@johpaz/hive-agents 1.1.4 → 1.1.5

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 (51) hide show
  1. package/README.md +3 -3
  2. package/dist/hive.js +52027 -4372
  3. package/dist/tool-worker.js +49660 -1160
  4. package/dist/ui/assets/{A2UIPage-EDS7lN-K.js → A2UIPage-Dr3p75oE.js} +1 -1
  5. package/dist/ui/assets/{AgentCreateForm-KvhVhAFP.js → AgentCreateForm-DqYhH_gm.js} +1 -1
  6. package/dist/ui/assets/{AgentDetailPage-B2dCpO92.js → AgentDetailPage-BVtE88U5.js} +1 -1
  7. package/dist/ui/assets/{AgentNewPage-CF2B4dbu.js → AgentNewPage-BRpFxJIT.js} +1 -1
  8. package/dist/ui/assets/{AgentsPage-CMvz-CtA.js → AgentsPage-BOIJ55cj.js} +1 -1
  9. package/dist/ui/assets/{ApiClientPage-tzzL3rZC.js → ApiClientPage-R9UDWfR2.js} +1 -1
  10. package/dist/ui/assets/{ChannelsPage-fE2vRwup.js → ChannelsPage-C5V2BmjL.js} +1 -1
  11. package/dist/ui/assets/{DashboardPage-57SaHnBL.js → DashboardPage-B18gMzNj.js} +1 -1
  12. package/dist/ui/assets/{LoginPage-Fag9Bp5h.js → LoginPage-nrsYF9AY.js} +1 -1
  13. package/dist/ui/assets/{LogsPage-GVJd_a65.js → LogsPage-DICMU_7m.js} +1 -1
  14. package/dist/ui/assets/{MeetingPage-TKQu8Nr-.js → MeetingPage-xslJGfIz.js} +1 -1
  15. package/dist/ui/assets/{ModelSelector-DciHLo7R.js → ModelSelector-BX4IvuYY.js} +1 -1
  16. package/dist/ui/assets/Office3DPage-a6cuzt5X.js +727 -0
  17. package/dist/ui/assets/{ProvidersPage-BsWFvzqz.js → ProvidersPage-C8-xGoeh.js} +1 -1
  18. package/dist/ui/assets/{RecoverPage-BkdOyljs.js → RecoverPage-Blms3NBa.js} +1 -1
  19. package/dist/ui/assets/{SettingsPage-D_43Rc2I.js → SettingsPage-BBeeq_QS.js} +1 -1
  20. package/dist/ui/assets/{SetupPage-D6Z3SYZu.js → SetupPage-CAjLseE_.js} +1 -1
  21. package/dist/ui/assets/{Vignette-bSrGVyRd.js → Vignette-DrI2yK2m.js} +1 -1
  22. package/dist/ui/assets/VoicePage-BeSSYstD.js +307 -0
  23. package/dist/ui/assets/{WebChatPage-Dzk3FhiR.js → WebChatPage-Bat7uUfd.js} +1 -1
  24. package/dist/ui/assets/{bia-csMImkVQ.glb → bia-qdLMQRFi.glb} +0 -0
  25. package/dist/ui/assets/{conversationsStore-5hf5grlP.js → conversationsStore-DhM07qYi.js} +1 -1
  26. package/dist/ui/assets/{dialog-DKnsGLwr.js → dialog-BP3GTCPn.js} +1 -1
  27. package/dist/ui/assets/{index-mBw9Tl7u.js → index-BG3nUPKq.js} +2 -2
  28. package/dist/ui/assets/{useAudioDevices-BYFaA0X-.js → useAudioDevices-zj0fuGwZ.js} +1 -1
  29. package/dist/ui/assets/{useHiveAgentsModelLoad-RRQ6-ANC.js → useHiveAgentsModelLoad-Cd9p-bjs.js} +1 -1
  30. package/dist/ui/assets/{useProviders-DXr4pJ57.js → useProviders-Dj1k5PCk.js} +1 -1
  31. package/dist/ui/index.html +1 -1
  32. package/package.json +1 -1
  33. package/packages/cli/src/commands/onboard.ts +8 -7
  34. package/packages/core/src/gateway/routes/providers.ts +26 -79
  35. package/packages/core/src/gateway/server.ts +20 -0
  36. package/packages/core/src/scheduler/integration.ts +26 -20
  37. package/packages/core/src/storage/collections.ts +7 -0
  38. package/packages/core/src/storage/model-sync.ts +404 -0
  39. package/packages/core/src/storage/seed.ts +33 -3
  40. package/packages/core/src/tools/cron/index.ts +25 -3
  41. package/packages/core/src/tools/office/office-escribir-docx.ts +275 -97
  42. package/packages/core/src/tools/office/office-escribir-pdf.ts +489 -99
  43. package/packages/core/src/tools/office/office-escribir-pptx.ts +86 -84
  44. package/packages/core/src/tools/office/office-escribir-xlsx.ts +196 -40
  45. package/packages/core/src/tools/office/office-style.ts +452 -0
  46. package/packages/core/src/tools/web/obscura-install.ts +119 -0
  47. package/packages/core/src/tools/web/obscura.ts +26 -4
  48. package/packages/core/src/utils/date.ts +29 -0
  49. package/packages/skills/src/bundled-data.generated.ts +780 -780
  50. package/dist/ui/assets/Office3DPage-CQnO522l.js +0 -727
  51. package/dist/ui/assets/VoicePage-CCE2EOE9.js +0 -307
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./vendor-react-kUOwxn0g.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./createLucideIcon-BRaPSYgN.js";import{t as a}from"./arrow-left-WyDPYZXU.js";import{t as o}from"./arrow-right-BuNjN-bk.js";import{t as s}from"./calendar-B6x9cw-q.js";import{t as c}from"./check-C8pw-7Fx.js";import{t as l}from"./circle-alert-CtDbK2nl.js";import{t as u}from"./download-BQXrpH0m.js";import{t as d}from"./ellipsis-vertical-D7uFJLGh.js";import{n as f,t as p}from"./slider-DXS4h1LB.js";import{n as m,t as h}from"./eye-CxvxtQT5.js";import{t as g}from"./info-8ReWzubE.js";import{t as _}from"./lock-open-v0EphssG.js";import{t as v}from"./lock-3IApZyVy.js";import{t as y}from"./mail-vwCEHyhQ.js";import{t as b}from"./pencil-CKritjT_.js";import{t as x}from"./plus-RD44ce15.js";import{t as S}from"./refresh-cw-DtJMHRHO.js";import{t as C}from"./search-z2oZt00P.js";import{t as w}from"./send-CpoY_2F-.js";import{t as T}from"./settings-qV3kVkeG.js";import{t as E}from"./trash-2-D6oziYAK.js";import{n as D,t as O}from"./wifi-BUJuOcgP.js";import{l as k}from"./vendor-router-DSMCk-Ka.js";import{B as A,G as ee,H as te,K as j,M as ne,N as re,Q as ie,R as M,U as ae,V as oe,W as N,ht as se,lt as P,nt as F,rt as ce,z as I}from"./index-mBw9Tl7u.js";import{t as le}from"./badge-B5AKge1b.js";import{t as ue}from"./scroll-area-CbH8FOo8.js";import{i as L,n as R,r as z,t as B}from"./tabs-epu-3Tl4.js";import{c as V,i as H,r as U,s as de,t as fe}from"./dialog-DKnsGLwr.js";var pe=i(`Camera`,[[`path`,{d:`M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z`,key:`1tc9qg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),W=i(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),me=i(`CreditCard`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),he=i(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),G=i(`Heart`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}]]),ge=i(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),_e=i(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ve=i(`MapPin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),ye=i(`Phone`,[[`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z`,key:`foiqr5`}]]),be=i(`Printer`,[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]),xe=i(`Share2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Se=i(`ShoppingCart`,[[`circle`,{cx:`8`,cy:`21`,r:`1`,key:`jimo8o`}],[`circle`,{cx:`19`,cy:`21`,r:`1`,key:`13723u`}],[`path`,{d:`M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12`,key:`9zh506`}]]),Ce=i(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),we=i(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),K=e(t(),1),q=n(),J=r(),Y={h1:`text-2xl font-black text-white`,h2:`text-xl font-bold text-white`,h3:`text-base font-bold text-white`,h4:`text-sm font-semibold text-white/90`,h5:`text-xs font-semibold text-white/80`,body:`text-sm text-white/70 leading-relaxed`,caption:`text-xs text-white/40`,label:`text-xs font-semibold text-white/50 uppercase tracking-wider`,code:`font-mono text-xs text-green-300 bg-black/40 rounded-lg p-3 leading-relaxed whitespace-pre-wrap break-all`};function Te(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,i,a,o,s;if(t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.text||t[3]!==n.usageHint||t[4]!==n.variant||t[5]!==n.weight){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e=N(n.text,r.dataModel,r.scopeData),c=n.variant??n.usageHint??`body`,l=Y[c]??Y.body;if(c===`code`){s=(0,J.jsx)(`pre`,{className:l,children:e});break bb0}let u=e.split(/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|\n)/g);i=l,t[10]===n.weight?a=t[11]:(a=n.weight?{flex:n.weight}:void 0,t[10]=n.weight,t[11]=a),o=u.map(Ee)}t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.text,t[3]=n.usageHint,t[4]=n.variant,t[5]=n.weight,t[6]=i,t[7]=a,t[8]=o,t[9]=s}else i=t[6],a=t[7],o=t[8],s=t[9];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c;return t[12]!==i||t[13]!==a||t[14]!==o?(c=(0,J.jsx)(`p`,{className:i,style:a,children:o}),t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],c}function Ee(e,t){return e.startsWith(`**`)&&e.endsWith(`**`)?(0,J.jsx)(`strong`,{className:`font-bold`,children:e.slice(2,-2)},t):e.startsWith(`*`)&&e.endsWith(`*`)?(0,J.jsx)(`em`,{className:`italic`,children:e.slice(1,-1)},t):e.startsWith("`")&&e.endsWith("`")?(0,J.jsx)(`code`,{className:`font-mono text-green-300 bg-black/30 px-1 rounded text-[0.9em]`,children:e.slice(1,-1)},t):e===`
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./vendor-react-kUOwxn0g.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./createLucideIcon-BRaPSYgN.js";import{t as a}from"./arrow-left-WyDPYZXU.js";import{t as o}from"./arrow-right-BuNjN-bk.js";import{t as s}from"./calendar-B6x9cw-q.js";import{t as c}from"./check-C8pw-7Fx.js";import{t as l}from"./circle-alert-CtDbK2nl.js";import{t as u}from"./download-BQXrpH0m.js";import{t as d}from"./ellipsis-vertical-D7uFJLGh.js";import{n as f,t as p}from"./slider-DXS4h1LB.js";import{n as m,t as h}from"./eye-CxvxtQT5.js";import{t as g}from"./info-8ReWzubE.js";import{t as _}from"./lock-open-v0EphssG.js";import{t as v}from"./lock-3IApZyVy.js";import{t as y}from"./mail-vwCEHyhQ.js";import{t as b}from"./pencil-CKritjT_.js";import{t as x}from"./plus-RD44ce15.js";import{t as S}from"./refresh-cw-DtJMHRHO.js";import{t as C}from"./search-z2oZt00P.js";import{t as w}from"./send-CpoY_2F-.js";import{t as T}from"./settings-qV3kVkeG.js";import{t as E}from"./trash-2-D6oziYAK.js";import{n as D,t as O}from"./wifi-BUJuOcgP.js";import{l as k}from"./vendor-router-DSMCk-Ka.js";import{B as A,G as ee,H as te,K as j,M as ne,N as re,Q as ie,R as M,U as ae,V as oe,W as N,ht as se,lt as P,nt as F,rt as ce,z as I}from"./index-BG3nUPKq.js";import{t as le}from"./badge-B5AKge1b.js";import{t as ue}from"./scroll-area-CbH8FOo8.js";import{i as L,n as R,r as z,t as B}from"./tabs-epu-3Tl4.js";import{c as V,i as H,r as U,s as de,t as fe}from"./dialog-BP3GTCPn.js";var pe=i(`Camera`,[[`path`,{d:`M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z`,key:`1tc9qg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),W=i(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),me=i(`CreditCard`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),he=i(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),G=i(`Heart`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}]]),ge=i(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),_e=i(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ve=i(`MapPin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),ye=i(`Phone`,[[`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z`,key:`foiqr5`}]]),be=i(`Printer`,[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]),xe=i(`Share2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Se=i(`ShoppingCart`,[[`circle`,{cx:`8`,cy:`21`,r:`1`,key:`jimo8o`}],[`circle`,{cx:`19`,cy:`21`,r:`1`,key:`13723u`}],[`path`,{d:`M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12`,key:`9zh506`}]]),Ce=i(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),we=i(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),K=e(t(),1),q=n(),J=r(),Y={h1:`text-2xl font-black text-white`,h2:`text-xl font-bold text-white`,h3:`text-base font-bold text-white`,h4:`text-sm font-semibold text-white/90`,h5:`text-xs font-semibold text-white/80`,body:`text-sm text-white/70 leading-relaxed`,caption:`text-xs text-white/40`,label:`text-xs font-semibold text-white/50 uppercase tracking-wider`,code:`font-mono text-xs text-green-300 bg-black/40 rounded-lg p-3 leading-relaxed whitespace-pre-wrap break-all`};function Te(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,i,a,o,s;if(t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.text||t[3]!==n.usageHint||t[4]!==n.variant||t[5]!==n.weight){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e=N(n.text,r.dataModel,r.scopeData),c=n.variant??n.usageHint??`body`,l=Y[c]??Y.body;if(c===`code`){s=(0,J.jsx)(`pre`,{className:l,children:e});break bb0}let u=e.split(/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|\n)/g);i=l,t[10]===n.weight?a=t[11]:(a=n.weight?{flex:n.weight}:void 0,t[10]=n.weight,t[11]=a),o=u.map(Ee)}t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.text,t[3]=n.usageHint,t[4]=n.variant,t[5]=n.weight,t[6]=i,t[7]=a,t[8]=o,t[9]=s}else i=t[6],a=t[7],o=t[8],s=t[9];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c;return t[12]!==i||t[13]!==a||t[14]!==o?(c=(0,J.jsx)(`p`,{className:i,style:a,children:o}),t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],c}function Ee(e,t){return e.startsWith(`**`)&&e.endsWith(`**`)?(0,J.jsx)(`strong`,{className:`font-bold`,children:e.slice(2,-2)},t):e.startsWith(`*`)&&e.endsWith(`*`)?(0,J.jsx)(`em`,{className:`italic`,children:e.slice(1,-1)},t):e.startsWith("`")&&e.endsWith("`")?(0,J.jsx)(`code`,{className:`font-mono text-green-300 bg-black/30 px-1 rounded text-[0.9em]`,children:e.slice(1,-1)},t):e===`
2
2
  `?(0,J.jsx)(`br`,{},t):e}function De(e,t,n,r){let i=[];for(let a of e)X(a,t,n,r)||i.push({message:a.message??`Validation failed: ${a.call}`});return{valid:i.length===0,errors:i}}function X(e,t,n,r){if(e.condition)return I(e.condition,t,n,r)===!0;let i=I({call:e.call,args:e.args??{}},t,n,r);return i===!0||i===`true`}function Oe(e,t,n,r){if(!e||e.length===0)return!1;for(let i of e)if(!X(i,t,n,r))return!0;return!1}function ke(e){let t=(0,q.c)(21),{def:n,ctx:r}=e,i=n.action,a=n.variant??`primary`,o;t[0]!==r||t[1]!==n.checks||t[2]!==n.disabled?(o=n.disabled===!0||Oe(n.checks,r.dataModel,r.scopeData),t[0]=r,t[1]=n.checks,t[2]=n.disabled,t[3]=o):o=t[3];let s=o,c=a===`primary`?`bg-blue-600 hover:bg-blue-500 text-white font-bold`:a===`borderless`?`text-white/70 hover:text-white hover:bg-white/5`:`bg-white/5 hover:bg-white/10 text-white/70 border border-white/10`,l;t[4]!==i||t[5]!==r||t[6]!==n.id||t[7]!==s?(l=()=>{if(s)return;let e=i?.event??i,t=e?.name;if(!t)return;let a={},o=e.context??{};for(let[e,t]of Object.entries(o))oe(t)?a[e]=j(t.path,r.dataModel,r.scopeData):A(t)?a[e]=I(t,r.dataModel,r.scopeData):a[e]=t;r.onAction(t,a,n.id)},t[4]=i,t[5]=r,t[6]=n.id,t[7]=s,t[8]=l):l=t[8];let u=l,d=`w-full py-2.5 rounded-xl text-sm transition-all disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 ${c}`,f;t[9]===n.weight?f=t[10]:(f=n.weight?{flex:n.weight}:void 0,t[9]=n.weight,t[10]=f);let p;t[11]!==r||t[12]!==n.child||t[13]!==n.text?(p=n.child?(0,J.jsx)(Q,{...r,id:n.child}):N(n.text,r.dataModel,r.scopeData)||`Button`,t[11]=r,t[12]=n.child,t[13]=n.text,t[14]=p):p=t[14];let m;return t[15]!==s||t[16]!==u||t[17]!==d||t[18]!==f||t[19]!==p?(m=(0,J.jsx)(`button`,{onClick:u,disabled:s,className:d,style:f,children:p}),t[15]=s,t[16]=u,t[17]=d,t[18]=f,t[19]=p,t[20]=m):m=t[20],m}var Ae={start:`flex-start`,end:`flex-end`,center:`center`,spaceBetween:`space-between`,spaceAround:`space-around`,spaceEvenly:`space-evenly`};function je(e){let t=(0,q.c)(12),{def:n,ctx:r}=e,i=Ae[String(n.justify??n.distribution??`start`)]??`flex-start`,a=n.align??n.alignment,o=a===`center`?`center`:a===`end`?`flex-end`:a===`stretch`?`stretch`:`flex-start`,s;t[0]===n.weight?s=t[1]:(s=n.weight?{flex:n.weight}:{},t[0]=n.weight,t[1]=s);let c;t[2]!==o||t[3]!==i||t[4]!==s?(c={justifyContent:i,alignItems:o,...s},t[2]=o,t[3]=i,t[4]=s,t[5]=c):c=t[5];let l;t[6]!==r||t[7]!==n.children?(l=$(n.children,r),t[6]=r,t[7]=n.children,t[8]=l):l=t[8];let u;return t[9]!==c||t[10]!==l?(u=(0,J.jsx)(`div`,{className:`flex flex-row gap-2`,style:c,children:l}),t[9]=c,t[10]=l,t[11]=u):u=t[11],u}var Me={start:`flex-start`,end:`flex-end`,center:`center`,spaceBetween:`space-between`,spaceAround:`space-around`,spaceEvenly:`space-evenly`};function Ne(e){let t=(0,q.c)(12),{def:n,ctx:r}=e,i=Me[String(n.justify??n.distribution??`start`)]??`flex-start`,a=n.align??n.alignment,o=a===`center`?`center`:a===`end`?`flex-end`:a===`stretch`?`stretch`:`flex-start`,s;t[0]===n.weight?s=t[1]:(s=n.weight?{flex:n.weight}:{},t[0]=n.weight,t[1]=s);let c;t[2]!==o||t[3]!==i||t[4]!==s?(c={justifyContent:i,alignItems:o,...s},t[2]=o,t[3]=i,t[4]=s,t[5]=c):c=t[5];let l;t[6]!==r||t[7]!==n.children?(l=$(n.children,r),t[6]=r,t[7]=n.children,t[8]=l):l=t[8];let u;return t[9]!==c||t[10]!==l?(u=(0,J.jsx)(`div`,{className:`flex flex-col gap-3`,style:c,children:l}),t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Pe(e){let t=(0,q.c)(8),{def:n,ctx:r}=e,i;t[0]===n.weight?i=t[1]:(i={background:`rgba(255,255,255,0.03)`,borderColor:`rgba(255,255,255,0.08)`,...n.weight?{flex:n.weight}:{}},t[0]=n.weight,t[1]=i);let a;t[2]!==r||t[3]!==n.child?(a=n.child&&(0,J.jsx)(Q,{...r,id:n.child}),t[2]=r,t[3]=n.child,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o=(0,J.jsx)(`div`,{className:`rounded-xl border p-4`,style:i,children:a}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function Fe(e){let t=(0,q.c)(12),{def:n,ctx:r}=e,i=n.direction===`horizontal`?`flex-row`:`flex-col`;if(n.children){let e=`flex ${i} gap-2 overflow-x-auto pb-1`,a;t[0]===n.weight?a=t[1]:(a=n.weight?{flex:n.weight}:void 0,t[0]=n.weight,t[1]=a);let o;t[2]!==r||t[3]!==n.children?(o=$(n.children,r),t[2]=r,t[3]=n.children,t[4]=o):o=t[4];let s;return t[5]!==e||t[6]!==a||t[7]!==o?(s=(0,J.jsx)(`div`,{className:e,style:a,children:o}),t[5]=e,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}if(n.child){let e;return t[9]!==r||t[10]!==n.child?(e=(0,J.jsx)(Q,{...r,id:n.child}),t[9]=r,t[10]=n.child,t[11]=e):e=t[11],e}return null}function Ie(e){let t=(0,q.c)(5),{def:n}=e,r=n.axis===`vertical`?`w-px bg-white/[0.06] self-stretch`:`h-px bg-white/[0.06] w-full`,i;t[0]===n.weight?i=t[1]:(i=n.weight?{flex:n.weight}:void 0,t[0]=n.weight,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,J.jsx)(`div`,{className:r,style:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}var Le={contain:`contain`,cover:`cover`,fill:`fill`,none:`none`,"scale-down":`scale-down`},Re={icon:`w-8 h-8`,avatar:`w-12 h-12 rounded-full`,smallFeature:`w-24 h-24`,mediumFeature:`w-48 h-48`,largeFeature:`w-64 h-64`,header:`w-full h-48`};function ze(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,i;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.url?(i=N(n.url,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.url,t[3]=i):i=t[3];let a=i;if(!a)return null;let o=Le[n.fit??`contain`]??`contain`,s=Re[n.usageHint??``]??``,c=typeof n.alt==`string`?n.alt:``,l=`rounded-xl overflow-hidden border border-white/[0.08] ${s}`,u;t[4]===n.weight?u=t[5]:(u=n.weight?{flex:n.weight}:void 0,t[4]=n.weight,t[5]=u);let d=o,f;t[6]===d?f=t[7]:(f={objectFit:d},t[6]=d,t[7]=f);let p;t[8]!==c||t[9]!==f||t[10]!==a?(p=(0,J.jsx)(`img`,{src:a,alt:c,className:`w-full max-h-64 block`,style:f}),t[8]=c,t[9]=f,t[10]=a,t[11]=p):p=t[11];let m;return t[12]!==l||t[13]!==u||t[14]!==p?(m=(0,J.jsx)(`div`,{className:l,style:u,children:p}),t[12]=l,t[13]=u,t[14]=p,t[15]=m):m=t[15],m}var Be={settings:T,home:ge,search:C,mail:y,call:ye,camera:pe,calendarToday:s,star:Ce,check:c,close:ie,delete:E,download:u,upload:we,edit:b,refresh:S,send:w,share:xe,shoppingCart:Se,warning:ce,info:g,error:l,favorite:G,favoriteOff:G,folder:he,help:W,lock:v,lockOpen:_,visibility:h,visibilityOff:m,add:x,arrowBack:a,arrowForward:o,accountCircle:F,notifications:se,moreVert:d,moreHoriz:f,locationOn:ve,payment:me,photo:_e,print:be,person:F};function Ve(e){let t=(0,q.c)(5),{def:n,ctx:r}=e,i=Be[N(n.name,r.dataModel,r.scopeData)]??W,a;t[0]===n.weight?a=t[1]:(a=n.weight?{flex:n.weight}:void 0,t[0]=n.weight,t[1]=a);let o;return t[2]!==i||t[3]!==a?(o=(0,J.jsx)(i,{className:`text-white/70`,style:a}),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function He(e){let t=(0,q.c)(56),{def:n,ctx:r}=e,i=(typeof n.value==`object`&&n.value,n.value),a;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==i?(a=N(i,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=i,t[3]=a):a=t[3];let[o,s]=(0,K.useState)(a),c;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==n.label?(c=N(n.label,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=n.label,t[7]=c):c=t[7];let l=c,u;t[8]!==r.dataModel||t[9]!==r.scopeData||t[10]!==n.placeholder?(u=N(n.placeholder,r.dataModel,r.scopeData),t[8]=r.dataModel,t[9]=r.scopeData,t[10]=n.placeholder,t[11]=u):u=t[11];let d=u,f=n.variant??n.textFieldType??`shortText`,p=f===`code`||f===`multiline_code`,m=f===`longText`||p||f===`multiline`,h;bb0:{if(n.checks){let e;t[12]!==r.dataModel||t[13]!==r.scopeData||t[14]!==n.checks?(e=De(n.checks,r.dataModel,r.scopeData),t[12]=r.dataModel,t[13]=r.scopeData,t[14]=n.checks,t[15]=e):e=t[15],h=e;break bb0}if(n.validationRegexp&&o){let e;t[16]!==n.validationRegexp||t[17]!==o?(e=new RegExp(n.validationRegexp).test(o),t[16]=n.validationRegexp,t[17]=o,t[18]=e):e=t[18];let r=e,i;t[19]===r?i=t[20]:(i=r?{valid:!0,errors:[]}:{valid:!1,errors:[{message:`Formato inválido`}]},t[19]=r,t[20]=i),h=i;break bb0}let e;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e={valid:!0,errors:[]},t[21]=e):e=t[21],h=e}let g=h,_;t[22]!==r||t[23]!==n.value?(_=e=>{if(s(e.target.value),typeof n.value==`object`&&n.value!==null&&`path`in n.value){let t=n.value.path;r.setDataModel(n=>{let r=structuredClone(n),i=t.replace(/^\//,``).split(`/`),a=r;for(let e=0;e<i.length-1;e++)a[i[e]]??(a[i[e]]={}),a=a[i[e]];return a[i[i.length-1]]=e.target.value,r})}},t[22]=r,t[23]=n.value,t[24]=_):_=t[24];let v=_,y;t[25]!==r||t[26]!==n.action||t[27]!==n.id?(y=e=>{let t=n.action,i=(t?.event??t)?.name;i&&r.onAction(i,{value:e},n.id)},t[25]=r,t[26]=n.action,t[27]=n.id,t[28]=y):y=t[28];let b=y,x;t[29]===b?x=t[30]:(x=e=>{b(e.target.value)},t[29]=b,t[30]=x);let S=x,C;t[31]!==b||t[32]!==m?(C=e=>{e.key===`Enter`&&!m&&b(e.target.value)},t[31]=b,t[32]=m,t[33]=C):C=t[33];let w=C,T=`w-full rounded-xl border px-3 py-2.5 text-sm resize-none outline-none transition-all
