@sleep2agi/agent-network-dashboard 0.1.0-preview.4 → 0.1.0-preview.6

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.
Files changed (142) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/diagnostics/route-bundle-stats.json +7 -7
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found.html +1 -1
  14. package/.next/server/app/_not-found.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  21. package/.next/server/app/admin.html +1 -1
  22. package/.next/server/app/admin.rsc +1 -1
  23. package/.next/server/app/admin.segments/_full.segment.rsc +1 -1
  24. package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
  25. package/.next/server/app/admin.segments/_index.segment.rsc +1 -1
  26. package/.next/server/app/admin.segments/_tree.segment.rsc +1 -1
  27. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +1 -1
  28. package/.next/server/app/admin.segments/admin.segment.rsc +1 -1
  29. package/.next/server/app/docs.html +1 -1
  30. package/.next/server/app/docs.rsc +1 -1
  31. package/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  32. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  33. package/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  34. package/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  35. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  36. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  37. package/.next/server/app/index.html +2 -2
  38. package/.next/server/app/index.rsc +2 -2
  39. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  40. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  41. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  42. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  43. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  44. package/.next/server/app/login.html +1 -1
  45. package/.next/server/app/login.rsc +1 -1
  46. package/.next/server/app/login.segments/_full.segment.rsc +1 -1
  47. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  48. package/.next/server/app/login.segments/_index.segment.rsc +1 -1
  49. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  50. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  51. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  52. package/.next/server/app/logs.html +1 -1
  53. package/.next/server/app/logs.rsc +1 -1
  54. package/.next/server/app/logs.segments/_full.segment.rsc +1 -1
  55. package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
  56. package/.next/server/app/logs.segments/_index.segment.rsc +1 -1
  57. package/.next/server/app/logs.segments/_tree.segment.rsc +1 -1
  58. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +1 -1
  59. package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
  60. package/.next/server/app/messages.html +1 -1
  61. package/.next/server/app/messages.rsc +1 -1
  62. package/.next/server/app/messages.segments/_full.segment.rsc +1 -1
  63. package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
  64. package/.next/server/app/messages.segments/_index.segment.rsc +1 -1
  65. package/.next/server/app/messages.segments/_tree.segment.rsc +1 -1
  66. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +1 -1
  67. package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
  68. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  69. package/.next/server/app/node.html +2 -2
  70. package/.next/server/app/node.rsc +2 -2
  71. package/.next/server/app/node.segments/_full.segment.rsc +2 -2
  72. package/.next/server/app/node.segments/_head.segment.rsc +1 -1
  73. package/.next/server/app/node.segments/_index.segment.rsc +1 -1
  74. package/.next/server/app/node.segments/_tree.segment.rsc +1 -1
  75. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +2 -2
  76. package/.next/server/app/node.segments/node.segment.rsc +1 -1
  77. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app/nodes.html +2 -2
  79. package/.next/server/app/nodes.rsc +2 -2
  80. package/.next/server/app/nodes.segments/_full.segment.rsc +2 -2
  81. package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
  82. package/.next/server/app/nodes.segments/_index.segment.rsc +1 -1
  83. package/.next/server/app/nodes.segments/_tree.segment.rsc +1 -1
  84. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +2 -2
  85. package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
  86. package/.next/server/app/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/settings/networks.html +1 -1
  88. package/.next/server/app/settings/networks.rsc +1 -1
  89. package/.next/server/app/settings/networks.segments/_full.segment.rsc +1 -1
  90. package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
  91. package/.next/server/app/settings/networks.segments/_index.segment.rsc +1 -1
  92. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +1 -1
  93. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
  94. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
  95. package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
  96. package/.next/server/app/settings/tokens.html +1 -1
  97. package/.next/server/app/settings/tokens.rsc +1 -1
  98. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +1 -1
  99. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
  100. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +1 -1
  101. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +1 -1
  102. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
  103. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
  104. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
  105. package/.next/server/app/settings.html +1 -1
  106. package/.next/server/app/settings.rsc +1 -1
  107. package/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  108. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  109. package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  110. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  111. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  112. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  113. package/.next/server/app/tasks.html +1 -1
  114. package/.next/server/app/tasks.rsc +1 -1
  115. package/.next/server/app/tasks.segments/_full.segment.rsc +1 -1
  116. package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
  117. package/.next/server/app/tasks.segments/_index.segment.rsc +1 -1
  118. package/.next/server/app/tasks.segments/_tree.segment.rsc +1 -1
  119. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +1 -1
  120. package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
  121. package/.next/server/chunks/ssr/_0s2kgzl._.js +1 -1
  122. package/.next/server/chunks/ssr/_0s2kgzl._.js.map +1 -1
  123. package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js +1 -1
  124. package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js.map +1 -1
  125. package/.next/server/middleware-build-manifest.js +3 -3
  126. package/.next/server/pages/404.html +1 -1
  127. package/.next/server/pages/500.html +1 -1
  128. package/.next/static/chunks/{0o~g2gtcm3~v5.js → 02w9ytw8eey3r.js} +1 -1
  129. package/.next/static/chunks/06f76ht~w6c6c.js +1 -0
  130. package/.next/static/chunks/0g5j6.4xxjqd3.js +1 -0
  131. package/.next/static/chunks/15cp_p75shcm9.js +1 -0
  132. package/.next/trace +2 -2
  133. package/.next/trace-build +1 -1
  134. package/app/components/TaskChatPanel.tsx +34 -17
  135. package/app/lib/useSSE.ts +23 -8
  136. package/package.json +1 -1
  137. package/.next/static/chunks/03qq_1ze1j3x_.js +0 -1
  138. package/.next/static/chunks/0e4dwg687ga5q.js +0 -1
  139. package/.next/static/chunks/0ga7wt1a18fpq.js +0 -1
  140. /package/.next/static/{lgag_dfMO-AGdtcyMHSLe → keZJjdNjrdbFuzwrc4g4c}/_buildManifest.js +0 -0
  141. /package/.next/static/{lgag_dfMO-AGdtcyMHSLe → keZJjdNjrdbFuzwrc4g4c}/_clientMiddlewareManifest.js +0 -0
  142. /package/.next/static/{lgag_dfMO-AGdtcyMHSLe → keZJjdNjrdbFuzwrc4g4c}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/styled-jsx/dist/index/index.js","../../../../node_modules/styled-jsx/style.js","../../../../app/components/TaskChatPanel.tsx"],"sourcesContent":["require('client-only');\nvar React = require('react');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\n\n/*\nBased on Glamor's sheet\nhttps://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js\n*/ function _defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\nvar isProd = typeof process !== \"undefined\" && process.env && process.env.NODE_ENV === \"production\";\nvar isString = function(o) {\n return Object.prototype.toString.call(o) === \"[object String]\";\n};\nvar StyleSheet = /*#__PURE__*/ function() {\n function StyleSheet(param) {\n var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? \"stylesheet\" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;\n invariant$1(isString(name), \"`name` must be a string\");\n this._name = name;\n this._deletedRulePlaceholder = \"#\" + name + \"-deleted-rule____{}\";\n invariant$1(typeof optimizeForSpeed === \"boolean\", \"`optimizeForSpeed` must be a boolean\");\n this._optimizeForSpeed = optimizeForSpeed;\n this._serverSheet = undefined;\n this._tags = [];\n this._injected = false;\n this._rulesCount = 0;\n var node = typeof window !== \"undefined\" && document.querySelector('meta[property=\"csp-nonce\"]');\n this._nonce = node ? node.getAttribute(\"content\") : null;\n }\n var _proto = StyleSheet.prototype;\n _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {\n invariant$1(typeof bool === \"boolean\", \"`setOptimizeForSpeed` accepts a boolean\");\n invariant$1(this._rulesCount === 0, \"optimizeForSpeed cannot be when rules have already been inserted\");\n this.flush();\n this._optimizeForSpeed = bool;\n this.inject();\n };\n _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {\n return this._optimizeForSpeed;\n };\n _proto.inject = function inject() {\n var _this = this;\n invariant$1(!this._injected, \"sheet already injected\");\n this._injected = true;\n if (typeof window !== \"undefined\" && this._optimizeForSpeed) {\n this._tags[0] = this.makeStyleTag(this._name);\n this._optimizeForSpeed = \"insertRule\" in this.getSheet();\n if (!this._optimizeForSpeed) {\n if (!isProd) {\n console.warn(\"StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.\");\n }\n this.flush();\n this._injected = true;\n }\n return;\n }\n this._serverSheet = {\n cssRules: [],\n insertRule: function(rule, index) {\n if (typeof index === \"number\") {\n _this._serverSheet.cssRules[index] = {\n cssText: rule\n };\n } else {\n _this._serverSheet.cssRules.push({\n cssText: rule\n });\n }\n return index;\n },\n deleteRule: function(index) {\n _this._serverSheet.cssRules[index] = null;\n }\n };\n };\n _proto.getSheetForTag = function getSheetForTag(tag) {\n if (tag.sheet) {\n return tag.sheet;\n }\n // this weirdness brought to you by firefox\n for(var i = 0; i < document.styleSheets.length; i++){\n if (document.styleSheets[i].ownerNode === tag) {\n return document.styleSheets[i];\n }\n }\n };\n _proto.getSheet = function getSheet() {\n return this.getSheetForTag(this._tags[this._tags.length - 1]);\n };\n _proto.insertRule = function insertRule(rule, index) {\n invariant$1(isString(rule), \"`insertRule` accepts only strings\");\n if (typeof window === \"undefined\") {\n if (typeof index !== \"number\") {\n index = this._serverSheet.cssRules.length;\n }\n this._serverSheet.insertRule(rule, index);\n return this._rulesCount++;\n }\n if (this._optimizeForSpeed) {\n var sheet = this.getSheet();\n if (typeof index !== \"number\") {\n index = sheet.cssRules.length;\n }\n // this weirdness for perf, and chrome's weird bug\n // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule\n try {\n sheet.insertRule(rule, index);\n } catch (error) {\n if (!isProd) {\n console.warn(\"StyleSheet: illegal rule: \\n\\n\" + rule + \"\\n\\nSee https://stackoverflow.com/q/20007992 for more info\");\n }\n return -1;\n }\n } else {\n var insertionPoint = this._tags[index];\n this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));\n }\n return this._rulesCount++;\n };\n _proto.replaceRule = function replaceRule(index, rule) {\n if (this._optimizeForSpeed || typeof window === \"undefined\") {\n var sheet = typeof window !== \"undefined\" ? this.getSheet() : this._serverSheet;\n if (!rule.trim()) {\n rule = this._deletedRulePlaceholder;\n }\n if (!sheet.cssRules[index]) {\n // @TBD Should we throw an error?\n return index;\n }\n sheet.deleteRule(index);\n try {\n sheet.insertRule(rule, index);\n } catch (error) {\n if (!isProd) {\n console.warn(\"StyleSheet: illegal rule: \\n\\n\" + rule + \"\\n\\nSee https://stackoverflow.com/q/20007992 for more info\");\n }\n // In order to preserve the indices we insert a deleteRulePlaceholder\n sheet.insertRule(this._deletedRulePlaceholder, index);\n }\n } else {\n var tag = this._tags[index];\n invariant$1(tag, \"old rule at index `\" + index + \"` not found\");\n tag.textContent = rule;\n }\n return index;\n };\n _proto.deleteRule = function deleteRule(index) {\n if (typeof window === \"undefined\") {\n this._serverSheet.deleteRule(index);\n return;\n }\n if (this._optimizeForSpeed) {\n this.replaceRule(index, \"\");\n } else {\n var tag = this._tags[index];\n invariant$1(tag, \"rule at index `\" + index + \"` not found\");\n tag.parentNode.removeChild(tag);\n this._tags[index] = null;\n }\n };\n _proto.flush = function flush() {\n this._injected = false;\n this._rulesCount = 0;\n if (typeof window !== \"undefined\") {\n this._tags.forEach(function(tag) {\n return tag && tag.parentNode.removeChild(tag);\n });\n this._tags = [];\n } else {\n // simpler on server\n this._serverSheet.cssRules = [];\n }\n };\n _proto.cssRules = function cssRules() {\n var _this = this;\n if (typeof window === \"undefined\") {\n return this._serverSheet.cssRules;\n }\n return this._tags.reduce(function(rules, tag) {\n if (tag) {\n rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {\n return rule.cssText === _this._deletedRulePlaceholder ? null : rule;\n }));\n } else {\n rules.push(null);\n }\n return rules;\n }, []);\n };\n _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {\n if (cssString) {\n invariant$1(isString(cssString), \"makeStyleTag accepts only strings as second parameter\");\n }\n var tag = document.createElement(\"style\");\n if (this._nonce) tag.setAttribute(\"nonce\", this._nonce);\n tag.type = \"text/css\";\n tag.setAttribute(\"data-\" + name, \"\");\n if (cssString) {\n tag.appendChild(document.createTextNode(cssString));\n }\n var head = document.head || document.getElementsByTagName(\"head\")[0];\n if (relativeToTag) {\n head.insertBefore(tag, relativeToTag);\n } else {\n head.appendChild(tag);\n }\n return tag;\n };\n _createClass(StyleSheet, [\n {\n key: \"length\",\n get: function get() {\n return this._rulesCount;\n }\n }\n ]);\n return StyleSheet;\n}();\nfunction invariant$1(condition, message) {\n if (!condition) {\n throw new Error(\"StyleSheet: \" + message + \".\");\n }\n}\n\nfunction hash(str) {\n var _$hash = 5381, i = str.length;\n while(i){\n _$hash = _$hash * 33 ^ str.charCodeAt(--i);\n }\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;\n}\nvar stringHash = hash;\n\nvar sanitize = function(rule) {\n return rule.replace(/\\/style/gi, \"\\\\/style\");\n};\nvar cache = {};\n/**\n * computeId\n *\n * Compute and memoize a jsx id from a basedId and optionally props.\n */ function computeId(baseId, props) {\n if (!props) {\n return \"jsx-\" + baseId;\n }\n var propsToString = String(props);\n var key = baseId + propsToString;\n if (!cache[key]) {\n cache[key] = \"jsx-\" + stringHash(baseId + \"-\" + propsToString);\n }\n return cache[key];\n}\n/**\n * computeSelector\n *\n * Compute and memoize dynamic selectors.\n */ function computeSelector(id, css) {\n var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;\n // Sanitize SSR-ed CSS.\n // Client side code doesn't need to be sanitized since we use\n // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).\n if (typeof window === \"undefined\") {\n css = sanitize(css);\n }\n var idcss = id + css;\n if (!cache[idcss]) {\n cache[idcss] = css.replace(selectoPlaceholderRegexp, id);\n }\n return cache[idcss];\n}\n\nfunction mapRulesToStyle(cssRules, options) {\n if (options === void 0) options = {};\n return cssRules.map(function(args) {\n var id = args[0];\n var css = args[1];\n return /*#__PURE__*/ React__default[\"default\"].createElement(\"style\", {\n id: \"__\" + id,\n // Avoid warnings upon render with a key\n key: \"__\" + id,\n nonce: options.nonce ? options.nonce : undefined,\n dangerouslySetInnerHTML: {\n __html: css\n }\n });\n });\n}\nvar StyleSheetRegistry = /*#__PURE__*/ function() {\n function StyleSheetRegistry(param) {\n var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;\n this._sheet = styleSheet || new StyleSheet({\n name: \"styled-jsx\",\n optimizeForSpeed: optimizeForSpeed\n });\n this._sheet.inject();\n if (styleSheet && typeof optimizeForSpeed === \"boolean\") {\n this._sheet.setOptimizeForSpeed(optimizeForSpeed);\n this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();\n }\n this._fromServer = undefined;\n this._indices = {};\n this._instancesCounts = {};\n }\n var _proto = StyleSheetRegistry.prototype;\n _proto.add = function add(props) {\n var _this = this;\n if (undefined === this._optimizeForSpeed) {\n this._optimizeForSpeed = Array.isArray(props.children);\n this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);\n this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();\n }\n if (typeof window !== \"undefined\" && !this._fromServer) {\n this._fromServer = this.selectFromServer();\n this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {\n acc[tagName] = 0;\n return acc;\n }, {});\n }\n var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;\n // Deduping: just increase the instances count.\n if (styleId in this._instancesCounts) {\n this._instancesCounts[styleId] += 1;\n return;\n }\n var indices = rules.map(function(rule) {\n return _this._sheet.insertRule(rule);\n })// Filter out invalid rules\n .filter(function(index) {\n return index !== -1;\n });\n this._indices[styleId] = indices;\n this._instancesCounts[styleId] = 1;\n };\n _proto.remove = function remove(props) {\n var _this = this;\n var styleId = this.getIdAndRules(props).styleId;\n invariant(styleId in this._instancesCounts, \"styleId: `\" + styleId + \"` not found\");\n this._instancesCounts[styleId] -= 1;\n if (this._instancesCounts[styleId] < 1) {\n var tagFromServer = this._fromServer && this._fromServer[styleId];\n if (tagFromServer) {\n tagFromServer.parentNode.removeChild(tagFromServer);\n delete this._fromServer[styleId];\n } else {\n this._indices[styleId].forEach(function(index) {\n return _this._sheet.deleteRule(index);\n });\n delete this._indices[styleId];\n }\n delete this._instancesCounts[styleId];\n }\n };\n _proto.update = function update(props, nextProps) {\n this.add(nextProps);\n this.remove(props);\n };\n _proto.flush = function flush() {\n this._sheet.flush();\n this._sheet.inject();\n this._fromServer = undefined;\n this._indices = {};\n this._instancesCounts = {};\n };\n _proto.cssRules = function cssRules() {\n var _this = this;\n var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {\n return [\n styleId,\n _this._fromServer[styleId]\n ];\n }) : [];\n var cssRules = this._sheet.cssRules();\n return fromServer.concat(Object.keys(this._indices).map(function(styleId) {\n return [\n styleId,\n _this._indices[styleId].map(function(index) {\n return cssRules[index].cssText;\n }).join(_this._optimizeForSpeed ? \"\" : \"\\n\")\n ];\n })// filter out empty rules\n .filter(function(rule) {\n return Boolean(rule[1]);\n }));\n };\n _proto.styles = function styles(options) {\n return mapRulesToStyle(this.cssRules(), options);\n };\n _proto.getIdAndRules = function getIdAndRules(props) {\n var css = props.children, dynamic = props.dynamic, id = props.id;\n if (dynamic) {\n var styleId = computeId(id, dynamic);\n return {\n styleId: styleId,\n rules: Array.isArray(css) ? css.map(function(rule) {\n return computeSelector(styleId, rule);\n }) : [\n computeSelector(styleId, css)\n ]\n };\n }\n return {\n styleId: computeId(id),\n rules: Array.isArray(css) ? css : [\n css\n ]\n };\n };\n /**\n * selectFromServer\n *\n * Collects style tags from the document with id __jsx-XXX\n */ _proto.selectFromServer = function selectFromServer() {\n var elements = Array.prototype.slice.call(document.querySelectorAll('[id^=\"__jsx-\"]'));\n return elements.reduce(function(acc, element) {\n var id = element.id.slice(2);\n acc[id] = element;\n return acc;\n }, {});\n };\n return StyleSheetRegistry;\n}();\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(\"StyleSheetRegistry: \" + message + \".\");\n }\n}\nvar StyleSheetContext = /*#__PURE__*/ React.createContext(null);\nStyleSheetContext.displayName = \"StyleSheetContext\";\nfunction createStyleRegistry() {\n return new StyleSheetRegistry();\n}\nfunction StyleRegistry(param) {\n var configuredRegistry = param.registry, children = param.children;\n var rootRegistry = React.useContext(StyleSheetContext);\n var ref = React.useState(function() {\n return rootRegistry || configuredRegistry || createStyleRegistry();\n }), registry = ref[0];\n return /*#__PURE__*/ React__default[\"default\"].createElement(StyleSheetContext.Provider, {\n value: registry\n }, children);\n}\nfunction useStyleRegistry() {\n return React.useContext(StyleSheetContext);\n}\n\n// Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.\n// https://github.com/reactwg/react-18/discussions/110\nvar useInsertionEffect = React__default[\"default\"].useInsertionEffect || React__default[\"default\"].useLayoutEffect;\nvar defaultRegistry = typeof window !== \"undefined\" ? createStyleRegistry() : undefined;\nfunction JSXStyle(props) {\n var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();\n // If `registry` does not exist, we do nothing here.\n if (!registry) {\n return null;\n }\n if (typeof window === \"undefined\") {\n registry.add(props);\n return null;\n }\n useInsertionEffect(function() {\n registry.add(props);\n return function() {\n registry.remove(props);\n };\n // props.children can be string[], will be striped since id is identical\n }, [\n props.id,\n String(props.dynamic)\n ]);\n return null;\n}\nJSXStyle.dynamic = function(info) {\n return info.map(function(tagInfo) {\n var baseId = tagInfo[0];\n var props = tagInfo[1];\n return computeId(baseId, props);\n }).join(\" \");\n};\n\nexports.StyleRegistry = StyleRegistry;\nexports.createStyleRegistry = createStyleRegistry;\nexports.style = JSXStyle;\nexports.useStyleRegistry = useStyleRegistry;\n","module.exports = require('./dist/index').style\n","'use client';\n\nimport { useState, useEffect, useRef, useCallback } from 'react';\nimport { timeAgo } from './utils';\n\ninterface ChatTask {\n task_id: string;\n from_name: string;\n to_name: string;\n status: string;\n priority: string;\n content: string;\n result: string;\n created_at: string;\n}\n\nconst STATUS_STEPS = ['created', 'delivered', 'running', 'replied'];\nconst STATUS_COLORS: Record<string, string> = {\n created: 'bg-gray-400', delivered: 'bg-blue-400', running: 'bg-green-400',\n replied: 'bg-purple-400', failed: 'bg-red-400', closed: 'bg-gray-500',\n};\n\nfunction StatusBar({ status }: { status: string }) {\n const idx = STATUS_STEPS.indexOf(status);\n const isFailed = status === 'failed';\n return (\n <div className=\"flex items-center gap-1 mt-1.5\">\n {STATUS_STEPS.map((s, i) => (\n <div key={s} className=\"flex items-center gap-1\">\n <div className={`w-2 h-2 rounded-full transition-all duration-700 ${\n isFailed ? (i === 0 ? 'bg-red-400' : 'bg-gray-700')\n : i <= idx ? (STATUS_COLORS[s] || 'bg-gray-600') : 'bg-gray-700'\n }`} />\n {i < STATUS_STEPS.length - 1 && (\n <div className={`w-4 h-px transition-colors duration-700 ${\n isFailed ? 'bg-red-800' : i < idx ? 'bg-gray-500' : 'bg-gray-800'\n }`} />\n )}\n </div>\n ))}\n <span className={`text-[10px] ml-1.5 font-medium ${\n isFailed ? 'text-red-400' : status === 'replied' ? 'text-purple-400'\n : status === 'running' ? 'text-green-400' : 'text-gray-500'\n }`}>{status}</span>\n {(status === 'running' || status === 'delivered') && (\n <span className=\"ml-1\">\n <span className=\"inline-block w-1 h-1 rounded-full bg-green-400 animate-pulse\" />\n <span className=\"inline-block w-1 h-1 rounded-full bg-green-400 animate-pulse ml-0.5\" style={{ animationDelay: '0.2s' }} />\n <span className=\"inline-block w-1 h-1 rounded-full bg-green-400 animate-pulse ml-0.5\" style={{ animationDelay: '0.4s' }} />\n </span>\n )}\n </div>\n );\n}\n\nfunction MarkdownContent({ text }: { text: string }) {\n if (!text) return <span className=\"text-gray-600 italic\">No content</span>;\n\n const parts = text.split(/(```[\\s\\S]*?```|`[^`\\n]+`|\\*\\*[^*]+\\*\\*)/g);\n return (\n <div className=\"whitespace-pre-wrap break-words leading-relaxed\">\n {parts.map((part, i) => {\n if (part.startsWith('```') && part.endsWith('```')) {\n const lines = part.slice(3, -3);\n const lang = lines.match(/^(\\w+)\\n/)?.[1] || '';\n const code = lang ? lines.slice(lang.length + 1) : lines;\n return (\n <div key={i} className=\"my-2 rounded-lg overflow-hidden border border-[#1a1a2a]\">\n {lang && <div className=\"bg-[#0a0a15] px-3 py-1 text-[10px] text-gray-500 border-b border-[#1a1a2a]\">{lang}</div>}\n <pre className=\"bg-[#050510] px-3 py-2 text-[11px] text-green-300 overflow-x-auto\">{code}</pre>\n </div>\n );\n }\n if (part.startsWith('`') && part.endsWith('`')) {\n return <code key={i} className=\"bg-[#0a0a15] rounded px-1.5 py-0.5 text-cyan-300 text-[11px] border border-[#1a1a2a]\">{part.slice(1, -1)}</code>;\n }\n if (part.startsWith('**') && part.endsWith('**')) {\n return <strong key={i} className=\"text-white font-semibold\">{part.slice(2, -2)}</strong>;\n }\n return <span key={i}>{part}</span>;\n })}\n </div>\n );\n}\n\ninterface TaskChatPanelProps {\n alias: string;\n onClose: () => void;\n /** When true, renders without outer panel chrome (for use inside CommandCenter) */\n inline?: boolean;\n /** Available nodes for @ mention */\n availableNodes?: string[];\n}\n\nexport function TaskChatPanel({ alias, onClose, inline, availableNodes }: TaskChatPanelProps) {\n const [messages, setMessages] = useState<ChatTask[]>([]);\n const [input, setInput] = useState('');\n const [priority, setPriority] = useState('normal');\n const [sending, setSending] = useState(false);\n const [pollingIds, setPollingIds] = useState<Set<string>>(new Set());\n const [historyLoaded, setHistoryLoaded] = useState(false);\n const [targetAlias, setTargetAlias] = useState(alias);\n const [showMentions, setShowMentions] = useState(false);\n const [mentionFilter, setMentionFilter] = useState('');\n const [mentionNodes, setMentionNodes] = useState<string[]>([]);\n const messagesEndRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n // Load available nodes for @ mention\n useEffect(() => {\n if (availableNodes) { setMentionNodes(availableNodes); return; }\n fetch('/api/hub/status').then(r => r.json()).then(d => {\n const nodes = (d.sessions || []).filter((s: { status: string }) => s.status !== 'offline').map((s: { alias: string }) => s.alias);\n setMentionNodes(nodes);\n }).catch(() => {});\n }, [availableNodes]);\n\n // Reset target when alias changes\n useEffect(() => { setTargetAlias(alias); }, [alias]);\n\n // Load task history for this node\n const loadHistory = useCallback(async () => {\n try {\n const res = await fetch(`/api/hub/tasks?to_name=${encodeURIComponent(alias)}&limit=30`);\n const data = await res.json();\n if (data.tasks) {\n // Show oldest first\n setMessages(data.tasks.reverse());\n }\n } catch {} finally {\n setHistoryLoaded(true);\n }\n }, [alias]);\n\n useEffect(() => {\n setMessages([]);\n setHistoryLoaded(false);\n loadHistory();\n // Focus textarea\n setTimeout(() => textareaRef.current?.focus(), 300);\n }, [alias, loadHistory]);\n\n // Auto-scroll to bottom\n useEffect(() => {\n messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });\n }, [messages]);\n\n // Poll pending tasks for status updates\n useEffect(() => {\n if (pollingIds.size === 0) return;\n const startTime = Date.now();\n const interval = setInterval(async () => {\n // Timeout after 120s\n if (Date.now() - startTime > 120000) {\n setPollingIds(new Set());\n clearInterval(interval);\n return;\n }\n for (const taskId of pollingIds) {\n try {\n const res = await fetch(`/api/hub/tasks?task_id=${encodeURIComponent(taskId)}`);\n const data = await res.json();\n if (data.tasks?.[0]) {\n const updated = data.tasks[0];\n setMessages(prev => prev.map(m => m.task_id === taskId ? { ...m, ...updated } : m));\n if (['replied', 'failed', 'closed', 'expired', 'cancelled'].includes(updated.status)) {\n setPollingIds(prev => { const n = new Set(prev); n.delete(taskId); return n; });\n }\n }\n } catch {}\n }\n }, 2000);\n return () => clearInterval(interval);\n }, [pollingIds]);\n\n const send = async () => {\n if (!input.trim() || sending) return;\n let taskContent = input.trim();\n let sendTo = targetAlias;\n\n // Parse @mention at start: \"@NodeName rest of message\"\n const atMatch = taskContent.match(/^@(\\S+)\\s+([\\s\\S]+)/);\n if (atMatch) {\n const mentioned = mentionNodes.find(n => n.toLowerCase() === atMatch[1].toLowerCase());\n if (mentioned) {\n sendTo = mentioned;\n taskContent = atMatch[2];\n }\n }\n\n setSending(true);\n setInput('');\n setShowMentions(false);\n if (textareaRef.current) textareaRef.current.style.height = 'auto';\n\n try {\n const res = await fetch('/api/hub/send', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ alias: sendTo, task: taskContent, priority }),\n });\n const data = await res.json();\n if (data.ok) {\n const newMsg: ChatTask = {\n task_id: data.message_id || `tmp-${Date.now()}`,\n from_name: 'Dashboard',\n to_name: sendTo,\n status: 'created',\n priority,\n content: taskContent,\n result: '',\n created_at: new Date().toISOString(),\n };\n setMessages(prev => [...prev, newMsg]);\n if (data.message_id) {\n setPollingIds(prev => new Set(prev).add(data.message_id));\n }\n }\n } catch {}\n setSending(false);\n textareaRef.current?.focus();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n // Enter sends, Shift+Enter inserts newline (standard chat UX).\n // Users habit-pressed Enter expecting send and saw nothing happen.\n if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {\n e.preventDefault();\n send();\n }\n if (e.key === 'Escape') setShowMentions(false);\n };\n\n const handleInputChange = (value: string) => {\n setInput(value);\n // Check if user just typed @\n const lastAt = value.lastIndexOf('@');\n if (lastAt >= 0 && (lastAt === 0 || value[lastAt - 1] === ' ' || value[lastAt - 1] === '\\n')) {\n const after = value.slice(lastAt + 1);\n if (!after.includes(' ') && !after.includes('\\n')) {\n setMentionFilter(after.toLowerCase());\n setShowMentions(true);\n return;\n }\n }\n setShowMentions(false);\n };\n\n const insertMention = (nodeName: string) => {\n const lastAt = input.lastIndexOf('@');\n const before = input.slice(0, lastAt);\n setInput(`${before}@${nodeName} `);\n setShowMentions(false);\n textareaRef.current?.focus();\n };\n\n const filteredMentions = mentionNodes.filter(n =>\n n !== alias && n.toLowerCase().includes(mentionFilter)\n ).slice(0, 8);\n\n const autoResize = (el: HTMLTextAreaElement) => {\n el.style.height = 'auto';\n el.style.height = Math.min(el.scrollHeight, 150) + 'px';\n };\n\n // Inline mode: just the chat content, no panel chrome\n const chatContent = (\n <>\n {/* Messages area */}\n <div className=\"flex-1 overflow-y-auto px-4 py-4 space-y-4\">\n {!historyLoaded && (\n <div className=\"flex justify-center py-8\">\n <div className=\"w-5 h-5 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin\" />\n </div>\n )}\n {historyLoaded && messages.length === 0 && (\n <div className=\"text-center py-12\">\n <div className=\"text-3xl mb-3\">💬</div>\n <div className=\"text-gray-500 text-sm\">Start a conversation</div>\n <div className=\"text-gray-600 text-xs mt-1\">Send a task to {alias}</div>\n </div>\n )}\n\n {messages.map((m, idx) => (\n <div key={m.task_id} className=\"space-y-2\">\n {/* Outgoing task */}\n <div className=\"flex justify-end\">\n <div className=\"max-w-[85%] bg-cyan-500/8 border border-cyan-500/15 rounded-2xl rounded-br-md px-4 py-2.5 shadow-sm\">\n <div className=\"text-[13px] text-gray-200\">\n <MarkdownContent text={m.content} />\n </div>\n <div className=\"flex items-center justify-between mt-1.5 gap-3\">\n <StatusBar status={m.status} />\n <span className=\"text-[9px] text-gray-600 shrink-0\">{timeAgo(m.created_at)}</span>\n </div>\n </div>\n </div>\n\n {/* Incoming reply */}\n {m.result && (\n <div className=\"flex justify-start\">\n <div className=\"max-w-[85%] bg-green-500/8 border border-green-500/15 rounded-2xl rounded-bl-md px-4 py-2.5 shadow-sm\">\n <div className=\"text-[10px] text-green-400 font-medium mb-1.5\">{m.to_name}</div>\n <div className=\"text-[13px] text-gray-200\">\n <MarkdownContent text={m.result} />\n </div>\n </div>\n </div>\n )}\n\n {/* Typing indicator when running */}\n {m.status === 'running' && !m.result && (\n <div className=\"flex justify-start\">\n <div className=\"bg-[#111128] border border-[#2a2a4a] rounded-2xl rounded-bl-md px-4 py-3\">\n <div className=\"flex gap-1\">\n <span className=\"w-2 h-2 rounded-full bg-gray-500 animate-bounce\" style={{ animationDelay: '0s' }} />\n <span className=\"w-2 h-2 rounded-full bg-gray-500 animate-bounce\" style={{ animationDelay: '0.15s' }} />\n <span className=\"w-2 h-2 rounded-full bg-gray-500 animate-bounce\" style={{ animationDelay: '0.3s' }} />\n </div>\n </div>\n </div>\n )}\n </div>\n ))}\n <div ref={messagesEndRef} />\n </div>\n\n {/* Input area */}\n <div className=\"border-t border-[#2a2a4a] bg-[#0d0d1a] px-4 py-3\">\n <div className=\"flex items-end gap-2\">\n <div className=\"flex-1 relative\">\n {/* @ mention dropdown */}\n {showMentions && filteredMentions.length > 0 && (\n <div className=\"absolute bottom-full left-0 right-0 mb-1 bg-[#111128] border border-[#2a2a4a] rounded-lg shadow-xl shadow-black/50 overflow-hidden z-10 max-h-48 overflow-y-auto\">\n {filteredMentions.map(node => (\n <button key={node} onClick={() => insertMention(node)}\n className=\"w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-cyan-500/10 transition-colors\">\n <span className=\"w-2 h-2 rounded-full bg-cyan-400 shrink-0\" />\n <span className=\"text-gray-300\">{node}</span>\n </button>\n ))}\n </div>\n )}\n <textarea\n ref={textareaRef}\n value={input}\n onChange={e => { handleInputChange(e.target.value); autoResize(e.target); }}\n onKeyDown={handleKeyDown}\n placeholder={`Message ${alias}...`}\n rows={1}\n className=\"w-full bg-[#111128] border border-[#2a2a4a] rounded-xl px-4 py-2.5 pr-16 text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none resize-none transition-colors\"\n />\n <div className=\"absolute right-2 bottom-1.5 flex items-center gap-1\">\n <select value={priority} onChange={e => setPriority(e.target.value)}\n className=\"bg-transparent text-[9px] text-gray-600 focus:outline-none cursor-pointer\">\n <option value=\"normal\">N</option>\n <option value=\"high\">H</option>\n <option value=\"low\">L</option>\n </select>\n </div>\n </div>\n <button onClick={send} disabled={sending || !input.trim()}\n className=\"p-2.5 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white rounded-xl transition-all shrink-0 active:scale-95\">\n {sending ? (\n <div className=\"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin\" />\n ) : (\n <svg className=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5\" />\n </svg>\n )}\n </button>\n </div>\n <div className=\"flex justify-between text-[9px] text-gray-700 mt-1.5\">\n <span>{input.includes('@') ? `Sending to: ${targetAlias}` : `Type @ to mention another node`}</span>\n <span>Enter to send · Shift+Enter for newline</span>\n </div>\n </div>\n </>\n );\n\n if (inline) {\n return <div className=\"flex flex-col h-full\">{chatContent}</div>;\n }\n\n return (\n <>\n <div className=\"fixed inset-0 bg-black/30 z-40 lg:hidden\" onClick={onClose} />\n <div className=\"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\">\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-[#2a2a4a] bg-[#0d0d1a]\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500/30 to-blue-500/30 flex items-center justify-center text-xs font-bold text-cyan-300\">\n {alias.slice(0, 2)}\n </div>\n <div>\n <div className=\"text-sm font-semibold text-white\">{alias}</div>\n <div className=\"text-[10px] text-gray-500\">{pollingIds.size > 0 ? 'Processing...' : 'Ready'}</div>\n </div>\n </div>\n <button onClick={onClose} className=\"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]\">\n <svg className=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n {chatContent}\n </div>\n <style jsx global>{`\n @keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }\n .animate-slide-in { animation: slide-in 0.2s ease-out; }\n `}</style>\n </>\n );\n}\n"],"names":["React","_interopDefaultLegacy","e","React__default","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_createClass","Constructor","protoProps","staticProps","prototype","isProd","process","env","isString","o","toString","call","StyleSheet","param","ref","_name","name","_optimizeForSpeed","optimizeForSpeed","invariant$1","_deletedRulePlaceholder","_serverSheet","undefined","_tags","_injected","_rulesCount","node","document","querySelector","_nonce","_proto","setOptimizeForSpeed","bool","flush","inject","isOptimizeForSpeed","_this","cssRules","insertRule","rule","index","cssText","push","deleteRule","getSheetForTag","tag","sheet","styleSheets","ownerNode","getSheet","insertionPoint","replaceRule","trim","error","console","warn","makeStyleTag","cssString","relativeToTag","createElement","setAttribute","type","appendChild","createTextNode","head","getElementsByTagName","insertBefore","get","condition","message","Error","hash","str","_$hash","charCodeAt","stringHash","sanitize","replace","cache","computeId","baseId","propsToString","String","computeSelector","id","css","selectoPlaceholderRegexp","idcss","mapRulesToStyle","options","map","args","nonce","dangerouslySetInnerHTML","__html","StyleSheetRegistry","_styleSheet","styleSheet","_sheet","_fromServer","_indices","_instancesCounts","add","Array","isArray","children","getIdAndRules","styleId","rules","indices","filter","remove","invariant","tagFromServer","parentNode","removeChild","forEach","update","nextProps","fromServer","keys","concat","join","Boolean","styles","dynamic","selectFromServer","elements","slice","querySelectorAll","reduce","acc","element","StyleSheetContext","createContext","displayName","createStyleRegistry","StyleRegistry","configuredRegistry","registry","rootRegistry","useContext","useState","Provider","value","useStyleRegistry","useInsertionEffect","useLayoutEffect","defaultRegistry","JSXStyle","info","tagInfo","exports","style","module","STATUS_STEPS","STATUS_COLORS","created","delivered","running","replied","failed","closed","StatusBar","status","idx","indexOf","isFailed","className","s","animationDelay","MarkdownContent","text","parts","split","part","startsWith","endsWith","lines","lang","match","code","TaskChatPanel","alias","onClose","inline","availableNodes","messages","setMessages","input","setInput","priority","setPriority","sending","setSending","pollingIds","setPollingIds","Set","historyLoaded","setHistoryLoaded","targetAlias","setTargetAlias","showMentions","setShowMentions","mentionFilter","setMentionFilter","mentionNodes","setMentionNodes","messagesEndRef","textareaRef","fetch","then","r","json","d","nodes","sessions","catch","loadHistory","res","encodeURIComponent","data","tasks","reverse","setTimeout","current","focus","scrollIntoView","behavior","size","startTime","Date","now","interval","setInterval","clearInterval","taskId","updated","prev","m","task_id","includes","n","delete","send","taskContent","sendTo","atMatch","mentioned","find","toLowerCase","height","method","headers","body","JSON","stringify","task","ok","newMsg","message_id","from_name","to_name","content","result","created_at","toISOString","handleKeyDown","shiftKey","nativeEvent","isComposing","preventDefault","handleInputChange","lastAt","lastIndexOf","after","insertMention","nodeName","before","filteredMentions","autoResize","el","Math","min","scrollHeight","chatContent","onClick","onChange","onKeyDown","placeholder","rows","disabled","fill","viewBox","stroke","strokeWidth","strokeLinecap","strokeLinejoin"],"mappings":"6DACA,IAAIA,EAAAA,EAAAA,CAAAA,CAAAA,OAIAG,EAFwCD,GAAkB,AAAb,OAAOA,KAEnC,KAAmCF,GAFkB,GAE1C,GAAEC,OAFqDC,GAAQ,CAAJA,AAAM,SAAa,EAqB1GmB,AArBwGnB,EAqB5E,IAAnB,OAAOoB,SAA2BA,QAAQC,GAAG,GAAI,EAC1DC,EAAW,SAASC,CAAC,EACrB,MAA6C,oBAAtCZ,OAAOO,EAFqE,OAE5D,CAACM,QAAQ,CAACC,IAAI,CAACF,EAC1C,EACIG,EAA2B,WAAd,AACb,SAASA,EADe,AACJC,CAAK,EACrB,IAAIC,EAAgB,KAAK,IAAfD,EAAmB,CAAC,EAAIA,EAAOE,EAAQD,EAAIE,IAAI,CAAEA,EAAiB,KAAK,IAAfD,EAAmB,aAAeA,EAAOE,EAAoBH,EAAII,gBAAgB,CAAEA,EAAyC,KAAK,IAA3BD,EAA+BZ,EAASY,EAChNE,EAAYX,EAASQ,GAAO,2BAC5B,IAAI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A,CADG,EACH,EAAC,MAAA,CAAIjB,UAAU,gCAAwBqH,IAI9C,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,QAAA,CAAA,WACE,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAyDC,QAAStG,0CAApD,mCACf,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,yCAAc,uJAEb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,yCAAc,qFACb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,yCAAc,0BACb,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,yCAAc,yIACZD,EAAMvD,KAAK,CAAC,EAAG,KAElB,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,2CACC,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,yCAAc,kCAAoCuD,IACnD,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,yCAAc,2BAA6BY,EAAWkC,IAAI,CAAG,EAAI,gBAAkB,gBAGxF,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CAAOyD,QAAStG,0CAAmB,oEAClC,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAwB4G,KAAK,OAAOC,QAAQ,YAAYC,OAAO,eAAeC,YAAa,0CAA7E,SACb,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAKC,cAAc,QAAQC,eAAe,QAAQnF,EAAE,gEAI1DuE,6LAQT","ignoreList":[0,1]}
