@johpaz/hive-agents 1.1.6 → 1.1.11

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 (182) hide show
  1. package/README.md +4 -10
  2. package/dist/hive.js +5258 -2985
  3. package/dist/tool-worker.js +197 -75
  4. package/dist/ui/assets/{A2UIPage-CxE3jH4_.js → A2UIPage-v-VggXW3.js} +4 -4
  5. package/dist/ui/assets/{AgentCreateForm-SGj5AqAX.js → AgentCreateForm-Dr1l4Cvg.js} +1 -1
  6. package/dist/ui/assets/AgentDetailPage-Dsh_grrr.js +1 -0
  7. package/dist/ui/assets/{AgentNewPage-xvAmX6kw.js → AgentNewPage-D7557C0J.js} +1 -1
  8. package/dist/ui/assets/AgentsPage-C_Z56LL1.js +10 -0
  9. package/dist/ui/assets/{ApiClientPage-NLw2wHjH.js → ApiClientPage-uuBnrh0y.js} +1 -1
  10. package/dist/ui/assets/ChannelsPage-BI4mAgRU.js +8 -0
  11. package/dist/ui/assets/DashboardPage-BjAxvzYP.js +6 -0
  12. package/dist/ui/assets/LoginPage-D7IZKON0.js +1 -0
  13. package/dist/ui/assets/{LogsPage-G9d2G1nL.js → LogsPage-mcqOYvGw.js} +1 -1
  14. package/dist/ui/assets/MeetingPage-qPJ1z5HA.js +1 -0
  15. package/dist/ui/assets/ModelSelector-njfNhkng.js +1 -0
  16. package/dist/ui/assets/{NotFound-D4ZlDVg9.js → NotFound-DY8e1RKh.js} +1 -1
  17. package/dist/ui/assets/{Office3DPage-31AMJ-LN.css → Office3DPage-C3SIzd2H.css} +1 -1
  18. package/dist/ui/assets/Office3DPage-Du42LRwi.js +319 -0
  19. package/dist/ui/assets/ProvidersPage-GDCJs8Zb.js +1 -0
  20. package/dist/ui/assets/{RecoverPage-Dr6qKgV5.js → RecoverPage-B6qvBBIl.js} +1 -1
  21. package/dist/ui/assets/SettingsPage-Br4PfWuc.js +9 -0
  22. package/dist/ui/assets/{SetupPage-BoVKIf4r.js → SetupPage-OaouFLGD.js} +1 -1
  23. package/dist/ui/assets/{Vignette-DrI2yK2m.js → Vignette-GSZ-owcN.js} +17 -17
  24. package/dist/ui/assets/VoicePage-DRQZBl3j.js +307 -0
  25. package/dist/ui/assets/WebChatPage-Cypq-SYi.js +29 -0
  26. package/dist/ui/assets/{agentCapabilities-CDSfJWhw.js → agentCapabilities-Bf71Gir4.js} +1 -1
  27. package/dist/ui/assets/{alert-CjiX20jI.js → alert-Dn604uVs.js} +1 -1
  28. package/dist/ui/assets/{badge-B5AKge1b.js → badge-C6H33ePv.js} +1 -1
  29. package/dist/ui/assets/{card-mTJ4oZbL.js → card-D0qneq1i.js} +1 -1
  30. package/dist/ui/assets/{conversationsStore-ns_ZfKgg.js → conversationsStore-D6XgjMr1.js} +1 -1
  31. package/dist/ui/assets/{dialog-C3n2xYF2.js → dialog-DO1fQCF7.js} +1 -1
  32. package/dist/ui/assets/dist-js-C2MfmbEW.js +1 -0
  33. package/dist/ui/assets/{dist-js-CkNhvsFc.js → dist-js-Djxbxbst.js} +1 -1
  34. package/dist/ui/assets/google-external-e9lvWjy4.js +1 -0
  35. package/dist/ui/assets/index-BKNFH2al.css +2 -0
  36. package/dist/ui/assets/index-U0e4e5mL.js +156 -0
  37. package/dist/ui/assets/{key-DPkOY-J0.js → key-round-Ca0Ns34v.js} +1 -1
  38. package/dist/ui/assets/{label-D_fvqJyD.js → label-CvAtVE-v.js} +1 -1
  39. package/dist/ui/assets/{scroll-area-CbH8FOo8.js → scroll-area-CYMu7sU0.js} +1 -1
  40. package/dist/ui/assets/select-BjBXxyxL.js +1 -0
  41. package/dist/ui/assets/{slider-DXS4h1LB.js → slider-DR31eN3r.js} +1 -1
  42. package/dist/ui/assets/{switch-ndx8VCpm.js → switch-B5dAwb54.js} +1 -1
  43. package/dist/ui/assets/{tabs-epu-3Tl4.js → tabs-Ct92cLXr.js} +1 -1
  44. package/dist/ui/assets/{earth-BJRGJbVn.js → terminal-CpBDERBE.js} +1 -1
  45. package/dist/ui/assets/{textarea-BgZJFZTX.js → textarea-xtFAVuPf.js} +1 -1
  46. package/dist/ui/assets/{useAudioDevices-CsPrtpWY.js → useAudioDevices-wZArmV3m.js} +1 -1
  47. package/dist/ui/assets/{useHiveAgentsModelLoad-nn4gON9g.js → useHiveAgentsModelLoad-CqJkzTOT.js} +1 -1
  48. package/dist/ui/assets/useOfficeModel-DZvwZRCw.js +1 -0
  49. package/dist/ui/assets/{useProviders-9tvEC3hX.js → useProviders-CeSzDnx-.js} +1 -1
  50. package/dist/ui/assets/vendor-router-DxU0Uf4R.js +3 -0
  51. package/dist/ui/index.html +5 -5
  52. package/package.json +1 -3
  53. package/packages/core/src/agent/agent-catalog.ts +98 -1
  54. package/packages/core/src/agent/agent-loop.ts +5 -44
  55. package/packages/core/src/agent/context-compiler.ts +6 -94
  56. package/packages/core/src/agent/conversation-store.ts +23 -1
  57. package/packages/core/src/agent/llm-providers/openai-compat-base.ts +1 -1
  58. package/packages/core/src/agent/prompt-builder.ts +17 -1
  59. package/packages/core/src/agent/tool-selector.ts +8 -0
  60. package/packages/core/src/artifacts/store.ts +66 -8
  61. package/packages/core/src/canvas/emitter.ts +0 -19
  62. package/packages/core/src/gateway/google-host.ts +228 -0
  63. package/packages/core/src/gateway/initializer.ts +8 -0
  64. package/packages/core/src/gateway/routes/agents.ts +14 -0
  65. package/packages/core/src/gateway/routes/auth.ts +25 -3
  66. package/packages/core/src/gateway/routes/chat.ts +14 -1
  67. package/packages/core/src/gateway/routes/google.ts +252 -0
  68. package/packages/core/src/gateway/routes/meeting.ts +11 -3
  69. package/packages/core/src/gateway/routes/models.ts +27 -11
  70. package/packages/core/src/gateway/routes/multimodal.ts +19 -0
  71. package/packages/core/src/gateway/routes/providers.ts +19 -18
  72. package/packages/core/src/gateway/routes/system.ts +1 -3
  73. package/packages/core/src/gateway/routes/tts-local.ts +20 -374
  74. package/packages/core/src/gateway/routes/voice.ts +29 -35
  75. package/packages/core/src/gateway/server.ts +58 -32
  76. package/packages/core/src/gateway/tts/README.md +7 -86
  77. package/packages/core/src/gateway/tts/build.py +105 -0
  78. package/packages/core/src/gateway/tts/kitten.ts +282 -0
  79. package/packages/core/src/gateway/tts/python.d.ts +4 -0
  80. package/packages/core/src/gateway/tts/src/detect.ts +33 -39
  81. package/packages/core/src/gateway/tts/worker.py +80 -0
  82. package/packages/core/src/google/client.ts +123 -0
  83. package/packages/core/src/google/config.ts +60 -0
  84. package/packages/core/src/google/google.test.ts +287 -0
  85. package/packages/core/src/google/index.ts +5 -0
  86. package/packages/core/src/google/oauth.ts +144 -0
  87. package/packages/core/src/google/scopes.ts +41 -0
  88. package/packages/core/src/google/token-store.ts +33 -0
  89. package/packages/core/src/multimodal/attachment-ingest.ts +19 -4
  90. package/packages/core/src/multimodal/image-generation.ts +244 -0
  91. package/packages/core/src/storage/collections.ts +8 -8
  92. package/packages/core/src/storage/google-capabilities.ts +91 -0
  93. package/packages/core/src/storage/model-activation.ts +18 -0
  94. package/packages/core/src/storage/model-sync.ts +66 -14
  95. package/packages/core/src/storage/onboarding.ts +10 -2
  96. package/packages/core/src/storage/seed.ts +81 -18
  97. package/packages/core/src/storage/usage.ts +0 -52
  98. package/packages/core/src/tools/agents/get-available-models.ts +1 -3
  99. package/packages/core/src/tools/core/index.ts +1 -1
  100. package/packages/core/src/tools/google/calendar.ts +204 -0
  101. package/packages/core/src/tools/google/drive.ts +160 -0
  102. package/packages/core/src/tools/google/gmail.ts +579 -0
  103. package/packages/core/src/tools/google/index.ts +18 -0
  104. package/packages/core/src/tools/google/shared.ts +80 -0
  105. package/packages/core/src/tools/image/image-generate.ts +90 -0
  106. package/packages/core/src/tools/image/index.ts +13 -0
  107. package/packages/core/src/tools/image/office-leer-imagenes.ts +198 -0
  108. package/packages/core/src/tools/index.ts +27 -0
  109. package/packages/core/src/tools/office/office-images.ts +137 -0
  110. package/packages/core/src/tools/office/office-leer-docx.ts +10 -1
  111. package/packages/core/src/tools/office/office-leer-pdf.ts +1 -1
  112. package/packages/core/src/tools/office/office-leer-pptx.ts +4 -1
  113. package/packages/core/src/tools/office/office-pdf-images.ts +225 -0
  114. package/packages/core/src/tools/office/pdf-text.ts +2 -2
  115. package/packages/core/src/tools/web/browser-screenshot.ts +7 -0
  116. package/packages/core/src/voice/index.ts +123 -155
  117. package/packages/core/src/voice/local-model.ts +8 -0
  118. package/packages/core/src/voice/stt-models.ts +39 -0
  119. package/packages/skills/src/bundled/google/google_calendar/SKILL.md +51 -0
  120. package/packages/skills/src/bundled/google/google_drive/SKILL.md +50 -0
  121. package/packages/skills/src/bundled/google/google_gmail/SKILL.md +61 -0
  122. package/packages/skills/src/bundled-data.generated.ts +45 -0
  123. package/dist/ui/assets/AgentDetailPage-CyYbqzHr.js +0 -1
  124. package/dist/ui/assets/AgentsPage-CEWNs4Lt.js +0 -10
  125. package/dist/ui/assets/ChannelsPage-CmeXP-hI.js +0 -8
  126. package/dist/ui/assets/DashboardPage-C3z4kZXD.js +0 -6
  127. package/dist/ui/assets/LoginPage-DDisP8hm.js +0 -1
  128. package/dist/ui/assets/MeetingPage-CKyjxtFr.js +0 -1
  129. package/dist/ui/assets/ModelSelector-VVwpDrYF.js +0 -1
  130. package/dist/ui/assets/Office3DPage-CYxB6z2p.js +0 -727
  131. package/dist/ui/assets/ProvidersPage-CM9-E-Pf.js +0 -1
  132. package/dist/ui/assets/SettingsPage-BvD-vs5g.js +0 -9
  133. package/dist/ui/assets/VoicePage-CmudxYny.js +0 -307
  134. package/dist/ui/assets/WebChatPage-CnoXpEOl.js +0 -29
  135. package/dist/ui/assets/dist-js-jWCEHSkB.js +0 -1
  136. package/dist/ui/assets/index-C0W6p0lk.js +0 -156
  137. package/dist/ui/assets/index-DmFPF9xQ.css +0 -2
  138. package/dist/ui/assets/lock-open-v0EphssG.js +0 -1
  139. package/dist/ui/assets/select-v_3QBYrD.js +0 -1
  140. package/dist/ui/assets/terminal-BEcTK780.js +0 -1
  141. package/dist/ui/assets/useOfficeModel-BaDn7U-X.js +0 -1
  142. package/dist/ui/assets/vendor-router-DSMCk-Ka.js +0 -3
  143. package/packages/core/src/agent/jev-decisions.ts +0 -242
  144. package/packages/core/src/agent/jev-planner.ts +0 -293
  145. package/packages/core/src/gateway/tts/package.json +0 -25
  146. package/packages/core/src/gateway/tts/src/client.ts +0 -59
  147. package/packages/core/src/gateway/tts/src/index.ts +0 -15
  148. package/packages/core/src/gateway/tts/src/install.ts +0 -137
  149. package/packages/core/src/gateway/tts/src/models.ts +0 -50
  150. package/packages/core/src/gateway/tts/src/server.ts +0 -253
  151. /package/dist/ui/assets/{core-p4c5dns5.js → core-npANj14X.js} +0 -0
  152. /package/dist/ui/assets/{download-BQXrpH0m.js → download-D0aDV8Y_.js} +0 -0
  153. /package/dist/ui/assets/{ellipsis-vertical-D7uFJLGh.js → ellipsis-vertical-BOW_iEOO.js} +0 -0
  154. /package/dist/ui/assets/{external-link-6oTH9pUM.js → external-link-DNJH7epD.js} +0 -0
  155. /package/dist/ui/assets/{eye-CxvxtQT5.js → eye-BVfTWOME.js} +0 -0
  156. /package/dist/ui/assets/{file-text-D5ZJEx3E.js → file-text-ByqNMpXm.js} +0 -0
  157. /package/dist/ui/assets/{gateway-url-BALS_wVh.js → gateway-url-BzQV75Ig.js} +0 -0
  158. /package/dist/ui/assets/{gauge-CEu7PhTW.js → gauge-CB4np0Vz.js} +0 -0
  159. /package/dist/ui/assets/{history-DLK5rTlP.js → history-CbhJX41s.js} +0 -0
  160. /package/dist/ui/assets/{info-8ReWzubE.js → info-BCD3-QX9.js} +0 -0
  161. /package/dist/ui/assets/{lock-3IApZyVy.js → lock-DpBean4K.js} +0 -0
  162. /package/dist/ui/assets/{mail-vwCEHyhQ.js → mail-Biwn8WrV.js} +0 -0
  163. /package/dist/ui/assets/{mic-CpDU_2as.js → mic-Rq4BxU1R.js} +0 -0
  164. /package/dist/ui/assets/{pause-BAMsNQkh.js → pause-87NGXbsz.js} +0 -0
  165. /package/dist/ui/assets/{pencil-CKritjT_.js → pencil-BG8EFaS3.js} +0 -0
  166. /package/dist/ui/assets/{play-Cwpe4tp6.js → play-D3De6YsQ.js} +0 -0
  167. /package/dist/ui/assets/{plus-RD44ce15.js → plus-Bp8-V68t.js} +0 -0
  168. /package/dist/ui/assets/{radio-lFPMHi6-.js → radio-m7rzuDKK.js} +0 -0
  169. /package/dist/ui/assets/{refresh-cw-DtJMHRHO.js → refresh-cw-D6F1zoC6.js} +0 -0
  170. /package/dist/ui/assets/{rotate-ccw-b3E_4PoX.js → rotate-ccw-DUlEC1_D.js} +0 -0
  171. /package/dist/ui/assets/{search-z2oZt00P.js → search-CfNwwpMW.js} +0 -0
  172. /package/dist/ui/assets/{send-CpoY_2F-.js → send-CI868CBV.js} +0 -0
  173. /package/dist/ui/assets/{settings-qV3kVkeG.js → settings-AEM2uWiD.js} +0 -0
  174. /package/dist/ui/assets/{shield-CIarwBvx.js → shield-DvVIcbzd.js} +0 -0
  175. /package/dist/ui/assets/{sparkles-DVvY6jDT.js → sparkles-DRe4GbSH.js} +0 -0
  176. /package/dist/ui/assets/{square-D5zdNkAY.js → square-DTWkjTT3.js} +0 -0
  177. /package/dist/ui/assets/{trash-2-D6oziYAK.js → trash-2-BZsMCfso.js} +0 -0
  178. /package/dist/ui/assets/{utils-DEmd_M8c.js → utils-lc8H6VGT.js} +0 -0
  179. /package/dist/ui/assets/{volume-2-EaA0JRvD.js → volume-2-CBMYsuF3.js} +0 -0
  180. /package/dist/ui/assets/{volume-x-CROXNMGT.js → volume-x-vNFf2e4-.js} +0 -0
  181. /package/dist/ui/assets/{wifi-BUJuOcgP.js → wifi-DNv53AfN.js} +0 -0
  182. /package/dist/ui/assets/{zap-DSoX9NDk.js → zap-Yed86Sh8.js} +0 -0