3
3
  bg-white/[0.04] border-white/[0.08] focus:border-blue-500/50 focus:bg-white/[0.06]
4
4
  disabled:opacity-50 placeholder:text-white/20
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./check-C8pw-7Fx.js";import{t as i}from"./circle-alert-CtDbK2nl.js";import{t as a}from"./useProviders-DXr4pJ57.js";import{t as o}from"./external-link-6oTH9pUM.js";import{n as s,r as c,t as l}from"./ModelSelector-DciHLo7R.js";import{t as u}from"./shield-CIarwBvx.js";import{t as d}from"./sparkles-DVvY6jDT.js";import{t as f}from"./utils-DEmd_M8c.js";import{F as p,N as m,O as h,Q as g,S as _,X as v,Y as y,ct as b}from"./index-mBw9Tl7u.js";import{a as x,c as S,i as C,n as w,o as T,r as E,s as ee,t as D}from"./dialog-DKnsGLwr.js";import{t as O}from"./label-D_fvqJyD.js";import{t as k}from"./textarea-BgZJFZTX.js";import{i as A,n as j,o as M,s as N,t as P}from"./select-v_3QBYrD.js";import{t as F}from"./switch-ndx8VCpm.js";import{a as I,i as L,n as R,r as z,t as B}from"./card-mTJ4oZbL.js";var V=e(t(),1),H=n(),U=[{value:`friendly`,label:`Amigable`},{value:`professional`,label:`Profesional`},{value:`casual`,label:`Casual`},{value:`formal`,label:`Formal`},{value:`creative`,label:`Creativo`}];function W({initialData:e,onSuccess:t,onCancel:n}){let{createAgent:W,updateAgent:G,isLoading:K,error:q}=_(),{activeProviders:te}=h(),[J,Y]=(0,V.useState)({isValidating:!1,exists:!1,accessible:!1}),[X,Z]=(0,V.useState)({name:``,description:``,tone:`professional`,provider_id:``,model_id:``,role:`coordinator`,enabled:!0,systemPrompt:``,workspace:e?.workspace||``});(0,V.useEffect)(()=>{e&&Z({...e,provider_id:e.provider_id||e.providerId||``,model_id:e.model_id||e.modelId||``})},[e]);let Q=async e=>{if(!e||e.trim()===``){Y({isValidating:!1,exists:!1,accessible:!1});return}Y({isValidating:!0,exists:!1,accessible:!1});try{let t=await m(`/api/workspace/validate`,{method:`POST`,body:{path:e}});Y({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){Y({isValidating:!1,exists:!1,accessible:!1,error:e.message})}},ne=async()=>{if(X.workspace)try{await m(`/api/workspace/create`,{method:`POST`,body:{path:X.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await Q(X.workspace)}catch(e){p.fire(`Error`,e.message,`error`)}},re=async()=>{if(X.workspace)try{await m(`/api/workspace/open?path=${encodeURIComponent(X.workspace)}`,{method:`GET`})}catch(e){p.fire(`Error`,e.message,`error`)}},ie=async n=>{if(n.preventDefault(),!X.provider_id||!X.model_id){p.fire(`Incompleto`,`Por favor selecciona un proveedor y modelo`,`warning`);return}try{e?.id?await G(e.id,X):await W(X),t&&t()}catch(e){console.error(e)}},$=!!e?.id;return(0,H.jsxs)(B,{className:`hive-card--form group`,children:[(0,H.jsx)(`div`,{className:`hive-glow-blob--card absolute -top-24 -right-24 h-48 w-48 bg-blue-600/10 group-hover:bg-blue-600/20`,style:{borderRadius:`50%`,filter:`blur(80px)`}}),(0,H.jsx)(L,{className:`relative`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:$?(0,H.jsx)(s,{className:`h-5 w-5`}):(0,H.jsx)(d,{className:`h-5 w-5`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(I,{className:`text-xl font-bold text-white/90`,children:$?`Configurar Nodo`:`Desplegar Nuevo Nodo`}),(0,H.jsx)(z,{className:`text-white/40`,children:$?`Ajusta los parámetros de tu agente inteligente.`:`Crea una nueva entidad inteligente para tu colmena.`})]})]}),n&&(0,H.jsx)(v,{variant:`ghost`,size:`icon`,onClick:n,className:`text-white/40 hover:text-white hover:bg-white/5`,children:(0,H.jsx)(g,{className:`h-5 w-5`})})]})}),(0,H.jsx)(R,{className:`relative space-y-6 pt-2`,children:(0,H.jsxs)(`form`,{onSubmit:ie,className:`space-y-8`,children:[(0,H.jsxs)(`div`,{className:`grid gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`name`,className:`hive-label--field`,children:`Nombre del Agente`}),(0,H.jsx)(y,{id:`name`,placeholder:`Ej: Analista de Mercado`,className:`hive-input`,value:X.name,onChange:e=>Z({...X,name:e.target.value}),disabled:K,required:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`description`,className:`hive-label--field`,children:`Descripción / Rol`}),(0,H.jsx)(k,{id:`description`,placeholder:`Describe qué hace este agente y cuáles son sus objetivos...`,className:`hive-textarea`,value:X.description,onChange:e=>Z({...X,description:e.target.value}),disabled:K})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(O,{htmlFor:`systemPrompt`,className:`hive-label--field`,children:`System Prompt`}),(0,H.jsxs)(D,{children:[(0,H.jsx)(S,{asChild:!0,children:(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,H.jsxs)(E,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,H.jsxs)(T,{children:[(0,H.jsx)(ee,{className:`text-xl`,children:`Editar System Prompt`}),(0,H.jsx)(C,{className:`text-sm text-white/50`,children:`El prompt base de comportamiento del agente. Se recomienda formato Markdown.`})]}),(0,H.jsx)(`div`,{className:`py-2`,children:(0,H.jsx)(k,{value:X.systemPrompt||``,onChange:e=>Z({...X,systemPrompt:e.target.value}),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`,disabled:K})}),(0,H.jsx)(x,{children:(0,H.jsx)(w,{asChild:!0,children:(0,H.jsx)(v,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Guardar Cambios`})})})]})]})]}),X.systemPrompt?(0,H.jsxs)(`p`,{className:`text-xs text-white/40 line-clamp-1 italic border border-white/5 bg-white/[0.02] p-2 rounded-md`,children:[`"`,X.systemPrompt,`"`]}):(0,H.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(c,{className:`h-4 w-4 text-emerald-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Workspace Directory`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`workspace`,className:`hive-label--field`,children:`Directorio de Trabajo del Agente`}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(y,{id:`workspace`,placeholder:`Ej: /home/user/proyectos, D:\\Work, /Volumes/USB`,className:`hive-input flex-1 font-mono text-sm`,value:X.workspace,onChange:e=>{Z({...X,workspace:e.target.value}),Q(e.target.value)},disabled:K}),X.workspace&&J.exists&&J.accessible&&(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`icon`,onClick:re,className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10`,title:`Abrir en el explorador`,children:(0,H.jsx)(o,{className:`h-4 w-4`})})]}),(0,H.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente creará archivos, carpetas y ejecutará comandos. Puede ser cualquier ubicación en tu sistema (disco duro, USB, red, etc.).`}),X.workspace&&X.workspace.trim()!==``&&(0,H.jsxs)(`div`,{className:f(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,J.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!J.isValidating&&J.exists&&J.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!J.isValidating&&J.exists&&!J.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!J.isValidating&&!J.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[J.isValidating&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(b,{className:`h-3.5 w-3.5 animate-spin`}),(0,H.jsx)(`span`,{children:`Validando directorio...`})]}),!J.isValidating&&J.exists&&J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(r,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`Directorio válido y accesible`})]}),!J.isValidating&&J.exists&&!J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(i,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio existe pero no tiene permisos de lectura/escritura`})]}),!J.isValidating&&!J.exists&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(c,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio no existe`}),!J.error&&(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,onClick:ne,className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear directorio`})]})]})]})]}),(0,H.jsx)(`div`,{className:`hive-card-divider`}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(a,{className:`h-4 w-4 text-blue-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Motor de Inteligencia`})]}),(0,H.jsx)(l,{selectedProviderId:X.provider_id||void 0,selectedModelId:X.model_id||void 0,onProviderChange:e=>Z({...X,provider_id:e,model_id:``}),onModelChange:e=>Z({...X,model_id:e}),disabled:K,typeFilter:`llm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`tone`,className:`hive-label--field`,children:`Tono de Voz`}),(0,H.jsxs)(P,{value:X.tone,onValueChange:e=>Z({...X,tone:e}),disabled:K,children:[(0,H.jsx)(M,{className:`hive-select-trigger`,children:(0,H.jsx)(N,{placeholder:`Selecciona un tono`})}),(0,H.jsx)(j,{className:`hive-select-content`,children:U.map(e=>(0,H.jsx)(A,{value:e.value,className:`hive-select-item`,children:e.label},e.value))})]})]}),(0,H.jsxs)(`div`,{className:`hive-toggle-panel`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(u,{className:`h-3.5 w-3.5 text-purple-400`}),(0,H.jsx)(O,{htmlFor:`role`,className:`text-xs font-medium text-white/70`,children:`Rol`})]}),(0,H.jsxs)(P,{value:X.role,onValueChange:e=>Z({...X,role:e}),disabled:K,children:[(0,H.jsx)(M,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,H.jsx)(N,{})}),(0,H.jsxs)(j,{className:`bg-zinc-900 border-white/10`,children:[(0,H.jsx)(A,{value:`coordinator`,children:`Coordinador`}),(0,H.jsx)(A,{value:`worker`,children:`Worker`})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`h-2 w-2 rounded-full ${X.enabled?`bg-blue-400`:`bg-zinc-600`}`}),(0,H.jsx)(O,{htmlFor:`enabled`,className:`text-xs font-medium text-white/70`,children:`Habilitado`})]}),(0,H.jsx)(F,{id:`enabled`,checked:X.enabled,onCheckedChange:e=>Z({...X,enabled:e}),disabled:K})]})]})]}),q&&(0,H.jsx)(`div`,{className:`hive-form-error`,children:q}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 pt-4`,children:[n&&(0,H.jsx)(v,{type:`button`,variant:`outline`,onClick:n,disabled:K,className:`hive-btn--form-cancel`,children:`Cancelar`}),(0,H.jsx)(v,{type:`submit`,disabled:K,className:`hive-btn--form-submit`,children:K?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(b,{className:`mr-2 h-4 w-4 animate-spin`}),`Procesando...`]}):(0,H.jsx)(H.Fragment,{children:$?`Actualizar Agente`:`Desplegar Agente`})})]})]})})]})}export{W as t};
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./check-C8pw-7Fx.js";import{t as i}from"./circle-alert-CtDbK2nl.js";import{t as a}from"./useProviders-Dj1k5PCk.js";import{t as o}from"./external-link-6oTH9pUM.js";import{n as s,r as c,t as l}from"./ModelSelector-BX4IvuYY.js";import{t as u}from"./shield-CIarwBvx.js";import{t as d}from"./sparkles-DVvY6jDT.js";import{t as f}from"./utils-DEmd_M8c.js";import{F as p,N as m,O as h,Q as g,S as _,X as v,Y as y,ct as b}from"./index-BG3nUPKq.js";import{a as x,c as S,i as C,n as w,o as T,r as E,s as ee,t as D}from"./dialog-BP3GTCPn.js";import{t as O}from"./label-D_fvqJyD.js";import{t as k}from"./textarea-BgZJFZTX.js";import{i as A,n as j,o as M,s as N,t as P}from"./select-v_3QBYrD.js";import{t as F}from"./switch-ndx8VCpm.js";import{a as I,i as L,n as R,r as z,t as B}from"./card-mTJ4oZbL.js";var V=e(t(),1),H=n(),U=[{value:`friendly`,label:`Amigable`},{value:`professional`,label:`Profesional`},{value:`casual`,label:`Casual`},{value:`formal`,label:`Formal`},{value:`creative`,label:`Creativo`}];function W({initialData:e,onSuccess:t,onCancel:n}){let{createAgent:W,updateAgent:G,isLoading:K,error:q}=_(),{activeProviders:te}=h(),[J,Y]=(0,V.useState)({isValidating:!1,exists:!1,accessible:!1}),[X,Z]=(0,V.useState)({name:``,description:``,tone:`professional`,provider_id:``,model_id:``,role:`coordinator`,enabled:!0,systemPrompt:``,workspace:e?.workspace||``});(0,V.useEffect)(()=>{e&&Z({...e,provider_id:e.provider_id||e.providerId||``,model_id:e.model_id||e.modelId||``})},[e]);let Q=async e=>{if(!e||e.trim()===``){Y({isValidating:!1,exists:!1,accessible:!1});return}Y({isValidating:!0,exists:!1,accessible:!1});try{let t=await m(`/api/workspace/validate`,{method:`POST`,body:{path:e}});Y({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){Y({isValidating:!1,exists:!1,accessible:!1,error:e.message})}},ne=async()=>{if(X.workspace)try{await m(`/api/workspace/create`,{method:`POST`,body:{path:X.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await Q(X.workspace)}catch(e){p.fire(`Error`,e.message,`error`)}},re=async()=>{if(X.workspace)try{await m(`/api/workspace/open?path=${encodeURIComponent(X.workspace)}`,{method:`GET`})}catch(e){p.fire(`Error`,e.message,`error`)}},ie=async n=>{if(n.preventDefault(),!X.provider_id||!X.model_id){p.fire(`Incompleto`,`Por favor selecciona un proveedor y modelo`,`warning`);return}try{e?.id?await G(e.id,X):await W(X),t&&t()}catch(e){console.error(e)}},$=!!e?.id;return(0,H.jsxs)(B,{className:`hive-card--form group`,children:[(0,H.jsx)(`div`,{className:`hive-glow-blob--card absolute -top-24 -right-24 h-48 w-48 bg-blue-600/10 group-hover:bg-blue-600/20`,style:{borderRadius:`50%`,filter:`blur(80px)`}}),(0,H.jsx)(L,{className:`relative`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:$?(0,H.jsx)(s,{className:`h-5 w-5`}):(0,H.jsx)(d,{className:`h-5 w-5`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(I,{className:`text-xl font-bold text-white/90`,children:$?`Configurar Nodo`:`Desplegar Nuevo Nodo`}),(0,H.jsx)(z,{className:`text-white/40`,children:$?`Ajusta los parámetros de tu agente inteligente.`:`Crea una nueva entidad inteligente para tu colmena.`})]})]}),n&&(0,H.jsx)(v,{variant:`ghost`,size:`icon`,onClick:n,className:`text-white/40 hover:text-white hover:bg-white/5`,children:(0,H.jsx)(g,{className:`h-5 w-5`})})]})}),(0,H.jsx)(R,{className:`relative space-y-6 pt-2`,children:(0,H.jsxs)(`form`,{onSubmit:ie,className:`space-y-8`,children:[(0,H.jsxs)(`div`,{className:`grid gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`name`,className:`hive-label--field`,children:`Nombre del Agente`}),(0,H.jsx)(y,{id:`name`,placeholder:`Ej: Analista de Mercado`,className:`hive-input`,value:X.name,onChange:e=>Z({...X,name:e.target.value}),disabled:K,required:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`description`,className:`hive-label--field`,children:`Descripción / Rol`}),(0,H.jsx)(k,{id:`description`,placeholder:`Describe qué hace este agente y cuáles son sus objetivos...`,className:`hive-textarea`,value:X.description,onChange:e=>Z({...X,description:e.target.value}),disabled:K})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(O,{htmlFor:`systemPrompt`,className:`hive-label--field`,children:`System Prompt`}),(0,H.jsxs)(D,{children:[(0,H.jsx)(S,{asChild:!0,children:(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,H.jsxs)(E,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,H.jsxs)(T,{children:[(0,H.jsx)(ee,{className:`text-xl`,children:`Editar System Prompt`}),(0,H.jsx)(C,{className:`text-sm text-white/50`,children:`El prompt base de comportamiento del agente. Se recomienda formato Markdown.`})]}),(0,H.jsx)(`div`,{className:`py-2`,children:(0,H.jsx)(k,{value:X.systemPrompt||``,onChange:e=>Z({...X,systemPrompt:e.target.value}),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`,disabled:K})}),(0,H.jsx)(x,{children:(0,H.jsx)(w,{asChild:!0,children:(0,H.jsx)(v,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Guardar Cambios`})})})]})]})]}),X.systemPrompt?(0,H.jsxs)(`p`,{className:`text-xs text-white/40 line-clamp-1 italic border border-white/5 bg-white/[0.02] p-2 rounded-md`,children:[`"`,X.systemPrompt,`"`]}):(0,H.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(c,{className:`h-4 w-4 text-emerald-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Workspace Directory`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`workspace`,className:`hive-label--field`,children:`Directorio de Trabajo del Agente`}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(y,{id:`workspace`,placeholder:`Ej: /home/user/proyectos, D:\\Work, /Volumes/USB`,className:`hive-input flex-1 font-mono text-sm`,value:X.workspace,onChange:e=>{Z({...X,workspace:e.target.value}),Q(e.target.value)},disabled:K}),X.workspace&&J.exists&&J.accessible&&(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`icon`,onClick:re,className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10`,title:`Abrir en el explorador`,children:(0,H.jsx)(o,{className:`h-4 w-4`})})]}),(0,H.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente creará archivos, carpetas y ejecutará comandos. Puede ser cualquier ubicación en tu sistema (disco duro, USB, red, etc.).`}),X.workspace&&X.workspace.trim()!==``&&(0,H.jsxs)(`div`,{className:f(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,J.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!J.isValidating&&J.exists&&J.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!J.isValidating&&J.exists&&!J.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!J.isValidating&&!J.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[J.isValidating&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(b,{className:`h-3.5 w-3.5 animate-spin`}),(0,H.jsx)(`span`,{children:`Validando directorio...`})]}),!J.isValidating&&J.exists&&J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(r,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`Directorio válido y accesible`})]}),!J.isValidating&&J.exists&&!J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(i,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio existe pero no tiene permisos de lectura/escritura`})]}),!J.isValidating&&!J.exists&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(c,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio no existe`}),!J.error&&(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,onClick:ne,className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear directorio`})]})]})]})]}),(0,H.jsx)(`div`,{className:`hive-card-divider`}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(a,{className:`h-4 w-4 text-blue-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Motor de Inteligencia`})]}),(0,H.jsx)(l,{selectedProviderId:X.provider_id||void 0,selectedModelId:X.model_id||void 0,onProviderChange:e=>Z({...X,provider_id:e,model_id:``}),onModelChange:e=>Z({...X,model_id:e}),disabled:K,typeFilter:`llm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`tone`,className:`hive-label--field`,children:`Tono de Voz`}),(0,H.jsxs)(P,{value:X.tone,onValueChange:e=>Z({...X,tone:e}),disabled:K,children:[(0,H.jsx)(M,{className:`hive-select-trigger`,children:(0,H.jsx)(N,{placeholder:`Selecciona un tono`})}),(0,H.jsx)(j,{className:`hive-select-content`,children:U.map(e=>(0,H.jsx)(A,{value:e.value,className:`hive-select-item`,children:e.label},e.value))})]})]}),(0,H.jsxs)(`div`,{className:`hive-toggle-panel`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(u,{className:`h-3.5 w-3.5 text-purple-400`}),(0,H.jsx)(O,{htmlFor:`role`,className:`text-xs font-medium text-white/70`,children:`Rol`})]}),(0,H.jsxs)(P,{value:X.role,onValueChange:e=>Z({...X,role:e}),disabled:K,children:[(0,H.jsx)(M,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,H.jsx)(N,{})}),(0,H.jsxs)(j,{className:`bg-zinc-900 border-white/10`,children:[(0,H.jsx)(A,{value:`coordinator`,children:`Coordinador`}),(0,H.jsx)(A,{value:`worker`,children:`Worker`})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`h-2 w-2 rounded-full ${X.enabled?`bg-blue-400`:`bg-zinc-600`}`}),(0,H.jsx)(O,{htmlFor:`enabled`,className:`text-xs font-medium text-white/70`,children:`Habilitado`})]}),(0,H.jsx)(F,{id:`enabled`,checked:X.enabled,onCheckedChange:e=>Z({...X,enabled:e}),disabled:K})]})]})]}),q&&(0,H.jsx)(`div`,{className:`hive-form-error`,children:q}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 pt-4`,children:[n&&(0,H.jsx)(v,{type:`button`,variant:`outline`,onClick:n,disabled:K,className:`hive-btn--form-cancel`,children:`Cancelar`}),(0,H.jsx)(v,{type:`submit`,disabled:K,className:`hive-btn--form-submit`,children:K?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(b,{className:`mr-2 h-4 w-4 animate-spin`}),`Procesando...`]}):(0,H.jsx)(H.Fragment,{children:$?`Actualizar Agente`:`Desplegar Agente`})})]})]})})]})}export{W as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./vendor-react-kUOwxn0g.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./createLucideIcon-BRaPSYgN.js";import{t as a}from"./activity-C_GS5wrG.js";import{t as o}from"./calendar-B6x9cw-q.js";import{t as s}from"./check-C8pw-7Fx.js";import{t as c}from"./chevron-left-GK4EQOyZ.js";import{t as l}from"./circle-alert-CtDbK2nl.js";import{t as u}from"./circle-check-BKNT2_q6.js";import{n as d,t as f}from"./earth-BJRGJbVn.js";import{t as p}from"./useProviders-DXr4pJ57.js";import{t as m}from"./external-link-6oTH9pUM.js";import{n as h,r as g,t as _}from"./ModelSelector-DciHLo7R.js";import{a as v,i as y,o as b,r as x,s as S}from"./agentCapabilities-CDSfJWhw.js";import{t as C}from"./shield-CIarwBvx.js";import{t as w}from"./sparkles-DVvY6jDT.js";import{t as T}from"./terminal-BEcTK780.js";import{t as ee}from"./zap-DSoX9NDk.js";import{t as E}from"./utils-DEmd_M8c.js";import{c as D,l as O}from"./vendor-router-DSMCk-Ka.js";import{$ as k,A,D as te,I as j,N as M,O as N,P,S as F,X as I,Y as L,ct as R,dt as z,k as ne,mt as B,nt as V}from"./index-mBw9Tl7u.js";import{t as H}from"./badge-B5AKge1b.js";import{a as U,c as W,i as re,n as ie,o as G,r as K,s as ae,t as oe}from"./dialog-DKnsGLwr.js";import{t as q}from"./label-D_fvqJyD.js";import{t as se}from"./textarea-BgZJFZTX.js";import{i as J,n as Y,o as ce,s as X,t as le}from"./select-v_3QBYrD.js";import{t as ue}from"./switch-ndx8VCpm.js";var Z=i(`BookOpenCheck`,[[`path`,{d:`M12 21V7`,key:`gj6g52`}],[`path`,{d:`m16 12 2 2 4-4`,key:`mdajum`}],[`path`,{d:`M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3`,key:`8arnkb`}]]),de=i(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Q=i(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),fe=i(`Fingerprint`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),pe=i(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),me=i(`PackageOpen`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),he=n(),ge=e(t(),1),$=r();function _e(e){let t=(0,he.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(n,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ve({agentId:e}){let{agents:t,updateAgent:n,fetchAgents:r}=F(),{fetchProviders:i}=N(),{fetchModels:o}=te();(0,ge.useEffect)(()=>{r(),i(),o()},[r,i,o]);let c=t.find(t=>t.id===e),[u,d]=(0,ge.useState)({name:``,description:``,provider_id:``,model_id:``,tone:``,role:`coordinator`,enabled:!0,headers:``,systemPrompt:``,workspace:``}),[f,p]=(0,ge.useState)({isValidating:!1,exists:!1,accessible:!1});(0,ge.useEffect)(()=>{c&&(d({name:c.name||``,description:c.description||``,provider_id:c.provider_id||c.providerId||``,model_id:c.model_id||c.modelId||``,tone:c.tone||``,role:c.role||`coordinator`,enabled:!!c.enabled,headers:``,systemPrompt:c.systemPrompt||``,workspace:c.workspace||``}),c.workspace&&v(c.workspace))},[c]);let v=async e=>{if(!e||e.trim()===``){p({isValidating:!1,exists:!1,accessible:!1});return}p({isValidating:!0,exists:!1,accessible:!1});try{let t=await M(`/api/workspace/validate`,{method:`POST`,body:{path:e}});p({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){p({isValidating:!1,exists:!1,accessible:!1,error:e.message})}};return c?(0,$.jsx)(`div`,{className:`space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500`,children:(0,$.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,$.jsxs)(`div`,{className:`lg:col-span-1 space-y-6`,children:[(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-blue-500/10 border border-blue-500/20`,children:(0,$.jsx)(_e,{icon:V,className:`h-4 w-4 text-blue-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Identidad Base`})]}),(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(q,{htmlFor:`name`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Nombre Público`}),(0,$.jsx)(L,{id:`name`,value:u.name,onChange:e=>d(t=>({...t,name:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Nombre del nodo`})]}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(q,{htmlFor:`tone`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Tono Cognitivo`}),(0,$.jsx)(L,{id:`tone`,value:u.tone,onChange:e=>d(t=>({...t,tone:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Ej: Analítico, Conciso...`})]})]})]}),(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-purple-500/10 border border-purple-500/20`,children:(0,$.jsx)(_e,{icon:C,className:`h-4 w-4 text-purple-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Permisos de Red`})]}),(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(q,{className:`text-sm font-semibold`,children:`Rol`}),(0,$.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Coordinador o Worker`})]}),(0,$.jsxs)(le,{value:u.role,onValueChange:e=>d(t=>({...t,role:e})),children:[(0,$.jsx)(ce,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,$.jsx)(X,{})}),(0,$.jsxs)(Y,{className:`bg-zinc-900 border-white/10`,children:[(0,$.jsx)(J,{value:`coordinator`,children:`Coordinador`}),(0,$.jsx)(J,{value:`worker`,children:`Worker`})]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(q,{className:`text-sm font-semibold`,children:`Nodo Activo`}),(0,$.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Disponible para la colmena`})]}),(0,$.jsx)(ue,{checked:u.enabled,onCheckedChange:e=>d(t=>({...t,enabled:e}))})]})]})]}),(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-emerald-500/10 border border-emerald-500/20`,children:(0,$.jsx)(_e,{icon:g,className:`h-4 w-4 text-emerald-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Workspace Directory`})]}),(0,$.jsx)(`div`,{className:`space-y-4`,children:(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(q,{htmlFor:`workspace`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directorio de Trabajo`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(L,{id:`workspace`,value:u.workspace,onChange:e=>{d(t=>({...t,workspace:e.target.value})),v(e.target.value)},className:`bg-white/5 border-white/10 focus:border-emerald-500/50 rounded-xl h-11 font-mono text-sm flex-1`,placeholder:`Ej: /home/user/proyectos, D:\\Work`}),u.workspace&&f.exists&&f.accessible&&(0,$.jsx)(I,{type:`button`,variant:`outline`,size:`icon`,onClick:async()=>{if(u.workspace)try{await M(`/api/workspace/open?path=${encodeURIComponent(u.workspace)}`,{method:`GET`})}catch(e){P.fire({icon:`error`,title:e.message})}},className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10 h-11 w-11`,title:`Abrir en el explorador`,children:(0,$.jsx)(m,{className:`h-4 w-4`})})]}),(0,$.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente operará. Puede ser cualquier ubicación (disco, USB, red).`}),u.workspace&&u.workspace.trim()!==``&&(0,$.jsxs)(`div`,{className:E(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,f.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!f.isValidating&&f.exists&&f.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!f.isValidating&&f.exists&&!f.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!f.isValidating&&!f.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[f.isValidating&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(R,{className:`h-3.5 w-3.5 animate-spin`}),(0,$.jsx)(`span`,{children:`Validando directorio...`})]}),!f.isValidating&&f.exists&&f.accessible&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`Directorio válido y accesible`})]}),!f.isValidating&&f.exists&&!f.accessible&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(l,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`Sin permisos de lectura/escritura`})]}),!f.isValidating&&!f.exists&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`El directorio no existe`}),!f.error&&(0,$.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,onClick:async()=>{if(u.workspace)try{await M(`/api/workspace/create`,{method:`POST`,body:{path:u.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await v(u.workspace)}catch(e){P.fire({icon:`error`,title:e.message})}},className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear`})]})]})]})})]})]}),(0,$.jsx)(`div`,{className:`lg:col-span-2 space-y-6`,children:(0,$.jsxs)(`div`,{className:`p-8 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-8`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-amber-500/10 border border-amber-500/20`,children:(0,$.jsx)(_e,{icon:w,className:`h-4 w-4 text-amber-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Configuración Cognitiva`})]}),(0,$.jsxs)(I,{onClick:async()=>{j.show(`Sincronizando configuración del agente...`);try{await n(e,{...u,role:u.role,enabled:+!!u.enabled,workspace:u.workspace||null}),P.fire({icon:`success`,title:`Cambios sincronizados correctamente`})}catch(e){P.fire({icon:`error`,title:e instanceof Error?e.message:`Error al sincronizar cambios`})}finally{j.hide()}},className:`bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-xl px-6 shadow-[0_4px_15px_rgba(37,99,235,0.3)] transition-all active:scale-95 gap-2`,children:[(0,$.jsx)(_e,{icon:h,className:`h-4 w-4`}),`Sincronizar Cambios`]})]}),(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(q,{htmlFor:`description`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directiva de Misión (Descripción)`}),(0,$.jsx)(se,{id:`description`,value:u.description,onChange:e=>d(t=>({...t,description:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-2xl min-h-[80px] resize-none`,placeholder:`Define el propósito general de este nodo...`})]}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,$.jsx)(q,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`System Prompt (Markdown)`}),(0,$.jsxs)(oe,{children:[(0,$.jsx)(W,{asChild:!0,children:(0,$.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,$.jsxs)(K,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,$.jsxs)(G,{children:[(0,$.jsx)(ae,{className:`text-xl`,children:`Editar System Prompt`}),(0,$.jsx)(re,{className:`text-sm text-white/50`,children:`El comportamiento principal del agente. Se recomienda usar Markdown.`})]}),(0,$.jsx)(`div`,{className:`py-2`,children:(0,$.jsx)(se,{value:u.systemPrompt,onChange:e=>d(t=>({...t,systemPrompt:e.target.value})),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`})}),(0,$.jsx)(U,{children:(0,$.jsx)(ie,{asChild:!0,children:(0,$.jsx)(I,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Listo`})})})]})]})]}),u.systemPrompt?(0,$.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4 max-h-[120px] overflow-y-auto custom-scrollbar`,children:(0,$.jsx)(`p`,{className:`text-xs text-white/60 font-mono whitespace-pre-wrap italic`,children:u.systemPrompt})}):(0,$.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4`,children:(0,$.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})})]}),(0,$.jsx)(_,{selectedProviderId:u.provider_id||void 0,selectedModelId:u.model_id||void 0,onProviderChange:e=>d(t=>({...t,provider_id:e,model_id:``})),onModelChange:e=>d(t=>({...t,model_id:e})),typeFilter:`llm`})]}),(0,$.jsxs)(`div`,{className:`mt-8 p-4 rounded-2xl bg-white/[0.03] border border-white/5 flex items-start gap-4 italic`,children:[(0,$.jsx)(_e,{icon:z,className:`h-5 w-5 text-white/20 mt-0.5`}),(0,$.jsx)(`p`,{className:`text-[11px] text-white/30 leading-relaxed`,children:`Las credenciales de acceso y llaves de cifrado para los headers personalizados se gestionan en una capa segura y no son visibles en texto plano para mantener la integridad de la red.`})]})]})})]})}):(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 text-center space-y-4 rounded-3xl border border-dashed border-white/10 bg-white/5`,children:[(0,$.jsx)(_e,{icon:a,className:`h-12 w-12 text-white/10 animate-pulse`}),(0,$.jsx)(`p`,{className:`text-white/40 font-medium`,children:`Buscando nodo en la colmena...`})]})}function ye(e){let t=(0,he.c)(87),{agent:n}=e,{providers:r}=N(),{models:i}=te(),s=n.role===`coordinator`,c=n.provider_id||n.providerId,l=n.model_id||n.modelId,u=n.created_at||n.createdAt,d;t[0]===u?d=t[1]:(d=u?v(typeof u==`string`?new Date(u):new Date(u*1e3),`PPP`,{locale:y}):`Fecha desconocida`,t[0]=u,t[1]=d);let f=d,m;t[2]!==c||t[3]!==r?(m=r.find(e=>e.id===c)?.name||c,t[2]=c,t[3]=r,t[4]=m):m=t[4];let h=m,g;t[5]!==l||t[6]!==i?(g=i.find(e=>e.id===l)?.name||l,t[5]=l,t[6]=i,t[7]=g):g=t[7];let _=g,x=`hive-card--internal group ${n.enabled?`hive-card--internal-active`:`hive-card--internal-disabled`}`,S;t[8]===n.enabled?S=t[9]:(S=n.enabled&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`absolute -top-24 -right-24 h-64 w-64 bg-blue-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-blue-600/20 transition-all duration-700`}),(0,$.jsx)(`div`,{className:`absolute -bottom-24 -left-24 h-64 w-64 bg-purple-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-purple-600/20 transition-all duration-700`})]}),t[8]=n.enabled,t[9]=S);let C=`hive-icon-wrap--internal ${n.enabled?`hive-icon-wrap--internal-active`:`hive-icon-wrap--internal-disabled`}`,w=`h-6 w-6 ${n.enabled?`text-blue-400`:`text-white/20`}`,T;t[10]===w?T=t[11]:(T=(0,$.jsx)(fe,{className:w}),t[10]=w,t[11]=T);let E;t[12]!==C||t[13]!==T?(E=(0,$.jsx)(`div`,{className:C,children:T}),t[12]=C,t[13]=T,t[14]=E):E=t[14];let D=`hive-page-header__label ${!n.enabled&&`text-white/20`}`,O;t[15]===D?O=t[16]:(O=(0,$.jsx)(`span`,{className:D,children:`Identidad de Nodo`}),t[15]=D,t[16]=O);let k;t[17]!==n.enabled||t[18]!==s?(k=s&&(0,$.jsx)(H,{className:`hive-tag--coordinator ${!n.enabled&&`bg-white/5 text-white/20 border-white/10`}`,children:`Coordinador`}),t[17]=n.enabled,t[18]=s,t[19]=k):k=t[19];let A;t[20]!==O||t[21]!==k?(A=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[O,k]}),t[20]=O,t[21]=k,t[22]=A):A=t[22];let j=`text-4xl font-black tracking-tighter ${n.enabled?`text-white`:`text-white/40`}`,M;t[23]!==n.name||t[24]!==j?(M=(0,$.jsx)(`h1`,{className:j,children:n.name}),t[23]=n.name,t[24]=j,t[25]=M):M=t[25];let P;t[26]!==A||t[27]!==M?(P=(0,$.jsxs)(`div`,{children:[A,M]}),t[26]=A,t[27]=M,t[28]=P):P=t[28];let F;t[29]!==P||t[30]!==E?(F=(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[E,P]}),t[29]=P,t[30]=E,t[31]=F):F=t[31];let I=`text-lg leading-relaxed max-w-2xl font-light italic ${n.enabled?`text-white/60`:`text-white/20`}`,L=n.description||`Este agente no tiene una descripción definida aún.`,R;t[32]!==I||t[33]!==L?(R=(0,$.jsxs)(`p`,{className:I,children:[`"`,L,`"`]}),t[32]=I,t[33]=L,t[34]=R):R=t[34];let z;t[35]!==F||t[36]!==R?(z=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[F,R]}),t[35]=F,t[36]=R,t[37]=z):z=t[37];let ne=n.enabled?`text-blue-400`:`text-white/20`,B;t[38]!==n.enabled||t[39]!==_||t[40]!==h||t[41]!==ne?(B=(0,$.jsx)(be,{icon:p,label:`Infraestructura`,value:h,subValue:_,color:ne,enabled:n.enabled}),t[38]=n.enabled,t[39]=_,t[40]=h,t[41]=ne,t[42]=B):B=t[42];let V=n.tone||`Neutral`,U=n.enabled?`text-purple-400`:`text-white/20`,W;t[43]!==n.enabled||t[44]!==V||t[45]!==U?(W=(0,$.jsx)(be,{icon:ee,label:`Personalidad`,value:V,color:U,enabled:n.enabled}),t[43]=n.enabled,t[44]=V,t[45]=U,t[46]=W):W=t[46];let re=n.enabled?`text-emerald-400`:`text-white/20`,ie;t[47]!==n.enabled||t[48]!==f||t[49]!==re?(ie=(0,$.jsx)(be,{icon:o,label:`Desplegado el`,value:f,color:re,enabled:n.enabled}),t[47]=n.enabled,t[48]=f,t[49]=re,t[50]=ie):ie=t[50];let G;t[51]!==B||t[52]!==W||t[53]!==ie?(G=(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4`,children:[B,W,ie]}),t[51]=B,t[52]=W,t[53]=ie,t[54]=G):G=t[54];let K;t[55]!==z||t[56]!==G?(K=(0,$.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[z,G]}),t[55]=z,t[56]=G,t[57]=K):K=t[57];let ae;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(`span`,{className:`hive-label block`,children:`Estado Operativo`}),t[58]=ae):ae=t[58];let oe=n.enabled?n.status:`hibernated`,q;t[59]===oe?q=t[60]:(q=(0,$.jsxs)(`div`,{className:`text-center md:text-right space-y-2`,children:[ae,(0,$.jsx)(b,{status:oe,className:`px-6 py-2 text-sm border-2`})]}),t[59]=oe,t[60]=q);let se;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(`p`,{className:`hive-label mb-1`,children:`Carga de Red`}),t[61]=se):se=t[61];let J;t[62]===n.enabled?J=t[63]:(J=n.enabled&&(0,$.jsx)(`div`,{className:`hive-network-fill`}),t[62]=n.enabled,t[63]=J);let Y;t[64]===J?Y=t[65]:(Y=(0,$.jsxs)(`div`,{className:`flex-1`,children:[se,(0,$.jsx)(`div`,{className:`hive-network-track`,children:J})]}),t[64]=J,t[65]=Y);let ce=`h-5 w-5 ${n.enabled?`text-blue-400 animate-pulse`:`text-white/10`}`,X;t[66]===ce?X=t[67]:(X=(0,$.jsx)(a,{className:ce}),t[66]=ce,t[67]=X);let le;t[68]!==Y||t[69]!==X?(le=(0,$.jsxs)(`div`,{className:`hive-network-panel md:w-auto`,children:[Y,X]}),t[68]=Y,t[69]=X,t[70]=le):le=t[70];let ue;t[71]!==q||t[72]!==le?(ue=(0,$.jsxs)(`div`,{className:`flex flex-col items-center md:items-end gap-6 min-w-[200px]`,children:[q,le]}),t[71]=q,t[72]=le,t[73]=ue):ue=t[73];let Z;t[74]!==K||t[75]!==ue?(Z=(0,$.jsxs)(`div`,{className:`relative flex flex-col md:flex-row gap-8 items-start justify-between`,children:[K,ue]}),t[74]=K,t[75]=ue,t[76]=Z):Z=t[76];let de=`hive-strip--bottom ${!n.enabled&&`opacity-20`}`,Q;t[77]===de?Q=t[78]:(Q=(0,$.jsx)(`div`,{className:de}),t[77]=de,t[78]=Q);let pe;t[79]===n.id?pe=t[80]:(pe=(0,$.jsxs)(`div`,{className:`absolute top-4 right-8 hive-mono hidden md:block`,children:[`NODE_UID: `,n.id]}),t[79]=n.id,t[80]=pe);let me;return t[81]!==x||t[82]!==Z||t[83]!==Q||t[84]!==pe||t[85]!==S?(me=(0,$.jsxs)(`div`,{className:x,children:[S,Z,Q,pe]}),t[81]=x,t[82]=Z,t[83]=Q,t[84]=pe,t[85]=S,t[86]=me):me=t[86],me}function be(e){let t=(0,he.c)(21),{icon:n,label:r,value:i,subValue:a,color:o,enabled:s}=e,c=`hive-info-card ${s?`hive-info-card--active`:`hive-info-card--disabled`}`,l=`h-3.5 w-3.5 ${o}`,u;t[0]!==n||t[1]!==l?(u=(0,$.jsx)(n,{className:l}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d;t[3]===r?d=t[4]:(d=(0,$.jsx)(`span`,{className:`hive-info-card__label`,children:r}),t[3]=r,t[4]=d);let f;t[5]!==u||t[6]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[u,d]}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p=`hive-info-card__value ${s?`text-white/80 group-hover/item:text-white`:`text-white/20`}`,m;t[8]!==p||t[9]!==i?(m=(0,$.jsx)(`p`,{className:p,children:i}),t[8]=p,t[9]=i,t[10]=m):m=t[10];let h;t[11]!==s||t[12]!==a?(h=a&&(0,$.jsx)(`p`,{className:`hive-info-card__sub ${s?`text-white/40`:`text-white/10`}`,children:a}),t[11]=s,t[12]=a,t[13]=h):h=t[13];let g;t[14]!==m||t[15]!==h?(g=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[m,h]}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;return t[17]!==c||t[18]!==f||t[19]!==g?(_=(0,$.jsxs)(`div`,{className:c,children:[f,g]}),t[17]=c,t[18]=f,t[19]=g,t[20]=_):_=t[20],_}var xe={filesystem:`Archivos`,web:`Web`,cron:`Automatización`,cli:`Terminal`,agents:`Agentes`,canvas:`Canvas`,office:`Office`,mcp:`MCP`,core:`Sistema`};function Se(e){return e.startsWith(`fs_`)?`filesystem`:e.startsWith(`browser_`)||e.startsWith(`web_`)||e===`search_knowledge`?`web`:e.startsWith(`cron`)?`cron`:e.startsWith(`office_`)?`office`:e.startsWith(`mcp`)||e.includes(`_mcp`)?`mcp`:e.startsWith(`canvas_`)||e.startsWith(`a2ui_`)?`canvas`:e.startsWith(`cli_`)?`cli`:e.includes(`agent`)||e.includes(`task_`)||e.includes(`acceptance`)?`agents`:`core`}function Ce(e){return e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function we(e){let t=(0,he.c)(59),{agent:n}=e,{tools:r,isLoading:i,fetchTools:a}=A(),{skills:o,isLoading:s,fetchSkills:c}=ne(),l,u;t[0]!==c||t[1]!==a||t[2]!==o.length||t[3]!==r.length?(l=()=>{r.length===0&&a(),o.length===0&&c()},u=[c,a,o.length,r.length],t[0]=c,t[1]=a,t[2]=o.length,t[3]=r.length,t[4]=l,t[5]=u):(l=t[4],u=t[5]),(0,ge.useEffect)(l,u);let d;t[6]===n.toolsJson?d=t[7]:(d=x(n.toolsJson),t[6]=n.toolsJson,t[7]=d);let f=d,p;t[8]===n.skillsJson?p=t[9]:(p=x(n.skillsJson),t[8]=n.skillsJson,t[9]=p);let m=p,h;t[10]!==n.minimalTools||t[11]!==n.role?(h=n.role===`coordinator`?n.minimalTools??[]:[],t[10]=n.minimalTools,t[11]=n.role,t[12]=h):h=t[12];let g=h,_;t[13]!==n.minimalSkills||t[14]!==n.role?(_=n.role===`coordinator`?n.minimalSkills??[]:[],t[13]=n.minimalSkills,t[14]=n.role,t[15]=_):_=t[15];let v=_,y;if(t[16]!==g||t[17]!==f||t[18]!==r){let e=new Map;g.forEach(t=>e.set(t,{id:t,source:`base`})),f.forEach(t=>{let n=e.get(t.id);e.set(t.id,{...t,source:n?.source??`assigned`})}),y=Array.from(e.values()).map(e=>{let t=r.find(t=>t.id===e.id);return{id:e.id,name:t?.name||e.suppliedName||Ce(e.id),description:t?.description||`Capacidad disponible en el loadout operativo de este agente.`,category:t?.category||Se(e.id),available:t?t.enabled&&t.active!==!1:!0,source:e.source}}),t[16]=g,t[17]=f,t[18]=r,t[19]=y}else y=t[19];let b=y,C;if(t[20]!==v||t[21]!==m||t[22]!==o){let e=new Map;v.forEach(t=>e.set(t.id,{id:t.id,suppliedName:t.name,source:`base`})),m.forEach(t=>{let n=e.get(t.id);e.set(t.id,{...t,source:n?.source??`assigned`})}),C=Array.from(e.values()).map(e=>{let t=o.find(t=>t.id===e.id),n=v.find(t=>t.id===e.id);return{id:e.id,name:t?.name||n?.name||e.suppliedName||Ce(e.id),description:t?.description||n?.description||`Conocimiento operativo incluido en el contexto de este agente.`,category:t?.category||n?.category||`core`,source:e.source}}),t[20]=v,t[21]=m,t[22]=o,t[23]=C}else C=t[23];let w=C,T;t[24]===b?T=t[25]:(T=new Set(b.map(ke)),t[24]=b,t[25]=T);let ee=T.size,E;t[26]!==n.mcpServerIds||t[27]!==n.mcpServers?(E=n.mcpServers??(n.mcpServerIds??[]).map(Oe),t[26]=n.mcpServerIds,t[27]=n.mcpServers,t[28]=E):E=t[28];let D=E,O=i&&r.length===0||s&&o.length===0,te,j;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-lg border border-emerald-500/20 bg-emerald-500/10`,children:(0,$.jsx)(k,{className:`h-4 w-4 text-emerald-400`})}),j=(0,$.jsx)(`h2`,{className:`text-sm font-black uppercase tracking-[0.12em] text-white/85`,children:`Loadout operativo`}),t[29]=te,t[30]=j):(te=t[29],j=t[30]);let M=n.role===`coordinator`?`Capacidades mínimas del coordinador y asignaciones adicionales`:`Tools y skills asignadas para ejecutar tareas`,N;t[31]===M?N=t[32]:(N=(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[te,(0,$.jsxs)(`div`,{children:[j,(0,$.jsx)(`p`,{className:`mt-0.5 text-[11px] text-white/35`,children:M})]})]}),t[31]=M,t[32]=N);let P;t[33]===b.length?P=t[34]:(P=(0,$.jsx)(je,{value:b.length,label:`tools`,color:`text-emerald-400`}),t[33]=b.length,t[34]=P);let F;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`div`,{className:`h-7 w-px bg-white/[0.08]`}),t[35]=F):F=t[35];let I;t[36]===w.length?I=t[37]:(I=(0,$.jsx)(je,{value:w.length,label:`skills`,color:`text-amber-400`}),t[36]=w.length,t[37]=I);let L;t[38]===D.length?L=t[39]:(L=D.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`h-7 w-px bg-white/[0.08]`}),(0,$.jsx)(je,{value:D.length,label:`MCP`,color:`text-violet-400`})]}),t[38]=D.length,t[39]=L);let z;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(`div`,{className:`hidden h-7 w-px bg-white/[0.08] sm:block`}),t[40]=z):z=t[40];let B;t[41]===ee?B=t[42]:(B=(0,$.jsx)(`div`,{className:`hidden sm:block`,children:(0,$.jsx)(je,{value:ee,label:`categorías`,color:`text-blue-400`})}),t[41]=ee,t[42]=B);let V;t[43]!==P||t[44]!==I||t[45]!==L||t[46]!==B?(V=(0,$.jsxs)(`div`,{className:`flex items-center gap-4`,children:[P,F,I,L,z,B]}),t[43]=P,t[44]=I,t[45]=L,t[46]=B,t[47]=V):V=t[47];let H;t[48]!==N||t[49]!==V?(H=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 border-b border-white/[0.07] px-5 py-4 sm:flex-row sm:items-center sm:justify-between`,children:[N,V]}),t[48]=N,t[49]=V,t[50]=H):H=t[50];let U;t[51]!==D||t[52]!==O||t[53]!==w||t[54]!==b?(U=O&&b.length===0&&w.length===0&&D.length===0?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-14 text-xs text-white/35`,children:[(0,$.jsx)(R,{className:`h-4 w-4 animate-spin text-emerald-400`}),`Sincronizando loadout…`]}):b.length===0&&w.length===0&&D.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center px-5 py-14 text-center`,children:[(0,$.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-xl border border-dashed border-white/10 bg-white/[0.025]`,children:(0,$.jsx)(me,{className:`h-5 w-5 text-white/20`})}),(0,$.jsx)(`p`,{className:`mt-3 text-sm font-semibold text-white/60`,children:`Este agente no tiene capacidades asignadas`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-white/30`,children:`Su loadout operativo está vacío.`})]}):(0,$.jsxs)($.Fragment,{children:[b.length>0&&(0,$.jsxs)(`div`,{className:`p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(k,{className:`h-3.5 w-3.5 text-emerald-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Tools disponibles`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:b.map(De)})]}),D.length>0&&(0,$.jsxs)(`div`,{className:`border-t border-white/[0.07] p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(S,{className:`h-3.5 w-3.5 text-violet-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Integraciones MCP asignadas`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:D.map(Ee)})]}),w.length>0&&(0,$.jsxs)(`div`,{className:`border-t border-white/[0.07] p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(Z,{className:`h-3.5 w-3.5 text-amber-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Skills en contexto`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:w.map(Te)})]})]}),t[51]=D,t[52]=O,t[53]=w,t[54]=b,t[55]=U):U=t[55];let W;return t[56]!==H||t[57]!==U?(W=(0,$.jsxs)(`section`,{className:`mb-8 overflow-hidden rounded-2xl border border-white/[0.08] bg-[#0b0e14]/75`,children:[H,U]}),t[56]=H,t[57]=U,t[58]=W):W=t[58],W}function Te(e){return(0,$.jsxs)(`article`,{className:`rounded-xl border border-amber-500/10 bg-amber-500/[0.025] p-3.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-amber-500/15 bg-amber-500/[0.07]`,children:(0,$.jsx)(Z,{className:`h-3.5 w-3.5 text-amber-400`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 min-h-8 text-[10px] leading-4 text-white/30`,children:e.description})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-amber-400/65`,children:e.category}),(0,$.jsx)(Ae,{source:e.source})]})]},e.id)}function Ee(e){return(0,$.jsxs)(`article`,{className:`rounded-xl border border-violet-500/15 bg-violet-500/[0.035] p-3.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-violet-500/20 bg-violet-500/[0.08]`,children:(0,$.jsx)(S,{className:`h-3.5 w-3.5 text-violet-300`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`span`,{className:`mt-1 h-2 w-2 shrink-0 rounded-full ${e.enabled?`bg-emerald-400`:`bg-white/20`}`})]}),(0,$.jsxs)(`p`,{className:`mt-1 text-[10px] leading-4 text-white/30`,children:[`Servidor completo · `,e.toolsCount,` tools sincronizadas`]})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-violet-300/70`,children:e.status}),(0,$.jsx)(`span`,{className:`rounded bg-violet-500/10 px-1.5 py-0.5 text-[7px] font-black uppercase tracking-wider text-violet-200/70`,children:`Persistente`})]})]},e.id)}function De(e){return(0,$.jsxs)(`article`,{className:`group rounded-xl border border-white/[0.07] bg-black/20 p-3.5 transition-colors hover:border-emerald-500/20 hover:bg-emerald-500/[0.025]`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-white/[0.07] bg-white/[0.035]`,children:(0,$.jsx)(Me(e.category),{className:`h-3.5 w-3.5 text-emerald-400/80`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`span`,{title:e.available?`Disponible`:`No disponible`,children:(0,$.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 ${e.available?`text-emerald-400`:`text-white/15`}`})})]}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 min-h-8 text-[10px] leading-4 text-white/30`,children:e.description})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-emerald-400/65`,children:xe[e.category]||e.category}),(0,$.jsx)(Ae,{source:e.source})]})]},e.id)}function Oe(e){return{id:e,name:e,status:`unknown`,enabled:!0,toolsCount:0}}function ke(e){return e.category}function Ae(e){let t=(0,he.c)(3),{source:n}=e,r=`rounded px-1.5 py-0.5 text-[7px] font-black uppercase tracking-wider ${n===`base`?`bg-blue-500/10 text-blue-300/70`:`bg-white/5 text-white/25`}`,i=n===`base`?`Minimal · base`:`Asignada`,a;return t[0]!==r||t[1]!==i?(a=(0,$.jsx)(`span`,{className:r,children:i}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function je(e){let t=(0,he.c)(8),{value:n,label:r,color:i}=e,a=`text-base font-black tabular-nums ${i}`,o;t[0]!==a||t[1]!==n?(o=(0,$.jsx)(`p`,{className:a,children:n}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;t[3]===r?s=t[4]:(s=(0,$.jsx)(`p`,{className:`text-[8px] font-bold uppercase tracking-wider text-white/25`,children:r}),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,$.jsxs)(`div`,{className:`text-right`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Me(e){switch(e){case`filesystem`:return Q;case`web`:return f;case`cron`:return de;case`cli`:return T;case`agents`:return B;case`canvas`:return d;case`mcp`:return S;case`office`:return Q;default:return k}}function Ne(){let e=(0,he.c)(25),{id:t}=O(),n=D(),r=t??`unknown`,{agents:i,fetchAgents:o}=F(),s,l;e[0]===o?(s=e[1],l=e[2]):(s=()=>{o()},l=[o],e[0]=o,e[1]=s,e[2]=l),(0,ge.useEffect)(s,l);let u;if(e[3]!==r||e[4]!==i){let t;e[6]===r?t=e[7]:(t=e=>e.id===r,e[6]=r,e[7]=t),u=i.find(t),e[3]=r,e[4]=i,e[5]=u}else u=e[5];let d=u,f;e[8]===n?f=e[9]:(f=()=>n(`/agents`),e[8]=n,e[9]=f);let p,m;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(c,{className:`h-4 w-4 transition-transform group-hover:-translate-x-1`}),m=(0,$.jsx)(`span`,{className:`text-sm font-bold uppercase tracking-widest`,children:`Volver a la Colmena`}),e[10]=p,e[11]=m):(p=e[10],m=e[11]);let h;e[12]===f?h=e[13]:(h=(0,$.jsxs)(I,{variant:`ghost`,onClick:f,className:`group flex items-center gap-2 text-white/40 hover:text-white hover:bg-white/5 px-4 py-2 rounded-xl transition-colors`,children:[p,m]}),e[12]=f,e[13]=h);let g,_;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(pe,{className:`h-4 w-4`}),(0,$.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Agentes`})]}),_=(0,$.jsx)(`div`,{className:`h-4 w-px bg-white/10`}),e[14]=g,e[15]=_):(g=e[14],_=e[15]);let v;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(`div`,{className:`flex items-center gap-4 text-white/20`,children:[g,_,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(a,{className:`h-4 w-4`}),(0,$.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Detalles Operativos`})]})]}),e[16]=v):v=e[16];let y;e[17]===h?y=e[18]:(y=(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[h,v]}),e[17]=h,e[18]=y);let b;e[19]!==d||e[20]!==r?(b=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ye,{agent:d}),(0,$.jsx)(we,{agent:d}),(0,$.jsx)(`div`,{className:`grid grid-cols-1 gap-8`,children:(0,$.jsx)(ve,{agentId:r})})]}):(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[60vh] text-center space-y-6`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(`div`,{className:`h-24 w-24 rounded-full border-4 border-t-blue-500 border-white/5 animate-spin`}),(0,$.jsx)(a,{className:`absolute inset-0 m-auto h-8 w-8 text-blue-400 animate-pulse`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-xl font-bold text-white mb-2`,children:`Sincronizando con el Nodo`}),(0,$.jsx)(`p`,{className:`text-white/40 max-w-xs mx-auto`,children:`Estamos recuperando la configuración cuántica de este agente desde la base de datos central.`})]})]}),e[19]=d,e[20]=r,e[21]=b):b=e[21];let x;return e[22]!==y||e[23]!==b?(x=(0,$.jsx)(`div`,{className:`min-h-screen bg-transparent pb-20`,children:(0,$.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 animate-fade-in`,children:[y,b]})}),e[22]=y,e[23]=b,e[24]=x):x=e[24],x}export{Ne as AgentDetailPage};
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./vendor-react-kUOwxn0g.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./createLucideIcon-BRaPSYgN.js";import{t as a}from"./activity-C_GS5wrG.js";import{t as o}from"./calendar-B6x9cw-q.js";import{t as s}from"./check-C8pw-7Fx.js";import{t as c}from"./chevron-left-GK4EQOyZ.js";import{t as l}from"./circle-alert-CtDbK2nl.js";import{t as u}from"./circle-check-BKNT2_q6.js";import{n as d,t as f}from"./earth-BJRGJbVn.js";import{t as p}from"./useProviders-Dj1k5PCk.js";import{t as m}from"./external-link-6oTH9pUM.js";import{n as h,r as g,t as _}from"./ModelSelector-BX4IvuYY.js";import{a as v,i as y,o as b,r as x,s as S}from"./agentCapabilities-CDSfJWhw.js";import{t as C}from"./shield-CIarwBvx.js";import{t as w}from"./sparkles-DVvY6jDT.js";import{t as T}from"./terminal-BEcTK780.js";import{t as ee}from"./zap-DSoX9NDk.js";import{t as E}from"./utils-DEmd_M8c.js";import{c as D,l as O}from"./vendor-router-DSMCk-Ka.js";import{$ as k,A,D as te,I as j,N as M,O as N,P,S as F,X as I,Y as L,ct as R,dt as z,k as ne,mt as B,nt as V}from"./index-BG3nUPKq.js";import{t as H}from"./badge-B5AKge1b.js";import{a as U,c as W,i as re,n as ie,o as G,r as K,s as ae,t as oe}from"./dialog-BP3GTCPn.js";import{t as q}from"./label-D_fvqJyD.js";import{t as se}from"./textarea-BgZJFZTX.js";import{i as J,n as Y,o as ce,s as X,t as le}from"./select-v_3QBYrD.js";import{t as ue}from"./switch-ndx8VCpm.js";var Z=i(`BookOpenCheck`,[[`path`,{d:`M12 21V7`,key:`gj6g52`}],[`path`,{d:`m16 12 2 2 4-4`,key:`mdajum`}],[`path`,{d:`M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3`,key:`8arnkb`}]]),de=i(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Q=i(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),fe=i(`Fingerprint`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),pe=i(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),me=i(`PackageOpen`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),he=n(),ge=e(t(),1),$=r();function _e(e){let t=(0,he.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(n,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ve({agentId:e}){let{agents:t,updateAgent:n,fetchAgents:r}=F(),{fetchProviders:i}=N(),{fetchModels:o}=te();(0,ge.useEffect)(()=>{r(),i(),o()},[r,i,o]);let c=t.find(t=>t.id===e),[u,d]=(0,ge.useState)({name:``,description:``,provider_id:``,model_id:``,tone:``,role:`coordinator`,enabled:!0,headers:``,systemPrompt:``,workspace:``}),[f,p]=(0,ge.useState)({isValidating:!1,exists:!1,accessible:!1});(0,ge.useEffect)(()=>{c&&(d({name:c.name||``,description:c.description||``,provider_id:c.provider_id||c.providerId||``,model_id:c.model_id||c.modelId||``,tone:c.tone||``,role:c.role||`coordinator`,enabled:!!c.enabled,headers:``,systemPrompt:c.systemPrompt||``,workspace:c.workspace||``}),c.workspace&&v(c.workspace))},[c]);let v=async e=>{if(!e||e.trim()===``){p({isValidating:!1,exists:!1,accessible:!1});return}p({isValidating:!0,exists:!1,accessible:!1});try{let t=await M(`/api/workspace/validate`,{method:`POST`,body:{path:e}});p({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){p({isValidating:!1,exists:!1,accessible:!1,error:e.message})}};return c?(0,$.jsx)(`div`,{className:`space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500`,children:(0,$.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,$.jsxs)(`div`,{className:`lg:col-span-1 space-y-6`,children:[(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-blue-500/10 border border-blue-500/20`,children:(0,$.jsx)(_e,{icon:V,className:`h-4 w-4 text-blue-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Identidad Base`})]}),(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(q,{htmlFor:`name`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Nombre Público`}),(0,$.jsx)(L,{id:`name`,value:u.name,onChange:e=>d(t=>({...t,name:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Nombre del nodo`})]}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(q,{htmlFor:`tone`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Tono Cognitivo`}),(0,$.jsx)(L,{id:`tone`,value:u.tone,onChange:e=>d(t=>({...t,tone:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Ej: Analítico, Conciso...`})]})]})]}),(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-purple-500/10 border border-purple-500/20`,children:(0,$.jsx)(_e,{icon:C,className:`h-4 w-4 text-purple-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Permisos de Red`})]}),(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(q,{className:`text-sm font-semibold`,children:`Rol`}),(0,$.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Coordinador o Worker`})]}),(0,$.jsxs)(le,{value:u.role,onValueChange:e=>d(t=>({...t,role:e})),children:[(0,$.jsx)(ce,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,$.jsx)(X,{})}),(0,$.jsxs)(Y,{className:`bg-zinc-900 border-white/10`,children:[(0,$.jsx)(J,{value:`coordinator`,children:`Coordinador`}),(0,$.jsx)(J,{value:`worker`,children:`Worker`})]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(q,{className:`text-sm font-semibold`,children:`Nodo Activo`}),(0,$.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Disponible para la colmena`})]}),(0,$.jsx)(ue,{checked:u.enabled,onCheckedChange:e=>d(t=>({...t,enabled:e}))})]})]})]}),(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-emerald-500/10 border border-emerald-500/20`,children:(0,$.jsx)(_e,{icon:g,className:`h-4 w-4 text-emerald-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Workspace Directory`})]}),(0,$.jsx)(`div`,{className:`space-y-4`,children:(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(q,{htmlFor:`workspace`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directorio de Trabajo`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(L,{id:`workspace`,value:u.workspace,onChange:e=>{d(t=>({...t,workspace:e.target.value})),v(e.target.value)},className:`bg-white/5 border-white/10 focus:border-emerald-500/50 rounded-xl h-11 font-mono text-sm flex-1`,placeholder:`Ej: /home/user/proyectos, D:\\Work`}),u.workspace&&f.exists&&f.accessible&&(0,$.jsx)(I,{type:`button`,variant:`outline`,size:`icon`,onClick:async()=>{if(u.workspace)try{await M(`/api/workspace/open?path=${encodeURIComponent(u.workspace)}`,{method:`GET`})}catch(e){P.fire({icon:`error`,title:e.message})}},className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10 h-11 w-11`,title:`Abrir en el explorador`,children:(0,$.jsx)(m,{className:`h-4 w-4`})})]}),(0,$.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente operará. Puede ser cualquier ubicación (disco, USB, red).`}),u.workspace&&u.workspace.trim()!==``&&(0,$.jsxs)(`div`,{className:E(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,f.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!f.isValidating&&f.exists&&f.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!f.isValidating&&f.exists&&!f.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!f.isValidating&&!f.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[f.isValidating&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(R,{className:`h-3.5 w-3.5 animate-spin`}),(0,$.jsx)(`span`,{children:`Validando directorio...`})]}),!f.isValidating&&f.exists&&f.accessible&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`Directorio válido y accesible`})]}),!f.isValidating&&f.exists&&!f.accessible&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(l,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`Sin permisos de lectura/escritura`})]}),!f.isValidating&&!f.exists&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`El directorio no existe`}),!f.error&&(0,$.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,onClick:async()=>{if(u.workspace)try{await M(`/api/workspace/create`,{method:`POST`,body:{path:u.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await v(u.workspace)}catch(e){P.fire({icon:`error`,title:e.message})}},className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear`})]})]})]})})]})]}),(0,$.jsx)(`div`,{className:`lg:col-span-2 space-y-6`,children:(0,$.jsxs)(`div`,{className:`p-8 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-8`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-amber-500/10 border border-amber-500/20`,children:(0,$.jsx)(_e,{icon:w,className:`h-4 w-4 text-amber-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Configuración Cognitiva`})]}),(0,$.jsxs)(I,{onClick:async()=>{j.show(`Sincronizando configuración del agente...`);try{await n(e,{...u,role:u.role,enabled:+!!u.enabled,workspace:u.workspace||null}),P.fire({icon:`success`,title:`Cambios sincronizados correctamente`})}catch(e){P.fire({icon:`error`,title:e instanceof Error?e.message:`Error al sincronizar cambios`})}finally{j.hide()}},className:`bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-xl px-6 shadow-[0_4px_15px_rgba(37,99,235,0.3)] transition-all active:scale-95 gap-2`,children:[(0,$.jsx)(_e,{icon:h,className:`h-4 w-4`}),`Sincronizar Cambios`]})]}),(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(q,{htmlFor:`description`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directiva de Misión (Descripción)`}),(0,$.jsx)(se,{id:`description`,value:u.description,onChange:e=>d(t=>({...t,description:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-2xl min-h-[80px] resize-none`,placeholder:`Define el propósito general de este nodo...`})]}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,$.jsx)(q,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`System Prompt (Markdown)`}),(0,$.jsxs)(oe,{children:[(0,$.jsx)(W,{asChild:!0,children:(0,$.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,$.jsxs)(K,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,$.jsxs)(G,{children:[(0,$.jsx)(ae,{className:`text-xl`,children:`Editar System Prompt`}),(0,$.jsx)(re,{className:`text-sm text-white/50`,children:`El comportamiento principal del agente. Se recomienda usar Markdown.`})]}),(0,$.jsx)(`div`,{className:`py-2`,children:(0,$.jsx)(se,{value:u.systemPrompt,onChange:e=>d(t=>({...t,systemPrompt:e.target.value})),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`})}),(0,$.jsx)(U,{children:(0,$.jsx)(ie,{asChild:!0,children:(0,$.jsx)(I,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Listo`})})})]})]})]}),u.systemPrompt?(0,$.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4 max-h-[120px] overflow-y-auto custom-scrollbar`,children:(0,$.jsx)(`p`,{className:`text-xs text-white/60 font-mono whitespace-pre-wrap italic`,children:u.systemPrompt})}):(0,$.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4`,children:(0,$.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})})]}),(0,$.jsx)(_,{selectedProviderId:u.provider_id||void 0,selectedModelId:u.model_id||void 0,onProviderChange:e=>d(t=>({...t,provider_id:e,model_id:``})),onModelChange:e=>d(t=>({...t,model_id:e})),typeFilter:`llm`})]}),(0,$.jsxs)(`div`,{className:`mt-8 p-4 rounded-2xl bg-white/[0.03] border border-white/5 flex items-start gap-4 italic`,children:[(0,$.jsx)(_e,{icon:z,className:`h-5 w-5 text-white/20 mt-0.5`}),(0,$.jsx)(`p`,{className:`text-[11px] text-white/30 leading-relaxed`,children:`Las credenciales de acceso y llaves de cifrado para los headers personalizados se gestionan en una capa segura y no son visibles en texto plano para mantener la integridad de la red.`})]})]})})]})}):(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 text-center space-y-4 rounded-3xl border border-dashed border-white/10 bg-white/5`,children:[(0,$.jsx)(_e,{icon:a,className:`h-12 w-12 text-white/10 animate-pulse`}),(0,$.jsx)(`p`,{className:`text-white/40 font-medium`,children:`Buscando nodo en la colmena...`})]})}function ye(e){let t=(0,he.c)(87),{agent:n}=e,{providers:r}=N(),{models:i}=te(),s=n.role===`coordinator`,c=n.provider_id||n.providerId,l=n.model_id||n.modelId,u=n.created_at||n.createdAt,d;t[0]===u?d=t[1]:(d=u?v(typeof u==`string`?new Date(u):new Date(u*1e3),`PPP`,{locale:y}):`Fecha desconocida`,t[0]=u,t[1]=d);let f=d,m;t[2]!==c||t[3]!==r?(m=r.find(e=>e.id===c)?.name||c,t[2]=c,t[3]=r,t[4]=m):m=t[4];let h=m,g;t[5]!==l||t[6]!==i?(g=i.find(e=>e.id===l)?.name||l,t[5]=l,t[6]=i,t[7]=g):g=t[7];let _=g,x=`hive-card--internal group ${n.enabled?`hive-card--internal-active`:`hive-card--internal-disabled`}`,S;t[8]===n.enabled?S=t[9]:(S=n.enabled&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`absolute -top-24 -right-24 h-64 w-64 bg-blue-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-blue-600/20 transition-all duration-700`}),(0,$.jsx)(`div`,{className:`absolute -bottom-24 -left-24 h-64 w-64 bg-purple-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-purple-600/20 transition-all duration-700`})]}),t[8]=n.enabled,t[9]=S);let C=`hive-icon-wrap--internal ${n.enabled?`hive-icon-wrap--internal-active`:`hive-icon-wrap--internal-disabled`}`,w=`h-6 w-6 ${n.enabled?`text-blue-400`:`text-white/20`}`,T;t[10]===w?T=t[11]:(T=(0,$.jsx)(fe,{className:w}),t[10]=w,t[11]=T);let E;t[12]!==C||t[13]!==T?(E=(0,$.jsx)(`div`,{className:C,children:T}),t[12]=C,t[13]=T,t[14]=E):E=t[14];let D=`hive-page-header__label ${!n.enabled&&`text-white/20`}`,O;t[15]===D?O=t[16]:(O=(0,$.jsx)(`span`,{className:D,children:`Identidad de Nodo`}),t[15]=D,t[16]=O);let k;t[17]!==n.enabled||t[18]!==s?(k=s&&(0,$.jsx)(H,{className:`hive-tag--coordinator ${!n.enabled&&`bg-white/5 text-white/20 border-white/10`}`,children:`Coordinador`}),t[17]=n.enabled,t[18]=s,t[19]=k):k=t[19];let A;t[20]!==O||t[21]!==k?(A=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[O,k]}),t[20]=O,t[21]=k,t[22]=A):A=t[22];let j=`text-4xl font-black tracking-tighter ${n.enabled?`text-white`:`text-white/40`}`,M;t[23]!==n.name||t[24]!==j?(M=(0,$.jsx)(`h1`,{className:j,children:n.name}),t[23]=n.name,t[24]=j,t[25]=M):M=t[25];let P;t[26]!==A||t[27]!==M?(P=(0,$.jsxs)(`div`,{children:[A,M]}),t[26]=A,t[27]=M,t[28]=P):P=t[28];let F;t[29]!==P||t[30]!==E?(F=(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[E,P]}),t[29]=P,t[30]=E,t[31]=F):F=t[31];let I=`text-lg leading-relaxed max-w-2xl font-light italic ${n.enabled?`text-white/60`:`text-white/20`}`,L=n.description||`Este agente no tiene una descripción definida aún.`,R;t[32]!==I||t[33]!==L?(R=(0,$.jsxs)(`p`,{className:I,children:[`"`,L,`"`]}),t[32]=I,t[33]=L,t[34]=R):R=t[34];let z;t[35]!==F||t[36]!==R?(z=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[F,R]}),t[35]=F,t[36]=R,t[37]=z):z=t[37];let ne=n.enabled?`text-blue-400`:`text-white/20`,B;t[38]!==n.enabled||t[39]!==_||t[40]!==h||t[41]!==ne?(B=(0,$.jsx)(be,{icon:p,label:`Infraestructura`,value:h,subValue:_,color:ne,enabled:n.enabled}),t[38]=n.enabled,t[39]=_,t[40]=h,t[41]=ne,t[42]=B):B=t[42];let V=n.tone||`Neutral`,U=n.enabled?`text-purple-400`:`text-white/20`,W;t[43]!==n.enabled||t[44]!==V||t[45]!==U?(W=(0,$.jsx)(be,{icon:ee,label:`Personalidad`,value:V,color:U,enabled:n.enabled}),t[43]=n.enabled,t[44]=V,t[45]=U,t[46]=W):W=t[46];let re=n.enabled?`text-emerald-400`:`text-white/20`,ie;t[47]!==n.enabled||t[48]!==f||t[49]!==re?(ie=(0,$.jsx)(be,{icon:o,label:`Desplegado el`,value:f,color:re,enabled:n.enabled}),t[47]=n.enabled,t[48]=f,t[49]=re,t[50]=ie):ie=t[50];let G;t[51]!==B||t[52]!==W||t[53]!==ie?(G=(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4`,children:[B,W,ie]}),t[51]=B,t[52]=W,t[53]=ie,t[54]=G):G=t[54];let K;t[55]!==z||t[56]!==G?(K=(0,$.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[z,G]}),t[55]=z,t[56]=G,t[57]=K):K=t[57];let ae;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(`span`,{className:`hive-label block`,children:`Estado Operativo`}),t[58]=ae):ae=t[58];let oe=n.enabled?n.status:`hibernated`,q;t[59]===oe?q=t[60]:(q=(0,$.jsxs)(`div`,{className:`text-center md:text-right space-y-2`,children:[ae,(0,$.jsx)(b,{status:oe,className:`px-6 py-2 text-sm border-2`})]}),t[59]=oe,t[60]=q);let se;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(`p`,{className:`hive-label mb-1`,children:`Carga de Red`}),t[61]=se):se=t[61];let J;t[62]===n.enabled?J=t[63]:(J=n.enabled&&(0,$.jsx)(`div`,{className:`hive-network-fill`}),t[62]=n.enabled,t[63]=J);let Y;t[64]===J?Y=t[65]:(Y=(0,$.jsxs)(`div`,{className:`flex-1`,children:[se,(0,$.jsx)(`div`,{className:`hive-network-track`,children:J})]}),t[64]=J,t[65]=Y);let ce=`h-5 w-5 ${n.enabled?`text-blue-400 animate-pulse`:`text-white/10`}`,X;t[66]===ce?X=t[67]:(X=(0,$.jsx)(a,{className:ce}),t[66]=ce,t[67]=X);let le;t[68]!==Y||t[69]!==X?(le=(0,$.jsxs)(`div`,{className:`hive-network-panel md:w-auto`,children:[Y,X]}),t[68]=Y,t[69]=X,t[70]=le):le=t[70];let ue;t[71]!==q||t[72]!==le?(ue=(0,$.jsxs)(`div`,{className:`flex flex-col items-center md:items-end gap-6 min-w-[200px]`,children:[q,le]}),t[71]=q,t[72]=le,t[73]=ue):ue=t[73];let Z;t[74]!==K||t[75]!==ue?(Z=(0,$.jsxs)(`div`,{className:`relative flex flex-col md:flex-row gap-8 items-start justify-between`,children:[K,ue]}),t[74]=K,t[75]=ue,t[76]=Z):Z=t[76];let de=`hive-strip--bottom ${!n.enabled&&`opacity-20`}`,Q;t[77]===de?Q=t[78]:(Q=(0,$.jsx)(`div`,{className:de}),t[77]=de,t[78]=Q);let pe;t[79]===n.id?pe=t[80]:(pe=(0,$.jsxs)(`div`,{className:`absolute top-4 right-8 hive-mono hidden md:block`,children:[`NODE_UID: `,n.id]}),t[79]=n.id,t[80]=pe);let me;return t[81]!==x||t[82]!==Z||t[83]!==Q||t[84]!==pe||t[85]!==S?(me=(0,$.jsxs)(`div`,{className:x,children:[S,Z,Q,pe]}),t[81]=x,t[82]=Z,t[83]=Q,t[84]=pe,t[85]=S,t[86]=me):me=t[86],me}function be(e){let t=(0,he.c)(21),{icon:n,label:r,value:i,subValue:a,color:o,enabled:s}=e,c=`hive-info-card ${s?`hive-info-card--active`:`hive-info-card--disabled`}`,l=`h-3.5 w-3.5 ${o}`,u;t[0]!==n||t[1]!==l?(u=(0,$.jsx)(n,{className:l}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d;t[3]===r?d=t[4]:(d=(0,$.jsx)(`span`,{className:`hive-info-card__label`,children:r}),t[3]=r,t[4]=d);let f;t[5]!==u||t[6]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[u,d]}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p=`hive-info-card__value ${s?`text-white/80 group-hover/item:text-white`:`text-white/20`}`,m;t[8]!==p||t[9]!==i?(m=(0,$.jsx)(`p`,{className:p,children:i}),t[8]=p,t[9]=i,t[10]=m):m=t[10];let h;t[11]!==s||t[12]!==a?(h=a&&(0,$.jsx)(`p`,{className:`hive-info-card__sub ${s?`text-white/40`:`text-white/10`}`,children:a}),t[11]=s,t[12]=a,t[13]=h):h=t[13];let g;t[14]!==m||t[15]!==h?(g=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[m,h]}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;return t[17]!==c||t[18]!==f||t[19]!==g?(_=(0,$.jsxs)(`div`,{className:c,children:[f,g]}),t[17]=c,t[18]=f,t[19]=g,t[20]=_):_=t[20],_}var xe={filesystem:`Archivos`,web:`Web`,cron:`Automatización`,cli:`Terminal`,agents:`Agentes`,canvas:`Canvas`,office:`Office`,mcp:`MCP`,core:`Sistema`};function Se(e){return e.startsWith(`fs_`)?`filesystem`:e.startsWith(`browser_`)||e.startsWith(`web_`)||e===`search_knowledge`?`web`:e.startsWith(`cron`)?`cron`:e.startsWith(`office_`)?`office`:e.startsWith(`mcp`)||e.includes(`_mcp`)?`mcp`:e.startsWith(`canvas_`)||e.startsWith(`a2ui_`)?`canvas`:e.startsWith(`cli_`)?`cli`:e.includes(`agent`)||e.includes(`task_`)||e.includes(`acceptance`)?`agents`:`core`}function Ce(e){return e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function we(e){let t=(0,he.c)(59),{agent:n}=e,{tools:r,isLoading:i,fetchTools:a}=A(),{skills:o,isLoading:s,fetchSkills:c}=ne(),l,u;t[0]!==c||t[1]!==a||t[2]!==o.length||t[3]!==r.length?(l=()=>{r.length===0&&a(),o.length===0&&c()},u=[c,a,o.length,r.length],t[0]=c,t[1]=a,t[2]=o.length,t[3]=r.length,t[4]=l,t[5]=u):(l=t[4],u=t[5]),(0,ge.useEffect)(l,u);let d;t[6]===n.toolsJson?d=t[7]:(d=x(n.toolsJson),t[6]=n.toolsJson,t[7]=d);let f=d,p;t[8]===n.skillsJson?p=t[9]:(p=x(n.skillsJson),t[8]=n.skillsJson,t[9]=p);let m=p,h;t[10]!==n.minimalTools||t[11]!==n.role?(h=n.role===`coordinator`?n.minimalTools??[]:[],t[10]=n.minimalTools,t[11]=n.role,t[12]=h):h=t[12];let g=h,_;t[13]!==n.minimalSkills||t[14]!==n.role?(_=n.role===`coordinator`?n.minimalSkills??[]:[],t[13]=n.minimalSkills,t[14]=n.role,t[15]=_):_=t[15];let v=_,y;if(t[16]!==g||t[17]!==f||t[18]!==r){let e=new Map;g.forEach(t=>e.set(t,{id:t,source:`base`})),f.forEach(t=>{let n=e.get(t.id);e.set(t.id,{...t,source:n?.source??`assigned`})}),y=Array.from(e.values()).map(e=>{let t=r.find(t=>t.id===e.id);return{id:e.id,name:t?.name||e.suppliedName||Ce(e.id),description:t?.description||`Capacidad disponible en el loadout operativo de este agente.`,category:t?.category||Se(e.id),available:t?t.enabled&&t.active!==!1:!0,source:e.source}}),t[16]=g,t[17]=f,t[18]=r,t[19]=y}else y=t[19];let b=y,C;if(t[20]!==v||t[21]!==m||t[22]!==o){let e=new Map;v.forEach(t=>e.set(t.id,{id:t.id,suppliedName:t.name,source:`base`})),m.forEach(t=>{let n=e.get(t.id);e.set(t.id,{...t,source:n?.source??`assigned`})}),C=Array.from(e.values()).map(e=>{let t=o.find(t=>t.id===e.id),n=v.find(t=>t.id===e.id);return{id:e.id,name:t?.name||n?.name||e.suppliedName||Ce(e.id),description:t?.description||n?.description||`Conocimiento operativo incluido en el contexto de este agente.`,category:t?.category||n?.category||`core`,source:e.source}}),t[20]=v,t[21]=m,t[22]=o,t[23]=C}else C=t[23];let w=C,T;t[24]===b?T=t[25]:(T=new Set(b.map(ke)),t[24]=b,t[25]=T);let ee=T.size,E;t[26]!==n.mcpServerIds||t[27]!==n.mcpServers?(E=n.mcpServers??(n.mcpServerIds??[]).map(Oe),t[26]=n.mcpServerIds,t[27]=n.mcpServers,t[28]=E):E=t[28];let D=E,O=i&&r.length===0||s&&o.length===0,te,j;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-lg border border-emerald-500/20 bg-emerald-500/10`,children:(0,$.jsx)(k,{className:`h-4 w-4 text-emerald-400`})}),j=(0,$.jsx)(`h2`,{className:`text-sm font-black uppercase tracking-[0.12em] text-white/85`,children:`Loadout operativo`}),t[29]=te,t[30]=j):(te=t[29],j=t[30]);let M=n.role===`coordinator`?`Capacidades mínimas del coordinador y asignaciones adicionales`:`Tools y skills asignadas para ejecutar tareas`,N;t[31]===M?N=t[32]:(N=(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[te,(0,$.jsxs)(`div`,{children:[j,(0,$.jsx)(`p`,{className:`mt-0.5 text-[11px] text-white/35`,children:M})]})]}),t[31]=M,t[32]=N);let P;t[33]===b.length?P=t[34]:(P=(0,$.jsx)(je,{value:b.length,label:`tools`,color:`text-emerald-400`}),t[33]=b.length,t[34]=P);let F;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`div`,{className:`h-7 w-px bg-white/[0.08]`}),t[35]=F):F=t[35];let I;t[36]===w.length?I=t[37]:(I=(0,$.jsx)(je,{value:w.length,label:`skills`,color:`text-amber-400`}),t[36]=w.length,t[37]=I);let L;t[38]===D.length?L=t[39]:(L=D.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`h-7 w-px bg-white/[0.08]`}),(0,$.jsx)(je,{value:D.length,label:`MCP`,color:`text-violet-400`})]}),t[38]=D.length,t[39]=L);let z;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(`div`,{className:`hidden h-7 w-px bg-white/[0.08] sm:block`}),t[40]=z):z=t[40];let B;t[41]===ee?B=t[42]:(B=(0,$.jsx)(`div`,{className:`hidden sm:block`,children:(0,$.jsx)(je,{value:ee,label:`categorías`,color:`text-blue-400`})}),t[41]=ee,t[42]=B);let V;t[43]!==P||t[44]!==I||t[45]!==L||t[46]!==B?(V=(0,$.jsxs)(`div`,{className:`flex items-center gap-4`,children:[P,F,I,L,z,B]}),t[43]=P,t[44]=I,t[45]=L,t[46]=B,t[47]=V):V=t[47];let H;t[48]!==N||t[49]!==V?(H=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 border-b border-white/[0.07] px-5 py-4 sm:flex-row sm:items-center sm:justify-between`,children:[N,V]}),t[48]=N,t[49]=V,t[50]=H):H=t[50];let U;t[51]!==D||t[52]!==O||t[53]!==w||t[54]!==b?(U=O&&b.length===0&&w.length===0&&D.length===0?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-14 text-xs text-white/35`,children:[(0,$.jsx)(R,{className:`h-4 w-4 animate-spin text-emerald-400`}),`Sincronizando loadout…`]}):b.length===0&&w.length===0&&D.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center px-5 py-14 text-center`,children:[(0,$.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-xl border border-dashed border-white/10 bg-white/[0.025]`,children:(0,$.jsx)(me,{className:`h-5 w-5 text-white/20`})}),(0,$.jsx)(`p`,{className:`mt-3 text-sm font-semibold text-white/60`,children:`Este agente no tiene capacidades asignadas`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-white/30`,children:`Su loadout operativo está vacío.`})]}):(0,$.jsxs)($.Fragment,{children:[b.length>0&&(0,$.jsxs)(`div`,{className:`p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(k,{className:`h-3.5 w-3.5 text-emerald-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Tools disponibles`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:b.map(De)})]}),D.length>0&&(0,$.jsxs)(`div`,{className:`border-t border-white/[0.07] p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(S,{className:`h-3.5 w-3.5 text-violet-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Integraciones MCP asignadas`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:D.map(Ee)})]}),w.length>0&&(0,$.jsxs)(`div`,{className:`border-t border-white/[0.07] p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(Z,{className:`h-3.5 w-3.5 text-amber-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Skills en contexto`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:w.map(Te)})]})]}),t[51]=D,t[52]=O,t[53]=w,t[54]=b,t[55]=U):U=t[55];let W;return t[56]!==H||t[57]!==U?(W=(0,$.jsxs)(`section`,{className:`mb-8 overflow-hidden rounded-2xl border border-white/[0.08] bg-[#0b0e14]/75`,children:[H,U]}),t[56]=H,t[57]=U,t[58]=W):W=t[58],W}function Te(e){return(0,$.jsxs)(`article`,{className:`rounded-xl border border-amber-500/10 bg-amber-500/[0.025] p-3.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-amber-500/15 bg-amber-500/[0.07]`,children:(0,$.jsx)(Z,{className:`h-3.5 w-3.5 text-amber-400`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 min-h-8 text-[10px] leading-4 text-white/30`,children:e.description})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-amber-400/65`,children:e.category}),(0,$.jsx)(Ae,{source:e.source})]})]},e.id)}function Ee(e){return(0,$.jsxs)(`article`,{className:`rounded-xl border border-violet-500/15 bg-violet-500/[0.035] p-3.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-violet-500/20 bg-violet-500/[0.08]`,children:(0,$.jsx)(S,{className:`h-3.5 w-3.5 text-violet-300`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`span`,{className:`mt-1 h-2 w-2 shrink-0 rounded-full ${e.enabled?`bg-emerald-400`:`bg-white/20`}`})]}),(0,$.jsxs)(`p`,{className:`mt-1 text-[10px] leading-4 text-white/30`,children:[`Servidor completo · `,e.toolsCount,` tools sincronizadas`]})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-violet-300/70`,children:e.status}),(0,$.jsx)(`span`,{className:`rounded bg-violet-500/10 px-1.5 py-0.5 text-[7px] font-black uppercase tracking-wider text-violet-200/70`,children:`Persistente`})]})]},e.id)}function De(e){return(0,$.jsxs)(`article`,{className:`group rounded-xl border border-white/[0.07] bg-black/20 p-3.5 transition-colors hover:border-emerald-500/20 hover:bg-emerald-500/[0.025]`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-white/[0.07] bg-white/[0.035]`,children:(0,$.jsx)(Me(e.category),{className:`h-3.5 w-3.5 text-emerald-400/80`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`span`,{title:e.available?`Disponible`:`No disponible`,children:(0,$.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 ${e.available?`text-emerald-400`:`text-white/15`}`})})]}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 min-h-8 text-[10px] leading-4 text-white/30`,children:e.description})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-emerald-400/65`,children:xe[e.category]||e.category}),(0,$.jsx)(Ae,{source:e.source})]})]},e.id)}function Oe(e){return{id:e,name:e,status:`unknown`,enabled:!0,toolsCount:0}}function ke(e){return e.category}function Ae(e){let t=(0,he.c)(3),{source:n}=e,r=`rounded px-1.5 py-0.5 text-[7px] font-black uppercase tracking-wider ${n===`base`?`bg-blue-500/10 text-blue-300/70`:`bg-white/5 text-white/25`}`,i=n===`base`?`Minimal · base`:`Asignada`,a;return t[0]!==r||t[1]!==i?(a=(0,$.jsx)(`span`,{className:r,children:i}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function je(e){let t=(0,he.c)(8),{value:n,label:r,color:i}=e,a=`text-base font-black tabular-nums ${i}`,o;t[0]!==a||t[1]!==n?(o=(0,$.jsx)(`p`,{className:a,children:n}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;t[3]===r?s=t[4]:(s=(0,$.jsx)(`p`,{className:`text-[8px] font-bold uppercase tracking-wider text-white/25`,children:r}),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,$.jsxs)(`div`,{className:`text-right`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Me(e){switch(e){case`filesystem`:return Q;case`web`:return f;case`cron`:return de;case`cli`:return T;case`agents`:return B;case`canvas`:return d;case`mcp`:return S;case`office`:return Q;default:return k}}function Ne(){let e=(0,he.c)(25),{id:t}=O(),n=D(),r=t??`unknown`,{agents:i,fetchAgents:o}=F(),s,l;e[0]===o?(s=e[1],l=e[2]):(s=()=>{o()},l=[o],e[0]=o,e[1]=s,e[2]=l),(0,ge.useEffect)(s,l);let u;if(e[3]!==r||e[4]!==i){let t;e[6]===r?t=e[7]:(t=e=>e.id===r,e[6]=r,e[7]=t),u=i.find(t),e[3]=r,e[4]=i,e[5]=u}else u=e[5];let d=u,f;e[8]===n?f=e[9]:(f=()=>n(`/agents`),e[8]=n,e[9]=f);let p,m;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(c,{className:`h-4 w-4 transition-transform group-hover:-translate-x-1`}),m=(0,$.jsx)(`span`,{className:`text-sm font-bold uppercase tracking-widest`,children:`Volver a la Colmena`}),e[10]=p,e[11]=m):(p=e[10],m=e[11]);let h;e[12]===f?h=e[13]:(h=(0,$.jsxs)(I,{variant:`ghost`,onClick:f,className:`group flex items-center gap-2 text-white/40 hover:text-white hover:bg-white/5 px-4 py-2 rounded-xl transition-colors`,children:[p,m]}),e[12]=f,e[13]=h);let g,_;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(pe,{className:`h-4 w-4`}),(0,$.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Agentes`})]}),_=(0,$.jsx)(`div`,{className:`h-4 w-px bg-white/10`}),e[14]=g,e[15]=_):(g=e[14],_=e[15]);let v;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(`div`,{className:`flex items-center gap-4 text-white/20`,children:[g,_,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(a,{className:`h-4 w-4`}),(0,$.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Detalles Operativos`})]})]}),e[16]=v):v=e[16];let y;e[17]===h?y=e[18]:(y=(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[h,v]}),e[17]=h,e[18]=y);let b;e[19]!==d||e[20]!==r?(b=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ye,{agent:d}),(0,$.jsx)(we,{agent:d}),(0,$.jsx)(`div`,{className:`grid grid-cols-1 gap-8`,children:(0,$.jsx)(ve,{agentId:r})})]}):(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[60vh] text-center space-y-6`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(`div`,{className:`h-24 w-24 rounded-full border-4 border-t-blue-500 border-white/5 animate-spin`}),(0,$.jsx)(a,{className:`absolute inset-0 m-auto h-8 w-8 text-blue-400 animate-pulse`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-xl font-bold text-white mb-2`,children:`Sincronizando con el Nodo`}),(0,$.jsx)(`p`,{className:`text-white/40 max-w-xs mx-auto`,children:`Estamos recuperando la configuración cuántica de este agente desde la base de datos central.`})]})]}),e[19]=d,e[20]=r,e[21]=b):b=e[21];let x;return e[22]!==y||e[23]!==b?(x=(0,$.jsx)(`div`,{className:`min-h-screen bg-transparent pb-20`,children:(0,$.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 animate-fade-in`,children:[y,b]})}),e[22]=y,e[23]=b,e[24]=x):x=e[24],x}export{Ne as AgentDetailPage};
@@ -1 +1 @@
1
- import{t as e}from"./vendor-react-kUOwxn0g.js";import{o as t}from"./vendor-query-Dj8xYhQD.js";import{t as n}from"./AgentCreateForm-KvhVhAFP.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AgentNewPage};
1
+ import{t as e}from"./vendor-react-kUOwxn0g.js";import{o as t}from"./vendor-query-Dj8xYhQD.js";import{t as n}from"./AgentCreateForm-DqYhH_gm.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AgentNewPage};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{_ as n,c as r,d as i,f as a,g as o,h as s,l as c,m as l,p as u,u as d,v as f,y as p}from"./vendor-radix-DUug7irY.js";import{t as m}from"./vendor-react-kUOwxn0g.js";import{o as h}from"./vendor-query-Dj8xYhQD.js";import{t as g}from"./createLucideIcon-BRaPSYgN.js";import{t as ee}from"./activity-C_GS5wrG.js";import{t as _}from"./arrow-up-right-DWzTsCXj.js";import{t as v}from"./calendar-B6x9cw-q.js";import{t as y}from"./check-C8pw-7Fx.js";import{t as b}from"./chevron-right-BupZqrxu.js";import{t as x}from"./useProviders-DXr4pJ57.js";import{t as S}from"./ellipsis-vertical-D7uFJLGh.js";import{t as C}from"./file-text-D5ZJEx3E.js";import{r as w}from"./ModelSelector-DciHLo7R.js";import{t as T}from"./gauge-CEu7PhTW.js";import{t as te}from"./lock-3IApZyVy.js";import{a as E,i as D,n as O,o as k,s as A,t as ne}from"./agentCapabilities-CDSfJWhw.js";import{t as j}from"./pencil-CKritjT_.js";import{t as M}from"./plus-RD44ce15.js";import{t as N}from"./refresh-cw-DtJMHRHO.js";import{t as re}from"./shield-CIarwBvx.js";import{t as P}from"./sparkles-DVvY6jDT.js";import{t as ie}from"./trash-2-D6oziYAK.js";import{t as ae}from"./zap-DSoX9NDk.js";import{t as F}from"./utils-DEmd_M8c.js";import{c as oe}from"./vendor-router-DSMCk-Ka.js";import{$ as se,D as ce,F as le,O as ue,Q as de,S as fe,X as I,mt as pe}from"./index-mBw9Tl7u.js";import{t as L}from"./AgentCreateForm-KvhVhAFP.js";var R=g(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),z=g(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),me=g(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),B=g(`Pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),V=m(),H=e(t(),1),U=h(),W=s,he=p,G=H.forwardRef((e,t)=>{let n=(0,V.c)(14),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,inset:a,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a&&`pl-8`,c;n[5]!==i||n[6]!==s?(c=F(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent`,s,i),n[5]=i,n[6]=s,n[7]=c):c=n[7];let l;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,U.jsx)(b,{className:`ml-auto h-4 w-4`}),n[8]=l):l=n[8];let u;return n[9]!==r||n[10]!==o||n[11]!==t||n[12]!==c?(u=(0,U.jsxs)(f,{ref:t,className:c,...o,children:[r,l]}),n[9]=r,n[10]=o,n[11]=t,n[12]=c,n[13]=u):u=n[13],u});G.displayName=f.displayName;var K=H.forwardRef((e,t)=>{let r=(0,V.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=F(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,i),r[3]=i,r[4]=o);let s;return r[5]!==a||r[6]!==t||r[7]!==o?(s=(0,U.jsx)(n,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=s):s=r[8],s});K.displayName=n.displayName;var ge=H.forwardRef((e,t)=>{let n=(0,V.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,sideOffset:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?4:a,s;n[4]===r?s=n[5]:(s=F(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r),n[4]=r,n[5]=s);let l;return n[6]!==i||n[7]!==t||n[8]!==o||n[9]!==s?(l=(0,U.jsx)(u,{children:(0,U.jsx)(c,{ref:t,sideOffset:o,className:s,...i})}),n[6]=i,n[7]=t,n[8]=o,n[9]=s,n[10]=l):l=n[10],l});ge.displayName=c.displayName;var _e=H.forwardRef((e,t)=>{let n=(0,V.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,inset:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=i&&`pl-8`,s;n[4]!==r||n[5]!==o?(s=F(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,o,r),n[4]=r,n[5]=o,n[6]=s):s=n[6];let c;return n[7]!==a||n[8]!==t||n[9]!==s?(c=(0,U.jsx)(d,{ref:t,className:s,...a}),n[7]=a,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});_e.displayName=d.displayName;var ve=H.forwardRef((e,t)=>{let n=(0,V.c)(14),a,o,s,c;n[0]===e?(a=n[1],o=n[2],s=n[3],c=n[4]):({className:s,children:o,checked:a,...c}=e,n[0]=e,n[1]=a,n[2]=o,n[3]=s,n[4]=c);let l;n[5]===s?l=n[6]:(l=F(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,s),n[5]=s,n[6]=l);let u;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,U.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,U.jsx)(i,{children:(0,U.jsx)(y,{className:`h-4 w-4`})})}),n[7]=u):u=n[7];let d;return n[8]!==a||n[9]!==o||n[10]!==c||n[11]!==t||n[12]!==l?(d=(0,U.jsxs)(r,{ref:t,className:l,checked:a,...c,children:[u,o]}),n[8]=a,n[9]=o,n[10]=c,n[11]=t,n[12]=l,n[13]=d):d=n[13],d});ve.displayName=r.displayName;var q=H.forwardRef((e,t)=>{let n=(0,V.c)(12),r,a,o;n[0]===e?(r=n[1],a=n[2],o=n[3]):({className:a,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=o);let s;n[4]===a?s=n[5]:(s=F(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,a),n[4]=a,n[5]=s);let c;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,U.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,U.jsx)(i,{children:(0,U.jsx)(z,{className:`h-2 w-2 fill-current`})})}),n[6]=c):c=n[6];let u;return n[7]!==r||n[8]!==o||n[9]!==t||n[10]!==s?(u=(0,U.jsxs)(l,{ref:t,className:s,...o,children:[c,r]}),n[7]=r,n[8]=o,n[9]=t,n[10]=s,n[11]=u):u=n[11],u});q.displayName=l.displayName;var ye=H.forwardRef((e,t)=>{let n=(0,V.c)(11),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:r,inset:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s=i&&`pl-8`,c;n[4]!==r||n[5]!==s?(c=F(`px-2 py-1.5 text-sm font-semibold`,s,r),n[4]=r,n[5]=s,n[6]=c):c=n[6];let l;return n[7]!==o||n[8]!==t||n[9]!==c?(l=(0,U.jsx)(a,{ref:t,className:c,...o}),n[7]=o,n[8]=t,n[9]=c,n[10]=l):l=n[10],l});ye.displayName=a.displayName;var be=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`-mx-1 my-1 h-px bg-muted`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,U.jsx)(o,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});be.displayName=o.displayName;var xe=e=>{let t=(0,V.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`ml-auto text-xs tracking-widest opacity-60`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,U.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};xe.displayName=`DropdownMenuShortcut`;function Se(e){if(!e)return null;try{return E(new Date(e),`dd MMM yyyy`,{locale:D})}catch{return null}}function J(e){let t=(0,V.c)(165),{agent:n,onEdit:r}=e,i=oe(),{deleteAgent:a}=fe(),{providers:o}=ue(),{models:s}=ce(),c;t[0]!==n.id||t[1]!==i?(c=e=>{e.target.closest(`[role="menuitem"]`)||e.target.closest(`button`)||i(`/agents/${n.id}`)},t[0]=n.id,t[1]=i,t[2]=c):c=t[2];let l=c,u;t[3]!==n.id||t[4]!==n.name||t[5]!==a?(u=async e=>{if(e.stopPropagation(),(await le.fire({title:`¿Eliminar Agente?`,text:`¿Estás seguro de que deseas eliminar al agente "${n.name}"? Esta acción eliminará permanentemente su configuración.`,icon:`warning`,showCancelButton:!0,confirmButtonText:`Sí, eliminar`,cancelButtonText:`Cancelar`,reverseButtons:!0,background:`#09090b`,color:`#fff`,customClass:{popup:`border border-white/10 rounded-xl`,confirmButton:`bg-red-500 hover:bg-red-600 text-white`,cancelButton:`bg-white/10 hover:bg-white/20 text-white`}})).isConfirmed)try{await a(n.id)}catch(e){console.error(e)}},t[3]=n.id,t[4]=n.name,t[5]=a,t[6]=u):u=t[6];let d=u,f=n.role===`coordinator`,p=n.provider_id||n.providerId,m=n.model_id||n.modelId,h;t[7]!==p||t[8]!==o?(h=o.find(e=>e.id===p)?.name||p,t[7]=p,t[8]=o,t[9]=h):h=t[9];let g=h,_;t[10]!==m||t[11]!==s?(_=s.find(e=>e.id===m)?.name||m,t[10]=m,t[11]=s,t[12]=_):_=t[12];let y=_,b=n.enabled?n.status:`hibernated`,E;t[13]===n?E=t[14]:(E=O(n),t[13]=n,t[14]=E);let D=E.length,A;t[15]===n?A=t[16]:(A=ne(n),t[15]=n,t[16]=A);let j=A.length,M=!!n.systemPrompt,N=n.maxIterations||10,P=n.created_at||n.createdAt,F;t[17]===P?F=t[18]:(F=Se(P),t[17]=P,t[18]=F);let de=F,pe=`group relative overflow-hidden rounded-2xl border bg-black/40 backdrop-blur-xl transition-all duration-500 cursor-pointer flex flex-col h-full
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{_ as n,c as r,d as i,f as a,g as o,h as s,l as c,m as l,p as u,u as d,v as f,y as p}from"./vendor-radix-DUug7irY.js";import{t as m}from"./vendor-react-kUOwxn0g.js";import{o as h}from"./vendor-query-Dj8xYhQD.js";import{t as g}from"./createLucideIcon-BRaPSYgN.js";import{t as ee}from"./activity-C_GS5wrG.js";import{t as _}from"./arrow-up-right-DWzTsCXj.js";import{t as v}from"./calendar-B6x9cw-q.js";import{t as y}from"./check-C8pw-7Fx.js";import{t as b}from"./chevron-right-BupZqrxu.js";import{t as x}from"./useProviders-Dj1k5PCk.js";import{t as S}from"./ellipsis-vertical-D7uFJLGh.js";import{t as C}from"./file-text-D5ZJEx3E.js";import{r as w}from"./ModelSelector-BX4IvuYY.js";import{t as T}from"./gauge-CEu7PhTW.js";import{t as te}from"./lock-3IApZyVy.js";import{a as E,i as D,n as O,o as k,s as A,t as ne}from"./agentCapabilities-CDSfJWhw.js";import{t as j}from"./pencil-CKritjT_.js";import{t as M}from"./plus-RD44ce15.js";import{t as N}from"./refresh-cw-DtJMHRHO.js";import{t as re}from"./shield-CIarwBvx.js";import{t as P}from"./sparkles-DVvY6jDT.js";import{t as ie}from"./trash-2-D6oziYAK.js";import{t as ae}from"./zap-DSoX9NDk.js";import{t as F}from"./utils-DEmd_M8c.js";import{c as oe}from"./vendor-router-DSMCk-Ka.js";import{$ as se,D as ce,F as le,O as ue,Q as de,S as fe,X as I,mt as pe}from"./index-BG3nUPKq.js";import{t as L}from"./AgentCreateForm-DqYhH_gm.js";var R=g(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),z=g(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),me=g(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),B=g(`Pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),V=m(),H=e(t(),1),U=h(),W=s,he=p,G=H.forwardRef((e,t)=>{let n=(0,V.c)(14),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,inset:a,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a&&`pl-8`,c;n[5]!==i||n[6]!==s?(c=F(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent`,s,i),n[5]=i,n[6]=s,n[7]=c):c=n[7];let l;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,U.jsx)(b,{className:`ml-auto h-4 w-4`}),n[8]=l):l=n[8];let u;return n[9]!==r||n[10]!==o||n[11]!==t||n[12]!==c?(u=(0,U.jsxs)(f,{ref:t,className:c,...o,children:[r,l]}),n[9]=r,n[10]=o,n[11]=t,n[12]=c,n[13]=u):u=n[13],u});G.displayName=f.displayName;var K=H.forwardRef((e,t)=>{let r=(0,V.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=F(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,i),r[3]=i,r[4]=o);let s;return r[5]!==a||r[6]!==t||r[7]!==o?(s=(0,U.jsx)(n,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=s):s=r[8],s});K.displayName=n.displayName;var ge=H.forwardRef((e,t)=>{let n=(0,V.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,sideOffset:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?4:a,s;n[4]===r?s=n[5]:(s=F(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r),n[4]=r,n[5]=s);let l;return n[6]!==i||n[7]!==t||n[8]!==o||n[9]!==s?(l=(0,U.jsx)(u,{children:(0,U.jsx)(c,{ref:t,sideOffset:o,className:s,...i})}),n[6]=i,n[7]=t,n[8]=o,n[9]=s,n[10]=l):l=n[10],l});ge.displayName=c.displayName;var _e=H.forwardRef((e,t)=>{let n=(0,V.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,inset:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=i&&`pl-8`,s;n[4]!==r||n[5]!==o?(s=F(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,o,r),n[4]=r,n[5]=o,n[6]=s):s=n[6];let c;return n[7]!==a||n[8]!==t||n[9]!==s?(c=(0,U.jsx)(d,{ref:t,className:s,...a}),n[7]=a,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});_e.displayName=d.displayName;var ve=H.forwardRef((e,t)=>{let n=(0,V.c)(14),a,o,s,c;n[0]===e?(a=n[1],o=n[2],s=n[3],c=n[4]):({className:s,children:o,checked:a,...c}=e,n[0]=e,n[1]=a,n[2]=o,n[3]=s,n[4]=c);let l;n[5]===s?l=n[6]:(l=F(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,s),n[5]=s,n[6]=l);let u;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,U.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,U.jsx)(i,{children:(0,U.jsx)(y,{className:`h-4 w-4`})})}),n[7]=u):u=n[7];let d;return n[8]!==a||n[9]!==o||n[10]!==c||n[11]!==t||n[12]!==l?(d=(0,U.jsxs)(r,{ref:t,className:l,checked:a,...c,children:[u,o]}),n[8]=a,n[9]=o,n[10]=c,n[11]=t,n[12]=l,n[13]=d):d=n[13],d});ve.displayName=r.displayName;var q=H.forwardRef((e,t)=>{let n=(0,V.c)(12),r,a,o;n[0]===e?(r=n[1],a=n[2],o=n[3]):({className:a,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=o);let s;n[4]===a?s=n[5]:(s=F(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,a),n[4]=a,n[5]=s);let c;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,U.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,U.jsx)(i,{children:(0,U.jsx)(z,{className:`h-2 w-2 fill-current`})})}),n[6]=c):c=n[6];let u;return n[7]!==r||n[8]!==o||n[9]!==t||n[10]!==s?(u=(0,U.jsxs)(l,{ref:t,className:s,...o,children:[c,r]}),n[7]=r,n[8]=o,n[9]=t,n[10]=s,n[11]=u):u=n[11],u});q.displayName=l.displayName;var ye=H.forwardRef((e,t)=>{let n=(0,V.c)(11),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:r,inset:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s=i&&`pl-8`,c;n[4]!==r||n[5]!==s?(c=F(`px-2 py-1.5 text-sm font-semibold`,s,r),n[4]=r,n[5]=s,n[6]=c):c=n[6];let l;return n[7]!==o||n[8]!==t||n[9]!==c?(l=(0,U.jsx)(a,{ref:t,className:c,...o}),n[7]=o,n[8]=t,n[9]=c,n[10]=l):l=n[10],l});ye.displayName=a.displayName;var be=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`-mx-1 my-1 h-px bg-muted`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,U.jsx)(o,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});be.displayName=o.displayName;var xe=e=>{let t=(0,V.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`ml-auto text-xs tracking-widest opacity-60`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,U.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};xe.displayName=`DropdownMenuShortcut`;function Se(e){if(!e)return null;try{return E(new Date(e),`dd MMM yyyy`,{locale:D})}catch{return null}}function J(e){let t=(0,V.c)(165),{agent:n,onEdit:r}=e,i=oe(),{deleteAgent:a}=fe(),{providers:o}=ue(),{models:s}=ce(),c;t[0]!==n.id||t[1]!==i?(c=e=>{e.target.closest(`[role="menuitem"]`)||e.target.closest(`button`)||i(`/agents/${n.id}`)},t[0]=n.id,t[1]=i,t[2]=c):c=t[2];let l=c,u;t[3]!==n.id||t[4]!==n.name||t[5]!==a?(u=async e=>{if(e.stopPropagation(),(await le.fire({title:`¿Eliminar Agente?`,text:`¿Estás seguro de que deseas eliminar al agente "${n.name}"? Esta acción eliminará permanentemente su configuración.`,icon:`warning`,showCancelButton:!0,confirmButtonText:`Sí, eliminar`,cancelButtonText:`Cancelar`,reverseButtons:!0,background:`#09090b`,color:`#fff`,customClass:{popup:`border border-white/10 rounded-xl`,confirmButton:`bg-red-500 hover:bg-red-600 text-white`,cancelButton:`bg-white/10 hover:bg-white/20 text-white`}})).isConfirmed)try{await a(n.id)}catch(e){console.error(e)}},t[3]=n.id,t[4]=n.name,t[5]=a,t[6]=u):u=t[6];let d=u,f=n.role===`coordinator`,p=n.provider_id||n.providerId,m=n.model_id||n.modelId,h;t[7]!==p||t[8]!==o?(h=o.find(e=>e.id===p)?.name||p,t[7]=p,t[8]=o,t[9]=h):h=t[9];let g=h,_;t[10]!==m||t[11]!==s?(_=s.find(e=>e.id===m)?.name||m,t[10]=m,t[11]=s,t[12]=_):_=t[12];let y=_,b=n.enabled?n.status:`hibernated`,E;t[13]===n?E=t[14]:(E=O(n),t[13]=n,t[14]=E);let D=E.length,A;t[15]===n?A=t[16]:(A=ne(n),t[15]=n,t[16]=A);let j=A.length,M=!!n.systemPrompt,N=n.maxIterations||10,P=n.created_at||n.createdAt,F;t[17]===P?F=t[18]:(F=Se(P),t[17]=P,t[18]=F);let de=F,pe=`group relative overflow-hidden rounded-2xl border bg-black/40 backdrop-blur-xl transition-all duration-500 cursor-pointer flex flex-col h-full
2
2
  ${n.enabled?f?`border-purple-500/20 hover:border-purple-500/50 hover:bg-white/[0.03] hover:shadow-[0_0_30px_rgba(168,85,247,0.15)]`:`border-white/10 hover:border-blue-500/50 hover:bg-white/[0.03] hover:shadow-[0_0_30px_rgba(59,130,246,0.15)]`:`border-white/5 opacity-70 grayscale hover:grayscale-0`}
3
3
  `,L;t[19]!==n.id||t[20]!==i?(L=e=>{(e.key===`Enter`||e.key===` `)&&i(`/agents/${n.id}`)},t[19]=n.id,t[20]=i,t[21]=L):L=t[21];let R;t[22]!==n.enabled||t[23]!==f?(R=n.enabled&&(0,U.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent ${f?`via-purple-500/60`:`via-blue-500/50`} to-transparent`}),t[22]=n.enabled,t[23]=f,t[24]=R):R=t[24];let z;t[25]!==n.enabled||t[26]!==f?(z=n.enabled&&(0,U.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-br ${f?`from-purple-500/10 via-transparent to-blue-500/5`:`from-blue-500/10 via-transparent to-purple-500/10`} opacity-0 transition-opacity duration-500 group-hover:opacity-100 pointer-events-none`}),t[25]=n.enabled,t[26]=f,t[27]=z):z=t[27];let H=`w-11 h-11 rounded-xl flex items-center justify-center shrink-0 border transition-colors
4
4
  ${f?`bg-purple-500/10 border-purple-500/20 group-hover:border-purple-500/40`:`bg-blue-500/10 border-blue-500/20 group-hover:border-blue-500/40`}`,G;t[28]===f?G=t[29]:(G=f?(0,U.jsx)(re,{className:`h-5 w-5 text-purple-400`}):(0,U.jsx)(x,{className:`h-5 w-5 text-blue-400`}),t[28]=f,t[29]=G);let K;t[30]!==H||t[31]!==G?(K=(0,U.jsx)(`div`,{className:H,children:G}),t[30]=H,t[31]=G,t[32]=K):K=t[32];let ve=`text-base font-bold tracking-tight transition-colors truncate ${n.enabled?`text-white/95 group-hover:text-white`:`text-white/40`}`,q;t[33]!==n.name||t[34]!==ve?(q=(0,U.jsx)(`h3`,{className:ve,children:n.name}),t[33]=n.name,t[34]=ve,t[35]=q):q=t[35];let ye=`text-[9px] px-2 py-0.5 rounded-full font-bold uppercase border
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./chevron-down-8GjmTjLR.js";import{t as i}from"./chevron-right-BupZqrxu.js";import{t as a}from"./circle-check-BKNT2_q6.js";import{t as o}from"./circle-x-DfBjbztU.js";import{t as s}from"./copy-wR7o7Ly8.js";import{t as c}from"./history-DLK5rTlP.js";import{t as l}from"./plus-RD44ce15.js";import{t as u}from"./send-CpoY_2F-.js";import{t as d}from"./trash-2-D6oziYAK.js";import{t as f}from"./utils-DEmd_M8c.js";import{N as ee,X as p,Y as m,dt as h,ft as g}from"./index-mBw9Tl7u.js";import{t as te}from"./badge-B5AKge1b.js";import{t as _}from"./scroll-area-CbH8FOo8.js";import{i as v,n as y,r as b,t as x}from"./tabs-epu-3Tl4.js";import{t as S}from"./textarea-BgZJFZTX.js";import{i as C,n as ne,o as re,s as w,t as T}from"./select-v_3QBYrD.js";import{a as E,i as D,n as O,t as k}from"./card-mTJ4oZbL.js";var A=e(t(),1),j=n(),ie=[`GET`,`POST`,`PUT`,`DELETE`,`PATCH`,`HEAD`,`OPTIONS`];function M(){return Math.random().toString(36).substring(2,9)}function N(){return{id:M(),key:``,value:``,enabled:!0}}function P(){let[e,t]=(0,A.useState)(`GET`),[n,P]=(0,A.useState)(``),[F,I]=(0,A.useState)([N()]),[L,R]=(0,A.useState)([N()]),[z,B]=(0,A.useState)(``),[V,H]=(0,A.useState)(null),[U,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)(0),[q,J]=(0,A.useState)([]),[Y,ae]=(0,A.useState)(!1),[oe,se]=(0,A.useState)(`body`);(0,A.useEffect)(()=>{try{let e=localStorage.getItem(`hive-api-client-history`);e&&J(JSON.parse(e))}catch{}},[]);let ce=(0,A.useCallback)(e=>{localStorage.setItem(`hive-api-client-history`,JSON.stringify(e.slice(0,50)))},[]),X=(e,t,n,r,i)=>{t(e.map(e=>e.id===n?{...e,[r]:i}:e))},Z=(e,t)=>{t([...e,N()])},le=(e,t,n)=>{e.length===1?t([N()]):t(e.filter(e=>e.id!==n))},ue=()=>{let e={};for(let t of F)t.enabled&&t.key.trim()&&(e[t.key.trim()]=t.value);return e},de=()=>{let e={};for(let t of L)t.enabled&&t.key.trim()&&(e[t.key.trim()]=t.value);return e},Q=async()=>{if(!n.trim())return;W(!0),H(null);let t=performance.now();try{let r={method:e,url:n.trim(),headers:ue(),query_params:de()};z.trim()&&e!==`GET`&&e!==`HEAD`&&(r.body=z.trim());let i=await ee(`/api/http-request`,{method:`POST`,body:r,showError:!1});K(Math.round(performance.now()-t)),H(i);let a=[{id:M(),method:e,url:n.trim(),timestamp:Date.now(),status:i.status,ok:i.ok},...q];J(a),ce(a)}catch(e){K(Math.round(performance.now()-t)),H({ok:!1,error:e.message||`Request failed`})}finally{W(!1)}},fe=e=>{t(e.method),P(e.url),H(null)},pe=e=>{navigator.clipboard.writeText(e)},me=e=>{if(e==null)return``;if(typeof e==`string`)try{let t=JSON.parse(e);return JSON.stringify(t,null,2)}catch{return e}return JSON.stringify(e,null,2)},he=e=>e?e>=200&&e<300?`bg-green-500`:e>=300&&e<400?`bg-yellow-500`:e>=400&&e<500?`bg-orange-500`:`bg-red-500`:`bg-gray-500`,$=(e,t,n,r)=>(0,j.jsxs)(`div`,{className:`space-y-2`,children:[e.map(i=>(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.enabled,onChange:n=>X(e,t,i.id,`enabled`,n.target.checked),className:`h-4 w-4 rounded border-white/20 bg-background`}),(0,j.jsx)(m,{placeholder:n,value:i.key,onChange:n=>X(e,t,i.id,`key`,n.target.value),className:`h-8 text-xs bg-background/50`}),(0,j.jsx)(m,{placeholder:r,value:i.value,onChange:n=>X(e,t,i.id,`value`,n.target.value),className:`h-8 text-xs bg-background/50`}),(0,j.jsx)(p,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground hover:text-red-400`,onClick:()=>le(e,t,i.id),children:(0,j.jsx)(d,{className:`h-3.5 w-3.5`})})]},i.id)),(0,j.jsxs)(p,{variant:`ghost`,size:`sm`,className:`text-xs text-muted-foreground hover:text-primary`,onClick:()=>Z(e,t),children:[(0,j.jsx)(l,{className:`h-3.5 w-3.5 mr-1`}),`Agregar`]})]});return(0,j.jsxs)(`div`,{className:`hive-page-container animate-fade-in mt-10`,children:[(0,j.jsx)(`div`,{className:`hive-page-header mb-6`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,j.jsx)(`div`,{className:`h-10 w-10 rounded-xl bg-purple-500/10 border border-purple-500/20 flex items-center justify-center text-purple-400`,children:(0,j.jsx)(h,{className:`h-6 w-6`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`text-3xl font-black text-white uppercase tracking-tighter`,children:`API Client`}),(0,j.jsx)(`p`,{className:`hive-subtitle`,children:`Cliente HTTP para probar endpoints REST directamente desde Hive.`})]})]})}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-6`,children:[(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsx)(k,{className:`border-white/10 bg-card/50`,children:(0,j.jsx)(O,{className:`p-4`,children:(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsxs)(T,{value:e,onValueChange:t,children:[(0,j.jsx)(re,{className:`w-[110px] h-10 text-xs font-bold tracking-wider`,children:(0,j.jsx)(w,{})}),(0,j.jsx)(ne,{children:ie.map(e=>(0,j.jsx)(C,{value:e,className:`text-xs font-bold`,children:e},e))})]}),(0,j.jsx)(m,{placeholder:`https://api.example.com/endpoint`,value:n,onChange:e=>P(e.target.value),onKeyDown:e=>e.key===`Enter`&&Q(),className:`h-10 text-sm bg-background/50 font-mono`}),(0,j.jsxs)(p,{onClick:Q,disabled:U||!n.trim(),className:`h-10 px-6 bg-purple-600 hover:bg-purple-500 text-white font-bold text-xs tracking-wider`,children:[U?(0,j.jsx)(g,{className:`h-4 w-4 animate-spin mr-2`}):(0,j.jsx)(u,{className:`h-4 w-4 mr-2`}),`ENVIAR`]})]})})}),(0,j.jsx)(k,{className:`border-white/10 bg-card/50`,children:(0,j.jsx)(O,{className:`p-4`,children:(0,j.jsxs)(x,{defaultValue:`headers`,className:`w-full`,children:[(0,j.jsxs)(b,{className:`bg-background/50 h-8`,children:[(0,j.jsxs)(v,{value:`headers`,className:`text-xs h-7`,children:[`Headers (`,F.filter(e=>e.enabled&&e.key.trim()).length,`)`]}),(0,j.jsxs)(v,{value:`query`,className:`text-xs h-7`,children:[`Query Params (`,L.filter(e=>e.enabled&&e.key.trim()).length,`)`]}),(0,j.jsx)(v,{value:`body`,className:`text-xs h-7`,children:`Body`})]}),(0,j.jsx)(y,{value:`headers`,className:`mt-3`,children:$(F,I,`Header`,`Value`)}),(0,j.jsx)(y,{value:`query`,className:`mt-3`,children:$(L,R,`Key`,`Value`)}),(0,j.jsxs)(y,{value:`body`,className:`mt-3`,children:[(0,j.jsx)(S,{placeholder:`{
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./chevron-down-8GjmTjLR.js";import{t as i}from"./chevron-right-BupZqrxu.js";import{t as a}from"./circle-check-BKNT2_q6.js";import{t as o}from"./circle-x-DfBjbztU.js";import{t as s}from"./copy-wR7o7Ly8.js";import{t as c}from"./history-DLK5rTlP.js";import{t as l}from"./plus-RD44ce15.js";import{t as u}from"./send-CpoY_2F-.js";import{t as d}from"./trash-2-D6oziYAK.js";import{t as f}from"./utils-DEmd_M8c.js";import{N as ee,X as p,Y as m,dt as h,ft as g}from"./index-BG3nUPKq.js";import{t as te}from"./badge-B5AKge1b.js";import{t as _}from"./scroll-area-CbH8FOo8.js";import{i as v,n as y,r as b,t as x}from"./tabs-epu-3Tl4.js";import{t as S}from"./textarea-BgZJFZTX.js";import{i as C,n as ne,o as re,s as w,t as T}from"./select-v_3QBYrD.js";import{a as E,i as D,n as O,t as k}from"./card-mTJ4oZbL.js";var A=e(t(),1),j=n(),ie=[`GET`,`POST`,`PUT`,`DELETE`,`PATCH`,`HEAD`,`OPTIONS`];function M(){return Math.random().toString(36).substring(2,9)}function N(){return{id:M(),key:``,value:``,enabled:!0}}function P(){let[e,t]=(0,A.useState)(`GET`),[n,P]=(0,A.useState)(``),[F,I]=(0,A.useState)([N()]),[L,R]=(0,A.useState)([N()]),[z,B]=(0,A.useState)(``),[V,H]=(0,A.useState)(null),[U,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)(0),[q,J]=(0,A.useState)([]),[Y,ae]=(0,A.useState)(!1),[oe,se]=(0,A.useState)(`body`);(0,A.useEffect)(()=>{try{let e=localStorage.getItem(`hive-api-client-history`);e&&J(JSON.parse(e))}catch{}},[]);let ce=(0,A.useCallback)(e=>{localStorage.setItem(`hive-api-client-history`,JSON.stringify(e.slice(0,50)))},[]),X=(e,t,n,r,i)=>{t(e.map(e=>e.id===n?{...e,[r]:i}:e))},Z=(e,t)=>{t([...e,N()])},le=(e,t,n)=>{e.length===1?t([N()]):t(e.filter(e=>e.id!==n))},ue=()=>{let e={};for(let t of F)t.enabled&&t.key.trim()&&(e[t.key.trim()]=t.value);return e},de=()=>{let e={};for(let t of L)t.enabled&&t.key.trim()&&(e[t.key.trim()]=t.value);return e},Q=async()=>{if(!n.trim())return;W(!0),H(null);let t=performance.now();try{let r={method:e,url:n.trim(),headers:ue(),query_params:de()};z.trim()&&e!==`GET`&&e!==`HEAD`&&(r.body=z.trim());let i=await ee(`/api/http-request`,{method:`POST`,body:r,showError:!1});K(Math.round(performance.now()-t)),H(i);let a=[{id:M(),method:e,url:n.trim(),timestamp:Date.now(),status:i.status,ok:i.ok},...q];J(a),ce(a)}catch(e){K(Math.round(performance.now()-t)),H({ok:!1,error:e.message||`Request failed`})}finally{W(!1)}},fe=e=>{t(e.method),P(e.url),H(null)},pe=e=>{navigator.clipboard.writeText(e)},me=e=>{if(e==null)return``;if(typeof e==`string`)try{let t=JSON.parse(e);return JSON.stringify(t,null,2)}catch{return e}return JSON.stringify(e,null,2)},he=e=>e?e>=200&&e<300?`bg-green-500`:e>=300&&e<400?`bg-yellow-500`:e>=400&&e<500?`bg-orange-500`:`bg-red-500`:`bg-gray-500`,$=(e,t,n,r)=>(0,j.jsxs)(`div`,{className:`space-y-2`,children:[e.map(i=>(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.enabled,onChange:n=>X(e,t,i.id,`enabled`,n.target.checked),className:`h-4 w-4 rounded border-white/20 bg-background`}),(0,j.jsx)(m,{placeholder:n,value:i.key,onChange:n=>X(e,t,i.id,`key`,n.target.value),className:`h-8 text-xs bg-background/50`}),(0,j.jsx)(m,{placeholder:r,value:i.value,onChange:n=>X(e,t,i.id,`value`,n.target.value),className:`h-8 text-xs bg-background/50`}),(0,j.jsx)(p,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground hover:text-red-400`,onClick:()=>le(e,t,i.id),children:(0,j.jsx)(d,{className:`h-3.5 w-3.5`})})]},i.id)),(0,j.jsxs)(p,{variant:`ghost`,size:`sm`,className:`text-xs text-muted-foreground hover:text-primary`,onClick:()=>Z(e,t),children:[(0,j.jsx)(l,{className:`h-3.5 w-3.5 mr-1`}),`Agregar`]})]});return(0,j.jsxs)(`div`,{className:`hive-page-container animate-fade-in mt-10`,children:[(0,j.jsx)(`div`,{className:`hive-page-header mb-6`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,j.jsx)(`div`,{className:`h-10 w-10 rounded-xl bg-purple-500/10 border border-purple-500/20 flex items-center justify-center text-purple-400`,children:(0,j.jsx)(h,{className:`h-6 w-6`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`text-3xl font-black text-white uppercase tracking-tighter`,children:`API Client`}),(0,j.jsx)(`p`,{className:`hive-subtitle`,children:`Cliente HTTP para probar endpoints REST directamente desde Hive.`})]})]})}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-6`,children:[(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsx)(k,{className:`border-white/10 bg-card/50`,children:(0,j.jsx)(O,{className:`p-4`,children:(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsxs)(T,{value:e,onValueChange:t,children:[(0,j.jsx)(re,{className:`w-[110px] h-10 text-xs font-bold tracking-wider`,children:(0,j.jsx)(w,{})}),(0,j.jsx)(ne,{children:ie.map(e=>(0,j.jsx)(C,{value:e,className:`text-xs font-bold`,children:e},e))})]}),(0,j.jsx)(m,{placeholder:`https://api.example.com/endpoint`,value:n,onChange:e=>P(e.target.value),onKeyDown:e=>e.key===`Enter`&&Q(),className:`h-10 text-sm bg-background/50 font-mono`}),(0,j.jsxs)(p,{onClick:Q,disabled:U||!n.trim(),className:`h-10 px-6 bg-purple-600 hover:bg-purple-500 text-white font-bold text-xs tracking-wider`,children:[U?(0,j.jsx)(g,{className:`h-4 w-4 animate-spin mr-2`}):(0,j.jsx)(u,{className:`h-4 w-4 mr-2`}),`ENVIAR`]})]})})}),(0,j.jsx)(k,{className:`border-white/10 bg-card/50`,children:(0,j.jsx)(O,{className:`p-4`,children:(0,j.jsxs)(x,{defaultValue:`headers`,className:`w-full`,children:[(0,j.jsxs)(b,{className:`bg-background/50 h-8`,children:[(0,j.jsxs)(v,{value:`headers`,className:`text-xs h-7`,children:[`Headers (`,F.filter(e=>e.enabled&&e.key.trim()).length,`)`]}),(0,j.jsxs)(v,{value:`query`,className:`text-xs h-7`,children:[`Query Params (`,L.filter(e=>e.enabled&&e.key.trim()).length,`)`]}),(0,j.jsx)(v,{value:`body`,className:`text-xs h-7`,children:`Body`})]}),(0,j.jsx)(y,{value:`headers`,className:`mt-3`,children:$(F,I,`Header`,`Value`)}),(0,j.jsx)(y,{value:`query`,className:`mt-3`,children:$(L,R,`Key`,`Value`)}),(0,j.jsxs)(y,{value:`body`,className:`mt-3`,children:[(0,j.jsx)(S,{placeholder:`{
2
2
  "key": "value"