1
+ {"version":3,"sources":["../../../../node_modules/styled-jsx/dist/index/index.js","../../../../node_modules/styled-jsx/style.js","../../../../app/components/TaskChatPanel.tsx"],"sourcesContent":["require('client-only');\nvar React = require('react');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\n\n/*\nBased on Glamor's sheet\nhttps://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js\n*/ function _defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\nvar isProd = typeof process !== \"undefined\" && process.env && process.env.NODE_ENV === \"production\";\nvar isString = function(o) {\n return Object.prototype.toString.call(o) === \"[object String]\";\n};\nvar StyleSheet = /*#__PURE__*/ function() {\n function StyleSheet(param) {\n var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? \"stylesheet\" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;\n invariant$1(isString(name), \"`name` must be a string\");\n this._name = name;\n this._deletedRulePlaceholder = \"#\" + name + \"-deleted-rule____{}\";\n invariant$1(typeof optimizeForSpeed === \"boolean\", \"`optimizeForSpeed` must be a boolean\");\n this._optimizeForSpeed = optimizeForSpeed;\n this._serverSheet = undefined;\n this._tags = [];\n this._injected = false;\n this._rulesCount = 0;\n var node = typeof window !== \"undefined\" && document.querySelector('meta[property=\"csp-nonce\"]');\n this._nonce = node ? node.getAttribute(\"content\") : null;\n }\n var _proto = StyleSheet.prototype;\n _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {\n invariant$1(typeof bool === \"boolean\", \"`setOptimizeForSpeed` accepts a boolean\");\n invariant$1(this._rulesCount === 0, \"optimizeForSpeed cannot be when rules have already been inserted\");\n this.flush();\n this._optimizeForSpeed = bool;\n this.inject();\n };\n _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {\n return this._optimizeForSpeed;\n };\n _proto.inject = function inject() {\n var _this = this;\n invariant$1(!this._injected, \"sheet already injected\");\n this._injected = true;\n if (typeof window !== \"undefined\" && this._optimizeForSpeed) {\n this._tags[0] = this.makeStyleTag(this._name);\n this._optimizeForSpeed = \"insertRule\" in this.getSheet();\n if (!this._optimizeForSpeed) {\n if (!isProd) {\n console.warn(\"StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.\");\n }\n this.flush();\n this._injected = true;\n }\n return;\n }\n this._serverSheet = {\n cssRules: [],\n insertRule: function(rule, index) {\n if (typeof index === \"number\") {\n _this._serverSheet.cssRules[index] = {\n cssText: rule\n };\n } else {\n _this._serverSheet.cssRules.push({\n cssText: rule\n });\n }\n return index;\n },\n deleteRule: function(index) {\n _this._serverSheet.cssRules[index] = null;\n }\n };\n };\n _proto.getSheetForTag = function getSheetForTag(tag) {\n if (tag.sheet) {\n return tag.sheet;\n }\n // this weirdness brought to you by firefox\n for(var i = 0; i < document.styleSheets.length; i++){\n if (document.styleSheets[i].ownerNode === tag) {\n return document.styleSheets[i];\n }\n }\n };\n _proto.getSheet = function getSheet() {\n return this.getSheetForTag(this._tags[this._tags.length - 1]);\n };\n _proto.insertRule = function insertRule(rule, index) {\n invariant$1(isString(rule), \"`insertRule` accepts only strings\");\n if (typeof window === \"undefined\") {\n if (typeof index !== \"number\") {\n index = this._serverSheet.cssRules.length;\n }\n this._serverSheet.insertRule(rule, index);\n return this._rulesCount++;\n }\n if (this._optimizeForSpeed) {\n var sheet = this.getSheet();\n if (typeof index !== \"number\") {\n index = sheet.cssRules.length;\n }\n // this weirdness for perf, and chrome's weird bug\n // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule\n try {\n sheet.insertRule(rule, index);\n } catch (error) {\n if (!isProd) {\n console.warn(\"StyleSheet: illegal rule: \\n\\n\" + rule + \"\\n\\nSee https://stackoverflow.com/q/20007992 for more info\");\n }\n return -1;\n }\n } else {\n var insertionPoint = this._tags[index];\n this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));\n }\n return this._rulesCount++;\n };\n _proto.replaceRule = function replaceRule(index, rule) {\n if (this._optimizeForSpeed || typeof window === \"undefined\") {\n var sheet = typeof window !== \"undefined\" ? this.getSheet() : this._serverSheet;\n if (!rule.trim()) {\n rule = this._deletedRulePlaceholder;\n }\n if (!sheet.cssRules[index]) {\n // @TBD Should we throw an error?\n return index;\n }\n sheet.deleteRule(index);\n try {\n sheet.insertRule(rule, index);\n } catch (error) {\n if (!isProd) {\n console.warn(\"StyleSheet: illegal rule: \\n\\n\" + rule + \"\\n\\nSee https://stackoverflow.com/q/20007992 for more info\");\n }\n // In order to preserve the indices we insert a deleteRulePlaceholder\n sheet.insertRule(this._deletedRulePlaceholder, index);\n }\n } else {\n var tag = this._tags[index];\n invariant$1(tag, \"old rule at index `\" + index + \"` not found\");\n tag.textContent = rule;\n }\n return index;\n };\n _proto.deleteRule = function deleteRule(index) {\n if (typeof window === \"undefined\") {\n this._serverSheet.deleteRule(index);\n return;\n }\n if (this._optimizeForSpeed) {\n this.replaceRule(index, \"\");\n } else {\n var tag = this._tags[index];\n invariant$1(tag, \"rule at index `\" + index + \"` not found\");\n tag.parentNode.removeChild(tag);\n this._tags[index] = null;\n }\n };\n _proto.flush = function flush() {\n this._injected = false;\n this._rulesCount = 0;\n if (typeof window !== \"undefined\") {\n this._tags.forEach(function(tag) {\n return tag && tag.parentNode.removeChild(tag);\n });\n this._tags = [];\n } else {\n // simpler on server\n this._serverSheet.cssRules = [];\n }\n };\n _proto.cssRules = function cssRules() {\n var _this = this;\n if (typeof window === \"undefined\") {\n return this._serverSheet.cssRules;\n }\n return this._tags.reduce(function(rules, tag) {\n if (tag) {\n rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {\n return rule.cssText === _this._deletedRulePlaceholder ? null : rule;\n }));\n } else {\n rules.push(null);\n }\n return rules;\n }, []);\n };\n _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {\n if (cssString) {\n invariant$1(isString(cssString), \"makeStyleTag accepts only strings as second parameter\");\n }\n var tag = document.createElement(\"style\");\n if (this._nonce) tag.setAttribute(\"nonce\", this._nonce);\n tag.type = \"text/css\";\n tag.setAttribute(\"data-\" + name, \"\");\n if (cssString) {\n tag.appendChild(document.createTextNode(cssString));\n }\n var head = document.head || document.getElementsByTagName(\"head\")[0];\n if (relativeToTag) {\n head.insertBefore(tag, relativeToTag);\n } else {\n head.appendChild(tag);\n }\n return tag;\n };\n _createClass(StyleSheet, [\n {\n key: \"length\",\n get: function get() {\n return this._rulesCount;\n }\n }\n ]);\n return StyleSheet;\n}();\nfunction invariant$1(condition, message) {\n if (!condition) {\n throw new Error(\"StyleSheet: \" + message + \".\");\n }\n}\n\nfunction hash(str) {\n var _$hash = 5381, i = str.length;\n while(i){\n _$hash = _$hash * 33 ^ str.charCodeAt(--i);\n }\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;\n}\nvar stringHash = hash;\n\nvar sanitize = function(rule) {\n return rule.replace(/\\/style/gi, \"\\\\/style\");\n};\nvar cache = {};\n/**\n * computeId\n *\n * Compute and memoize a jsx id from a basedId and optionally props.\n */ function computeId(baseId, props) {\n if (!props) {\n return \"jsx-\" + baseId;\n }\n var propsToString = String(props);\n var key = baseId + propsToString;\n if (!cache[key]) {\n cache[key] = \"jsx-\" + stringHash(baseId + \"-\" + propsToString);\n }\n return cache[key];\n}\n/**\n * computeSelector\n *\n * Compute and memoize dynamic selectors.\n */ function computeSelector(id, css) {\n var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;\n // Sanitize SSR-ed CSS.\n // Client side code doesn't need to be sanitized since we use\n // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).\n if (typeof window === \"undefined\") {\n css = sanitize(css);\n }\n var idcss = id + css;\n if (!cache[idcss]) {\n cache[idcss] = css.replace(selectoPlaceholderRegexp, id);\n }\n return cache[idcss];\n}\n\nfunction mapRulesToStyle(cssRules, options) {\n if (options === void 0) options = {};\n return cssRules.map(function(args) {\n var id = args[0];\n var css = args[1];\n return /*#__PURE__*/ React__default[\"default\"].createElement(\"style\", {\n id: \"__\" + id,\n // Avoid warnings upon render with a key\n key: \"__\" + id,\n nonce: options.nonce ? options.nonce : undefined,\n dangerouslySetInnerHTML: {\n __html: css\n }\n });\n });\n}\nvar StyleSheetRegistry = /*#__PURE__*/ function() {\n function StyleSheetRegistry(param) {\n var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;\n this._sheet = styleSheet || new StyleSheet({\n name: \"styled-jsx\",\n optimizeForSpeed: optimizeForSpeed\n });\n this._sheet.inject();\n if (styleSheet && typeof optimizeForSpeed === \"boolean\") {\n this._sheet.setOptimizeForSpeed(optimizeForSpeed);\n this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();\n }\n this._fromServer = undefined;\n this._indices = {};\n this._instancesCounts = {};\n }\n var _proto = StyleSheetRegistry.prototype;\n _proto.add = function add(props) {\n var _this = this;\n if (undefined === this._optimizeForSpeed) {\n this._optimizeForSpeed = Array.isArray(props.children);\n this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);\n this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();\n }\n if (typeof window !== \"undefined\" && !this._fromServer) {\n this._fromServer = this.selectFromServer();\n this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {\n acc[tagName] = 0;\n return acc;\n }, {});\n }\n var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;\n // Deduping: just increase the instances count.\n if (styleId in this._instancesCounts) {\n this._instancesCounts[styleId] += 1;\n return;\n }\n var indices = rules.map(function(rule) {\n return _this._sheet.insertRule(rule);\n })// Filter out invalid rules\n .filter(function(index) {\n return index !== -1;\n });\n this._indices[styleId] = indices;\n this._instancesCounts[styleId] = 1;\n };\n _proto.remove = function remove(props) {\n var _this = this;\n var styleId = this.getIdAndRules(props).styleId;\n invariant(styleId in this._instancesCounts, \"styleId: `\" + styleId + \"` not found\");\n this._instancesCounts[styleId] -= 1;\n if (this._instancesCounts[styleId] < 1) {\n var tagFromServer = this._fromServer && this._fromServer[styleId];\n if (tagFromServer) {\n tagFromServer.parentNode.removeChild(tagFromServer);\n delete this._fromServer[styleId];\n } else {\n this._indices[styleId].forEach(function(index) {\n return _this._sheet.deleteRule(index);\n });\n delete this._indices[styleId];\n }\n delete this._instancesCounts[styleId];\n }\n };\n _proto.update = function update(props, nextProps) {\n this.add(nextProps);\n this.remove(props);\n };\n _proto.flush = function flush() {\n this._sheet.flush();\n this._sheet.inject();\n this._fromServer = undefined;\n this._indices = {};\n this._instancesCounts = {};\n };\n _proto.cssRules = function cssRules() {\n var _this = this;\n var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {\n return [\n styleId,\n _this._fromServer[styleId]\n ];\n }) : [];\n var cssRules = this._sheet.cssRules();\n return fromServer.concat(Object.keys(this._indices).map(function(styleId) {\n return [\n styleId,\n _this._indices[styleId].map(function(index) {\n return cssRules[index].cssText;\n }).join(_this._optimizeForSpeed ? \"\" : \"\\n\")\n ];\n })// filter out empty rules\n .filter(function(rule) {\n return Boolean(rule[1]);\n }));\n };\n _proto.styles = function styles(options) {\n return mapRulesToStyle(this.cssRules(), options);\n };\n _proto.getIdAndRules = function getIdAndRules(props) {\n var css = props.children, dynamic = props.dynamic, id = props.id;\n if (dynamic) {\n var styleId = computeId(id, dynamic);\n return {\n styleId: styleId,\n rules: Array.isArray(css) ? css.map(function(rule) {\n return computeSelector(styleId, rule);\n }) : [\n computeSelector(styleId, css)\n ]\n };\n }\n return {\n styleId: computeId(id),\n rules: Array.isArray(css) ? css : [\n css\n ]\n };\n };\n /**\n * selectFromServer\n *\n * Collects style tags from the document with id __jsx-XXX\n */ _proto.selectFromServer = function selectFromServer() {\n var elements = Array.prototype.slice.call(document.querySelectorAll('[id^=\"__jsx-\"]'));\n return elements.reduce(function(acc, element) {\n var id = element.id.slice(2);\n acc[id] = element;\n return acc;\n }, {});\n };\n return StyleSheetRegistry;\n}();\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(\"StyleSheetRegistry: \" + message + \".\");\n }\n}\nvar StyleSheetContext = /*#__PURE__*/ React.createContext(null);\nStyleSheetContext.displayName = \"StyleSheetContext\";\nfunction createStyleRegistry() {\n return new StyleSheetRegistry();\n}\nfunction StyleRegistry(param) {\n var configuredRegistry = param.registry, children = param.children;\n var rootRegistry = React.useContext(StyleSheetContext);\n var ref = React.useState(function() {\n return rootRegistry || configuredRegistry || createStyleRegistry();\n }), registry = ref[0];\n return /*#__PURE__*/ React__default[\"default\"].createElement(StyleSheetContext.Provider, {\n value: registry\n }, children);\n}\nfunction useStyleRegistry() {\n return React.useContext(StyleSheetContext);\n}\n\n// Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.\n// https://github.com/reactwg/react-18/discussions/110\nvar useInsertionEffect = React__default[\"default\"].useInsertionEffect || React__default[\"default\"].useLayoutEffect;\nvar defaultRegistry = typeof window !== \"undefined\" ? createStyleRegistry() : undefined;\nfunction JSXStyle(props) {\n var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();\n // If `registry` does not exist, we do nothing here.\n if (!registry) {\n return null;\n }\n if (typeof window === \"undefined\") {\n registry.add(props);\n return null;\n }\n useInsertionEffect(function() {\n registry.add(props);\n return function() {\n registry.remove(props);\n };\n // props.children can be string[], will be striped since id is identical\n }, [\n props.id,\n String(props.dynamic)\n ]);\n return null;\n}\nJSXStyle.dynamic = function(info) {\n return info.map(function(tagInfo) {\n var baseId = tagInfo[0];\n var props = tagInfo[1];\n return computeId(baseId, props);\n }).join(\" \");\n};\n\nexports.StyleRegistry = StyleRegistry;\nexports.createStyleRegistry = createStyleRegistry;\nexports.style = JSXStyle;\nexports.useStyleRegistry = useStyleRegistry;\n","module.exports = require('./dist/index').style\n","'use client';\n\nimport { useState, useEffect, useRef, useCallback } from 'react';\nimport { timeAgo } from './utils';\n\ninterface ChatTask {\n task_id: string;\n from_name: string;\n to_name: string;\n status: string;\n priority: string;\n content: string;\n result: string;\n created_at: string;\n}\n\nconst STATUS_STEPS = ['created', 'delivered', 'running', 'replied'];\nconst STATUS_COLORS: Record<string, string> = {\n created: 'bg-gray-400', delivered: 'bg-blue-400', running: 'bg-green-400',\n replied: 'bg-purple-400', failed: 'bg-red-400', closed: 'bg-gray-500',\n};\n\nfunction StatusBar({ status }: { status: string }) {\n const idx = STATUS_STEPS.indexOf(status);\n const isFailed = status === 'failed';\n return (\n <div className=\"flex items-center gap-1 mt-1.5\">\n {STATUS_STEPS.map((s, i) => (\n <div key={s} className=\"flex items-center gap-1\">\n <div className={`w-2 h-2 rounded-full transition-all duration-700 ${\n isFailed ? (i === 0 ? 'bg-red-400' : 'bg-gray-700')\n : i <= idx ? (STATUS_COLORS[s] || 'bg-gray-600') : 'bg-gray-700'\n }`} />\n {i < STATUS_STEPS.length - 1 && (\n <div className={`w-4 h-px transition-colors duration-700 ${\n isFailed ? 'bg-red-800' : i < idx ? 'bg-gray-500' : 'bg-gray-800'\n }`} />\n )}\n </div>\n ))}\n <span className={`text-[10px] ml-1.5 font-medium ${\n isFailed ? 'text-red-400' : status === 'replied' ? 'text-purple-400'\n : status === 'running' ? 'text-green-400' : 'text-gray-500'\n }`}>{status}</span>\n {(status === 'running' || status === 'delivered') && (\n <span className=\"ml-1\">\n <span className=\"inline-block w-1 h-1 rounded-full bg-green-400 animate-pulse\" />\n <span className=\"inline-block w-1 h-1 rounded-full bg-green-400 animate-pulse ml-0.5\" style={{ animationDelay: '0.2s' }} />\n <span className=\"inline-block w-1 h-1 rounded-full bg-green-400 animate-pulse ml-0.5\" style={{ animationDelay: '0.4s' }} />\n </span>\n )}\n </div>\n );\n}\n\nfunction MarkdownContent({ text }: { text: string }) {\n if (!text) return <span className=\"text-gray-600 italic\">No content</span>;\n\n const parts = text.split(/(```[\\s\\S]*?```|`[^`\\n]+`|\\*\\*[^*]+\\*\\*)/g);\n return (\n <div className=\"whitespace-pre-wrap break-words leading-relaxed\">\n {parts.map((part, i) => {\n if (part.startsWith('```') && part.endsWith('```')) {\n const lines = part.slice(3, -3);\n const lang = lines.match(/^(\\w+)\\n/)?.[1] || '';\n const code = lang ? lines.slice(lang.length + 1) : lines;\n return (\n <div key={i} className=\"my-2 rounded-lg overflow-hidden border border-[#1a1a2a]\">\n {lang && <div className=\"bg-[#0a0a15] px-3 py-1 text-[10px] text-gray-500 border-b border-[#1a1a2a]\">{lang}</div>}\n <pre className=\"bg-[#050510] px-3 py-2 text-[11px] text-green-300 overflow-x-auto\">{code}</pre>\n </div>\n );\n }\n if (part.startsWith('`') && part.endsWith('`')) {\n return <code key={i} className=\"bg-[#0a0a15] rounded px-1.5 py-0.5 text-cyan-300 text-[11px] border border-[#1a1a2a]\">{part.slice(1, -1)}</code>;\n }\n if (part.startsWith('**') && part.endsWith('**')) {\n return <strong key={i} className=\"text-white font-semibold\">{part.slice(2, -2)}</strong>;\n }\n return <span key={i}>{part}</span>;\n })}\n </div>\n );\n}\n\ninterface TaskChatPanelProps {\n alias: string;\n onClose: () => void;\n /** When true, renders without outer panel chrome (for use inside CommandCenter) */\n inline?: boolean;\n /** Available nodes for @ mention */\n availableNodes?: string[];\n}\n\nexport function TaskChatPanel({ alias, onClose, inline, availableNodes }: TaskChatPanelProps) {\n const [messages, setMessages] = useState<ChatTask[]>([]);\n const [input, setInput] = useState('');\n const [priority, setPriority] = useState('normal');\n const [sending, setSending] = useState(false);\n const [pollingIds, setPollingIds] = useState<Set<string>>(new Set());\n const [historyLoaded, setHistoryLoaded] = useState(false);\n const [targetAlias, setTargetAlias] = useState(alias);\n const [showMentions, setShowMentions] = useState(false);\n const [mentionFilter, setMentionFilter] = useState('');\n const [mentionNodes, setMentionNodes] = useState<string[]>([]);\n const messagesEndRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n // Load available nodes for @ mention\n useEffect(() => {\n if (availableNodes) { setMentionNodes(availableNodes); return; }\n fetch('/api/hub/status').then(r => r.json()).then(d => {\n const nodes = (d.sessions || []).filter((s: { status: string }) => s.status !== 'offline').map((s: { alias: string }) => s.alias);\n setMentionNodes(nodes);\n }).catch(() => {});\n }, [availableNodes]);\n\n // Reset target when alias changes\n useEffect(() => { setTargetAlias(alias); }, [alias]);\n\n // Load task history for this node\n const loadHistory = useCallback(async () => {\n try {\n const res = await fetch(`/api/hub/tasks?to_name=${encodeURIComponent(alias)}&limit=30`);\n const data = await res.json();\n if (data.tasks) {\n // Show oldest first\n setMessages(data.tasks.reverse());\n }\n } catch {} finally {\n setHistoryLoaded(true);\n }\n }, [alias]);\n\n useEffect(() => {\n setMessages([]);\n setHistoryLoaded(false);\n loadHistory();\n // Focus textarea\n setTimeout(() => textareaRef.current?.focus(), 300);\n }, [alias, loadHistory]);\n\n // Auto-scroll to bottom\n useEffect(() => {\n messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });\n }, [messages]);\n\n // Poll pending tasks for status updates\n useEffect(() => {\n if (pollingIds.size === 0) return;\n const startTime = Date.now();\n const interval = setInterval(async () => {\n // Timeout after 120s\n if (Date.now() - startTime > 120000) {\n setPollingIds(new Set());\n clearInterval(interval);\n return;\n }\n for (const taskId of pollingIds) {\n try {\n const res = await fetch(`/api/hub/tasks?task_id=${encodeURIComponent(taskId)}`);\n const data = await res.json();\n if (data.tasks?.[0]) {\n const updated = data.tasks[0];\n setMessages(prev => prev.map(m => m.task_id === taskId ? { ...m, ...updated } : m));\n if (['replied', 'failed', 'closed', 'expired', 'cancelled'].includes(updated.status)) {\n setPollingIds(prev => { const n = new Set(prev); n.delete(taskId); return n; });\n }\n }\n } catch {}\n }\n }, 2000);\n return () => clearInterval(interval);\n }, [pollingIds]);\n\n const send = async () => {\n if (!input.trim() || sending) return;\n let taskContent = input.trim();\n let sendTo = targetAlias;\n\n // Parse @mention at start: \"@NodeName rest of message\"\n const atMatch = taskContent.match(/^@(\\S+)\\s+([\\s\\S]+)/);\n if (atMatch) {\n const mentioned = mentionNodes.find(n => n.toLowerCase() === atMatch[1].toLowerCase());\n if (mentioned) {\n sendTo = mentioned;\n taskContent = atMatch[2];\n }\n }\n\n setSending(true);\n setInput('');\n setShowMentions(false);\n if (textareaRef.current) textareaRef.current.style.height = 'auto';\n\n // Optimistic echo first so the user always sees their message in history\n // even if the network call fails or the server returns ok:false. Earlier\n // version only added on data.ok=true → silent failures looked like\n // 'tasks get swallowed'.\n const localTaskId = `tmp-${Date.now()}`;\n const optimistic: ChatTask = {\n task_id: localTaskId,\n from_name: 'Dashboard',\n to_name: sendTo,\n status: 'created',\n priority,\n content: taskContent,\n result: '',\n created_at: new Date().toISOString(),\n };\n setMessages(prev => [...prev, optimistic]);\n\n try {\n const res = await fetch('/api/hub/send', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ alias: sendTo, task: taskContent, priority }),\n });\n const data = await res.json().catch(() => ({ ok: false, error: `HTTP ${res.status}` }));\n if (data.ok && data.message_id) {\n setMessages(prev => prev.map(m =>\n m.task_id === localTaskId ? { ...m, task_id: data.message_id, status: 'delivered' } : m,\n ));\n setPollingIds(prev => new Set(prev).add(data.message_id));\n } else {\n const reason = data.error || data.detail || `send failed (status ${res.status})`;\n setMessages(prev => prev.map(m =>\n m.task_id === localTaskId ? { ...m, status: 'failed', result: `❌ ${reason}` } : m,\n ));\n }\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : String(e);\n setMessages(prev => prev.map(m =>\n m.task_id === localTaskId ? { ...m, status: 'failed', result: `❌ network error: ${msg}` } : m,\n ));\n }\n setSending(false);\n textareaRef.current?.focus();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n // Enter sends, Shift+Enter inserts newline (standard chat UX).\n // Users habit-pressed Enter expecting send and saw nothing happen.\n if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {\n e.preventDefault();\n send();\n }\n if (e.key === 'Escape') setShowMentions(false);\n };\n\n const handleInputChange = (value: string) => {\n setInput(value);\n // Check if user just typed @\n const lastAt = value.lastIndexOf('@');\n if (lastAt >= 0 && (lastAt === 0 || value[lastAt - 1] === ' ' || value[lastAt - 1] === '\\n')) {\n const after = value.slice(lastAt + 1);\n if (!after.includes(' ') && !after.includes('\\n')) {\n setMentionFilter(after.toLowerCase());\n setShowMentions(true);\n return;\n }\n }\n setShowMentions(false);\n };\n\n const insertMention = (nodeName: string) => {\n const lastAt = input.lastIndexOf('@');\n const before = input.slice(0, lastAt);\n setInput(`${before}@${nodeName} `);\n setShowMentions(false);\n textareaRef.current?.focus();\n };\n\n const filteredMentions = mentionNodes.filter(n =>\n n !== alias && n.toLowerCase().includes(mentionFilter)\n ).slice(0, 8);\n\n const autoResize = (el: HTMLTextAreaElement) => {\n el.style.height = 'auto';\n el.style.height = Math.min(el.scrollHeight, 150) + 'px';\n };\n\n // Inline mode: just the chat content, no panel chrome\n const chatContent = (\n <>\n {/* Messages area */}\n <div className=\"flex-1 overflow-y-auto px-4 py-4 space-y-4\">\n {!historyLoaded && (\n <div className=\"flex justify-center py-8\">\n <div className=\"w-5 h-5 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin\" />\n </div>\n )}\n {historyLoaded && messages.length === 0 && (\n <div className=\"text-center py-12\">\n <div className=\"text-3xl mb-3\">💬</div>\n <div className=\"text-gray-500 text-sm\">Start a conversation</div>\n <div className=\"text-gray-600 text-xs mt-1\">Send a task to {alias}</div>\n </div>\n )}\n\n {messages.map((m, idx) => (\n <div key={m.task_id} className=\"space-y-2\">\n {/* Outgoing task */}\n <div className=\"flex justify-end\">\n <div className=\"max-w-[85%] bg-cyan-500/8 border border-cyan-500/15 rounded-2xl rounded-br-md px-4 py-2.5 shadow-sm\">\n <div className=\"text-[13px] text-gray-200\">\n <MarkdownContent text={m.content} />\n </div>\n <div className=\"flex items-center justify-between mt-1.5 gap-3\">\n <StatusBar status={m.status} />\n <span className=\"text-[9px] text-gray-600 shrink-0\">{timeAgo(m.created_at)}</span>\n </div>\n </div>\n </div>\n\n {/* Incoming reply */}\n {m.result && (\n <div className=\"flex justify-start\">\n <div className=\"max-w-[85%] bg-green-500/8 border border-green-500/15 rounded-2xl rounded-bl-md px-4 py-2.5 shadow-sm\">\n <div className=\"text-[10px] text-green-400 font-medium mb-1.5\">{m.to_name}</div>\n <div className=\"text-[13px] text-gray-200\">\n <MarkdownContent text={m.result} />\n </div>\n </div>\n </div>\n )}\n\n {/* Typing indicator when running */}\n {m.status === 'running' && !m.result && (\n <div className=\"flex justify-start\">\n <div className=\"bg-[#111128] border border-[#2a2a4a] rounded-2xl rounded-bl-md px-4 py-3\">\n <div className=\"flex gap-1\">\n <span className=\"w-2 h-2 rounded-full bg-gray-500 animate-bounce\" style={{ animationDelay: '0s' }} />\n <span className=\"w-2 h-2 rounded-full bg-gray-500 animate-bounce\" style={{ animationDelay: '0.15s' }} />\n <span className=\"w-2 h-2 rounded-full bg-gray-500 animate-bounce\" style={{ animationDelay: '0.3s' }} />\n </div>\n </div>\n </div>\n )}\n </div>\n ))}\n <div ref={messagesEndRef} />\n </div>\n\n {/* Input area */}\n <div className=\"border-t border-[#2a2a4a] bg-[#0d0d1a] px-4 py-3\">\n <div className=\"flex items-end gap-2\">\n <div className=\"flex-1 relative\">\n {/* @ mention dropdown */}\n {showMentions && filteredMentions.length > 0 && (\n <div className=\"absolute bottom-full left-0 right-0 mb-1 bg-[#111128] border border-[#2a2a4a] rounded-lg shadow-xl shadow-black/50 overflow-hidden z-10 max-h-48 overflow-y-auto\">\n {filteredMentions.map(node => (\n <button key={node} onClick={() => insertMention(node)}\n className=\"w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-cyan-500/10 transition-colors\">\n <span className=\"w-2 h-2 rounded-full bg-cyan-400 shrink-0\" />\n <span className=\"text-gray-300\">{node}</span>\n </button>\n ))}\n </div>\n )}\n <textarea\n ref={textareaRef}\n value={input}\n onChange={e => { handleInputChange(e.target.value); autoResize(e.target); }}\n onKeyDown={handleKeyDown}\n placeholder={`Message ${alias}...`}\n rows={1}\n className=\"w-full bg-[#111128] border border-[#2a2a4a] rounded-xl px-4 py-2.5 pr-16 text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none resize-none transition-colors\"\n />\n <div className=\"absolute right-2 bottom-1.5 flex items-center gap-1\">\n <select value={priority} onChange={e => setPriority(e.target.value)}\n className=\"bg-transparent text-[9px] text-gray-600 focus:outline-none cursor-pointer\">\n <option value=\"normal\">N</option>\n <option value=\"high\">H</option>\n <option value=\"low\">L</option>\n </select>\n </div>\n </div>\n <button onClick={send} disabled={sending || !input.trim()}\n className=\"p-2.5 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white rounded-xl transition-all shrink-0 active:scale-95\">\n {sending ? (\n <div className=\"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin\" />\n ) : (\n <svg className=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5\" />\n </svg>\n )}\n </button>\n </div>\n <div className=\"flex justify-between text-[9px] text-gray-700 mt-1.5\">\n <span>{input.includes('@') ? `Sending to: ${targetAlias}` : `Type @ to mention another node`}</span>\n <span>Enter to send · Shift+Enter for newline</span>\n </div>\n </div>\n </>\n );\n\n if (inline) {\n return <div className=\"flex flex-col h-full\">{chatContent}</div>;\n }\n\n return (\n <>\n <div className=\"fixed inset-0 bg-black/30 z-40 lg:hidden\" onClick={onClose} />\n <div className=\"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\">\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-[#2a2a4a] bg-[#0d0d1a]\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500/30 to-blue-500/30 flex items-center justify-center text-xs font-bold text-cyan-300\">\n {alias.slice(0, 2)}\n </div>\n <div>\n <div className=\"text-sm font-semibold text-white\">{alias}</div>\n <div className=\"text-[10px] text-gray-500\">{pollingIds.size > 0 ? 'Processing...' : 'Ready'}</div>\n </div>\n </div>\n <button onClick={onClose} className=\"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]\">\n <svg className=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n {chatContent}\n </div>\n <style jsx global>{`\n @keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }\n .animate-slide-in { animation: slide-in 0.2s ease-out; }\n `}</style>\n </>\n );\n}\n"],"names":["React","_interopDefaultLegacy","e","React__default","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_createClass","Constructor","protoProps","staticProps","prototype","isProd","process","env","isString","o","toString","call","StyleSheet","param","ref","_name","name","_optimizeForSpeed","optimizeForSpeed","invariant$1","_deletedRulePlaceholder","_serverSheet","undefined","_tags","_injected","_rulesCount","node","document","querySelector","_nonce","_proto","setOptimizeForSpeed","bool","flush","inject","isOptimizeForSpeed","_this","cssRules","insertRule","rule","index","cssText","push","deleteRule","getSheetForTag","tag","sheet","styleSheets","ownerNode","getSheet","insertionPoint","replaceRule","trim","error","console","warn","makeStyleTag","cssString","relativeToTag","createElement","setAttribute","type","appendChild","createTextNode","head","getElementsByTagName","insertBefore","get","condition","message","Error","hash","str","_$hash","charCodeAt","stringHash","sanitize","replace","cache","computeId","baseId","propsToString","String","computeSelector","id","css","selectoPlaceholderRegexp","idcss","mapRulesToStyle","options","map","args","nonce","dangerouslySetInnerHTML","__html","StyleSheetRegistry","_styleSheet","styleSheet","_sheet","_fromServer","_indices","_instancesCounts","add","Array","isArray","children","getIdAndRules","styleId","rules","indices","filter","remove","invariant","tagFromServer","parentNode","removeChild","forEach","update","nextProps","fromServer","keys","concat","join","Boolean","styles","dynamic","selectFromServer","elements","slice","querySelectorAll","reduce","acc","element","StyleSheetContext","createContext","displayName","createStyleRegistry","StyleRegistry","configuredRegistry","registry","rootRegistry","useContext","useState","Provider","value","useStyleRegistry","useInsertionEffect","useLayoutEffect","defaultRegistry","JSXStyle","info","tagInfo","exports","style","module","STATUS_STEPS","STATUS_COLORS","created","delivered","running","replied","failed","closed","StatusBar","status","idx","indexOf","isFailed","className","s","animationDelay","MarkdownContent","text","parts","split","part","startsWith","endsWith","lines","lang","match","code","TaskChatPanel","alias","onClose","inline","availableNodes","messages","setMessages","input","setInput","priority","setPriority","sending","setSending","pollingIds","setPollingIds","Set","historyLoaded","setHistoryLoaded","targetAlias","setTargetAlias","showMentions","setShowMentions","mentionFilter","setMentionFilter","mentionNodes","setMentionNodes","messagesEndRef","textareaRef","fetch","then","r","json","d","nodes","sessions","catch","loadHistory","res","encodeURIComponent","data","tasks","reverse","setTimeout","current","focus","scrollIntoView","behavior","size","startTime","Date","now","interval","setInterval","clearInterval","taskId","updated","prev","m","task_id","includes","n","delete","send","taskContent","sendTo","atMatch","mentioned","find","toLowerCase","height","localTaskId","optimistic","from_name","to_name","content","result","created_at","toISOString","method","headers","body","JSON","stringify","task","ok","message_id","reason","detail","msg","handleKeyDown","shiftKey","nativeEvent","isComposing","preventDefault","handleInputChange","lastAt","lastIndexOf","after","insertMention","nodeName","before","filteredMentions","autoResize","el","Math","min","scrollHeight","chatContent","onClick","onChange","onKeyDown","placeholder","rows","disabled","fill","viewBox","stroke","strokeWidth","strokeLinecap","strokeLinejoin"],"mappings":"6DACA,IAAIA,EAAAA,EAAAA,CAAAA,CAAAA,OAIAG,EAFwCD,GAAkB,AAAb,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AC,YAAY,EAAEzC,EAAAA,CAAa,CAAG,CAAC,8BAA8B,CAAC,GAC5F,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,UAAK,4DAMhB,AAAIf,EACK,CAAA,EAAA,EAAA,CADG,EACH,EAAC,MAAA,CAAIjB,UAAU,gCAAwByH,IAI9C,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,QAAA,CAAA,WACE,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAyDC,QAAS1G,0CAApD,mCACf,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,yCAAc,uJAEb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,yCAAc,qFACb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,yCAAc,0BACb,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,yCAAc,yIACZD,EAAMvD,KAAK,CAAC,EAAG,KAElB,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,2CACC,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,yCAAc,kCAAoCuD,IACnD,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,yCAAc,2BAA6BY,EAAWkC,IAAI,CAAG,EAAI,gBAAkB,gBAGxF,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CAAO6D,QAAS1G,0CAAmB,oEAClC,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAwBgH,KAAK,OAAOC,QAAQ,YAAYC,OAAO,eAAeC,YAAa,0CAA7E,SACb,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAKC,cAAc,QAAQC,eAAe,QAAQvF,EAAE,gEAI1D2E,6LAQT","ignoreList":[0,1]}
@@ -1,3 +1,3 @@
1
- module.exports=[60350,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(43515);function f({online:a,working:c,total:d,version:e,uptime:h}){let i=d>0?Math.round(a/d*100):0;return(0,b.jsxs)("div",{className:"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]})]}),(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}){return(0,b.jsxs)("div",{className:`relative overflow-hidden rounded-xl border ${h} bg-[#111128] px-4 py-3`,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:"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?"Sending...":"Broadcast"})]}),a.length>0&&(0,b.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1",children:[a.length,"/500"]}),g&&(0,b.jsx)("div",{className:`mt-3 text-sm text-center ${g.startsWith("Failed")?"text-red-400":"text-green-400/80"} animate-fade-in`,children:g})]})}function i(a,b,c){let d=b<=2?Math.PI:1.78*Math.PI,e=-Math.PI/2-d/2,f=b<=1?-Math.PI/2:e+d*a/(b-1);return{x:500+c*Math.cos(f),y:330+c*Math.sin(f)}}function j(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 k(a,b){return a.length>b?`${a.slice(0,b-1)}...`:a}function l({sessions:a,sseSessions:d}){let[e,f]=(0,c.useState)([]);(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();f(b.messages||[])}catch{}};a();let b=setInterval(a,5e3);return()=>clearInterval(b)},[]);let{onlineNodes:g,offlineNodes:h,nodePositions:m,flowLinks:n,activeAliases:o}=(0,c.useMemo)(()=>{let b,c=a.filter(a=>"offline"!==a.status||d[a.alias]),f=a.filter(a=>"offline"===a.status&&!d[a.alias]),g={};c.forEach((a,b)=>{g[a.alias]=i(b,Math.max(c.length,1),220)}),f.forEach((a,b)=>{g[a.alias]=i(b,Math.max(f.length,1),315)});let h=(b=new Map,e.forEach(a=>{if(!g[a.from_alias]||!g[a.to_alias]||a.from_alias===a.to_alias)return;let c=`${a.from_alias}->${a.to_alias}`,d=b.get(c);b.set(c,{key:c,from:a.from_alias,to:a.to_alias,count:(d?.count||0)+1,content:d?.content||a.content})}),[...b.values()].slice(0,18)),j=new Set;return h.forEach(a=>{j.add(a.from),j.add(a.to)}),{onlineNodes:c,offlineNodes:f,nodePositions:g,flowLinks:h,activeAliases:j}},[e,a,d]),p=g.filter(a=>"working"===a.status).length;return(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 gap-2 text-xs",children:[(0,b.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-green-500/10 text-green-300 border border-green-500/20",children:[p," 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",children:[g.length," online"]}),(0,b.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20",children:[n.length," active links"]})]})]}),(0,b.jsxs)("div",{className:"relative overflow-hidden rounded-lg border border-[#2a2a4a] bg-[#080814] shadow-2xl shadow-cyan-950/30",children:[(0,b.jsx)("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-cyan-400/70 to-transparent"}),(0,b.jsxs)("svg",{viewBox:"0 0 1000 680",className:"w-full h-auto block",preserveAspectRatio:"xMidYMid meet",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:"#0b1220"}),(0,b.jsx)("stop",{offset:"48%",stopColor:"#080814"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"#101018"})]}),(0,b.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:"#22d3ee",stopOpacity:"0.18"}),(0,b.jsx)("stop",{offset:"45%",stopColor:"#22c55e",stopOpacity:"0.045"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"#020617",stopOpacity:"0"})]}),(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"})]})]}),(0,b.jsx)("marker",{id:"topo-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:(0,b.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#67e8f9"})})]}),(0,b.jsx)("rect",{width:"1000",height:"680",fill:"url(#topo-panel)"}),(0,b.jsx)("circle",{cx:500,cy:330,r:"330",fill:"url(#topo-radar)"}),[90,170,250,330].map(a=>(0,b.jsx)("circle",{cx:500,cy:330,r:a,fill:"none",stroke:"#164e63",strokeWidth:"1",opacity:"0.35"},a)),[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:"#164e63",strokeWidth:"1",opacity:"0.18"},a)),g.map(a=>{let c=m[a.alias];if(!c)return null;let d=j({x:500,y:330},c,0);return(0,b.jsx)("path",{d:d,fill:"none",stroke:o.has(a.alias)?"#22d3ee":"#155e75",strokeWidth:o.has(a.alias)?2:1,strokeDasharray:o.has(a.alias)?"none":"8 10",opacity:o.has(a.alias)?.65:.35},`hub-${a.alias}`)}),n.map((a,c)=>{let d=m[a.from],e=m[a.to];if(!d||!e)return null;let f=j(d,e,c%2==0?36:-36),g=Math.min(2+a.count,7);return(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:f,fill:"none",stroke:"#67e8f9",strokeWidth:g,opacity:"0.28",filter:"url(#topo-glow)",markerEnd:"url(#topo-arrow)"}),(0,b.jsx)("path",{id:`flow-path-${c}`,d:f,fill:"none",stroke:"#e0f2fe",strokeWidth:"1",strokeDasharray:"2 12",opacity:"0.75"}),(0,b.jsx)("circle",{r:"4",fill:"#fef08a",filter:"url(#topo-glow)",children:(0,b.jsx)("animateMotion",{dur:`${2.2+c%5*.32}s`,repeatCount:"indefinite",path:f})})]},a.key)}),(0,b.jsxs)("g",{filter:"url(#topo-glow)",children:[(0,b.jsx)("circle",{cx:500,cy:330,r:"56",fill:"#020617",stroke:"#67e8f9",strokeWidth:"2"}),(0,b.jsxs)("circle",{cx:500,cy:330,r:"42",fill:"none",stroke:"#22c55e",strokeWidth:"1.5",opacity:"0.8",children:[(0,b.jsx)("animate",{attributeName:"r",values:"42;52;42",dur:"3s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0.8;0.2;0.8",dur:"3s",repeatCount:"indefinite"})]}),(0,b.jsx)("path",{d:"M470 330 h60 M500 300 v60",stroke:"#e0f2fe",strokeWidth:"5",strokeLinecap:"round",opacity:"0.9"}),(0,b.jsx)("text",{x:500,y:408,textAnchor:"middle",fill:"#e5e7eb",fontSize:"16",fontFamily:"monospace",fontWeight:"700",children:"DASHBOARD"}),(0,b.jsx)("text",{x:500,y:426,textAnchor:"middle",fill:"#64748b",fontSize:"10",fontFamily:"monospace",children:"command relay"})]}),[...g,...h].map(a=>{let c=m[a.alias];if(!c)return null;let e="offline"!==a.status||!!d[a.alias],f=e?"working"===a.status?{label:"working",primary:"#22c55e",halo:"#14532d",text:"#dcfce7"}:"idle"===a.status?{label:"idle",primary:"#2dd4bf",halo:"#134e4a",text:"#ccfbf1"}:{label:a.status||"online",primary:"#38bdf8",halo:"#0c4a6e",text:"#e0f2fe"}:{label:"offline",primary:"#6b7280",halo:"#111827",text:"#9ca3af"},g=o.has(a.alias),h=e?26:18;return(0,b.jsxs)("g",{className:"transition-opacity",children:[g&&(0,b.jsxs)("circle",{cx:c.x,cy:c.y,r:h+14,fill:f.primary,opacity:"0.12",children:[(0,b.jsx)("animate",{attributeName:"r",values:`${h+8};${h+22};${h+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,b.jsx)("circle",{cx:c.x,cy:c.y,r:h+8,fill:f.halo,opacity:e?.55:.25}),(0,b.jsx)("circle",{cx:c.x,cy:c.y,r:h,fill:e?"#020617":"#080814",stroke:f.primary,strokeWidth:e?3:1.5,strokeDasharray:e?"none":"5 5",filter:e?"url(#topo-glow)":void 0}),(0,b.jsx)("circle",{cx:c.x,cy:c.y,r:e?8:5,fill:f.primary}),"working"===a.status&&(0,b.jsx)("path",{d:`M${c.x-9},${c.y+11} h18`,stroke:"#fef08a",strokeWidth:"3",strokeLinecap:"round",children:(0,b.jsx)("animate",{attributeName:"opacity",values:"1;0.25;1",dur:"1.1s",repeatCount:"indefinite"})}),(0,b.jsxs)("g",{transform:`translate(${c.x}, ${c.y+h+22})`,children:[(0,b.jsx)("rect",{x:"-62",y:"-14",width:"124",height:"42",rx:"6",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,b.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:f.text,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:k(a.alias,14)}),(0,b.jsxs)("text",{x:"0",y:"17",textAnchor:"middle",fill:f.primary,fontSize:"9",fontFamily:"monospace",children:[f.label," ",e?`sse:${d[a.alias]}`:""]})]})]},a.alias)}),(0,b.jsxs)("g",{transform:"translate(28, 34)",children:[(0,b.jsx)("rect",{x:"0",y:"0",width:"285",height:60+20*Math.min(n.length,4),rx:"8",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,b.jsx)("text",{x:"16",y:"26",fill:"#e5e7eb",fontSize:"13",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,b.jsxs)("text",{x:"178",y:"26",fill:"#67e8f9",fontSize:"11",fontFamily:"monospace",children:[e.length," messages"]}),n.slice(0,4).map((a,c)=>(0,b.jsxs)("text",{x:"16",y:54+20*c,fill:"#94a3b8",fontSize:"10",fontFamily:"monospace",children:[k(a.from,8)," ","->"," ",k(a.to,8)," / ",a.count," / ",k(a.content,18)]},a.key))]}),(0,b.jsxs)("g",{transform:"translate(720, 34)",children:[(0,b.jsx)("rect",{x:"0",y:"0",width:"250",height:"112",rx:"8",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,b.jsx)("circle",{cx:"18",cy:"26",r:"6",fill:"#22c55e"}),(0,b.jsx)("text",{x:"34",y:"30",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"working node"}),(0,b.jsx)("circle",{cx:"18",cy:"52",r:"6",fill:"#2dd4bf"}),(0,b.jsx)("text",{x:"34",y:"56",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"online idle"}),(0,b.jsx)("circle",{cx:"18",cy:"78",r:"6",fill:"#6b7280"}),(0,b.jsx)("text",{x:"34",y:"82",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"offline / no SSE"}),(0,b.jsx)("path",{d:"M150,78 Q176,52 210,78",fill:"none",stroke:"#67e8f9",strokeWidth:"3",markerEnd:"url(#topo-arrow)"})]})]})]})]})}let m={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:""}},n={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function o({session:a,hasSse:c,sseCount:f,onChat:g}){let h=c&&m[a.status]||n;return(0,b.jsxs)(d.default,{href:`/node?alias=${encodeURIComponent(a.alias)}`,prefetch:!1,className:`block rounded-xl border p-4 transition-all duration-300 cursor-pointer ${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)("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${h.dot} ${c&&"working"===a.status?"animate-pulse":""}`}),(0,b.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:a.alias,children:a.alias})]}),(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",{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)})]})]})]})}function p({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 justify-between text-xs text-gray-500 mb-1.5",children:[(0,b.jsx)("span",{className:"text-blue-400 font-medium",children:a.from_session}),(0,b.jsx)("span",{children:a.created_at})]}),(0,b.jsx)("div",{className:"text-gray-300 leading-relaxed",children:a.content})]},a.id))})]})}function q(){return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono animate-pulse",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"h-7 w-48 bg-gray-800 rounded mb-2"}),(0,b.jsx)("div",{className:"h-4 w-64 bg-gray-800/60 rounded"})]}),(0,b.jsx)("div",{className:"flex gap-3",children:[1,2,3].map(a=>(0,b.jsx)("div",{className:"w-[72px] h-[60px] bg-gray-800/40 rounded-lg border border-gray-800"},a))})]}),(0,b.jsxs)("div",{className:"mb-6 flex gap-2",children:[(0,b.jsx)("div",{className:"flex-1 h-10 bg-gray-800/40 rounded-lg"}),(0,b.jsx)("div",{className:"w-28 h-10 bg-gray-800/40 rounded-lg"})]}),(0,b.jsx)("div",{className:"w-full max-w-4xl mx-auto mb-8 h-64 bg-gray-800/20 rounded-xl"}),(0,b.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[1,2,3,4].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-gray-800/40 p-4 bg-gray-800/20",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-gray-700"}),(0,b.jsx)("div",{className:"h-4 w-24 bg-gray-700 rounded"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("div",{className:"h-3 w-full bg-gray-800/60 rounded"}),(0,b.jsx)("div",{className:"h-3 w-3/4 bg-gray-800/60 rounded"}),(0,b.jsx)("div",{className:"h-3 w-1/2 bg-gray-800/60 rounded"})]})]},a))})]})}function r({hint:a}){return(0,b.jsxs)("div",{className:"text-center py-16",children:[(0,b.jsx)("div",{className:"text-gray-600 text-4xl mb-4",children:"--"}),(0,b.jsx)("h3",{className:"text-gray-400 text-lg font-medium mb-2",children:"No agents in this network"}),a?.global_count?(0,b.jsxs)("p",{className:"text-gray-500 text-sm max-w-md mx-auto",children:["Server has ",(0,b.jsx)("span",{className:"text-cyan-400 font-medium",children:a.global_count})," nodes globally, but none are registered to the current network. Switch network or contact admin."]}):(0,b.jsx)("p",{className:"text-gray-600 text-sm max-w-md mx-auto",children:"Agent sessions will appear here once they connect to the CommHub."})]})}var s=a.i(22397);function t(){let{setNetworkId:a}=(0,s.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,t]=(0,c.useState)(""),[u,v]=(0,c.useState)(""),w=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:u})});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:u})}),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 x=(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:x}),(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.jsx)("button",{onClick:()=>{t(d.user?.display_name||""),v(""),q(!p)},className:"text-xs text-gray-500 hover:text-gray-300",children:"Edit"}),(0,b.jsx)("button",{onClick:()=>{e({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300",children:"Sign out"})]}),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=>t(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:u,onChange:a=>v(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:w,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var u=a.i(31626),v=a.i(15261);function w({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)(x,{alias:a})},a))})]}),(0,b.jsx)(u.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 x({alias:a}){return(0,b.jsx)(v.TaskChatPanel,{alias:a,onClose:()=>{},inline:!0})}function y({sessions:a,onClose:d}){let[e,f]=(0,c.useState)(new Set),[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)("normal"),[k,l]=(0,c.useState)(!1),[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(""),q=a.filter(a=>"offline"!==a.status).filter(a=>!o||a.alias.toLowerCase().includes(o.toLowerCase())||(a.agent||"").toLowerCase().includes(o.toLowerCase())),r=async()=>{if(!g.trim()||0===e.size||k)return;l(!0),n([]);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:i})}),c=await b.json();return{alias:a,ok:!!c.ok,error:c.error}}catch(b){return{alias:a,ok:!1,error:"send failed"}}});n(await Promise.all(a)),l(!1)},s=m.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",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",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:o,onChange:a=>p(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===q.length?f(new Set):f(new Set(q.map(a=>a.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:e.size===q.length?"Deselect all":`Select all (${q.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:[q.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)("div",{className:`w-2 h-2 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===q.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:i,onChange:a=>j(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:r,disabled:k||!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:k?(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":""}`})]})]}),m.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:[s,"/",m.length," dispatched successfully"]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:m.map(a=>(0,b.jsxs)("span",{className:`text-[10px] px-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:[a.alias,": ",a.ok?"✓":a.error||"✗"]},a.alias))})]})]})]})]})]})}var z=a.i(44332),A=a.i(64565);a.s(["default",0,function(){(0,c.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:a,hint:g,error:i,isLoading:j}=(0,z.useSessions)(),{health:k}=(0,z.useHealth)(),{config:m}=(0,z.useAnetConfig)(),{tasks:n}=(0,z.useTasks)({limit:"500"}),{stats:s}=(0,z.useStats)(),{license:u}=(0,z.useLicense)(),[v,x]=(0,c.useState)(!1),[B,C]=(0,c.useState)(!1),D=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}}(),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)([]),{mutate:I}=(0,A.useSWRConfig)(),{connected:J,supported:K}=function({url:a,onEvent:b,reconnectDelay:d=3e3,enabled:e=!0}){let[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(null),l=(0,c.useRef)(null),m=(0,c.useRef)(void 0),n=(0,c.useRef)(!1),o=(0,c.useCallback)(()=>{if(!e||!a||n.current)return;l.current&&l.current.close();let c=a.includes("?")?`${a}&probe=1`:`${a}?probe=1`,f=new AbortController,h=setTimeout(()=>f.abort(),5e3);fetch(c,{method:"HEAD",cache:"no-store",signal:f.signal}).finally(()=>clearTimeout(h)).then(c=>{if("true"!==c.headers.get("x-anet-sse-available")){n.current=!0,g(!1),k(!1);return}k(!0);let e=new EventSource(a);l.current=e,e.onopen=()=>{g(!0)},e.onmessage=a=>{try{let c=JSON.parse(a.data);i(c),b?.(c)}catch{}},e.onerror=()=>{g(!1),e.close(),l.current=null,m.current=setTimeout(o,d)}}).catch(()=>{g(!1),k(!1)})},[a,b,d,e]);return(0,c.useEffect)(()=>(n.current=!1,k(!!e&&null),o(),()=>{l.current&&(l.current.close(),l.current=null),m.current&&clearTimeout(m.current)}),[o]),{connected:f,lastEvent:h,supported:j}}({url:"/api/hub/events",enabled:"1"!==process.env.NEXT_PUBLIC_DISABLE_SSE,onEvent:a=>{["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(a.type)&&(I("/api/hub/status"),I(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&&H(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)},[]),j)return(0,b.jsx)(q,{});let L=k?.sse_sessions||{},M=a=>"offline"!==a.status||!!L[a.alias],N=a.filter(M).length,O=a.length,P=a.filter(a=>"working"===a.status).length,Q=k?(0,e.formatUptime)(k.uptime):"--",R=k?.version||"--",S=!!(m?.hub&&m.tokenConfigured),T=m?.source==="file"?"Local config":m?.source==="runtime-env"?"Runtime env":"Config missing",U={};if(s?.tasks?.by_status?.length)for(let a of s.tasks.by_status)U[a.status]=a.count;else for(let a of n)U[a.status]=(U[a.status]||0)+1;let V=[...a].sort((a,b)=>{let c=+!!M(a),d=+!!M(b);if(c!==d)return d-c;let e=+("working"===a.status);return("working"===b.status)-e});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:N,working:P,total:O,version:R,uptime:Q})}),(0,b.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,b.jsx)("button",{onClick:()=>F(!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)(t,{})})]}),(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:()=>C(!B),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 ${S?"bg-green-400":"bg-red-400"}`}),(0,b.jsx)("span",{className:"text-gray-500",children:T})]}),(0,b.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${B?"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"})})]}),B&&(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:m?.hub||void 0,children:["Hub: ",(0,b.jsx)("span",{className:m?.hub?"text-cyan-300":"text-red-300",children:m?.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 ${m?.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: ",m?.tokenPreview||"not configured"]})})]}),m?.error&&(0,b.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:m.error})]})]}),Object.keys(U).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:[{key:"running",color:"bg-green-500/10 text-green-300 border-green-500/20"},{key:"delivered",color:"bg-blue-500/10 text-blue-300 border-blue-500/20"},{key:"acked",color:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"},{key:"replied",color:"bg-purple-500/10 text-purple-300 border-purple-500/20"},{key:"failed",color:"bg-red-500/10 text-red-300 border-red-500/20"},{key:"cancelled",color:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20"},{key:"expired",color:"bg-orange-500/10 text-orange-300 border-orange-500/20"},{key:"closed",color:"bg-gray-500/10 text-gray-500 border-gray-500/20"}].filter(({key:a})=>U[a]).map(({key:a,color:c})=>(0,b.jsxs)(d.default,{href:`/tasks?status=${a}`,prefetch:!1,className:`px-2.5 py-1 rounded-md border text-xs ${c} hover:opacity-80 transition-opacity`,children:[a,": ",U[a]]},a))})]}),(0,b.jsx)("section",{className:"mb-6 grid grid-cols-3 sm:grid-cols-6 gap-2",children:[{href:"/nodes",label:"Nodes",value:`${N}/${O}`,color:"text-green-400 border-green-500/15"},{href:"/tasks",label:"Tasks",value:String(Object.values(U).reduce((a,b)=>a+b,0)||"--"),color:"text-cyan-400 border-cyan-500/15"},{href:"/tasks?status=failed",label:"Failed",value:String(U.failed||0),color:U.failed?"text-red-400 border-red-500/20":"text-gray-600 border-gray-700/30"},{href:"/messages",label:"Messages",value:"→",color:"text-blue-400 border-blue-500/15"},{href:"/logs",label:"Logs",value:"→",color:"text-purple-400 border-purple-500/15"},{href:"/admin",label:"Admin",value:"→",color:"text-gray-400 border-gray-500/15"}].map(a=>(0,b.jsxs)(d.default,{href:a.href,prefetch:!1,className:`text-center rounded-xl border ${a.color} bg-[#111128] px-3 py-2.5 hover:bg-[#161630] transition-colors`,children:[(0,b.jsx)("div",{className:`text-lg font-bold tabular-nums ${a.color.split(" ")[0]}`,children:a.value}),(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:a.label})]},a.href))}),(0,b.jsx)(h,{}),n.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:n.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 ${"replied"===a.status?"bg-purple-400":"running"===a.status?"bg-green-400":"failed"===a.status?"bg-red-400":"bg-blue-400"}`}),(0,b.jsx)("span",{className:"text-blue-400 shrink-0",children:a.from_name||"?"}),(0,b.jsx)("span",{className:"text-gray-600",children:"→"}),(0,b.jsx)("span",{className:"text-cyan-400 shrink-0",children:a.to_name||"?"}),(0,b.jsx)("span",{className:"text-gray-500 truncate flex-1",children:a.content?.slice(0,40)||"--"}),(0,b.jsx)("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] border ${"replied"===a.status?"text-purple-300 border-purple-500/20":"failed"===a.status?"text-red-300 border-red-500/20":"text-gray-500 border-gray-700/30"}`,children:a.status})]},a.task_id))})]}),i&&(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(i)}),(0,b.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),a.length>0&&(0,b.jsx)("div",{className:"flex justify-center mb-4",children:(0,b.jsx)("button",{onClick:()=>x(!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&&a.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&&a.length>0&&(0,b.jsx)(l,{sessions:a,sseSessions:L}),0!==a.length||i?(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",children:V.map(a=>(0,b.jsx)(o,{session:a,hasSse:M(a),sseCount:L[a.alias]||0,onChat:D.openTab},a.alias))}):(0,b.jsx)(r,{hint:g}),(0,b.jsx)(p,{messages:G}),(0,b.jsxs)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:[K&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${J?"bg-green-400":"bg-gray-600"}`}),J?"SSE live":"SWR polling"]}),u?.license&&(0,b.jsxs)(b.Fragment,{children:[K&&(0,b.jsx)(b.Fragment,{children:"·"}),(0,b.jsxs)("span",{className:u.license.days_left<=7?"text-red-400":"pro"===u.license.type?"text-green-400":"text-yellow-400",children:[u.license.type," (",u.license.days_left,"d left)"]})]})]}),E&&(0,b.jsx)(y,{sessions:a,onClose:()=>F(!1)}),D.tabs.length>0&&(0,b.jsx)(w,{tabs:D.tabs,activeTab:D.activeTab,onOpenTab:D.openTab,onCloseTab:D.closeTab,onSetActive:D.setActiveTab,onClose:D.closeAll})]})}],60350)}];
1
+ module.exports=[60350,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(43515);function f({online:a,working:c,total:d,version:e,uptime:h}){let i=d>0?Math.round(a/d*100):0;return(0,b.jsxs)("div",{className:"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]})]}),(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}){return(0,b.jsxs)("div",{className:`relative overflow-hidden rounded-xl border ${h} bg-[#111128] px-4 py-3`,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:"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?"Sending...":"Broadcast"})]}),a.length>0&&(0,b.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1",children:[a.length,"/500"]}),g&&(0,b.jsx)("div",{className:`mt-3 text-sm text-center ${g.startsWith("Failed")?"text-red-400":"text-green-400/80"} animate-fade-in`,children:g})]})}function i(a,b,c){let d=b<=2?Math.PI:1.78*Math.PI,e=-Math.PI/2-d/2,f=b<=1?-Math.PI/2:e+d*a/(b-1);return{x:500+c*Math.cos(f),y:330+c*Math.sin(f)}}function j(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 k(a,b){return a.length>b?`${a.slice(0,b-1)}...`:a}function l({sessions:a,sseSessions:d}){let[e,f]=(0,c.useState)([]);(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();f(b.messages||[])}catch{}};a();let b=setInterval(a,5e3);return()=>clearInterval(b)},[]);let{onlineNodes:g,offlineNodes:h,nodePositions:m,flowLinks:n,activeAliases:o}=(0,c.useMemo)(()=>{let b,c=a.filter(a=>"offline"!==a.status||d[a.alias]),f=a.filter(a=>"offline"===a.status&&!d[a.alias]),g={};c.forEach((a,b)=>{g[a.alias]=i(b,Math.max(c.length,1),220)}),f.forEach((a,b)=>{g[a.alias]=i(b,Math.max(f.length,1),315)});let h=(b=new Map,e.forEach(a=>{if(!g[a.from_alias]||!g[a.to_alias]||a.from_alias===a.to_alias)return;let c=`${a.from_alias}->${a.to_alias}`,d=b.get(c);b.set(c,{key:c,from:a.from_alias,to:a.to_alias,count:(d?.count||0)+1,content:d?.content||a.content})}),[...b.values()].slice(0,18)),j=new Set;return h.forEach(a=>{j.add(a.from),j.add(a.to)}),{onlineNodes:c,offlineNodes:f,nodePositions:g,flowLinks:h,activeAliases:j}},[e,a,d]),p=g.filter(a=>"working"===a.status).length;return(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 gap-2 text-xs",children:[(0,b.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-green-500/10 text-green-300 border border-green-500/20",children:[p," 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",children:[g.length," online"]}),(0,b.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20",children:[n.length," active links"]})]})]}),(0,b.jsxs)("div",{className:"relative overflow-hidden rounded-lg border border-[#2a2a4a] bg-[#080814] shadow-2xl shadow-cyan-950/30",children:[(0,b.jsx)("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-cyan-400/70 to-transparent"}),(0,b.jsxs)("svg",{viewBox:"0 0 1000 680",className:"w-full h-auto block",preserveAspectRatio:"xMidYMid meet",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:"#0b1220"}),(0,b.jsx)("stop",{offset:"48%",stopColor:"#080814"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"#101018"})]}),(0,b.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:"#22d3ee",stopOpacity:"0.18"}),(0,b.jsx)("stop",{offset:"45%",stopColor:"#22c55e",stopOpacity:"0.045"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"#020617",stopOpacity:"0"})]}),(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"})]})]}),(0,b.jsx)("marker",{id:"topo-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:(0,b.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#67e8f9"})})]}),(0,b.jsx)("rect",{width:"1000",height:"680",fill:"url(#topo-panel)"}),(0,b.jsx)("circle",{cx:500,cy:330,r:"330",fill:"url(#topo-radar)"}),[90,170,250,330].map(a=>(0,b.jsx)("circle",{cx:500,cy:330,r:a,fill:"none",stroke:"#164e63",strokeWidth:"1",opacity:"0.35"},a)),[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:"#164e63",strokeWidth:"1",opacity:"0.18"},a)),g.map(a=>{let c=m[a.alias];if(!c)return null;let d=j({x:500,y:330},c,0);return(0,b.jsx)("path",{d:d,fill:"none",stroke:o.has(a.alias)?"#22d3ee":"#155e75",strokeWidth:o.has(a.alias)?2:1,strokeDasharray:o.has(a.alias)?"none":"8 10",opacity:o.has(a.alias)?.65:.35},`hub-${a.alias}`)}),n.map((a,c)=>{let d=m[a.from],e=m[a.to];if(!d||!e)return null;let f=j(d,e,c%2==0?36:-36),g=Math.min(2+a.count,7);return(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:f,fill:"none",stroke:"#67e8f9",strokeWidth:g,opacity:"0.28",filter:"url(#topo-glow)",markerEnd:"url(#topo-arrow)"}),(0,b.jsx)("path",{id:`flow-path-${c}`,d:f,fill:"none",stroke:"#e0f2fe",strokeWidth:"1",strokeDasharray:"2 12",opacity:"0.75"}),(0,b.jsx)("circle",{r:"4",fill:"#fef08a",filter:"url(#topo-glow)",children:(0,b.jsx)("animateMotion",{dur:`${2.2+c%5*.32}s`,repeatCount:"indefinite",path:f})})]},a.key)}),(0,b.jsxs)("g",{filter:"url(#topo-glow)",children:[(0,b.jsx)("circle",{cx:500,cy:330,r:"56",fill:"#020617",stroke:"#67e8f9",strokeWidth:"2"}),(0,b.jsxs)("circle",{cx:500,cy:330,r:"42",fill:"none",stroke:"#22c55e",strokeWidth:"1.5",opacity:"0.8",children:[(0,b.jsx)("animate",{attributeName:"r",values:"42;52;42",dur:"3s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0.8;0.2;0.8",dur:"3s",repeatCount:"indefinite"})]}),(0,b.jsx)("path",{d:"M470 330 h60 M500 300 v60",stroke:"#e0f2fe",strokeWidth:"5",strokeLinecap:"round",opacity:"0.9"}),(0,b.jsx)("text",{x:500,y:408,textAnchor:"middle",fill:"#e5e7eb",fontSize:"16",fontFamily:"monospace",fontWeight:"700",children:"DASHBOARD"}),(0,b.jsx)("text",{x:500,y:426,textAnchor:"middle",fill:"#64748b",fontSize:"10",fontFamily:"monospace",children:"command relay"})]}),[...g,...h].map(a=>{let c=m[a.alias];if(!c)return null;let e="offline"!==a.status||!!d[a.alias],f=e?"working"===a.status?{label:"working",primary:"#22c55e",halo:"#14532d",text:"#dcfce7"}:"idle"===a.status?{label:"idle",primary:"#2dd4bf",halo:"#134e4a",text:"#ccfbf1"}:{label:a.status||"online",primary:"#38bdf8",halo:"#0c4a6e",text:"#e0f2fe"}:{label:"offline",primary:"#6b7280",halo:"#111827",text:"#9ca3af"},g=o.has(a.alias),h=e?26:18;return(0,b.jsxs)("g",{className:"transition-opacity",children:[g&&(0,b.jsxs)("circle",{cx:c.x,cy:c.y,r:h+14,fill:f.primary,opacity:"0.12",children:[(0,b.jsx)("animate",{attributeName:"r",values:`${h+8};${h+22};${h+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,b.jsx)("circle",{cx:c.x,cy:c.y,r:h+8,fill:f.halo,opacity:e?.55:.25}),(0,b.jsx)("circle",{cx:c.x,cy:c.y,r:h,fill:e?"#020617":"#080814",stroke:f.primary,strokeWidth:e?3:1.5,strokeDasharray:e?"none":"5 5",filter:e?"url(#topo-glow)":void 0}),(0,b.jsx)("circle",{cx:c.x,cy:c.y,r:e?8:5,fill:f.primary}),"working"===a.status&&(0,b.jsx)("path",{d:`M${c.x-9},${c.y+11} h18`,stroke:"#fef08a",strokeWidth:"3",strokeLinecap:"round",children:(0,b.jsx)("animate",{attributeName:"opacity",values:"1;0.25;1",dur:"1.1s",repeatCount:"indefinite"})}),(0,b.jsxs)("g",{transform:`translate(${c.x}, ${c.y+h+22})`,children:[(0,b.jsx)("rect",{x:"-62",y:"-14",width:"124",height:"42",rx:"6",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,b.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:f.text,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:k(a.alias,14)}),(0,b.jsxs)("text",{x:"0",y:"17",textAnchor:"middle",fill:f.primary,fontSize:"9",fontFamily:"monospace",children:[f.label," ",e?`sse:${d[a.alias]}`:""]})]})]},a.alias)}),(0,b.jsxs)("g",{transform:"translate(28, 34)",children:[(0,b.jsx)("rect",{x:"0",y:"0",width:"285",height:60+20*Math.min(n.length,4),rx:"8",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,b.jsx)("text",{x:"16",y:"26",fill:"#e5e7eb",fontSize:"13",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,b.jsxs)("text",{x:"178",y:"26",fill:"#67e8f9",fontSize:"11",fontFamily:"monospace",children:[e.length," messages"]}),n.slice(0,4).map((a,c)=>(0,b.jsxs)("text",{x:"16",y:54+20*c,fill:"#94a3b8",fontSize:"10",fontFamily:"monospace",children:[k(a.from,8)," ","->"," ",k(a.to,8)," / ",a.count," / ",k(a.content,18)]},a.key))]}),(0,b.jsxs)("g",{transform:"translate(720, 34)",children:[(0,b.jsx)("rect",{x:"0",y:"0",width:"250",height:"112",rx:"8",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,b.jsx)("circle",{cx:"18",cy:"26",r:"6",fill:"#22c55e"}),(0,b.jsx)("text",{x:"34",y:"30",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"working node"}),(0,b.jsx)("circle",{cx:"18",cy:"52",r:"6",fill:"#2dd4bf"}),(0,b.jsx)("text",{x:"34",y:"56",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"online idle"}),(0,b.jsx)("circle",{cx:"18",cy:"78",r:"6",fill:"#6b7280"}),(0,b.jsx)("text",{x:"34",y:"82",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"offline / no SSE"}),(0,b.jsx)("path",{d:"M150,78 Q176,52 210,78",fill:"none",stroke:"#67e8f9",strokeWidth:"3",markerEnd:"url(#topo-arrow)"})]})]})]})]})}let m={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:""}},n={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function o({session:a,hasSse:c,sseCount:f,onChat:g}){let h=c&&m[a.status]||n;return(0,b.jsxs)(d.default,{href:`/node?alias=${encodeURIComponent(a.alias)}`,prefetch:!1,className:`block rounded-xl border p-4 transition-all duration-300 cursor-pointer ${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)("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${h.dot} ${c&&"working"===a.status?"animate-pulse":""}`}),(0,b.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:a.alias,children:a.alias})]}),(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",{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)})]})]})]})}function p({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 justify-between text-xs text-gray-500 mb-1.5",children:[(0,b.jsx)("span",{className:"text-blue-400 font-medium",children:a.from_session}),(0,b.jsx)("span",{children:a.created_at})]}),(0,b.jsx)("div",{className:"text-gray-300 leading-relaxed",children:a.content})]},a.id))})]})}function q(){return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono animate-pulse",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"h-7 w-48 bg-gray-800 rounded mb-2"}),(0,b.jsx)("div",{className:"h-4 w-64 bg-gray-800/60 rounded"})]}),(0,b.jsx)("div",{className:"flex gap-3",children:[1,2,3].map(a=>(0,b.jsx)("div",{className:"w-[72px] h-[60px] bg-gray-800/40 rounded-lg border border-gray-800"},a))})]}),(0,b.jsxs)("div",{className:"mb-6 flex gap-2",children:[(0,b.jsx)("div",{className:"flex-1 h-10 bg-gray-800/40 rounded-lg"}),(0,b.jsx)("div",{className:"w-28 h-10 bg-gray-800/40 rounded-lg"})]}),(0,b.jsx)("div",{className:"w-full max-w-4xl mx-auto mb-8 h-64 bg-gray-800/20 rounded-xl"}),(0,b.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[1,2,3,4].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-gray-800/40 p-4 bg-gray-800/20",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-gray-700"}),(0,b.jsx)("div",{className:"h-4 w-24 bg-gray-700 rounded"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("div",{className:"h-3 w-full bg-gray-800/60 rounded"}),(0,b.jsx)("div",{className:"h-3 w-3/4 bg-gray-800/60 rounded"}),(0,b.jsx)("div",{className:"h-3 w-1/2 bg-gray-800/60 rounded"})]})]},a))})]})}function r({hint:a}){return(0,b.jsxs)("div",{className:"text-center py-16",children:[(0,b.jsx)("div",{className:"text-gray-600 text-4xl mb-4",children:"--"}),(0,b.jsx)("h3",{className:"text-gray-400 text-lg font-medium mb-2",children:"No agents in this network"}),a?.global_count?(0,b.jsxs)("p",{className:"text-gray-500 text-sm max-w-md mx-auto",children:["Server has ",(0,b.jsx)("span",{className:"text-cyan-400 font-medium",children:a.global_count})," nodes globally, but none are registered to the current network. Switch network or contact admin."]}):(0,b.jsx)("p",{className:"text-gray-600 text-sm max-w-md mx-auto",children:"Agent sessions will appear here once they connect to the CommHub."})]})}var s=a.i(22397);function t(){let{setNetworkId:a}=(0,s.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,t]=(0,c.useState)(""),[u,v]=(0,c.useState)(""),w=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:u})});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:u})}),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 x=(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:x}),(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.jsx)("button",{onClick:()=>{t(d.user?.display_name||""),v(""),q(!p)},className:"text-xs text-gray-500 hover:text-gray-300",children:"Edit"}),(0,b.jsx)("button",{onClick:()=>{e({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300",children:"Sign out"})]}),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=>t(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:u,onChange:a=>v(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:w,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var u=a.i(31626),v=a.i(15261);function w({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)(x,{alias:a})},a))})]}),(0,b.jsx)(u.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 x({alias:a}){return(0,b.jsx)(v.TaskChatPanel,{alias:a,onClose:()=>{},inline:!0})}function y({sessions:a,onClose:d}){let[e,f]=(0,c.useState)(new Set),[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)("normal"),[k,l]=(0,c.useState)(!1),[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(""),q=a.filter(a=>"offline"!==a.status).filter(a=>!o||a.alias.toLowerCase().includes(o.toLowerCase())||(a.agent||"").toLowerCase().includes(o.toLowerCase())),r=async()=>{if(!g.trim()||0===e.size||k)return;l(!0),n([]);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:i})}),c=await b.json();return{alias:a,ok:!!c.ok,error:c.error}}catch(b){return{alias:a,ok:!1,error:"send failed"}}});n(await Promise.all(a)),l(!1)},s=m.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",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",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:o,onChange:a=>p(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===q.length?f(new Set):f(new Set(q.map(a=>a.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:e.size===q.length?"Deselect all":`Select all (${q.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:[q.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)("div",{className:`w-2 h-2 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===q.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:i,onChange:a=>j(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:r,disabled:k||!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:k?(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":""}`})]})]}),m.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:[s,"/",m.length," dispatched successfully"]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:m.map(a=>(0,b.jsxs)("span",{className:`text-[10px] px-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:[a.alias,": ",a.ok?"✓":a.error||"✗"]},a.alias))})]})]})]})]})]})}var z=a.i(44332),A=a.i(64565);a.s(["default",0,function(){(0,c.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:a,hint:g,error:i,isLoading:j}=(0,z.useSessions)(),{health:k}=(0,z.useHealth)(),{config:m}=(0,z.useAnetConfig)(),{tasks:n}=(0,z.useTasks)({limit:"500"}),{stats:s}=(0,z.useStats)(),{license:u}=(0,z.useLicense)(),[v,x]=(0,c.useState)(!1),[B,C]=(0,c.useState)(!1),D=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}}(),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)([]),{mutate:I}=(0,A.useSWRConfig)(),{connected:J,supported:K}=function({url:a,onEvent:b,reconnectDelay:d=3e3,enabled:e=!0}){let[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(null),l=(0,c.useRef)(null),m=(0,c.useRef)(void 0),n=(0,c.useRef)(!1),o=(0,c.useRef)(null),p=(0,c.useRef)(!1),q=(0,c.useCallback)(()=>{if(!e||!a||n.current||p.current)return;l.current&&(l.current.close(),l.current=null),o.current&&o.current.abort();let c=a.includes("?")?`${a}&probe=1`:`${a}?probe=1`,f=new AbortController;o.current=f;let h=setTimeout(()=>f.abort(),5e3);fetch(c,{method:"HEAD",cache:"no-store",signal:f.signal}).finally(()=>clearTimeout(h)).then(c=>{if(p.current)return;if("true"!==c.headers.get("x-anet-sse-available")){n.current=!0,g(!1),k(!1);return}k(!0);let e=new EventSource(a);l.current=e,e.onopen=()=>g(!0),e.onmessage=a=>{try{let c=JSON.parse(a.data);i(c),b?.(c)}catch{}},e.onerror=()=>{g(!1),e.close(),l.current=null,p.current||(m.current=setTimeout(q,d))}}).catch(()=>{p.current||(g(!1),k(!1))})},[a,b,d,e]);return(0,c.useEffect)(()=>(n.current=!1,p.current=!1,k(!!e&&null),q(),()=>{p.current=!0,o.current&&(o.current.abort(),o.current=null),l.current&&(l.current.close(),l.current=null),m.current&&clearTimeout(m.current)}),[q]),{connected:f,lastEvent:h,supported:j}}({url:"/api/hub/events",enabled:"1"!==process.env.NEXT_PUBLIC_DISABLE_SSE,onEvent:a=>{["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(a.type)&&(I("/api/hub/status"),I(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&&H(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)},[]),j)return(0,b.jsx)(q,{});let L=k?.sse_sessions||{},M=a=>"offline"!==a.status||!!L[a.alias],N=a.filter(M).length,O=a.length,P=a.filter(a=>"working"===a.status).length,Q=k?(0,e.formatUptime)(k.uptime):"--",R=k?.version||"--",S=!!(m?.hub&&m.tokenConfigured),T=m?.source==="file"?"Local config":m?.source==="runtime-env"?"Runtime env":"Config missing",U={};if(s?.tasks?.by_status?.length)for(let a of s.tasks.by_status)U[a.status]=a.count;else for(let a of n)U[a.status]=(U[a.status]||0)+1;let V=[...a].sort((a,b)=>{let c=+!!M(a),d=+!!M(b);if(c!==d)return d-c;let e=+("working"===a.status);return("working"===b.status)-e});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:N,working:P,total:O,version:R,uptime:Q})}),(0,b.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,b.jsx)("button",{onClick:()=>F(!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)(t,{})})]}),(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:()=>C(!B),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 ${S?"bg-green-400":"bg-red-400"}`}),(0,b.jsx)("span",{className:"text-gray-500",children:T})]}),(0,b.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${B?"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"})})]}),B&&(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:m?.hub||void 0,children:["Hub: ",(0,b.jsx)("span",{className:m?.hub?"text-cyan-300":"text-red-300",children:m?.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 ${m?.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: ",m?.tokenPreview||"not configured"]})})]}),m?.error&&(0,b.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:m.error})]})]}),Object.keys(U).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:[{key:"running",color:"bg-green-500/10 text-green-300 border-green-500/20"},{key:"delivered",color:"bg-blue-500/10 text-blue-300 border-blue-500/20"},{key:"acked",color:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"},{key:"replied",color:"bg-purple-500/10 text-purple-300 border-purple-500/20"},{key:"failed",color:"bg-red-500/10 text-red-300 border-red-500/20"},{key:"cancelled",color:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20"},{key:"expired",color:"bg-orange-500/10 text-orange-300 border-orange-500/20"},{key:"closed",color:"bg-gray-500/10 text-gray-500 border-gray-500/20"}].filter(({key:a})=>U[a]).map(({key:a,color:c})=>(0,b.jsxs)(d.default,{href:`/tasks?status=${a}`,prefetch:!1,className:`px-2.5 py-1 rounded-md border text-xs ${c} hover:opacity-80 transition-opacity`,children:[a,": ",U[a]]},a))})]}),(0,b.jsx)("section",{className:"mb-6 grid grid-cols-3 sm:grid-cols-6 gap-2",children:[{href:"/nodes",label:"Nodes",value:`${N}/${O}`,color:"text-green-400 border-green-500/15"},{href:"/tasks",label:"Tasks",value:String(Object.values(U).reduce((a,b)=>a+b,0)||"--"),color:"text-cyan-400 border-cyan-500/15"},{href:"/tasks?status=failed",label:"Failed",value:String(U.failed||0),color:U.failed?"text-red-400 border-red-500/20":"text-gray-600 border-gray-700/30"},{href:"/messages",label:"Messages",value:"→",color:"text-blue-400 border-blue-500/15"},{href:"/logs",label:"Logs",value:"→",color:"text-purple-400 border-purple-500/15"},{href:"/admin",label:"Admin",value:"→",color:"text-gray-400 border-gray-500/15"}].map(a=>(0,b.jsxs)(d.default,{href:a.href,prefetch:!1,className:`text-center rounded-xl border ${a.color} bg-[#111128] px-3 py-2.5 hover:bg-[#161630] transition-colors`,children:[(0,b.jsx)("div",{className:`text-lg font-bold tabular-nums ${a.color.split(" ")[0]}`,children:a.value}),(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:a.label})]},a.href))}),(0,b.jsx)(h,{}),n.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:n.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 ${"replied"===a.status?"bg-purple-400":"running"===a.status?"bg-green-400":"failed"===a.status?"bg-red-400":"bg-blue-400"}`}),(0,b.jsx)("span",{className:"text-blue-400 shrink-0",children:a.from_name||"?"}),(0,b.jsx)("span",{className:"text-gray-600",children:"→"}),(0,b.jsx)("span",{className:"text-cyan-400 shrink-0",children:a.to_name||"?"}),(0,b.jsx)("span",{className:"text-gray-500 truncate flex-1",children:a.content?.slice(0,40)||"--"}),(0,b.jsx)("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] border ${"replied"===a.status?"text-purple-300 border-purple-500/20":"failed"===a.status?"text-red-300 border-red-500/20":"text-gray-500 border-gray-700/30"}`,children:a.status})]},a.task_id))})]}),i&&(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(i)}),(0,b.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),a.length>0&&(0,b.jsx)("div",{className:"flex justify-center mb-4",children:(0,b.jsx)("button",{onClick:()=>x(!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&&a.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&&a.length>0&&(0,b.jsx)(l,{sessions:a,sseSessions:L}),0!==a.length||i?(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",children:V.map(a=>(0,b.jsx)(o,{session:a,hasSse:M(a),sseCount:L[a.alias]||0,onChat:D.openTab},a.alias))}):(0,b.jsx)(r,{hint:g}),(0,b.jsx)(p,{messages:G}),(0,b.jsxs)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:[K&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${J?"bg-green-400":"bg-gray-600"}`}),J?"SSE live":"SWR polling"]}),u?.license&&(0,b.jsxs)(b.Fragment,{children:[K&&(0,b.jsx)(b.Fragment,{children:"·"}),(0,b.jsxs)("span",{className:u.license.days_left<=7?"text-red-400":"pro"===u.license.type?"text-green-400":"text-yellow-400",children:[u.license.type," (",u.license.days_left,"d left)"]})]})]}),E&&(0,b.jsx)(y,{sessions:a,onClose:()=>F(!1)}),D.tabs.length>0&&(0,b.jsx)(w,{tabs:D.tabs,activeTab:D.activeTab,onOpenTab:D.openTab,onCloseTab:D.closeTab,onSetActive:D.setActiveTab,onClose:D.closeAll})]})}],60350)}];
2
2
 
3
3
  //# sourceMappingURL=app_page_tsx_0es_sk2._.js.map