@@ -273271,7 +273271,7 @@ var officeLeerPdfTool = {
273271
273271
  totalPaginas: r.totalPaginas,
273272
273272
  paginasLeidas: r.paginasLeidas,
273273
273273
  texto: "",
273274
- aviso: "Estas p\xE1ginas no tienen texto extra\xEDble: el PDF parece escaneado (solo im\xE1genes). Esta herramienta no hace OCR; p\xEDdele al usuario el documento en formato editable o que copie el texto."
273274
+ aviso: "Estas p\xE1ginas no tienen texto extra\xEDble: el PDF parece escaneado (solo im\xE1genes). Esta herramienta no hace OCR: para leerlo usa office_leer_imagenes con la misma ruta (transcribe cada p\xE1gina con el modelo de visi\xF3n, una llamada por p\xE1gina). Si no hay modelo de visi\xF3n configurado, p\xEDdele al usuario el documento en formato editable o que copie el texto."
273275
273275
  };
273276
273276
  }
273277
273277
  const vacias = r.caracteresPorPagina.filter((c) => c === 0).length;
@@ -274255,6 +274255,189 @@ var officeEscribirPdfTool = {
274255
274255
  }
274256
274256
  };
274257
274257
 
274258
+ // packages/core/src/tools/office/pptx-slides.ts
274259
+ var unescapeXml = (s) => s.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&");
274260
+ async function listarSlides(zip) {
274261
+ const porNumeroDeArchivo = () => Object.keys(zip.files).filter((n) => /^ppt\/slides\/slide\d+\.xml$/i.test(n)).sort((a, b) => Number(a.match(/slide(\d+)/)[1]) - Number(b.match(/slide(\d+)/)[1])).map((archivo, i) => ({ numero: i + 1, archivo }));
274262
+ const pres = await zip.file("ppt/presentation.xml")?.async("string");
274263
+ const rels = await zip.file("ppt/_rels/presentation.xml.rels")?.async("string");
274264
+ if (!pres || !rels)
274265
+ return porNumeroDeArchivo();
274266
+ const destinos = new Map;
274267
+ for (const m of rels.matchAll(/<Relationship\b[^>]*>/g)) {
274268
+ const id = m[0].match(/\bId="([^"]+)"/)?.[1];
274269
+ const target = m[0].match(/\bTarget="([^"]+)"/)?.[1];
274270
+ if (id && target)
274271
+ destinos.set(id, target);
274272
+ }
274273
+ const ordenados = [];
274274
+ for (const m of pres.matchAll(/<p:sldId\b[^>]*\br:id="([^"]+)"/g)) {
274275
+ const target = destinos.get(m[1]);
274276
+ if (!target)
274277
+ continue;
274278
+ const archivo = target.startsWith("/") ? target.slice(1) : `ppt/${target.replace(/^\.\//, "")}`;
274279
+ if (zip.file(archivo))
274280
+ ordenados.push({ numero: ordenados.length + 1, archivo });
274281
+ }
274282
+ return ordenados.length ? ordenados : porNumeroDeArchivo();
274283
+ }
274284
+ function textoDeXml(xml) {
274285
+ const parrafos = [];
274286
+ for (const p of xml.matchAll(/<a:p[ >][\s\S]*?<\/a:p>/g)) {
274287
+ const partes = [...p[0].matchAll(/<a:t(?:\s[^>]*)?>([^<]*)<\/a:t>|<a:br\s*\/>/g)].map((m) => m[1] === undefined ? `
274288
+ ` : unescapeXml(m[1]));
274289
+ const linea = partes.join("").trim();
274290
+ if (linea)
274291
+ parrafos.push(linea);
274292
+ }
274293
+ return parrafos.join(`
274294
+ `);
274295
+ }
274296
+ function tituloDeXml(xml, texto) {
274297
+ for (const sp of xml.matchAll(/<p:sp\b[\s\S]*?<\/p:sp>/g)) {
274298
+ if (/<p:ph\b[^>]*\btype="(?:title|ctrTitle)"/.test(sp[0])) {
274299
+ const t = textoDeXml(sp[0]);
274300
+ if (t)
274301
+ return t.split(`
274302
+ `)[0];
274303
+ }
274304
+ }
274305
+ return texto.split(`
274306
+ `)[0] || undefined;
274307
+ }
274308
+ async function archivoDeNotas(zip, slide) {
274309
+ const relsPath = slide.archivo.replace(/slides\/(slide\d+\.xml)$/, "slides/_rels/$1.rels");
274310
+ const rels = await zip.file(relsPath)?.async("string");
274311
+ const target = rels?.match(/<Relationship\b[^>]*\bType="[^"]*\/notesSlide"[^>]*>/)?.[0].match(/\bTarget="([^"]+)"/)?.[1];
274312
+ if (!target)
274313
+ return null;
274314
+ const base = slide.archivo.split("/").slice(0, -1);
274315
+ const partes = target.startsWith("/") ? target.slice(1).split("/") : [...base, ...target.split("/")];
274316
+ const resueltas = [];
274317
+ for (const p of partes) {
274318
+ if (p === "..")
274319
+ resueltas.pop();
274320
+ else if (p !== ".")
274321
+ resueltas.push(p);
274322
+ }
274323
+ const ruta = resueltas.join("/");
274324
+ return zip.file(ruta) ? ruta : null;
274325
+ }
274326
+
274327
+ // packages/core/src/tools/office/office-images.ts
274328
+ var MIN_BYTES_IMAGEN = 5000;
274329
+ var MIME_POR_EXT = {
274330
+ png: "image/png",
274331
+ jpg: "image/jpeg",
274332
+ jpeg: "image/jpeg",
274333
+ gif: "image/gif",
274334
+ webp: "image/webp"
274335
+ };
274336
+ var unescapeXml2 = (s) => s.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&");
274337
+ function resolverRuta(carpetaBase, target) {
274338
+ const partes = target.startsWith("/") ? target.slice(1).split("/") : [...carpetaBase, ...target.split("/")];
274339
+ const resueltas = [];
274340
+ for (const p of partes) {
274341
+ if (p === "..")
274342
+ resueltas.pop();
274343
+ else if (p !== ".")
274344
+ resueltas.push(p);
274345
+ }
274346
+ return resueltas.join("/");
274347
+ }
274348
+ async function relacionesDeImagen(zip, relsPath, carpetaBase) {
274349
+ const rels = await zip.file(relsPath)?.async("string");
274350
+ const mapa = new Map;
274351
+ if (!rels)
274352
+ return mapa;
274353
+ for (const m of rels.matchAll(/<Relationship\b[^>]*>/g)) {
274354
+ if (!/\bType="[^"]*\/image"/.test(m[0]) || /\bTargetMode="External"/.test(m[0]))
274355
+ continue;
274356
+ const id = m[0].match(/\bId="([^"]+)"/)?.[1];
274357
+ const target = m[0].match(/\bTarget="([^"]+)"/)?.[1];
274358
+ if (id && target)
274359
+ mapa.set(id, resolverRuta(carpetaBase, target));
274360
+ }
274361
+ return mapa;
274362
+ }
274363
+ function tamanoDe(zip, archivo) {
274364
+ const size = zip.file(archivo)?._data?.uncompressedSize;
274365
+ return typeof size === "number" ? size : undefined;
274366
+ }
274367
+ function mimeDe(archivo) {
274368
+ return MIME_POR_EXT[archivo.split(".").pop()?.toLowerCase() ?? ""] ?? null;
274369
+ }
274370
+
274371
+ class Acumulador {
274372
+ zip;
274373
+ imagenes = [];
274374
+ omitidas = 0;
274375
+ vistos = new Map;
274376
+ descartados = new Set;
274377
+ constructor(zip) {
274378
+ this.zip = zip;
274379
+ }
274380
+ agregar(archivo, ubicacion) {
274381
+ const previo = this.vistos.get(archivo);
274382
+ if (previo) {
274383
+ if (!previo.ubicacion.includes(ubicacion) && previo.ubicacion.split(" \xB7 ").length < 3)
274384
+ previo.ubicacion += ` \xB7 ${ubicacion}`;
274385
+ return;
274386
+ }
274387
+ if (this.descartados.has(archivo))
274388
+ return;
274389
+ const mimeType = mimeDe(archivo);
274390
+ const tamano = tamanoDe(this.zip, archivo);
274391
+ if (!this.zip.file(archivo) || !mimeType || tamano !== undefined && tamano < MIN_BYTES_IMAGEN) {
274392
+ this.descartados.add(archivo);
274393
+ this.omitidas++;
274394
+ return;
274395
+ }
274396
+ const ref = { numero: this.imagenes.length + 1, archivo, mimeType, ubicacion };
274397
+ this.imagenes.push(ref);
274398
+ this.vistos.set(archivo, ref);
274399
+ }
274400
+ }
274401
+ async function imagenesDocx(zip) {
274402
+ const xml = await zip.file("word/document.xml")?.async("string");
274403
+ if (!xml)
274404
+ return { imagenes: [], omitidas: 0 };
274405
+ const rels = await relacionesDeImagen(zip, "word/_rels/document.xml.rels", ["word"]);
274406
+ const acc = new Acumulador(zip);
274407
+ let ultimoTexto = "";
274408
+ for (const p of xml.matchAll(/<w:p[ >][\s\S]*?<\/w:p>/g)) {
274409
+ const texto = [...p[0].matchAll(/<w:t(?:\s[^>]*)?>([^<]*)<\/w:t>/g)].map((m) => unescapeXml2(m[1])).join("").trim();
274410
+ const recorte = texto.length > 80 ? `${texto.slice(0, 80)}\u2026` : texto;
274411
+ for (const e of p[0].matchAll(/\br:embed="([^"]+)"/g)) {
274412
+ const archivo = rels.get(e[1]);
274413
+ if (!archivo)
274414
+ continue;
274415
+ const ubicacion = recorte ? `Junto a: \xAB${recorte}\xBB` : ultimoTexto ? `Despu\xE9s de: \xAB${ultimoTexto}\xBB` : "Al inicio del documento";
274416
+ acc.agregar(archivo, ubicacion);
274417
+ }
274418
+ if (recorte)
274419
+ ultimoTexto = recorte;
274420
+ }
274421
+ return { imagenes: acc.imagenes, omitidas: acc.omitidas };
274422
+ }
274423
+ async function imagenesPptx(zip) {
274424
+ const acc = new Acumulador(zip);
274425
+ for (const slide of await listarSlides(zip)) {
274426
+ const xml = await zip.file(slide.archivo).async("string");
274427
+ const relsPath = slide.archivo.replace(/slides\/(slide\d+\.xml)$/, "slides/_rels/$1.rels");
274428
+ const rels = await relacionesDeImagen(zip, relsPath, slide.archivo.split("/").slice(0, -1));
274429
+ for (const e of xml.matchAll(/\br:embed="([^"]+)"/g)) {
274430
+ const archivo = rels.get(e[1]);
274431
+ if (archivo)
274432
+ acc.agregar(archivo, `Diapositiva ${slide.numero}`);
274433
+ }
274434
+ }
274435
+ return { imagenes: acc.imagenes, omitidas: acc.omitidas };
274436
+ }
274437
+ async function listarImagenes(zip, formato) {
274438
+ return formato === "docx" ? imagenesDocx(zip) : imagenesPptx(zip);
274439
+ }
274440
+
274258
274441
  // packages/core/src/tools/office/office-leer-docx.ts