3
3
  }`,value:z,onChange:e=>B(e.target.value),className:`min-h-[140px] font-mono text-xs bg-background/50`}),(0,j.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:`Se enviará como string crudo. Para JSON, asegúrate de que sea válido.`})]})]})})}),V&&(0,j.jsxs)(k,{className:f(`border-white/10`,V.ok?`bg-green-500/[0.02]`:`bg-red-500/[0.02]`),children:[(0,j.jsx)(D,{className:`pb-3`,children:(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(E,{className:`text-sm font-bold tracking-wider`,children:`RESPUESTA`}),V.status!==void 0&&(0,j.jsxs)(te,{variant:`outline`,className:f(`text-xs font-bold border-none`,he(V.status),`text-white`),children:[V.status,` `,V.statusText||``]}),V.ok?(0,j.jsx)(a,{className:`h-4 w-4 text-green-500`}):(0,j.jsx)(o,{className:`h-4 w-4 text-red-500`}),(0,j.jsxs)(`span`,{className:`text-[10px] text-muted-foreground font-mono`,children:[G,`ms`]})]}),(0,j.jsxs)(p,{variant:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>pe(JSON.stringify(V,null,2)),children:[(0,j.jsx)(s,{className:`h-3 w-3 mr-1`}),`Copiar`]})]})}),(0,j.jsx)(O,{className:`pt-0`,children:(0,j.jsxs)(x,{value:oe,onValueChange:se,children:[(0,j.jsxs)(b,{className:`bg-background/50 h-8`,children:[(0,j.jsx)(v,{value:`body`,className:`text-xs h-7`,children:`Body`}),(0,j.jsx)(v,{value:`headers`,className:`text-xs h-7`,children:`Headers`}),(0,j.jsx)(v,{value:`raw`,className:`text-xs h-7`,children:`Raw`})]}),(0,j.jsx)(y,{value:`body`,className:`mt-3`,children:(0,j.jsx)(_,{className:`h-[300px] w-full rounded-md border bg-black/40 p-3`,children:(0,j.jsx)(`pre`,{className:`font-mono text-xs text-green-400 whitespace-pre-wrap`,children:me(V.body??V)})})}),(0,j.jsx)(y,{value:`headers`,className:`mt-3`,children:(0,j.jsx)(_,{className:`h-[300px] w-full rounded-md border bg-black/40 p-3`,children:V.headers?(0,j.jsx)(`div`,{className:`space-y-1`,children:Object.entries(V.headers).map(([e,t])=>(0,j.jsxs)(`div`,{className:`flex gap-2 text-xs font-mono`,children:[(0,j.jsxs)(`span`,{className:`text-purple-400 shrink-0`,children:[e,`:`]}),(0,j.jsx)(`span`,{className:`text-white/70`,children:String(t)})]},e))}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No headers disponibles`})})}),(0,j.jsx)(y,{value:`raw`,className:`mt-3`,children:(0,j.jsx)(_,{className:`h-[300px] w-full rounded-md border bg-black/40 p-3`,children:(0,j.jsx)(`pre`,{className:`font-mono text-xs text-white/60 whitespace-pre-wrap`,children:JSON.stringify(V,null,2)})})})]})})]})]}),(0,j.jsx)(`div`,{children:(0,j.jsxs)(k,{className:`border-white/10 bg-card/50`,children:[(0,j.jsx)(D,{className:`pb-3`,children:(0,j.jsxs)(`button`,{onClick:()=>ae(!Y),className:`flex items-center justify-between w-full`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(c,{className:`h-4 w-4 text-muted-foreground`}),(0,j.jsx)(E,{className:`text-xs font-bold tracking-wider`,children:`HISTORIAL`})]}),Y?(0,j.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}):(0,j.jsx)(i,{className:`h-4 w-4 text-muted-foreground`})]})}),Y&&(0,j.jsxs)(O,{className:`pt-0`,children:[q.length===0?(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground text-center py-4`,children:`No hay requests en el historial`}):(0,j.jsx)(_,{className:`h-[calc(100vh-300px)]`,children:(0,j.jsx)(`div`,{className:`space-y-1`,children:q.map(e=>(0,j.jsxs)(`button`,{onClick:()=>fe(e),className:`w-full text-left p-2 rounded-lg hover:bg-white/5 transition-colors group`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:f(`text-[10px] font-bold px-1.5 py-0.5 rounded`,e.ok?`bg-green-500/20 text-green-400`:`bg-red-500/20 text-red-400`),children:e.method}),e.status&&(0,j.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.status})]}),(0,j.jsx)(`p`,{className:`text-[10px] text-white/50 truncate mt-1 font-mono`,children:e.url}),(0,j.jsx)(`p`,{className:`text-[9px] text-white/30 mt-0.5`,children:new Date(e.timestamp).toLocaleTimeString()})]},e.id))})}),q.length>0&&(0,j.jsxs)(p,{variant:`ghost`,size:`sm`,className:`w-full mt-2 text-[10px] text-muted-foreground hover:text-red-400`,onClick:()=>{J([]),localStorage.removeItem(`hive-api-client-history`)},children:[(0,j.jsx)(d,{className:`h-3 w-3 mr-1`}),`Limpiar historial`]})]})]})})]})]})}export{P as ApiClientPage};
@@ -1,4 +1,4 @@
1
- import{r as e,t}from"./rolldown-runtime-S-ySWqyJ.js";import{f as n}from"./vendor-charts-K3xcRl0X.js";import{t as r}from"./vendor-react-kUOwxn0g.js";import{o as i}from"./vendor-query-Dj8xYhQD.js";import{t as a}from"./createLucideIcon-BRaPSYgN.js";import{t as o}from"./circle-alert-CtDbK2nl.js";import{t as s}from"./circle-check-BKNT2_q6.js";import{n as c,t as l}from"./eye-CxvxtQT5.js";import{t as u}from"./plus-RD44ce15.js";import{t as d}from"./refresh-cw-DtJMHRHO.js";import{t as f}from"./settings-qV3kVkeG.js";import{t as p}from"./zap-DSoX9NDk.js";import{c as m}from"./vendor-router-DSMCk-Ka.js";import{C as h,D as g,N as _,O as v,Q as y,X as b,Y as x,ct as S,j as C,lt as w,st as T}from"./index-mBw9Tl7u.js";import{t as E}from"./label-D_fvqJyD.js";import{a as ee,i as D,n as O,o as k,r as A,s as j,t as M}from"./select-v_3QBYrD.js";import{t as N}from"./switch-ndx8VCpm.js";import{n as P,t as F}from"./alert-CjiX20jI.js";var te=a(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),I=e(n(),1),ne=r(),L=i();function R(e){let t=(0,ne.c)(57),{channel:n,onEdit:r,onToggle:i}=e,a=n.isConfigured===!1,o=n.status===`connected`||n.status===`connecting`,s;t[0]!==n||t[1]!==r?(s=()=>r(n),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=`hive-card group transition-all duration-500 cursor-pointer ${o?`hive-card--active border-emerald-500/20`:a?`opacity-50 border-dashed hover:opacity-80 hover:border-blue-500/30`:`opacity-60 grayscale-[0.8] hover:opacity-100 hover:grayscale-0`}`,l=`h-12 w-12 rounded-xl flex items-center justify-center border transition-all duration-500 ${o?`bg-emerald-500/10 border-emerald-500/30 text-emerald-400 shadow-[0_0_15px_rgba(16,185,129,0.2)]`:a?`bg-blue-500/5 border-blue-500/20 text-blue-400/40`:`bg-white/5 border-white/10 text-white/30`}`,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,L.jsx)(T,{className:`h-6 w-6`}),t[3]=u):u=t[3];let d;t[4]===l?d=t[5]:(d=(0,L.jsx)(`div`,{className:l,children:u}),t[4]=l,t[5]=d);let f;t[6]!==n.status||t[7]!==o?(f=o&&(0,L.jsx)(`span`,{className:`text-[9px] font-black tracking-widest text-emerald-500 shadow-emerald-glow`,children:n.status===`connecting`?`CONECTANDO`:`CONECTADO`}),t[6]=n.status,t[7]=o,t[8]=f):f=t[8];let p;t[9]!==n.enabled||t[10]!==n.id||t[11]!==a||t[12]!==i?(p=a?(0,L.jsx)(`span`,{className:`text-[9px] font-black tracking-widest text-blue-400/60 uppercase`,children:`DISPONIBLE`}):(0,L.jsx)(N,{checked:n.enabled,onCheckedChange:e=>i(n.id,e),onClick:z,className:`data-[state=checked]:bg-emerald-500 scale-75 origin-right`}),t[9]=n.enabled,t[10]=n.id,t[11]=a,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==f||t[15]!==p?(m=(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f,p]}),t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;t[17]!==d||t[18]!==m?(h=(0,L.jsxs)(`div`,{className:`flex items-start justify-between mb-8`,children:[d,m]}),t[17]=d,t[18]=m,t[19]=h):h=t[19];let g;t[20]===n.type?g=t[21]:(g=(0,L.jsx)(`h3`,{className:`text-xl font-black text-white uppercase tracking-tighter mb-1 line-clamp-1 group-hover:text-emerald-400 transition-colors`,children:n.type}),t[20]=n.type,t[21]=g);let _;t[22]!==n.id||t[23]!==a?(_=a?`CLICK PARA CONFIGURAR`:`ID: ${n.id.substring(0,12).toUpperCase()}`,t[22]=n.id,t[23]=a,t[24]=_):_=t[24];let v;t[25]===_?v=t[26]:(v=(0,L.jsx)(`p`,{className:`text-[10px] text-white/20 font-black tracking-[0.2em] mb-4`,children:_}),t[25]=_,t[26]=v);let y;t[27]!==g||t[28]!==v?(y=(0,L.jsxs)(`div`,{children:[g,v]}),t[27]=g,t[28]=v,t[29]=y):y=t[29];let b;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,L.jsx)(`span`,{className:`hive-stat__label`,children:`VOZ`}),t[30]=b):b=t[30];let x=`hive-stat__value ${n.voice_enabled?`text-emerald-500`:`text-white/20`}`,S=n.voice_enabled?`ON`:`OFF`,C;t[31]!==x||t[32]!==S?(C=(0,L.jsxs)(`div`,{className:`hive-stat`,children:[b,(0,L.jsx)(`span`,{className:x,children:S})]}),t[31]=x,t[32]=S,t[33]=C):C=t[33];let w;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,L.jsx)(`span`,{className:`hive-stat__label`,children:`SÍNTESIS`}),t[34]=w):w=t[34];let E=`hive-stat__value ${n.tts_enabled?`text-emerald-500`:`text-white/20`}`,ee=n.tts_enabled?`ON`:`OFF`,D;t[35]!==E||t[36]!==ee?(D=(0,L.jsxs)(`div`,{className:`hive-stat`,children:[w,(0,L.jsx)(`span`,{className:E,children:ee})]}),t[35]=E,t[36]=ee,t[37]=D):D=t[37];let O;t[38]!==C||t[39]!==D?(O=(0,L.jsxs)(`div`,{className:`pt-4 border-t border-white/5 flex items-center gap-6`,children:[C,D]}),t[38]=C,t[39]=D,t[40]=O):O=t[40];let k;t[41]!==y||t[42]!==O?(k=(0,L.jsxs)(`div`,{className:`space-y-4`,children:[y,O]}),t[41]=y,t[42]=O,t[43]=k):k=t[43];let A;t[44]===o?A=t[45]:(A=o&&(0,L.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--emerald -bottom-10 -right-10 h-24 w-24 opacity-20`}),t[44]=o,t[45]=A);let j;t[46]!==k||t[47]!==A||t[48]!==h?(j=(0,L.jsxs)(`div`,{className:`hive-card-body relative overflow-hidden`,children:[h,k,A]}),t[46]=k,t[47]=A,t[48]=h,t[49]=j):j=t[49];let M=`hive-strip--bottom ${o?`bg-emerald-500`:a?`bg-blue-500/30`:`bg-white/10`}`,P;t[50]===M?P=t[51]:(P=(0,L.jsx)(`div`,{className:M}),t[50]=M,t[51]=P);let F;return t[52]!==s||t[53]!==c||t[54]!==j||t[55]!==P?(F=(0,L.jsxs)(`div`,{onClick:s,className:c,children:[j,P]}),t[52]=s,t[53]=c,t[54]=j,t[55]=P,t[56]=F):F=t[56],F}function z(e){return e.stopPropagation()}var re=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),B=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),ie=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),ae=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),V=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),H=t((e=>{var t=B().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),U=t((e=>{var t=B().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),oe=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),W=t((e=>{var t=ie(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),se=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),G=t((e=>{var t=se();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),ce=t(((e,t)=>{var n=G();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),le=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),ue=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
1
+ import{r as e,t}from"./rolldown-runtime-S-ySWqyJ.js";import{f as n}from"./vendor-charts-K3xcRl0X.js";import{t as r}from"./vendor-react-kUOwxn0g.js";import{o as i}from"./vendor-query-Dj8xYhQD.js";import{t as a}from"./createLucideIcon-BRaPSYgN.js";import{t as o}from"./circle-alert-CtDbK2nl.js";import{t as s}from"./circle-check-BKNT2_q6.js";import{n as c,t as l}from"./eye-CxvxtQT5.js";import{t as u}from"./plus-RD44ce15.js";import{t as d}from"./refresh-cw-DtJMHRHO.js";import{t as f}from"./settings-qV3kVkeG.js";import{t as p}from"./zap-DSoX9NDk.js";import{c as m}from"./vendor-router-DSMCk-Ka.js";import{C as h,D as g,N as _,O as v,Q as y,X as b,Y as x,ct as S,j as C,lt as w,st as T}from"./index-BG3nUPKq.js";import{t as E}from"./label-D_fvqJyD.js";import{a as ee,i as D,n as O,o as k,r as A,s as j,t as M}from"./select-v_3QBYrD.js";import{t as N}from"./switch-ndx8VCpm.js";import{n as P,t as F}from"./alert-CjiX20jI.js";var te=a(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),I=e(n(),1),ne=r(),L=i();function R(e){let t=(0,ne.c)(57),{channel:n,onEdit:r,onToggle:i}=e,a=n.isConfigured===!1,o=n.status===`connected`||n.status===`connecting`,s;t[0]!==n||t[1]!==r?(s=()=>r(n),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=`hive-card group transition-all duration-500 cursor-pointer ${o?`hive-card--active border-emerald-500/20`:a?`opacity-50 border-dashed hover:opacity-80 hover:border-blue-500/30`:`opacity-60 grayscale-[0.8] hover:opacity-100 hover:grayscale-0`}`,l=`h-12 w-12 rounded-xl flex items-center justify-center border transition-all duration-500 ${o?`bg-emerald-500/10 border-emerald-500/30 text-emerald-400 shadow-[0_0_15px_rgba(16,185,129,0.2)]`:a?`bg-blue-500/5 border-blue-500/20 text-blue-400/40`:`bg-white/5 border-white/10 text-white/30`}`,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,L.jsx)(T,{className:`h-6 w-6`}),t[3]=u):u=t[3];let d;t[4]===l?d=t[5]:(d=(0,L.jsx)(`div`,{className:l,children:u}),t[4]=l,t[5]=d);let f;t[6]!==n.status||t[7]!==o?(f=o&&(0,L.jsx)(`span`,{className:`text-[9px] font-black tracking-widest text-emerald-500 shadow-emerald-glow`,children:n.status===`connecting`?`CONECTANDO`:`CONECTADO`}),t[6]=n.status,t[7]=o,t[8]=f):f=t[8];let p;t[9]!==n.enabled||t[10]!==n.id||t[11]!==a||t[12]!==i?(p=a?(0,L.jsx)(`span`,{className:`text-[9px] font-black tracking-widest text-blue-400/60 uppercase`,children:`DISPONIBLE`}):(0,L.jsx)(N,{checked:n.enabled,onCheckedChange:e=>i(n.id,e),onClick:z,className:`data-[state=checked]:bg-emerald-500 scale-75 origin-right`}),t[9]=n.enabled,t[10]=n.id,t[11]=a,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==f||t[15]!==p?(m=(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f,p]}),t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;t[17]!==d||t[18]!==m?(h=(0,L.jsxs)(`div`,{className:`flex items-start justify-between mb-8`,children:[d,m]}),t[17]=d,t[18]=m,t[19]=h):h=t[19];let g;t[20]===n.type?g=t[21]:(g=(0,L.jsx)(`h3`,{className:`text-xl font-black text-white uppercase tracking-tighter mb-1 line-clamp-1 group-hover:text-emerald-400 transition-colors`,children:n.type}),t[20]=n.type,t[21]=g);let _;t[22]!==n.id||t[23]!==a?(_=a?`CLICK PARA CONFIGURAR`:`ID: ${n.id.substring(0,12).toUpperCase()}`,t[22]=n.id,t[23]=a,t[24]=_):_=t[24];let v;t[25]===_?v=t[26]:(v=(0,L.jsx)(`p`,{className:`text-[10px] text-white/20 font-black tracking-[0.2em] mb-4`,children:_}),t[25]=_,t[26]=v);let y;t[27]!==g||t[28]!==v?(y=(0,L.jsxs)(`div`,{children:[g,v]}),t[27]=g,t[28]=v,t[29]=y):y=t[29];let b;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,L.jsx)(`span`,{className:`hive-stat__label`,children:`VOZ`}),t[30]=b):b=t[30];let x=`hive-stat__value ${n.voice_enabled?`text-emerald-500`:`text-white/20`}`,S=n.voice_enabled?`ON`:`OFF`,C;t[31]!==x||t[32]!==S?(C=(0,L.jsxs)(`div`,{className:`hive-stat`,children:[b,(0,L.jsx)(`span`,{className:x,children:S})]}),t[31]=x,t[32]=S,t[33]=C):C=t[33];let w;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,L.jsx)(`span`,{className:`hive-stat__label`,children:`SÍNTESIS`}),t[34]=w):w=t[34];let E=`hive-stat__value ${n.tts_enabled?`text-emerald-500`:`text-white/20`}`,ee=n.tts_enabled?`ON`:`OFF`,D;t[35]!==E||t[36]!==ee?(D=(0,L.jsxs)(`div`,{className:`hive-stat`,children:[w,(0,L.jsx)(`span`,{className:E,children:ee})]}),t[35]=E,t[36]=ee,t[37]=D):D=t[37];let O;t[38]!==C||t[39]!==D?(O=(0,L.jsxs)(`div`,{className:`pt-4 border-t border-white/5 flex items-center gap-6`,children:[C,D]}),t[38]=C,t[39]=D,t[40]=O):O=t[40];let k;t[41]!==y||t[42]!==O?(k=(0,L.jsxs)(`div`,{className:`space-y-4`,children:[y,O]}),t[41]=y,t[42]=O,t[43]=k):k=t[43];let A;t[44]===o?A=t[45]:(A=o&&(0,L.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--emerald -bottom-10 -right-10 h-24 w-24 opacity-20`}),t[44]=o,t[45]=A);let j;t[46]!==k||t[47]!==A||t[48]!==h?(j=(0,L.jsxs)(`div`,{className:`hive-card-body relative overflow-hidden`,children:[h,k,A]}),t[46]=k,t[47]=A,t[48]=h,t[49]=j):j=t[49];let M=`hive-strip--bottom ${o?`bg-emerald-500`:a?`bg-blue-500/30`:`bg-white/10`}`,P;t[50]===M?P=t[51]:(P=(0,L.jsx)(`div`,{className:M}),t[50]=M,t[51]=P);let F;return t[52]!==s||t[53]!==c||t[54]!==j||t[55]!==P?(F=(0,L.jsxs)(`div`,{onClick:s,className:c,children:[j,P]}),t[52]=s,t[53]=c,t[54]=j,t[55]=P,t[56]=F):F=t[56],F}function z(e){return e.stopPropagation()}var re=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),B=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),ie=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),ae=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),V=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),H=t((e=>{var t=B().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),U=t((e=>{var t=B().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),oe=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),W=t((e=>{var t=ie(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),se=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),G=t((e=>{var t=se();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),ce=t(((e,t)=>{var n=G();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),le=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),ue=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
2
2
  ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),K=t((e=>{var t=le(),n=ue();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),de=t((e=>{var t=B(),n=W(),r=ie(),i=K(),a=le(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),fe=t((e=>{var t=B(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),pe=t(((e,t)=>{var n=K();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),me=t(((e,t)=>{var n=K(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),he=t(((e,t)=>{var n=K();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),ge=t(((e,t)=>{var n=K(),r=B();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
3
3
  Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),_e=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),ve=t((e=>{var t=K(),n=pe(),r=me(),i=he(),a=ge(),o=ue(),s=B(),c=_e();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
4
4
  Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),ye=t((e=>{var t=B(),n=ie(),r=ae(),i=V(),a=H(),o=U(),s=oe(),c=W(),l=ce(),u=de(),d=fe(),f=K(),p=ve();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`