@bpinhosilva/agent-orchestrator 1.1.3 → 1.2.0

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 (93) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +7 -0
  3. package/dist/cli/commands/run.command.js +20 -1
  4. package/dist/cli/commands/setup.command.js +13 -0
  5. package/dist/cli/constants.js +2 -1
  6. package/dist/cli/env.js +2 -0
  7. package/dist/cli/preload.js +12 -0
  8. package/dist/cli/process-manager.js +33 -29
  9. package/dist/cli/setup/index.js +24 -0
  10. package/dist/cli/setup/validators.js +14 -0
  11. package/dist/config/env.validation.js +6 -0
  12. package/dist/config/runtime-logger.js +214 -0
  13. package/dist/main.js +8 -0
  14. package/dist/ui/assets/{AgentFleet-BarfEwcK.js → AgentFleet-B8p5vbKK.js} +1 -1
  15. package/dist/ui/assets/{AttachmentItem-Cerhbyya.js → AttachmentItem-C_uUACPz.js} +1 -1
  16. package/dist/ui/assets/{ConfirmDialog-y3vTcqFR.js → ConfirmDialog-BltdtevE.js} +1 -1
  17. package/dist/ui/assets/{CreateRecurrentTaskModal-BgfnJ1n8.js → CreateRecurrentTaskModal-CGSdgNAf.js} +1 -1
  18. package/dist/ui/assets/{CreateTaskModal-BH9lOLYT.js → CreateTaskModal-XNvIWKz3.js} +1 -1
  19. package/dist/ui/assets/{ExecLogModal-ShacCOOV.js → ExecLogModal-BYTGF04P.js} +1 -1
  20. package/dist/ui/assets/{MarkdownField--1gpyapw.js → MarkdownField-DR6tHsei.js} +1 -1
  21. package/dist/ui/assets/{Profile-qnuRN5Qv.js → Profile-ByioVLM8.js} +1 -1
  22. package/dist/ui/assets/{ProjectDetail-ZYQG9yn2.js → ProjectDetail-dwZDzb0m.js} +1 -1
  23. package/dist/ui/assets/{Providers-DR7srJHq.js → Providers-JAClEFt0.js} +1 -1
  24. package/dist/ui/assets/{Scheduler-Bs3DC0re.js → Scheduler-C1HQNxQ6.js} +2 -2
  25. package/dist/ui/assets/{Settings-C3ad44vP.js → Settings-Cjn2xdo1.js} +1 -1
  26. package/dist/ui/assets/{TaskDetail-D-f_Ao2a.js → TaskDetail-Blphf9tw.js} +1 -1
  27. package/dist/ui/assets/{TaskExecutions-BeodRIz1.js → TaskExecutions-ydR4KPCY.js} +3 -3
  28. package/dist/ui/assets/{TaskManager-BA2Y31ut.js → TaskManager-DrFbuAwN.js} +3 -3
  29. package/dist/ui/assets/{UserDetail-BvWm-U4y.js → UserDetail-mWjJPTzO.js} +1 -1
  30. package/dist/ui/assets/{Users-CQNcXLyV.js → Users-FaX0thJx.js} +1 -1
  31. package/dist/ui/assets/{activity-CmAajKmR.js → activity-B_2QSywM.js} +1 -1
  32. package/dist/ui/assets/{agents-b8btewki.js → agents-YQJ7JNfI.js} +1 -1
  33. package/dist/ui/assets/{auth-dROenHXk.js → auth-Lh2N3iYN.js} +1 -1
  34. package/dist/ui/assets/{bot-QVmnxPf4.js → bot-DadO9w3D.js} +1 -1
  35. package/dist/ui/assets/{box-Bw_pyYzU.js → box-CFDcDxHv.js} +1 -1
  36. package/dist/ui/assets/{brain-C6vlLcg3.js → brain-DWTpby6b.js} +1 -1
  37. package/dist/ui/assets/{briefcase-DtHlat45.js → briefcase-mFWNV6w9.js} +1 -1
  38. package/dist/ui/assets/check-BiORptL3.js +1 -0
  39. package/dist/ui/assets/chevron-down-BUOg3vvd.js +1 -0
  40. package/dist/ui/assets/chevron-left-B0NmQyxK.js +1 -0
  41. package/dist/ui/assets/chevron-right-Bm_d1KKk.js +1 -0
  42. package/dist/ui/assets/{circle-alert-pUx6yhcF.js → circle-alert-sCcf7ANF.js} +1 -1
  43. package/dist/ui/assets/circle-check-Jz8IOE4h.js +1 -0
  44. package/dist/ui/assets/client-B553SX3l.js +9 -0
  45. package/dist/ui/assets/clock-CSNFJjo4.js +1 -0
  46. package/dist/ui/assets/{cpu-8Sbc9Dk0.js → cpu-C2_GFeSH.js} +1 -1
  47. package/dist/ui/assets/{database-D6O4hvbm.js → database-zXW48-_N.js} +1 -1
  48. package/dist/ui/assets/{download-DHcd5oLD.js → download-DZdOdijy.js} +1 -1
  49. package/dist/ui/assets/{eye-Cc-vy4Zu.js → eye-CjrFwZG_.js} +1 -1
  50. package/dist/ui/assets/{file-text-DWBSXx5l.js → file-text-CX_Yqfjf.js} +1 -1
  51. package/dist/ui/assets/{index-BvUv9Lzq.js → index-IcLlFUZs.js} +3 -3
  52. package/dist/ui/assets/{info-1jA6X-_e.js → info-DGHChFI6.js} +1 -1
  53. package/dist/ui/assets/{layers-BcHXXg-4.js → layers-CVf8_Byb.js} +1 -1
  54. package/dist/ui/assets/loader-circle-CB6PQwdc.js +1 -0
  55. package/dist/ui/assets/{panels-top-left-Vk8FzAxf.js → panels-top-left-Cp169WzB.js} +1 -1
  56. package/dist/ui/assets/{paperclip-DWJjaP8B.js → paperclip-5Y367YTj.js} +1 -1
  57. package/dist/ui/assets/plus-CkteVqhM.js +1 -0
  58. package/dist/ui/assets/{projects-CUOthD8N.js → projects-DoalTI7c.js} +1 -1
  59. package/dist/ui/assets/{providers-CNrSTcdc.js → providers-AawjMy3x.js} +1 -1
  60. package/dist/ui/assets/{recurrent-tasks-CKT47N2l.js → recurrent-tasks-7thk45mk.js} +1 -1
  61. package/dist/ui/assets/{refresh-cw-DQW6jR7M.js → refresh-cw-BgDsJOC_.js} +1 -1
  62. package/dist/ui/assets/{rocket-CMSwBl_C.js → rocket-B9Iexkcw.js} +1 -1
  63. package/dist/ui/assets/{save-DycJmlX0.js → save-Cmqi1IkN.js} +1 -1
  64. package/dist/ui/assets/{send-BZjwSrJW.js → send-iK1X7WSe.js} +1 -1
  65. package/dist/ui/assets/{server-CJE2K1Vt.js → server-BBmM-vrg.js} +1 -1
  66. package/dist/ui/assets/{settings-at7JqFrc.js → settings-BpKLGxm8.js} +1 -1
  67. package/dist/ui/assets/{shield-alert-CP5GVXxa.js → shield-alert-Do_Sg9SX.js} +1 -1
  68. package/dist/ui/assets/{shield-check-Cr4SHjdR.js → shield-check-YKs9kUNq.js} +1 -1
  69. package/dist/ui/assets/{sparkles-v57Nc-z-.js → sparkles-krUpxie4.js} +1 -1
  70. package/dist/ui/assets/{taskFormSchemas-dl1t1OyX.js → taskFormSchemas-B6YlRxrx.js} +1 -1
  71. package/dist/ui/assets/{tasks-DEUQCNoH.js → tasks-DHsBE-ea.js} +1 -1
  72. package/dist/ui/assets/{terminal-a6AV2mPO.js → terminal-B6iyNuAm.js} +1 -1
  73. package/dist/ui/assets/{trash-2-DJpTXgEP.js → trash-2-CphQfk35.js} +1 -1
  74. package/dist/ui/assets/{trending-up-DlrXEXE6.js → trending-up-ClGbkbN9.js} +1 -1
  75. package/dist/ui/assets/user-Brcjlps5.js +1 -0
  76. package/dist/ui/assets/{user-plus-nDkwsBT1.js → user-plus-0Y0M1GKi.js} +1 -1
  77. package/dist/ui/assets/{users-C6WiDiuN.js → users-BcnlUG5N.js} +1 -1
  78. package/dist/ui/assets/{users-Ef6Sh2iR.js → users-tdyaGZbx.js} +1 -1
  79. package/dist/ui/assets/x-CCZGYGDC.js +1 -0
  80. package/dist/ui/assets/{zap-BmhZqgvm.js → zap-BDAytXMX.js} +1 -1
  81. package/dist/ui/index.html +17 -17
  82. package/package.json +1 -1
  83. package/dist/ui/assets/check-DTei8Qlg.js +0 -1
  84. package/dist/ui/assets/chevron-down-LTeQHW9O.js +0 -1
  85. package/dist/ui/assets/chevron-left-CJc_eQid.js +0 -1
  86. package/dist/ui/assets/chevron-right-G5-HRo_C.js +0 -1
  87. package/dist/ui/assets/circle-check-B9kyRki5.js +0 -1
  88. package/dist/ui/assets/client-BGOBXkO8.js +0 -9
  89. package/dist/ui/assets/clock-BY4rrypg.js +0 -1
  90. package/dist/ui/assets/loader-circle-Cl6yIkPK.js +0 -1
  91. package/dist/ui/assets/plus-Dx6G8SOZ.js +0 -1
  92. package/dist/ui/assets/user--KOoEB9m.js +0 -1
  93. package/dist/ui/assets/x-wDy15QMx.js +0 -1