274259
274442
  import * as fs10 from "fs";
274260
274443
  import * as path9 from "path";
@@ -274308,13 +274491,19 @@ ${textoCeldas.join(" | ")}`;
274308
274491
  }
274309
274492
  }
274310
274493
  const advertencias = resultadoTexto.messages.filter((m) => m.type === "warning").map((m) => m.message);
274311
- log13.info(`DOCX le\xEDdo: ${resultadoTexto.value.length} caracteres`);
274494
+ let imagenes = 0;
274495
+ try {
274496
+ const JSZip = (await Promise.resolve().then(() => __toESM(require_lib3(), 1))).default;
274497
+ imagenes = (await listarImagenes(await JSZip.loadAsync(buffer), "docx")).imagenes.length;
274498
+ } catch {}
274499
+ log13.info(`DOCX le\xEDdo: ${resultadoTexto.value.length} caracteres, ${imagenes} im\xE1genes`);
274312
274500
  return {
274313
274501
  ok: true,
274314
274502
  ruta: rutaAbsoluta,
274315
274503
  texto: resultadoTexto.value,
274316
274504
  tablas: textoTablas,
274317
- advertencias: advertencias.length > 0 ? advertencias : undefined
274505
+ advertencias: advertencias.length > 0 ? advertencias : undefined,
274506
+ ...imagenes ? { imagenes, aviso_imagenes: `El documento tiene ${imagenes} ${imagenes === 1 ? "imagen" : "im\xE1genes"} que NO est\xE1n en este texto (capturas, gr\xE1ficos, diagramas). Si hacen falta, usa la tool office_leer_imagenes con la misma ruta.` } : {}
274318
274507
  };
274319
274508
  } catch (error) {
274320
274509
  log13.error(`Error leyendo DOCX: ${error.message}`);
@@ -274981,75 +275170,6 @@ var officeEscribirXlsxTool = {
274981
275170
  }
274982
275171
  };
274983
275172
 
274984
- // packages/core/src/tools/office/pptx-slides.ts
274985
- var unescapeXml = (s) => s.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&");
274986
- async function listarSlides(zip) {
274987
- const porNumeroDeArchivo = () => Object.keys(zip.files).filter((n) => /^ppt\/slides\/slide\d+\.xml$/i.test(n)).sort((a, b) => Number(a.match(/slide(\d+)/)[1]) - Number(b.match(/slide(\d+)/)[1])).map((archivo, i) => ({ numero: i + 1, archivo }));
274988
- const pres = await zip.file("ppt/presentation.xml")?.async("string");
274989
- const rels = await zip.file("ppt/_rels/presentation.xml.rels")?.async("string");
274990
- if (!pres || !rels)
274991
- return porNumeroDeArchivo();
274992
- const destinos = new Map;
274993
- for (const m of rels.matchAll(/<Relationship\b[^>]*>/g)) {
274994
- const id = m[0].match(/\bId="([^"]+)"/)?.[1];
274995
- const target = m[0].match(/\bTarget="([^"]+)"/)?.[1];
274996
- if (id && target)
274997
- destinos.set(id, target);
274998
- }
274999
- const ordenados = [];
275000
- for (const m of pres.matchAll(/<p:sldId\b[^>]*\br:id="([^"]+)"/g)) {
275001
- const target = destinos.get(m[1]);
275002
- if (!target)
275003
- continue;
275004
- const archivo = target.startsWith("/") ? target.slice(1) : `ppt/${target.replace(/^\.\//, "")}`;
275005
- if (zip.file(archivo))
275006
- ordenados.push({ numero: ordenados.length + 1, archivo });
275007
- }
275008
- return ordenados.length ? ordenados : porNumeroDeArchivo();
275009
- }
275010
- function textoDeXml(xml) {
275011
- const parrafos = [];
275012
- for (const p of xml.matchAll(/<a:p[ >][\s\S]*?<\/a:p>/g)) {
275013
- const partes = [...p[0].matchAll(/<a:t(?:\s[^>]*)?>([^<]*)<\/a:t>|<a:br\s*\/>/g)].map((m) => m[1] === undefined ? `
275014
- ` : unescapeXml(m[1]));
275015
- const linea = partes.join("").trim();
275016
- if (linea)
275017
- parrafos.push(linea);
275018
- }
275019
- return parrafos.join(`
275020
- `);
275021
- }
275022
- function tituloDeXml(xml, texto) {
275023
- for (const sp of xml.matchAll(/<p:sp\b[\s\S]*?<\/p:sp>/g)) {
275024
- if (/<p:ph\b[^>]*\btype="(?:title|ctrTitle)"/.test(sp[0])) {
275025
- const t = textoDeXml(sp[0]);
275026
- if (t)
275027
- return t.split(`
275028
- `)[0];
275029
- }
275030
- }
275031
- return texto.split(`
275032
- `)[0] || undefined;
275033
- }
275034
- async function archivoDeNotas(zip, slide) {
275035
- const relsPath = slide.archivo.replace(/slides\/(slide\d+\.xml)$/, "slides/_rels/$1.rels");
275036
- const rels = await zip.file(relsPath)?.async("string");
275037
- const target = rels?.match(/<Relationship\b[^>]*\bType="[^"]*\/notesSlide"[^>]*>/)?.[0].match(/\bTarget="([^"]+)"/)?.[1];
275038
- if (!target)
275039
- return null;
275040
- const base = slide.archivo.split("/").slice(0, -1);
275041
- const partes = target.startsWith("/") ? target.slice(1).split("/") : [...base, ...target.split("/")];
275042
- const resueltas = [];
275043
- for (const p of partes) {
275044
- if (p === "..")
275045
- resueltas.pop();
275046
- else if (p !== ".")
275047
- resueltas.push(p);
275048
- }
275049
- const ruta = resueltas.join("/");
275050
- return zip.file(ruta) ? ruta : null;
275051
- }
275052
-
275053
275173
  // packages/core/src/tools/office/office-leer-pptx.ts
275054
275174
  import * as fs14 from "fs";
275055
275175
  import * as path13 from "path";
@@ -275117,12 +275237,14 @@ var officeLeerPptxTool = {
275117
275237
  diapositivas.push(item);
275118
275238
  usados += tam;
275119
275239
  }
275120
- log17.info(`PPTX le\xEDdo: ${slides.length} slides totales, ${diapositivas.length} le\xEDdas`);
275240
+ const imagenes = (await listarImagenes(zip, "pptx").catch(() => ({ imagenes: [] }))).imagenes.length;
275241
+ log17.info(`PPTX le\xEDdo: ${slides.length} slides totales, ${diapositivas.length} le\xEDdas, ${imagenes} im\xE1genes`);
275121
275242
  return {
275122
275243
  ok: true,
275123
275244
  ruta: rutaAbsoluta,
275124
275245
  totalDiapositivas: slides.length,
275125
275246
  diapositivas,
275247
+ ...imagenes ? { imagenes, aviso_imagenes: `La presentaci\xF3n tiene ${imagenes} ${imagenes === 1 ? "imagen" : "im\xE1genes"} que NO est\xE1n en este texto (capturas, gr\xE1ficos, diagramas). Si hacen falta, usa la tool office_leer_imagenes con la misma ruta.` } : {},
275126
275248
  ...siguiente ? { truncado: true, siguiente_diapositiva: siguiente, aviso: `Hay m\xE1s diapositivas: vuelve a llamar con desde_diapositiva=${siguiente}.` } : {}
275127
275249
  };
275128
275250
  } catch (error) {
@@ -275314,14 +275436,14 @@ var officeEscribirPptxTool = {
275314
275436
  import * as fs16 from "fs";
275315
275437
  import * as path15 from "path";
275316
275438
  var log19 = logger.child("office-editar-docx");
275317
- var unescapeXml2 = (s) => s.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&");
275439
+ var unescapeXml3 = (s) => s.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&");
275318
275440
  var escapeXml = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
275319
275441
  function reemplazarEnParrafo(parrafo, buscar, reemplazar, etiqueta = "w:t") {
275320
275442
  const re = new RegExp(`(<${etiqueta}(?:\\s[^>]*)?>)([^<]*)(<\\/${etiqueta}>)`, "g");
275321
275443
  const partes = [];
275322
275444
  let m;
275323
275445
  while (m = re.exec(parrafo)) {
275324
- partes.push({ start: m.index, end: m.index + m[0].length, open: m[1], text: unescapeXml2(m[2]) });
275446
+ partes.push({ start: m.index, end: m.index + m[0].length, open: m[1], text: unescapeXml3(m[2]) });
275325
275447
  }
275326
275448
  if (partes.length === 0)
275327
275449
  return { xml: parrafo, cuenta: 0 };
@@ -1,8 +1,8 @@
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-C0W6p0lk.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-C3n2xYF2.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
- `?(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
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-D0aDV8Y_.js";import{t as d}from"./ellipsis-vertical-BOW_iEOO.js";import{n as f,t as p}from"./slider-DR31eN3r.js";import{n as m,t as h}from"./eye-BVfTWOME.js";import{t as g}from"./info-BCD3-QX9.js";import{t as _}from"./lock-DpBean4K.js";import{t as v}from"./mail-Biwn8WrV.js";import{t as y}from"./pencil-BG8EFaS3.js";import{t as b}from"./plus-Bp8-V68t.js";import{t as x}from"./refresh-cw-D6F1zoC6.js";import{t as S}from"./search-CfNwwpMW.js";import{t as C}from"./send-CI868CBV.js";import{t as w}from"./settings-AEM2uWiD.js";import{t as T}from"./trash-2-BZsMCfso.js";import{n as E,t as D}from"./wifi-DNv53AfN.js";import{l as O}from"./vendor-router-DxU0Uf4R.js";import{B as k,G as A,H as ee,K as j,M as te,N as ne,Q as re,R as M,U as ie,V as ae,W as N,ht as oe,lt as P,nt as F,rt as se,z as I}from"./index-U0e4e5mL.js";import{t as ce}from"./badge-C6H33ePv.js";import{t as le}from"./scroll-area-CYMu7sU0.js";import{i as ue,n as L,r as R,t as z}from"./tabs-Ct92cLXr.js";import{c as B,i as V,r as H,s as U,t as de}from"./dialog-DO1fQCF7.js";var fe=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`}]]),pe=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`}]]),me=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`}]]),he=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`}]]),ge=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`}]]),_e=i(`LockOpen`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),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
+ `?(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))ae(t)?a[e]=j(t.path,r.dataModel,r.scopeData):k(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:w,home:he,search:S,mail:v,call:ye,camera:fe,calendarToday:s,star:Ce,check:c,close:re,delete:T,download:u,upload:we,edit:y,refresh:x,send:C,share:xe,shoppingCart:Se,warning:se,info:g,error:l,favorite:G,favoriteOff:G,folder:me,help:W,lock:_,lockOpen:_e,visibility:h,visibilityOff:m,add:b,arrowBack:a,arrowForward:o,accountCircle:F,notifications:oe,moreVert:d,moreHoriz:f,locationOn:ve,payment:pe,photo:ge,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
5
5
  ${p?`font-mono text-green-300 leading-relaxed`:`text-white/80 leading-relaxed`}
6
- ${g.valid?``:`border-red-500/50`}`,E;t[34]===n.weight?E=t[35]:(E=n.weight?{flex:n.weight}:void 0,t[34]=n.weight,t[35]=E);let D;t[36]===l?D=t[37]:(D=l&&(0,J.jsx)(`label`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:l}),t[36]=l,t[37]=D);let O;t[38]!==S||t[39]!==v||t[40]!==w||t[41]!==T||t[42]!==p||t[43]!==m||t[44]!==o||t[45]!==d||t[46]!==f?(O=m?(0,J.jsx)(`textarea`,{value:o,onChange:v,onBlur:S,onKeyDown:w,placeholder:d,rows:p?5:3,className:T}):(0,J.jsx)(`input`,{type:f===`obscured`?`password`:f===`number`?`number`:`text`,value:o,onChange:v,onBlur:S,onKeyDown:w,placeholder:d,className:T}),t[38]=S,t[39]=v,t[40]=w,t[41]=T,t[42]=p,t[43]=m,t[44]=o,t[45]=d,t[46]=f,t[47]=O):O=t[47];let k;t[48]!==g.errors||t[49]!==g.valid?(k=!g.valid&&g.errors.length>0&&(0,J.jsx)(`p`,{className:`text-xs text-red-400`,children:g.errors[0].message}),t[48]=g.errors,t[49]=g.valid,t[50]=k):k=t[50];let A;return t[51]!==E||t[52]!==D||t[53]!==O||t[54]!==k?(A=(0,J.jsxs)(`div`,{className:`space-y-1.5`,style:E,children:[D,O,k]}),t[51]=E,t[52]=D,t[53]=O,t[54]=k,t[55]=A):A=t[55],A}function Ue(e){let t=(0,q.c)(22),{def:n,ctx:r}=e,i;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.label?(i=N(n.label,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.label,t[3]=i):i=t[3];let a=i,o=n.value,s;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==o?(s=te(o,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=o,t[7]=s):s=t[7];let[c,l]=(0,K.useState)(s),u;t[8]!==r||t[9]!==n.value?(u=e=>{if(l(e.target.checked),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.checked,r})}},t[8]=r,t[9]=n.value,t[10]=u):u=t[10];let d=u,f;t[11]===n.weight?f=t[12]:(f=n.weight?{flex:n.weight}:void 0,t[11]=n.weight,t[12]=f);let p;t[13]!==d||t[14]!==c?(p=(0,J.jsx)(`input`,{type:`checkbox`,checked:c,onChange:d,className:`w-4 h-4 rounded border-white/20 bg-white/5 text-blue-500 focus:ring-blue-500/30`}),t[13]=d,t[14]=c,t[15]=p):p=t[15];let m;t[16]===a?m=t[17]:(m=(0,J.jsx)(`span`,{className:`text-sm text-white/70`,children:a}),t[16]=a,t[17]=m);let h;return t[18]!==f||t[19]!==p||t[20]!==m?(h=(0,J.jsxs)(`label`,{className:`flex items-center gap-2.5 cursor-pointer`,style:f,children:[p,m]}),t[18]=f,t[19]=p,t[20]=m,t[21]=h):h=t[21],h}function Z(e){let t=(0,q.c)(30),{def:n,ctx:r}=e,i=n.variant===`mutuallyExclusive`?`single`:`multi`,a=n.maxAllowedSelections??(i===`single`?1:5),o=n.selections??n.value,s;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==o?(s=ee(o,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=o,t[3]=s):s=t[3];let[c,l]=(0,K.useState)(s),u;t[4]===n.options?u=t[5]:(u=n.options??[],t[4]=n.options,t[5]=u);let d=u,f;t[6]!==r||t[7]!==n.action||t[8]!==n.id||t[9]!==n.selections||t[10]!==n.value||t[11]!==a||t[12]!==i?(f=e=>{l(t=>{let o;o=i===`single`?[e]:t.includes(e)?t.filter(t=>t!==e):t.length>=a?t:[...t,e];let s=n.selections??n.value;if(typeof s==`object`&&s&&`path`in s){let e=s.path;r.setDataModel(t=>{let n=structuredClone(t),r=e.replace(/^\//,``).split(`/`),i=n;for(let e=0;e<r.length-1;e++)i[r[e]]??(i[r[e]]={}),i=i[r[e]];return i[r[r.length-1]]=o,n})}let c=n.action,l=(c?.event??c)?.name;return l&&r.onAction(l,{selections:o,selected:o[0]??null},n.id),o})},t[6]=r,t[7]=n.action,t[8]=n.id,t[9]=n.selections,t[10]=n.value,t[11]=a,t[12]=i,t[13]=f):f=t[13];let p=f,m;t[14]===n.weight?m=t[15]:(m=n.weight?{flex:n.weight}:void 0,t[14]=n.weight,t[15]=m);let h;if(t[16]!==r.dataModel||t[17]!==r.scopeData||t[18]!==c||t[19]!==d||t[20]!==p){let e;t[22]!==r.dataModel||t[23]!==r.scopeData||t[24]!==c||t[25]!==p?(e=(e,t)=>{let n=N(e.label,r.dataModel,r.scopeData),i=e.value??n,a=c.includes(i),o=String.fromCharCode(65+t);return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>p(i),className:`w-full text-left px-3 py-2.5 rounded-xl border text-sm transition-all flex items-center gap-2.5
6
+ ${g.valid?``:`border-red-500/50`}`,E;t[34]===n.weight?E=t[35]:(E=n.weight?{flex:n.weight}:void 0,t[34]=n.weight,t[35]=E);let D;t[36]===l?D=t[37]:(D=l&&(0,J.jsx)(`label`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:l}),t[36]=l,t[37]=D);let O;t[38]!==S||t[39]!==v||t[40]!==w||t[41]!==T||t[42]!==p||t[43]!==m||t[44]!==o||t[45]!==d||t[46]!==f?(O=m?(0,J.jsx)(`textarea`,{value:o,onChange:v,onBlur:S,onKeyDown:w,placeholder:d,rows:p?5:3,className:T}):(0,J.jsx)(`input`,{type:f===`obscured`?`password`:f===`number`?`number`:`text`,value:o,onChange:v,onBlur:S,onKeyDown:w,placeholder:d,className:T}),t[38]=S,t[39]=v,t[40]=w,t[41]=T,t[42]=p,t[43]=m,t[44]=o,t[45]=d,t[46]=f,t[47]=O):O=t[47];let k;t[48]!==g.errors||t[49]!==g.valid?(k=!g.valid&&g.errors.length>0&&(0,J.jsx)(`p`,{className:`text-xs text-red-400`,children:g.errors[0].message}),t[48]=g.errors,t[49]=g.valid,t[50]=k):k=t[50];let A;return t[51]!==E||t[52]!==D||t[53]!==O||t[54]!==k?(A=(0,J.jsxs)(`div`,{className:`space-y-1.5`,style:E,children:[D,O,k]}),t[51]=E,t[52]=D,t[53]=O,t[54]=k,t[55]=A):A=t[55],A}function Ue(e){let t=(0,q.c)(22),{def:n,ctx:r}=e,i;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.label?(i=N(n.label,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.label,t[3]=i):i=t[3];let a=i,o=n.value,s;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==o?(s=ee(o,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=o,t[7]=s):s=t[7];let[c,l]=(0,K.useState)(s),u;t[8]!==r||t[9]!==n.value?(u=e=>{if(l(e.target.checked),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.checked,r})}},t[8]=r,t[9]=n.value,t[10]=u):u=t[10];let d=u,f;t[11]===n.weight?f=t[12]:(f=n.weight?{flex:n.weight}:void 0,t[11]=n.weight,t[12]=f);let p;t[13]!==d||t[14]!==c?(p=(0,J.jsx)(`input`,{type:`checkbox`,checked:c,onChange:d,className:`w-4 h-4 rounded border-white/20 bg-white/5 text-blue-500 focus:ring-blue-500/30`}),t[13]=d,t[14]=c,t[15]=p):p=t[15];let m;t[16]===a?m=t[17]:(m=(0,J.jsx)(`span`,{className:`text-sm text-white/70`,children:a}),t[16]=a,t[17]=m);let h;return t[18]!==f||t[19]!==p||t[20]!==m?(h=(0,J.jsxs)(`label`,{className:`flex items-center gap-2.5 cursor-pointer`,style:f,children:[p,m]}),t[18]=f,t[19]=p,t[20]=m,t[21]=h):h=t[21],h}function Z(e){let t=(0,q.c)(30),{def:n,ctx:r}=e,i=n.variant===`mutuallyExclusive`?`single`:`multi`,a=n.maxAllowedSelections??(i===`single`?1:5),o=n.selections??n.value,s;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==o?(s=A(o,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=o,t[3]=s):s=t[3];let[c,l]=(0,K.useState)(s),u;t[4]===n.options?u=t[5]:(u=n.options??[],t[4]=n.options,t[5]=u);let d=u,f;t[6]!==r||t[7]!==n.action||t[8]!==n.id||t[9]!==n.selections||t[10]!==n.value||t[11]!==a||t[12]!==i?(f=e=>{l(t=>{let o;o=i===`single`?[e]:t.includes(e)?t.filter(t=>t!==e):t.length>=a?t:[...t,e];let s=n.selections??n.value;if(typeof s==`object`&&s&&`path`in s){let e=s.path;r.setDataModel(t=>{let n=structuredClone(t),r=e.replace(/^\//,``).split(`/`),i=n;for(let e=0;e<r.length-1;e++)i[r[e]]??(i[r[e]]={}),i=i[r[e]];return i[r[r.length-1]]=o,n})}let c=n.action,l=(c?.event??c)?.name;return l&&r.onAction(l,{selections:o,selected:o[0]??null},n.id),o})},t[6]=r,t[7]=n.action,t[8]=n.id,t[9]=n.selections,t[10]=n.value,t[11]=a,t[12]=i,t[13]=f):f=t[13];let p=f,m;t[14]===n.weight?m=t[15]:(m=n.weight?{flex:n.weight}:void 0,t[14]=n.weight,t[15]=m);let h;if(t[16]!==r.dataModel||t[17]!==r.scopeData||t[18]!==c||t[19]!==d||t[20]!==p){let e;t[22]!==r.dataModel||t[23]!==r.scopeData||t[24]!==c||t[25]!==p?(e=(e,t)=>{let n=N(e.label,r.dataModel,r.scopeData),i=e.value??n,a=c.includes(i),o=String.fromCharCode(65+t);return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>p(i),className:`w-full text-left px-3 py-2.5 rounded-xl border text-sm transition-all flex items-center gap-2.5
7
7
  ${a?`bg-blue-500/15 border-blue-500/50 text-blue-100`:`bg-white/[0.03] border-white/[0.08] text-white/65 hover:border-white/20 hover:bg-white/[0.06]`}`,children:[(0,J.jsx)(`span`,{className:`text-xs font-bold w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 transition-colors
8
- ${a?`bg-blue-500/40 text-blue-200`:`bg-white/5 text-white/40`}`,children:a?`✓`:o}),(0,J.jsx)(`span`,{className:`leading-snug`,children:n})]},t)},t[22]=r.dataModel,t[23]=r.scopeData,t[24]=c,t[25]=p,t[26]=e):e=t[26],h=d.map(e),t[16]=r.dataModel,t[17]=r.scopeData,t[18]=c,t[19]=d,t[20]=p,t[21]=h}else h=t[21];let g;return t[27]!==m||t[28]!==h?(g=(0,J.jsx)(`div`,{className:`space-y-2`,style:m,children:h}),t[27]=m,t[28]=h,t[29]=g):g=t[29],g}function We(e){let t=(0,q.c)(39),{def:n,ctx:r}=e,i=typeof n.min==`number`?n.min:n.minValue??0,a=typeof n.max==`number`?n.max:n.maxValue??100,o=typeof n.step==`number`?n.step:1,s=n.label,c=n.value,l;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==c?(l=ae(c,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=c,t[3]=l):l=t[3];let[u,d]=(0,K.useState)(l),f;if(t[4]!==r||t[5]!==n.value){let e=e=>{if(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,r})}};f=t=>{d(t[0]),e(t[0])},t[4]=r,t[5]=n.value,t[6]=f}else f=t[6];let m=f,h;t[7]!==r||t[8]!==n.action||t[9]!==n.id?(h=e=>{let t=e[0],i=n.action,a=(i?.event??i)?.name;a&&r.onAction(a,{value:t},n.id)},t[7]=r,t[8]=n.action,t[9]=n.id,t[10]=h):h=t[10];let g=h,_;t[11]===n.weight?_=t[12]:(_=n.weight?{flex:n.weight}:void 0,t[11]=n.weight,t[12]=_);let v;t[13]===s?v=t[14]:(v=s&&(0,J.jsx)(`span`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:s}),t[13]=s,t[14]=v);let y;t[15]===i?y=t[16]:(y=(0,J.jsx)(`span`,{children:i}),t[15]=i,t[16]=y);let b;t[17]===u?b=t[18]:(b=(0,J.jsx)(`span`,{className:`text-white/70 font-mono`,children:u}),t[17]=u,t[18]=b);let x;t[19]===a?x=t[20]:(x=(0,J.jsx)(`span`,{children:a}),t[19]=a,t[20]=x);let S;t[21]!==y||t[22]!==b||t[23]!==x?(S=(0,J.jsxs)(`div`,{className:`flex justify-between text-xs text-white/40`,children:[y,b,x]}),t[21]=y,t[22]=b,t[23]=x,t[24]=S):S=t[24];let C;t[25]===u?C=t[26]:(C=[u],t[25]=u,t[26]=C);let w;t[27]!==m||t[28]!==g||t[29]!==a||t[30]!==i||t[31]!==o||t[32]!==C?(w=(0,J.jsx)(p,{value:C,min:i,max:a,step:o,onValueChange:m,onValueCommit:g,className:`w-full`}),t[27]=m,t[28]=g,t[29]=a,t[30]=i,t[31]=o,t[32]=C,t[33]=w):w=t[33];let T;return t[34]!==S||t[35]!==w||t[36]!==_||t[37]!==v?(T=(0,J.jsxs)(`div`,{className:`space-y-2`,style:_,children:[v,S,w]}),t[34]=S,t[35]=w,t[36]=_,t[37]=v,t[38]=T):T=t[38],T}function Ge(e){let t=(0,q.c)(15),{def:n,ctx:r}=e,[i,a]=(0,K.useState)(``),o;t[0]!==r||t[1]!==n.value?(o=e=>{if(a(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[0]=r,t[1]=n.value,t[2]=o):o=t[2];let s=o,c=n.enableTime&&n.enableDate?`datetime-local`:n.enableDate?`date`:`time`,l;t[3]===n.weight?l=t[4]:(l=n.weight?{flex:n.weight}:void 0,t[3]=n.weight,t[4]=l);let u;t[5]===n.label?u=t[6]:(u=n.label&&(0,J.jsx)(`label`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:typeof n.label==`string`?n.label:String(n.label)}),t[5]=n.label,t[6]=u);let d;t[7]!==s||t[8]!==c||t[9]!==i?(d=(0,J.jsx)(`input`,{type:c,value:i,onChange:s,className:`w-full rounded-xl border px-3 py-2.5 text-sm bg-white/[0.04] border-white/[0.08] focus:border-blue-500/50 focus:bg-white/[0.06] outline-none text-white/80`}),t[7]=s,t[8]=c,t[9]=i,t[10]=d):d=t[10];let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,J.jsxs)(`div`,{className:`space-y-1.5`,style:l,children:[u,d]}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function Ke(e){let t=(0,q.c)(25),{def:n,ctx:r}=e,i;t[0]!==n.tabItems||t[1]!==n.tabs?(i=Array.isArray(n.tabs)?n.tabs:n.tabItems??[],t[0]=n.tabItems,t[1]=n.tabs,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==a[0]?(o=a[0]?.title?N(a[0].title,r.dataModel,r.scopeData):``,t[3]=r,t[4]=a[0],t[5]=o):o=t[5];let s=o,c;t[6]===n.weight?c=t[7]:(c=n.weight?{flex:n.weight}:void 0,t[6]=n.weight,t[7]=c);let l;if(t[8]!==r||t[9]!==a){let e;t[11]===r?e=t[12]:(e=(e,t)=>(0,J.jsx)(L,{value:N(e.title,r.dataModel,r.scopeData),children:N(e.title,r.dataModel,r.scopeData)},t),t[11]=r,t[12]=e),l=a.map(e),t[8]=r,t[9]=a,t[10]=l}else l=t[10];let u;t[13]===l?u=t[14]:(u=(0,J.jsx)(z,{className:`w-full`,children:l}),t[13]=l,t[14]=u);let d;if(t[15]!==r||t[16]!==a){let e;t[18]===r?e=t[19]:(e=(e,t)=>(0,J.jsx)(R,{value:N(e.title,r.dataModel,r.scopeData),children:(0,J.jsx)(Q,{...r,id:e.child})},t),t[18]=r,t[19]=e),d=a.map(e),t[15]=r,t[16]=a,t[17]=d}else d=t[17];let f;return t[20]!==s||t[21]!==c||t[22]!==u||t[23]!==d?(f=(0,J.jsxs)(B,{defaultValue:s,style:c,children:[u,d]}),t[20]=s,t[21]=c,t[22]=u,t[23]=d,t[24]=f):f=t[24],f}function qe(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,[i,a]=(0,K.useState)(!1),o;t[0]!==r||t[1]!==n.entryPointChild||t[2]!==n.trigger?(o=(n.trigger??n.entryPointChild)&&(0,J.jsx)(V,{asChild:!0,children:(0,J.jsx)(`div`,{className:`cursor-pointer`,children:(0,J.jsx)(Q,{...r,id:n.trigger??n.entryPointChild})})}),t[0]=r,t[1]=n.entryPointChild,t[2]=n.trigger,t[3]=o):o=t[3];let s,c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(de,{className:`sr-only`,children:`Interactive modal`}),c=(0,J.jsx)(H,{className:`sr-only`,children:`Interactive modal content generated by the agent.`}),t[4]=s,t[5]=c):(s=t[4],c=t[5]);let l;t[6]!==r||t[7]!==n.content||t[8]!==n.contentChild?(l=(n.content??n.contentChild)&&(0,J.jsx)(Q,{...r,id:n.content??n.contentChild}),t[6]=r,t[7]=n.content,t[8]=n.contentChild,t[9]=l):l=t[9];let u;t[10]===l?u=t[11]:(u=(0,J.jsxs)(U,{children:[s,c,l]}),t[10]=l,t[11]=u);let d;return t[12]!==i||t[13]!==o||t[14]!==u?(d=(0,J.jsxs)(fe,{open:i,onOpenChange:a,children:[o,u]}),t[12]=i,t[13]=o,t[14]=u,t[15]=d):d=t[15],d}function Je(e){let t=(0,q.c)(11),{def:n,ctx:r}=e,i=n.url,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=a;if(!o)return null;let s;t[4]===n.weight?s=t[5]:(s=n.weight?{flex:n.weight}:void 0,t[4]=n.weight,t[5]=s);let c;t[6]===o?c=t[7]:(c=(0,J.jsx)(`video`,{src:o,controls:!0,className:`w-full max-h-96`,children:`Tu navegador no soporta video.`}),t[6]=o,t[7]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsx)(`div`,{className:`rounded-xl overflow-hidden border border-white/[0.08]`,style:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Ye(e){let t=(0,q.c)(19),{def:n,ctx:r}=e,i=n.url,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=a,s=n.description,c;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==s?(c=N(s,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=s,t[7]=c):c=t[7];let l=c;if(!o)return null;let u;t[8]===n.weight?u=t[9]:(u=n.weight?{flex:n.weight}:void 0,t[8]=n.weight,t[9]=u);let d;t[10]===l?d=t[11]:(d=l&&(0,J.jsx)(`p`,{className:`text-xs text-white/40 mb-2`,children:l}),t[10]=l,t[11]=d);let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f={height:40},t[12]=f):f=t[12];let p;t[13]===o?p=t[14]:(p=(0,J.jsx)(`audio`,{src:o,controls:!0,className:`w-full`,style:f,children:`Tu navegador no soporta audio.`}),t[13]=o,t[14]=p);let m;return t[15]!==u||t[16]!==d||t[17]!==p?(m=(0,J.jsxs)(`div`,{className:`rounded-xl border border-white/[0.08] p-4 bg-white/[0.02]`,style:u,children:[d,p]}),t[15]=u,t[16]=d,t[17]=p,t[18]=m):m=t[18],m}function Xe(e){let t=(0,q.c)(22),{surface:n,onAction:r,isLoading:i}=e,{components:a,dataModel:o,rootId:s,theme:c}=n,l;t[0]===o?l=t[1]:(l=()=>structuredClone(o),t[0]=o,t[1]=l);let[u,d]=(0,K.useState)(l),f,p;t[2]===o?(f=t[3],p=t[4]):(f=()=>{d(structuredClone(o))},p=[o],t[2]=o,t[3]=f,t[4]=p),(0,K.useEffect)(f,p);let m;if(t[5]!==a){m=new Map;for(let e of a)m.set(e.id,e);t[5]=a,t[6]=m}else m=t[6];let h=m,g=c?.primaryColor||`#3B82F6`,_;t[7]!==r||t[8]!==n.surfaceId?(_=(e,t,i)=>{r&&r({name:e,surfaceId:n.surfaceId,sourceComponentId:i,timestamp:new Date().toISOString(),context:t})},t[7]=r,t[8]=n.surfaceId,t[9]=_):_=t[9];let v=_;if(i){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,J.jsx)(`span`,{className:`text-white/30 text-sm animate-pulse`,children:`Cargando superficie...`})}),t[10]=e):e=t[10],e}if(!s||!h.has(s)){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`flex items-center justify-center py-8 text-white/20 text-sm`,children:`Sin contenido disponible`}),t[11]=e):e=t[11],e}let y;t[12]===g?y=t[13]:(y={"--a2ui-primary":g},t[12]=g,t[13]=y);let b=y,x;t[14]!==h||t[15]!==v||t[16]!==u||t[17]!==s?(x=(0,J.jsx)(Q,{id:s,compMap:h,dataModel:u,setDataModel:d,scopeData:void 0,onAction:v}),t[14]=h,t[15]=v,t[16]=u,t[17]=s,t[18]=x):x=t[18];let S;return t[19]!==b||t[20]!==x?(S=(0,J.jsx)(`div`,{className:`a2ui-surface`,style:b,children:x}),t[19]=b,t[20]=x,t[21]=S):S=t[21],S}var Ze=48;function Q(e){let t=(0,q.c)(71),n=e.compMap,r,i,a,o;if(t[0]!==e){o=Symbol.for(`react.early_return_sentinel`);bb0:{if(i=n.get(e.id),!i){o=null;break bb0}let s;t[5]===e.ancestors?s=t[6]:(s=e.ancestors??[],t[5]=e.ancestors,t[6]=s);let c=s;if(c.includes(e.id)||c.length>=Ze){let n;t[7]===e.id?n=t[8]:(n=(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-amber-400/30 px-3 py-2 text-xs text-amber-300/70`,children:[`Componente "`,e.id,`" omitido: se contiene a sí mismo`]}),t[7]=e.id,t[8]=n),o=n;break bb0}let l;t[9]!==c||t[10]!==e.id?(l=[...c,e.id],t[9]=c,t[10]=e.id,t[11]=l):l=t[11];let u;t[12]!==e||t[13]!==l?(u={...e,ancestors:l},t[12]=e,t[13]=l,t[14]=u):u=t[14],r=u,a=i.component?.replace(/[^\x00-\x7F]/g,``).trim()}t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s=a;switch(s){case`Text`:{let e;return t[15]!==r||t[16]!==i?(e=(0,J.jsx)(Te,{def:i,ctx:r}),t[15]=r,t[16]=i,t[17]=e):e=t[17],e}case`Button`:{let e;return t[18]!==r||t[19]!==i?(e=(0,J.jsx)(ke,{def:i,ctx:r}),t[18]=r,t[19]=i,t[20]=e):e=t[20],e}case`Row`:{let e;return t[21]!==r||t[22]!==i?(e=(0,J.jsx)(je,{def:i,ctx:r}),t[21]=r,t[22]=i,t[23]=e):e=t[23],e}case`Column`:{let e;return t[24]!==r||t[25]!==i?(e=(0,J.jsx)(Ne,{def:i,ctx:r}),t[24]=r,t[25]=i,t[26]=e):e=t[26],e}case`Card`:{let e;return t[27]!==r||t[28]!==i?(e=(0,J.jsx)(Pe,{def:i,ctx:r}),t[27]=r,t[28]=i,t[29]=e):e=t[29],e}case`List`:{let e;return t[30]!==r||t[31]!==i?(e=(0,J.jsx)(Fe,{def:i,ctx:r}),t[30]=r,t[31]=i,t[32]=e):e=t[32],e}case`Divider`:{let e;return t[33]!==r||t[34]!==i?(e=(0,J.jsx)(Ie,{def:i,ctx:r}),t[33]=r,t[34]=i,t[35]=e):e=t[35],e}case`Image`:{let e;return t[36]!==r||t[37]!==i?(e=(0,J.jsx)(ze,{def:i,ctx:r}),t[36]=r,t[37]=i,t[38]=e):e=t[38],e}case`Icon`:{let e;return t[39]!==r||t[40]!==i?(e=(0,J.jsx)(Ve,{def:i,ctx:r}),t[39]=r,t[40]=i,t[41]=e):e=t[41],e}case`TextField`:{let e;return t[42]!==r||t[43]!==i?(e=(0,J.jsx)(He,{def:i,ctx:r}),t[42]=r,t[43]=i,t[44]=e):e=t[44],e}case`CheckBox`:{let e;return t[45]!==r||t[46]!==i?(e=(0,J.jsx)(Ue,{def:i,ctx:r}),t[45]=r,t[46]=i,t[47]=e):e=t[47],e}case`ChoicePicker`:{let e;return t[48]!==r||t[49]!==i?(e=(0,J.jsx)(Z,{def:i,ctx:r}),t[48]=r,t[49]=i,t[50]=e):e=t[50],e}case`Slider`:{let e;return t[51]!==r||t[52]!==i?(e=(0,J.jsx)(We,{def:i,ctx:r}),t[51]=r,t[52]=i,t[53]=e):e=t[53],e}case`DateTimeInput`:{let e;return t[54]!==r||t[55]!==i?(e=(0,J.jsx)(Ge,{def:i,ctx:r}),t[54]=r,t[55]=i,t[56]=e):e=t[56],e}case`Tabs`:{let e;return t[57]!==r||t[58]!==i?(e=(0,J.jsx)(Ke,{def:i,ctx:r}),t[57]=r,t[58]=i,t[59]=e):e=t[59],e}case`Modal`:{let e;return t[60]!==r||t[61]!==i?(e=(0,J.jsx)(qe,{def:i,ctx:r}),t[60]=r,t[61]=i,t[62]=e):e=t[62],e}case`Video`:{let e;return t[63]!==r||t[64]!==i?(e=(0,J.jsx)(Je,{def:i,ctx:r}),t[63]=r,t[64]=i,t[65]=e):e=t[65],e}case`AudioPlayer`:{let e;return t[66]!==r||t[67]!==i?(e=(0,J.jsx)(Ye,{def:i,ctx:r}),t[66]=r,t[67]=i,t[68]=e):e=t[68],e}default:{let e;return t[69]===s?e=t[70]:(e=(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-white/10 px-3 py-2 text-xs text-white/30`,children:[`Unknown component: `,s]}),t[69]=s,t[70]=e),e}}}function $(e,t){if(!e)return[];if(typeof e==`string`)return[(0,J.jsx)(Q,{...t,id:e},e)];if(Array.isArray(e))return e.map(e=>(0,J.jsx)(Q,{...t,id:e},e));if(`explicitList`in e||`array`in e)return(`explicitList`in e?e.explicitList:e.array).map(e=>(0,J.jsx)(Q,{...t,id:e},e));if(`path`in e&&`componentId`in e){let n=e,r=j(n.path,t.dataModel,t.scopeData);return Array.isArray(r)?r.map((e,r)=>{let i=typeof e==`object`&&e?e:{value:e,index:r};return(0,J.jsx)(Q,{...t,id:n.componentId,scopeData:i},`${n.componentId}_${r}`)}):[]}if(`template`in e){let n=e.template,r=j(n.dataBinding,t.dataModel,t.scopeData);return Array.isArray(r)?r.map((e,r)=>{let i=typeof e==`object`&&e?e:{value:e,index:r};return(0,J.jsx)(Q,{...t,id:n.componentId,scopeData:i},`${n.componentId}_${r}`)}):[]}return[]}function Qe(){let e=M(e=>e.a2uiSurfaces),t=M(e=>e.sendA2UIAction),n=M(e=>e.deleteA2UISurface),[r,i]=(0,K.useState)(null),a=(0,K.useCallback)(e=>{t(e)},[t]),o=async e=>{i(e);try{await re(`/api/a2ui/surfaces/${encodeURIComponent(e)}`,{method:`DELETE`,showError:!0}),n(e)}catch{}finally{i(null)}},s=Array.from(e.values());return(0,J.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,style:{backgroundImage:`radial-gradient(circle, rgba(59,130,246,0.03) 1px, transparent 1px)`,backgroundSize:`40px 40px`},children:[s.length===0?(0,J.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-white/20`,children:[(0,J.jsx)(P,{className:`h-10 w-10 opacity-30`}),(0,J.jsx)(`p`,{className:`text-sm`,children:`Sin paneles interactivos activos`}),(0,J.jsx)(`p`,{className:`text-xs text-white/15`,children:`Los resultados y formularios creados por los agentes aparecerán aquí.`})]}):(0,J.jsx)(ue,{className:`flex-1 p-6`,children:s.length>0&&(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:s.map(e=>(0,J.jsxs)(`div`,{className:`rounded-xl border border-blue-500/20 bg-[rgba(255,255,255,0.02)] backdrop-blur-sm p-4`,style:e.theme?.primaryColor?{borderColor:`${e.theme.primaryColor}33`}:void 0,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3 pb-3 border-b border-white/5`,children:[e.theme?.agentDisplayName?(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.theme.iconUrl&&(0,J.jsx)(`img`,{src:e.theme.iconUrl,alt:``,className:`w-5 h-5 rounded-full`}),(0,J.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,style:{color:e.theme.primaryColor??`#93c5fd`},children:e.theme.agentDisplayName})]}):(0,J.jsx)(`span`,{className:`font-mono text-[10px] text-white/40`,children:e.surfaceId}),(0,J.jsx)(`button`,{type:`button`,title:`Eliminar superficie ${e.surfaceId}`,"aria-label":`Eliminar superficie ${e.surfaceId}`,disabled:r===e.surfaceId,onClick:()=>o(e.surfaceId),className:`rounded-md p-1.5 text-white/25 transition hover:bg-red-500/10 hover:text-red-300 disabled:opacity-40`,children:(0,J.jsx)(E,{className:`h-3.5 w-3.5`})})]}),(0,J.jsx)(Xe,{surface:e,onAction:a})]},e.surfaceId))})}),(0,J.jsx)(`div`,{className:`border-t border-white/5 bg-white/[0.02] px-6 py-2.5`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(P,{className:`h-3 w-3 text-blue-400/50`}),(0,J.jsx)(`span`,{className:`hive-mono`,children:s.length>0?`${s.length} superficie${s.length>1?`s`:``} A2UI activa${s.length>1?`s`:``}`:`Panel interactivo · sin superficies`})]})})]})}function $e(){let e=(0,q.c)(20),{sessionId:t}=k(),{currentUser:n}=ne(),r=M(tt),i=M(et),a=t&&t!==`default`?t:n?.id,o,s;if(e[0]===i?(o=e[1],s=e[2]):(o=()=>{i()},s=[i],e[0]=i,e[1]=o,e[2]=s),(0,K.useEffect)(o,s),!a){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] items-center justify-center`,children:(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent`}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Cargando sesión...`})]})}),e[3]=t):t=e[3],t}let c,l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:(0,J.jsx)(P,{className:`h-5 w-5`})}),l=(0,J.jsx)(`h2`,{className:`hive-title-page !text-lg`,children:`Panel interactivo`}),e[4]=c,e[5]=l):(c=e[4],l=e[5]);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(F,{className:`h-3 w-3`}),e[6]=u):u=e[6];let d;e[7]===a?d=e[8]:(d=(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[c,(0,J.jsxs)(`div`,{children:[l,(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-white/40 mt-0.5`,children:[u,(0,J.jsx)(`span`,{className:`font-mono`,children:a})]})]})]}),e[7]=a,e[8]=d);let f=`flex items-center gap-1.5 px-3 py-1 transition-all duration-500 border ${r?`bg-emerald-500/15 text-emerald-500 border-emerald-500/20 hover:bg-emerald-500/20`:`bg-red-500/15 text-red-500 border-red-500/20 hover:bg-red-500/20`}`,p;e[9]===r?p=e[10]:(p=r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(O,{className:`h-3.5 w-3.5 animate-pulse`}),(0,J.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Live`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(D,{className:`h-3.5 w-3.5`}),(0,J.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Offline`})]}),e[9]=r,e[10]=p);let m;e[11]!==f||e[12]!==p?(m=(0,J.jsx)(le,{variant:`outline`,className:f,children:p}),e[11]=f,e[12]=p,e[13]=m):m=e[13];let h;e[14]!==d||e[15]!==m?(h=(0,J.jsxs)(`div`,{className:`flex flex-row items-center justify-between space-y-0 border-b border-white/5 bg-white/5 px-6 py-4`,children:[d,m]}),e[14]=d,e[15]=m,e[16]=h):h=e[16];let g;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(Qe,{}),e[17]=g):g=e[17];let _;return e[18]===h?_=e[19]:(_=(0,J.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] flex-col bg-background/50 backdrop-blur-sm`,children:(0,J.jsx)(`div`,{className:`flex-1 overflow-hidden p-4 lg:p-8`,children:(0,J.jsx)(`div`,{className:`mx-auto h-full max-w-7xl`,children:(0,J.jsxs)(`div`,{className:`hive-card flex h-full flex-col shadow-2xl`,children:[h,g]})})})}),e[18]=h,e[19]=_),_}function et(e){return e.markA2UISeen}function tt(e){return e.isConnected}export{$e as A2UIPage};
8
+ ${a?`bg-blue-500/40 text-blue-200`:`bg-white/5 text-white/40`}`,children:a?`✓`:o}),(0,J.jsx)(`span`,{className:`leading-snug`,children:n})]},t)},t[22]=r.dataModel,t[23]=r.scopeData,t[24]=c,t[25]=p,t[26]=e):e=t[26],h=d.map(e),t[16]=r.dataModel,t[17]=r.scopeData,t[18]=c,t[19]=d,t[20]=p,t[21]=h}else h=t[21];let g;return t[27]!==m||t[28]!==h?(g=(0,J.jsx)(`div`,{className:`space-y-2`,style:m,children:h}),t[27]=m,t[28]=h,t[29]=g):g=t[29],g}function We(e){let t=(0,q.c)(39),{def:n,ctx:r}=e,i=typeof n.min==`number`?n.min:n.minValue??0,a=typeof n.max==`number`?n.max:n.maxValue??100,o=typeof n.step==`number`?n.step:1,s=n.label,c=n.value,l;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==c?(l=ie(c,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=c,t[3]=l):l=t[3];let[u,d]=(0,K.useState)(l),f;if(t[4]!==r||t[5]!==n.value){let e=e=>{if(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,r})}};f=t=>{d(t[0]),e(t[0])},t[4]=r,t[5]=n.value,t[6]=f}else f=t[6];let m=f,h;t[7]!==r||t[8]!==n.action||t[9]!==n.id?(h=e=>{let t=e[0],i=n.action,a=(i?.event??i)?.name;a&&r.onAction(a,{value:t},n.id)},t[7]=r,t[8]=n.action,t[9]=n.id,t[10]=h):h=t[10];let g=h,_;t[11]===n.weight?_=t[12]:(_=n.weight?{flex:n.weight}:void 0,t[11]=n.weight,t[12]=_);let v;t[13]===s?v=t[14]:(v=s&&(0,J.jsx)(`span`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:s}),t[13]=s,t[14]=v);let y;t[15]===i?y=t[16]:(y=(0,J.jsx)(`span`,{children:i}),t[15]=i,t[16]=y);let b;t[17]===u?b=t[18]:(b=(0,J.jsx)(`span`,{className:`text-white/70 font-mono`,children:u}),t[17]=u,t[18]=b);let x;t[19]===a?x=t[20]:(x=(0,J.jsx)(`span`,{children:a}),t[19]=a,t[20]=x);let S;t[21]!==y||t[22]!==b||t[23]!==x?(S=(0,J.jsxs)(`div`,{className:`flex justify-between text-xs text-white/40`,children:[y,b,x]}),t[21]=y,t[22]=b,t[23]=x,t[24]=S):S=t[24];let C;t[25]===u?C=t[26]:(C=[u],t[25]=u,t[26]=C);let w;t[27]!==m||t[28]!==g||t[29]!==a||t[30]!==i||t[31]!==o||t[32]!==C?(w=(0,J.jsx)(p,{value:C,min:i,max:a,step:o,onValueChange:m,onValueCommit:g,className:`w-full`}),t[27]=m,t[28]=g,t[29]=a,t[30]=i,t[31]=o,t[32]=C,t[33]=w):w=t[33];let T;return t[34]!==S||t[35]!==w||t[36]!==_||t[37]!==v?(T=(0,J.jsxs)(`div`,{className:`space-y-2`,style:_,children:[v,S,w]}),t[34]=S,t[35]=w,t[36]=_,t[37]=v,t[38]=T):T=t[38],T}function Ge(e){let t=(0,q.c)(15),{def:n,ctx:r}=e,[i,a]=(0,K.useState)(``),o;t[0]!==r||t[1]!==n.value?(o=e=>{if(a(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[0]=r,t[1]=n.value,t[2]=o):o=t[2];let s=o,c=n.enableTime&&n.enableDate?`datetime-local`:n.enableDate?`date`:`time`,l;t[3]===n.weight?l=t[4]:(l=n.weight?{flex:n.weight}:void 0,t[3]=n.weight,t[4]=l);let u;t[5]===n.label?u=t[6]:(u=n.label&&(0,J.jsx)(`label`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:typeof n.label==`string`?n.label:String(n.label)}),t[5]=n.label,t[6]=u);let d;t[7]!==s||t[8]!==c||t[9]!==i?(d=(0,J.jsx)(`input`,{type:c,value:i,onChange:s,className:`w-full rounded-xl border px-3 py-2.5 text-sm bg-white/[0.04] border-white/[0.08] focus:border-blue-500/50 focus:bg-white/[0.06] outline-none text-white/80`}),t[7]=s,t[8]=c,t[9]=i,t[10]=d):d=t[10];let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,J.jsxs)(`div`,{className:`space-y-1.5`,style:l,children:[u,d]}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function Ke(e){let t=(0,q.c)(25),{def:n,ctx:r}=e,i;t[0]!==n.tabItems||t[1]!==n.tabs?(i=Array.isArray(n.tabs)?n.tabs:n.tabItems??[],t[0]=n.tabItems,t[1]=n.tabs,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==a[0]?(o=a[0]?.title?N(a[0].title,r.dataModel,r.scopeData):``,t[3]=r,t[4]=a[0],t[5]=o):o=t[5];let s=o,c;t[6]===n.weight?c=t[7]:(c=n.weight?{flex:n.weight}:void 0,t[6]=n.weight,t[7]=c);let l;if(t[8]!==r||t[9]!==a){let e;t[11]===r?e=t[12]:(e=(e,t)=>(0,J.jsx)(ue,{value:N(e.title,r.dataModel,r.scopeData),children:N(e.title,r.dataModel,r.scopeData)},t),t[11]=r,t[12]=e),l=a.map(e),t[8]=r,t[9]=a,t[10]=l}else l=t[10];let u;t[13]===l?u=t[14]:(u=(0,J.jsx)(R,{className:`w-full`,children:l}),t[13]=l,t[14]=u);let d;if(t[15]!==r||t[16]!==a){let e;t[18]===r?e=t[19]:(e=(e,t)=>(0,J.jsx)(L,{value:N(e.title,r.dataModel,r.scopeData),children:(0,J.jsx)(Q,{...r,id:e.child})},t),t[18]=r,t[19]=e),d=a.map(e),t[15]=r,t[16]=a,t[17]=d}else d=t[17];let f;return t[20]!==s||t[21]!==c||t[22]!==u||t[23]!==d?(f=(0,J.jsxs)(z,{defaultValue:s,style:c,children:[u,d]}),t[20]=s,t[21]=c,t[22]=u,t[23]=d,t[24]=f):f=t[24],f}function qe(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,[i,a]=(0,K.useState)(!1),o;t[0]!==r||t[1]!==n.entryPointChild||t[2]!==n.trigger?(o=(n.trigger??n.entryPointChild)&&(0,J.jsx)(B,{asChild:!0,children:(0,J.jsx)(`div`,{className:`cursor-pointer`,children:(0,J.jsx)(Q,{...r,id:n.trigger??n.entryPointChild})})}),t[0]=r,t[1]=n.entryPointChild,t[2]=n.trigger,t[3]=o):o=t[3];let s,c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(U,{className:`sr-only`,children:`Interactive modal`}),c=(0,J.jsx)(V,{className:`sr-only`,children:`Interactive modal content generated by the agent.`}),t[4]=s,t[5]=c):(s=t[4],c=t[5]);let l;t[6]!==r||t[7]!==n.content||t[8]!==n.contentChild?(l=(n.content??n.contentChild)&&(0,J.jsx)(Q,{...r,id:n.content??n.contentChild}),t[6]=r,t[7]=n.content,t[8]=n.contentChild,t[9]=l):l=t[9];let u;t[10]===l?u=t[11]:(u=(0,J.jsxs)(H,{children:[s,c,l]}),t[10]=l,t[11]=u);let d;return t[12]!==i||t[13]!==o||t[14]!==u?(d=(0,J.jsxs)(de,{open:i,onOpenChange:a,children:[o,u]}),t[12]=i,t[13]=o,t[14]=u,t[15]=d):d=t[15],d}function Je(e){let t=(0,q.c)(11),{def:n,ctx:r}=e,i=n.url,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=a;if(!o)return null;let s;t[4]===n.weight?s=t[5]:(s=n.weight?{flex:n.weight}:void 0,t[4]=n.weight,t[5]=s);let c;t[6]===o?c=t[7]:(c=(0,J.jsx)(`video`,{src:o,controls:!0,className:`w-full max-h-96`,children:`Tu navegador no soporta video.`}),t[6]=o,t[7]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsx)(`div`,{className:`rounded-xl overflow-hidden border border-white/[0.08]`,style:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Ye(e){let t=(0,q.c)(19),{def:n,ctx:r}=e,i=n.url,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=a,s=n.description,c;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==s?(c=N(s,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=s,t[7]=c):c=t[7];let l=c;if(!o)return null;let u;t[8]===n.weight?u=t[9]:(u=n.weight?{flex:n.weight}:void 0,t[8]=n.weight,t[9]=u);let d;t[10]===l?d=t[11]:(d=l&&(0,J.jsx)(`p`,{className:`text-xs text-white/40 mb-2`,children:l}),t[10]=l,t[11]=d);let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f={height:40},t[12]=f):f=t[12];let p;t[13]===o?p=t[14]:(p=(0,J.jsx)(`audio`,{src:o,controls:!0,className:`w-full`,style:f,children:`Tu navegador no soporta audio.`}),t[13]=o,t[14]=p);let m;return t[15]!==u||t[16]!==d||t[17]!==p?(m=(0,J.jsxs)(`div`,{className:`rounded-xl border border-white/[0.08] p-4 bg-white/[0.02]`,style:u,children:[d,p]}),t[15]=u,t[16]=d,t[17]=p,t[18]=m):m=t[18],m}function Xe(e){let t=(0,q.c)(22),{surface:n,onAction:r,isLoading:i}=e,{components:a,dataModel:o,rootId:s,theme:c}=n,l;t[0]===o?l=t[1]:(l=()=>structuredClone(o),t[0]=o,t[1]=l);let[u,d]=(0,K.useState)(l),f,p;t[2]===o?(f=t[3],p=t[4]):(f=()=>{d(structuredClone(o))},p=[o],t[2]=o,t[3]=f,t[4]=p),(0,K.useEffect)(f,p);let m;if(t[5]!==a){m=new Map;for(let e of a)m.set(e.id,e);t[5]=a,t[6]=m}else m=t[6];let h=m,g=c?.primaryColor||`#3B82F6`,_;t[7]!==r||t[8]!==n.surfaceId?(_=(e,t,i)=>{r&&r({name:e,surfaceId:n.surfaceId,sourceComponentId:i,timestamp:new Date().toISOString(),context:t})},t[7]=r,t[8]=n.surfaceId,t[9]=_):_=t[9];let v=_;if(i){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,J.jsx)(`span`,{className:`text-white/30 text-sm animate-pulse`,children:`Cargando superficie...`})}),t[10]=e):e=t[10],e}if(!s||!h.has(s)){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`flex items-center justify-center py-8 text-white/20 text-sm`,children:`Sin contenido disponible`}),t[11]=e):e=t[11],e}let y;t[12]===g?y=t[13]:(y={"--a2ui-primary":g},t[12]=g,t[13]=y);let b=y,x;t[14]!==h||t[15]!==v||t[16]!==u||t[17]!==s?(x=(0,J.jsx)(Q,{id:s,compMap:h,dataModel:u,setDataModel:d,scopeData:void 0,onAction:v}),t[14]=h,t[15]=v,t[16]=u,t[17]=s,t[18]=x):x=t[18];let S;return t[19]!==b||t[20]!==x?(S=(0,J.jsx)(`div`,{className:`a2ui-surface`,style:b,children:x}),t[19]=b,t[20]=x,t[21]=S):S=t[21],S}var Ze=48;function Q(e){let t=(0,q.c)(71),n=e.compMap,r,i,a,o;if(t[0]!==e){o=Symbol.for(`react.early_return_sentinel`);bb0:{if(i=n.get(e.id),!i){o=null;break bb0}let s;t[5]===e.ancestors?s=t[6]:(s=e.ancestors??[],t[5]=e.ancestors,t[6]=s);let c=s;if(c.includes(e.id)||c.length>=Ze){let n;t[7]===e.id?n=t[8]:(n=(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-amber-400/30 px-3 py-2 text-xs text-amber-300/70`,children:[`Componente "`,e.id,`" omitido: se contiene a sí mismo`]}),t[7]=e.id,t[8]=n),o=n;break bb0}let l;t[9]!==c||t[10]!==e.id?(l=[...c,e.id],t[9]=c,t[10]=e.id,t[11]=l):l=t[11];let u;t[12]!==e||t[13]!==l?(u={...e,ancestors:l},t[12]=e,t[13]=l,t[14]=u):u=t[14],r=u,a=i.component?.replace(/[^\x00-\x7F]/g,``).trim()}t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s=a;switch(s){case`Text`:{let e;return t[15]!==r||t[16]!==i?(e=(0,J.jsx)(Te,{def:i,ctx:r}),t[15]=r,t[16]=i,t[17]=e):e=t[17],e}case`Button`:{let e;return t[18]!==r||t[19]!==i?(e=(0,J.jsx)(ke,{def:i,ctx:r}),t[18]=r,t[19]=i,t[20]=e):e=t[20],e}case`Row`:{let e;return t[21]!==r||t[22]!==i?(e=(0,J.jsx)(je,{def:i,ctx:r}),t[21]=r,t[22]=i,t[23]=e):e=t[23],e}case`Column`:{let e;return t[24]!==r||t[25]!==i?(e=(0,J.jsx)(Ne,{def:i,ctx:r}),t[24]=r,t[25]=i,t[26]=e):e=t[26],e}case`Card`:{let e;return t[27]!==r||t[28]!==i?(e=(0,J.jsx)(Pe,{def:i,ctx:r}),t[27]=r,t[28]=i,t[29]=e):e=t[29],e}case`List`:{let e;return t[30]!==r||t[31]!==i?(e=(0,J.jsx)(Fe,{def:i,ctx:r}),t[30]=r,t[31]=i,t[32]=e):e=t[32],e}case`Divider`:{let e;return t[33]!==r||t[34]!==i?(e=(0,J.jsx)(Ie,{def:i,ctx:r}),t[33]=r,t[34]=i,t[35]=e):e=t[35],e}case`Image`:{let e;return t[36]!==r||t[37]!==i?(e=(0,J.jsx)(ze,{def:i,ctx:r}),t[36]=r,t[37]=i,t[38]=e):e=t[38],e}case`Icon`:{let e;return t[39]!==r||t[40]!==i?(e=(0,J.jsx)(Ve,{def:i,ctx:r}),t[39]=r,t[40]=i,t[41]=e):e=t[41],e}case`TextField`:{let e;return t[42]!==r||t[43]!==i?(e=(0,J.jsx)(He,{def:i,ctx:r}),t[42]=r,t[43]=i,t[44]=e):e=t[44],e}case`CheckBox`:{let e;return t[45]!==r||t[46]!==i?(e=(0,J.jsx)(Ue,{def:i,ctx:r}),t[45]=r,t[46]=i,t[47]=e):e=t[47],e}case`ChoicePicker`:{let e;return t[48]!==r||t[49]!==i?(e=(0,J.jsx)(Z,{def:i,ctx:r}),t[48]=r,t[49]=i,t[50]=e):e=t[50],e}case`Slider`:{let e;return t[51]!==r||t[52]!==i?(e=(0,J.jsx)(We,{def:i,ctx:r}),t[51]=r,t[52]=i,t[53]=e):e=t[53],e}case`DateTimeInput`:{let e;return t[54]!==r||t[55]!==i?(e=(0,J.jsx)(Ge,{def:i,ctx:r}),t[54]=r,t[55]=i,t[56]=e):e=t[56],e}case`Tabs`:{let e;return t[57]!==r||t[58]!==i?(e=(0,J.jsx)(Ke,{def:i,ctx:r}),t[57]=r,t[58]=i,t[59]=e):e=t[59],e}case`Modal`:{let e;return t[60]!==r||t[61]!==i?(e=(0,J.jsx)(qe,{def:i,ctx:r}),t[60]=r,t[61]=i,t[62]=e):e=t[62],e}case`Video`:{let e;return t[63]!==r||t[64]!==i?(e=(0,J.jsx)(Je,{def:i,ctx:r}),t[63]=r,t[64]=i,t[65]=e):e=t[65],e}case`AudioPlayer`:{let e;return t[66]!==r||t[67]!==i?(e=(0,J.jsx)(Ye,{def:i,ctx:r}),t[66]=r,t[67]=i,t[68]=e):e=t[68],e}default:{let e;return t[69]===s?e=t[70]:(e=(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-white/10 px-3 py-2 text-xs text-white/30`,children:[`Unknown component: `,s]}),t[69]=s,t[70]=e),e}}}function $(e,t){if(!e)return[];if(typeof e==`string`)return[(0,J.jsx)(Q,{...t,id:e},e)];if(Array.isArray(e))return e.map(e=>(0,J.jsx)(Q,{...t,id:e},e));if(`explicitList`in e||`array`in e)return(`explicitList`in e?e.explicitList:e.array).map(e=>(0,J.jsx)(Q,{...t,id:e},e));if(`path`in e&&`componentId`in e){let n=e,r=j(n.path,t.dataModel,t.scopeData);return Array.isArray(r)?r.map((e,r)=>{let i=typeof e==`object`&&e?e:{value:e,index:r};return(0,J.jsx)(Q,{...t,id:n.componentId,scopeData:i},`${n.componentId}_${r}`)}):[]}if(`template`in e){let n=e.template,r=j(n.dataBinding,t.dataModel,t.scopeData);return Array.isArray(r)?r.map((e,r)=>{let i=typeof e==`object`&&e?e:{value:e,index:r};return(0,J.jsx)(Q,{...t,id:n.componentId,scopeData:i},`${n.componentId}_${r}`)}):[]}return[]}function Qe(){let e=M(e=>e.a2uiSurfaces),t=M(e=>e.sendA2UIAction),n=M(e=>e.deleteA2UISurface),[r,i]=(0,K.useState)(null),a=(0,K.useCallback)(e=>{t(e)},[t]),o=async e=>{i(e);try{await ne(`/api/a2ui/surfaces/${encodeURIComponent(e)}`,{method:`DELETE`,showError:!0}),n(e)}catch{}finally{i(null)}},s=Array.from(e.values());return(0,J.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,style:{backgroundImage:`radial-gradient(circle, rgba(59,130,246,0.03) 1px, transparent 1px)`,backgroundSize:`40px 40px`},children:[s.length===0?(0,J.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-white/20`,children:[(0,J.jsx)(P,{className:`h-10 w-10 opacity-30`}),(0,J.jsx)(`p`,{className:`text-sm`,children:`Sin paneles interactivos activos`}),(0,J.jsx)(`p`,{className:`text-xs text-white/15`,children:`Los resultados y formularios creados por los agentes aparecerán aquí.`})]}):(0,J.jsx)(le,{className:`flex-1 p-6`,children:s.length>0&&(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:s.map(e=>(0,J.jsxs)(`div`,{className:`rounded-xl border border-blue-500/20 bg-[rgba(255,255,255,0.02)] backdrop-blur-sm p-4`,style:e.theme?.primaryColor?{borderColor:`${e.theme.primaryColor}33`}:void 0,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3 pb-3 border-b border-white/5`,children:[e.theme?.agentDisplayName?(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.theme.iconUrl&&(0,J.jsx)(`img`,{src:e.theme.iconUrl,alt:``,className:`w-5 h-5 rounded-full`}),(0,J.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,style:{color:e.theme.primaryColor??`#93c5fd`},children:e.theme.agentDisplayName})]}):(0,J.jsx)(`span`,{className:`font-mono text-[10px] text-white/40`,children:e.surfaceId}),(0,J.jsx)(`button`,{type:`button`,title:`Eliminar superficie ${e.surfaceId}`,"aria-label":`Eliminar superficie ${e.surfaceId}`,disabled:r===e.surfaceId,onClick:()=>o(e.surfaceId),className:`rounded-md p-1.5 text-white/25 transition hover:bg-red-500/10 hover:text-red-300 disabled:opacity-40`,children:(0,J.jsx)(T,{className:`h-3.5 w-3.5`})})]}),(0,J.jsx)(Xe,{surface:e,onAction:a})]},e.surfaceId))})}),(0,J.jsx)(`div`,{className:`border-t border-white/5 bg-white/[0.02] px-6 py-2.5`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(P,{className:`h-3 w-3 text-blue-400/50`}),(0,J.jsx)(`span`,{className:`hive-mono`,children:s.length>0?`${s.length} superficie${s.length>1?`s`:``} A2UI activa${s.length>1?`s`:``}`:`Panel interactivo · sin superficies`})]})})]})}function $e(){let e=(0,q.c)(20),{sessionId:t}=O(),{currentUser:n}=te(),r=M(tt),i=M(et),a=t&&t!==`default`?t:n?.id,o,s;if(e[0]===i?(o=e[1],s=e[2]):(o=()=>{i()},s=[i],e[0]=i,e[1]=o,e[2]=s),(0,K.useEffect)(o,s),!a){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] items-center justify-center`,children:(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent`}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Cargando sesión...`})]})}),e[3]=t):t=e[3],t}let c,l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:(0,J.jsx)(P,{className:`h-5 w-5`})}),l=(0,J.jsx)(`h2`,{className:`hive-title-page !text-lg`,children:`Panel interactivo`}),e[4]=c,e[5]=l):(c=e[4],l=e[5]);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(F,{className:`h-3 w-3`}),e[6]=u):u=e[6];let d;e[7]===a?d=e[8]:(d=(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[c,(0,J.jsxs)(`div`,{children:[l,(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-white/40 mt-0.5`,children:[u,(0,J.jsx)(`span`,{className:`font-mono`,children:a})]})]})]}),e[7]=a,e[8]=d);let f=`flex items-center gap-1.5 px-3 py-1 transition-all duration-500 border ${r?`bg-emerald-500/15 text-emerald-500 border-emerald-500/20 hover:bg-emerald-500/20`:`bg-red-500/15 text-red-500 border-red-500/20 hover:bg-red-500/20`}`,p;e[9]===r?p=e[10]:(p=r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(D,{className:`h-3.5 w-3.5 animate-pulse`}),(0,J.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Live`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(E,{className:`h-3.5 w-3.5`}),(0,J.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Offline`})]}),e[9]=r,e[10]=p);let m;e[11]!==f||e[12]!==p?(m=(0,J.jsx)(ce,{variant:`outline`,className:f,children:p}),e[11]=f,e[12]=p,e[13]=m):m=e[13];let h;e[14]!==d||e[15]!==m?(h=(0,J.jsxs)(`div`,{className:`flex flex-row items-center justify-between space-y-0 border-b border-white/5 bg-white/5 px-6 py-4`,children:[d,m]}),e[14]=d,e[15]=m,e[16]=h):h=e[16];let g;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(Qe,{}),e[17]=g):g=e[17];let _;return e[18]===h?_=e[19]:(_=(0,J.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] flex-col bg-background/50 backdrop-blur-sm`,children:(0,J.jsx)(`div`,{className:`flex-1 overflow-hidden p-4 lg:p-8`,children:(0,J.jsx)(`div`,{className:`mx-auto h-full max-w-7xl`,children:(0,J.jsxs)(`div`,{className:`hive-card flex h-full flex-col shadow-2xl`,children:[h,g]})})})}),e[18]=h,e[19]=_),_}function et(e){return e.markA2UISeen}function tt(e){return e.isConnected}export{$e as A2UIPage};
@@ -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-9tvEC3hX.js";import{t as o}from"./external-link-6oTH9pUM.js";import{n as s,r as c,t as l}from"./ModelSelector-VVwpDrYF.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-C0W6p0lk.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-C3n2xYF2.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-CeSzDnx-.js";import{t as o}from"./external-link-DNJH7epD.js";import{n as s,r as c,t as l}from"./ModelSelector-njfNhkng.js";import{t as u}from"./shield-DvVIcbzd.js";import{t as d}from"./sparkles-DRe4GbSH.js";import{t as f}from"./utils-lc8H6VGT.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-U0e4e5mL.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-DO1fQCF7.js";import{t as O}from"./label-CvAtVE-v.js";import{t as k}from"./textarea-xtFAVuPf.js";import{i as A,n as j,o as M,s as N,t as P}from"./select-BjBXxyxL.js";import{t as F}from"./switch-B5dAwb54.js";import{a as I,i as L,n as R,r as z,t as B}from"./card-D0qneq1i.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};