@@ -1 +1 @@
1
- import{a as e,t}from"./rolldown-runtime-COnpUsM8.js";import{g as n}from"./vendor-dnd-CfaHPvi0.js";import{c as r,s as i}from"./vendor-react-BmVaKUwY.js";import{i as a,n as o,t as s}from"./vendor-query-xpDrc4rM.js";import{n as c,r as l,t as u}from"./vendor-markdown-DoJbQ1of.js";import{i as d,t as f}from"./client-BGOBXkO8.js";import{t as p}from"./chevron-right-G5-HRo_C.js";import{t as m}from"./MarkdownField--1gpyapw.js";import{t as h}from"./save-DycJmlX0.js";import{t as g}from"./send-BZjwSrJW.js";import{t as _}from"./shield-check-Cr4SHjdR.js";import{t as v}from"./trash-2-DJpTXgEP.js";import{t as y}from"./ConfirmDialog-y3vTcqFR.js";import{t as b}from"./user--KOoEB9m.js";import{t as x}from"./zap-BmhZqgvm.js";import{n as S}from"./AuthContextInstance-DiFo9Qb2.js";import{n as C}from"./agents-b8btewki.js";import{t as w}from"./useNotification-DQayTSUL.js";import{a as T}from"./agentEmojis-BQA0jC3z.js";import{a as E,c as D,o as O,s as ee}from"./vendor-forms-DHyqHeyd.js";import{i as k,n as A,t as j}from"./tasks-DEUQCNoH.js";import{o as te}from"./taskFormSchemas-dl1t1OyX.js";import{t as M}from"./AttachmentItem-Cerhbyya.js";var ne=d(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),re=d(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),N=d(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),ie=d(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),ae=d(`wallet`,[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]),P=e(n(),1),F={USER:`user`,AGENT:`agent`},I={create:async(e,t)=>(await f.post(`/tasks/${e}/comments`,t)).data,findAllByTask:async e=>(await f.get(`/tasks/${e}/comments`)).data,remove:async(e,t)=>{await f.delete(`/tasks/${e}/comments/${t}`)}},L=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||(e(t,E,w),e.$i=!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),R=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e=e||{};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),z=e(L(),1),B=e(R(),1),V=l();z.default.extend(B.default);var H=({comment:e,onDelete:t})=>{let n=e.authorType===F.AGENT,r=n?e.authorAgent?.name:e.authorUser?.username,i=n?e.authorAgent?.avatarUrl:e.authorUser?.avatarUrl,a=n?T(e.authorAgent?.emoji):null;return(0,V.jsxs)(`div`,{className:`flex gap-4 group`,children:[(0,V.jsx)(`div`,{className:`flex-shrink-0 h-10 w-10 rounded-xl flex items-center justify-center border transition-all ${n?`bg-tertiary/10 border-tertiary/20 text-tertiary shadow-[0_0_15px_rgba(221,183,255,0.1)]`:`bg-primary/10 border-primary/20 text-primary shadow-[0_0_15px_rgba(173,198,255,0.1)]`}`,children:n?(0,V.jsx)(`span`,{className:`text-2xl`,"aria-label":`${r} emoji`,children:a}):i?(0,V.jsx)(`img`,{src:i,alt:r,className:`h-full w-full object-cover p-1`}):(0,V.jsx)(b,{size:20})}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-sm font-headline font-bold ${n?`text-tertiary`:`text-primary`}`,children:r||`Anonymous`}),n&&(0,V.jsx)(`span`,{className:`px-1.5 py-0.5 bg-tertiary/10 text-tertiary text-[9px] font-black uppercase tracking-widest rounded border border-tertiary/20`,children:`Agent`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-on-surface-variant/40 lowercase`,children:(0,z.default)(e.createdAt).format(`MMM DD, YYYY HH:mm:ss`)}),t&&(0,V.jsx)(`button`,{onClick:()=>t(e.id),className:`opacity-0 group-hover:opacity-100 p-2 hover:bg-error/10 text-on-surface-variant/40 hover:text-error rounded-lg transition-all`,title:`Delete comment`,children:(0,V.jsx)(v,{size:18})})]})]}),(0,V.jsxs)(`div`,{className:`bg-surface-container-high/40 border border-outline-variant/5 p-4 rounded-xl shadow-sm group-hover:bg-surface-container-high/60 transition-colors`,children:[(0,V.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none text-on-surface leading-relaxed`,children:(0,V.jsx)(c,{remarkPlugins:[u],children:e.content})}),e.artifacts&&e.artifacts.length>0&&(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3 mt-4 pt-4 border-t border-outline-variant/10`,children:e.artifacts.map(e=>(0,V.jsx)(M,{name:e.originalName,type:e.mimeType.split(`/`)[1]||`file`,filePath:e.filePath,size:`Artifact`},e.id))})]})]})]})},U=({comments:e,isLoading:t,onDelete:n})=>(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 py-6 custom-scrollbar`,children:t?(0,V.jsx)(`div`,{className:`space-y-6 animate-pulse`,children:[1,2,3].map(e=>(0,V.jsxs)(`div`,{className:`flex gap-4`,children:[(0,V.jsx)(`div`,{className:`h-10 w-10 bg-surface-container-highest rounded-xl`}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-3`,children:[(0,V.jsx)(`div`,{className:`h-4 w-1/4 bg-surface-container-highest rounded`}),(0,V.jsx)(`div`,{className:`h-20 w-full bg-surface-container-highest rounded-xl`})]})]},e))}):e.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 text-center space-y-4 bg-surface-container-high/20 rounded-2xl border border-dashed border-outline-variant/20`,children:[(0,V.jsx)(`div`,{className:`h-12 w-12 rounded-full bg-surface-container-highest flex items-center justify-center text-on-surface-variant/40`,children:(0,V.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`p`,{className:`text-sm font-bold text-on-surface`,children:`No comments yet`}),(0,V.jsx)(`p`,{className:`text-xs text-on-surface-variant/60`,children:`Start the conversation by adding a comment below.`})]})]}):(0,V.jsx)(`div`,{className:`space-y-8`,children:e.map(e=>(0,V.jsx)(H,{comment:e,onDelete:n},e.id))})}),W=({onSend:e,isSending:t})=>{let[n,r]=(0,P.useState)(``),i=()=>{n.trim()&&!t&&(e(n),r(``))};return(0,V.jsxs)(`div`,{className:`bg-surface-container-low border border-outline-variant/10 rounded-2xl p-4 shadow-2xl shadow-primary/5 focus-within:border-primary/30 transition-all space-y-4`,children:[(0,V.jsx)(m,{value:n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&i()},placeholder:`Write a comment...`,height:`min-h-[120px]`}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between pt-4 border-t border-outline-variant/5`,children:[(0,V.jsx)(`div`,{className:`flex items-center gap-1`}),(0,V.jsx)(`button`,{onClick:i,disabled:!n.trim()||t,className:`flex items-center gap-2 px-5 py-2.5 rounded-xl font-bold text-xs uppercase tracking-widest transition-all active:scale-95 disabled:opacity-50 disabled:active:scale-100 ${n.trim()?`bg-gradient-to-r from-primary to-primary/80 text-on-primary shadow-lg shadow-primary/20 hover:brightness-110`:`bg-surface-container-highest text-on-surface-variant cursor-not-allowed`}`,children:t?(0,V.jsx)(`div`,{className:`w-4 h-4 rounded-full border-2 border-on-primary/30 border-t-on-primary animate-spin`}):(0,V.jsxs)(V.Fragment,{children:[`Send`,(0,V.jsx)(g,{size:14})]})})]})]})},oe=({taskId:e})=>{let[t,n]=(0,P.useState)(!1),[r,i]=(0,P.useState)(null),[s,c]=(0,P.useState)(!1),{user:l}=S(),{notifySuccess:u,notifyApiError:d}=w(),f=a(),{data:p=[],isLoading:m}=o({queryKey:[`comments`,e],queryFn:async()=>[...await I.findAllByTask(e)].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()),enabled:!!e,refetchInterval:1e4}),h=(0,P.useCallback)(()=>{f.invalidateQueries({queryKey:[`comments`,e]})},[f,e]);return(0,V.jsxs)(`div`,{className:`bg-surface-container-low rounded-2xl border border-outline-variant/10 shadow-2xl shadow-primary/5 overflow-hidden flex flex-col h-full`,children:[(0,V.jsxs)(`div`,{className:`p-6 border-b border-outline-variant/5 flex items-center justify-between bg-surface-container-low/50 backdrop-blur-md sticky top-0 z-10`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`div`,{className:`bg-primary/20 p-2.5 rounded-xl shadow-lg shadow-primary/10`,children:(0,V.jsx)(N,{size:22,className:`text-secondary stroke-[2.5]`})}),(0,V.jsx)(`h2`,{className:`text-lg font-headline font-black tracking-tight text-on-surface`,children:`Comments & Activity`})]}),(0,V.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,V.jsxs)(`span`,{className:`text-[10px] bg-white/5 border border-white/10 px-2 py-0.5 rounded text-white/40 font-mono tracking-widest uppercase`,children:[p.length,` Logged`]})})]}),(0,V.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,V.jsx)(U,{comments:p,isLoading:m,onDelete:e=>{i(e)}})}),(0,V.jsx)(`div`,{className:`p-6 bg-surface-container-low/50 border-t border-outline-variant/5 backdrop-blur-md`,children:(0,V.jsx)(W,{onSend:async t=>{if(!(!e||!l))try{n(!0),await I.create(e,{content:t,authorType:F.USER,authorUserId:l.id}),h()}catch{}finally{n(!1)}},isSending:t})}),(0,V.jsx)(y,{isOpen:!!r,onClose:()=>!s&&i(null),onConfirm:async()=>{if(!(!e||!r))try{c(!0),await I.remove(e,r),h(),i(null),u(`Protocol Cleared`,`The comment data has been purged from the orchestration logs.`)}catch(e){d(e,`Purge Failed`)}finally{c(!1)}},title:`Purge Communication Protocol?`,message:`This action will permanently erase the selected entry and all its associated artifacts from the neural stream. This operation is irreversible.`,confirmText:`Execute Purge`,variant:`danger`,loading:s})]})},G=[`#6366f1`,`#8b5cf6`,`#a855f7`,`#d946ef`,`#ec4899`,`#f43f5e`,`#ef4444`,`#f97316`,`#eab308`,`#84cc16`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#0ea5e9`,`#3b82f6`,`#6d28d9`];function K(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}var se=({name:e,size:t=40,className:n=``})=>{let r=(0,P.useMemo)(()=>{let t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():(t[0]?.[0]??`U`).toUpperCase()},[e]),i=(0,P.useMemo)(()=>G[K(e)%G.length],[e]);return(0,V.jsx)(`div`,{role:`img`,"aria-label":`${e} avatar`,className:`inline-flex items-center justify-center rounded-full text-white font-bold select-none shrink-0 ${n}`,style:{width:t,height:t,backgroundColor:i,fontSize:t*.38},children:r})},ce={title:``,description:``,status:A.BACKLOG,priority:j.MEDIUM,assigneeId:``},q=()=>{let{projectId:e,taskId:t}=r(),n=i(),c=a(),{notifyApiError:l,notifyError:u,notifySuccess:d}=w(),[f,g]=(0,P.useState)(!1),b=(0,P.useId)(),S=(0,P.useId)(),T=(0,P.useId)(),M=(0,P.useId)(),N=(0,P.useId)(),{control:F,formState:{errors:I,isDirty:L},handleSubmit:R,register:z,reset:B,setValue:H}=ee({resolver:E(te),defaultValues:ce,mode:`onBlur`}),U=o({queryKey:[`task`,e,t],enabled:!!(e&&t),queryFn:async()=>(await k.findOne(e,t)).data}),W=o({queryKey:[`agents`],queryFn:async()=>(await C.findAll()).data});(0,P.useEffect)(()=>{U.error&&l(U.error,`Fetch Error`)},[l,U.error]),(0,P.useEffect)(()=>{W.error&&l(W.error,`Agents Load Failed`)},[W.error,l]),(0,P.useEffect)(()=>{if(!U.data)return;let e=U.data.status===A.ARCHIVED?A.BACKLOG:U.data.status;B({title:U.data.title,description:U.data.description,status:e,priority:Number(U.data.priority),assigneeId:U.data.assignee?.id??``})},[B,U.data]);let G=s({mutationFn:async n=>{if(!e||!t)throw Error(`Task route is missing required identifiers`);return await k.update(e,t,{title:n.title,description:n.description,status:n.status,priority:n.priority,assigneeId:n.assigneeId||null}),n},onSuccess:n=>{!e||!t||(c.invalidateQueries({queryKey:[`task`,e,t]}),c.invalidateQueries({queryKey:[`tasks`,e]}),B(n),d(`Task Updated`,`Intelligence node parameters successfully reconfigured.`))},onError:e=>{l(e,`Update Failed`)}}),K=s({mutationFn:async()=>{if(!e||!t)throw Error(`Task route is missing required identifiers`);await k.delete(e,t)},onSuccess:()=>{e&&c.invalidateQueries({queryKey:[`tasks`,e]}),c.removeQueries({queryKey:[`task`,e,t]}),d(`Task Decommissioned`,`Intelligence node removed from the orchestration grid.`),n(`/`)},onError:e=>{l(e,`Decommission Failed`)}}),q=U.data,J=(0,P.useMemo)(()=>W.data??[],[W.data]),le=D({control:F,name:`title`}),Y=D({control:F,name:`status`}),ue=D({control:F,name:`priority`}),X=D({control:F,name:`assigneeId`}),Z=(0,P.useMemo)(()=>J.find(e=>e.id===X)??null,[J,X]),Q=U.isPending||G.isPending||K.isPending,de=R(async e=>{await G.mutateAsync(e)},()=>{u(`Validation Error`,`Please review the highlighted fields before saving.`)}),fe=()=>{K.isPending||g(!0)};if(U.isPending)return(0,V.jsx)(`div`,{className:`w-full h-[60vh] flex items-center justify-center`,"aria-busy":`true`,children:(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,V.jsx)(`div`,{className:`w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin`}),(0,V.jsx)(`p`,{className:`text-on-surface-variant text-sm font-black uppercase tracking-[0.3em] animate-pulse`,children:`Accessing Node Data`})]})});if(!q)return(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto w-full py-16 text-center space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-sm font-black uppercase tracking-[0.2em] text-on-surface-variant/60`,children:`Task intelligence node unavailable`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(`/`),className:`px-5 py-2 rounded-xl bg-surface-container-high text-on-surface hover:bg-surface-container-highest transition-colors`,children:`Return to Task Manager`})]});let $=`#NODE-${q.id.substring(0,4).toUpperCase()}`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`max-w-7xl mx-auto w-full space-y-8 animate-in fade-in duration-500`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,V.jsxs)(`nav`,{className:`flex items-center space-x-2 text-sm text-on-surface-variant font-medium`,"aria-label":`Task breadcrumb`,children:[(0,V.jsx)(`button`,{type:`button`,className:`hover:text-primary transition-colors`,onClick:()=>n(`/`),children:`Task Manager`}),(0,V.jsx)(p,{size:16,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`text-on-surface`,children:$})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:fe,disabled:Q,className:`flex items-center gap-2 px-4 py-2 text-xs font-black uppercase tracking-widest text-error hover:bg-error/10 transition-all rounded-xl active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed`,children:[(0,V.jsx)(v,{size:16,"aria-hidden":`true`}),`Decommission`]}),(0,V.jsxs)(`button`,{type:`button`,disabled:!0,"aria-disabled":`true`,className:`flex items-center gap-2 px-4 py-2 text-xs font-black uppercase tracking-widest text-on-surface bg-surface-container-high hover:bg-surface-container-highest transition-all rounded-xl opacity-50 cursor-not-allowed`,children:[(0,V.jsx)(re,{size:16,"aria-hidden":`true`}),`Halt execution`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:de,disabled:Q||!L,className:`flex items-center gap-2 px-6 py-2 text-xs font-black uppercase tracking-widest bg-primary text-on-primary rounded-xl shadow-lg shadow-primary/20 hover:scale-105 transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100`,children:[(0,V.jsx)(h,{size:16,"aria-hidden":`true`}),G.isPending?`Synchronizing...`:`Save Protocol`]})]})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-6`,children:[(0,V.jsxs)(`div`,{className:`lg:col-span-8 flex flex-col gap-6`,children:[(0,V.jsxs)(`div`,{className:`bg-surface-container-low p-8 rounded-2xl border border-outline-variant/10 shadow-2xl relative overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`absolute top-0 right-0 w-32 h-32 bg-primary/5 rounded-full blur-3xl -mr-16 -mt-16`}),(0,V.jsxs)(`div`,{className:`flex items-start justify-between mb-10 relative z-10 gap-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,V.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-[0.2em] text-primary/70`,children:`Intelligence Node identifier`}),(0,V.jsxs)(`h2`,{className:`text-3xl font-headline font-black text-white tracking-tight break-words`,children:[$,`: `,le||q.title]})]}),(0,V.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,V.jsxs)(`select`,{...z(`status`),"aria-invalid":!!I.status,"aria-describedby":I.status?b:void 0,className:`appearance-none cursor-pointer px-6 py-2 rounded-xl border font-black text-[10px] uppercase tracking-widest outline-none transition-all hover:brightness-110 active:scale-95 ${Y===A.DONE?`bg-secondary/10 border-secondary/20 text-secondary`:Y===A.IN_PROGRESS?`bg-primary/10 border-primary/20 text-primary`:`bg-surface-container-highest/50 border-outline-variant/20 text-on-surface-variant`}`,children:[(0,V.jsx)(`option`,{value:A.BACKLOG,className:`bg-surface-container-low`,children:`Backlog`}),(0,V.jsx)(`option`,{value:A.IN_PROGRESS,className:`bg-surface-container-low`,children:`In Progress`}),(0,V.jsx)(`option`,{value:A.REVIEW,className:`bg-surface-container-low`,children:`Review`}),(0,V.jsx)(`option`,{value:A.DONE,className:`bg-surface-container-low`,children:`Done`})]}),Y===A.IN_PROGRESS&&(0,V.jsxs)(`span`,{className:`absolute -left-1 -top-1 flex h-2 w-2`,"aria-hidden":`true`,children:[(0,V.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75`}),(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-primary`})]})]})]}),I.status&&(0,V.jsx)(`p`,{id:b,className:`mb-6 text-xs text-error font-semibold`,children:I.status.message}),(0,V.jsxs)(`div`,{className:`space-y-8 relative z-10`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`label`,{htmlFor:`task-detail-title`,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 ml-1`,children:`Node Designation`}),(0,V.jsx)(`input`,{id:`task-detail-title`,className:`w-full bg-surface-container-highest/30 border border-outline-variant/10 rounded-xl px-4 py-3 text-sm text-white focus:ring-1 focus:ring-primary/40 focus:bg-surface-container-highest/50 transition-all outline-none font-medium`,type:`text`,"aria-invalid":!!I.title,"aria-describedby":I.title?S:void 0,...z(`title`)}),I.title&&(0,V.jsx)(`p`,{id:S,className:`text-xs text-error font-semibold`,children:I.title.message})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`label`,{htmlFor:`task-detail-priority`,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 ml-1`,children:`Operational Priority`}),(0,V.jsx)(O,{control:F,name:`priority`,render:({field:e})=>(0,V.jsxs)(`select`,{id:`task-detail-priority`,value:e.value,onChange:t=>e.onChange(Number(t.target.value)),onBlur:e.onBlur,"aria-invalid":!!I.priority,"aria-describedby":I.priority?T:void 0,className:`w-full border rounded-xl px-4 py-3 text-sm transition-all outline-none font-black tracking-widest uppercase appearance-none ${ue===j.CRITICAL?`bg-error/30 text-white border-error shadow-[0_0_15px_rgba(255,107,107,0.15)] ring-1 ring-error/20`:`bg-surface-container-highest/30 text-white border-outline-variant/10 focus:ring-1 focus:ring-primary/40 focus:bg-surface-container-highest/50`}`,children:[(0,V.jsx)(`option`,{value:j.CRITICAL,className:`bg-surface-container-low`,children:`CRITICAL`}),(0,V.jsx)(`option`,{value:j.HIGH,className:`bg-surface-container-low`,children:`HIGH`}),(0,V.jsx)(`option`,{value:j.MEDIUM,className:`bg-surface-container-low`,children:`MEDIUM`}),(0,V.jsx)(`option`,{value:j.LOW,className:`bg-surface-container-low`,children:`LOW`})]})}),I.priority&&(0,V.jsx)(`p`,{id:T,className:`text-xs text-error font-semibold`,children:I.priority.message})]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(O,{control:F,name:`description`,render:({field:e})=>(0,V.jsx)(m,{label:`Objective / Parameters`,value:e.value,onChange:t=>e.onChange(t),placeholder:`Describe the desired output and constraints for this node...`,height:`h-56`,helperText:`Supports GitHub Flavored Markdown for logic structure`,initialMode:`preview`,maxLength:2e3})}),I.description&&(0,V.jsx)(`p`,{id:M,className:`text-xs text-error font-semibold`,children:I.description.message})]})]})]}),(0,V.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,V.jsx)(oe,{taskId:t||``})})]}),(0,V.jsxs)(`div`,{className:`lg:col-span-4 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`bg-surface-container-low p-8 rounded-2xl border border-outline-variant/10 shadow-xl`,children:[(0,V.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-tertiary/80 block mb-6`,children:`Assigned Intelligence`}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsxs)(`select`,{value:X,onChange:e=>{H(`assigneeId`,e.target.value,{shouldDirty:!0,shouldValidate:!0})},"aria-invalid":!!I.assigneeId,"aria-describedby":I.assigneeId?N:void 0,className:`w-full bg-surface-container-high/50 border border-outline-variant/5 rounded-2xl p-5 appearance-none cursor-pointer focus:ring-1 focus:ring-tertiary/40 outline-none text-white font-headline font-black transition-all hover:border-tertiary/30`,children:[(0,V.jsx)(`option`,{value:``,children:`Protocol Unassigned`}),J.map(e=>(0,V.jsx)(`option`,{value:e.id,className:`bg-surface-container-low`,children:e.name},e.id))]}),(0,V.jsx)(`div`,{className:`absolute right-5 top-1/2 -translate-y-1/2 pointer-events-none text-on-surface-variant/40`,children:(0,V.jsx)(ne,{size:20,"aria-hidden":`true`})})]}),I.assigneeId&&(0,V.jsx)(`p`,{id:N,className:`text-xs text-error font-semibold`,children:I.assigneeId.message}),Z?(0,V.jsxs)(`div`,{className:`flex items-center gap-5 p-5 bg-tertiary/5 rounded-2xl border border-tertiary/10 animate-in fade-in slide-in-from-top-2 duration-300`,children:[(0,V.jsx)(`div`,{className:`h-14 w-14 rounded-xl bg-tertiary/10 flex items-center justify-center text-tertiary overflow-hidden shadow-inner`,children:(0,V.jsx)(se,{name:Z.name||`U`,size:48,className:`rounded-lg`})}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h4`,{className:`font-headline font-black text-white`,children:Z.name}),(0,V.jsx)(`p`,{className:`text-[10px] text-tertiary/60 font-black uppercase tracking-widest mt-1`,children:Z.role||`Intelligence Unit`})]})]}):(0,V.jsxs)(`div`,{className:`flex items-center gap-5 p-5 bg-surface-container-high/20 rounded-2xl border border-dashed border-outline-variant/20 italic`,children:[(0,V.jsx)(`div`,{className:`h-14 w-14 rounded-xl bg-surface-container-highest/30 flex items-center justify-center text-on-surface-variant/20`,children:(0,V.jsx)(x,{size:24,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h4`,{className:`font-headline font-bold text-on-surface-variant/40`,children:`Awaiting Assignment`}),(0,V.jsx)(`p`,{className:`text-[9px] text-on-surface-variant/30 font-black uppercase tracking-widest mt-1`,children:`Grid performance limited`})]})]})]}),(0,V.jsxs)(`button`,{type:`button`,disabled:!0,"aria-disabled":`true`,className:`w-full mt-6 py-3 text-[10px] font-black uppercase tracking-[0.2em] text-on-surface-variant transition-all flex items-center justify-center gap-3 bg-surface-container-highest/20 rounded-xl border border-outline-variant/5 opacity-50 cursor-not-allowed`,children:[(0,V.jsx)(ie,{size:16,className:`text-primary`,"aria-hidden":`true`}),`Tune Node Parameters`]})]}),(0,V.jsxs)(`div`,{className:`bg-surface-container-low p-8 rounded-2xl border border-outline-variant/10 shadow-xl`,children:[(0,V.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 block mb-8`,children:`Execution metrics`}),(0,V.jsxs)(`div`,{className:`space-y-8`,children:[(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex justify-between items-end`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface`,children:`Node Progress`}),(0,V.jsxs)(`span`,{className:`text-xs font-mono text-primary font-bold`,children:[Y===A.DONE?`100`:Y===A.IN_PROGRESS?`42`:`0`,`%`]})]}),(0,V.jsx)(`div`,{className:`h-2 w-full bg-surface-container-highest rounded-full overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full transition-all duration-1000 ${Y===A.DONE?`bg-secondary`:`bg-primary`}`,style:{width:`${Y===A.DONE?100:Y===A.IN_PROGRESS?42:0}%`}})})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsxs)(`div`,{className:`p-4 bg-surface-container-highest/20 rounded-xl border border-outline-variant/5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1 text-on-surface-variant/60`,children:[(0,V.jsx)(x,{size:14,className:`text-secondary`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`text-[9px] font-black uppercase tracking-widest`,children:`Latency`})]}),(0,V.jsxs)(`div`,{className:`text-lg font-mono font-bold text-white`,children:[q.llmLatency||0,`ms`]})]}),(0,V.jsxs)(`div`,{className:`p-4 bg-surface-container-highest/20 rounded-xl border border-outline-variant/5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1 text-on-surface-variant/60`,children:[(0,V.jsx)(ae,{size:14,className:`text-tertiary`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`text-[9px] font-black uppercase tracking-widest`,children:`Node Cost`})]}),(0,V.jsxs)(`div`,{className:`text-lg font-mono font-bold text-white`,children:[`$`,(q.costEstimate||0).toFixed(6)]})]})]})]})]}),(0,V.jsxs)(`div`,{className:`bg-gradient-to-br from-secondary/5 to-primary/5 p-8 rounded-2xl border border-secondary/10 relative overflow-hidden group shadow-xl`,children:[(0,V.jsx)(`div`,{className:`absolute top-0 right-0 -mr-4 -mt-4 text-secondary/5 opacity-50 transition-transform group-hover:scale-110`,children:(0,V.jsx)(_,{size:120,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`relative z-10`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-[0.2em] text-secondary/80`,children:`Integrity status`}),(0,V.jsx)(`span`,{className:`px-2 py-0.5 bg-secondary/20 text-secondary text-[9px] font-black rounded uppercase`,children:`Optimal`})]}),(0,V.jsx)(`div`,{className:`text-4xl font-headline font-black text-white tracking-tighter`,children:`99.8%`}),(0,V.jsx)(`p`,{className:`text-[10px] text-on-surface-variant/60 mt-2 italic font-medium leading-relaxed`,children:`Intelligence stream verified and synchronized across grid.`})]})]})]})]})]}),(0,V.jsx)(y,{isOpen:f,onClose:()=>g(!1),onConfirm:()=>{g(!1),K.mutate()},title:`Decommission Task Node?`,message:`Are you sure you want to decommission this task node? This action cannot be undone.`,confirmText:`Decommission`,variant:`danger`,loading:K.isPending})]})};export{q as default};
1
+ import{a as e,t}from"./rolldown-runtime-COnpUsM8.js";import{g as n}from"./vendor-dnd-CfaHPvi0.js";import{c as r,s as i}from"./vendor-react-BmVaKUwY.js";import{i as a,n as o,t as s}from"./vendor-query-xpDrc4rM.js";import{n as c,r as l,t as u}from"./vendor-markdown-DoJbQ1of.js";import{i as d,t as f}from"./client-B553SX3l.js";import{t as p}from"./chevron-right-Bm_d1KKk.js";import{t as m}from"./MarkdownField-DR6tHsei.js";import{t as h}from"./save-Cmqi1IkN.js";import{t as g}from"./send-iK1X7WSe.js";import{t as _}from"./shield-check-YKs9kUNq.js";import{t as v}from"./trash-2-CphQfk35.js";import{t as y}from"./ConfirmDialog-BltdtevE.js";import{t as b}from"./user-Brcjlps5.js";import{t as x}from"./zap-BDAytXMX.js";import{n as S}from"./AuthContextInstance-DiFo9Qb2.js";import{n as C}from"./agents-YQJ7JNfI.js";import{t as w}from"./useNotification-DQayTSUL.js";import{a as T}from"./agentEmojis-BQA0jC3z.js";import{a as E,c as D,o as O,s as ee}from"./vendor-forms-DHyqHeyd.js";import{i as k,n as A,t as j}from"./tasks-DHsBE-ea.js";import{o as te}from"./taskFormSchemas-B6YlRxrx.js";import{t as M}from"./AttachmentItem-C_uUACPz.js";var ne=d(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),re=d(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),N=d(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),ie=d(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),ae=d(`wallet`,[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]),P=e(n(),1),F={USER:`user`,AGENT:`agent`},I={create:async(e,t)=>(await f.post(`/tasks/${e}/comments`,t)).data,findAllByTask:async e=>(await f.get(`/tasks/${e}/comments`)).data,remove:async(e,t)=>{await f.delete(`/tasks/${e}/comments/${t}`)}},L=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||(e(t,E,w),e.$i=!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),R=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e=e||{};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),z=e(L(),1),B=e(R(),1),V=l();z.default.extend(B.default);var H=({comment:e,onDelete:t})=>{let n=e.authorType===F.AGENT,r=n?e.authorAgent?.name:e.authorUser?.username,i=n?e.authorAgent?.avatarUrl:e.authorUser?.avatarUrl,a=n?T(e.authorAgent?.emoji):null;return(0,V.jsxs)(`div`,{className:`flex gap-4 group`,children:[(0,V.jsx)(`div`,{className:`flex-shrink-0 h-10 w-10 rounded-xl flex items-center justify-center border transition-all ${n?`bg-tertiary/10 border-tertiary/20 text-tertiary shadow-[0_0_15px_rgba(221,183,255,0.1)]`:`bg-primary/10 border-primary/20 text-primary shadow-[0_0_15px_rgba(173,198,255,0.1)]`}`,children:n?(0,V.jsx)(`span`,{className:`text-2xl`,"aria-label":`${r} emoji`,children:a}):i?(0,V.jsx)(`img`,{src:i,alt:r,className:`h-full w-full object-cover p-1`}):(0,V.jsx)(b,{size:20})}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-sm font-headline font-bold ${n?`text-tertiary`:`text-primary`}`,children:r||`Anonymous`}),n&&(0,V.jsx)(`span`,{className:`px-1.5 py-0.5 bg-tertiary/10 text-tertiary text-[9px] font-black uppercase tracking-widest rounded border border-tertiary/20`,children:`Agent`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`text-xs font-mono text-on-surface-variant/40 lowercase`,children:(0,z.default)(e.createdAt).format(`MMM DD, YYYY HH:mm:ss`)}),t&&(0,V.jsx)(`button`,{onClick:()=>t(e.id),className:`opacity-0 group-hover:opacity-100 p-2 hover:bg-error/10 text-on-surface-variant/40 hover:text-error rounded-lg transition-all`,title:`Delete comment`,children:(0,V.jsx)(v,{size:18})})]})]}),(0,V.jsxs)(`div`,{className:`bg-surface-container-high/40 border border-outline-variant/5 p-4 rounded-xl shadow-sm group-hover:bg-surface-container-high/60 transition-colors`,children:[(0,V.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none text-on-surface leading-relaxed`,children:(0,V.jsx)(c,{remarkPlugins:[u],children:e.content})}),e.artifacts&&e.artifacts.length>0&&(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3 mt-4 pt-4 border-t border-outline-variant/10`,children:e.artifacts.map(e=>(0,V.jsx)(M,{name:e.originalName,type:e.mimeType.split(`/`)[1]||`file`,filePath:e.filePath,size:`Artifact`},e.id))})]})]})]})},U=({comments:e,isLoading:t,onDelete:n})=>(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 py-6 custom-scrollbar`,children:t?(0,V.jsx)(`div`,{className:`space-y-6 animate-pulse`,children:[1,2,3].map(e=>(0,V.jsxs)(`div`,{className:`flex gap-4`,children:[(0,V.jsx)(`div`,{className:`h-10 w-10 bg-surface-container-highest rounded-xl`}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-3`,children:[(0,V.jsx)(`div`,{className:`h-4 w-1/4 bg-surface-container-highest rounded`}),(0,V.jsx)(`div`,{className:`h-20 w-full bg-surface-container-highest rounded-xl`})]})]},e))}):e.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 text-center space-y-4 bg-surface-container-high/20 rounded-2xl border border-dashed border-outline-variant/20`,children:[(0,V.jsx)(`div`,{className:`h-12 w-12 rounded-full bg-surface-container-highest flex items-center justify-center text-on-surface-variant/40`,children:(0,V.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,V.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`p`,{className:`text-sm font-bold text-on-surface`,children:`No comments yet`}),(0,V.jsx)(`p`,{className:`text-xs text-on-surface-variant/60`,children:`Start the conversation by adding a comment below.`})]})]}):(0,V.jsx)(`div`,{className:`space-y-8`,children:e.map(e=>(0,V.jsx)(H,{comment:e,onDelete:n},e.id))})}),W=({onSend:e,isSending:t})=>{let[n,r]=(0,P.useState)(``),i=()=>{n.trim()&&!t&&(e(n),r(``))};return(0,V.jsxs)(`div`,{className:`bg-surface-container-low border border-outline-variant/10 rounded-2xl p-4 shadow-2xl shadow-primary/5 focus-within:border-primary/30 transition-all space-y-4`,children:[(0,V.jsx)(m,{value:n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&i()},placeholder:`Write a comment...`,height:`min-h-[120px]`}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between pt-4 border-t border-outline-variant/5`,children:[(0,V.jsx)(`div`,{className:`flex items-center gap-1`}),(0,V.jsx)(`button`,{onClick:i,disabled:!n.trim()||t,className:`flex items-center gap-2 px-5 py-2.5 rounded-xl font-bold text-xs uppercase tracking-widest transition-all active:scale-95 disabled:opacity-50 disabled:active:scale-100 ${n.trim()?`bg-gradient-to-r from-primary to-primary/80 text-on-primary shadow-lg shadow-primary/20 hover:brightness-110`:`bg-surface-container-highest text-on-surface-variant cursor-not-allowed`}`,children:t?(0,V.jsx)(`div`,{className:`w-4 h-4 rounded-full border-2 border-on-primary/30 border-t-on-primary animate-spin`}):(0,V.jsxs)(V.Fragment,{children:[`Send`,(0,V.jsx)(g,{size:14})]})})]})]})},oe=({taskId:e})=>{let[t,n]=(0,P.useState)(!1),[r,i]=(0,P.useState)(null),[s,c]=(0,P.useState)(!1),{user:l}=S(),{notifySuccess:u,notifyApiError:d}=w(),f=a(),{data:p=[],isLoading:m}=o({queryKey:[`comments`,e],queryFn:async()=>[...await I.findAllByTask(e)].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()),enabled:!!e,refetchInterval:1e4}),h=(0,P.useCallback)(()=>{f.invalidateQueries({queryKey:[`comments`,e]})},[f,e]);return(0,V.jsxs)(`div`,{className:`bg-surface-container-low rounded-2xl border border-outline-variant/10 shadow-2xl shadow-primary/5 overflow-hidden flex flex-col h-full`,children:[(0,V.jsxs)(`div`,{className:`p-6 border-b border-outline-variant/5 flex items-center justify-between bg-surface-container-low/50 backdrop-blur-md sticky top-0 z-10`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`div`,{className:`bg-primary/20 p-2.5 rounded-xl shadow-lg shadow-primary/10`,children:(0,V.jsx)(N,{size:22,className:`text-secondary stroke-[2.5]`})}),(0,V.jsx)(`h2`,{className:`text-lg font-headline font-black tracking-tight text-on-surface`,children:`Comments & Activity`})]}),(0,V.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,V.jsxs)(`span`,{className:`text-[10px] bg-white/5 border border-white/10 px-2 py-0.5 rounded text-white/40 font-mono tracking-widest uppercase`,children:[p.length,` Logged`]})})]}),(0,V.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,V.jsx)(U,{comments:p,isLoading:m,onDelete:e=>{i(e)}})}),(0,V.jsx)(`div`,{className:`p-6 bg-surface-container-low/50 border-t border-outline-variant/5 backdrop-blur-md`,children:(0,V.jsx)(W,{onSend:async t=>{if(!(!e||!l))try{n(!0),await I.create(e,{content:t,authorType:F.USER,authorUserId:l.id}),h()}catch{}finally{n(!1)}},isSending:t})}),(0,V.jsx)(y,{isOpen:!!r,onClose:()=>!s&&i(null),onConfirm:async()=>{if(!(!e||!r))try{c(!0),await I.remove(e,r),h(),i(null),u(`Protocol Cleared`,`The comment data has been purged from the orchestration logs.`)}catch(e){d(e,`Purge Failed`)}finally{c(!1)}},title:`Purge Communication Protocol?`,message:`This action will permanently erase the selected entry and all its associated artifacts from the neural stream. This operation is irreversible.`,confirmText:`Execute Purge`,variant:`danger`,loading:s})]})},G=[`#6366f1`,`#8b5cf6`,`#a855f7`,`#d946ef`,`#ec4899`,`#f43f5e`,`#ef4444`,`#f97316`,`#eab308`,`#84cc16`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#0ea5e9`,`#3b82f6`,`#6d28d9`];function K(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}var se=({name:e,size:t=40,className:n=``})=>{let r=(0,P.useMemo)(()=>{let t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():(t[0]?.[0]??`U`).toUpperCase()},[e]),i=(0,P.useMemo)(()=>G[K(e)%G.length],[e]);return(0,V.jsx)(`div`,{role:`img`,"aria-label":`${e} avatar`,className:`inline-flex items-center justify-center rounded-full text-white font-bold select-none shrink-0 ${n}`,style:{width:t,height:t,backgroundColor:i,fontSize:t*.38},children:r})},ce={title:``,description:``,status:A.BACKLOG,priority:j.MEDIUM,assigneeId:``},q=()=>{let{projectId:e,taskId:t}=r(),n=i(),c=a(),{notifyApiError:l,notifyError:u,notifySuccess:d}=w(),[f,g]=(0,P.useState)(!1),b=(0,P.useId)(),S=(0,P.useId)(),T=(0,P.useId)(),M=(0,P.useId)(),N=(0,P.useId)(),{control:F,formState:{errors:I,isDirty:L},handleSubmit:R,register:z,reset:B,setValue:H}=ee({resolver:E(te),defaultValues:ce,mode:`onBlur`}),U=o({queryKey:[`task`,e,t],enabled:!!(e&&t),queryFn:async()=>(await k.findOne(e,t)).data}),W=o({queryKey:[`agents`],queryFn:async()=>(await C.findAll()).data});(0,P.useEffect)(()=>{U.error&&l(U.error,`Fetch Error`)},[l,U.error]),(0,P.useEffect)(()=>{W.error&&l(W.error,`Agents Load Failed`)},[W.error,l]),(0,P.useEffect)(()=>{if(!U.data)return;let e=U.data.status===A.ARCHIVED?A.BACKLOG:U.data.status;B({title:U.data.title,description:U.data.description,status:e,priority:Number(U.data.priority),assigneeId:U.data.assignee?.id??``})},[B,U.data]);let G=s({mutationFn:async n=>{if(!e||!t)throw Error(`Task route is missing required identifiers`);return await k.update(e,t,{title:n.title,description:n.description,status:n.status,priority:n.priority,assigneeId:n.assigneeId||null}),n},onSuccess:n=>{!e||!t||(c.invalidateQueries({queryKey:[`task`,e,t]}),c.invalidateQueries({queryKey:[`tasks`,e]}),B(n),d(`Task Updated`,`Intelligence node parameters successfully reconfigured.`))},onError:e=>{l(e,`Update Failed`)}}),K=s({mutationFn:async()=>{if(!e||!t)throw Error(`Task route is missing required identifiers`);await k.delete(e,t)},onSuccess:()=>{e&&c.invalidateQueries({queryKey:[`tasks`,e]}),c.removeQueries({queryKey:[`task`,e,t]}),d(`Task Decommissioned`,`Intelligence node removed from the orchestration grid.`),n(`/`)},onError:e=>{l(e,`Decommission Failed`)}}),q=U.data,J=(0,P.useMemo)(()=>W.data??[],[W.data]),le=D({control:F,name:`title`}),Y=D({control:F,name:`status`}),ue=D({control:F,name:`priority`}),X=D({control:F,name:`assigneeId`}),Z=(0,P.useMemo)(()=>J.find(e=>e.id===X)??null,[J,X]),Q=U.isPending||G.isPending||K.isPending,de=R(async e=>{await G.mutateAsync(e)},()=>{u(`Validation Error`,`Please review the highlighted fields before saving.`)}),fe=()=>{K.isPending||g(!0)};if(U.isPending)return(0,V.jsx)(`div`,{className:`w-full h-[60vh] flex items-center justify-center`,"aria-busy":`true`,children:(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,V.jsx)(`div`,{className:`w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin`}),(0,V.jsx)(`p`,{className:`text-on-surface-variant text-sm font-black uppercase tracking-[0.3em] animate-pulse`,children:`Accessing Node Data`})]})});if(!q)return(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto w-full py-16 text-center space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-sm font-black uppercase tracking-[0.2em] text-on-surface-variant/60`,children:`Task intelligence node unavailable`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(`/`),className:`px-5 py-2 rounded-xl bg-surface-container-high text-on-surface hover:bg-surface-container-highest transition-colors`,children:`Return to Task Manager`})]});let $=`#NODE-${q.id.substring(0,4).toUpperCase()}`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`max-w-7xl mx-auto w-full space-y-8 animate-in fade-in duration-500`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,V.jsxs)(`nav`,{className:`flex items-center space-x-2 text-sm text-on-surface-variant font-medium`,"aria-label":`Task breadcrumb`,children:[(0,V.jsx)(`button`,{type:`button`,className:`hover:text-primary transition-colors`,onClick:()=>n(`/`),children:`Task Manager`}),(0,V.jsx)(p,{size:16,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`text-on-surface`,children:$})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:fe,disabled:Q,className:`flex items-center gap-2 px-4 py-2 text-xs font-black uppercase tracking-widest text-error hover:bg-error/10 transition-all rounded-xl active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed`,children:[(0,V.jsx)(v,{size:16,"aria-hidden":`true`}),`Decommission`]}),(0,V.jsxs)(`button`,{type:`button`,disabled:!0,"aria-disabled":`true`,className:`flex items-center gap-2 px-4 py-2 text-xs font-black uppercase tracking-widest text-on-surface bg-surface-container-high hover:bg-surface-container-highest transition-all rounded-xl opacity-50 cursor-not-allowed`,children:[(0,V.jsx)(re,{size:16,"aria-hidden":`true`}),`Halt execution`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:de,disabled:Q||!L,className:`flex items-center gap-2 px-6 py-2 text-xs font-black uppercase tracking-widest bg-primary text-on-primary rounded-xl shadow-lg shadow-primary/20 hover:scale-105 transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100`,children:[(0,V.jsx)(h,{size:16,"aria-hidden":`true`}),G.isPending?`Synchronizing...`:`Save Protocol`]})]})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-6`,children:[(0,V.jsxs)(`div`,{className:`lg:col-span-8 flex flex-col gap-6`,children:[(0,V.jsxs)(`div`,{className:`bg-surface-container-low p-8 rounded-2xl border border-outline-variant/10 shadow-2xl relative overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`absolute top-0 right-0 w-32 h-32 bg-primary/5 rounded-full blur-3xl -mr-16 -mt-16`}),(0,V.jsxs)(`div`,{className:`flex items-start justify-between mb-10 relative z-10 gap-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,V.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-[0.2em] text-primary/70`,children:`Intelligence Node identifier`}),(0,V.jsxs)(`h2`,{className:`text-3xl font-headline font-black text-white tracking-tight break-words`,children:[$,`: `,le||q.title]})]}),(0,V.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,V.jsxs)(`select`,{...z(`status`),"aria-invalid":!!I.status,"aria-describedby":I.status?b:void 0,className:`appearance-none cursor-pointer px-6 py-2 rounded-xl border font-black text-[10px] uppercase tracking-widest outline-none transition-all hover:brightness-110 active:scale-95 ${Y===A.DONE?`bg-secondary/10 border-secondary/20 text-secondary`:Y===A.IN_PROGRESS?`bg-primary/10 border-primary/20 text-primary`:`bg-surface-container-highest/50 border-outline-variant/20 text-on-surface-variant`}`,children:[(0,V.jsx)(`option`,{value:A.BACKLOG,className:`bg-surface-container-low`,children:`Backlog`}),(0,V.jsx)(`option`,{value:A.IN_PROGRESS,className:`bg-surface-container-low`,children:`In Progress`}),(0,V.jsx)(`option`,{value:A.REVIEW,className:`bg-surface-container-low`,children:`Review`}),(0,V.jsx)(`option`,{value:A.DONE,className:`bg-surface-container-low`,children:`Done`})]}),Y===A.IN_PROGRESS&&(0,V.jsxs)(`span`,{className:`absolute -left-1 -top-1 flex h-2 w-2`,"aria-hidden":`true`,children:[(0,V.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75`}),(0,V.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-primary`})]})]})]}),I.status&&(0,V.jsx)(`p`,{id:b,className:`mb-6 text-xs text-error font-semibold`,children:I.status.message}),(0,V.jsxs)(`div`,{className:`space-y-8 relative z-10`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`label`,{htmlFor:`task-detail-title`,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 ml-1`,children:`Node Designation`}),(0,V.jsx)(`input`,{id:`task-detail-title`,className:`w-full bg-surface-container-highest/30 border border-outline-variant/10 rounded-xl px-4 py-3 text-sm text-white focus:ring-1 focus:ring-primary/40 focus:bg-surface-container-highest/50 transition-all outline-none font-medium`,type:`text`,"aria-invalid":!!I.title,"aria-describedby":I.title?S:void 0,...z(`title`)}),I.title&&(0,V.jsx)(`p`,{id:S,className:`text-xs text-error font-semibold`,children:I.title.message})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`label`,{htmlFor:`task-detail-priority`,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 ml-1`,children:`Operational Priority`}),(0,V.jsx)(O,{control:F,name:`priority`,render:({field:e})=>(0,V.jsxs)(`select`,{id:`task-detail-priority`,value:e.value,onChange:t=>e.onChange(Number(t.target.value)),onBlur:e.onBlur,"aria-invalid":!!I.priority,"aria-describedby":I.priority?T:void 0,className:`w-full border rounded-xl px-4 py-3 text-sm transition-all outline-none font-black tracking-widest uppercase appearance-none ${ue===j.CRITICAL?`bg-error/30 text-white border-error shadow-[0_0_15px_rgba(255,107,107,0.15)] ring-1 ring-error/20`:`bg-surface-container-highest/30 text-white border-outline-variant/10 focus:ring-1 focus:ring-primary/40 focus:bg-surface-container-highest/50`}`,children:[(0,V.jsx)(`option`,{value:j.CRITICAL,className:`bg-surface-container-low`,children:`CRITICAL`}),(0,V.jsx)(`option`,{value:j.HIGH,className:`bg-surface-container-low`,children:`HIGH`}),(0,V.jsx)(`option`,{value:j.MEDIUM,className:`bg-surface-container-low`,children:`MEDIUM`}),(0,V.jsx)(`option`,{value:j.LOW,className:`bg-surface-container-low`,children:`LOW`})]})}),I.priority&&(0,V.jsx)(`p`,{id:T,className:`text-xs text-error font-semibold`,children:I.priority.message})]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(O,{control:F,name:`description`,render:({field:e})=>(0,V.jsx)(m,{label:`Objective / Parameters`,value:e.value,onChange:t=>e.onChange(t),placeholder:`Describe the desired output and constraints for this node...`,height:`h-56`,helperText:`Supports GitHub Flavored Markdown for logic structure`,initialMode:`preview`,maxLength:2e3})}),I.description&&(0,V.jsx)(`p`,{id:M,className:`text-xs text-error font-semibold`,children:I.description.message})]})]})]}),(0,V.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,V.jsx)(oe,{taskId:t||``})})]}),(0,V.jsxs)(`div`,{className:`lg:col-span-4 space-y-6`,children:[(0,V.jsxs)(`div`,{className:`bg-surface-container-low p-8 rounded-2xl border border-outline-variant/10 shadow-xl`,children:[(0,V.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-tertiary/80 block mb-6`,children:`Assigned Intelligence`}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsxs)(`select`,{value:X,onChange:e=>{H(`assigneeId`,e.target.value,{shouldDirty:!0,shouldValidate:!0})},"aria-invalid":!!I.assigneeId,"aria-describedby":I.assigneeId?N:void 0,className:`w-full bg-surface-container-high/50 border border-outline-variant/5 rounded-2xl p-5 appearance-none cursor-pointer focus:ring-1 focus:ring-tertiary/40 outline-none text-white font-headline font-black transition-all hover:border-tertiary/30`,children:[(0,V.jsx)(`option`,{value:``,children:`Protocol Unassigned`}),J.map(e=>(0,V.jsx)(`option`,{value:e.id,className:`bg-surface-container-low`,children:e.name},e.id))]}),(0,V.jsx)(`div`,{className:`absolute right-5 top-1/2 -translate-y-1/2 pointer-events-none text-on-surface-variant/40`,children:(0,V.jsx)(ne,{size:20,"aria-hidden":`true`})})]}),I.assigneeId&&(0,V.jsx)(`p`,{id:N,className:`text-xs text-error font-semibold`,children:I.assigneeId.message}),Z?(0,V.jsxs)(`div`,{className:`flex items-center gap-5 p-5 bg-tertiary/5 rounded-2xl border border-tertiary/10 animate-in fade-in slide-in-from-top-2 duration-300`,children:[(0,V.jsx)(`div`,{className:`h-14 w-14 rounded-xl bg-tertiary/10 flex items-center justify-center text-tertiary overflow-hidden shadow-inner`,children:(0,V.jsx)(se,{name:Z.name||`U`,size:48,className:`rounded-lg`})}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h4`,{className:`font-headline font-black text-white`,children:Z.name}),(0,V.jsx)(`p`,{className:`text-[10px] text-tertiary/60 font-black uppercase tracking-widest mt-1`,children:Z.role||`Intelligence Unit`})]})]}):(0,V.jsxs)(`div`,{className:`flex items-center gap-5 p-5 bg-surface-container-high/20 rounded-2xl border border-dashed border-outline-variant/20 italic`,children:[(0,V.jsx)(`div`,{className:`h-14 w-14 rounded-xl bg-surface-container-highest/30 flex items-center justify-center text-on-surface-variant/20`,children:(0,V.jsx)(x,{size:24,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h4`,{className:`font-headline font-bold text-on-surface-variant/40`,children:`Awaiting Assignment`}),(0,V.jsx)(`p`,{className:`text-[9px] text-on-surface-variant/30 font-black uppercase tracking-widest mt-1`,children:`Grid performance limited`})]})]})]}),(0,V.jsxs)(`button`,{type:`button`,disabled:!0,"aria-disabled":`true`,className:`w-full mt-6 py-3 text-[10px] font-black uppercase tracking-[0.2em] text-on-surface-variant transition-all flex items-center justify-center gap-3 bg-surface-container-highest/20 rounded-xl border border-outline-variant/5 opacity-50 cursor-not-allowed`,children:[(0,V.jsx)(ie,{size:16,className:`text-primary`,"aria-hidden":`true`}),`Tune Node Parameters`]})]}),(0,V.jsxs)(`div`,{className:`bg-surface-container-low p-8 rounded-2xl border border-outline-variant/10 shadow-xl`,children:[(0,V.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 block mb-8`,children:`Execution metrics`}),(0,V.jsxs)(`div`,{className:`space-y-8`,children:[(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex justify-between items-end`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface`,children:`Node Progress`}),(0,V.jsxs)(`span`,{className:`text-xs font-mono text-primary font-bold`,children:[Y===A.DONE?`100`:Y===A.IN_PROGRESS?`42`:`0`,`%`]})]}),(0,V.jsx)(`div`,{className:`h-2 w-full bg-surface-container-highest rounded-full overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full transition-all duration-1000 ${Y===A.DONE?`bg-secondary`:`bg-primary`}`,style:{width:`${Y===A.DONE?100:Y===A.IN_PROGRESS?42:0}%`}})})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsxs)(`div`,{className:`p-4 bg-surface-container-highest/20 rounded-xl border border-outline-variant/5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1 text-on-surface-variant/60`,children:[(0,V.jsx)(x,{size:14,className:`text-secondary`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`text-[9px] font-black uppercase tracking-widest`,children:`Latency`})]}),(0,V.jsxs)(`div`,{className:`text-lg font-mono font-bold text-white`,children:[q.llmLatency||0,`ms`]})]}),(0,V.jsxs)(`div`,{className:`p-4 bg-surface-container-highest/20 rounded-xl border border-outline-variant/5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1 text-on-surface-variant/60`,children:[(0,V.jsx)(ae,{size:14,className:`text-tertiary`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`text-[9px] font-black uppercase tracking-widest`,children:`Node Cost`})]}),(0,V.jsxs)(`div`,{className:`text-lg font-mono font-bold text-white`,children:[`$`,(q.costEstimate||0).toFixed(6)]})]})]})]})]}),(0,V.jsxs)(`div`,{className:`bg-gradient-to-br from-secondary/5 to-primary/5 p-8 rounded-2xl border border-secondary/10 relative overflow-hidden group shadow-xl`,children:[(0,V.jsx)(`div`,{className:`absolute top-0 right-0 -mr-4 -mt-4 text-secondary/5 opacity-50 transition-transform group-hover:scale-110`,children:(0,V.jsx)(_,{size:120,"aria-hidden":`true`})}),(0,V.jsxs)(`div`,{className:`relative z-10`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-[0.2em] text-secondary/80`,children:`Integrity status`}),(0,V.jsx)(`span`,{className:`px-2 py-0.5 bg-secondary/20 text-secondary text-[9px] font-black rounded uppercase`,children:`Optimal`})]}),(0,V.jsx)(`div`,{className:`text-4xl font-headline font-black text-white tracking-tighter`,children:`99.8%`}),(0,V.jsx)(`p`,{className:`text-[10px] text-on-surface-variant/60 mt-2 italic font-medium leading-relaxed`,children:`Intelligence stream verified and synchronized across grid.`})]})]})]})]})]}),(0,V.jsx)(y,{isOpen:f,onClose:()=>g(!1),onConfirm:()=>{g(!1),K.mutate()},title:`Decommission Task Node?`,message:`Are you sure you want to decommission this task node? This action cannot be undone.`,confirmText:`Decommission`,variant:`danger`,loading:K.isPending})]})};export{q as default};