@hotmeshio/long-tail 0.1.6 → 0.1.7

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 (335) hide show
  1. package/README.md +44 -4
  2. package/build/api/auth.d.ts +5 -0
  3. package/build/api/auth.js +42 -0
  4. package/build/api/bot-accounts.d.ts +50 -0
  5. package/build/api/bot-accounts.js +215 -0
  6. package/build/api/controlplane.d.ts +20 -0
  7. package/build/api/controlplane.js +110 -0
  8. package/build/api/dba.d.ts +15 -0
  9. package/build/api/dba.js +68 -0
  10. package/build/api/escalations.d.ts +70 -0
  11. package/build/api/escalations.js +656 -0
  12. package/build/api/exports.d.ts +32 -0
  13. package/build/api/exports.js +146 -0
  14. package/build/api/index.d.ts +18 -0
  15. package/build/api/index.js +54 -0
  16. package/build/api/insight.d.ts +29 -0
  17. package/build/api/insight.js +90 -0
  18. package/build/api/maintenance.d.ts +7 -0
  19. package/build/api/maintenance.js +28 -0
  20. package/build/api/mcp-runs.d.ts +16 -0
  21. package/build/api/mcp-runs.js +62 -0
  22. package/build/api/mcp.d.ts +52 -0
  23. package/build/api/mcp.js +212 -0
  24. package/build/api/namespaces.d.ts +7 -0
  25. package/build/{routes/escalations/helpers.js → api/namespaces.js} +24 -12
  26. package/build/api/roles.d.ts +25 -0
  27. package/build/api/roles.js +159 -0
  28. package/build/api/settings.d.ts +2 -0
  29. package/build/api/settings.js +35 -0
  30. package/build/api/tasks.d.ts +27 -0
  31. package/build/api/tasks.js +96 -0
  32. package/build/api/users.d.ts +44 -0
  33. package/build/api/users.js +162 -0
  34. package/build/api/workflow-sets.d.ts +26 -0
  35. package/build/api/workflow-sets.js +119 -0
  36. package/build/api/workflows.d.ts +48 -0
  37. package/build/api/workflows.js +298 -0
  38. package/build/api/yaml-workflows.d.ts +87 -0
  39. package/build/api/yaml-workflows.js +556 -0
  40. package/build/index.d.ts +4 -0
  41. package/build/index.js +6 -1
  42. package/build/lib/db/schemas/004_workflow_sets.sql +29 -0
  43. package/build/lib/db/schemas/005_unique_graph_topic.sql +7 -0
  44. package/build/lib/db/schemas/011_system_workflow_configs.sql +7 -0
  45. package/build/lib/events/callback.d.ts +41 -0
  46. package/build/lib/events/callback.js +98 -0
  47. package/build/modules/config.js +1 -1
  48. package/build/routes/auth.js +37 -36
  49. package/build/routes/bot-accounts.js +34 -164
  50. package/build/routes/controlplane.js +20 -60
  51. package/build/routes/dba.js +18 -28
  52. package/build/routes/escalations/bulk.js +17 -192
  53. package/build/routes/escalations/list.js +29 -75
  54. package/build/routes/escalations/resolve.js +3 -193
  55. package/build/routes/escalations/single.js +13 -122
  56. package/build/routes/exports.js +44 -95
  57. package/build/routes/index.js +2 -0
  58. package/build/routes/insight.js +46 -88
  59. package/build/routes/maintenance.js +41 -17
  60. package/build/routes/mcp-runs.js +52 -60
  61. package/build/routes/mcp.js +49 -177
  62. package/build/routes/namespaces.js +9 -20
  63. package/build/routes/roles.js +23 -97
  64. package/build/routes/settings.js +37 -25
  65. package/build/routes/tasks.js +28 -64
  66. package/build/routes/users.js +24 -113
  67. package/build/routes/workflow-sets.d.ts +2 -0
  68. package/build/routes/workflow-sets.js +98 -0
  69. package/build/routes/workflows/config.js +23 -57
  70. package/build/routes/workflows/discovery.js +11 -85
  71. package/build/routes/workflows/invocation.js +16 -84
  72. package/build/routes/yaml-workflows/cron.js +12 -61
  73. package/build/routes/yaml-workflows/crud.js +30 -223
  74. package/build/routes/yaml-workflows/deployment.js +15 -115
  75. package/build/routes/yaml-workflows/versions.js +20 -58
  76. package/build/sdk/index.d.ts +327 -0
  77. package/build/sdk/index.js +298 -0
  78. package/build/services/controlplane/index.d.ts +1 -2
  79. package/build/services/controlplane/index.js +3 -3
  80. package/build/services/controlplane/sql.d.ts +2 -2
  81. package/build/services/controlplane/sql.js +4 -5
  82. package/build/services/controlplane/types.d.ts +1 -0
  83. package/build/services/export/index.js +6 -1
  84. package/build/services/hotmesh-utils.js +2 -4
  85. package/build/services/insight/index.d.ts +7 -0
  86. package/build/services/insight/index.js +30 -0
  87. package/build/services/mcp/client/tools.js +13 -1
  88. package/build/services/mcp-runs/sql.js +1 -1
  89. package/build/services/workflow-sets/db.d.ts +16 -0
  90. package/build/services/workflow-sets/db.js +78 -0
  91. package/build/services/workflow-sets/index.d.ts +1 -0
  92. package/build/services/workflow-sets/index.js +11 -0
  93. package/build/services/workflow-sets/sql.d.ts +6 -0
  94. package/build/services/workflow-sets/sql.js +24 -0
  95. package/build/services/yaml-workflow/db-utils.d.ts +1 -0
  96. package/build/services/yaml-workflow/db-utils.js +4 -0
  97. package/build/services/yaml-workflow/db.d.ts +5 -0
  98. package/build/services/yaml-workflow/db.js +17 -0
  99. package/build/services/yaml-workflow/pipeline/build/wiring.js +14 -1
  100. package/build/services/yaml-workflow/pipeline/prompts.d.ts +1 -1
  101. package/build/services/yaml-workflow/pipeline/prompts.js +1 -1
  102. package/build/services/yaml-workflow/sql.d.ts +2 -1
  103. package/build/services/yaml-workflow/sql.js +8 -3
  104. package/build/services/yaml-workflow/types.d.ts +3 -0
  105. package/build/services/yaml-workflow/workers/callbacks.js +7 -1
  106. package/build/services/yaml-workflow/workers/register.js +7 -0
  107. package/build/start/adapters.js +4 -0
  108. package/build/system/index.js +6 -0
  109. package/build/system/mcp-servers/knowledge.js +1 -1
  110. package/build/system/seed/server-definitions.js +2 -1
  111. package/build/system/workflows/mcp-workflow-builder/activities/index.d.ts +1 -1
  112. package/build/system/workflows/mcp-workflow-builder/activities/index.js +2 -1
  113. package/build/system/workflows/mcp-workflow-builder/activities/tool-loader.d.ts +6 -0
  114. package/build/system/workflows/mcp-workflow-builder/activities/tool-loader.js +26 -0
  115. package/build/system/workflows/mcp-workflow-builder/index.js +26 -2
  116. package/build/system/workflows/mcp-workflow-builder/prompts.js +104 -35
  117. package/build/system/workflows/mcp-workflow-planner/activities/analyze.d.ts +11 -0
  118. package/build/system/workflows/mcp-workflow-planner/activities/analyze.js +36 -0
  119. package/build/system/workflows/mcp-workflow-planner/activities/index.d.ts +3 -0
  120. package/build/system/workflows/mcp-workflow-planner/activities/index.js +12 -0
  121. package/build/system/workflows/mcp-workflow-planner/activities/persist.d.ts +19 -0
  122. package/build/system/workflows/mcp-workflow-planner/activities/persist.js +55 -0
  123. package/build/system/workflows/mcp-workflow-planner/activities/plan.d.ts +10 -0
  124. package/build/system/workflows/mcp-workflow-planner/activities/plan.js +43 -0
  125. package/build/system/workflows/mcp-workflow-planner/index.d.ts +7 -0
  126. package/build/system/workflows/mcp-workflow-planner/index.js +152 -0
  127. package/build/system/workflows/mcp-workflow-planner/prompts.d.ts +7 -0
  128. package/build/system/workflows/mcp-workflow-planner/prompts.js +77 -0
  129. package/build/tsconfig.tsbuildinfo +1 -1
  130. package/build/types/index.d.ts +1 -0
  131. package/build/types/sdk.d.ts +27 -0
  132. package/build/types/sdk.js +2 -0
  133. package/build/types/workflow-set.d.ts +44 -0
  134. package/build/types/workflow-set.js +5 -0
  135. package/dashboard/dist/assets/{AdminDashboard-BXkKGkb5.js → AdminDashboard-DRjkRSjJ.js} +2 -2
  136. package/dashboard/dist/assets/{AdminDashboard-BXkKGkb5.js.map → AdminDashboard-DRjkRSjJ.js.map} +1 -1
  137. package/dashboard/dist/assets/{AvailableEscalationsPage-DcH592mc.js → AvailableEscalationsPage-CnivX4Tz.js} +2 -2
  138. package/dashboard/dist/assets/{AvailableEscalationsPage-DcH592mc.js.map → AvailableEscalationsPage-CnivX4Tz.js.map} +1 -1
  139. package/dashboard/dist/assets/BotPicker-DwwaBhTH.js +2 -0
  140. package/dashboard/dist/assets/{BotPicker-A6LtzyuO.js.map → BotPicker-DwwaBhTH.js.map} +1 -1
  141. package/dashboard/dist/assets/{CollapsibleSection-C7nL2_mv.js → CollapsibleSection-DQpaVA0M.js} +2 -2
  142. package/dashboard/dist/assets/{CollapsibleSection-C7nL2_mv.js.map → CollapsibleSection-DQpaVA0M.js.map} +1 -1
  143. package/dashboard/dist/assets/{ConfirmDeleteModal-CWFwJrSl.js → ConfirmDeleteModal-B7JoDNvt.js} +2 -2
  144. package/dashboard/dist/assets/{ConfirmDeleteModal-CWFwJrSl.js.map → ConfirmDeleteModal-B7JoDNvt.js.map} +1 -1
  145. package/dashboard/dist/assets/{CopyableId-DbZ5c3jh.js → CopyableId-AqoZayBG.js} +2 -2
  146. package/dashboard/dist/assets/{CopyableId-DbZ5c3jh.js.map → CopyableId-AqoZayBG.js.map} +1 -1
  147. package/dashboard/dist/assets/{CredentialsPage-ClWkmLPu.js → CredentialsPage-qGw1kQzi.js} +2 -2
  148. package/dashboard/dist/assets/{CredentialsPage-ClWkmLPu.js.map → CredentialsPage-qGw1kQzi.js.map} +1 -1
  149. package/dashboard/dist/assets/{CustomDurationPicker-CtH2hReF.js → CustomDurationPicker-D1HUQcd0.js} +2 -2
  150. package/dashboard/dist/assets/{CustomDurationPicker-CtH2hReF.js.map → CustomDurationPicker-D1HUQcd0.js.map} +1 -1
  151. package/dashboard/dist/assets/{DataTable-CM5ZcpPi.js → DataTable-DKvSKoVG.js} +2 -2
  152. package/dashboard/dist/assets/{DataTable-CM5ZcpPi.js.map → DataTable-DKvSKoVG.js.map} +1 -1
  153. package/dashboard/dist/assets/{ElapsedCell-CwqavyeC.js → ElapsedCell-B0yrReGQ.js} +2 -2
  154. package/dashboard/dist/assets/{ElapsedCell-CwqavyeC.js.map → ElapsedCell-B0yrReGQ.js.map} +1 -1
  155. package/dashboard/dist/assets/{EmptyState-BBn78pmm.js → EmptyState-X0fIzYID.js} +2 -2
  156. package/dashboard/dist/assets/{EmptyState-BBn78pmm.js.map → EmptyState-X0fIzYID.js.map} +1 -1
  157. package/dashboard/dist/assets/{EscalationsOverview-BcJ2E3X7.js → EscalationsOverview-BQAT9W7r.js} +2 -2
  158. package/dashboard/dist/assets/{EscalationsOverview-BcJ2E3X7.js.map → EscalationsOverview-BQAT9W7r.js.map} +1 -1
  159. package/dashboard/dist/assets/{EventTable-C1en_KZ0.js → EventTable-CX1KNLhZ.js} +2 -2
  160. package/dashboard/dist/assets/{EventTable-C1en_KZ0.js.map → EventTable-CX1KNLhZ.js.map} +1 -1
  161. package/dashboard/dist/assets/{FilterBar-CZTlrLQT.js → FilterBar-DMTvuQy-.js} +2 -2
  162. package/dashboard/dist/assets/{FilterBar-CZTlrLQT.js.map → FilterBar-DMTvuQy-.js.map} +1 -1
  163. package/dashboard/dist/assets/{ListToolbar-Cdbsapig.js → ListToolbar-DTOSxoEy.js} +2 -2
  164. package/dashboard/dist/assets/{ListToolbar-Cdbsapig.js.map → ListToolbar-DTOSxoEy.js.map} +1 -1
  165. package/dashboard/dist/assets/{McpOverview-CSpEJxKa.js → McpOverview-BaKTIWrG.js} +2 -2
  166. package/dashboard/dist/assets/{McpOverview-CSpEJxKa.js.map → McpOverview-BaKTIWrG.js.map} +1 -1
  167. package/dashboard/dist/assets/McpQueryDetailPage-CC08T5k8.js +5 -0
  168. package/dashboard/dist/assets/McpQueryDetailPage-CC08T5k8.js.map +1 -0
  169. package/dashboard/dist/assets/McpQueryPage-CVfF9dYg.js +2 -0
  170. package/dashboard/dist/assets/McpQueryPage-CVfF9dYg.js.map +1 -0
  171. package/dashboard/dist/assets/{McpRunDetailPage-9xdxgG4d.js → McpRunDetailPage-CKs1RWeV.js} +2 -2
  172. package/dashboard/dist/assets/{McpRunDetailPage-9xdxgG4d.js.map → McpRunDetailPage-CKs1RWeV.js.map} +1 -1
  173. package/dashboard/dist/assets/{McpRunsPage-wWLqHsd4.js → McpRunsPage-CcPD_tY1.js} +2 -2
  174. package/dashboard/dist/assets/{McpRunsPage-wWLqHsd4.js.map → McpRunsPage-CcPD_tY1.js.map} +1 -1
  175. package/dashboard/dist/assets/{Modal-kB_P7ZOr.js → Modal-_2AbWxJT.js} +2 -2
  176. package/dashboard/dist/assets/{Modal-kB_P7ZOr.js.map → Modal-_2AbWxJT.js.map} +1 -1
  177. package/dashboard/dist/assets/OperatorDashboard-BGiRaRDr.js +2 -0
  178. package/dashboard/dist/assets/{OperatorDashboard-jc0vrgDI.js.map → OperatorDashboard-BGiRaRDr.js.map} +1 -1
  179. package/dashboard/dist/assets/{PageHeader-NkOeBR05.js → PageHeader-DVr5Qyzm.js} +2 -2
  180. package/dashboard/dist/assets/{PageHeader-NkOeBR05.js.map → PageHeader-DVr5Qyzm.js.map} +1 -1
  181. package/dashboard/dist/assets/{PageHeaderWithStats-ywNhrmFK.js → PageHeaderWithStats-D0KRASML.js} +2 -2
  182. package/dashboard/dist/assets/{PageHeaderWithStats-ywNhrmFK.js.map → PageHeaderWithStats-D0KRASML.js.map} +1 -1
  183. package/dashboard/dist/assets/{PriorityBadge-B2MQbSxy.js → PriorityBadge-Bx2559OU.js} +2 -2
  184. package/dashboard/dist/assets/{PriorityBadge-B2MQbSxy.js.map → PriorityBadge-Bx2559OU.js.map} +1 -1
  185. package/dashboard/dist/assets/{ProcessDetailPage-B7z7IdqE.js → ProcessDetailPage-69I--sry.js} +2 -2
  186. package/dashboard/dist/assets/{ProcessDetailPage-B7z7IdqE.js.map → ProcessDetailPage-69I--sry.js.map} +1 -1
  187. package/dashboard/dist/assets/{ProcessesListPage-C-uHadO6.js → ProcessesListPage-BDpUbua2.js} +2 -2
  188. package/dashboard/dist/assets/{ProcessesListPage-C-uHadO6.js.map → ProcessesListPage-BDpUbua2.js.map} +1 -1
  189. package/dashboard/dist/assets/{RolePill-C1dgC-fK.js → RolePill-CcAqEaSt.js} +2 -2
  190. package/dashboard/dist/assets/{RolePill-C1dgC-fK.js.map → RolePill-CcAqEaSt.js.map} +1 -1
  191. package/dashboard/dist/assets/{RolesPage-BSxrD1vm.js → RolesPage-Cl23Hjet.js} +2 -2
  192. package/dashboard/dist/assets/{RolesPage-BSxrD1vm.js.map → RolesPage-Cl23Hjet.js.map} +1 -1
  193. package/dashboard/dist/assets/{RowActions-lYaHGI-v.js → RowActions-B4mqIt3Z.js} +2 -2
  194. package/dashboard/dist/assets/{RowActions-lYaHGI-v.js.map → RowActions-B4mqIt3Z.js.map} +1 -1
  195. package/dashboard/dist/assets/{StatCard-v2TiITVr.js → StatCard-Cz_2OjAZ.js} +2 -2
  196. package/dashboard/dist/assets/{StatCard-v2TiITVr.js.map → StatCard-Cz_2OjAZ.js.map} +1 -1
  197. package/dashboard/dist/assets/{StatusBadge-DWlxevgG.js → StatusBadge-Wi2FJZsn.js} +2 -2
  198. package/dashboard/dist/assets/{StatusBadge-DWlxevgG.js.map → StatusBadge-Wi2FJZsn.js.map} +1 -1
  199. package/dashboard/dist/assets/{StepIndicator-CRM4ft28.js → StepIndicator-PW5NRDMb.js} +2 -2
  200. package/dashboard/dist/assets/{StepIndicator-CRM4ft28.js.map → StepIndicator-PW5NRDMb.js.map} +1 -1
  201. package/dashboard/dist/assets/{StickyPagination-CF0EToEU.js → StickyPagination-Bl2Uzz65.js} +2 -2
  202. package/dashboard/dist/assets/{StickyPagination-CF0EToEU.js.map → StickyPagination-Bl2Uzz65.js.map} +1 -1
  203. package/dashboard/dist/assets/{SwimlaneTimeline-CNlj7fgg.js → SwimlaneTimeline-CUPqMd0z.js} +2 -2
  204. package/dashboard/dist/assets/{SwimlaneTimeline-CNlj7fgg.js.map → SwimlaneTimeline-CUPqMd0z.js.map} +1 -1
  205. package/dashboard/dist/assets/{TagInput-CH8qMGhC.js → TagInput-BLtf86Ly.js} +2 -2
  206. package/dashboard/dist/assets/{TagInput-CH8qMGhC.js.map → TagInput-BLtf86Ly.js.map} +1 -1
  207. package/dashboard/dist/assets/{TaskDetailPage-CdWo-6mu.js → TaskDetailPage-BXJFX74D.js} +2 -2
  208. package/dashboard/dist/assets/{TaskDetailPage-CdWo-6mu.js.map → TaskDetailPage-BXJFX74D.js.map} +1 -1
  209. package/dashboard/dist/assets/{TaskQueuePill-BPj4ogVG.js → TaskQueuePill-CWYj3xKe.js} +2 -2
  210. package/dashboard/dist/assets/{TaskQueuePill-BPj4ogVG.js.map → TaskQueuePill-CWYj3xKe.js.map} +1 -1
  211. package/dashboard/dist/assets/{TasksListPage-CtRkMpKU.js → TasksListPage-C3cX94Mw.js} +2 -2
  212. package/dashboard/dist/assets/{TasksListPage-CtRkMpKU.js.map → TasksListPage-C3cX94Mw.js.map} +1 -1
  213. package/dashboard/dist/assets/{TimeAgo-Di1a3X5P.js → TimeAgo-B_5yDDHV.js} +2 -2
  214. package/dashboard/dist/assets/{TimeAgo-Di1a3X5P.js.map → TimeAgo-B_5yDDHV.js.map} +1 -1
  215. package/dashboard/dist/assets/{TimestampCell-CqrXql-S.js → TimestampCell-DRX724uU.js} +2 -2
  216. package/dashboard/dist/assets/{TimestampCell-CqrXql-S.js.map → TimestampCell-DRX724uU.js.map} +1 -1
  217. package/dashboard/dist/assets/{UserName-BUFYCnRa.js → UserName-Ca8FA469.js} +2 -2
  218. package/dashboard/dist/assets/{UserName-BUFYCnRa.js.map → UserName-Ca8FA469.js.map} +1 -1
  219. package/dashboard/dist/assets/{WorkflowExecutionPage-25iusMml.js → WorkflowExecutionPage-BBYWEV2P.js} +2 -2
  220. package/dashboard/dist/assets/{WorkflowExecutionPage-25iusMml.js.map → WorkflowExecutionPage-BBYWEV2P.js.map} +1 -1
  221. package/dashboard/dist/assets/WorkflowPill-BXifAuLi.js +2 -0
  222. package/dashboard/dist/assets/{WorkflowPill-DPKOcbf4.js.map → WorkflowPill-BXifAuLi.js.map} +1 -1
  223. package/dashboard/dist/assets/{WorkflowsDashboard-BgxslssH.js → WorkflowsDashboard-Drl3juz9.js} +2 -2
  224. package/dashboard/dist/assets/{WorkflowsDashboard-BgxslssH.js.map → WorkflowsDashboard-Drl3juz9.js.map} +1 -1
  225. package/dashboard/dist/assets/{WorkflowsOverview-Doe5L-Re.js → WorkflowsOverview-03IRrDLg.js} +2 -2
  226. package/dashboard/dist/assets/{WorkflowsOverview-Doe5L-Re.js.map → WorkflowsOverview-03IRrDLg.js.map} +1 -1
  227. package/dashboard/dist/assets/YamlWorkflowsPage-DC2cLxVi.js +2 -0
  228. package/dashboard/dist/assets/YamlWorkflowsPage-DC2cLxVi.js.map +1 -0
  229. package/dashboard/dist/assets/{bots-Bi2_O1Ts.js → bots-DZEXcgiJ.js} +2 -2
  230. package/dashboard/dist/assets/{bots-Bi2_O1Ts.js.map → bots-DZEXcgiJ.js.map} +1 -1
  231. package/dashboard/dist/assets/{escalation-Ck1KlLkT.js → escalation-Cw48lNaF.js} +2 -2
  232. package/dashboard/dist/assets/{escalation-Ck1KlLkT.js.map → escalation-Cw48lNaF.js.map} +1 -1
  233. package/dashboard/dist/assets/{escalation-columns-ohDsj2eJ.js → escalation-columns-NINpo3qf.js} +2 -2
  234. package/dashboard/dist/assets/{escalation-columns-ohDsj2eJ.js.map → escalation-columns-NINpo3qf.js.map} +1 -1
  235. package/dashboard/dist/assets/helpers-Cuu3xKfr.js +2 -0
  236. package/dashboard/dist/assets/helpers-Cuu3xKfr.js.map +1 -0
  237. package/dashboard/dist/assets/{helpers-BoD2SgUY.js → helpers-fk_qr729.js} +2 -2
  238. package/dashboard/dist/assets/{helpers-BoD2SgUY.js.map → helpers-fk_qr729.js.map} +1 -1
  239. package/dashboard/dist/assets/index-B98ipWxE.js +2 -0
  240. package/dashboard/dist/assets/{index-D7zYZOnH.js.map → index-B98ipWxE.js.map} +1 -1
  241. package/dashboard/dist/assets/{index-BEtLIsML.js → index-BIG3KooI.js} +2 -2
  242. package/dashboard/dist/assets/{index-BEtLIsML.js.map → index-BIG3KooI.js.map} +1 -1
  243. package/dashboard/dist/assets/{index-DYyLF-Qb.js → index-BwN3KP_L.js} +5 -5
  244. package/dashboard/dist/assets/{index-DYyLF-Qb.js.map → index-BwN3KP_L.js.map} +1 -1
  245. package/dashboard/dist/assets/index-Bxe8h1x4.js +17 -0
  246. package/dashboard/dist/assets/{index-DOkHXmyf.js.map → index-Bxe8h1x4.js.map} +1 -1
  247. package/dashboard/dist/assets/{index-FuohTtaM.js → index-CNI7k7oB.js} +3 -3
  248. package/dashboard/dist/assets/{index-FuohTtaM.js.map → index-CNI7k7oB.js.map} +1 -1
  249. package/dashboard/dist/assets/{index-CZrJ09p-.js → index-CORHB0WC.js} +2 -2
  250. package/dashboard/dist/assets/{index-CZrJ09p-.js.map → index-CORHB0WC.js.map} +1 -1
  251. package/dashboard/dist/assets/{index-PyCTS05D.css → index-DcIKW-cZ.css} +1 -1
  252. package/dashboard/dist/assets/{index-D3NyVADW.js → index-Dj-z-x8M.js} +2 -2
  253. package/dashboard/dist/assets/index-Dj-z-x8M.js.map +1 -0
  254. package/dashboard/dist/assets/{index-Bn2xHDr8.js → index-DwRytW9O.js} +3 -3
  255. package/dashboard/dist/assets/{index-Bn2xHDr8.js.map → index-DwRytW9O.js.map} +1 -1
  256. package/dashboard/dist/assets/index-aRvL-dXp.js +2 -0
  257. package/dashboard/dist/assets/{index-Dk2Q51o0.js.map → index-aRvL-dXp.js.map} +1 -1
  258. package/dashboard/dist/assets/index-b03HlbnH.js +2 -0
  259. package/dashboard/dist/assets/{index-BpT-6WgJ.js.map → index-b03HlbnH.js.map} +1 -1
  260. package/dashboard/dist/assets/{mcp-CJtYjA7A.js → mcp-BZoFryNc.js} +2 -2
  261. package/dashboard/dist/assets/{mcp-CJtYjA7A.js.map → mcp-BZoFryNc.js.map} +1 -1
  262. package/dashboard/dist/assets/mcp-query-wiw1kwm8.js +2 -0
  263. package/dashboard/dist/assets/mcp-query-wiw1kwm8.js.map +1 -0
  264. package/dashboard/dist/assets/{mcp-runs-DUWm9Z4V.js → mcp-runs-BaEKnf5v.js} +2 -2
  265. package/dashboard/dist/assets/{mcp-runs-DUWm9Z4V.js.map → mcp-runs-BaEKnf5v.js.map} +1 -1
  266. package/dashboard/dist/assets/{namespaces-BM5P2qmL.js → namespaces-BwnZI4_A.js} +2 -2
  267. package/dashboard/dist/assets/{namespaces-BM5P2qmL.js.map → namespaces-BwnZI4_A.js.map} +1 -1
  268. package/dashboard/dist/assets/{roles-lv0shpjJ.js → roles-Bgn1K8zU.js} +2 -2
  269. package/dashboard/dist/assets/{roles-lv0shpjJ.js.map → roles-Bgn1K8zU.js.map} +1 -1
  270. package/dashboard/dist/assets/{settings-Wlq92mRo.js → settings-CizYiutL.js} +2 -2
  271. package/dashboard/dist/assets/{settings-Wlq92mRo.js.map → settings-CizYiutL.js.map} +1 -1
  272. package/dashboard/dist/assets/{tasks-BFGm4PuE.js → tasks-Bmte_hc4.js} +2 -2
  273. package/dashboard/dist/assets/{tasks-BFGm4PuE.js.map → tasks-Bmte_hc4.js.map} +1 -1
  274. package/dashboard/dist/assets/{useEventHooks-DIE6ue4x.js → useEventHooks-CUCxpiI2.js} +2 -2
  275. package/dashboard/dist/assets/{useEventHooks-DIE6ue4x.js.map → useEventHooks-CUCxpiI2.js.map} +1 -1
  276. package/dashboard/dist/assets/{useYamlActivityEvents-DCwSO73t.js → useYamlActivityEvents-Cum02Ej9.js} +2 -2
  277. package/dashboard/dist/assets/{useYamlActivityEvents-DCwSO73t.js.map → useYamlActivityEvents-Cum02Ej9.js.map} +1 -1
  278. package/dashboard/dist/assets/{users-tA5-K0wA.js → users-NSDgTt-z.js} +2 -2
  279. package/dashboard/dist/assets/{users-tA5-K0wA.js.map → users-NSDgTt-z.js.map} +1 -1
  280. package/dashboard/dist/assets/{vendor-icons-BiIug1SK.js → vendor-icons-D1DdudfH.js} +93 -73
  281. package/dashboard/dist/assets/vendor-icons-D1DdudfH.js.map +1 -0
  282. package/dashboard/dist/assets/{workflows-CfLc15Wr.js → workflows-k0XRdGXx.js} +2 -2
  283. package/dashboard/dist/assets/{workflows-CfLc15Wr.js.map → workflows-k0XRdGXx.js.map} +1 -1
  284. package/dashboard/dist/assets/yaml-workflows-DAre8I78.js +2 -0
  285. package/dashboard/dist/assets/yaml-workflows-DAre8I78.js.map +1 -0
  286. package/dashboard/dist/index.html +3 -3
  287. package/docs/epic-integration.md +224 -0
  288. package/docs/events.md +28 -0
  289. package/docs/sdk.md +177 -0
  290. package/docs/story.md +157 -0
  291. package/docs/workflow-builder.md +371 -0
  292. package/package.json +3 -2
  293. package/build/routes/escalations/helpers.d.ts +0 -5
  294. package/build/routes/resolve.d.ts +0 -9
  295. package/build/routes/resolve.js +0 -19
  296. package/build/routes/yaml-workflows/helpers.d.ts +0 -2
  297. package/build/routes/yaml-workflows/helpers.js +0 -8
  298. package/dashboard/dist/assets/BotPicker-A6LtzyuO.js +0 -2
  299. package/dashboard/dist/assets/McpQueryDetailPage-DhqEI180.js +0 -5
  300. package/dashboard/dist/assets/McpQueryDetailPage-DhqEI180.js.map +0 -1
  301. package/dashboard/dist/assets/McpQueryPage-CIiVMlqo.js +0 -2
  302. package/dashboard/dist/assets/McpQueryPage-CIiVMlqo.js.map +0 -1
  303. package/dashboard/dist/assets/OperatorDashboard-jc0vrgDI.js +0 -2
  304. package/dashboard/dist/assets/RunAsSelector-CJDnyp93.js +0 -2
  305. package/dashboard/dist/assets/RunAsSelector-CJDnyp93.js.map +0 -1
  306. package/dashboard/dist/assets/WorkflowPill-DPKOcbf4.js +0 -2
  307. package/dashboard/dist/assets/YamlWorkflowsPage-BliAckJ6.js +0 -2
  308. package/dashboard/dist/assets/YamlWorkflowsPage-BliAckJ6.js.map +0 -1
  309. package/dashboard/dist/assets/index-BpT-6WgJ.js +0 -2
  310. package/dashboard/dist/assets/index-D3NyVADW.js.map +0 -1
  311. package/dashboard/dist/assets/index-D7zYZOnH.js +0 -2
  312. package/dashboard/dist/assets/index-DOkHXmyf.js +0 -17
  313. package/dashboard/dist/assets/index-Dk2Q51o0.js +0 -2
  314. package/dashboard/dist/assets/mcp-query-jQJQrs_7.js +0 -2
  315. package/dashboard/dist/assets/mcp-query-jQJQrs_7.js.map +0 -1
  316. package/dashboard/dist/assets/vendor-icons-BiIug1SK.js.map +0 -1
  317. package/dashboard/dist/assets/yaml-workflows-D7JXNqbM.js +0 -2
  318. package/dashboard/dist/assets/yaml-workflows-D7JXNqbM.js.map +0 -1
  319. package/docs/img/01-login.png +0 -0
  320. package/docs/img/02-dashboard-home.png +0 -0
  321. package/docs/img/03-processes-list.png +0 -0
  322. package/docs/img/04-escalations-list.png +0 -0
  323. package/docs/img/05-mcp-servers.png +0 -0
  324. package/docs/img/06-mcp-pipelines.png +0 -0
  325. package/docs/img/07-workflows-list.png +0 -0
  326. package/docs/img/compilation/01-query-submit.png +0 -0
  327. package/docs/img/compilation/02-mcp-servers.png +0 -0
  328. package/docs/img/compilation/03-query-completed.png +0 -0
  329. package/docs/img/compilation/04-wizard-original.png +0 -0
  330. package/docs/img/compilation/05-wizard-timeline.png +0 -0
  331. package/docs/img/compilation/06-wizard-profile.png +0 -0
  332. package/docs/img/compilation/07-wizard-deploy.png +0 -0
  333. package/docs/img/compilation/08-wizard-test-modal.png +0 -0
  334. package/docs/img/compilation/09-wizard-test-compare.png +0 -0
  335. package/docs/img/compilation/10-wizard-verify.png +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProcessesListPage-C-uHadO6.js","assets/tasks-BFGm4PuE.js","assets/vendor-query-DLp59M9_.js","assets/workflows-CfLc15Wr.js","assets/useEventHooks-DIE6ue4x.js","assets/useFilterParams-BUyLHcx_.js","assets/vendor-react-Co3Y8ikm.js","assets/DataTable-CM5ZcpPi.js","assets/EmptyState-BBn78pmm.js","assets/TimestampCell-CqrXql-S.js","assets/StickyPagination-CF0EToEU.js","assets/FilterBar-CZTlrLQT.js","assets/PageHeader-NkOeBR05.js","assets/ListToolbar-Cdbsapig.js","assets/vendor-icons-BiIug1SK.js","assets/WorkflowPill-DPKOcbf4.js","assets/ProcessDetailPage-B7z7IdqE.js","assets/settings-Wlq92mRo.js","assets/PageHeaderWithStats-ywNhrmFK.js","assets/StatusBadge-DWlxevgG.js","assets/RolePill-C1dgC-fK.js","assets/UserName-BUFYCnRa.js","assets/users-tA5-K0wA.js","assets/McpOverview-CSpEJxKa.js","assets/mcp-CJtYjA7A.js","assets/mcp-runs-DUWm9Z4V.js","assets/yaml-workflows-D7JXNqbM.js","assets/namespaces-BM5P2qmL.js","assets/StatCard-v2TiITVr.js","assets/McpRunsPage-wWLqHsd4.js","assets/ElapsedCell-CwqavyeC.js","assets/RowActions-lYaHGI-v.js","assets/McpRunDetailPage-9xdxgG4d.js","assets/CopyableId-DbZ5c3jh.js","assets/CollapsibleSection-C7nL2_mv.js","assets/EventTable-C1en_KZ0.js","assets/SwimlaneTimeline-CNlj7fgg.js","assets/McpQueryPage-CIiVMlqo.js","assets/mcp-query-jQJQrs_7.js","assets/McpQueryDetailPage-DhqEI180.js","assets/TagInput-CH8qMGhC.js","assets/RunAsSelector-CJDnyp93.js","assets/BotPicker-A6LtzyuO.js","assets/bots-Bi2_O1Ts.js","assets/TimeAgo-Di1a3X5P.js","assets/useYamlActivityEvents-DCwSO73t.js","assets/EscalationsOverview-BcJ2E3X7.js","assets/AvailableEscalationsPage-DcH592mc.js","assets/roles-lv0shpjJ.js","assets/Modal-kB_P7ZOr.js","assets/constants-BHkpVaqx.js","assets/CustomDurationPicker-CtH2hReF.js","assets/escalation-columns-ohDsj2eJ.js","assets/PriorityBadge-B2MQbSxy.js","assets/escalation-Ck1KlLkT.js","assets/OperatorDashboard-jc0vrgDI.js","assets/index-Bn2xHDr8.js","assets/WorkflowsOverview-Doe5L-Re.js","assets/index-FuohTtaM.js","assets/helpers-BoD2SgUY.js","assets/WorkflowsDashboard-BgxslssH.js","assets/YamlWorkflowsPage-BliAckJ6.js","assets/useExpandedRows-Cg9iq6Vy.js","assets/TasksListPage-CtRkMpKU.js","assets/TaskDetailPage-CdWo-6mu.js","assets/WorkflowExecutionPage-25iusMml.js","assets/AdminDashboard-BXkKGkb5.js","assets/index-BpT-6WgJ.js","assets/TaskQueuePill-BPj4ogVG.js","assets/index-DOkHXmyf.js","assets/ConfirmDeleteModal-CWFwJrSl.js","assets/StepIndicator-CRM4ft28.js","assets/index-Dk2Q51o0.js","assets/index-CZrJ09p-.js","assets/index-D7zYZOnH.js","assets/RolesPage-BSxrD1vm.js","assets/index-BEtLIsML.js","assets/index-D3NyVADW.js","assets/CredentialsPage-ClWkmLPu.js"])))=>i.map(i=>d[i]);
2
- var RC=Object.defineProperty;var jC=(i,s,a)=>s in i?RC(i,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[s]=a;var S=(i,s,a)=>jC(i,typeof s!="symbol"?s+"":s,a);import{r as Jw,a as B,g as MC,u as ii,b as Vs,c as Sa,Q as kC,d as VC}from"./vendor-query-DLp59M9_.js";import{r as UC,L as uu,u as Zi,N as sh,a as Gw,b as Wr,O as Xd,c as Qw,d as zC,R as BC}from"./vendor-react-Co3Y8ikm.js";import{R as qC,B as Xw,I as LC,U as HC,a as PC,T as $C,W as IC,A as YC,S as FC,P as JC,b as GC,L as Zw,c as QC,d as Y0,e as XC,M as Kw,f as Ww,C as ZC,g as KC,E as WC,h as eT,i as zS,X as F0,F as tT,j as nT,k as sT,G as aT,l as rT,m as iT}from"./vendor-icons-BiIug1SK.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function a(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(u){if(u.ep)return;u.ep=!0;const d=a(u);fetch(u.href,d)}})();var t0={exports:{}},qd={},BS;function oT(){if(BS)return qd;BS=1;/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProcessesListPage-BDpUbua2.js","assets/tasks-Bmte_hc4.js","assets/vendor-query-DLp59M9_.js","assets/workflows-k0XRdGXx.js","assets/useEventHooks-CUCxpiI2.js","assets/useFilterParams-BUyLHcx_.js","assets/vendor-react-Co3Y8ikm.js","assets/DataTable-DKvSKoVG.js","assets/EmptyState-X0fIzYID.js","assets/TimestampCell-DRX724uU.js","assets/StickyPagination-Bl2Uzz65.js","assets/FilterBar-DMTvuQy-.js","assets/PageHeader-DVr5Qyzm.js","assets/ListToolbar-DTOSxoEy.js","assets/vendor-icons-D1DdudfH.js","assets/WorkflowPill-BXifAuLi.js","assets/ProcessDetailPage-69I--sry.js","assets/settings-CizYiutL.js","assets/PageHeaderWithStats-D0KRASML.js","assets/StatusBadge-Wi2FJZsn.js","assets/RolePill-CcAqEaSt.js","assets/UserName-Ca8FA469.js","assets/users-NSDgTt-z.js","assets/McpOverview-BaKTIWrG.js","assets/mcp-BZoFryNc.js","assets/mcp-runs-BaEKnf5v.js","assets/yaml-workflows-DAre8I78.js","assets/namespaces-BwnZI4_A.js","assets/StatCard-Cz_2OjAZ.js","assets/McpRunsPage-CcPD_tY1.js","assets/ElapsedCell-B0yrReGQ.js","assets/RowActions-B4mqIt3Z.js","assets/McpRunDetailPage-CKs1RWeV.js","assets/CopyableId-AqoZayBG.js","assets/CollapsibleSection-DQpaVA0M.js","assets/EventTable-CX1KNLhZ.js","assets/SwimlaneTimeline-CUPqMd0z.js","assets/McpQueryPage-CVfF9dYg.js","assets/mcp-query-wiw1kwm8.js","assets/McpQueryDetailPage-CC08T5k8.js","assets/TagInput-BLtf86Ly.js","assets/helpers-Cuu3xKfr.js","assets/BotPicker-DwwaBhTH.js","assets/bots-DZEXcgiJ.js","assets/useYamlActivityEvents-Cum02Ej9.js","assets/TimeAgo-B_5yDDHV.js","assets/EscalationsOverview-BQAT9W7r.js","assets/AvailableEscalationsPage-CnivX4Tz.js","assets/roles-Bgn1K8zU.js","assets/Modal-_2AbWxJT.js","assets/constants-BHkpVaqx.js","assets/CustomDurationPicker-D1HUQcd0.js","assets/escalation-columns-NINpo3qf.js","assets/PriorityBadge-Bx2559OU.js","assets/escalation-Cw48lNaF.js","assets/OperatorDashboard-BGiRaRDr.js","assets/index-DwRytW9O.js","assets/WorkflowsOverview-03IRrDLg.js","assets/index-CNI7k7oB.js","assets/helpers-fk_qr729.js","assets/WorkflowsDashboard-Drl3juz9.js","assets/YamlWorkflowsPage-DC2cLxVi.js","assets/useExpandedRows-Cg9iq6Vy.js","assets/TasksListPage-C3cX94Mw.js","assets/TaskDetailPage-BXJFX74D.js","assets/WorkflowExecutionPage-BBYWEV2P.js","assets/AdminDashboard-DRjkRSjJ.js","assets/index-b03HlbnH.js","assets/TaskQueuePill-CWYj3xKe.js","assets/index-Bxe8h1x4.js","assets/ConfirmDeleteModal-B7JoDNvt.js","assets/StepIndicator-PW5NRDMb.js","assets/index-aRvL-dXp.js","assets/index-CORHB0WC.js","assets/index-B98ipWxE.js","assets/RolesPage-Cl23Hjet.js","assets/index-BIG3KooI.js","assets/index-Dj-z-x8M.js","assets/CredentialsPage-qGw1kQzi.js"])))=>i.map(i=>d[i]);
2
+ var RC=Object.defineProperty;var jC=(i,s,a)=>s in i?RC(i,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[s]=a;var S=(i,s,a)=>jC(i,typeof s!="symbol"?s+"":s,a);import{r as Jw,a as B,g as MC,u as ii,b as Vs,c as Sa,Q as kC,d as VC}from"./vendor-query-DLp59M9_.js";import{r as UC,L as uu,u as Zi,N as sh,a as Gw,b as Wr,O as Xd,c as Qw,d as zC,R as BC}from"./vendor-react-Co3Y8ikm.js";import{R as qC,B as Xw,I as LC,U as HC,a as PC,T as $C,W as IC,A as YC,S as FC,P as JC,b as GC,L as Zw,c as QC,d as XC,e as Y0,M as Kw,f as Ww,C as ZC,g as KC,E as WC,h as eT,i as zS,X as F0,F as tT,j as nT,k as sT,G as aT,l as rT,m as iT}from"./vendor-icons-D1DdudfH.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function a(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(u){if(u.ep)return;u.ep=!0;const d=a(u);fetch(u.href,d)}})();var t0={exports:{}},qd={},BS;function oT(){if(BS)return qd;BS=1;/**
3
3
  * @license React
4
4
  * react-jsx-dev-runtime.development.js
5
5
  *
@@ -268,7 +268,7 @@ ${g}`),w(q);return}m(null,F),o.strategy===Ms.Count&&(x--,x===0&&w()),o.strategy=
268
268
 
269
269
  ${m.stack}`),g.unsubscribe(),p.reject(x)):(x=rE(_),x?(m&&(x.stack+=`
270
270
 
271
- ${m.stack}`),p.reject(x)):p.resolve(_))}});return g.requestSubject=s,this.protocol.publish(s,a,{reply:d,headers:o.headers}),p}else{const d=new lE(this.protocol.muxSubscriptions,s,o,u);this.protocol.request(d);try{this.publish(s,a,{reply:`${this.protocol.muxSubscriptions.baseInbox}${d.token}`,headers:o.headers})}catch(m){d.cancel(m)}const p=Promise.race([d.timer,d.deferred]);return p.catch(()=>{d.cancel()}),p}}flush(){return this.isClosed()?Promise.reject(ge.errorForCode(ue.ConnectionClosed)):this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(ge.errorForCode(ue.ConnectionClosed)):this.isDraining()?Promise.reject(ge.errorForCode(ue.ConnectionDraining)):(this.draining=!0,this.protocol.drain())}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){const s=this.protocol.getServer();return s?s.listen:""}status(){const s=new sn;return s.iterClosed.then(()=>{const a=this.listeners.indexOf(s);this.listeners.splice(a,1)}),this.listeners.push(s),s}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}async context(){return(await this.request("$SYS.REQ.USER.INFO")).json((a,o)=>a==="time"?new Date(Date.parse(o)):o)}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}async jetstreamManager(s={}){const a=new W3(this,s);if(s.checkAPI!==!1)try{await a.getAccountInfo()}catch(o){const u=o;throw u.code===ue.NoResponders&&(u.code=ue.JetStreamNotEnabled),u}return a}jetstream(s={}){return new ey(this,s)}getServerVersion(){const s=this.info;return s?Xi(s.version):void 0}async rtt(){if(!this.protocol._closed&&!this.protocol.connected)throw ge.errorForCode(ue.Disconnect);const s=Date.now();return await this.flush(),Date.now()-s}get features(){return this.protocol.features}get services(){return this._services||(this._services=new sO(this)),this._services}reconnect(){return this.isClosed()?Promise.reject(ge.errorForCode(ue.ConnectionClosed)):this.isDraining()?Promise.reject(ge.errorForCode(ue.ConnectionDraining)):this.protocol.reconnect()}}class sO{constructor(s){S(this,"nc");this.nc=s}add(s){try{return new Su(this.nc,s).start()}catch(a){return Promise.reject(a)}}client(s,a){return new U3(this.nc,s,a)}}class aO{constructor(s,a,o){S(this,"bucket");S(this,"sm");S(this,"prefixLen");this.bucket=s,this.prefixLen=a,this.sm=o}get key(){return this.sm.subject.substring(this.prefixLen)}get value(){return this.sm.data}get delta(){return 0}get created(){return this.sm.time}get revision(){return this.sm.seq}get operation(){return this.sm.header.get(fh)||"PUT"}get length(){const s=this.sm.header.get(Dn.MessageSizeHdr)||"";return s!==""?parseInt(s,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class rO{constructor(s,a,o){S(this,"bucket");S(this,"key");S(this,"sm");this.bucket=s,this.key=a,this.sm=o}get value(){return this.sm.data}get created(){return new Date(Q0(this.sm.info.timestampNanos))}get revision(){return this.sm.seq}get operation(){var s;return((s=this.sm.headers)==null?void 0:s.get(fh))||"PUT"}get delta(){return this.sm.info.pending}get length(){var a;const s=((a=this.sm.headers)==null?void 0:a.get(Dn.MessageSizeHdr))||"";return s!==""?parseInt(s,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class gE extends GT{constructor(a,o,u){super(a.nc,o,u);S(this,"js");S(this,"monitor");this.js=a,this.monitor=null,this.sub.closed.then(()=>{this.monitor&&this.monitor.cancel()})}set info(a){this.sub.info=a}get info(){return this.sub.info}_resetOrderedConsumer(a){if(this.info===null||this.sub.isClosed())return;const o=nr(this.js.nc.options.inboxPrefix);this.js.nc._resub(this.sub,o);const d=this.info;d.config.name=ai.next(),d.ordered_consumer_sequence.delivery_seq=0,d.flow_control.heartbeat_count=0,d.flow_control.fc_count=0,d.flow_control.consumer_restarts++,d.deliver=o,d.config.deliver_subject=o,d.config.deliver_policy=Vt.StartSequence,d.config.opt_start_seq=a;const p={};p.stream_name=this.info.stream,p.config=d.config;const m=`${d.api.prefix}.CONSUMER.CREATE.${d.stream}`;this.js._request(m,p,{retries:-1}).then(g=>{const x=g,_=this.sub.info;_.last=x,this.info.config=x.config,this.info.name=x.name}).catch(g=>{const x=new ge(`unable to recreate ordered consumer ${d.stream} at seq ${a}`,ue.RequestError,g);this.sub.callback(x,{})})}_maybeSetupHbMonitoring(){var o,u;const a=((u=(o=this.info)==null?void 0:o.config)==null?void 0:u.idle_heartbeat)||0;a&&this._setupHbMonitoring(Q0(a))}_setupHbMonitoring(a,o=0){const u={cancelAfter:0,maxOut:2};o&&(u.cancelAfter=o);const d=this.sub,p=m=>{var _,w,D,z;const g=CT(409,`${ys.IdleHeartbeatMissed}: ${m}`,this.sub.subject);if(!((_=this.info)==null?void 0:_.ordered))this.sub.callback(null,g);else{if(!this.js.nc.protocol.connected)return!1;const q=((D=(w=this.info)==null?void 0:w.ordered_consumer_sequence)==null?void 0:D.stream_seq)||0;return this._resetOrderedConsumer(q+1),(z=this.monitor)==null||z.restart(),!1}return!d.noIterator};this.monitor=new Z0(a,p,u)}_checkHbOrderConsumer(a){const o=a.headers.get(Dn.ConsumerStalledHdr);o!==""&&this.js.nc.publish(o);const u=parseInt(a.headers.get(Dn.LastConsumerSeqHdr),10),d=this.info.ordered_consumer_sequence;return this.info.flow_control.heartbeat_count++,u!==d.delivery_seq&&this._resetOrderedConsumer(d.stream_seq+1),!1}_checkOrderedConsumer(a){const o=this.info.ordered_consumer_sequence,u=a.info.streamSequence,d=a.info.deliverySequence;return d!=o.delivery_seq+1?(this._resetOrderedConsumer(o.stream_seq+1),!1):(o.delivery_seq=d,o.stream_seq=u,!0)}async destroy(){this.isClosed()||await this.drain();const a=this.sub.info,o=a.config.durable_name||a.name,u=`${a.api.prefix}.CONSUMER.DELETE.${a.stream}.${o}`;await a.api._request(u)}async consumerInfo(){const a=this.sub.info,o=a.config.durable_name||a.name,u=`${a.api.prefix}.CONSUMER.INFO.${a.stream}.${o}`,d=await a.api._request(u);return a.last=d,d}}class iO extends gE{constructor(s,a,o){super(s,a,o)}pull(s={batch:1}){const{stream:a,config:o,name:u}=this.sub.info,d=o.durable_name??u,p={};if(p.batch=s.batch||1,p.no_wait=s.no_wait||!1,(s.max_bytes??0)>0){const x=this.js.nc.features.get(et.JS_PULL_MAX_BYTES);if(!x.ok)throw new Error(`max_bytes is only supported on servers ${x.min} or better`);p.max_bytes=s.max_bytes}let m=0;s.expires&&s.expires>0&&(m=s.expires,p.expires=Et(m));let g=0;if(s.idle_heartbeat&&s.idle_heartbeat>0&&(g=s.idle_heartbeat,p.idle_heartbeat=Et(g)),g&&m===0)throw new Error("idle_heartbeat requires expires");if(g>m)throw new Error("expires must be greater than idle_heartbeat");if(this.info){this.monitor&&this.monitor.cancel(),m&&g&&(this.monitor?this.monitor._change(g,m):this._setupHbMonitoring(g,m));const x=this.info.api,_=`${x.prefix}.CONSUMER.MSG.NEXT.${a}.${d}`,w=this.sub.subject;x.nc.publish(_,x.jc.encode(p),{reply:w})}}}function oO(i,s){return i?cO(s):lO(s)}function lO(i){return(s,a)=>s?[s,null]:(s=dl(a),s?[s,null]:[null,vu(a,i)])}function cO(i){return(s,a)=>{if(s)return[s,null];const o=dl(a);return o!==null?[vE(o),null]:[null,vu(a,i)]}}function vE(i){if(i!==null)switch(i.code){case ue.JetStream404NoMessages:case ue.JetStream408RequestTimeout:return null;case ue.JetStream409:return TT(i)?i:null;default:return i}return null}function uO(i){i&&i.ack()}function fO(i){const s=i.split(".");if(s.length===9&&s.splice(2,0,"_",""),s.length<11||s[0]!=="$JS"||s[1]!=="ACK")throw new Error("not js message");const a={};return a.domain=s[2]==="_"?"":s[2],a.account_hash=s[3],a.stream=s[4],a.consumer=s[5],a.deliveryCount=parseInt(s[6],10),a.redeliveryCount=a.deliveryCount,a.redelivered=a.deliveryCount>1,a.streamSequence=parseInt(s[7],10),a.deliverySequence=parseInt(s[8],10),a.timestampNanos=parseInt(s[9],10),a.pending=parseInt(s[10],10),a}class dO{constructor(s,a){S(this,"msg");S(this,"di");S(this,"didAck");S(this,"timeout");this.msg=s,this.didAck=!1,this.timeout=a}get subject(){return this.msg.subject}get sid(){return this.msg.sid}get data(){return this.msg.data}get headers(){return this.msg.headers}get info(){return this.di||(this.di=fO(this.reply)),this.di}get redelivered(){return this.info.deliveryCount>1}get reply(){return this.msg.reply||""}get seq(){return this.info.streamSequence}doAck(s){this.didAck||(this.didAck=!this.isWIP(s),this.msg.respond(s))}isWIP(s){return s.length===4&&s[0]===su[0]&&s[1]===su[1]&&s[2]===su[2]&&s[3]===su[3]}async ackAck(s){var o;s=s||{},s.timeout=s.timeout||this.timeout;const a=_t();if(this.didAck)a.resolve(!1);else if(this.didAck=!0,this.msg.reply){const d=this.msg.publisher,p=!((o=d.options)!=null&&o.noAsyncTraces),m=new lE(d.muxSubscriptions,this.msg.reply,{timeout:s.timeout},p);d.request(m);try{d.publish(this.msg.reply,mw,{reply:`${d.muxSubscriptions.baseInbox}${m.token}`})}catch(g){m.cancel(g)}try{await Promise.race([m.timer,m.deferred]),a.resolve(!0)}catch(g){m.cancel(g),a.reject(g)}}else a.resolve(!1);return a}ack(){this.doAck(mw)}nak(s){let a=F3;s&&(a=w0().encode(`-NAK ${JSON.stringify({delay:Et(s)})}`)),this.doAck(a)}working(){this.doAck(su)}next(s,a={batch:1}){const o={};o.batch=a.batch||1,o.no_wait=a.no_wait||!1,a.expires&&a.expires>0&&(o.expires=Et(a.expires));const u=ks().encode(o),d=yl.concat(J3,Q3,u),p=s?{reply:s}:void 0;this.msg.respond(d,p)}term(s=""){let a=G3;(s==null?void 0:s.length)>0&&(a=w0().encode(`+TERM ${s}`)),this.doAck(a)}json(){return this.msg.json()}string(){return this.msg.string()}}const hO="1.30.3",mO="nats.ws";class pO{constructor(){S(this,"version");S(this,"lang");S(this,"closeError");S(this,"connected");S(this,"done");S(this,"socket");S(this,"options");S(this,"socketClosed");S(this,"encrypted");S(this,"peeked");S(this,"yields");S(this,"signal");S(this,"closedNotification");this.version=hO,this.lang=mO,this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=_t(),this.closedNotification=_t()}async connect(s,a){const o=_t();if(a.tls)return o.reject(new ge("tls",ue.InvalidOption)),o;this.options=a;const u=s.src;if(a.wsFactory){const{socket:d,encrypted:p}=await a.wsFactory(s.src,a);this.socket=d,this.encrypted=p}else this.encrypted=u.indexOf("wss://")===0,this.socket=new WebSocket(u);return this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.isDiscarded()},this.socket.onmessage=d=>{if(this.isDiscarded())return;if(this.yields.push(new Uint8Array(d.data)),this.peeked){this.signal.resolve();return}const p=yl.concat(...this.yields),m=e3(p);if(m!==""){const g=C3.exec(m);if(!g){a.debug&&console.error("!!!",Hd(p)),o.reject(new Error("unexpected response from server"));return}try{const x=JSON.parse(g[1]);A3(x,this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),o.resolve()}catch(x){o.reject(x);return}}},this.socket.onclose=d=>{if(this.isDiscarded())return;this.socketClosed=!0;let p;this.done||(d.wasClean||(p=new Error(d.reason)),this._closed(p))},this.socket.onerror=d=>{if(this.isDiscarded())return;const p=d,m=new ge(p.message,ue.Unknown,new Error(p.error));o.reject(m)},o}disconnect(){this._closed(void 0,!0)}async _closed(s,a=!0){if(!this.isDiscarded()&&this.connected&&!this.done){if(this.closeError=s,!s)for(;!this.socketClosed&&this.socket.bufferedAmount>0;)await gl(100);this.done=!0;try{this.socket.close(s?1002:1e3,s?s.message:void 0)}catch{}a&&this.closedNotification.resolve(s)}}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async*iterate(){for(;;){if(this.isDiscarded())return;this.yields.length===0&&await this.signal;const s=this.yields;this.yields=[];for(let a=0;a<s.length;a++)this.options.debug&&console.info(`> ${Hd(s[a])}`),yield s[a];if(this.done)break;this.yields.length===0&&(s.length=0,this.yields=s,this.signal=_t())}}isEncrypted(){return this.connected&&this.encrypted}send(s){if(!this.isDiscarded())try{this.socket.send(s.buffer),this.options.debug&&console.info(`< ${Hd(s)}`);return}catch(a){this.options.debug&&console.error(`!!! ${Hd(s)}: ${a}`)}}close(s){return this._closed(s,!1)}closed(){return this.closedNotification}isDiscarded(){return this.done?(this.discard(),!0):!1}discard(){var s;this.done=!0;try{(s=this.socket)==null||s.close()}catch{}}}function bO(i,s){/^(.*:\/\/)(.*)/.test(i)||(typeof s=="boolean"?i=`${s===!0?"https":"http"}://${i}`:i=`https://${i}`);let o=new URL(i);const u=o.protocol.toLowerCase();u==="ws:"&&(s=!1),u==="wss:"&&(s=!0),u!=="https:"&&u!=="http"&&(i=i.replace(/^(.*:\/\/)(.*)/gm,"$2"),o=new URL(`http://${i}`));let d,p;const m=o.hostname,g=o.pathname,x=o.search||"";switch(u){case"http:":case"ws:":case"nats:":p=o.port||"80",d="ws:";break;case"https:":case"wss:":case"tls:":p=o.port||"443",d="wss:";break;default:p=o.port||s===!0?"443":"80",d=s===!0?"wss:":"ws:";break}return`${d}//${m}:${p}${g}${x}`}function yO(i={}){return QT({defaultPort:443,urlParseFn:bO,factory:()=>new pO}),ty.connect(i)}const gO="ws://localhost:9222",vO="dev_api_secret",xO="lt.events";function xE(i,s){const a=i.split("."),o=s.split(".");for(let u=0;u<o.length;u++){const d=o[u];if(d===">")return!0;if(u>=a.length||d!=="*"&&d!==a[u])return!1}return a.length===o.length}const vh=B.createContext({connected:!1,subscribe:()=>()=>{}});function NO(){const{connected:i}=B.useContext(vh);return{connected:i}}function NE(i,s){const{subscribe:a}=B.useContext(vh),o=B.useRef(s);o.current=s,B.useEffect(()=>a(i,d=>o.current(d)),[a,i])}const SO=B.createContext({connected:!1,subscribe:()=>()=>{}}),wO=w0();function EO({children:i}){const s=B.useRef(null),a=B.useRef(null),[o,u]=B.useState(!1),d=B.useRef(null),p=B.useRef(new Map),m=B.useCallback((_,w)=>{const D=p.current;return D.has(_)||D.set(_,new Set),D.get(_).add(w),()=>{const z=D.get(_);z&&(z.delete(w),z.size===0&&D.delete(_))}},[]),g=B.useCallback((_,w)=>{for(const[D,z]of p.current)if(xE(_,D))for(const q of z)try{q(w)}catch{}},[]),x=B.useCallback(async()=>{try{if(s.current)return;const _=await yO({servers:gO,token:vO,reconnect:!0,maxReconnectAttempts:-1,reconnectTimeWait:2e3});s.current=_,u(!0);const w=_.subscribe("lt.>");a.current=w,(async()=>{for await(const D of w)try{const z=JSON.parse(wO.decode(D.data));g(D.subject,z)}catch{}})(),(async()=>{for await(const D of _.status())D.type==="disconnect"||D.type==="error"?u(!1):D.type==="reconnect"&&u(!0)})()}catch{u(!1),d.current=setTimeout(x,3e3)}},[g]);return B.useEffect(()=>(x(),()=>{d.current&&clearTimeout(d.current),a.current&&a.current.unsubscribe(),s.current&&(s.current.close().catch(()=>{}),s.current=null),u(!1)}),[x]),b.jsxDEV(SO.Provider,{value:{connected:o,subscribe:m},children:b.jsxDEV(vh.Provider,{value:{connected:o,subscribe:m},children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useNats.tsx",lineNumber:192,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/hooks/useNats.tsx",lineNumber:191,columnNumber:5},this)}const Na=Object.create(null);Na.open="0";Na.close="1";Na.ping="2";Na.pong="3";Na.message="4";Na.upgrade="5";Na.noop="6";const Wd=Object.create(null);Object.keys(Na).forEach(i=>{Wd[Na[i]]=i});const z0={type:"error",data:"parser error"},SE=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wE=typeof ArrayBuffer=="function",EE=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer,ny=({type:i,data:s},a,o)=>SE&&s instanceof Blob?a?o(s):bw(s,o):wE&&(s instanceof ArrayBuffer||EE(s))?a?o(s):bw(new Blob([s]),o):o(Na[i]+(s||"")),bw=(i,s)=>{const a=new FileReader;return a.onload=function(){const o=a.result.split(",")[1];s("b"+(o||""))},a.readAsDataURL(i)};function yw(i){return i instanceof Uint8Array?i:i instanceof ArrayBuffer?new Uint8Array(i):new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let h0;function _O(i,s){if(SE&&i.data instanceof Blob)return i.data.arrayBuffer().then(yw).then(s);if(wE&&(i.data instanceof ArrayBuffer||EE(i.data)))return s(yw(i.data));ny(i,!1,a=>{h0||(h0=new TextEncoder),s(h0.encode(a))})}const gw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i<gw.length;i++)cu[gw.charCodeAt(i)]=i;const AO=i=>{let s=i.length*.75,a=i.length,o,u=0,d,p,m,g;i[i.length-1]==="="&&(s--,i[i.length-2]==="="&&s--);const x=new ArrayBuffer(s),_=new Uint8Array(x);for(o=0;o<a;o+=4)d=cu[i.charCodeAt(o)],p=cu[i.charCodeAt(o+1)],m=cu[i.charCodeAt(o+2)],g=cu[i.charCodeAt(o+3)],_[u++]=d<<2|p>>4,_[u++]=(p&15)<<4|m>>2,_[u++]=(m&3)<<6|g&63;return x},DO=typeof ArrayBuffer=="function",sy=(i,s)=>{if(typeof i!="string")return{type:"message",data:_E(i,s)};const a=i.charAt(0);return a==="b"?{type:"message",data:CO(i.substring(1),s)}:Wd[a]?i.length>1?{type:Wd[a],data:i.substring(1)}:{type:Wd[a]}:z0},CO=(i,s)=>{if(DO){const a=AO(i);return _E(a,s)}else return{base64:!0,data:i}},_E=(i,s)=>{switch(s){case"blob":return i instanceof Blob?i:new Blob([i]);case"arraybuffer":default:return i instanceof ArrayBuffer?i:i.buffer}},AE="",TO=(i,s)=>{const a=i.length,o=new Array(a);let u=0;i.forEach((d,p)=>{ny(d,!1,m=>{o[p]=m,++u===a&&s(o.join(AE))})})},OO=(i,s)=>{const a=i.split(AE),o=[];for(let u=0;u<a.length;u++){const d=sy(a[u],s);if(o.push(d),d.type==="error")break}return o};function RO(){return new TransformStream({transform(i,s){_O(i,a=>{const o=a.length;let u;if(o<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,o);else if(o<65536){u=new Uint8Array(3);const d=new DataView(u.buffer);d.setUint8(0,126),d.setUint16(1,o)}else{u=new Uint8Array(9);const d=new DataView(u.buffer);d.setUint8(0,127),d.setBigUint64(1,BigInt(o))}i.data&&typeof i.data!="string"&&(u[0]|=128),s.enqueue(u),s.enqueue(a)})}})}let m0;function Yd(i){return i.reduce((s,a)=>s+a.length,0)}function Fd(i,s){if(i[0].length===s)return i.shift();const a=new Uint8Array(s);let o=0;for(let u=0;u<s;u++)a[u]=i[0][o++],o===i[0].length&&(i.shift(),o=0);return i.length&&o<i[0].length&&(i[0]=i[0].slice(o)),a}function jO(i,s){m0||(m0=new TextDecoder);const a=[];let o=0,u=-1,d=!1;return new TransformStream({transform(p,m){for(a.push(p);;){if(o===0){if(Yd(a)<1)break;const g=Fd(a,1);d=(g[0]&128)===128,u=g[0]&127,u<126?o=3:u===126?o=1:o=2}else if(o===1){if(Yd(a)<2)break;const g=Fd(a,2);u=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),o=3}else if(o===2){if(Yd(a)<8)break;const g=Fd(a,8),x=new DataView(g.buffer,g.byteOffset,g.length),_=x.getUint32(0);if(_>Math.pow(2,21)-1){m.enqueue(z0);break}u=_*Math.pow(2,32)+x.getUint32(4),o=3}else{if(Yd(a)<u)break;const g=Fd(a,u);m.enqueue(sy(d?g:m0.decode(g),s)),o=0}if(u===0||u>i){m.enqueue(z0);break}}}})}const DE=4;function Yt(i){if(i)return MO(i)}function MO(i){for(var s in Yt.prototype)i[s]=Yt.prototype[s];return i}Yt.prototype.on=Yt.prototype.addEventListener=function(i,s){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(s),this};Yt.prototype.once=function(i,s){function a(){this.off(i,a),s.apply(this,arguments)}return a.fn=s,this.on(i,a),this};Yt.prototype.off=Yt.prototype.removeListener=Yt.prototype.removeAllListeners=Yt.prototype.removeEventListener=function(i,s){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+i];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var o,u=0;u<a.length;u++)if(o=a[u],o===s||o.fn===s){a.splice(u,1);break}return a.length===0&&delete this._callbacks["$"+i],this};Yt.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var s=new Array(arguments.length-1),a=this._callbacks["$"+i],o=1;o<arguments.length;o++)s[o-1]=arguments[o];if(a){a=a.slice(0);for(var o=0,u=a.length;o<u;++o)a[o].apply(this,s)}return this};Yt.prototype.emitReserved=Yt.prototype.emit;Yt.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Yt.prototype.hasListeners=function(i){return!!this.listeners(i).length};const xh=typeof Promise=="function"&&typeof Promise.resolve=="function"?s=>Promise.resolve().then(s):(s,a)=>a(s,0),gs=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),kO="arraybuffer";function CE(i,...s){return s.reduce((a,o)=>(i.hasOwnProperty(o)&&(a[o]=i[o]),a),{})}const VO=gs.setTimeout,UO=gs.clearTimeout;function Nh(i,s){s.useNativeTimers?(i.setTimeoutFn=VO.bind(gs),i.clearTimeoutFn=UO.bind(gs)):(i.setTimeoutFn=gs.setTimeout.bind(gs),i.clearTimeoutFn=gs.clearTimeout.bind(gs))}const zO=1.33;function BO(i){return typeof i=="string"?qO(i):Math.ceil((i.byteLength||i.size)*zO)}function qO(i){let s=0,a=0;for(let o=0,u=i.length;o<u;o++)s=i.charCodeAt(o),s<128?a+=1:s<2048?a+=2:s<55296||s>=57344?a+=3:(o++,a+=4);return a}function TE(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function LO(i){let s="";for(let a in i)i.hasOwnProperty(a)&&(s.length&&(s+="&"),s+=encodeURIComponent(a)+"="+encodeURIComponent(i[a]));return s}function HO(i){let s={},a=i.split("&");for(let o=0,u=a.length;o<u;o++){let d=a[o].split("=");s[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return s}class PO extends Error{constructor(s,a,o){super(s),this.description=a,this.context=o,this.type="TransportError"}}class ay extends Yt{constructor(s){super(),this.writable=!1,Nh(this,s),this.opts=s,this.query=s.query,this.socket=s.socket,this.supportsBinary=!s.forceBase64}onError(s,a,o){return super.emitReserved("error",new PO(s,a,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(s){this.readyState==="open"&&this.write(s)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(s){const a=sy(s,this.socket.binaryType);this.onPacket(a)}onPacket(s){super.emitReserved("packet",s)}onClose(s){this.readyState="closed",super.emitReserved("close",s)}pause(s){}createUri(s,a={}){return s+"://"+this._hostname()+this._port()+this.opts.path+this._query(a)}_hostname(){const s=this.opts.hostname;return s.indexOf(":")===-1?s:"["+s+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(s){const a=LO(s);return a.length?"?"+a:""}}class $O extends ay{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(s){this.readyState="pausing";const a=()=>{this.readyState="paused",s()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||a()})),this.writable||(o++,this.once("drain",function(){--o||a()}))}else a()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(s){const a=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};OO(s,this.socket.binaryType).forEach(a),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const s=()=>{this.write([{type:"close"}])};this.readyState==="open"?s():this.once("open",s)}write(s){this.writable=!1,TO(s,a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const s=this.opts.secure?"https":"http",a=this.query||{};return this.opts.timestampRequests!==!1&&(a[this.opts.timestampParam]=TE()),!this.supportsBinary&&!a.sid&&(a.b64=1),this.createUri(s,a)}}let OE=!1;try{OE=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const IO=OE;function YO(){}class FO extends $O{constructor(s){if(super(s),typeof location<"u"){const a=location.protocol==="https:";let o=location.port;o||(o=a?"443":"80"),this.xd=typeof location<"u"&&s.hostname!==location.hostname||o!==s.port}}doWrite(s,a){const o=this.request({method:"POST",data:s});o.on("success",a),o.on("error",(u,d)=>{this.onError("xhr post error",u,d)})}doPoll(){const s=this.request();s.on("data",this.onData.bind(this)),s.on("error",(a,o)=>{this.onError("xhr poll error",a,o)}),this.pollXhr=s}}class xa extends Yt{constructor(s,a,o){super(),this.createRequest=s,Nh(this,o),this._opts=o,this._method=o.method||"GET",this._uri=a,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var s;const a=CE(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");a.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(a);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&o.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(s=this._opts.cookieJar)===null||s===void 0||s.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var u;o.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=xa.requestsCount++,xa.requests[this._index]=this)}_onError(s){this.emitReserved("error",s,this._xhr),this._cleanup(!0)}_cleanup(s){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=YO,s)try{this._xhr.abort()}catch{}typeof document<"u"&&delete xa.requests[this._index],this._xhr=null}}_onLoad(){const s=this._xhr.responseText;s!==null&&(this.emitReserved("data",s),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}xa.requestsCount=0;xa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",vw);else if(typeof addEventListener=="function"){const i="onpagehide"in gs?"pagehide":"unload";addEventListener(i,vw,!1)}}function vw(){for(let i in xa.requests)xa.requests.hasOwnProperty(i)&&xa.requests[i].abort()}const JO=(function(){const i=RE({xdomain:!1});return i&&i.responseType!==null})();class GO extends FO{constructor(s){super(s);const a=s&&s.forceBase64;this.supportsBinary=JO&&!a}request(s={}){return Object.assign(s,{xd:this.xd},this.opts),new xa(RE,this.uri(),s)}}function RE(i){const s=i.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!s||IO))return new XMLHttpRequest}catch{}if(!s)try{return new gs[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const jE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class QO extends ay{get name(){return"websocket"}doOpen(){const s=this.uri(),a=this.opts.protocols,o=jE?{}:CE(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(s,a,o)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=s=>this.onClose({description:"websocket connection closed",context:s}),this.ws.onmessage=s=>this.onData(s.data),this.ws.onerror=s=>this.onError("websocket error",s)}write(s){this.writable=!1;for(let a=0;a<s.length;a++){const o=s[a],u=a===s.length-1;ny(o,this.supportsBinary,d=>{try{this.doWrite(o,d)}catch{}u&&xh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const s=this.opts.secure?"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=TE()),this.supportsBinary||(a.b64=1),this.createUri(s,a)}}const p0=gs.WebSocket||gs.MozWebSocket;class XO extends QO{createSocket(s,a,o){return jE?new p0(s,a,o):a?new p0(s,a):new p0(s)}doWrite(s,a){this.ws.send(a)}}class ZO extends ay{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(s){return this.emitReserved("error",s)}this._transport.closed.then(()=>{this.onClose()}).catch(s=>{this.onError("webtransport error",s)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(s=>{const a=jO(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=s.readable.pipeThrough(a).getReader(),u=RO();u.readable.pipeTo(s.writable),this._writer=u.writable.getWriter();const d=()=>{o.read().then(({done:m,value:g})=>{m||(this.onPacket(g),d())}).catch(m=>{})};d();const p={type:"open"};this.query.sid&&(p.data=`{"sid":"${this.query.sid}"}`),this._writer.write(p).then(()=>this.onOpen())})})}write(s){this.writable=!1;for(let a=0;a<s.length;a++){const o=s[a],u=a===s.length-1;this._writer.write(o).then(()=>{u&&xh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var s;(s=this._transport)===null||s===void 0||s.close()}}const KO={websocket:XO,webtransport:ZO,polling:GO},WO=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,e5=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function B0(i){if(i.length>8e3)throw"URI too long";const s=i,a=i.indexOf("["),o=i.indexOf("]");a!=-1&&o!=-1&&(i=i.substring(0,a)+i.substring(a,o).replace(/:/g,";")+i.substring(o,i.length));let u=WO.exec(i||""),d={},p=14;for(;p--;)d[e5[p]]=u[p]||"";return a!=-1&&o!=-1&&(d.source=s,d.host=d.host.substring(1,d.host.length-1).replace(/;/g,":"),d.authority=d.authority.replace("[","").replace("]","").replace(/;/g,":"),d.ipv6uri=!0),d.pathNames=t5(d,d.path),d.queryKey=n5(d,d.query),d}function t5(i,s){const a=/\/{2,9}/g,o=s.replace(a,"/").split("/");return(s.slice(0,1)=="/"||s.length===0)&&o.splice(0,1),s.slice(-1)=="/"&&o.splice(o.length-1,1),o}function n5(i,s){const a={};return s.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,u,d){u&&(a[u]=d)}),a}const q0=typeof addEventListener=="function"&&typeof removeEventListener=="function",eh=[];q0&&addEventListener("offline",()=>{eh.forEach(i=>i())},!1);class si extends Yt{constructor(s,a){if(super(),this.binaryType=kO,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,s&&typeof s=="object"&&(a=s,s=null),s){const o=B0(s);a.hostname=o.host,a.secure=o.protocol==="https"||o.protocol==="wss",a.port=o.port,o.query&&(a.query=o.query)}else a.host&&(a.hostname=B0(a.host).host);Nh(this,a),this.secure=a.secure!=null?a.secure:typeof location<"u"&&location.protocol==="https:",a.hostname&&!a.port&&(a.port=this.secure?"443":"80"),this.hostname=a.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=a.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},a.transports.forEach(o=>{const u=o.prototype.name;this.transports.push(u),this._transportsByName[u]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},a),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=HO(this.opts.query)),q0&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},eh.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(s){const a=Object.assign({},this.opts.query);a.EIO=DE,a.transport=s,this.id&&(a.sid=this.id);const o=Object.assign({},this.opts,{query:a,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[s]);return new this._transportsByName[s](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const s=this.opts.rememberUpgrade&&si.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const a=this.createTransport(s);a.open(),this.setTransport(a)}setTransport(s){this.transport&&this.transport.removeAllListeners(),this.transport=s,s.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){this.readyState="open",si.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",s),this.emitReserved("heartbeat"),s.type){case"open":this.onHandshake(JSON.parse(s.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const a=new Error("server error");a.code=s.data,this._onError(a);break;case"message":this.emitReserved("data",s.data),this.emitReserved("message",s.data);break}}onHandshake(s){this.emitReserved("handshake",s),this.id=s.sid,this.transport.query.sid=s.sid,this._pingInterval=s.pingInterval,this._pingTimeout=s.pingTimeout,this._maxPayload=s.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const s=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+s,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},s),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const s=this._getWritablePackets();this.transport.send(s),this._prevBufferLen=s.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let o=0;o<this.writeBuffer.length;o++){const u=this.writeBuffer[o].data;if(u&&(a+=BO(u)),o>0&&a>this._maxPayload)return this.writeBuffer.slice(0,o);a+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const s=Date.now()>this._pingTimeoutTime;return s&&(this._pingTimeoutTime=0,xh(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),s}write(s,a,o){return this._sendPacket("message",s,a,o),this}send(s,a,o){return this._sendPacket("message",s,a,o),this}_sendPacket(s,a,o,u){if(typeof a=="function"&&(u=a,a=void 0),typeof o=="function"&&(u=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const d={type:s,data:a,options:o};this.emitReserved("packetCreate",d),this.writeBuffer.push(d),u&&this.once("flush",u),this.flush()}close(){const s=()=>{this._onClose("forced close"),this.transport.close()},a=()=>{this.off("upgrade",a),this.off("upgradeError",a),s()},o=()=>{this.once("upgrade",a),this.once("upgradeError",a)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():s()}):this.upgrading?o():s()),this}_onError(s){if(si.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",s),this._onClose("transport error",s)}_onClose(s,a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),q0&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=eh.indexOf(this._offlineEventListener);o!==-1&&eh.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",s,a),this.writeBuffer=[],this._prevBufferLen=0}}}si.protocol=DE;class s5 extends si{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let s=0;s<this._upgrades.length;s++)this._probe(this._upgrades[s])}_probe(s){let a=this.createTransport(s),o=!1;si.priorWebsocketSuccess=!1;const u=()=>{o||(a.send([{type:"ping",data:"probe"}]),a.once("packet",w=>{if(!o)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",a),!a)return;si.priorWebsocketSuccess=a.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(_(),this.setTransport(a),a.send([{type:"upgrade"}]),this.emitReserved("upgrade",a),a=null,this.upgrading=!1,this.flush())})}else{const D=new Error("probe error");D.transport=a.name,this.emitReserved("upgradeError",D)}}))};function d(){o||(o=!0,_(),a.close(),a=null)}const p=w=>{const D=new Error("probe error: "+w);D.transport=a.name,d(),this.emitReserved("upgradeError",D)};function m(){p("transport closed")}function g(){p("socket closed")}function x(w){a&&w.name!==a.name&&d()}const _=()=>{a.removeListener("open",u),a.removeListener("error",p),a.removeListener("close",m),this.off("close",g),this.off("upgrading",x)};a.once("open",u),a.once("error",p),a.once("close",m),this.once("close",g),this.once("upgrading",x),this._upgrades.indexOf("webtransport")!==-1&&s!=="webtransport"?this.setTimeoutFn(()=>{o||a.open()},200):a.open()}onHandshake(s){this._upgrades=this._filterUpgrades(s.upgrades),super.onHandshake(s)}_filterUpgrades(s){const a=[];for(let o=0;o<s.length;o++)~this.transports.indexOf(s[o])&&a.push(s[o]);return a}}let a5=class extends s5{constructor(s,a={}){const o=typeof s=="object"?s:a;(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(u=>KO[u]).filter(u=>!!u)),super(s,o)}};function r5(i,s="",a){let o=i;a=a||typeof location<"u"&&location,i==null&&(i=a.protocol+"//"+a.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=a.protocol+i:i=a.host+i),/^(https?|wss?):\/\//.test(i)||(typeof a<"u"?i=a.protocol+"//"+i:i="https://"+i),o=B0(i)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const d=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+d+":"+o.port+s,o.href=o.protocol+"://"+d+(a&&a.port===o.port?"":":"+o.port),o}const i5=typeof ArrayBuffer=="function",o5=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,ME=Object.prototype.toString,l5=typeof Blob=="function"||typeof Blob<"u"&&ME.call(Blob)==="[object BlobConstructor]",c5=typeof File=="function"||typeof File<"u"&&ME.call(File)==="[object FileConstructor]";function ry(i){return i5&&(i instanceof ArrayBuffer||o5(i))||l5&&i instanceof Blob||c5&&i instanceof File}function th(i,s){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let a=0,o=i.length;a<o;a++)if(th(i[a]))return!0;return!1}if(ry(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return th(i.toJSON(),!0);for(const a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&th(i[a]))return!0;return!1}function u5(i){const s=[],a=i.data,o=i;return o.data=L0(a,s),o.attachments=s.length,{packet:o,buffers:s}}function L0(i,s){if(!i)return i;if(ry(i)){const a={_placeholder:!0,num:s.length};return s.push(i),a}else if(Array.isArray(i)){const a=new Array(i.length);for(let o=0;o<i.length;o++)a[o]=L0(i[o],s);return a}else if(typeof i=="object"&&!(i instanceof Date)){const a={};for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&(a[o]=L0(i[o],s));return a}return i}function f5(i,s){return i.data=H0(i.data,s),delete i.attachments,i}function H0(i,s){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<s.length)return s[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let a=0;a<i.length;a++)i[a]=H0(i[a],s);else if(typeof i=="object")for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&(i[a]=H0(i[a],s));return i}var Jd={exports:{}},b0,xw;function d5(){if(xw)return b0;xw=1;var i=1e3,s=i*60,a=s*60,o=a*24,u=o*7,d=o*365.25;b0=function(_,w){w=w||{};var D=typeof _;if(D==="string"&&_.length>0)return p(_);if(D==="number"&&isFinite(_))return w.long?g(_):m(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function p(_){if(_=String(_),!(_.length>100)){var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(w){var D=parseFloat(w[1]),z=(w[2]||"ms").toLowerCase();switch(z){case"years":case"year":case"yrs":case"yr":case"y":return D*d;case"weeks":case"week":case"w":return D*u;case"days":case"day":case"d":return D*o;case"hours":case"hour":case"hrs":case"hr":case"h":return D*a;case"minutes":case"minute":case"mins":case"min":case"m":return D*s;case"seconds":case"second":case"secs":case"sec":case"s":return D*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return D;default:return}}}}function m(_){var w=Math.abs(_);return w>=o?Math.round(_/o)+"d":w>=a?Math.round(_/a)+"h":w>=s?Math.round(_/s)+"m":w>=i?Math.round(_/i)+"s":_+"ms"}function g(_){var w=Math.abs(_);return w>=o?x(_,w,o,"day"):w>=a?x(_,w,a,"hour"):w>=s?x(_,w,s,"minute"):w>=i?x(_,w,i,"second"):_+" ms"}function x(_,w,D,z){var q=w>=D*1.5;return Math.round(_/D)+" "+z+(q?"s":"")}return b0}var y0,Nw;function h5(){if(Nw)return y0;Nw=1;function i(s){o.debug=o,o.default=o,o.coerce=x,o.disable=m,o.enable=d,o.enabled=g,o.humanize=d5(),o.destroy=_,Object.keys(s).forEach(w=>{o[w]=s[w]}),o.names=[],o.skips=[],o.formatters={};function a(w){let D=0;for(let z=0;z<w.length;z++)D=(D<<5)-D+w.charCodeAt(z),D|=0;return o.colors[Math.abs(D)%o.colors.length]}o.selectColor=a;function o(w){let D,z=null,q,F;function Z(...ee){if(!Z.enabled)return;const te=Z,we=Number(new Date),De=we-(D||we);te.diff=De,te.prev=D,te.curr=we,D=we,ee[0]=o.coerce(ee[0]),typeof ee[0]!="string"&&ee.unshift("%O");let U=0;ee[0]=ee[0].replace(/%([a-zA-Z%])/g,(oe,W)=>{if(oe==="%%")return"%";U++;const Q=o.formatters[W];if(typeof Q=="function"){const H=ee[U];oe=Q.call(te,H),ee.splice(U,1),U--}return oe}),o.formatArgs.call(te,ee),(te.log||o.log).apply(te,ee)}return Z.namespace=w,Z.useColors=o.useColors(),Z.color=o.selectColor(w),Z.extend=u,Z.destroy=o.destroy,Object.defineProperty(Z,"enabled",{enumerable:!0,configurable:!1,get:()=>z!==null?z:(q!==o.namespaces&&(q=o.namespaces,F=o.enabled(w)),F),set:ee=>{z=ee}}),typeof o.init=="function"&&o.init(Z),Z}function u(w,D){const z=o(this.namespace+(typeof D>"u"?":":D)+w);return z.log=this.log,z}function d(w){o.save(w),o.namespaces=w,o.names=[],o.skips=[];const D=(typeof w=="string"?w:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const z of D)z[0]==="-"?o.skips.push(z.slice(1)):o.names.push(z)}function p(w,D){let z=0,q=0,F=-1,Z=0;for(;z<w.length;)if(q<D.length&&(D[q]===w[z]||D[q]==="*"))D[q]==="*"?(F=q,Z=z,q++):(z++,q++);else if(F!==-1)q=F+1,Z++,z=Z;else return!1;for(;q<D.length&&D[q]==="*";)q++;return q===D.length}function m(){const w=[...o.names,...o.skips.map(D=>"-"+D)].join(",");return o.enable(""),w}function g(w){for(const D of o.skips)if(p(w,D))return!1;for(const D of o.names)if(p(w,D))return!0;return!1}function x(w){return w instanceof Error?w.stack||w.message:w}function _(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}return y0=i,y0}var Sw;function m5(){return Sw||(Sw=1,(function(i,s){var a={};s.formatArgs=u,s.save=d,s.load=p,s.useColors=o,s.storage=m(),s.destroy=(()=>{let x=!1;return()=>{x||(x=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),s.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function o(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let x;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(x=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(x[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function u(x){if(x[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+x[0]+(this.useColors?"%c ":" ")+"+"+i.exports.humanize(this.diff),!this.useColors)return;const _="color: "+this.color;x.splice(1,0,_,"color: inherit");let w=0,D=0;x[0].replace(/%[a-zA-Z%]/g,z=>{z!=="%%"&&(w++,z==="%c"&&(D=w))}),x.splice(D,0,_)}s.log=console.debug||console.log||(()=>{});function d(x){try{x?s.storage.setItem("debug",x):s.storage.removeItem("debug")}catch{}}function p(){let x;try{x=s.storage.getItem("debug")||s.storage.getItem("DEBUG")}catch{}return!x&&typeof process<"u"&&"env"in process&&(x=a.DEBUG),x}function m(){try{return localStorage}catch{}}i.exports=h5()(s);const{formatters:g}=i.exports;g.j=function(x){try{return JSON.stringify(x)}catch(_){return"[UnexpectedJSONParseError]: "+_.message}}})(Jd,Jd.exports)),Jd.exports}var p5=m5();const b5=MC(p5),P0=b5("socket.io-parser"),y5=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ke;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(Ke||(Ke={}));class g5{constructor(s){this.replacer=s}encode(s){return P0("encoding packet %j",s),(s.type===Ke.EVENT||s.type===Ke.ACK)&&th(s)?this.encodeAsBinary({type:s.type===Ke.EVENT?Ke.BINARY_EVENT:Ke.BINARY_ACK,nsp:s.nsp,data:s.data,id:s.id}):[this.encodeAsString(s)]}encodeAsString(s){let a=""+s.type;return(s.type===Ke.BINARY_EVENT||s.type===Ke.BINARY_ACK)&&(a+=s.attachments+"-"),s.nsp&&s.nsp!=="/"&&(a+=s.nsp+","),s.id!=null&&(a+=s.id),s.data!=null&&(a+=JSON.stringify(s.data,this.replacer)),P0("encoded %j as %s",s,a),a}encodeAsBinary(s){const a=u5(s),o=this.encodeAsString(a.packet),u=a.buffers;return u.unshift(o),u}}class iy extends Yt{constructor(s){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof s=="function"?{reviver:s}:s)}add(s){let a;if(typeof s=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");a=this.decodeString(s);const o=a.type===Ke.BINARY_EVENT;o||a.type===Ke.BINARY_ACK?(a.type=o?Ke.EVENT:Ke.ACK,this.reconstructor=new v5(a),a.attachments===0&&super.emitReserved("decoded",a)):super.emitReserved("decoded",a)}else if(ry(s)||s.base64)if(this.reconstructor)a=this.reconstructor.takeBinaryData(s),a&&(this.reconstructor=null,super.emitReserved("decoded",a));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+s)}decodeString(s){let a=0;const o={type:Number(s.charAt(0))};if(Ke[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Ke.BINARY_EVENT||o.type===Ke.BINARY_ACK){const d=a+1;for(;s.charAt(++a)!=="-"&&a!=s.length;);const p=s.substring(d,a);if(p!=Number(p)||s.charAt(a)!=="-")throw new Error("Illegal attachments");const m=Number(p);if(!x5(m)||m<0)throw new Error("Illegal attachments");if(m>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=m}if(s.charAt(a+1)==="/"){const d=a+1;for(;++a&&!(s.charAt(a)===","||a===s.length););o.nsp=s.substring(d,a)}else o.nsp="/";const u=s.charAt(a+1);if(u!==""&&Number(u)==u){const d=a+1;for(;++a;){const p=s.charAt(a);if(p==null||Number(p)!=p){--a;break}if(a===s.length)break}o.id=Number(s.substring(d,a+1))}if(s.charAt(++a)){const d=this.tryParse(s.substr(a));if(iy.isPayloadValid(o.type,d))o.data=d;else throw new Error("invalid payload")}return P0("decoded %s as %j",s,o),o}tryParse(s){try{return JSON.parse(s,this.opts.reviver)}catch{return!1}}static isPayloadValid(s,a){switch(s){case Ke.CONNECT:return ww(a);case Ke.DISCONNECT:return a===void 0;case Ke.CONNECT_ERROR:return typeof a=="string"||ww(a);case Ke.EVENT:case Ke.BINARY_EVENT:return Array.isArray(a)&&(typeof a[0]=="number"||typeof a[0]=="string"&&y5.indexOf(a[0])===-1);case Ke.ACK:case Ke.BINARY_ACK:return Array.isArray(a)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class v5{constructor(s){this.packet=s,this.buffers=[],this.reconPack=s}takeBinaryData(s){if(this.buffers.push(s),this.buffers.length===this.reconPack.attachments){const a=f5(this.reconPack,this.buffers);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const x5=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function ww(i){return Object.prototype.toString.call(i)==="[object Object]"}const N5=Object.freeze(Object.defineProperty({__proto__:null,Decoder:iy,Encoder:g5,get PacketType(){return Ke}},Symbol.toStringTag,{value:"Module"}));function js(i,s,a){return i.on(s,a),function(){i.off(s,a)}}const S5=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class kE extends Yt{constructor(s,a,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=s,this.nsp=a,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const s=this.io;this.subs=[js(s,"open",this.onopen.bind(this)),js(s,"packet",this.onpacket.bind(this)),js(s,"error",this.onerror.bind(this)),js(s,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...s){return s.unshift("message"),this.emit.apply(this,s),this}emit(s,...a){var o,u,d;if(S5.hasOwnProperty(s))throw new Error('"'+s.toString()+'" is a reserved event name');if(a.unshift(s),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const p={type:Ke.EVENT,data:a};if(p.options={},p.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const _=this.ids++,w=a.pop();this._registerAckCallback(_,w),p.id=_}const m=(u=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||u===void 0?void 0:u.writable,g=this.connected&&!(!((d=this.io.engine)===null||d===void 0)&&d._hasPingExpired());return this.flags.volatile&&!m||(g?(this.notifyOutgoingListeners(p),this.packet(p)):this.sendBuffer.push(p)),this.flags={},this}_registerAckCallback(s,a){var o;const u=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(u===void 0){this.acks[s]=a;return}const d=this.io.setTimeoutFn(()=>{delete this.acks[s];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===s&&this.sendBuffer.splice(m,1);a.call(this,new Error("operation has timed out"))},u),p=(...m)=>{this.io.clearTimeoutFn(d),a.apply(this,m)};p.withError=!0,this.acks[s]=p}emitWithAck(s,...a){return new Promise((o,u)=>{const d=(p,m)=>p?u(p):o(m);d.withError=!0,a.push(d),this.emit(s,...a)})}_addToQueue(s){let a;typeof s[s.length-1]=="function"&&(a=s.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:s,flags:Object.assign({fromQueue:!0},this.flags)};s.push((u,...d)=>(this._queue[0],u!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),a&&a(u)):(this._queue.shift(),a&&a(null,...d)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(s=!1){if(!this.connected||this._queue.length===0)return;const a=this._queue[0];a.pending&&!s||(a.pending=!0,a.tryCount++,this.flags=a.flags,this.emit.apply(this,a.args))}packet(s){s.nsp=this.nsp,this.io._packet(s)}onopen(){typeof this.auth=="function"?this.auth(s=>{this._sendConnectPacket(s)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(s){this.packet({type:Ke.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},s):s})}onerror(s){this.connected||this.emitReserved("connect_error",s)}onclose(s,a){this.connected=!1,delete this.id,this.emitReserved("disconnect",s,a),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(s=>{if(!this.sendBuffer.some(o=>String(o.id)===s)){const o=this.acks[s];delete this.acks[s],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(s){if(s.nsp===this.nsp)switch(s.type){case Ke.CONNECT:s.data&&s.data.sid?this.onconnect(s.data.sid,s.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ke.EVENT:case Ke.BINARY_EVENT:this.onevent(s);break;case Ke.ACK:case Ke.BINARY_ACK:this.onack(s);break;case Ke.DISCONNECT:this.ondisconnect();break;case Ke.CONNECT_ERROR:this.destroy();const o=new Error(s.data.message);o.data=s.data.data,this.emitReserved("connect_error",o);break}}onevent(s){const a=s.data||[];s.id!=null&&a.push(this.ack(s.id)),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(s){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const o of a)o.apply(this,s)}super.emit.apply(this,s),this._pid&&s.length&&typeof s[s.length-1]=="string"&&(this._lastOffset=s[s.length-1])}ack(s){const a=this;let o=!1;return function(...u){o||(o=!0,a.packet({type:Ke.ACK,id:s,data:u}))}}onack(s){const a=this.acks[s.id];typeof a=="function"&&(delete this.acks[s.id],a.withError&&s.data.unshift(null),a.apply(this,s.data))}onconnect(s,a){this.id=s,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(s=>this.emitEvent(s)),this.receiveBuffer=[],this.sendBuffer.forEach(s=>{this.notifyOutgoingListeners(s),this.packet(s)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(s=>s()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ke.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(s){return this.flags.compress=s,this}get volatile(){return this.flags.volatile=!0,this}timeout(s){return this.flags.timeout=s,this}onAny(s){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(s),this}prependAny(s){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(s),this}offAny(s){if(!this._anyListeners)return this;if(s){const a=this._anyListeners;for(let o=0;o<a.length;o++)if(s===a[o])return a.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(s){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(s),this}prependAnyOutgoing(s){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(s),this}offAnyOutgoing(s){if(!this._anyOutgoingListeners)return this;if(s){const a=this._anyOutgoingListeners;for(let o=0;o<a.length;o++)if(s===a[o])return a.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(s){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const o of a)o.apply(this,s.data)}}}function vl(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}vl.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var s=Math.random(),a=Math.floor(s*this.jitter*i);i=(Math.floor(s*10)&1)==0?i-a:i+a}return Math.min(i,this.max)|0};vl.prototype.reset=function(){this.attempts=0};vl.prototype.setMin=function(i){this.ms=i};vl.prototype.setMax=function(i){this.max=i};vl.prototype.setJitter=function(i){this.jitter=i};class $0 extends Yt{constructor(s,a){var o;super(),this.nsps={},this.subs=[],s&&typeof s=="object"&&(a=s,s=void 0),a=a||{},a.path=a.path||"/socket.io",this.opts=a,Nh(this,a),this.reconnection(a.reconnection!==!1),this.reconnectionAttempts(a.reconnectionAttempts||1/0),this.reconnectionDelay(a.reconnectionDelay||1e3),this.reconnectionDelayMax(a.reconnectionDelayMax||5e3),this.randomizationFactor((o=a.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new vl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(a.timeout==null?2e4:a.timeout),this._readyState="closed",this.uri=s;const u=a.parser||N5;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=a.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(s){return arguments.length?(this._reconnection=!!s,s||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(s){return s===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=s,this)}reconnectionDelay(s){var a;return s===void 0?this._reconnectionDelay:(this._reconnectionDelay=s,(a=this.backoff)===null||a===void 0||a.setMin(s),this)}randomizationFactor(s){var a;return s===void 0?this._randomizationFactor:(this._randomizationFactor=s,(a=this.backoff)===null||a===void 0||a.setJitter(s),this)}reconnectionDelayMax(s){var a;return s===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=s,(a=this.backoff)===null||a===void 0||a.setMax(s),this)}timeout(s){return arguments.length?(this._timeout=s,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(s){if(~this._readyState.indexOf("open"))return this;this.engine=new a5(this.uri,this.opts);const a=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const u=js(a,"open",function(){o.onopen(),s&&s()}),d=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),s?s(m):this.maybeReconnectOnOpen()},p=js(a,"error",d);if(this._timeout!==!1){const m=this._timeout,g=this.setTimeoutFn(()=>{u(),d(new Error("timeout")),a.close()},m);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(u),this.subs.push(p),this}connect(s){return this.open(s)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const s=this.engine;this.subs.push(js(s,"ping",this.onping.bind(this)),js(s,"data",this.ondata.bind(this)),js(s,"error",this.onerror.bind(this)),js(s,"close",this.onclose.bind(this)),js(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(s){try{this.decoder.add(s)}catch(a){this.onclose("parse error",a)}}ondecoded(s){xh(()=>{this.emitReserved("packet",s)},this.setTimeoutFn)}onerror(s){this.emitReserved("error",s)}socket(s,a){let o=this.nsps[s];return o?this._autoConnect&&!o.active&&o.connect():(o=new kE(this,s,a),this.nsps[s]=o),o}_destroy(s){const a=Object.keys(this.nsps);for(const o of a)if(this.nsps[o].active)return;this._close()}_packet(s){const a=this.encoder.encode(s);for(let o=0;o<a.length;o++)this.engine.write(a[o],s.options)}cleanup(){this.subs.forEach(s=>s()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(s,a){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",s,a),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const s=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const a=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{s.skipReconnect||(this.emitReserved("reconnect_attempt",s.backoff.attempts),!s.skipReconnect&&s.open(u=>{u?(s._reconnecting=!1,s.reconnect(),this.emitReserved("reconnect_error",u)):s.onreconnect()}))},a);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const s=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",s)}}const au={};function nh(i,s){typeof i=="object"&&(s=i,i=void 0),s=s||{};const a=r5(i,s.path||"/socket.io"),o=a.source,u=a.id,d=a.path,p=au[u]&&d in au[u].nsps,m=s.forceNew||s["force new connection"]||s.multiplex===!1||p;let g;return m?g=new $0(o,s):(au[u]||(au[u]=new $0(o,s)),g=au[u]),a.query&&!s.query&&(s.query=a.queryKey),g.socket(a.path,s)}Object.assign(nh,{Manager:$0,Socket:kE,io:nh,connect:nh});const w5=B.createContext({connected:!1,subscribe:()=>()=>{}});function E5({children:i}){const s=B.useRef(null),[a,o]=B.useState(!1),u=B.useRef(new Map),d=B.useCallback((m,g)=>{const x=u.current;return x.has(m)||x.set(m,new Set),x.get(m).add(g),()=>{const _=x.get(m);_&&(_.delete(g),_.size===0&&x.delete(m))}},[]),p=B.useCallback((m,g)=>{for(const[x,_]of u.current)if(xE(m,x))for(const w of _)try{w(g)}catch{}},[]);return B.useEffect(()=>{const m=nh({path:"/socket.io",transports:["polling","websocket"],upgrade:!0,reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:2e3});return s.current=m,console.log("[lt-socketio] connecting..."),m.on("connect",()=>{console.log("[lt-socketio] connected, id:",m.id),o(!0)}),m.on("disconnect",g=>{console.log("[lt-socketio] disconnected:",g),o(!1)}),m.on("connect_error",g=>{console.warn("[lt-socketio] connect error:",g.message),o(!1)}),m.onAny((g,x)=>{if(g.startsWith("lt."))try{const _=typeof x=="string"?JSON.parse(x):x;p(g,_)}catch{}}),()=>{m.removeAllListeners(),m.disconnect(),s.current=null,o(!1)}},[p]),b.jsxDEV(w5.Provider,{value:{connected:a,subscribe:d},children:b.jsxDEV(vh.Provider,{value:{connected:a,subscribe:d},children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useSocketIO.tsx",lineNumber:163,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/hooks/useSocketIO.tsx",lineNumber:162,columnNumber:5},this)}function _5({children:i}){const[s,a]=B.useState(null);return B.useEffect(()=>{let o=!1;async function u(){var d;try{console.log("[lt-transport] detecting event transport...");const p=await fetch("/api/settings");if(!p.ok){console.warn("[lt-transport] settings fetch failed, falling back to socketio"),o||a("socketio");return}const m=await p.json(),g=(d=m==null?void 0:m.events)==null?void 0:d.transport;console.log("[lt-transport] server reports:",g),o||a(g==="nats"?"nats":"socketio")}catch(p){console.warn("[lt-transport] settings fetch error, falling back to socketio",p),o||a("socketio")}}return u(),()=>{o=!0}},[]),s==="nats"?b.jsxDEV(EO,{children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useEventTransport.tsx",lineNumber:48,columnNumber:12},this):s==="socketio"?b.jsxDEV(E5,{children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useEventTransport.tsx",lineNumber:52,columnNumber:12},this):b.jsxDEV(b.Fragment,{children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useEventTransport.tsx",lineNumber:56,columnNumber:10},this)}const VE=B.createContext(null),Ew="lt_sidebar_collapsed";function A5({children:i}){const[s,a]=B.useState(()=>{try{return localStorage.getItem(Ew)==="true"}catch{return!1}}),o=B.useCallback(()=>{a(u=>{const d=!u;try{localStorage.setItem(Ew,String(d))}catch{}return d})},[]);return b.jsxDEV(VE.Provider,{value:{collapsed:s,toggle:o},children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useSidebar.tsx",lineNumber:40,columnNumber:5},this)}function UE(){const i=B.useContext(VE);if(!i)throw new Error("useSidebar must be used within SidebarProvider");return i}function E6(i){const s=i?`?period=${i}`:"";return ii({queryKey:["escalationStats",i],queryFn:()=>Nt(`/escalations/stats${s}`)})}function _6(){return ii({queryKey:["escalationTypes"],queryFn:()=>Nt("/escalations/types")})}function D5(i){const s=new URLSearchParams;return i.status&&s.set("status",i.status),i.role&&s.set("role",i.role),i.type&&s.set("type",i.type),i.subtype&&s.set("subtype",i.subtype),i.assigned_to&&s.set("assigned_to",i.assigned_to),i.priority&&s.set("priority",String(i.priority)),i.limit&&s.set("limit",String(i.limit)),i.offset!==void 0&&s.set("offset",String(i.offset)),i.sort_by&&s.set("sort_by",i.sort_by),i.order&&s.set("order",i.order),ii({queryKey:["escalations",i],queryFn:()=>Nt(`/escalations?${s}`)})}function A6(i){return ii({queryKey:["escalations","by-workflow",i],queryFn:()=>Nt(`/escalations/by-workflow/${i}`),enabled:!!i})}function D6(i){return ii({queryKey:["escalations",i],queryFn:()=>Nt(`/escalations/${i}`),enabled:!!i})}function C6(){const i=Vs();return Sa({mutationFn:({id:s,durationMinutes:a})=>Nt(`/escalations/${s}/claim`,{method:"POST",body:JSON.stringify({durationMinutes:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function T6(){const i=Vs();return Sa({mutationFn:s=>Nt(`/escalations/${s}/release`,{method:"POST"}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function O6(){const i=Vs();return Sa({mutationFn:({id:s,resolverPayload:a})=>Nt(`/escalations/${s}/resolve`,{method:"POST",body:JSON.stringify({resolverPayload:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"}),i.invalidateQueries({queryKey:["tasks"],refetchType:"all"}),i.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function R6(){const i=Vs();return Sa({mutationFn:({id:s,targetRole:a})=>Nt(`/escalations/${s}/escalate`,{method:"PATCH",body:JSON.stringify({targetRole:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function j6(){const i=Vs();return Sa({mutationFn:({ids:s,priority:a})=>Nt("/escalations/priority",{method:"PATCH",body:JSON.stringify({ids:s,priority:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function M6(){const i=Vs();return Sa({mutationFn:({ids:s,durationMinutes:a})=>Nt("/escalations/bulk-claim",{method:"POST",body:JSON.stringify({ids:s,durationMinutes:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function k6(){const i=Vs();return Sa({mutationFn:({ids:s,targetUserId:a,durationMinutes:o})=>Nt("/escalations/bulk-assign",{method:"POST",body:JSON.stringify({ids:s,targetUserId:a,durationMinutes:o})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function V6(){const i=Vs();return Sa({mutationFn:({ids:s,targetRole:a})=>Nt("/escalations/bulk-escalate",{method:"PATCH",body:JSON.stringify({ids:s,targetRole:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function U6(){const i=Vs();return Sa({mutationFn:({ids:s,hint:a})=>Nt("/escalations/bulk-triage",{method:"POST",body:JSON.stringify({ids:s,...a?{hint:a}:{}})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function C5(){const{user:i}=Ki(),s=i==null?void 0:i.userId,a=Vs(),{data:o}=D5({assigned_to:s,status:"pending"});NE(`${xO}.escalation.>`,()=>{s&&a.invalidateQueries({queryKey:["escalations"]})});const u=new Date;return((o==null?void 0:o.escalations)??[]).filter(p=>p.assigned_until&&new Date(p.assigned_until)>u).length}function T5({className:i="",onClick:s}){const{connected:a}=NO();return b.jsxDEV("button",{type:"button",onClick:s,className:`relative text-text-tertiary hover:text-accent transition-colors ${i}`,title:a?"Live events enabled":"Live events disconnected","aria-label":a?"Live events enabled":"Live events disconnected",children:[b.jsxDEV(qC,{className:"w-4 h-4",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/NatsStatus.tsx",lineNumber:24,columnNumber:7},this),b.jsxDEV("span",{className:`absolute -top-1 -right-1 w-2 h-2 rounded-full ${a?"bg-emerald-500":"bg-text-tertiary"}`,"data-testid":"nats-status-dot"},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/NatsStatus.tsx",lineNumber:25,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/display/NatsStatus.tsx",lineNumber:17,columnNumber:5},this)}function oy({size:i="sm",hideLabel:s=!1}){const a=i==="lg",o=a?"w-[16rem] h-[16rem] -rotate-[120deg] opacity-40 -ml-10":"w-[12.5rem] h-[12.5rem] -rotate-[120deg] opacity-40 -ml-8",u=a?"text-[44px] font-normal text-text-primary tracking-[0.15em] -ml-[12.5rem]":"text-[36px] font-normal text-text-primary tracking-[0.15em] -ml-[9.75rem]";return b.jsxDEV("div",{className:"flex items-center",style:{height:"50px"},children:[b.jsxDEV("img",{src:"/logo512.png",alt:"LongTail",className:`shrink-0 z-0 ${o}`},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/AppLogo.tsx",lineNumber:28,columnNumber:7},this),b.jsxDEV("span",{className:`z-[1] transition-opacity duration-300 ${u} ${s?"opacity-0":""}`,children:"LongTail"},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/AppLogo.tsx",lineNumber:33,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/display/AppLogo.tsx",lineNumber:27,columnNumber:5},this)}function O5({onToggleEventFeed:i,onToggleDocs:s}){const{user:a,logout:o}=Ki(),u=C5(),[d,p]=B.useState(!1),m=B.useRef(null);return B.useEffect(()=>{if(!d)return;const g=x=>{m.current&&!m.current.contains(x.target)&&p(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[d]),b.jsxDEV("header",{className:"h-14 shrink-0 border-b border-surface-border bg-surface-raised flex items-center justify-between px-5 relative z-30",children:[b.jsxDEV("div",{className:"flex items-center gap-4",children:b.jsxDEV(uu,{to:"/","aria-label":"Home",children:b.jsxDEV(oy,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:31,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:30,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:29,columnNumber:7},this),b.jsxDEV("div",{className:"flex items-center gap-4",children:[b.jsxDEV("button",{onClick:s,className:"text-text-tertiary hover:text-accent transition-colors","aria-label":"Documentation",title:"Documentation",children:b.jsxDEV(Xw,{className:"w-4 h-4",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:43,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:37,columnNumber:9},this),b.jsxDEV(uu,{to:"/escalations/queue",className:"relative text-text-tertiary hover:text-accent transition-colors","aria-label":"Escalation inbox",title:"Escalation inbox",children:[b.jsxDEV(LC,{className:"w-4 h-4",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:51,columnNumber:11},this),b.jsxDEV("span",{className:`absolute -top-1 -right-1 w-2 h-2 rounded-full ${u>0?"bg-status-warning":"bg-text-tertiary"}`},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:52,columnNumber:11},this),b.jsxDEV("span",{className:`absolute -top-2.5 -right-3 text-[8px] font-bold tabular-nums ${u>0?"text-status-warning":"text-text-tertiary"}`,children:u},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:53,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:45,columnNumber:9},this),b.jsxDEV(T5,{onClick:i},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:55,columnNumber:9},this),a&&b.jsxDEV("div",{className:"relative",ref:m,children:[b.jsxDEV("button",{onClick:()=>p(g=>!g),className:"btn-ghost text-xs flex items-center gap-1",children:[b.jsxDEV(HC,{className:"w-3.5 h-3.5 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:62,columnNumber:15},this),a.displayName||a.username||a.userId,b.jsxDEV("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:65,columnNumber:17},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:64,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:58,columnNumber:13},this),d&&b.jsxDEV("div",{className:"absolute right-0 top-full mt-1 w-48 bg-surface-raised border border-surface-border rounded-md shadow-lg py-1 z-50",children:[b.jsxDEV(uu,{to:"/credentials",onClick:()=>p(!1),className:"block px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:"Credentials"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:70,columnNumber:17},this),b.jsxDEV("button",{onClick:()=>{p(!1),o()},className:"block w-full text-left px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:"Sign Out"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:77,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:69,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:57,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:36,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:28,columnNumber:5},this)}function ly({open:i,children:s}){const[a,o]=B.useState(i);return B.useEffect(()=>{i&&o(!0)},[i]),b.jsxDEV("div",{className:`grid transition-[grid-template-rows] duration-300 ease-out ${i?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,onTransitionEnd:()=>{i||o(!1)},children:b.jsxDEV("div",{className:"overflow-hidden",children:a?s:null},void 0,!1,{fileName:"/app/dashboard/src/components/common/layout/Collapsible.tsx",lineNumber:15,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/layout/Collapsible.tsx",lineNumber:11,columnNumber:5},this)}function I0(i){return({isActive:s})=>{const a="flex items-center rounded-md transition-colors duration-150",o="bg-surface-hover text-text-primary font-medium",u="text-text-secondary hover:text-text-primary hover:bg-surface-hover";return i?`${a} justify-center w-10 h-10 mx-auto ${s?o:u}`:`${a} gap-3 px-4 py-2 text-sm ${s?o:u}`}}function R5(){return({isActive:i})=>`flex items-center gap-3 pl-11 pr-4 py-1.5 text-xs rounded-md transition-colors duration-150 ${i?"text-text-primary font-medium":"text-text-secondary hover:text-text-primary"}`}function j5({group:i,collapsed:s}){const{pathname:a}=Zi(),o=i.matchPaths.some(m=>a.startsWith(m)),[u,d]=B.useState(o),p=u||o;return s?b.jsxDEV(b.Fragment,{children:i.items.map(m=>b.jsxDEV(sh,{to:m.to,className:I0(!0),title:m.label,children:m.icon&&b.jsxDEV(m.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:70,columnNumber:26},this)},m.to,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:64,columnNumber:11},this))},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:62,columnNumber:7},this):b.jsxDEV("div",{children:[b.jsxDEV("button",{onClick:()=>d(m=>!m),className:"w-full flex items-center justify-between px-4 py-2 text-sm rounded-md transition-colors duration-150 text-text-secondary hover:text-text-primary hover:bg-surface-hover",children:[b.jsxDEV("span",{className:"flex items-center gap-3",children:[i.icon&&b.jsxDEV(i.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:84,columnNumber:26},this),b.jsxDEV("span",{children:i.label},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:85,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:83,columnNumber:9},this),b.jsxDEV("svg",{className:`w-3.5 h-3.5 text-text-tertiary transition-transform duration-150 ${p?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:94,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:87,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:79,columnNumber:7},this),b.jsxDEV(ly,{open:p,children:i.items.map(m=>b.jsxDEV(sh,{to:m.to,end:m.end,className:R5(),children:[m.icon&&b.jsxDEV(m.icon,{className:"w-4 h-4 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:100,columnNumber:26},this),b.jsxDEV("span",{children:m.label},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:101,columnNumber:13},this)]},m.to,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:99,columnNumber:11},this))},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:97,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:78,columnNumber:5},this)}function M5(i){return i.kind==="group"}function k5({entry:i,collapsed:s}){const{pathname:a,search:o}=Zi();if(i.to.includes("?")){const[d,p]=i.to.split("?"),m=a===d&&o===`?${p}`,g=I0(s)({isActive:m});return b.jsxDEV(sh,{to:i.to,className:g,title:s?i.label:void 0,children:[i.icon&&b.jsxDEV(i.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:128,columnNumber:24},this),!s&&b.jsxDEV("span",{children:i.label},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:129,columnNumber:24},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:127,columnNumber:7},this)}return b.jsxDEV(sh,{to:i.to,end:i.end,className:I0(s),title:s?i.label:void 0,children:[i.icon&&b.jsxDEV(i.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:141,columnNumber:22},this),!s&&b.jsxDEV("span",{children:i.label},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:142,columnNumber:22},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:135,columnNumber:5},this)}function cy({heading:i,entries:s}){const{collapsed:a}=UE();return b.jsxDEV("div",{className:"space-y-1",children:[a?b.jsxDEV("div",{className:"h-px bg-surface-border mx-3 my-2",title:i},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:153,columnNumber:9},this):b.jsxDEV("p",{className:"px-4 py-2 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:i},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:155,columnNumber:9},this),s.map(o=>M5(o)?b.jsxDEV(j5,{group:o,collapsed:a},o.label,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:161,columnNumber:11},this):b.jsxDEV(k5,{entry:o,collapsed:a},o.to,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:163,columnNumber:11},this))]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:151,columnNumber:5},this)}const V5=[{to:"/admin/users",label:"Accounts",icon:PC},{to:"/admin/roles",label:"Roles & Permissions",icon:$C},{to:"/admin/maintenance",label:"DB Maintenance",icon:IC},{to:"/admin/controlplane",label:"Task Queues",icon:YC}];function U5(){return b.jsxDEV(cy,{heading:"Admin",entries:V5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/AdminSidebar.tsx",lineNumber:17,columnNumber:10},this)}const z5=[{to:"/workflows/registry",label:"Workflow Registry",icon:FC},{to:"/workflows/start",label:"Invoke Workflow",icon:JC},{to:"/escalations/available",label:"All Escalations",icon:GC},{to:"/workflows/executions",label:"Durable Executions",icon:Zw}];function B5(){return b.jsxDEV(cy,{heading:"Durable Workflows",entries:z5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EngineerSidebar.tsx",lineNumber:12,columnNumber:10},this)}const q5=[{to:"/mcp/servers",label:"MCP Server Tools",icon:QC},{to:"/mcp/workflows",label:"MCP Pipeline Tools",icon:Y0},{to:"/mcp/queries",label:"Pipeline Designer",icon:XC},{to:"/mcp/executions",label:"Pipeline Executions",icon:Zw}];function L5(){return b.jsxDEV(cy,{heading:"MCP Workflows",entries:q5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/McpSidebar.tsx",lineNumber:12,columnNumber:10},this)}function H5({children:i,className:s=""}){return b.jsxDEV("p",{className:`text-[10px] font-semibold uppercase tracking-widest text-text-tertiary ${s}`,children:i},void 0,!1,{fileName:"/app/dashboard/src/components/common/layout/SectionLabel.tsx",lineNumber:10,columnNumber:5},this)}const g0=280,_w="cubic-bezier(0.4, 0, 0.2, 1)",Gd=40;function P5(i){if(!i)return"scale(0.92)";const s=window.innerWidth,a=window.innerHeight,o=s-Gd*2,u=a-Gd*2,d=i.width/o,p=i.height/u,m=i.left+i.width/2-(Gd+o/2),g=i.top+i.height/2-(Gd+u/2);return`translate(${m}px, ${g}px) scale(${d}, ${p})`}function zE({open:i,onClose:s,sourceRef:a,children:o}){const[u,d]=B.useState(null),p=B.useRef(null),m=B.useRef(!1);B.useEffect(()=>{var D,z;i&&!m.current?(p.current=((D=a==null?void 0:a.current)==null?void 0:D.getBoundingClientRect())??null,d("entering")):!i&&m.current&&u==="open"&&(p.current=((z=a==null?void 0:a.current)==null?void 0:z.getBoundingClientRect())??null,d("exiting")),m.current=i},[i,a,u]),B.useEffect(()=>{if(u!=="entering")return;const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>d("open"))});return()=>cancelAnimationFrame(D)},[u]),B.useEffect(()=>{if(u)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[u]),B.useEffect(()=>{if(!u)return;const D=z=>{z.key==="Escape"&&s()};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[u,s]);const g=B.useCallback(D=>{D.propertyName==="transform"&&u==="exiting"&&d(null)},[u]);if(B.useEffect(()=>{if(u!=="exiting")return;const D=setTimeout(()=>d(null),g0+50);return()=>clearTimeout(D)},[u]),!u)return null;const x=u==="entering"||u==="exiting",_=x?P5(p.current):"none",w=x?0:1;return Gw.createPortal(b.jsxDEV("div",{className:"fixed inset-0 z-50 overflow-auto p-10",style:{transformOrigin:"center center",transition:`transform ${g0}ms ${_w}, opacity ${g0}ms ${_w}`,transform:_,opacity:w,backgroundColor:"#FFFFFF"},onTransitionEnd:g,children:o},void 0,!1,{fileName:"/app/dashboard/src/components/common/layout/FullscreenOverlay.tsx",lineNumber:93,columnNumber:5},this),document.body)}function $5(i){const s=i.trim().split(`
271
+ ${m.stack}`),p.reject(x)):p.resolve(_))}});return g.requestSubject=s,this.protocol.publish(s,a,{reply:d,headers:o.headers}),p}else{const d=new lE(this.protocol.muxSubscriptions,s,o,u);this.protocol.request(d);try{this.publish(s,a,{reply:`${this.protocol.muxSubscriptions.baseInbox}${d.token}`,headers:o.headers})}catch(m){d.cancel(m)}const p=Promise.race([d.timer,d.deferred]);return p.catch(()=>{d.cancel()}),p}}flush(){return this.isClosed()?Promise.reject(ge.errorForCode(ue.ConnectionClosed)):this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(ge.errorForCode(ue.ConnectionClosed)):this.isDraining()?Promise.reject(ge.errorForCode(ue.ConnectionDraining)):(this.draining=!0,this.protocol.drain())}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){const s=this.protocol.getServer();return s?s.listen:""}status(){const s=new sn;return s.iterClosed.then(()=>{const a=this.listeners.indexOf(s);this.listeners.splice(a,1)}),this.listeners.push(s),s}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}async context(){return(await this.request("$SYS.REQ.USER.INFO")).json((a,o)=>a==="time"?new Date(Date.parse(o)):o)}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}async jetstreamManager(s={}){const a=new W3(this,s);if(s.checkAPI!==!1)try{await a.getAccountInfo()}catch(o){const u=o;throw u.code===ue.NoResponders&&(u.code=ue.JetStreamNotEnabled),u}return a}jetstream(s={}){return new ey(this,s)}getServerVersion(){const s=this.info;return s?Xi(s.version):void 0}async rtt(){if(!this.protocol._closed&&!this.protocol.connected)throw ge.errorForCode(ue.Disconnect);const s=Date.now();return await this.flush(),Date.now()-s}get features(){return this.protocol.features}get services(){return this._services||(this._services=new sO(this)),this._services}reconnect(){return this.isClosed()?Promise.reject(ge.errorForCode(ue.ConnectionClosed)):this.isDraining()?Promise.reject(ge.errorForCode(ue.ConnectionDraining)):this.protocol.reconnect()}}class sO{constructor(s){S(this,"nc");this.nc=s}add(s){try{return new Su(this.nc,s).start()}catch(a){return Promise.reject(a)}}client(s,a){return new U3(this.nc,s,a)}}class aO{constructor(s,a,o){S(this,"bucket");S(this,"sm");S(this,"prefixLen");this.bucket=s,this.prefixLen=a,this.sm=o}get key(){return this.sm.subject.substring(this.prefixLen)}get value(){return this.sm.data}get delta(){return 0}get created(){return this.sm.time}get revision(){return this.sm.seq}get operation(){return this.sm.header.get(fh)||"PUT"}get length(){const s=this.sm.header.get(Dn.MessageSizeHdr)||"";return s!==""?parseInt(s,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class rO{constructor(s,a,o){S(this,"bucket");S(this,"key");S(this,"sm");this.bucket=s,this.key=a,this.sm=o}get value(){return this.sm.data}get created(){return new Date(Q0(this.sm.info.timestampNanos))}get revision(){return this.sm.seq}get operation(){var s;return((s=this.sm.headers)==null?void 0:s.get(fh))||"PUT"}get delta(){return this.sm.info.pending}get length(){var a;const s=((a=this.sm.headers)==null?void 0:a.get(Dn.MessageSizeHdr))||"";return s!==""?parseInt(s,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class gE extends GT{constructor(a,o,u){super(a.nc,o,u);S(this,"js");S(this,"monitor");this.js=a,this.monitor=null,this.sub.closed.then(()=>{this.monitor&&this.monitor.cancel()})}set info(a){this.sub.info=a}get info(){return this.sub.info}_resetOrderedConsumer(a){if(this.info===null||this.sub.isClosed())return;const o=nr(this.js.nc.options.inboxPrefix);this.js.nc._resub(this.sub,o);const d=this.info;d.config.name=ai.next(),d.ordered_consumer_sequence.delivery_seq=0,d.flow_control.heartbeat_count=0,d.flow_control.fc_count=0,d.flow_control.consumer_restarts++,d.deliver=o,d.config.deliver_subject=o,d.config.deliver_policy=Vt.StartSequence,d.config.opt_start_seq=a;const p={};p.stream_name=this.info.stream,p.config=d.config;const m=`${d.api.prefix}.CONSUMER.CREATE.${d.stream}`;this.js._request(m,p,{retries:-1}).then(g=>{const x=g,_=this.sub.info;_.last=x,this.info.config=x.config,this.info.name=x.name}).catch(g=>{const x=new ge(`unable to recreate ordered consumer ${d.stream} at seq ${a}`,ue.RequestError,g);this.sub.callback(x,{})})}_maybeSetupHbMonitoring(){var o,u;const a=((u=(o=this.info)==null?void 0:o.config)==null?void 0:u.idle_heartbeat)||0;a&&this._setupHbMonitoring(Q0(a))}_setupHbMonitoring(a,o=0){const u={cancelAfter:0,maxOut:2};o&&(u.cancelAfter=o);const d=this.sub,p=m=>{var _,w,D,z;const g=CT(409,`${ys.IdleHeartbeatMissed}: ${m}`,this.sub.subject);if(!((_=this.info)==null?void 0:_.ordered))this.sub.callback(null,g);else{if(!this.js.nc.protocol.connected)return!1;const q=((D=(w=this.info)==null?void 0:w.ordered_consumer_sequence)==null?void 0:D.stream_seq)||0;return this._resetOrderedConsumer(q+1),(z=this.monitor)==null||z.restart(),!1}return!d.noIterator};this.monitor=new Z0(a,p,u)}_checkHbOrderConsumer(a){const o=a.headers.get(Dn.ConsumerStalledHdr);o!==""&&this.js.nc.publish(o);const u=parseInt(a.headers.get(Dn.LastConsumerSeqHdr),10),d=this.info.ordered_consumer_sequence;return this.info.flow_control.heartbeat_count++,u!==d.delivery_seq&&this._resetOrderedConsumer(d.stream_seq+1),!1}_checkOrderedConsumer(a){const o=this.info.ordered_consumer_sequence,u=a.info.streamSequence,d=a.info.deliverySequence;return d!=o.delivery_seq+1?(this._resetOrderedConsumer(o.stream_seq+1),!1):(o.delivery_seq=d,o.stream_seq=u,!0)}async destroy(){this.isClosed()||await this.drain();const a=this.sub.info,o=a.config.durable_name||a.name,u=`${a.api.prefix}.CONSUMER.DELETE.${a.stream}.${o}`;await a.api._request(u)}async consumerInfo(){const a=this.sub.info,o=a.config.durable_name||a.name,u=`${a.api.prefix}.CONSUMER.INFO.${a.stream}.${o}`,d=await a.api._request(u);return a.last=d,d}}class iO extends gE{constructor(s,a,o){super(s,a,o)}pull(s={batch:1}){const{stream:a,config:o,name:u}=this.sub.info,d=o.durable_name??u,p={};if(p.batch=s.batch||1,p.no_wait=s.no_wait||!1,(s.max_bytes??0)>0){const x=this.js.nc.features.get(et.JS_PULL_MAX_BYTES);if(!x.ok)throw new Error(`max_bytes is only supported on servers ${x.min} or better`);p.max_bytes=s.max_bytes}let m=0;s.expires&&s.expires>0&&(m=s.expires,p.expires=Et(m));let g=0;if(s.idle_heartbeat&&s.idle_heartbeat>0&&(g=s.idle_heartbeat,p.idle_heartbeat=Et(g)),g&&m===0)throw new Error("idle_heartbeat requires expires");if(g>m)throw new Error("expires must be greater than idle_heartbeat");if(this.info){this.monitor&&this.monitor.cancel(),m&&g&&(this.monitor?this.monitor._change(g,m):this._setupHbMonitoring(g,m));const x=this.info.api,_=`${x.prefix}.CONSUMER.MSG.NEXT.${a}.${d}`,w=this.sub.subject;x.nc.publish(_,x.jc.encode(p),{reply:w})}}}function oO(i,s){return i?cO(s):lO(s)}function lO(i){return(s,a)=>s?[s,null]:(s=dl(a),s?[s,null]:[null,vu(a,i)])}function cO(i){return(s,a)=>{if(s)return[s,null];const o=dl(a);return o!==null?[vE(o),null]:[null,vu(a,i)]}}function vE(i){if(i!==null)switch(i.code){case ue.JetStream404NoMessages:case ue.JetStream408RequestTimeout:return null;case ue.JetStream409:return TT(i)?i:null;default:return i}return null}function uO(i){i&&i.ack()}function fO(i){const s=i.split(".");if(s.length===9&&s.splice(2,0,"_",""),s.length<11||s[0]!=="$JS"||s[1]!=="ACK")throw new Error("not js message");const a={};return a.domain=s[2]==="_"?"":s[2],a.account_hash=s[3],a.stream=s[4],a.consumer=s[5],a.deliveryCount=parseInt(s[6],10),a.redeliveryCount=a.deliveryCount,a.redelivered=a.deliveryCount>1,a.streamSequence=parseInt(s[7],10),a.deliverySequence=parseInt(s[8],10),a.timestampNanos=parseInt(s[9],10),a.pending=parseInt(s[10],10),a}class dO{constructor(s,a){S(this,"msg");S(this,"di");S(this,"didAck");S(this,"timeout");this.msg=s,this.didAck=!1,this.timeout=a}get subject(){return this.msg.subject}get sid(){return this.msg.sid}get data(){return this.msg.data}get headers(){return this.msg.headers}get info(){return this.di||(this.di=fO(this.reply)),this.di}get redelivered(){return this.info.deliveryCount>1}get reply(){return this.msg.reply||""}get seq(){return this.info.streamSequence}doAck(s){this.didAck||(this.didAck=!this.isWIP(s),this.msg.respond(s))}isWIP(s){return s.length===4&&s[0]===su[0]&&s[1]===su[1]&&s[2]===su[2]&&s[3]===su[3]}async ackAck(s){var o;s=s||{},s.timeout=s.timeout||this.timeout;const a=_t();if(this.didAck)a.resolve(!1);else if(this.didAck=!0,this.msg.reply){const d=this.msg.publisher,p=!((o=d.options)!=null&&o.noAsyncTraces),m=new lE(d.muxSubscriptions,this.msg.reply,{timeout:s.timeout},p);d.request(m);try{d.publish(this.msg.reply,mw,{reply:`${d.muxSubscriptions.baseInbox}${m.token}`})}catch(g){m.cancel(g)}try{await Promise.race([m.timer,m.deferred]),a.resolve(!0)}catch(g){m.cancel(g),a.reject(g)}}else a.resolve(!1);return a}ack(){this.doAck(mw)}nak(s){let a=F3;s&&(a=w0().encode(`-NAK ${JSON.stringify({delay:Et(s)})}`)),this.doAck(a)}working(){this.doAck(su)}next(s,a={batch:1}){const o={};o.batch=a.batch||1,o.no_wait=a.no_wait||!1,a.expires&&a.expires>0&&(o.expires=Et(a.expires));const u=ks().encode(o),d=yl.concat(J3,Q3,u),p=s?{reply:s}:void 0;this.msg.respond(d,p)}term(s=""){let a=G3;(s==null?void 0:s.length)>0&&(a=w0().encode(`+TERM ${s}`)),this.doAck(a)}json(){return this.msg.json()}string(){return this.msg.string()}}const hO="1.30.3",mO="nats.ws";class pO{constructor(){S(this,"version");S(this,"lang");S(this,"closeError");S(this,"connected");S(this,"done");S(this,"socket");S(this,"options");S(this,"socketClosed");S(this,"encrypted");S(this,"peeked");S(this,"yields");S(this,"signal");S(this,"closedNotification");this.version=hO,this.lang=mO,this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=_t(),this.closedNotification=_t()}async connect(s,a){const o=_t();if(a.tls)return o.reject(new ge("tls",ue.InvalidOption)),o;this.options=a;const u=s.src;if(a.wsFactory){const{socket:d,encrypted:p}=await a.wsFactory(s.src,a);this.socket=d,this.encrypted=p}else this.encrypted=u.indexOf("wss://")===0,this.socket=new WebSocket(u);return this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.isDiscarded()},this.socket.onmessage=d=>{if(this.isDiscarded())return;if(this.yields.push(new Uint8Array(d.data)),this.peeked){this.signal.resolve();return}const p=yl.concat(...this.yields),m=e3(p);if(m!==""){const g=C3.exec(m);if(!g){a.debug&&console.error("!!!",Hd(p)),o.reject(new Error("unexpected response from server"));return}try{const x=JSON.parse(g[1]);A3(x,this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),o.resolve()}catch(x){o.reject(x);return}}},this.socket.onclose=d=>{if(this.isDiscarded())return;this.socketClosed=!0;let p;this.done||(d.wasClean||(p=new Error(d.reason)),this._closed(p))},this.socket.onerror=d=>{if(this.isDiscarded())return;const p=d,m=new ge(p.message,ue.Unknown,new Error(p.error));o.reject(m)},o}disconnect(){this._closed(void 0,!0)}async _closed(s,a=!0){if(!this.isDiscarded()&&this.connected&&!this.done){if(this.closeError=s,!s)for(;!this.socketClosed&&this.socket.bufferedAmount>0;)await gl(100);this.done=!0;try{this.socket.close(s?1002:1e3,s?s.message:void 0)}catch{}a&&this.closedNotification.resolve(s)}}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async*iterate(){for(;;){if(this.isDiscarded())return;this.yields.length===0&&await this.signal;const s=this.yields;this.yields=[];for(let a=0;a<s.length;a++)this.options.debug&&console.info(`> ${Hd(s[a])}`),yield s[a];if(this.done)break;this.yields.length===0&&(s.length=0,this.yields=s,this.signal=_t())}}isEncrypted(){return this.connected&&this.encrypted}send(s){if(!this.isDiscarded())try{this.socket.send(s.buffer),this.options.debug&&console.info(`< ${Hd(s)}`);return}catch(a){this.options.debug&&console.error(`!!! ${Hd(s)}: ${a}`)}}close(s){return this._closed(s,!1)}closed(){return this.closedNotification}isDiscarded(){return this.done?(this.discard(),!0):!1}discard(){var s;this.done=!0;try{(s=this.socket)==null||s.close()}catch{}}}function bO(i,s){/^(.*:\/\/)(.*)/.test(i)||(typeof s=="boolean"?i=`${s===!0?"https":"http"}://${i}`:i=`https://${i}`);let o=new URL(i);const u=o.protocol.toLowerCase();u==="ws:"&&(s=!1),u==="wss:"&&(s=!0),u!=="https:"&&u!=="http"&&(i=i.replace(/^(.*:\/\/)(.*)/gm,"$2"),o=new URL(`http://${i}`));let d,p;const m=o.hostname,g=o.pathname,x=o.search||"";switch(u){case"http:":case"ws:":case"nats:":p=o.port||"80",d="ws:";break;case"https:":case"wss:":case"tls:":p=o.port||"443",d="wss:";break;default:p=o.port||s===!0?"443":"80",d=s===!0?"wss:":"ws:";break}return`${d}//${m}:${p}${g}${x}`}function yO(i={}){return QT({defaultPort:443,urlParseFn:bO,factory:()=>new pO}),ty.connect(i)}const gO="ws://localhost:9222",vO="dev_api_secret",xO="lt.events";function xE(i,s){const a=i.split("."),o=s.split(".");for(let u=0;u<o.length;u++){const d=o[u];if(d===">")return!0;if(u>=a.length||d!=="*"&&d!==a[u])return!1}return a.length===o.length}const vh=B.createContext({connected:!1,subscribe:()=>()=>{}});function NO(){const{connected:i}=B.useContext(vh);return{connected:i}}function NE(i,s){const{subscribe:a}=B.useContext(vh),o=B.useRef(s);o.current=s,B.useEffect(()=>a(i,d=>o.current(d)),[a,i])}const SO=B.createContext({connected:!1,subscribe:()=>()=>{}}),wO=w0();function EO({children:i}){const s=B.useRef(null),a=B.useRef(null),[o,u]=B.useState(!1),d=B.useRef(null),p=B.useRef(new Map),m=B.useCallback((_,w)=>{const D=p.current;return D.has(_)||D.set(_,new Set),D.get(_).add(w),()=>{const z=D.get(_);z&&(z.delete(w),z.size===0&&D.delete(_))}},[]),g=B.useCallback((_,w)=>{for(const[D,z]of p.current)if(xE(_,D))for(const q of z)try{q(w)}catch{}},[]),x=B.useCallback(async()=>{try{if(s.current)return;const _=await yO({servers:gO,token:vO,reconnect:!0,maxReconnectAttempts:-1,reconnectTimeWait:2e3});s.current=_,u(!0);const w=_.subscribe("lt.>");a.current=w,(async()=>{for await(const D of w)try{const z=JSON.parse(wO.decode(D.data));g(D.subject,z)}catch{}})(),(async()=>{for await(const D of _.status())D.type==="disconnect"||D.type==="error"?u(!1):D.type==="reconnect"&&u(!0)})()}catch{u(!1),d.current=setTimeout(x,3e3)}},[g]);return B.useEffect(()=>(x(),()=>{d.current&&clearTimeout(d.current),a.current&&a.current.unsubscribe(),s.current&&(s.current.close().catch(()=>{}),s.current=null),u(!1)}),[x]),b.jsxDEV(SO.Provider,{value:{connected:o,subscribe:m},children:b.jsxDEV(vh.Provider,{value:{connected:o,subscribe:m},children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useNats.tsx",lineNumber:192,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/hooks/useNats.tsx",lineNumber:191,columnNumber:5},this)}const Na=Object.create(null);Na.open="0";Na.close="1";Na.ping="2";Na.pong="3";Na.message="4";Na.upgrade="5";Na.noop="6";const Wd=Object.create(null);Object.keys(Na).forEach(i=>{Wd[Na[i]]=i});const z0={type:"error",data:"parser error"},SE=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wE=typeof ArrayBuffer=="function",EE=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer,ny=({type:i,data:s},a,o)=>SE&&s instanceof Blob?a?o(s):bw(s,o):wE&&(s instanceof ArrayBuffer||EE(s))?a?o(s):bw(new Blob([s]),o):o(Na[i]+(s||"")),bw=(i,s)=>{const a=new FileReader;return a.onload=function(){const o=a.result.split(",")[1];s("b"+(o||""))},a.readAsDataURL(i)};function yw(i){return i instanceof Uint8Array?i:i instanceof ArrayBuffer?new Uint8Array(i):new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let h0;function _O(i,s){if(SE&&i.data instanceof Blob)return i.data.arrayBuffer().then(yw).then(s);if(wE&&(i.data instanceof ArrayBuffer||EE(i.data)))return s(yw(i.data));ny(i,!1,a=>{h0||(h0=new TextEncoder),s(h0.encode(a))})}const gw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i<gw.length;i++)cu[gw.charCodeAt(i)]=i;const AO=i=>{let s=i.length*.75,a=i.length,o,u=0,d,p,m,g;i[i.length-1]==="="&&(s--,i[i.length-2]==="="&&s--);const x=new ArrayBuffer(s),_=new Uint8Array(x);for(o=0;o<a;o+=4)d=cu[i.charCodeAt(o)],p=cu[i.charCodeAt(o+1)],m=cu[i.charCodeAt(o+2)],g=cu[i.charCodeAt(o+3)],_[u++]=d<<2|p>>4,_[u++]=(p&15)<<4|m>>2,_[u++]=(m&3)<<6|g&63;return x},DO=typeof ArrayBuffer=="function",sy=(i,s)=>{if(typeof i!="string")return{type:"message",data:_E(i,s)};const a=i.charAt(0);return a==="b"?{type:"message",data:CO(i.substring(1),s)}:Wd[a]?i.length>1?{type:Wd[a],data:i.substring(1)}:{type:Wd[a]}:z0},CO=(i,s)=>{if(DO){const a=AO(i);return _E(a,s)}else return{base64:!0,data:i}},_E=(i,s)=>{switch(s){case"blob":return i instanceof Blob?i:new Blob([i]);case"arraybuffer":default:return i instanceof ArrayBuffer?i:i.buffer}},AE="",TO=(i,s)=>{const a=i.length,o=new Array(a);let u=0;i.forEach((d,p)=>{ny(d,!1,m=>{o[p]=m,++u===a&&s(o.join(AE))})})},OO=(i,s)=>{const a=i.split(AE),o=[];for(let u=0;u<a.length;u++){const d=sy(a[u],s);if(o.push(d),d.type==="error")break}return o};function RO(){return new TransformStream({transform(i,s){_O(i,a=>{const o=a.length;let u;if(o<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,o);else if(o<65536){u=new Uint8Array(3);const d=new DataView(u.buffer);d.setUint8(0,126),d.setUint16(1,o)}else{u=new Uint8Array(9);const d=new DataView(u.buffer);d.setUint8(0,127),d.setBigUint64(1,BigInt(o))}i.data&&typeof i.data!="string"&&(u[0]|=128),s.enqueue(u),s.enqueue(a)})}})}let m0;function Yd(i){return i.reduce((s,a)=>s+a.length,0)}function Fd(i,s){if(i[0].length===s)return i.shift();const a=new Uint8Array(s);let o=0;for(let u=0;u<s;u++)a[u]=i[0][o++],o===i[0].length&&(i.shift(),o=0);return i.length&&o<i[0].length&&(i[0]=i[0].slice(o)),a}function jO(i,s){m0||(m0=new TextDecoder);const a=[];let o=0,u=-1,d=!1;return new TransformStream({transform(p,m){for(a.push(p);;){if(o===0){if(Yd(a)<1)break;const g=Fd(a,1);d=(g[0]&128)===128,u=g[0]&127,u<126?o=3:u===126?o=1:o=2}else if(o===1){if(Yd(a)<2)break;const g=Fd(a,2);u=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),o=3}else if(o===2){if(Yd(a)<8)break;const g=Fd(a,8),x=new DataView(g.buffer,g.byteOffset,g.length),_=x.getUint32(0);if(_>Math.pow(2,21)-1){m.enqueue(z0);break}u=_*Math.pow(2,32)+x.getUint32(4),o=3}else{if(Yd(a)<u)break;const g=Fd(a,u);m.enqueue(sy(d?g:m0.decode(g),s)),o=0}if(u===0||u>i){m.enqueue(z0);break}}}})}const DE=4;function Yt(i){if(i)return MO(i)}function MO(i){for(var s in Yt.prototype)i[s]=Yt.prototype[s];return i}Yt.prototype.on=Yt.prototype.addEventListener=function(i,s){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(s),this};Yt.prototype.once=function(i,s){function a(){this.off(i,a),s.apply(this,arguments)}return a.fn=s,this.on(i,a),this};Yt.prototype.off=Yt.prototype.removeListener=Yt.prototype.removeAllListeners=Yt.prototype.removeEventListener=function(i,s){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+i];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var o,u=0;u<a.length;u++)if(o=a[u],o===s||o.fn===s){a.splice(u,1);break}return a.length===0&&delete this._callbacks["$"+i],this};Yt.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var s=new Array(arguments.length-1),a=this._callbacks["$"+i],o=1;o<arguments.length;o++)s[o-1]=arguments[o];if(a){a=a.slice(0);for(var o=0,u=a.length;o<u;++o)a[o].apply(this,s)}return this};Yt.prototype.emitReserved=Yt.prototype.emit;Yt.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Yt.prototype.hasListeners=function(i){return!!this.listeners(i).length};const xh=typeof Promise=="function"&&typeof Promise.resolve=="function"?s=>Promise.resolve().then(s):(s,a)=>a(s,0),gs=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),kO="arraybuffer";function CE(i,...s){return s.reduce((a,o)=>(i.hasOwnProperty(o)&&(a[o]=i[o]),a),{})}const VO=gs.setTimeout,UO=gs.clearTimeout;function Nh(i,s){s.useNativeTimers?(i.setTimeoutFn=VO.bind(gs),i.clearTimeoutFn=UO.bind(gs)):(i.setTimeoutFn=gs.setTimeout.bind(gs),i.clearTimeoutFn=gs.clearTimeout.bind(gs))}const zO=1.33;function BO(i){return typeof i=="string"?qO(i):Math.ceil((i.byteLength||i.size)*zO)}function qO(i){let s=0,a=0;for(let o=0,u=i.length;o<u;o++)s=i.charCodeAt(o),s<128?a+=1:s<2048?a+=2:s<55296||s>=57344?a+=3:(o++,a+=4);return a}function TE(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function LO(i){let s="";for(let a in i)i.hasOwnProperty(a)&&(s.length&&(s+="&"),s+=encodeURIComponent(a)+"="+encodeURIComponent(i[a]));return s}function HO(i){let s={},a=i.split("&");for(let o=0,u=a.length;o<u;o++){let d=a[o].split("=");s[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return s}class PO extends Error{constructor(s,a,o){super(s),this.description=a,this.context=o,this.type="TransportError"}}class ay extends Yt{constructor(s){super(),this.writable=!1,Nh(this,s),this.opts=s,this.query=s.query,this.socket=s.socket,this.supportsBinary=!s.forceBase64}onError(s,a,o){return super.emitReserved("error",new PO(s,a,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(s){this.readyState==="open"&&this.write(s)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(s){const a=sy(s,this.socket.binaryType);this.onPacket(a)}onPacket(s){super.emitReserved("packet",s)}onClose(s){this.readyState="closed",super.emitReserved("close",s)}pause(s){}createUri(s,a={}){return s+"://"+this._hostname()+this._port()+this.opts.path+this._query(a)}_hostname(){const s=this.opts.hostname;return s.indexOf(":")===-1?s:"["+s+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(s){const a=LO(s);return a.length?"?"+a:""}}class $O extends ay{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(s){this.readyState="pausing";const a=()=>{this.readyState="paused",s()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||a()})),this.writable||(o++,this.once("drain",function(){--o||a()}))}else a()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(s){const a=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};OO(s,this.socket.binaryType).forEach(a),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const s=()=>{this.write([{type:"close"}])};this.readyState==="open"?s():this.once("open",s)}write(s){this.writable=!1,TO(s,a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const s=this.opts.secure?"https":"http",a=this.query||{};return this.opts.timestampRequests!==!1&&(a[this.opts.timestampParam]=TE()),!this.supportsBinary&&!a.sid&&(a.b64=1),this.createUri(s,a)}}let OE=!1;try{OE=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const IO=OE;function YO(){}class FO extends $O{constructor(s){if(super(s),typeof location<"u"){const a=location.protocol==="https:";let o=location.port;o||(o=a?"443":"80"),this.xd=typeof location<"u"&&s.hostname!==location.hostname||o!==s.port}}doWrite(s,a){const o=this.request({method:"POST",data:s});o.on("success",a),o.on("error",(u,d)=>{this.onError("xhr post error",u,d)})}doPoll(){const s=this.request();s.on("data",this.onData.bind(this)),s.on("error",(a,o)=>{this.onError("xhr poll error",a,o)}),this.pollXhr=s}}class xa extends Yt{constructor(s,a,o){super(),this.createRequest=s,Nh(this,o),this._opts=o,this._method=o.method||"GET",this._uri=a,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var s;const a=CE(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");a.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(a);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&o.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(s=this._opts.cookieJar)===null||s===void 0||s.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var u;o.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=xa.requestsCount++,xa.requests[this._index]=this)}_onError(s){this.emitReserved("error",s,this._xhr),this._cleanup(!0)}_cleanup(s){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=YO,s)try{this._xhr.abort()}catch{}typeof document<"u"&&delete xa.requests[this._index],this._xhr=null}}_onLoad(){const s=this._xhr.responseText;s!==null&&(this.emitReserved("data",s),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}xa.requestsCount=0;xa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",vw);else if(typeof addEventListener=="function"){const i="onpagehide"in gs?"pagehide":"unload";addEventListener(i,vw,!1)}}function vw(){for(let i in xa.requests)xa.requests.hasOwnProperty(i)&&xa.requests[i].abort()}const JO=(function(){const i=RE({xdomain:!1});return i&&i.responseType!==null})();class GO extends FO{constructor(s){super(s);const a=s&&s.forceBase64;this.supportsBinary=JO&&!a}request(s={}){return Object.assign(s,{xd:this.xd},this.opts),new xa(RE,this.uri(),s)}}function RE(i){const s=i.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!s||IO))return new XMLHttpRequest}catch{}if(!s)try{return new gs[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const jE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class QO extends ay{get name(){return"websocket"}doOpen(){const s=this.uri(),a=this.opts.protocols,o=jE?{}:CE(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(s,a,o)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=s=>this.onClose({description:"websocket connection closed",context:s}),this.ws.onmessage=s=>this.onData(s.data),this.ws.onerror=s=>this.onError("websocket error",s)}write(s){this.writable=!1;for(let a=0;a<s.length;a++){const o=s[a],u=a===s.length-1;ny(o,this.supportsBinary,d=>{try{this.doWrite(o,d)}catch{}u&&xh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const s=this.opts.secure?"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=TE()),this.supportsBinary||(a.b64=1),this.createUri(s,a)}}const p0=gs.WebSocket||gs.MozWebSocket;class XO extends QO{createSocket(s,a,o){return jE?new p0(s,a,o):a?new p0(s,a):new p0(s)}doWrite(s,a){this.ws.send(a)}}class ZO extends ay{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(s){return this.emitReserved("error",s)}this._transport.closed.then(()=>{this.onClose()}).catch(s=>{this.onError("webtransport error",s)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(s=>{const a=jO(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=s.readable.pipeThrough(a).getReader(),u=RO();u.readable.pipeTo(s.writable),this._writer=u.writable.getWriter();const d=()=>{o.read().then(({done:m,value:g})=>{m||(this.onPacket(g),d())}).catch(m=>{})};d();const p={type:"open"};this.query.sid&&(p.data=`{"sid":"${this.query.sid}"}`),this._writer.write(p).then(()=>this.onOpen())})})}write(s){this.writable=!1;for(let a=0;a<s.length;a++){const o=s[a],u=a===s.length-1;this._writer.write(o).then(()=>{u&&xh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var s;(s=this._transport)===null||s===void 0||s.close()}}const KO={websocket:XO,webtransport:ZO,polling:GO},WO=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,e5=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function B0(i){if(i.length>8e3)throw"URI too long";const s=i,a=i.indexOf("["),o=i.indexOf("]");a!=-1&&o!=-1&&(i=i.substring(0,a)+i.substring(a,o).replace(/:/g,";")+i.substring(o,i.length));let u=WO.exec(i||""),d={},p=14;for(;p--;)d[e5[p]]=u[p]||"";return a!=-1&&o!=-1&&(d.source=s,d.host=d.host.substring(1,d.host.length-1).replace(/;/g,":"),d.authority=d.authority.replace("[","").replace("]","").replace(/;/g,":"),d.ipv6uri=!0),d.pathNames=t5(d,d.path),d.queryKey=n5(d,d.query),d}function t5(i,s){const a=/\/{2,9}/g,o=s.replace(a,"/").split("/");return(s.slice(0,1)=="/"||s.length===0)&&o.splice(0,1),s.slice(-1)=="/"&&o.splice(o.length-1,1),o}function n5(i,s){const a={};return s.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,u,d){u&&(a[u]=d)}),a}const q0=typeof addEventListener=="function"&&typeof removeEventListener=="function",eh=[];q0&&addEventListener("offline",()=>{eh.forEach(i=>i())},!1);class si extends Yt{constructor(s,a){if(super(),this.binaryType=kO,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,s&&typeof s=="object"&&(a=s,s=null),s){const o=B0(s);a.hostname=o.host,a.secure=o.protocol==="https"||o.protocol==="wss",a.port=o.port,o.query&&(a.query=o.query)}else a.host&&(a.hostname=B0(a.host).host);Nh(this,a),this.secure=a.secure!=null?a.secure:typeof location<"u"&&location.protocol==="https:",a.hostname&&!a.port&&(a.port=this.secure?"443":"80"),this.hostname=a.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=a.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},a.transports.forEach(o=>{const u=o.prototype.name;this.transports.push(u),this._transportsByName[u]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},a),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=HO(this.opts.query)),q0&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},eh.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(s){const a=Object.assign({},this.opts.query);a.EIO=DE,a.transport=s,this.id&&(a.sid=this.id);const o=Object.assign({},this.opts,{query:a,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[s]);return new this._transportsByName[s](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const s=this.opts.rememberUpgrade&&si.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const a=this.createTransport(s);a.open(),this.setTransport(a)}setTransport(s){this.transport&&this.transport.removeAllListeners(),this.transport=s,s.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){this.readyState="open",si.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",s),this.emitReserved("heartbeat"),s.type){case"open":this.onHandshake(JSON.parse(s.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const a=new Error("server error");a.code=s.data,this._onError(a);break;case"message":this.emitReserved("data",s.data),this.emitReserved("message",s.data);break}}onHandshake(s){this.emitReserved("handshake",s),this.id=s.sid,this.transport.query.sid=s.sid,this._pingInterval=s.pingInterval,this._pingTimeout=s.pingTimeout,this._maxPayload=s.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const s=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+s,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},s),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const s=this._getWritablePackets();this.transport.send(s),this._prevBufferLen=s.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let o=0;o<this.writeBuffer.length;o++){const u=this.writeBuffer[o].data;if(u&&(a+=BO(u)),o>0&&a>this._maxPayload)return this.writeBuffer.slice(0,o);a+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const s=Date.now()>this._pingTimeoutTime;return s&&(this._pingTimeoutTime=0,xh(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),s}write(s,a,o){return this._sendPacket("message",s,a,o),this}send(s,a,o){return this._sendPacket("message",s,a,o),this}_sendPacket(s,a,o,u){if(typeof a=="function"&&(u=a,a=void 0),typeof o=="function"&&(u=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const d={type:s,data:a,options:o};this.emitReserved("packetCreate",d),this.writeBuffer.push(d),u&&this.once("flush",u),this.flush()}close(){const s=()=>{this._onClose("forced close"),this.transport.close()},a=()=>{this.off("upgrade",a),this.off("upgradeError",a),s()},o=()=>{this.once("upgrade",a),this.once("upgradeError",a)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():s()}):this.upgrading?o():s()),this}_onError(s){if(si.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",s),this._onClose("transport error",s)}_onClose(s,a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),q0&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=eh.indexOf(this._offlineEventListener);o!==-1&&eh.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",s,a),this.writeBuffer=[],this._prevBufferLen=0}}}si.protocol=DE;class s5 extends si{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let s=0;s<this._upgrades.length;s++)this._probe(this._upgrades[s])}_probe(s){let a=this.createTransport(s),o=!1;si.priorWebsocketSuccess=!1;const u=()=>{o||(a.send([{type:"ping",data:"probe"}]),a.once("packet",w=>{if(!o)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",a),!a)return;si.priorWebsocketSuccess=a.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(_(),this.setTransport(a),a.send([{type:"upgrade"}]),this.emitReserved("upgrade",a),a=null,this.upgrading=!1,this.flush())})}else{const D=new Error("probe error");D.transport=a.name,this.emitReserved("upgradeError",D)}}))};function d(){o||(o=!0,_(),a.close(),a=null)}const p=w=>{const D=new Error("probe error: "+w);D.transport=a.name,d(),this.emitReserved("upgradeError",D)};function m(){p("transport closed")}function g(){p("socket closed")}function x(w){a&&w.name!==a.name&&d()}const _=()=>{a.removeListener("open",u),a.removeListener("error",p),a.removeListener("close",m),this.off("close",g),this.off("upgrading",x)};a.once("open",u),a.once("error",p),a.once("close",m),this.once("close",g),this.once("upgrading",x),this._upgrades.indexOf("webtransport")!==-1&&s!=="webtransport"?this.setTimeoutFn(()=>{o||a.open()},200):a.open()}onHandshake(s){this._upgrades=this._filterUpgrades(s.upgrades),super.onHandshake(s)}_filterUpgrades(s){const a=[];for(let o=0;o<s.length;o++)~this.transports.indexOf(s[o])&&a.push(s[o]);return a}}let a5=class extends s5{constructor(s,a={}){const o=typeof s=="object"?s:a;(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(u=>KO[u]).filter(u=>!!u)),super(s,o)}};function r5(i,s="",a){let o=i;a=a||typeof location<"u"&&location,i==null&&(i=a.protocol+"//"+a.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=a.protocol+i:i=a.host+i),/^(https?|wss?):\/\//.test(i)||(typeof a<"u"?i=a.protocol+"//"+i:i="https://"+i),o=B0(i)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const d=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+d+":"+o.port+s,o.href=o.protocol+"://"+d+(a&&a.port===o.port?"":":"+o.port),o}const i5=typeof ArrayBuffer=="function",o5=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,ME=Object.prototype.toString,l5=typeof Blob=="function"||typeof Blob<"u"&&ME.call(Blob)==="[object BlobConstructor]",c5=typeof File=="function"||typeof File<"u"&&ME.call(File)==="[object FileConstructor]";function ry(i){return i5&&(i instanceof ArrayBuffer||o5(i))||l5&&i instanceof Blob||c5&&i instanceof File}function th(i,s){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let a=0,o=i.length;a<o;a++)if(th(i[a]))return!0;return!1}if(ry(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return th(i.toJSON(),!0);for(const a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&th(i[a]))return!0;return!1}function u5(i){const s=[],a=i.data,o=i;return o.data=L0(a,s),o.attachments=s.length,{packet:o,buffers:s}}function L0(i,s){if(!i)return i;if(ry(i)){const a={_placeholder:!0,num:s.length};return s.push(i),a}else if(Array.isArray(i)){const a=new Array(i.length);for(let o=0;o<i.length;o++)a[o]=L0(i[o],s);return a}else if(typeof i=="object"&&!(i instanceof Date)){const a={};for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&(a[o]=L0(i[o],s));return a}return i}function f5(i,s){return i.data=H0(i.data,s),delete i.attachments,i}function H0(i,s){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<s.length)return s[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let a=0;a<i.length;a++)i[a]=H0(i[a],s);else if(typeof i=="object")for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&(i[a]=H0(i[a],s));return i}var Jd={exports:{}},b0,xw;function d5(){if(xw)return b0;xw=1;var i=1e3,s=i*60,a=s*60,o=a*24,u=o*7,d=o*365.25;b0=function(_,w){w=w||{};var D=typeof _;if(D==="string"&&_.length>0)return p(_);if(D==="number"&&isFinite(_))return w.long?g(_):m(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function p(_){if(_=String(_),!(_.length>100)){var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(w){var D=parseFloat(w[1]),z=(w[2]||"ms").toLowerCase();switch(z){case"years":case"year":case"yrs":case"yr":case"y":return D*d;case"weeks":case"week":case"w":return D*u;case"days":case"day":case"d":return D*o;case"hours":case"hour":case"hrs":case"hr":case"h":return D*a;case"minutes":case"minute":case"mins":case"min":case"m":return D*s;case"seconds":case"second":case"secs":case"sec":case"s":return D*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return D;default:return}}}}function m(_){var w=Math.abs(_);return w>=o?Math.round(_/o)+"d":w>=a?Math.round(_/a)+"h":w>=s?Math.round(_/s)+"m":w>=i?Math.round(_/i)+"s":_+"ms"}function g(_){var w=Math.abs(_);return w>=o?x(_,w,o,"day"):w>=a?x(_,w,a,"hour"):w>=s?x(_,w,s,"minute"):w>=i?x(_,w,i,"second"):_+" ms"}function x(_,w,D,z){var q=w>=D*1.5;return Math.round(_/D)+" "+z+(q?"s":"")}return b0}var y0,Nw;function h5(){if(Nw)return y0;Nw=1;function i(s){o.debug=o,o.default=o,o.coerce=x,o.disable=m,o.enable=d,o.enabled=g,o.humanize=d5(),o.destroy=_,Object.keys(s).forEach(w=>{o[w]=s[w]}),o.names=[],o.skips=[],o.formatters={};function a(w){let D=0;for(let z=0;z<w.length;z++)D=(D<<5)-D+w.charCodeAt(z),D|=0;return o.colors[Math.abs(D)%o.colors.length]}o.selectColor=a;function o(w){let D,z=null,q,F;function Z(...ee){if(!Z.enabled)return;const te=Z,we=Number(new Date),De=we-(D||we);te.diff=De,te.prev=D,te.curr=we,D=we,ee[0]=o.coerce(ee[0]),typeof ee[0]!="string"&&ee.unshift("%O");let U=0;ee[0]=ee[0].replace(/%([a-zA-Z%])/g,(oe,W)=>{if(oe==="%%")return"%";U++;const Q=o.formatters[W];if(typeof Q=="function"){const H=ee[U];oe=Q.call(te,H),ee.splice(U,1),U--}return oe}),o.formatArgs.call(te,ee),(te.log||o.log).apply(te,ee)}return Z.namespace=w,Z.useColors=o.useColors(),Z.color=o.selectColor(w),Z.extend=u,Z.destroy=o.destroy,Object.defineProperty(Z,"enabled",{enumerable:!0,configurable:!1,get:()=>z!==null?z:(q!==o.namespaces&&(q=o.namespaces,F=o.enabled(w)),F),set:ee=>{z=ee}}),typeof o.init=="function"&&o.init(Z),Z}function u(w,D){const z=o(this.namespace+(typeof D>"u"?":":D)+w);return z.log=this.log,z}function d(w){o.save(w),o.namespaces=w,o.names=[],o.skips=[];const D=(typeof w=="string"?w:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const z of D)z[0]==="-"?o.skips.push(z.slice(1)):o.names.push(z)}function p(w,D){let z=0,q=0,F=-1,Z=0;for(;z<w.length;)if(q<D.length&&(D[q]===w[z]||D[q]==="*"))D[q]==="*"?(F=q,Z=z,q++):(z++,q++);else if(F!==-1)q=F+1,Z++,z=Z;else return!1;for(;q<D.length&&D[q]==="*";)q++;return q===D.length}function m(){const w=[...o.names,...o.skips.map(D=>"-"+D)].join(",");return o.enable(""),w}function g(w){for(const D of o.skips)if(p(w,D))return!1;for(const D of o.names)if(p(w,D))return!0;return!1}function x(w){return w instanceof Error?w.stack||w.message:w}function _(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}return y0=i,y0}var Sw;function m5(){return Sw||(Sw=1,(function(i,s){var a={};s.formatArgs=u,s.save=d,s.load=p,s.useColors=o,s.storage=m(),s.destroy=(()=>{let x=!1;return()=>{x||(x=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),s.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function o(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let x;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(x=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(x[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function u(x){if(x[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+x[0]+(this.useColors?"%c ":" ")+"+"+i.exports.humanize(this.diff),!this.useColors)return;const _="color: "+this.color;x.splice(1,0,_,"color: inherit");let w=0,D=0;x[0].replace(/%[a-zA-Z%]/g,z=>{z!=="%%"&&(w++,z==="%c"&&(D=w))}),x.splice(D,0,_)}s.log=console.debug||console.log||(()=>{});function d(x){try{x?s.storage.setItem("debug",x):s.storage.removeItem("debug")}catch{}}function p(){let x;try{x=s.storage.getItem("debug")||s.storage.getItem("DEBUG")}catch{}return!x&&typeof process<"u"&&"env"in process&&(x=a.DEBUG),x}function m(){try{return localStorage}catch{}}i.exports=h5()(s);const{formatters:g}=i.exports;g.j=function(x){try{return JSON.stringify(x)}catch(_){return"[UnexpectedJSONParseError]: "+_.message}}})(Jd,Jd.exports)),Jd.exports}var p5=m5();const b5=MC(p5),P0=b5("socket.io-parser"),y5=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ke;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(Ke||(Ke={}));class g5{constructor(s){this.replacer=s}encode(s){return P0("encoding packet %j",s),(s.type===Ke.EVENT||s.type===Ke.ACK)&&th(s)?this.encodeAsBinary({type:s.type===Ke.EVENT?Ke.BINARY_EVENT:Ke.BINARY_ACK,nsp:s.nsp,data:s.data,id:s.id}):[this.encodeAsString(s)]}encodeAsString(s){let a=""+s.type;return(s.type===Ke.BINARY_EVENT||s.type===Ke.BINARY_ACK)&&(a+=s.attachments+"-"),s.nsp&&s.nsp!=="/"&&(a+=s.nsp+","),s.id!=null&&(a+=s.id),s.data!=null&&(a+=JSON.stringify(s.data,this.replacer)),P0("encoded %j as %s",s,a),a}encodeAsBinary(s){const a=u5(s),o=this.encodeAsString(a.packet),u=a.buffers;return u.unshift(o),u}}class iy extends Yt{constructor(s){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof s=="function"?{reviver:s}:s)}add(s){let a;if(typeof s=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");a=this.decodeString(s);const o=a.type===Ke.BINARY_EVENT;o||a.type===Ke.BINARY_ACK?(a.type=o?Ke.EVENT:Ke.ACK,this.reconstructor=new v5(a),a.attachments===0&&super.emitReserved("decoded",a)):super.emitReserved("decoded",a)}else if(ry(s)||s.base64)if(this.reconstructor)a=this.reconstructor.takeBinaryData(s),a&&(this.reconstructor=null,super.emitReserved("decoded",a));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+s)}decodeString(s){let a=0;const o={type:Number(s.charAt(0))};if(Ke[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Ke.BINARY_EVENT||o.type===Ke.BINARY_ACK){const d=a+1;for(;s.charAt(++a)!=="-"&&a!=s.length;);const p=s.substring(d,a);if(p!=Number(p)||s.charAt(a)!=="-")throw new Error("Illegal attachments");const m=Number(p);if(!x5(m)||m<0)throw new Error("Illegal attachments");if(m>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=m}if(s.charAt(a+1)==="/"){const d=a+1;for(;++a&&!(s.charAt(a)===","||a===s.length););o.nsp=s.substring(d,a)}else o.nsp="/";const u=s.charAt(a+1);if(u!==""&&Number(u)==u){const d=a+1;for(;++a;){const p=s.charAt(a);if(p==null||Number(p)!=p){--a;break}if(a===s.length)break}o.id=Number(s.substring(d,a+1))}if(s.charAt(++a)){const d=this.tryParse(s.substr(a));if(iy.isPayloadValid(o.type,d))o.data=d;else throw new Error("invalid payload")}return P0("decoded %s as %j",s,o),o}tryParse(s){try{return JSON.parse(s,this.opts.reviver)}catch{return!1}}static isPayloadValid(s,a){switch(s){case Ke.CONNECT:return ww(a);case Ke.DISCONNECT:return a===void 0;case Ke.CONNECT_ERROR:return typeof a=="string"||ww(a);case Ke.EVENT:case Ke.BINARY_EVENT:return Array.isArray(a)&&(typeof a[0]=="number"||typeof a[0]=="string"&&y5.indexOf(a[0])===-1);case Ke.ACK:case Ke.BINARY_ACK:return Array.isArray(a)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class v5{constructor(s){this.packet=s,this.buffers=[],this.reconPack=s}takeBinaryData(s){if(this.buffers.push(s),this.buffers.length===this.reconPack.attachments){const a=f5(this.reconPack,this.buffers);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const x5=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function ww(i){return Object.prototype.toString.call(i)==="[object Object]"}const N5=Object.freeze(Object.defineProperty({__proto__:null,Decoder:iy,Encoder:g5,get PacketType(){return Ke}},Symbol.toStringTag,{value:"Module"}));function js(i,s,a){return i.on(s,a),function(){i.off(s,a)}}const S5=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class kE extends Yt{constructor(s,a,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=s,this.nsp=a,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const s=this.io;this.subs=[js(s,"open",this.onopen.bind(this)),js(s,"packet",this.onpacket.bind(this)),js(s,"error",this.onerror.bind(this)),js(s,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...s){return s.unshift("message"),this.emit.apply(this,s),this}emit(s,...a){var o,u,d;if(S5.hasOwnProperty(s))throw new Error('"'+s.toString()+'" is a reserved event name');if(a.unshift(s),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const p={type:Ke.EVENT,data:a};if(p.options={},p.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const _=this.ids++,w=a.pop();this._registerAckCallback(_,w),p.id=_}const m=(u=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||u===void 0?void 0:u.writable,g=this.connected&&!(!((d=this.io.engine)===null||d===void 0)&&d._hasPingExpired());return this.flags.volatile&&!m||(g?(this.notifyOutgoingListeners(p),this.packet(p)):this.sendBuffer.push(p)),this.flags={},this}_registerAckCallback(s,a){var o;const u=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(u===void 0){this.acks[s]=a;return}const d=this.io.setTimeoutFn(()=>{delete this.acks[s];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===s&&this.sendBuffer.splice(m,1);a.call(this,new Error("operation has timed out"))},u),p=(...m)=>{this.io.clearTimeoutFn(d),a.apply(this,m)};p.withError=!0,this.acks[s]=p}emitWithAck(s,...a){return new Promise((o,u)=>{const d=(p,m)=>p?u(p):o(m);d.withError=!0,a.push(d),this.emit(s,...a)})}_addToQueue(s){let a;typeof s[s.length-1]=="function"&&(a=s.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:s,flags:Object.assign({fromQueue:!0},this.flags)};s.push((u,...d)=>(this._queue[0],u!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),a&&a(u)):(this._queue.shift(),a&&a(null,...d)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(s=!1){if(!this.connected||this._queue.length===0)return;const a=this._queue[0];a.pending&&!s||(a.pending=!0,a.tryCount++,this.flags=a.flags,this.emit.apply(this,a.args))}packet(s){s.nsp=this.nsp,this.io._packet(s)}onopen(){typeof this.auth=="function"?this.auth(s=>{this._sendConnectPacket(s)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(s){this.packet({type:Ke.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},s):s})}onerror(s){this.connected||this.emitReserved("connect_error",s)}onclose(s,a){this.connected=!1,delete this.id,this.emitReserved("disconnect",s,a),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(s=>{if(!this.sendBuffer.some(o=>String(o.id)===s)){const o=this.acks[s];delete this.acks[s],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(s){if(s.nsp===this.nsp)switch(s.type){case Ke.CONNECT:s.data&&s.data.sid?this.onconnect(s.data.sid,s.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ke.EVENT:case Ke.BINARY_EVENT:this.onevent(s);break;case Ke.ACK:case Ke.BINARY_ACK:this.onack(s);break;case Ke.DISCONNECT:this.ondisconnect();break;case Ke.CONNECT_ERROR:this.destroy();const o=new Error(s.data.message);o.data=s.data.data,this.emitReserved("connect_error",o);break}}onevent(s){const a=s.data||[];s.id!=null&&a.push(this.ack(s.id)),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(s){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const o of a)o.apply(this,s)}super.emit.apply(this,s),this._pid&&s.length&&typeof s[s.length-1]=="string"&&(this._lastOffset=s[s.length-1])}ack(s){const a=this;let o=!1;return function(...u){o||(o=!0,a.packet({type:Ke.ACK,id:s,data:u}))}}onack(s){const a=this.acks[s.id];typeof a=="function"&&(delete this.acks[s.id],a.withError&&s.data.unshift(null),a.apply(this,s.data))}onconnect(s,a){this.id=s,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(s=>this.emitEvent(s)),this.receiveBuffer=[],this.sendBuffer.forEach(s=>{this.notifyOutgoingListeners(s),this.packet(s)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(s=>s()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ke.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(s){return this.flags.compress=s,this}get volatile(){return this.flags.volatile=!0,this}timeout(s){return this.flags.timeout=s,this}onAny(s){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(s),this}prependAny(s){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(s),this}offAny(s){if(!this._anyListeners)return this;if(s){const a=this._anyListeners;for(let o=0;o<a.length;o++)if(s===a[o])return a.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(s){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(s),this}prependAnyOutgoing(s){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(s),this}offAnyOutgoing(s){if(!this._anyOutgoingListeners)return this;if(s){const a=this._anyOutgoingListeners;for(let o=0;o<a.length;o++)if(s===a[o])return a.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(s){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const o of a)o.apply(this,s.data)}}}function vl(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}vl.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var s=Math.random(),a=Math.floor(s*this.jitter*i);i=(Math.floor(s*10)&1)==0?i-a:i+a}return Math.min(i,this.max)|0};vl.prototype.reset=function(){this.attempts=0};vl.prototype.setMin=function(i){this.ms=i};vl.prototype.setMax=function(i){this.max=i};vl.prototype.setJitter=function(i){this.jitter=i};class $0 extends Yt{constructor(s,a){var o;super(),this.nsps={},this.subs=[],s&&typeof s=="object"&&(a=s,s=void 0),a=a||{},a.path=a.path||"/socket.io",this.opts=a,Nh(this,a),this.reconnection(a.reconnection!==!1),this.reconnectionAttempts(a.reconnectionAttempts||1/0),this.reconnectionDelay(a.reconnectionDelay||1e3),this.reconnectionDelayMax(a.reconnectionDelayMax||5e3),this.randomizationFactor((o=a.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new vl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(a.timeout==null?2e4:a.timeout),this._readyState="closed",this.uri=s;const u=a.parser||N5;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=a.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(s){return arguments.length?(this._reconnection=!!s,s||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(s){return s===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=s,this)}reconnectionDelay(s){var a;return s===void 0?this._reconnectionDelay:(this._reconnectionDelay=s,(a=this.backoff)===null||a===void 0||a.setMin(s),this)}randomizationFactor(s){var a;return s===void 0?this._randomizationFactor:(this._randomizationFactor=s,(a=this.backoff)===null||a===void 0||a.setJitter(s),this)}reconnectionDelayMax(s){var a;return s===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=s,(a=this.backoff)===null||a===void 0||a.setMax(s),this)}timeout(s){return arguments.length?(this._timeout=s,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(s){if(~this._readyState.indexOf("open"))return this;this.engine=new a5(this.uri,this.opts);const a=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const u=js(a,"open",function(){o.onopen(),s&&s()}),d=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),s?s(m):this.maybeReconnectOnOpen()},p=js(a,"error",d);if(this._timeout!==!1){const m=this._timeout,g=this.setTimeoutFn(()=>{u(),d(new Error("timeout")),a.close()},m);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(u),this.subs.push(p),this}connect(s){return this.open(s)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const s=this.engine;this.subs.push(js(s,"ping",this.onping.bind(this)),js(s,"data",this.ondata.bind(this)),js(s,"error",this.onerror.bind(this)),js(s,"close",this.onclose.bind(this)),js(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(s){try{this.decoder.add(s)}catch(a){this.onclose("parse error",a)}}ondecoded(s){xh(()=>{this.emitReserved("packet",s)},this.setTimeoutFn)}onerror(s){this.emitReserved("error",s)}socket(s,a){let o=this.nsps[s];return o?this._autoConnect&&!o.active&&o.connect():(o=new kE(this,s,a),this.nsps[s]=o),o}_destroy(s){const a=Object.keys(this.nsps);for(const o of a)if(this.nsps[o].active)return;this._close()}_packet(s){const a=this.encoder.encode(s);for(let o=0;o<a.length;o++)this.engine.write(a[o],s.options)}cleanup(){this.subs.forEach(s=>s()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(s,a){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",s,a),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const s=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const a=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{s.skipReconnect||(this.emitReserved("reconnect_attempt",s.backoff.attempts),!s.skipReconnect&&s.open(u=>{u?(s._reconnecting=!1,s.reconnect(),this.emitReserved("reconnect_error",u)):s.onreconnect()}))},a);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const s=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",s)}}const au={};function nh(i,s){typeof i=="object"&&(s=i,i=void 0),s=s||{};const a=r5(i,s.path||"/socket.io"),o=a.source,u=a.id,d=a.path,p=au[u]&&d in au[u].nsps,m=s.forceNew||s["force new connection"]||s.multiplex===!1||p;let g;return m?g=new $0(o,s):(au[u]||(au[u]=new $0(o,s)),g=au[u]),a.query&&!s.query&&(s.query=a.queryKey),g.socket(a.path,s)}Object.assign(nh,{Manager:$0,Socket:kE,io:nh,connect:nh});const w5=B.createContext({connected:!1,subscribe:()=>()=>{}});function E5({children:i}){const s=B.useRef(null),[a,o]=B.useState(!1),u=B.useRef(new Map),d=B.useCallback((m,g)=>{const x=u.current;return x.has(m)||x.set(m,new Set),x.get(m).add(g),()=>{const _=x.get(m);_&&(_.delete(g),_.size===0&&x.delete(m))}},[]),p=B.useCallback((m,g)=>{for(const[x,_]of u.current)if(xE(m,x))for(const w of _)try{w(g)}catch{}},[]);return B.useEffect(()=>{const m=nh({path:"/socket.io",transports:["polling","websocket"],upgrade:!0,reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:2e3});return s.current=m,console.log("[lt-socketio] connecting..."),m.on("connect",()=>{console.log("[lt-socketio] connected, id:",m.id),o(!0)}),m.on("disconnect",g=>{console.log("[lt-socketio] disconnected:",g),o(!1)}),m.on("connect_error",g=>{console.warn("[lt-socketio] connect error:",g.message),o(!1)}),m.onAny((g,x)=>{if(g.startsWith("lt."))try{const _=typeof x=="string"?JSON.parse(x):x;p(g,_)}catch{}}),()=>{m.removeAllListeners(),m.disconnect(),s.current=null,o(!1)}},[p]),b.jsxDEV(w5.Provider,{value:{connected:a,subscribe:d},children:b.jsxDEV(vh.Provider,{value:{connected:a,subscribe:d},children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useSocketIO.tsx",lineNumber:163,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/hooks/useSocketIO.tsx",lineNumber:162,columnNumber:5},this)}function _5({children:i}){const[s,a]=B.useState(null);return B.useEffect(()=>{let o=!1;async function u(){var d;try{console.log("[lt-transport] detecting event transport...");const p=await fetch("/api/settings");if(!p.ok){console.warn("[lt-transport] settings fetch failed, falling back to socketio"),o||a("socketio");return}const m=await p.json(),g=(d=m==null?void 0:m.events)==null?void 0:d.transport;console.log("[lt-transport] server reports:",g),o||a(g==="nats"?"nats":"socketio")}catch(p){console.warn("[lt-transport] settings fetch error, falling back to socketio",p),o||a("socketio")}}return u(),()=>{o=!0}},[]),s==="nats"?b.jsxDEV(EO,{children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useEventTransport.tsx",lineNumber:48,columnNumber:12},this):s==="socketio"?b.jsxDEV(E5,{children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useEventTransport.tsx",lineNumber:52,columnNumber:12},this):b.jsxDEV(b.Fragment,{children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useEventTransport.tsx",lineNumber:56,columnNumber:10},this)}const VE=B.createContext(null),Ew="lt_sidebar_collapsed";function A5({children:i}){const[s,a]=B.useState(()=>{try{return localStorage.getItem(Ew)==="true"}catch{return!1}}),o=B.useCallback(()=>{a(u=>{const d=!u;try{localStorage.setItem(Ew,String(d))}catch{}return d})},[]);return b.jsxDEV(VE.Provider,{value:{collapsed:s,toggle:o},children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useSidebar.tsx",lineNumber:40,columnNumber:5},this)}function UE(){const i=B.useContext(VE);if(!i)throw new Error("useSidebar must be used within SidebarProvider");return i}function E6(i){const s=i?`?period=${i}`:"";return ii({queryKey:["escalationStats",i],queryFn:()=>Nt(`/escalations/stats${s}`)})}function _6(){return ii({queryKey:["escalationTypes"],queryFn:()=>Nt("/escalations/types")})}function D5(i){const s=new URLSearchParams;return i.status&&s.set("status",i.status),i.role&&s.set("role",i.role),i.type&&s.set("type",i.type),i.subtype&&s.set("subtype",i.subtype),i.assigned_to&&s.set("assigned_to",i.assigned_to),i.priority&&s.set("priority",String(i.priority)),i.limit&&s.set("limit",String(i.limit)),i.offset!==void 0&&s.set("offset",String(i.offset)),i.sort_by&&s.set("sort_by",i.sort_by),i.order&&s.set("order",i.order),ii({queryKey:["escalations",i],queryFn:()=>Nt(`/escalations?${s}`)})}function A6(i){return ii({queryKey:["escalations","by-workflow",i],queryFn:()=>Nt(`/escalations/by-workflow/${i}`),enabled:!!i})}function D6(i){return ii({queryKey:["escalations",i],queryFn:()=>Nt(`/escalations/${i}`),enabled:!!i})}function C6(){const i=Vs();return Sa({mutationFn:({id:s,durationMinutes:a})=>Nt(`/escalations/${s}/claim`,{method:"POST",body:JSON.stringify({durationMinutes:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function T6(){const i=Vs();return Sa({mutationFn:s=>Nt(`/escalations/${s}/release`,{method:"POST"}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function O6(){const i=Vs();return Sa({mutationFn:({id:s,resolverPayload:a})=>Nt(`/escalations/${s}/resolve`,{method:"POST",body:JSON.stringify({resolverPayload:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"}),i.invalidateQueries({queryKey:["tasks"],refetchType:"all"}),i.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function R6(){const i=Vs();return Sa({mutationFn:({id:s,targetRole:a})=>Nt(`/escalations/${s}/escalate`,{method:"PATCH",body:JSON.stringify({targetRole:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function j6(){const i=Vs();return Sa({mutationFn:({ids:s,priority:a})=>Nt("/escalations/priority",{method:"PATCH",body:JSON.stringify({ids:s,priority:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function M6(){const i=Vs();return Sa({mutationFn:({ids:s,durationMinutes:a})=>Nt("/escalations/bulk-claim",{method:"POST",body:JSON.stringify({ids:s,durationMinutes:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function k6(){const i=Vs();return Sa({mutationFn:({ids:s,targetUserId:a,durationMinutes:o})=>Nt("/escalations/bulk-assign",{method:"POST",body:JSON.stringify({ids:s,targetUserId:a,durationMinutes:o})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function V6(){const i=Vs();return Sa({mutationFn:({ids:s,targetRole:a})=>Nt("/escalations/bulk-escalate",{method:"PATCH",body:JSON.stringify({ids:s,targetRole:a})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function U6(){const i=Vs();return Sa({mutationFn:({ids:s,hint:a})=>Nt("/escalations/bulk-triage",{method:"POST",body:JSON.stringify({ids:s,...a?{hint:a}:{}})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function C5(){const{user:i}=Ki(),s=i==null?void 0:i.userId,a=Vs(),{data:o}=D5({assigned_to:s,status:"pending"});NE(`${xO}.escalation.>`,()=>{s&&a.invalidateQueries({queryKey:["escalations"]})});const u=new Date;return((o==null?void 0:o.escalations)??[]).filter(p=>p.assigned_until&&new Date(p.assigned_until)>u).length}function T5({className:i="",onClick:s}){const{connected:a}=NO();return b.jsxDEV("button",{type:"button",onClick:s,className:`relative text-text-tertiary hover:text-accent transition-colors ${i}`,title:a?"Live events enabled":"Live events disconnected","aria-label":a?"Live events enabled":"Live events disconnected",children:[b.jsxDEV(qC,{className:"w-4 h-4",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/NatsStatus.tsx",lineNumber:24,columnNumber:7},this),b.jsxDEV("span",{className:`absolute -top-1 -right-1 w-2 h-2 rounded-full ${a?"bg-emerald-500":"bg-text-tertiary"}`,"data-testid":"nats-status-dot"},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/NatsStatus.tsx",lineNumber:25,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/display/NatsStatus.tsx",lineNumber:17,columnNumber:5},this)}function oy({size:i="sm",hideLabel:s=!1}){const a=i==="lg",o=a?"w-[16rem] h-[16rem] -rotate-[120deg] opacity-40 -ml-10":"w-[12.5rem] h-[12.5rem] -rotate-[120deg] opacity-40 -ml-8",u=a?"text-[44px] font-normal text-text-primary tracking-[0.15em] -ml-[12.5rem]":"text-[36px] font-normal text-text-primary tracking-[0.15em] -ml-[9.75rem]";return b.jsxDEV("div",{className:"flex items-center",style:{height:"50px"},children:[b.jsxDEV("img",{src:"/logo512.png",alt:"LongTail",className:`shrink-0 z-0 ${o}`},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/AppLogo.tsx",lineNumber:28,columnNumber:7},this),b.jsxDEV("span",{className:`z-[1] transition-opacity duration-300 ${u} ${s?"opacity-0":""}`,children:"LongTail"},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/AppLogo.tsx",lineNumber:33,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/display/AppLogo.tsx",lineNumber:27,columnNumber:5},this)}function O5({onToggleEventFeed:i,onToggleDocs:s}){const{user:a,logout:o}=Ki(),u=C5(),[d,p]=B.useState(!1),m=B.useRef(null);return B.useEffect(()=>{if(!d)return;const g=x=>{m.current&&!m.current.contains(x.target)&&p(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[d]),b.jsxDEV("header",{className:"h-14 shrink-0 border-b border-surface-border bg-surface-raised flex items-center justify-between px-5 relative z-30",children:[b.jsxDEV("div",{className:"flex items-center gap-4",children:b.jsxDEV(uu,{to:"/","aria-label":"Home",children:b.jsxDEV(oy,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:31,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:30,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:29,columnNumber:7},this),b.jsxDEV("div",{className:"flex items-center gap-4",children:[b.jsxDEV("button",{onClick:s,className:"text-text-tertiary hover:text-accent transition-colors","aria-label":"Documentation",title:"Documentation",children:b.jsxDEV(Xw,{className:"w-4 h-4",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:43,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:37,columnNumber:9},this),b.jsxDEV(uu,{to:"/escalations/queue",className:"relative text-text-tertiary hover:text-accent transition-colors","aria-label":"Escalation inbox",title:"Escalation inbox",children:[b.jsxDEV(LC,{className:"w-4 h-4",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:51,columnNumber:11},this),b.jsxDEV("span",{className:`absolute -top-1 -right-1 w-2 h-2 rounded-full ${u>0?"bg-status-warning":"bg-text-tertiary"}`},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:52,columnNumber:11},this),b.jsxDEV("span",{className:`absolute -top-2.5 -right-3 text-[8px] font-bold tabular-nums ${u>0?"text-status-warning":"text-text-tertiary"}`,children:u},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:53,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:45,columnNumber:9},this),b.jsxDEV(T5,{onClick:i},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:55,columnNumber:9},this),a&&b.jsxDEV("div",{className:"relative",ref:m,children:[b.jsxDEV("button",{onClick:()=>p(g=>!g),className:"btn-ghost text-xs flex items-center gap-1",children:[b.jsxDEV(HC,{className:"w-3.5 h-3.5 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:62,columnNumber:15},this),a.displayName||a.username||a.userId,b.jsxDEV("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:65,columnNumber:17},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:64,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:58,columnNumber:13},this),d&&b.jsxDEV("div",{className:"absolute right-0 top-full mt-1 w-48 bg-surface-raised border border-surface-border rounded-md shadow-lg py-1 z-50",children:[b.jsxDEV(uu,{to:"/credentials",onClick:()=>p(!1),className:"block px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:"Credentials"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:70,columnNumber:17},this),b.jsxDEV("button",{onClick:()=>{p(!1),o()},className:"block w-full text-left px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:"Sign Out"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:77,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:69,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:57,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:36,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Header.tsx",lineNumber:28,columnNumber:5},this)}function ly({open:i,children:s}){const[a,o]=B.useState(i);return B.useEffect(()=>{i&&o(!0)},[i]),b.jsxDEV("div",{className:`grid transition-[grid-template-rows] duration-300 ease-out ${i?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,onTransitionEnd:()=>{i||o(!1)},children:b.jsxDEV("div",{className:"overflow-hidden",children:a?s:null},void 0,!1,{fileName:"/app/dashboard/src/components/common/layout/Collapsible.tsx",lineNumber:15,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/layout/Collapsible.tsx",lineNumber:11,columnNumber:5},this)}function I0(i){return({isActive:s})=>{const a="flex items-center rounded-md transition-colors duration-150",o="bg-surface-hover text-text-primary font-medium",u="text-text-secondary hover:text-text-primary hover:bg-surface-hover";return i?`${a} justify-center w-10 h-10 mx-auto ${s?o:u}`:`${a} gap-3 px-4 py-2 text-sm ${s?o:u}`}}function R5(){return({isActive:i})=>`flex items-center gap-3 pl-11 pr-4 py-1.5 text-xs rounded-md transition-colors duration-150 ${i?"text-text-primary font-medium":"text-text-secondary hover:text-text-primary"}`}function j5({group:i,collapsed:s}){const{pathname:a}=Zi(),o=i.matchPaths.some(m=>a.startsWith(m)),[u,d]=B.useState(o),p=u||o;return s?b.jsxDEV(b.Fragment,{children:i.items.map(m=>b.jsxDEV(sh,{to:m.to,className:I0(!0),title:m.label,children:m.icon&&b.jsxDEV(m.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:70,columnNumber:26},this)},m.to,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:64,columnNumber:11},this))},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:62,columnNumber:7},this):b.jsxDEV("div",{children:[b.jsxDEV("button",{onClick:()=>d(m=>!m),className:"w-full flex items-center justify-between px-4 py-2 text-sm rounded-md transition-colors duration-150 text-text-secondary hover:text-text-primary hover:bg-surface-hover",children:[b.jsxDEV("span",{className:"flex items-center gap-3",children:[i.icon&&b.jsxDEV(i.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:84,columnNumber:26},this),b.jsxDEV("span",{children:i.label},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:85,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:83,columnNumber:9},this),b.jsxDEV("svg",{className:`w-3.5 h-3.5 text-text-tertiary transition-transform duration-150 ${p?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:94,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:87,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:79,columnNumber:7},this),b.jsxDEV(ly,{open:p,children:i.items.map(m=>b.jsxDEV(sh,{to:m.to,end:m.end,className:R5(),children:[m.icon&&b.jsxDEV(m.icon,{className:"w-4 h-4 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:100,columnNumber:26},this),b.jsxDEV("span",{children:m.label},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:101,columnNumber:13},this)]},m.to,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:99,columnNumber:11},this))},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:97,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:78,columnNumber:5},this)}function M5(i){return i.kind==="group"}function k5({entry:i,collapsed:s}){const{pathname:a,search:o}=Zi();if(i.to.includes("?")){const[d,p]=i.to.split("?"),m=a===d&&o===`?${p}`,g=I0(s)({isActive:m});return b.jsxDEV(sh,{to:i.to,className:g,title:s?i.label:void 0,children:[i.icon&&b.jsxDEV(i.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:128,columnNumber:24},this),!s&&b.jsxDEV("span",{children:i.label},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:129,columnNumber:24},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:127,columnNumber:7},this)}return b.jsxDEV(sh,{to:i.to,end:i.end,className:I0(s),title:s?i.label:void 0,children:[i.icon&&b.jsxDEV(i.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:141,columnNumber:22},this),!s&&b.jsxDEV("span",{children:i.label},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:142,columnNumber:22},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:135,columnNumber:5},this)}function cy({heading:i,entries:s}){const{collapsed:a}=UE();return b.jsxDEV("div",{className:"space-y-1",children:[a?b.jsxDEV("div",{className:"h-px bg-surface-border mx-3 my-2",title:i},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:153,columnNumber:9},this):b.jsxDEV("p",{className:"px-4 py-2 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:i},void 0,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:155,columnNumber:9},this),s.map(o=>M5(o)?b.jsxDEV(j5,{group:o,collapsed:a},o.label,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:161,columnNumber:11},this):b.jsxDEV(k5,{entry:o,collapsed:a},o.to,!1,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:163,columnNumber:11},this))]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/SidebarNav.tsx",lineNumber:151,columnNumber:5},this)}const V5=[{to:"/admin/users",label:"Accounts",icon:PC},{to:"/admin/roles",label:"Roles & Permissions",icon:$C},{to:"/admin/maintenance",label:"DB Maintenance",icon:IC},{to:"/admin/controlplane",label:"Task Queues",icon:YC}];function U5(){return b.jsxDEV(cy,{heading:"Admin",entries:V5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/AdminSidebar.tsx",lineNumber:17,columnNumber:10},this)}const z5=[{to:"/workflows/registry",label:"Workflow Registry",icon:FC},{to:"/workflows/start",label:"Invoke Workflow",icon:JC},{to:"/escalations/available",label:"All Escalations",icon:GC},{to:"/workflows/executions",label:"Durable Executions",icon:Zw}];function B5(){return b.jsxDEV(cy,{heading:"Durable Workflows",entries:z5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EngineerSidebar.tsx",lineNumber:12,columnNumber:10},this)}const q5=[{to:"/mcp/queries",label:"MCP Tool Designer",icon:QC},{to:"/mcp/servers",label:"MCP Server Tools",icon:XC},{to:"/mcp/workflows",label:"MCP Pipeline Tools",icon:Y0},{to:"/mcp/executions",label:"Pipeline Executions",icon:Zw}];function L5(){return b.jsxDEV(cy,{heading:"MCP Workflows",entries:q5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/McpSidebar.tsx",lineNumber:12,columnNumber:10},this)}function H5({children:i,className:s=""}){return b.jsxDEV("p",{className:`text-[10px] font-semibold uppercase tracking-widest text-text-tertiary ${s}`,children:i},void 0,!1,{fileName:"/app/dashboard/src/components/common/layout/SectionLabel.tsx",lineNumber:10,columnNumber:5},this)}const g0=280,_w="cubic-bezier(0.4, 0, 0.2, 1)",Gd=40;function P5(i){if(!i)return"scale(0.92)";const s=window.innerWidth,a=window.innerHeight,o=s-Gd*2,u=a-Gd*2,d=i.width/o,p=i.height/u,m=i.left+i.width/2-(Gd+o/2),g=i.top+i.height/2-(Gd+u/2);return`translate(${m}px, ${g}px) scale(${d}, ${p})`}function zE({open:i,onClose:s,sourceRef:a,children:o}){const[u,d]=B.useState(null),p=B.useRef(null),m=B.useRef(!1);B.useEffect(()=>{var D,z;i&&!m.current?(p.current=((D=a==null?void 0:a.current)==null?void 0:D.getBoundingClientRect())??null,d("entering")):!i&&m.current&&u==="open"&&(p.current=((z=a==null?void 0:a.current)==null?void 0:z.getBoundingClientRect())??null,d("exiting")),m.current=i},[i,a,u]),B.useEffect(()=>{if(u!=="entering")return;const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>d("open"))});return()=>cancelAnimationFrame(D)},[u]),B.useEffect(()=>{if(u)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[u]),B.useEffect(()=>{if(!u)return;const D=z=>{z.key==="Escape"&&s()};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[u,s]);const g=B.useCallback(D=>{D.propertyName==="transform"&&u==="exiting"&&d(null)},[u]);if(B.useEffect(()=>{if(u!=="exiting")return;const D=setTimeout(()=>d(null),g0+50);return()=>clearTimeout(D)},[u]),!u)return null;const x=u==="entering"||u==="exiting",_=x?P5(p.current):"none",w=x?0:1;return Gw.createPortal(b.jsxDEV("div",{className:"fixed inset-0 z-50 overflow-auto p-10",style:{transformOrigin:"center center",transition:`transform ${g0}ms ${_w}, opacity ${g0}ms ${_w}`,transform:_,opacity:w,backgroundColor:"#FFFFFF"},onTransitionEnd:g,children:o},void 0,!1,{fileName:"/app/dashboard/src/components/common/layout/FullscreenOverlay.tsx",lineNumber:93,columnNumber:5},this),document.body)}function $5(i){const s=i.trim().split(`
272
272
  `);if(s.length<2)return i;const a=m=>m.split("|").map(g=>g.trim()).filter(Boolean),o=a(s[0]),u=s.slice(2),d=o.map(m=>`<th class="px-3 py-1.5 text-left text-[10px] font-semibold uppercase tracking-wider text-text-tertiary">${m}</th>`).join(""),p=u.map(m=>`<tr class="border-t border-surface-border">${a(m).map(_=>`<td class="px-3 py-1.5 text-xs text-text-secondary">${_}</td>`).join("")}</tr>`).join("");return`<table class="w-full my-3 text-xs"><thead><tr class="border-b border-surface-border">${d}</tr></thead><tbody>${p}</tbody></table>`}function Qd(i){return i.toLowerCase().replace(/<[^>]+>/g,"").replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").trim()}function I5(i){const s=[];let a=i.replace(/```(\w*)\n([\s\S]*?)```/g,(g,x,_)=>{const w=s.length;return s.push(`<pre class="bg-surface-sunken rounded p-3 my-2 overflow-x-auto text-[11px] leading-relaxed"><code>${_}</code></pre>`),`\0CODE${w}\0`});const o=/^(\|.+\|)\n(\|[-| :]+\|)\n((?:\|.+\|\n?)+)/gm;a=a.replace(o,(g,x,_,w)=>$5(`${x}
273
273
  ${_}
274
274
  ${w.trimEnd()}`)),a=a.replace(/`([^`]+)`/g,'<code class="bg-surface-sunken px-1 py-0.5 rounded text-[11px]">$1</code>'),a=a.replace(/^#### (.+)$/gm,(g,x)=>`<h4 id="${Qd(x)}" class="text-xs font-semibold text-text-primary mt-4 mb-1">${x}</h4>`).replace(/^### (.+)$/gm,(g,x)=>`<h3 id="${Qd(x)}" class="text-sm font-semibold text-text-primary mt-5 mb-1.5">${x}</h3>`).replace(/^## (.+)$/gm,(g,x)=>`<h2 id="${Qd(x)}" class="text-base font-semibold text-text-primary mt-6 mb-2 pb-1 border-b border-surface-border">${x}</h2>`).replace(/^# (.+)$/gm,(g,x)=>`<h1 id="${Qd(x)}" class="text-lg font-bold text-text-primary mb-3">${x}</h1>`),a=a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\(#([^)]+)\)/g,'<a data-anchor="$2" class="text-accent hover:underline cursor-pointer">$1</a>').replace(/\[([^\]]+)\]\(([^)]*\.md(?:#[^)]*)?)\)/g,'<a data-doc-link="$2" class="text-accent hover:underline cursor-pointer">$1</a>').replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-accent hover:underline">$1</a>').replace(/^ - (.+)$/gm,'<li class="ml-8 list-disc text-xs -my-1" style="line-height:1.1">$1</li>').replace(/^ - (.+)$/gm,'<li class="ml-8 list-disc text-xs -my-1" style="line-height:1.1">$1</li>').replace(/^- (.+)$/gm,'<li class="ml-4 list-disc text-xs -my-1" style="line-height:1.1">$1</li>').replace(/^\d+\. (.+)$/gm,'<li class="ml-4 list-decimal text-xs -my-1" style="line-height:1.1">$1</li>').replace(/^---+$/gm,'<hr class="border-surface-border my-4" />').replace(/(?:^> (.+)$\n?)+/gm,g=>{const x=g.replace(/^> /gm,"").trim(),_=/⚠️|warning|caution/i.test(x),w=/note:|ℹ️|info/i.test(x);return`<div class="${_?"bg-status-warning/5":w?"bg-accent/5":"bg-surface-sunken/50"} ${_?"border-status-warning":w?"border-accent":"border-text-tertiary"} border-l-2 rounded-r-md px-3 py-2 my-3 text-xs text-text-secondary leading-relaxed">${x}</div>`}).replace(/\n\n/g,"\0PARA\0").replace(/\n/g,"<br/>");const u=g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=g=>new RegExp(`(${u(g)}[\\s\\S]*?<\\/li>(?:<br\\/>)?)+`,"g");a=a.replace(d('<li class="ml-8 list-disc'),g=>`<ul class="mb-3">${g}</ul>`),a=a.replace(d('<li class="ml-4 list-disc'),g=>`<ul class="mb-3">${g}</ul>`),a=a.replace(d('<li class="ml-4 list-decimal'),g=>`<ol class="list-decimal mb-3">${g}</ol>`),a=a.replace(/\x00CODE(\d+)\x00/g,(g,x)=>s[parseInt(x,10)]);const p="text-xs leading-relaxed text-text-secondary mb-2",m=/<\/(h[1-4]|pre|table|ul|ol|hr|div)>/;return a=a.split("\0PARA\0").map(g=>{const x=g.trim();if(!x)return"";const _=[];let w=x,D;for(;(D=m.exec(w))!==null;){const z=D.index+D[0].length;_.push(w.slice(0,z)),w=w.slice(z).replace(/^<br\/>/,"").trim(),m.lastIndex=0}return w&&_.push(w),_.map(z=>{const q=z.trim();return q?/^\s*<(h[1-4]|pre|table|ul|ol|hr|div)/.test(q)?q:`<p class="${p}">${q}</p>`:""}).join("")}).join(""),a}const Y5=/(\*\*|^#{1,4}\s|^- |^\d+\.\s|```|^\|.*\|$|\[.+\]\(.+\))/m;function F5(i){return Y5.test(i)}function uy({content:i,className:s,onClick:a}){const o=B.useMemo(()=>I5(i),[i]);return b.jsxDEV("div",{className:s,onClick:a,dangerouslySetInnerHTML:{__html:o}},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/MarkdownRenderer.tsx",lineNumber:136,columnNumber:10},this)}function J5({className:i}){return b.jsxDEV("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h8M4 18h12"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:4,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:3,columnNumber:5},this)}function G5({className:i}){return b.jsxDEV("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7l-5 5 5 5M16 7l5 5-5 5"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:12,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:11,columnNumber:5},this)}function Q5({className:i}){return b.jsxDEV("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:20,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:19,columnNumber:5},this)}function X5({className:i}){return b.jsxDEV("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:28,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:27,columnNumber:5},this)}function Z5({className:i}){return b.jsxDEV("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9L3.5 3.5M9 15v4.5M9 15H4.5M9 15l-5.5 5.5M15 9h4.5M15 9V4.5M15 9l5.5-5.5M15 15h4.5M15 15v4.5m0-4.5l5.5 5.5"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:36,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:35,columnNumber:5},this)}function K5({className:i}){return b.jsxDEV("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:44,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewerIcons.tsx",lineNumber:43,columnNumber:5},this)}function dh({data:i,depth:s=0,generation:a}){const u=a!==void 0&&a>0&&a%2===1?!1:s>0,[d,p]=B.useState(u),[m,g]=B.useState(a);if(a!==void 0&&a!==m&&(g(a),p(a%2===0&&s>0)),i==null)return b.jsxDEV("span",{className:"text-text-tertiary italic",children:"null"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:25,columnNumber:12},this);if(typeof i=="string")return b.jsxDEV("span",{className:"text-text-primary",children:['"',i,'"']},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:29,columnNumber:12},this);if(typeof i=="number"||typeof i=="boolean")return b.jsxDEV("span",{className:"text-text-primary font-medium",children:String(i)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:33,columnNumber:12},this);if(Array.isArray(i))return i.length===0?b.jsxDEV("span",{className:"text-text-tertiary",children:"[]"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:37,columnNumber:35},this):d?b.jsxDEV("button",{onClick:()=>p(!1),className:"text-text-secondary hover:text-text-primary",children:["[",i.length," items]"]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:41,columnNumber:9},this):b.jsxDEV("span",{children:[b.jsxDEV("button",{onClick:()=>p(!0),className:"text-text-tertiary hover:text-text-primary",children:"["},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:52,columnNumber:9},this),b.jsxDEV("div",{className:"pl-4 border-l border-surface-border ml-1",children:i.map((x,_)=>b.jsxDEV("div",{children:[b.jsxDEV(dh,{data:x,depth:s+1,generation:a},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:61,columnNumber:15},this),_<i.length-1&&b.jsxDEV("span",{className:"text-text-tertiary",children:","},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:62,columnNumber:39},this)]},_,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:60,columnNumber:13},this))},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:58,columnNumber:9},this),b.jsxDEV("span",{className:"text-text-tertiary",children:"]"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:66,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:51,columnNumber:7},this);if(typeof i=="object"){const x=Object.entries(i);return x.length===0?b.jsxDEV("span",{className:"text-text-tertiary",children:"{}"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:73,columnNumber:38},this):d?b.jsxDEV("button",{onClick:()=>p(!1),className:"text-text-secondary hover:text-text-primary",children:["{","...","}"]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:77,columnNumber:9},this):b.jsxDEV("span",{children:[b.jsxDEV("button",{onClick:()=>p(!0),className:"text-text-tertiary hover:text-text-primary",children:"{"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:88,columnNumber:9},this),b.jsxDEV("div",{className:"pl-4 border-l border-surface-border ml-1",children:x.map(([_,w],D)=>b.jsxDEV("div",{children:[b.jsxDEV("span",{className:"text-text-secondary",children:_},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:97,columnNumber:15},this),b.jsxDEV("span",{className:"text-text-tertiary",children:": "},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:98,columnNumber:15},this),b.jsxDEV(dh,{data:w,depth:s+1,generation:a},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:99,columnNumber:15},this),D<x.length-1&&b.jsxDEV("span",{className:"text-text-tertiary",children:","},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:100,columnNumber:42},this)]},_,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:96,columnNumber:13},this))},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:94,columnNumber:9},this),b.jsxDEV("span",{className:"text-text-tertiary",children:"}"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:104,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:87,columnNumber:7},this)}return b.jsxDEV("span",{children:String(i)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:109,columnNumber:10},this)}function pu({data:i,depth:s=0}){if(i==null)return b.jsxDEV("span",{className:"text-text-tertiary italic",children:"null"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:118,columnNumber:12},this);if(typeof i=="string")return i.length>40&&F5(i)?b.jsxDEV(uy,{content:i},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:123,columnNumber:14},this):b.jsxDEV("span",{className:"text-text-primary",children:i},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:125,columnNumber:12},this);if(typeof i=="number"||typeof i=="boolean")return b.jsxDEV("span",{className:"text-text-primary font-medium",children:String(i)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:129,columnNumber:12},this);if(Array.isArray(i))return i.length===0?b.jsxDEV("span",{className:"text-text-tertiary italic",children:"empty list"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:133,columnNumber:35},this):b.jsxDEV("div",{className:"space-y-2",children:i.map((a,o)=>b.jsxDEV("div",{className:"flex items-baseline gap-2",children:[b.jsxDEV("span",{className:"text-text-tertiary text-[10px] shrink-0",children:[o+1,"."]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:138,columnNumber:13},this),b.jsxDEV("div",{className:"flex-1",children:b.jsxDEV(pu,{data:a,depth:s+1},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:140,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:139,columnNumber:13},this)]},o,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:137,columnNumber:11},this))},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:135,columnNumber:7},this);if(typeof i=="object"){const a=Object.entries(i);return a.length===0?b.jsxDEV("span",{className:"text-text-tertiary italic",children:"empty"},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:150,columnNumber:38},this):b.jsxDEV("div",{className:s>0?"pl-4 border-l border-surface-border space-y-3":"space-y-3",children:a.map(([o,u])=>{const d=u===null||typeof u!="object";return b.jsxDEV("div",{children:[b.jsxDEV("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:o.replace(/[_-]/g," ")},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:157,columnNumber:15},this),d?b.jsxDEV("p",{className:"text-sm text-text-primary",children:b.jsxDEV(pu,{data:u,depth:s+1},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:162,columnNumber:19},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:161,columnNumber:17},this):b.jsxDEV(pu,{data:u,depth:s+1},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:165,columnNumber:17},this)]},o,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:156,columnNumber:13},this)})},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:152,columnNumber:7},this)}return b.jsxDEV("span",{children:String(i)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:174,columnNumber:10},this)}function Aw({mode:i,setMode:s,isCollapsed:a,onToggleCollapse:o,onCopy:u,copied:d,onFullscreen:p,onClose:m,large:g}){const x=g?"w-5 h-5":"w-3.5 h-3.5",_=`${g?"p-2":"p-1.5"} rounded text-text-tertiary hover:text-text-primary hover:bg-surface-raised transition-colors duration-150`;return b.jsxDEV("div",{className:"flex items-center gap-0.5 bg-surface-sunken/80 rounded-md backdrop-blur-sm",children:[i==="json"&&b.jsxDEV("button",{onClick:o,className:_,title:a?"Expand all":"Collapse all",children:a?b.jsxDEV(K5,{className:x},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:207,columnNumber:26},this):b.jsxDEV(Z5,{className:x},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:207,columnNumber:60},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:206,columnNumber:9},this),b.jsxDEV("button",{onClick:()=>s(i==="json"?"tree":"json"),className:_,title:i==="json"?"Outline view":"JSON view",children:i==="json"?b.jsxDEV(J5,{className:x},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:211,columnNumber:28},this):b.jsxDEV(G5,{className:x},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:211,columnNumber:60},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:210,columnNumber:7},this),b.jsxDEV("button",{onClick:u,className:_,title:"Copy to clipboard",children:d?b.jsxDEV(X5,{className:`${x} text-status-success`},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:214,columnNumber:19},this):b.jsxDEV(Q5,{className:x},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:214,columnNumber:77},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:213,columnNumber:7},this),p&&b.jsxDEV("button",{onClick:p,className:_,title:"Fullscreen",children:b.jsxDEV(Kw,{className:x},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:218,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:217,columnNumber:9},this),m&&b.jsxDEV("button",{onClick:m,className:_,title:"Close (Esc)",children:b.jsxDEV(Ww,{className:x},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:223,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:222,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:204,columnNumber:5},this)}function W5({data:i,label:s,variant:a,defaultCollapsed:o=!1,defaultMode:u}){const d=B.useRef(null),[p,m]=B.useState(u??"json"),[g,x]=B.useState(!1),[_,w]=B.useState(!1),[D,z]=B.useState(0),[q,F]=B.useState(1),Z=D%2===0,ee=q%2===0,te=B.useCallback(()=>z(H=>H+1),[]),we=B.useCallback(()=>F(H=>H+1),[]);let De=i;if(typeof i=="string")try{De=JSON.parse(i)}catch{}const U=async()=>{const H=typeof i=="string"?i:JSON.stringify(De,null,2);await navigator.clipboard.writeText(H),x(!0),setTimeout(()=>x(!1),2e3)},ne=B.useCallback(()=>{F(1),w(!0)},[]),oe=a==="panel",W=oe?"border border-accent-muted/40 rounded-lg p-3 bg-surface-hover/30":"",Q=oe?"font-mono text-xs leading-relaxed bg-white rounded-md p-4 overflow-x-auto":"font-mono text-xs leading-relaxed bg-surface-sunken rounded-md p-4 overflow-x-auto";return b.jsxDEV("div",{className:W,children:[s&&b.jsxDEV(H5,{children:s},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:295,columnNumber:17},this),b.jsxDEV("div",{ref:d,className:"relative",children:[b.jsxDEV("div",{className:"absolute top-2 right-2 z-[5]",children:b.jsxDEV(Aw,{mode:p,setMode:m,isCollapsed:Z,onToggleCollapse:te,onCopy:U,copied:g,onFullscreen:ne},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:298,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:297,columnNumber:9},this),b.jsxDEV("div",{className:Q,children:p==="json"?b.jsxDEV(dh,{data:De,generation:D},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:306,columnNumber:30},this):b.jsxDEV(pu,{data:De},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:306,columnNumber:83},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:305,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:296,columnNumber:7},this),b.jsxDEV(zE,{open:_,onClose:()=>w(!1),sourceRef:d,children:[b.jsxDEV("div",{className:"sticky top-0 float-right z-10",children:b.jsxDEV(Aw,{mode:p,setMode:m,isCollapsed:ee,onToggleCollapse:we,onCopy:U,copied:g,onClose:()=>w(!1),large:!0},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:312,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:311,columnNumber:9},this),b.jsxDEV("div",{className:"font-mono text-sm leading-relaxed",children:p==="json"?b.jsxDEV(dh,{data:De,generation:q},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:321,columnNumber:30},this):b.jsxDEV(pu,{data:De},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:321,columnNumber:85},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:320,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:310,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/data/JsonViewer.tsx",lineNumber:294,columnNumber:5},this)}const e4=100,Dw=500;let t4=0;const BE={"escalation.created":"text-status-warning","escalation.claimed":"text-blue-400","escalation.released":"text-text-tertiary","escalation.resolved":"text-status-success","task.created":"text-accent","task.completed":"text-status-success","task.failed":"text-status-error","task.escalated":"text-status-warning","workflow.started":"text-accent","workflow.completed":"text-status-success","workflow.failed":"text-status-error","activity.started":"text-blue-400","activity.completed":"text-status-success","activity.failed":"text-status-error",milestone:"text-violet-400"};function Cw({event:i,forceExpanded:s=!1}){var D,z;const[a,o]=B.useState(s),u=BE[i.type]||"text-text-tertiary";B.useEffect(()=>{o(s)},[s]);const d=s,p=d?"text-xs":"text-[9px]",m=d?"text-xs":"text-[9px]",g=d?"text-xs":"text-[9px]",x=d?"w-3.5 h-3.5":"w-2.5 h-2.5",_=d?"py-2 px-4":"py-1 px-3",w=d?"pb-4 px-4":"pb-2 px-3";return b.jsxDEV("div",{className:"border-b border-surface-border/30 last:border-b-0",children:[b.jsxDEV("button",{onClick:()=>o(!a),className:`flex items-center gap-2 ${_} w-full text-left hover:bg-surface-hover/50 transition-colors`,children:[b.jsxDEV("span",{className:`${p} font-mono text-text-tertiary whitespace-nowrap tabular-nums shrink-0`,children:new Date(i.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:58,columnNumber:9},this),b.jsxDEV("span",{className:`${m} font-medium px-1 py-0.5 rounded ${u} bg-surface-sunken whitespace-nowrap shrink-0`,children:i.type},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:61,columnNumber:9},this),b.jsxDEV("span",{className:`${g} text-text-tertiary font-mono flex-1 min-w-0 truncate`,children:[(D=i.data)!=null&&D.workflowId?String(i.data.workflowId):"",(z=i.data)!=null&&z.escalationId?` esc:${String(i.data.escalationId).slice(0,12)}`:""]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:64,columnNumber:9},this),b.jsxDEV("svg",{className:`${x} text-text-tertiary shrink-0 transition-transform duration-150 ${a?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:b.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:72,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:68,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:54,columnNumber:7},this),b.jsxDEV(ly,{open:a,children:b.jsxDEV("div",{className:w,children:b.jsxDEV(W5,{data:i.data},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:77,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:76,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:75,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:53,columnNumber:5},this)}function n4({open:i,onToggle:s}){const[a,o]=B.useState([]),[u,d]=B.useState(!1),p=B.useRef(null),m=B.useRef(new Map);return NE("lt.events.>",B.useCallback(g=>{const x=String(g.type||"unknown");if(x.startsWith("mesh."))return;const _=`${x}:${g.timestamp||""}:${g.escalationId||g.workflowId||g.taskId||""}`,w=Date.now(),D=m.current.get(_);if(!(D&&w-D<Dw)){if(m.current.set(_,w),m.current.size>200)for(const[z,q]of m.current)w-q>Dw*2&&m.current.delete(z);o(z=>[{id:++t4,type:x,timestamp:g.timestamp||new Date().toISOString(),data:g},...z].slice(0,e4))}},[])),B.useEffect(()=>{i&&p.current&&(p.current.scrollTop=0)},[a.length,i]),b.jsxDEV("div",{className:"fixed bottom-0 left-0 right-0 z-40 border-t border-surface-border bg-surface-raised",children:[b.jsxDEV("button",{onClick:s,className:"flex items-center gap-2 w-full px-4 py-1.5 text-left hover:bg-surface-hover transition-colors",children:[i?b.jsxDEV(ZC,{className:"w-3 h-3 text-text-tertiary"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:133,columnNumber:17},this):b.jsxDEV(KC,{className:"w-3 h-3 text-text-tertiary"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:133,columnNumber:74},this),b.jsxDEV("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:"Event Stream"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:134,columnNumber:9},this),a.length>0&&b.jsxDEV("span",{className:"text-[9px] text-text-tertiary",children:[a.length," events"]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:138,columnNumber:11},this),a.length>0&&!i&&b.jsxDEV("span",{className:`text-[9px] font-medium px-1 py-0.5 rounded ${BE[a[0].type]||"text-text-tertiary"} bg-surface-sunken`,children:a[0].type},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:143,columnNumber:11},this),a.length>0&&b.jsxDEV("span",{className:"ml-auto flex items-center gap-1",children:[b.jsxDEV("span",{className:"text-text-tertiary hover:text-text-primary p-0.5 cursor-pointer",title:"Fullscreen",onClick:g=>{g.stopPropagation(),d(!0)},children:b.jsxDEV(Kw,{className:"w-3 h-3"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:154,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:149,columnNumber:13},this),b.jsxDEV("span",{className:"text-text-tertiary hover:text-text-primary p-0.5 cursor-pointer",title:"Clear events",onClick:g=>{g.stopPropagation(),o([])},children:b.jsxDEV(WC,{className:"w-3 h-3"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:161,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:156,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:148,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:129,columnNumber:7},this),b.jsxDEV(ly,{open:i,children:b.jsxDEV("div",{ref:p,className:"h-48 overflow-y-auto",children:a.length===0?b.jsxDEV("p",{className:"text-[10px] text-text-tertiary py-4 text-center",children:"Waiting for events..."},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:171,columnNumber:13},this):a.map(g=>b.jsxDEV(Cw,{event:g},g.id,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:173,columnNumber:33},this))},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:169,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:168,columnNumber:7},this),b.jsxDEV(zE,{open:u,onClose:()=>d(!1),sourceRef:p,children:[b.jsxDEV("div",{className:"sticky top-0 float-right z-10",children:b.jsxDEV("button",{onClick:()=>d(!1),className:"p-2 rounded text-text-tertiary hover:text-text-primary hover:bg-surface-raised transition-colors duration-150 bg-surface-sunken/80 backdrop-blur-sm",title:"Close (Esc)",children:b.jsxDEV(Ww,{className:"w-5 h-5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:185,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:180,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:179,columnNumber:9},this),a.length===0?b.jsxDEV("p",{className:"text-sm text-text-tertiary py-8",children:"No events captured"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:189,columnNumber:11},this):a.map(g=>b.jsxDEV(Cw,{event:g,forceExpanded:!0},g.id,!1,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:191,columnNumber:31},this))]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:178,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/EventFeed.tsx",lineNumber:127,columnNumber:5},this)}function s4(){return ii({queryKey:["docs"],queryFn:()=>Nt("/docs"),staleTime:5*6e4})}function a4(i){return ii({queryKey:["docs",i],queryFn:()=>Nt(`/docs/read?path=${encodeURIComponent(i)}`),enabled:!!i,staleTime:5*6e4})}function r4(){const[i,s]=B.useState([]),[a,o]=B.useState([]),[u,d]=B.useState(null),p=B.useRef(u),m=B.useRef(i),g=B.useRef(a);p.current=u,m.current=i,g.current=a;const x=B.useCallback((q,F)=>{var ee;const Z=p.current;if(Z){const te=((ee=F==null?void 0:F.current)==null?void 0:ee.scrollTop)??0;s([...m.current,{...Z,scrollTop:te}])}o([]),d({path:q,scrollTop:0})},[]),_=B.useCallback(q=>{var te;const F=m.current;if(F.length===0)return;const Z=F[F.length-1],ee=p.current;if(ee){const we=((te=q==null?void 0:q.current)==null?void 0:te.scrollTop)??0;o([...g.current,{...ee,scrollTop:we}])}s(F.slice(0,-1)),d(Z),requestAnimationFrame(()=>{q!=null&&q.current&&(q.current.scrollTop=Z.scrollTop)})},[]),w=B.useCallback(q=>{var te;const F=g.current;if(F.length===0)return;const Z=F[F.length-1],ee=p.current;if(ee){const we=((te=q==null?void 0:q.current)==null?void 0:te.scrollTop)??0;s([...m.current,{...ee,scrollTop:we}])}o(F.slice(0,-1)),d(Z),requestAnimationFrame(()=>{q!=null&&q.current&&(q.current.scrollTop=Z.scrollTop)})},[]),D=B.useCallback(q=>{var ee,te;const F=p.current;if(!F)return;const Z=((ee=q==null?void 0:q.current)==null?void 0:ee.scrollTop)??0;s([...m.current,{...F,scrollTop:Z}]),o([]),d({...F,scrollTop:((te=q==null?void 0:q.current)==null?void 0:te.scrollTop)??0})},[]),z=B.useCallback(()=>{s([]),o([]),d(null)},[]);return{current:u,backStack:i,forwardStack:a,navigate:x,goBack:_,goForward:w,pushScrollPosition:D,reset:z}}function i4(i,s){const[a,o]=i.split("#");let u=a;if(u.startsWith("./")||u.startsWith("../")){const p=((s?s.replace(/[^/]+$/,""):"")+u).split("/"),m=[];for(const g of p)g===".."?m.pop():g&&g!=="."&&m.push(g);u=m.join("/")}return{path:u,anchor:o}}function o4({content:i,currentPath:s,onNavigate:a,onAnchorClick:o}){const u=d=>{var x;const p=d.target,m=p.closest("[data-anchor]");if(m){d.preventDefault(),o();const _=m.dataset.anchor,w=(x=m.closest(".docs-content"))==null?void 0:x.querySelector(`#${CSS.escape(_)}`);w==null||w.scrollIntoView({behavior:"smooth",block:"start"});return}const g=p.closest("[data-doc-link]");if(g){d.preventDefault();const{path:_,anchor:w}=i4(g.dataset.docLink,s);a(_,w);return}};return b.jsxDEV(uy,{content:i,className:"docs-content",onClick:u},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:144,columnNumber:10},this)}function l4({docs:i,selected:s,onSelect:a}){const o=[],u=new Map;for(const p of i){const m=p.path.indexOf("/");if(m===-1)o.push(p);else{const g=p.path.slice(0,m);u.has(g)||u.set(g,[]),u.get(g).push(p)}}const d=p=>`block w-full text-left px-3 py-1 text-xs rounded truncate transition-colors ${s===p?"bg-accent/10 text-accent":"text-text-secondary hover:bg-surface-hover"}`;return b.jsxDEV("div",{className:"space-y-0.5",children:[o.map(p=>b.jsxDEV("button",{className:d(p.path),onClick:()=>a(p.path),children:p.title},p.path,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:180,columnNumber:9},this)),[...u.entries()].map(([p,m])=>b.jsxDEV("details",{open:!0,children:[b.jsxDEV("summary",{className:"flex items-center gap-1.5 px-3 py-1 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary cursor-pointer",children:[b.jsxDEV(tT,{className:"w-3 h-3",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:187,columnNumber:13},this),p]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:186,columnNumber:11},this),b.jsxDEV("div",{className:"pl-2 space-y-0.5",children:m.map(g=>b.jsxDEV("button",{className:d(g.path),onClick:()=>a(g.path),children:g.title},g.path,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:192,columnNumber:15},this))},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:190,columnNumber:11},this)]},p,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:185,columnNumber:9},this))]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:178,columnNumber:5},this)}function c4(i){if(!i.startsWith("#docs"))return null;const s=i.slice(1).split(":"),a=s[1]||"README.md",o=s[2]||void 0;return{path:a,anchor:o}}function u4(i){return!i||i==="README.md"?"#docs":`#docs:${i}`}function f4({open:i,onClose:s}){var oe,W,Q;const[a,o]=B.useState(!1),{data:u}=s4(),d=r4(),{data:p,isLoading:m}=a4(((oe=d.current)==null?void 0:oe.path)??null),g=B.useRef(null),[x,_]=B.useState(null);B.useEffect(()=>{x&&(p!=null&&p.content)&&g.current&&requestAnimationFrame(()=>{var le;const H=(le=g.current)==null?void 0:le.querySelector(`#${CSS.escape(x)}`);H==null||H.scrollIntoView({behavior:"smooth",block:"start"}),_(null)})},[x,p]);const w=B.useCallback(()=>{var ie;const H=c4(window.location.hash),le=(H==null?void 0:H.path)??"README.md";((ie=d.current)==null?void 0:ie.path)!==le&&d.navigate(le,g),H!=null&&H.anchor&&_(H.anchor)},[d]),D=B.useRef(!0);B.useEffect(()=>{if(!i||!d.current)return;if(D.current){D.current=!1;return}const H=u4(d.current.path);window.location.hash!==H&&window.history.replaceState(null,"",window.location.pathname+window.location.search+H)},[i,(W=d.current)==null?void 0:W.path]),B.useEffect(()=>{if(!i)return;const H=()=>{window.location.hash.startsWith("#docs")&&w()};return window.addEventListener("hashchange",H),()=>window.removeEventListener("hashchange",H)},[i,w]);const z=B.useCallback((H,le)=>{le&&_(le),d.navigate(H,g)},[d]),q=B.useCallback(H=>{d.navigate(H,g)},[d]),F=B.useCallback(()=>{d.goBack(g)},[d]),Z=B.useCallback(()=>{d.goForward(g)},[d]),ee=B.useCallback(()=>{d.pushScrollPosition(g)},[d]);if(B.useEffect(()=>{if(i){D.current=!0,w();const H=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(H)}},[i]),!(i||a))return null;const we=()=>{o(!1),setTimeout(()=>{s(),d.reset()},200)},De=((Q=d.current)==null?void 0:Q.path)??null,U=d.backStack.length>0,ne=d.forwardStack.length>0;return b.jsxDEV("div",{className:"fixed inset-y-0 right-0 z-50 flex",children:[b.jsxDEV("div",{className:`fixed inset-0 bg-black/20 transition-opacity duration-200 ${a&&i?"opacity-100":"opacity-0"}`,onClick:we},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:326,columnNumber:7},this),b.jsxDEV("div",{className:`relative ml-auto w-[40vw] min-w-[800px] max-w-[90vw] h-full bg-surface-raised border-l border-surface-border flex flex-col shadow-xl transition-transform duration-200 ease-out ${a&&i?"translate-x-0":"translate-x-full"}`,children:[b.jsxDEV("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border shrink-0",children:[b.jsxDEV("div",{className:"flex items-center gap-1",children:[b.jsxDEV("button",{onClick:F,disabled:!U,className:`p-0.5 transition-colors ${U?"text-text-tertiary hover:text-text-primary":"text-surface-border cursor-default"}`,title:"Back",children:b.jsxDEV(eT,{className:"w-4 h-4"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:342,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:336,columnNumber:13},this),b.jsxDEV("button",{onClick:Z,disabled:!ne,className:`p-0.5 transition-colors ${ne?"text-text-tertiary hover:text-text-primary":"text-surface-border cursor-default"}`,title:"Forward",children:b.jsxDEV(zS,{className:"w-4 h-4"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:350,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:344,columnNumber:13},this),b.jsxDEV(Xw,{className:"w-4 h-4 text-accent ml-1",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:352,columnNumber:13},this),b.jsxDEV("span",{className:"text-sm font-medium text-text-primary",children:"Documentation"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:353,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:335,columnNumber:11},this),b.jsxDEV("button",{onClick:we,className:"p-1 text-text-tertiary hover:text-text-primary",children:b.jsxDEV(F0,{className:"w-4 h-4"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:356,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:355,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:334,columnNumber:9},this),b.jsxDEV("div",{className:"flex flex-1 overflow-hidden",children:[b.jsxDEV("div",{className:"w-48 shrink-0 border-r border-surface-border overflow-y-auto py-2",children:u!=null&&u.docs?b.jsxDEV(l4,{docs:u.docs,selected:De,onSelect:q},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:365,columnNumber:15},this):b.jsxDEV("div",{className:"px-3 py-2 text-xs text-text-tertiary",children:"Loading..."},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:367,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:363,columnNumber:11},this),b.jsxDEV("div",{ref:g,className:"flex-1 overflow-y-auto px-6 py-4",children:De?m?b.jsxDEV("div",{className:"animate-pulse space-y-2",children:[b.jsxDEV("div",{className:"h-6 bg-surface-sunken rounded w-48"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:380,columnNumber:17},this),b.jsxDEV("div",{className:"h-4 bg-surface-sunken rounded w-full"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:381,columnNumber:17},this),b.jsxDEV("div",{className:"h-4 bg-surface-sunken rounded w-3/4"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:382,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:379,columnNumber:15},this):p!=null&&p.content?b.jsxDEV(o4,{content:p.content,currentPath:De,onNavigate:z,onAnchorClick:ee},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:385,columnNumber:15},this):b.jsxDEV("p",{className:"text-xs text-text-tertiary",children:"Document not found."},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:392,columnNumber:15},this):b.jsxDEV("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary",children:[b.jsxDEV(zS,{className:"w-5 h-5 mb-2"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:375,columnNumber:17},this),b.jsxDEV("p",{className:"text-xs",children:"Select a document"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:376,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:374,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:372,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:361,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:332,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/DocsDrawer.tsx",lineNumber:324,columnNumber:5},this)}const qE=B.createContext(null);function d4(i){if(i.includes("/escalations"))return["escalation","human-queue"]}const Tw=2e3;function h4(i){const a=i.filter(u=>!u.pending).slice(-8);return a.length===0?"":`[Prior conversation]
@@ -277,5 +277,5 @@ ${a.map(u=>`${u.role==="user"?"User":"Assistant"}: ${u.content}`).join(`
277
277
  [End prior conversation]
278
278
 
279
279
  `}function m4(i){const s=i.summary,a=i.title;if(s){const o=s.search(/\n\s*\{[\s\S]*"title"\s*:/);return o>0?s.slice(0,o).trim():s}return a||(typeof i=="string"?i:"Query completed.")}function p4({children:i}){const s=Zi(),[a,o]=B.useState(!1),[u,d]=B.useState([]),[p,m]=B.useState(null),[g,x]=B.useState({}),_=B.useRef(null),w={page:s.pathname.split("/").filter(Boolean).join("-")||"home",route:s.pathname,params:{},...g,suggestedTags:g.suggestedTags??d4(s.pathname)};B.useEffect(()=>()=>{_.current&&clearInterval(_.current)},[]);const D=B.useCallback(()=>o(ee=>!ee),[]),z=B.useCallback(ee=>{x(ee)},[]),q=B.useCallback(()=>{d([]),m(null)},[]),F=B.useCallback(async ee=>{var W;const te=new Date().toISOString(),we={id:`user-${Date.now()}`,role:"user",content:ee,timestamp:te},De={id:`pending-${Date.now()}`,role:"assistant",content:"",timestamp:te,pending:!0};d(Q=>[...Q,we,De]);const U={...w};(W=U.entities)!=null&&W.yamlContent&&U.entities.yamlContent.length>Tw&&(U.entities={...U.entities,yamlContent:U.entities.yamlContent.slice(0,Tw)+`
280
- ... (truncated)`});const oe=`${h4(u.concat(we))}${ee}`;try{const H=(await Nt("/insight/mcp-query",{method:"POST",body:JSON.stringify({prompt:oe,tags:U.suggestedTags,context:U,wait:!1,direct:!0})})).workflow_id;m(H),d(le=>le.map(ie=>ie.id===De.id?{...ie,workflowId:H}:ie)),_.current&&clearInterval(_.current),_.current=setInterval(async()=>{var le;try{const ie=await Nt(`/workflows/${H}/result`),ve=(le=ie==null?void 0:ie.result)==null?void 0:le.data;if(ve){_.current&&clearInterval(_.current),_.current=null,m(null);const Ge=m4(ve);let tt;try{tt=(await Nt(`/workflow-states/${H}/execution`)).duration_ms}catch{}d(ae=>ae.map(pe=>pe.id===De.id?{...pe,content:Ge,timestamp:new Date().toISOString(),pending:!1,durationMs:tt}:pe))}}catch{}},3e3)}catch{d(Q=>Q.map(H=>H.id===De.id?{...H,content:"Failed to submit query. Please try again.",pending:!1}:H))}},[u,w]),Z=B.useCallback(async ee=>{const te=u.find(U=>U.id===ee);if(!(te!=null&&te.workflowId)||te.compilationStatus==="compiling"||te.compilationStatus==="done")return;const we=u.indexOf(te),De=u.slice(0,we).reverse().find(U=>U.role==="user");if(De){d(U=>U.map(ne=>ne.id===ee?{...ne,compilationStatus:"compiling"}:ne));try{const U=await Nt("/insight/mcp-query/describe",{method:"POST",body:JSON.stringify({prompt:De.content,summary:te.content})}),ne=await Nt("/yaml-workflows",{method:"POST",body:JSON.stringify({workflow_id:te.workflowId,task_queue:"long-tail-system",workflow_name:"mcpQuery",name:U.tool_name,description:U.description,tags:U.tags,app_id:"longtail"})});await Nt(`/yaml-workflows/${ne.id}/deploy`,{method:"POST"}),d(oe=>oe.map(W=>W.id===ee?{...W,compilationStatus:"done"}:W))}catch(U){const ne=U instanceof Error?U.message:"Compilation failed";d(oe=>oe.map(W=>W.id===ee?{...W,compilationStatus:"error",compilationError:ne}:W))}}},[u]);return b.jsxDEV(qE.Provider,{value:{helpOpen:a,setHelpOpen:o,toggleHelp:D,messages:u,sendMessage:F,pageContext:w,setPageContext:z,activeWorkflowId:p,clearMessages:q,compileMessage:Z},children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useHelpAssistant.tsx",lineNumber:302,columnNumber:5},this)}function LE(){const i=B.useContext(qE);if(!i)throw new Error("useHelpAssistant must be used within HelpAssistantProvider");return i}function b4(){const{helpOpen:i,toggleHelp:s}=LE();return b.jsxDEV("button",{onClick:s,className:"fixed right-3 z-[45] flex items-center justify-center w-10 h-10 rounded-full bg-surface-raised shadow-lg hover:scale-110 transition-transform duration-150 border border-accent/30",style:{bottom:"calc(var(--feed-height, 32px) + 12px)"},"aria-label":i?"Close help":"Ask for help",children:i?b.jsxDEV(F0,{className:"w-5 h-5 text-text-tertiary",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpButton.tsx",lineNumber:15,columnNumber:9},this):b.jsxDEV("img",{src:"/logo512.png",alt:"Help",className:"w-8 h-8 -rotate-[120deg]"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpButton.tsx",lineNumber:17,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpButton.tsx",lineNumber:8,columnNumber:5},this)}const HE=6048e5,y4=864e5,Ow=6e4,Rw=525600,jw=43200,Mw=1440,kw=Symbol.for("constructDateFrom");function ar(i,s){return typeof i=="function"?i(s):i&&typeof i=="object"&&kw in i?i[kw](s):i instanceof Date?new i.constructor(s):new Date(s)}function ts(i,s){return ar(s||i,i)}let g4={};function wu(){return g4}function xu(i,s){var m,g,x,_;const a=wu(),o=(s==null?void 0:s.weekStartsOn)??((g=(m=s==null?void 0:s.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??a.weekStartsOn??((_=(x=a.locale)==null?void 0:x.options)==null?void 0:_.weekStartsOn)??0,u=ts(i,s==null?void 0:s.in),d=u.getDay(),p=(d<o?7:0)+d-o;return u.setDate(u.getDate()-p),u.setHours(0,0,0,0),u}function hh(i,s){return xu(i,{...s,weekStartsOn:1})}function PE(i,s){const a=ts(i,s==null?void 0:s.in),o=a.getFullYear(),u=ar(a,0);u.setFullYear(o+1,0,4),u.setHours(0,0,0,0);const d=hh(u),p=ar(a,0);p.setFullYear(o,0,4),p.setHours(0,0,0,0);const m=hh(p);return a.getTime()>=d.getTime()?o+1:a.getTime()>=m.getTime()?o:o-1}function mh(i){const s=ts(i),a=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return a.setUTCFullYear(s.getFullYear()),+i-+a}function $E(i,...s){const a=ar.bind(null,i||s.find(o=>typeof o=="object"));return s.map(a)}function Vw(i,s){const a=ts(i,s==null?void 0:s.in);return a.setHours(0,0,0,0),a}function v4(i,s,a){const[o,u]=$E(a==null?void 0:a.in,i,s),d=Vw(o),p=Vw(u),m=+d-mh(d),g=+p-mh(p);return Math.round((m-g)/y4)}function x4(i,s){const a=PE(i,s),o=ar(i,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),hh(o)}function N4(i,s){const a=+ts(i)-+ts(s);return a<0?-1:a>0?1:a}function S4(i){return ar(i,Date.now())}function w4(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function E4(i){return!(!w4(i)&&typeof i!="number"||isNaN(+ts(i)))}function _4(i){return s=>{const o=(i?Math[i]:Math.trunc)(s);return o===0?0:o}}function A4(i,s){const a=ts(i,s==null?void 0:s.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}const D4={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},C4=(i,s,a)=>{let o;const u=D4[i];return typeof u=="string"?o=u:s===1?o=u.one:o=u.other.replace("{{count}}",s.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o};function v0(i){return(s={})=>{const a=s.width?String(s.width):i.defaultWidth;return i.formats[a]||i.formats[i.defaultWidth]}}const T4={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},O4={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},R4={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},j4={date:v0({formats:T4,defaultWidth:"full"}),time:v0({formats:O4,defaultWidth:"full"}),dateTime:v0({formats:R4,defaultWidth:"full"})},M4={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},k4=(i,s,a,o)=>M4[i];function ru(i){return(s,a)=>{const o=a!=null&&a.context?String(a.context):"standalone";let u;if(o==="formatting"&&i.formattingValues){const p=i.defaultFormattingWidth||i.defaultWidth,m=a!=null&&a.width?String(a.width):p;u=i.formattingValues[m]||i.formattingValues[p]}else{const p=i.defaultWidth,m=a!=null&&a.width?String(a.width):i.defaultWidth;u=i.values[m]||i.values[p]}const d=i.argumentCallback?i.argumentCallback(s):s;return u[d]}}const V4={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},U4={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},z4={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},B4={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},q4={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},L4={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},H4=(i,s)=>{const a=Number(i),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},P4={ordinalNumber:H4,era:ru({values:V4,defaultWidth:"wide"}),quarter:ru({values:U4,defaultWidth:"wide",argumentCallback:i=>i-1}),month:ru({values:z4,defaultWidth:"wide"}),day:ru({values:B4,defaultWidth:"wide"}),dayPeriod:ru({values:q4,defaultWidth:"wide",formattingValues:L4,defaultFormattingWidth:"wide"})};function iu(i){return(s,a={})=>{const o=a.width,u=o&&i.matchPatterns[o]||i.matchPatterns[i.defaultMatchWidth],d=s.match(u);if(!d)return null;const p=d[0],m=o&&i.parsePatterns[o]||i.parsePatterns[i.defaultParseWidth],g=Array.isArray(m)?I4(m,w=>w.test(p)):$4(m,w=>w.test(p));let x;x=i.valueCallback?i.valueCallback(g):g,x=a.valueCallback?a.valueCallback(x):x;const _=s.slice(p.length);return{value:x,rest:_}}}function $4(i,s){for(const a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&s(i[a]))return a}function I4(i,s){for(let a=0;a<i.length;a++)if(s(i[a]))return a}function Y4(i){return(s,a={})=>{const o=s.match(i.matchPattern);if(!o)return null;const u=o[0],d=s.match(i.parsePattern);if(!d)return null;let p=i.valueCallback?i.valueCallback(d[0]):d[0];p=a.valueCallback?a.valueCallback(p):p;const m=s.slice(u.length);return{value:p,rest:m}}}const F4=/^(\d+)(th|st|nd|rd)?/i,J4=/\d+/i,G4={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Q4={any:[/^b/i,/^(a|c)/i]},X4={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Z4={any:[/1/i,/2/i,/3/i,/4/i]},K4={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},W4={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},eR={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},tR={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},nR={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sR={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},aR={ordinalNumber:Y4({matchPattern:F4,parsePattern:J4,valueCallback:i=>parseInt(i,10)}),era:iu({matchPatterns:G4,defaultMatchWidth:"wide",parsePatterns:Q4,defaultParseWidth:"any"}),quarter:iu({matchPatterns:X4,defaultMatchWidth:"wide",parsePatterns:Z4,defaultParseWidth:"any",valueCallback:i=>i+1}),month:iu({matchPatterns:K4,defaultMatchWidth:"wide",parsePatterns:W4,defaultParseWidth:"any"}),day:iu({matchPatterns:eR,defaultMatchWidth:"wide",parsePatterns:tR,defaultParseWidth:"any"}),dayPeriod:iu({matchPatterns:nR,defaultMatchWidth:"any",parsePatterns:sR,defaultParseWidth:"any"})},IE={code:"en-US",formatDistance:C4,formatLong:j4,formatRelative:k4,localize:P4,match:aR,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rR(i,s){const a=ts(i,s==null?void 0:s.in);return v4(a,A4(a))+1}function iR(i,s){const a=ts(i,s==null?void 0:s.in),o=+hh(a)-+x4(a);return Math.round(o/HE)+1}function YE(i,s){var _,w,D,z;const a=ts(i,s==null?void 0:s.in),o=a.getFullYear(),u=wu(),d=(s==null?void 0:s.firstWeekContainsDate)??((w=(_=s==null?void 0:s.locale)==null?void 0:_.options)==null?void 0:w.firstWeekContainsDate)??u.firstWeekContainsDate??((z=(D=u.locale)==null?void 0:D.options)==null?void 0:z.firstWeekContainsDate)??1,p=ar((s==null?void 0:s.in)||i,0);p.setFullYear(o+1,0,d),p.setHours(0,0,0,0);const m=xu(p,s),g=ar((s==null?void 0:s.in)||i,0);g.setFullYear(o,0,d),g.setHours(0,0,0,0);const x=xu(g,s);return+a>=+m?o+1:+a>=+x?o:o-1}function oR(i,s){var m,g,x,_;const a=wu(),o=(s==null?void 0:s.firstWeekContainsDate)??((g=(m=s==null?void 0:s.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((_=(x=a.locale)==null?void 0:x.options)==null?void 0:_.firstWeekContainsDate)??1,u=YE(i,s),d=ar((s==null?void 0:s.in)||i,0);return d.setFullYear(u,0,o),d.setHours(0,0,0,0),xu(d,s)}function lR(i,s){const a=ts(i,s==null?void 0:s.in),o=+xu(a,s)-+oR(a,s);return Math.round(o/HE)+1}function ct(i,s){const a=i<0?"-":"",o=Math.abs(i).toString().padStart(s,"0");return a+o}const Zr={y(i,s){const a=i.getFullYear(),o=a>0?a:1-a;return ct(s==="yy"?o%100:o,s.length)},M(i,s){const a=i.getMonth();return s==="M"?String(a+1):ct(a+1,2)},d(i,s){return ct(i.getDate(),s.length)},a(i,s){const a=i.getHours()/12>=1?"pm":"am";switch(s){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h(i,s){return ct(i.getHours()%12||12,s.length)},H(i,s){return ct(i.getHours(),s.length)},m(i,s){return ct(i.getMinutes(),s.length)},s(i,s){return ct(i.getSeconds(),s.length)},S(i,s){const a=s.length,o=i.getMilliseconds(),u=Math.trunc(o*Math.pow(10,a-3));return ct(u,s.length)}},ll={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Uw={G:function(i,s,a){const o=i.getFullYear()>0?1:0;switch(s){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},y:function(i,s,a){if(s==="yo"){const o=i.getFullYear(),u=o>0?o:1-o;return a.ordinalNumber(u,{unit:"year"})}return Zr.y(i,s)},Y:function(i,s,a,o){const u=YE(i,o),d=u>0?u:1-u;if(s==="YY"){const p=d%100;return ct(p,2)}return s==="Yo"?a.ordinalNumber(d,{unit:"year"}):ct(d,s.length)},R:function(i,s){const a=PE(i);return ct(a,s.length)},u:function(i,s){const a=i.getFullYear();return ct(a,s.length)},Q:function(i,s,a){const o=Math.ceil((i.getMonth()+1)/3);switch(s){case"Q":return String(o);case"QQ":return ct(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},q:function(i,s,a){const o=Math.ceil((i.getMonth()+1)/3);switch(s){case"q":return String(o);case"qq":return ct(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},M:function(i,s,a){const o=i.getMonth();switch(s){case"M":case"MM":return Zr.M(i,s);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},L:function(i,s,a){const o=i.getMonth();switch(s){case"L":return String(o+1);case"LL":return ct(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},w:function(i,s,a,o){const u=lR(i,o);return s==="wo"?a.ordinalNumber(u,{unit:"week"}):ct(u,s.length)},I:function(i,s,a){const o=iR(i);return s==="Io"?a.ordinalNumber(o,{unit:"week"}):ct(o,s.length)},d:function(i,s,a){return s==="do"?a.ordinalNumber(i.getDate(),{unit:"date"}):Zr.d(i,s)},D:function(i,s,a){const o=rR(i);return s==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):ct(o,s.length)},E:function(i,s,a){const o=i.getDay();switch(s){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},e:function(i,s,a,o){const u=i.getDay(),d=(u-o.weekStartsOn+8)%7||7;switch(s){case"e":return String(d);case"ee":return ct(d,2);case"eo":return a.ordinalNumber(d,{unit:"day"});case"eee":return a.day(u,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(u,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(u,{width:"short",context:"formatting"});case"eeee":default:return a.day(u,{width:"wide",context:"formatting"})}},c:function(i,s,a,o){const u=i.getDay(),d=(u-o.weekStartsOn+8)%7||7;switch(s){case"c":return String(d);case"cc":return ct(d,s.length);case"co":return a.ordinalNumber(d,{unit:"day"});case"ccc":return a.day(u,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(u,{width:"narrow",context:"standalone"});case"cccccc":return a.day(u,{width:"short",context:"standalone"});case"cccc":default:return a.day(u,{width:"wide",context:"standalone"})}},i:function(i,s,a){const o=i.getDay(),u=o===0?7:o;switch(s){case"i":return String(u);case"ii":return ct(u,s.length);case"io":return a.ordinalNumber(u,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},a:function(i,s,a){const u=i.getHours()/12>=1?"pm":"am";switch(s){case"a":case"aa":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(u,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(u,{width:"wide",context:"formatting"})}},b:function(i,s,a){const o=i.getHours();let u;switch(o===12?u=ll.noon:o===0?u=ll.midnight:u=o/12>=1?"pm":"am",s){case"b":case"bb":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(u,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(u,{width:"wide",context:"formatting"})}},B:function(i,s,a){const o=i.getHours();let u;switch(o>=17?u=ll.evening:o>=12?u=ll.afternoon:o>=4?u=ll.morning:u=ll.night,s){case"B":case"BB":case"BBB":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(u,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(u,{width:"wide",context:"formatting"})}},h:function(i,s,a){if(s==="ho"){let o=i.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return Zr.h(i,s)},H:function(i,s,a){return s==="Ho"?a.ordinalNumber(i.getHours(),{unit:"hour"}):Zr.H(i,s)},K:function(i,s,a){const o=i.getHours()%12;return s==="Ko"?a.ordinalNumber(o,{unit:"hour"}):ct(o,s.length)},k:function(i,s,a){let o=i.getHours();return o===0&&(o=24),s==="ko"?a.ordinalNumber(o,{unit:"hour"}):ct(o,s.length)},m:function(i,s,a){return s==="mo"?a.ordinalNumber(i.getMinutes(),{unit:"minute"}):Zr.m(i,s)},s:function(i,s,a){return s==="so"?a.ordinalNumber(i.getSeconds(),{unit:"second"}):Zr.s(i,s)},S:function(i,s){return Zr.S(i,s)},X:function(i,s,a){const o=i.getTimezoneOffset();if(o===0)return"Z";switch(s){case"X":return Bw(o);case"XXXX":case"XX":return Qi(o);case"XXXXX":case"XXX":default:return Qi(o,":")}},x:function(i,s,a){const o=i.getTimezoneOffset();switch(s){case"x":return Bw(o);case"xxxx":case"xx":return Qi(o);case"xxxxx":case"xxx":default:return Qi(o,":")}},O:function(i,s,a){const o=i.getTimezoneOffset();switch(s){case"O":case"OO":case"OOO":return"GMT"+zw(o,":");case"OOOO":default:return"GMT"+Qi(o,":")}},z:function(i,s,a){const o=i.getTimezoneOffset();switch(s){case"z":case"zz":case"zzz":return"GMT"+zw(o,":");case"zzzz":default:return"GMT"+Qi(o,":")}},t:function(i,s,a){const o=Math.trunc(+i/1e3);return ct(o,s.length)},T:function(i,s,a){return ct(+i,s.length)}};function zw(i,s=""){const a=i>0?"-":"+",o=Math.abs(i),u=Math.trunc(o/60),d=o%60;return d===0?a+String(u):a+String(u)+s+ct(d,2)}function Bw(i,s){return i%60===0?(i>0?"-":"+")+ct(Math.abs(i)/60,2):Qi(i,s)}function Qi(i,s=""){const a=i>0?"-":"+",o=Math.abs(i),u=ct(Math.trunc(o/60),2),d=ct(o%60,2);return a+u+s+d}const qw=(i,s)=>{switch(i){case"P":return s.date({width:"short"});case"PP":return s.date({width:"medium"});case"PPP":return s.date({width:"long"});case"PPPP":default:return s.date({width:"full"})}},FE=(i,s)=>{switch(i){case"p":return s.time({width:"short"});case"pp":return s.time({width:"medium"});case"ppp":return s.time({width:"long"});case"pppp":default:return s.time({width:"full"})}},cR=(i,s)=>{const a=i.match(/(P+)(p+)?/)||[],o=a[1],u=a[2];if(!u)return qw(i,s);let d;switch(o){case"P":d=s.dateTime({width:"short"});break;case"PP":d=s.dateTime({width:"medium"});break;case"PPP":d=s.dateTime({width:"long"});break;case"PPPP":default:d=s.dateTime({width:"full"});break}return d.replace("{{date}}",qw(o,s)).replace("{{time}}",FE(u,s))},uR={p:FE,P:cR},fR=/^D+$/,dR=/^Y+$/,hR=["D","DD","YY","YYYY"];function mR(i){return fR.test(i)}function pR(i){return dR.test(i)}function bR(i,s,a){const o=yR(i,s,a);if(console.warn(o),hR.includes(i))throw new RangeError(o)}function yR(i,s,a){const o=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${s}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const gR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xR=/^'([^]*?)'?$/,NR=/''/g,SR=/[a-zA-Z]/;function JE(i,s,a){var _,w,D,z;const o=wu(),u=o.locale??IE,d=o.firstWeekContainsDate??((w=(_=o.locale)==null?void 0:_.options)==null?void 0:w.firstWeekContainsDate)??1,p=o.weekStartsOn??((z=(D=o.locale)==null?void 0:D.options)==null?void 0:z.weekStartsOn)??0,m=ts(i,a==null?void 0:a.in);if(!E4(m))throw new RangeError("Invalid time value");let g=s.match(vR).map(q=>{const F=q[0];if(F==="p"||F==="P"){const Z=uR[F];return Z(q,u.formatLong)}return q}).join("").match(gR).map(q=>{if(q==="''")return{isToken:!1,value:"'"};const F=q[0];if(F==="'")return{isToken:!1,value:wR(q)};if(Uw[F])return{isToken:!0,value:q};if(F.match(SR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+F+"`");return{isToken:!1,value:q}});u.localize.preprocessor&&(g=u.localize.preprocessor(m,g));const x={firstWeekContainsDate:d,weekStartsOn:p,locale:u};return g.map(q=>{if(!q.isToken)return q.value;const F=q.value;(pR(F)||mR(F))&&bR(F,s,String(i));const Z=Uw[F[0]];return Z(m,F,u.localize,x)}).join("")}function wR(i){const s=i.match(xR);return s?s[1].replace(NR,"'"):i}function ER(i,s,a){const o=wu(),u=(a==null?void 0:a.locale)??o.locale??IE,d=N4(i,s);if(isNaN(d))throw new RangeError("Invalid time value");const p=Object.assign({},a,{addSuffix:a==null?void 0:a.addSuffix,comparison:d}),[m,g]=$E(a==null?void 0:a.in,...d>0?[s,i]:[i,s]),x=_4((a==null?void 0:a.roundingMethod)??"round"),_=g.getTime()-m.getTime(),w=_/Ow,D=mh(g)-mh(m),z=(_-D)/Ow,q=a==null?void 0:a.unit;let F;if(q?F=q:w<1?F="second":w<60?F="minute":w<Mw?F="hour":z<jw?F="day":z<Rw?F="month":F="year",F==="second"){const Z=x(_/1e3);return u.formatDistance("xSeconds",Z,p)}else if(F==="minute"){const Z=x(w);return u.formatDistance("xMinutes",Z,p)}else if(F==="hour"){const Z=x(w/60);return u.formatDistance("xHours",Z,p)}else if(F==="day"){const Z=x(z/Mw);return u.formatDistance("xDays",Z,p)}else if(F==="month"){const Z=x(z/jw);return Z===12&&q!=="month"?u.formatDistance("xYears",1,p):u.formatDistance("xMonths",Z,p)}else{const Z=x(z/Rw);return u.formatDistance("xYears",Z,p)}}function _R(i,s){return ER(i,S4(i),s)}function AR(i){const s=new Date(i);return s.getTime()>Date.now()?"just now":_R(s,{addSuffix:!0})}function z6(i){return i<=0?"Expired":fy(i)}function DR(i){return i==null?"--":fy(i)}function fy(i){if(i<1e3)return`${Math.round(i)}ms`;if(i<6e4){const p=i/1e3;return Number.isInteger(p)?`${p}s`:`${p.toFixed(1)}s`}const s=Math.floor(i/1e3),a=Math.floor(s/86400),o=Math.floor(s%86400/3600),u=Math.floor(s%3600/60),d=s%60;return a>0?o>0?`${a}d ${o}h`:`${a}d`:o>0?u>0?`${o}h ${u}m`:`${o}h`:d>0?`${u}m ${d}s`:`${u}m`}function B6(i,s){const a=new Date(i).getTime(),o=s?new Date(s).getTime():Date.now();return fy(o-a)}function GE({options:i,children:s,className:a=""}){const[o,u]=B.useState(!1),[d,p]=B.useState(null),[m,g]=B.useState(null),x=B.useRef(null),_=B.useRef(void 0),w=B.useRef(void 0),D=220,z=B.useCallback(()=>{if(!x.current)return;const ee=x.current.getBoundingClientRect(),te=window.innerWidth-D-8,we=Math.max(8,Math.min(ee.left,te));g({top:ee.bottom+4,left:we})},[]),q=B.useCallback(async(ee,te)=>{try{await navigator.clipboard.writeText(ee),p(te),clearTimeout(_.current),_.current=setTimeout(()=>p(null),1200)}catch{}},[]),F=B.useCallback(()=>{clearTimeout(w.current),z(),u(!0)},[z]),Z=B.useCallback(()=>{w.current=setTimeout(()=>u(!1),150)},[]);return B.useEffect(()=>()=>{clearTimeout(_.current),clearTimeout(w.current)},[]),b.jsxDEV("span",{ref:x,className:`inline-flex items-center cursor-default ${a}`,onMouseEnter:F,onMouseLeave:Z,children:[s,o&&m&&Gw.createPortal(b.jsxDEV("span",{className:"fixed z-[9999] bg-surface-raised border border-surface-border rounded shadow-lg py-1 min-w-[180px]",style:{top:m.top,left:m.left},onMouseEnter:F,onMouseLeave:Z,children:i.map(ee=>b.jsxDEV("button",{onClick:te=>{te.stopPropagation(),q(ee.value,ee.label)},className:"flex items-center justify-between w-full px-2.5 py-1 text-left hover:bg-surface-hover transition-colors",children:[b.jsxDEV("span",{className:"text-[9px] font-medium uppercase tracking-wider text-text-tertiary w-10 shrink-0",children:ee.label},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:85,columnNumber:15},this),b.jsxDEV("span",{className:"text-[10px] font-mono text-text-secondary truncate ml-2",children:d===ee.label?"✓":ee.value},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:88,columnNumber:15},this)]},ee.label,!0,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:80,columnNumber:13},this))},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:73,columnNumber:9},this),document.body)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:65,columnNumber:5},this)}function CR(i,s){const a=new Date(i);switch(s){case"relative":return AR(i);case"datetime":return JE(a,"MMM d, yyyy h:mm a");case"time":return a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}}function TR(i){const s=new Date(i);return[{label:"ms",value:String(s.getTime())},{label:"utc",value:s.toISOString()},{label:"local",value:JE(s,"MMM d, yyyy h:mm:ss a")}]}function OR({date:i,format:s="relative",className:a=""}){const[,o]=B.useState(0);B.useEffect(()=>{if(s!=="relative")return;const d=setInterval(()=>o(p=>p+1),3e4);return()=>clearInterval(d)},[s]);const u=B.useMemo(()=>TR(i),[i]);return b.jsxDEV(GE,{options:u,children:b.jsxDEV("time",{dateTime:i,className:`text-xs text-text-tertiary ${a}`,children:CR(i,s)},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateValue.tsx",lineNumber:56,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateValue.tsx",lineNumber:55,columnNumber:5},this)}function RR({ms:i,className:s=""}){const a=DR(i),o=B.useMemo(()=>i==null?[]:[{label:"ms",value:String(i)},{label:"sec",value:`${(i/1e3).toFixed(3)}s`},{label:"text",value:a}],[i,a]);return i==null?b.jsxDEV("span",{className:`text-xs text-text-tertiary ${s}`,children:"--"},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DurationValue.tsx",lineNumber:29,columnNumber:12},this):b.jsxDEV(GE,{options:o,children:b.jsxDEV("span",{className:`text-xs text-text-tertiary ${s}`,children:a},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DurationValue.tsx",lineNumber:34,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DurationValue.tsx",lineNumber:33,columnNumber:5},this)}const jR=["sm","md","lg","full"],Lw={sm:"w-[28rem] max-h-[40vh]",md:"w-[36rem] max-h-[60vh]",lg:"w-[48rem] max-h-[80vh]",full:"inset-4 w-auto max-h-none"},Hw={sm:"Small",md:"Medium",lg:"Large",full:"Fullscreen"};function MR({which:i}){const s="stroke-current";switch(i){case"sm":return b.jsxDEV("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsxDEV("rect",{x:"5",y:"5",width:"7",height:"7",rx:"1.5",className:s,strokeWidth:"1.5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:27,columnNumber:75},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:27,columnNumber:15},this);case"md":return b.jsxDEV("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsxDEV("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5",className:s,strokeWidth:"1.5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:29,columnNumber:75},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:29,columnNumber:15},this);case"lg":return b.jsxDEV("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsxDEV("rect",{x:"1.5",y:"1.5",width:"11",height:"11",rx:"1.5",className:s,strokeWidth:"1.5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:31,columnNumber:75},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:31,columnNumber:15},this);case"full":return b.jsxDEV("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsxDEV("rect",{x:"0.75",y:"0.75",width:"12.5",height:"12.5",rx:"1.5",className:s,strokeWidth:"1.5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:33,columnNumber:75},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:33,columnNumber:15},this)}}function kR({msg:i}){const[s,a]=B.useState(0);B.useEffect(()=>{const p=new Date(i.timestamp).getTime(),m=()=>a(Math.floor((Date.now()-p)/1e3));m();const g=setInterval(m,1e3);return()=>clearInterval(g)},[i.timestamp]);const o=Math.floor(s/60),u=s%60,d=o>0?`${o}m ${u}s`:`${u}s`;return b.jsxDEV("span",{className:"inline-flex flex-col gap-1.5",children:[b.jsxDEV("span",{className:"inline-flex items-center gap-1",children:[b.jsxDEV("span",{className:"text-text-tertiary",children:"Thinking"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:55,columnNumber:9},this),b.jsxDEV("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:56,columnNumber:9},this),b.jsxDEV("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse [animation-delay:150ms]"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:57,columnNumber:9},this),b.jsxDEV("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse [animation-delay:300ms]"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:58,columnNumber:9},this),b.jsxDEV("span",{className:"text-text-muted ml-1 tabular-nums",children:d},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:59,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:54,columnNumber:7},this),i.workflowId&&b.jsxDEV(uu,{to:`/workflows/executions/${i.workflowId}`,className:"inline-flex items-center gap-1 text-[10px] text-accent/70 hover:text-accent transition-colors",children:[b.jsxDEV(Y0,{className:"w-2.5 h-2.5",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:66,columnNumber:11},this),"watch execution"]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:62,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:53,columnNumber:5},this)}function VR({msg:i,compileMessage:s}){const a=i.role==="assistant";return b.jsxDEV("div",{className:`flex items-center gap-1.5 ${a?"justify-start":"justify-end"}`,children:[b.jsxDEV(OR,{date:i.timestamp,format:"time",className:"!text-[9px] text-text-muted/50"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:78,columnNumber:7},this),i.durationMs!=null&&b.jsxDEV(b.Fragment,{children:[b.jsxDEV("span",{className:"text-text-muted/30 text-[8px]",children:"·"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:81,columnNumber:11},this),b.jsxDEV(RR,{ms:i.durationMs,className:"!text-[9px] text-text-muted/50"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:82,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:80,columnNumber:9},this),i.workflowId&&b.jsxDEV(uu,{to:`/workflows/executions/${i.workflowId}`,className:"text-text-muted/40 hover:text-accent transition-colors",title:"View workflow execution",children:b.jsxDEV(Y0,{className:"w-2.5 h-2.5",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:91,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:86,columnNumber:9},this),a&&i.workflowId&&!i.pending&&b.jsxDEV("button",{onClick:()=>s(i.id),disabled:i.compilationStatus==="compiling"||i.compilationStatus==="done",className:"transition-colors",title:i.compilationStatus==="done"?"Compiled — future queries will match this pipeline":i.compilationStatus==="error"?i.compilationError??"Compilation failed":i.compilationStatus==="compiling"?"Compiling...":"Compile to fast pipeline",children:b.jsxDEV(aT,{className:`w-2.5 h-2.5 ${i.compilationStatus==="done"?"text-status-success":i.compilationStatus==="error"?"text-status-error":i.compilationStatus==="compiling"?"text-accent/40 animate-pulse":"text-text-muted/40 hover:text-accent"}`,strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:109,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:95,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:77,columnNumber:5},this)}function UR(){const{helpOpen:i,setHelpOpen:s,messages:a,sendMessage:o,pageContext:u,activeWorkflowId:d,clearMessages:p,compileMessage:m}=LE(),[g,x]=B.useState(""),[_,w]=B.useState("md"),[D,z]=B.useState(!0),q=B.useRef(null),F=B.useRef(null);if(B.useEffect(()=>{q.current&&(q.current.scrollTop=q.current.scrollHeight)},[a]),B.useEffect(()=>{i&&F.current&&F.current.focus()},[i]),B.useEffect(()=>{if(!i)return;const U=ne=>{ne.key==="Escape"&&(_==="full"?w("lg"):_==="lg"?w("md"):_==="md"?w("sm"):s(!1))};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[i,_,s]),!i)return null;const Z=()=>{const U=g.trim();!U||d||(o(U),x(""),F.current&&(F.current.style.height="auto"))},ee=U=>{U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),Z())},te=_==="full",we=u.page.replace(/-/g," "),De=te?{}:{bottom:"calc(var(--feed-height, 32px) + 76px)"};return b.jsxDEV("div",{className:`fixed z-[45] flex flex-col border border-surface-border rounded-lg overflow-hidden transition-all duration-300 ${te?Lw.full:`right-6 ${Lw[_]}`} ${D?"bg-surface-raised shadow-xl":"bg-surface-raised/[0.03] shadow-lg shadow-black/5"}`,style:De,onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[b.jsxDEV("div",{className:`flex items-center justify-between px-4 py-2.5 border-b border-surface-border shrink-0 transition-all duration-300 ${D?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[b.jsxDEV("div",{className:"min-w-0 flex-1",children:[b.jsxDEV("p",{className:"text-xs font-medium text-text-primary truncate",children:"Help Assistant"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:206,columnNumber:11},this),b.jsxDEV("p",{className:"text-[10px] text-text-tertiary truncate",children:we},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:207,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:205,columnNumber:9},this),b.jsxDEV("div",{className:"flex items-center gap-1 ml-2",children:[b.jsxDEV("div",{className:"flex items-center gap-0.5 border border-surface-border rounded p-0.5",role:"radiogroup","aria-label":"Panel size",children:jR.map(U=>b.jsxDEV("button",{onClick:()=>w(U),className:`p-1 rounded transition-colors ${U===_?"bg-accent/15 text-accent":"text-text-muted hover:text-text-secondary hover:bg-surface-hover"}`,role:"radio","aria-checked":U===_,"aria-label":Hw[U],title:Hw[U],children:b.jsxDEV(MR,{which:U},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:225,columnNumber:17},this)},U,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:212,columnNumber:15},this))},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:210,columnNumber:11},this),a.length>0&&b.jsxDEV("button",{onClick:p,className:"p-1 text-text-tertiary hover:text-text-secondary transition-colors","aria-label":"Clear conversation",title:"Clear conversation",children:b.jsxDEV(nT,{className:"w-3.5 h-3.5",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:236,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:230,columnNumber:13},this),b.jsxDEV("button",{onClick:()=>s(!1),className:"p-1 text-text-tertiary hover:text-text-primary transition-colors","aria-label":"Close",title:"Close",children:b.jsxDEV(F0,{className:"w-3.5 h-3.5",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:245,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:239,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:209,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:202,columnNumber:7},this),b.jsxDEV("div",{ref:q,className:`flex-1 overflow-y-auto px-4 py-3 space-y-3 min-h-[120px] transition-all duration-300 ${D?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[a.length===0&&b.jsxDEV("p",{className:"text-xs text-text-tertiary text-center py-6",children:"Ask anything about what you're viewing."},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:255,columnNumber:11},this),a.map(U=>b.jsxDEV("div",{className:`text-xs leading-relaxed ${U.role==="user"?"text-right":"text-left"}`,children:[b.jsxDEV("div",{className:`inline-block max-w-[85%] px-3 py-2 rounded-md whitespace-pre-wrap ${U.role==="user"?"bg-accent/10 text-text-primary":"bg-surface-sunken text-text-secondary"}`,children:U.pending?b.jsxDEV(kR,{msg:U},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:272,columnNumber:17},this):U.role==="assistant"?b.jsxDEV(uy,{content:U.content},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:274,columnNumber:17},this):U.content},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:264,columnNumber:13},this),!U.pending&&b.jsxDEV("div",{className:"mt-0.5",children:b.jsxDEV(VR,{msg:U,compileMessage:m},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:281,columnNumber:17},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:280,columnNumber:15},this)]},U.id,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:260,columnNumber:11},this))]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:251,columnNumber:7},this),b.jsxDEV("div",{className:`border-t border-surface-border px-3 py-2.5 flex gap-2 shrink-0 transition-all duration-300 ${D?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[b.jsxDEV("textarea",{ref:F,value:g,onChange:U=>{x(U.target.value);const ne=U.target;ne.style.height="auto",ne.style.height=`${Math.min(ne.scrollHeight,120)}px`},onKeyDown:ee,placeholder:"Ask a question...",rows:2,className:"flex-1 resize-none bg-surface text-xs text-text-primary placeholder:text-text-tertiary rounded px-2.5 py-1.5 border border-surface-border focus:outline-none focus:border-accent",style:{minHeight:"2.5rem"},disabled:!!d},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:292,columnNumber:9},this),b.jsxDEV("button",{onClick:Z,disabled:!g.trim()||!!d,className:"px-2.5 py-1.5 text-accent hover:text-accent-hover disabled:text-text-muted transition-colors self-end","aria-label":"Send",children:b.jsxDEV(sT,{className:"w-4 h-4",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:314,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:308,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:289,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:189,columnNumber:5},this)}function zR(){const{isSuperAdmin:i,hasRoleType:s,hasRole:a}=Ki(),{collapsed:o,toggle:u}=UE(),[d,p]=B.useState(!1),[m,g]=B.useState(()=>window.location.hash.startsWith("#docs")),x=Zi(),_=B.useRef(null);return B.useEffect(()=>{const w=_.current;w&&(w.classList.remove("animate-page-in"),w.offsetWidth,w.classList.add("animate-page-in"))},[x.pathname]),B.useEffect(()=>{const w=()=>{window.location.hash.startsWith("#docs")&&g(!0)};return window.addEventListener("hashchange",w),()=>window.removeEventListener("hashchange",w)},[]),b.jsxDEV("div",{className:"h-screen bg-surface flex flex-col",style:{"--feed-height":d?"224px":"32px"},children:[b.jsxDEV(O5,{onToggleEventFeed:()=>p(w=>!w),onToggleDocs:()=>g(w=>!w)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:45,columnNumber:7},this),b.jsxDEV("div",{className:"flex flex-1 overflow-hidden",children:[b.jsxDEV("aside",{className:`${o?"w-16":"w-60"} shrink-0 bg-surface-raised border-r border-surface-border flex flex-col transition-[width] duration-200 ease-out overflow-hidden relative z-20`,children:[b.jsxDEV("nav",{className:"flex-1 px-3 pt-[36px] pb-4 space-y-2 overflow-y-auto overflow-x-hidden",children:[(i||s("admin")||a("engineer"))&&b.jsxDEV(B5,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:57,columnNumber:79},this),(i||s("admin")||a("engineer"))&&b.jsxDEV(L5,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:58,columnNumber:79},this),(i||s("admin"))&&b.jsxDEV(U5,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:59,columnNumber:56},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:56,columnNumber:11},this),b.jsxDEV("button",{onClick:u,className:`shrink-0 py-3 text-text-tertiary hover:text-text-secondary transition-colors duration-150 ${o?"flex justify-center":"flex items-center px-7"}`,"aria-label":o?"Expand sidebar":"Collapse sidebar",children:o?b.jsxDEV(rT,{className:"w-4 h-4 text-accent-muted",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:71,columnNumber:15},this):b.jsxDEV(iT,{className:"w-4 h-4 text-accent-muted",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:73,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:63,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:50,columnNumber:9},this),b.jsxDEV("main",{className:"flex-1 overflow-y-auto",children:b.jsxDEV("div",{ref:_,className:`max-w-dashboard mx-auto px-10 py-10 animate-page-in ${d?"pb-60":"pb-16"}`,children:b.jsxDEV(Xd,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:81,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:80,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:79,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:48,columnNumber:7},this),b.jsxDEV(n4,{open:d,onToggle:()=>p(w=>!w)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:87,columnNumber:7},this),b.jsxDEV(f4,{open:m,onClose:()=>{g(!1),history.replaceState(null,"",window.location.pathname+window.location.search)}},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:88,columnNumber:7},this),b.jsxDEV(b4,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:89,columnNumber:7},this),b.jsxDEV(UR,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:90,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:43,columnNumber:5},this)}function BR(){const{isAuthenticated:i}=Ki(),s=Zi();return i?b.jsxDEV(A5,{children:b.jsxDEV(p4,{children:b.jsxDEV(zR,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:106,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:105,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:104,columnNumber:5},this):b.jsxDEV(Wr,{to:"/login",state:{from:s.pathname},replace:!0},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:100,columnNumber:12},this)}function QE({provider:i,className:s="w-5 h-5"}){switch(i){case"google":return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"currentColor",children:[b.jsxDEV("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:11,columnNumber:11},this),b.jsxDEV("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:12,columnNumber:11},this),b.jsxDEV("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:13,columnNumber:11},this),b.jsxDEV("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:14,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:10,columnNumber:9},this);case"github":return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"currentColor",children:b.jsxDEV("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:20,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:19,columnNumber:9},this);case"microsoft":return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"currentColor",children:[b.jsxDEV("path",{d:"M3 3h8.5v8.5H3z",fill:"#F25022"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:26,columnNumber:11},this),b.jsxDEV("path",{d:"M12.5 3H21v8.5h-8.5z",fill:"#7FBA00"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:27,columnNumber:11},this),b.jsxDEV("path",{d:"M3 12.5h8.5V21H3z",fill:"#00A4EF"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:28,columnNumber:11},this),b.jsxDEV("path",{d:"M12.5 12.5H21V21h-8.5z",fill:"#FFB900"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:29,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:25,columnNumber:9},this);case"anthropic":return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"currentColor",children:b.jsxDEV("path",{d:"M13.827 3.52h3.603L24 20.48h-3.603l-6.57-16.96zm-7.258 0h3.767L16.906 20.48h-3.674l-1.343-3.461H6.396l-1.34 3.461H1.5l5.07-16.96zm2.327 5.14l-2.065 5.326h4.108l-2.043-5.326z"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:35,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:34,columnNumber:9},this);default:return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[b.jsxDEV("circle",{cx:"12",cy:"12",r:"10"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:41,columnNumber:11},this),b.jsxDEV("path",{d:"M12 8v4l3 3"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:42,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:40,columnNumber:9},this)}}async function qR(){return Nt("/auth/oauth/providers")}async function LR(i,s){const a=s?`?label=${encodeURIComponent(s)}`:"";return Nt(`/auth/oauth/connections/${i}${a}`,{method:"DELETE"})}function q6(){return ii({queryKey:["oauth-connections"],queryFn:()=>Nt("/auth/oauth/connections")})}function L6(){const i=Vs();return Sa({mutationFn:({provider:s,label:a})=>LR(s,a),onSuccess:()=>{i.invalidateQueries({queryKey:["oauth-connections"]})}})}function HR(){var ne;const{login:i,isAuthenticated:s}=Ki(),a=Qw(),o=Zi(),u=new URLSearchParams(o.search),d=u.get("token"),p=u.get("error"),m=((ne=o.state)==null?void 0:ne.from)??u.get("returnTo")??"/",g=B.useRef(!1);d&&!g.current&&(g.current=!0,i(d,void 0,{displayName:u.get("displayName"),username:u.get("username")}));const[x,_]=B.useState(""),[w,D]=B.useState(""),[z,q]=B.useState(p||""),[F,Z]=B.useState(!1),[ee,te]=B.useState(!!d),[we,De]=B.useState([]);if(B.useEffect(()=>{d||qR().then(De).catch(()=>{})},[]),B.useEffect(()=>{if(!ee)return;const oe=setTimeout(()=>a(m,{replace:!0}),1500);return()=>clearTimeout(oe)},[ee]),s&&!ee)return b.jsxDEV(Wr,{to:m,replace:!0},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:54,columnNumber:12},this);const U=async oe=>{var W,Q;if(oe.preventDefault(),q(""),!x.trim()||!w){q("Username and password are required");return}Z(!0);try{const H=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:x.trim(),password:w})}),le=await H.json();if(!H.ok){q(le.error||"Login failed");return}te(!0),i(le.token,{username:x.trim(),password:w},{displayName:(W=le.user)==null?void 0:W.display_name,username:(Q=le.user)==null?void 0:Q.external_id})}catch{q("Unable to connect to server")}finally{Z(!1)}};return b.jsxDEV("div",{className:"min-h-screen bg-surface flex items-center justify-center overflow-hidden",children:b.jsxDEV("div",{className:"w-full max-w-md p-10",children:[b.jsxDEV("div",{className:`mb-10 transition-all duration-[1500ms] ease-in ${ee?"translate-x-[120vw] -translate-y-[60vh] scale-[3] opacity-0":""}`,children:b.jsxDEV(oy,{size:"lg",hideLabel:ee},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:101,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:94,columnNumber:9},this),b.jsxDEV("form",{onSubmit:U,className:`space-y-5 transition-opacity duration-300 ${ee?"opacity-0":""}`,children:[b.jsxDEV("div",{children:[b.jsxDEV("label",{htmlFor:"username",className:"block text-sm font-medium text-text-secondary mb-2",children:"Username"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:109,columnNumber:13},this),b.jsxDEV("input",{id:"username",type:"text",value:x,onChange:oe=>_(oe.target.value),className:"input",placeholder:"Enter your username",autoFocus:!ee,autoComplete:"username"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:115,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:108,columnNumber:11},this),b.jsxDEV("div",{children:[b.jsxDEV("label",{htmlFor:"password",className:"block text-sm font-medium text-text-secondary mb-2",children:"Password"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:128,columnNumber:13},this),b.jsxDEV("input",{id:"password",type:"password",value:w,onChange:oe=>D(oe.target.value),className:"input",placeholder:"Enter your password",autoComplete:"current-password"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:134,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:127,columnNumber:11},this),z&&b.jsxDEV("p",{className:"text-sm text-status-error",children:z},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:145,columnNumber:21},this),b.jsxDEV("button",{type:"submit",className:"btn-primary w-full",disabled:F||ee,children:F?"Signing in...":"Sign In"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:147,columnNumber:11},this),we.length>0&&b.jsxDEV(b.Fragment,{children:[b.jsxDEV("div",{className:"flex items-center gap-3 mt-6",children:[b.jsxDEV("div",{className:"flex-1 h-px bg-border"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:154,columnNumber:17},this),b.jsxDEV("span",{className:"text-xs text-text-tertiary",children:"or continue with"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:155,columnNumber:17},this),b.jsxDEV("div",{className:"flex-1 h-px bg-border"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:156,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:153,columnNumber:15},this),b.jsxDEV("div",{className:"space-y-2",children:we.filter(oe=>oe.provider!=="anthropic").map(oe=>b.jsxDEV("a",{href:`/api/auth/oauth/${oe.provider}?returnTo=${encodeURIComponent(m)}`,className:"btn-secondary w-full flex items-center justify-center gap-2",children:[b.jsxDEV(QE,{provider:oe.provider},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:165,columnNumber:21},this),"Sign in with ",oe.name]},oe.provider,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:160,columnNumber:19},this))},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:158,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:152,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:104,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:93,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:92,columnNumber:5},this)}function Pw(){const{isAuthenticated:i}=Ki(),s=Qw(),a=Zi(),o=new URLSearchParams(a.search),u=o.get("state")||"";B.useEffect(()=>{i||s(`/login?returnTo=${encodeURIComponent(a.pathname+a.search)}`)},[i]);const[d,p]=B.useState(""),[m,g]=B.useState(o.get("label")||"default"),[x,_]=B.useState(""),[w,D]=B.useState(!1),z=d.trim().startsWith("sk-ant-oat"),q=d.trim().startsWith("sk-ant-api"),F=Z=>{Z.preventDefault();const ee=d.trim();if(!ee){_("A token or API key is required");return}if(!ee.startsWith("sk-ant-")){_('Invalid format. Must start with "sk-ant-oat" (OAuth token) or "sk-ant-api" (API key)');return}D(!0),_("");const te=`/api/auth/oauth/anthropic/callback?code=${encodeURIComponent(ee)}&state=${encodeURIComponent(u)}`;window.location.href=te};return b.jsxDEV("div",{className:"min-h-screen bg-surface flex items-center justify-center",children:b.jsxDEV("div",{className:"w-full max-w-md p-10",children:[b.jsxDEV("div",{className:"mb-10",children:b.jsxDEV(oy,{size:"lg"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:67,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:66,columnNumber:9},this),b.jsxDEV("div",{className:"flex items-center gap-2 mb-6",children:[b.jsxDEV(QE,{provider:"anthropic",className:"w-6 h-6"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:71,columnNumber:11},this),b.jsxDEV("h2",{className:"text-lg font-semibold text-text-primary",children:"Connect Anthropic"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:72,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:70,columnNumber:9},this),b.jsxDEV("p",{className:"text-sm text-text-secondary mb-4",children:"Connect your Anthropic account so Claude Code tasks run under your credentials. Your token is encrypted at rest."},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:77,columnNumber:9},this),b.jsxDEV("form",{onSubmit:F,className:"space-y-5",children:[b.jsxDEV("div",{children:[b.jsxDEV("label",{htmlFor:"token",className:"block text-sm font-medium text-text-secondary mb-2",children:"OAuth Token or API Key"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:84,columnNumber:13},this),b.jsxDEV("input",{id:"token",type:"password",value:d,onChange:Z=>p(Z.target.value),className:"input",placeholder:"sk-ant-oat01-... or sk-ant-api03-...",autoFocus:!0,autoComplete:"off"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:90,columnNumber:13},this),z&&b.jsxDEV("p",{className:"text-xs text-status-success mt-1",children:"OAuth token detected — uses your Claude subscription (flat rate)"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:101,columnNumber:15},this),q&&b.jsxDEV("p",{className:"text-xs text-status-warning mt-1",children:"API key detected — billed per-token from your Anthropic API account"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:106,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:83,columnNumber:11},this),b.jsxDEV("div",{children:[b.jsxDEV("label",{htmlFor:"label",className:"block text-sm font-medium text-text-secondary mb-2",children:"Label"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:113,columnNumber:13},this),b.jsxDEV("input",{id:"label",type:"text",value:m,onChange:Z=>g(Z.target.value.replace(/\s+/g,"-").toLowerCase()),className:"input",placeholder:"default",autoComplete:"off"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:119,columnNumber:13},this),b.jsxDEV("p",{className:"text-xs text-text-tertiary mt-1",children:'A name for this credential. Use different labels to store multiple credentials (e.g., "subscription", "api-batch").'},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:128,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:112,columnNumber:11},this),x&&b.jsxDEV("p",{className:"text-sm text-status-error",children:x},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:134,columnNumber:21},this),b.jsxDEV("button",{type:"submit",className:"btn-primary w-full",disabled:w,children:w?"Validating...":"Connect"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:136,columnNumber:11},this),b.jsxDEV("a",{href:"/",className:"block text-center text-sm text-text-tertiary hover:text-text-secondary",children:"Cancel"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:144,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:82,columnNumber:9},this),b.jsxDEV("div",{className:"mt-6 space-y-3 text-xs text-text-tertiary",children:[b.jsxDEV("div",{children:[b.jsxDEV("span",{className:"font-medium text-text-secondary",children:"Recommended:"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:154,columnNumber:13},this)," ","Run"," ",b.jsxDEV("code",{className:"px-1 py-0.5 bg-surface-sunken rounded text-[11px]",children:"claude setup-token"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:156,columnNumber:13},this)," ","in your terminal to generate an OAuth token that uses your subscription."]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:153,columnNumber:11},this),b.jsxDEV("div",{children:[b.jsxDEV("span",{className:"font-medium text-text-secondary",children:"Alternative:"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:160,columnNumber:13},this)," ","Use an API key from"," ",b.jsxDEV("a",{href:"https://console.anthropic.com/settings/keys",target:"_blank",rel:"noopener noreferrer",className:"text-accent-secondary hover:underline",children:"console.anthropic.com"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:162,columnNumber:13},this)," ","(billed per-token)."]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:159,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:152,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:65,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:64,columnNumber:5},this)}function x0({roleTypes:i,roleNames:s,redirectTo:a="/"}){const{isSuperAdmin:o,hasRole:u,hasRoleType:d}=Ki();return o?b.jsxDEV(Xd,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/RequireRole.tsx",lineNumber:18,columnNumber:28},this):i&&i.some(p=>d(p))?b.jsxDEV(Xd,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/RequireRole.tsx",lineNumber:21,columnNumber:66},this):s&&s.some(p=>u(p))?b.jsxDEV(Xd,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/RequireRole.tsx",lineNumber:24,columnNumber:62},this):b.jsxDEV(Wr,{to:a,replace:!0},void 0,!1,{fileName:"/app/dashboard/src/components/layout/RequireRole.tsx",lineNumber:26,columnNumber:10},this)}const $w=B.lazy(()=>rt(()=>import("./ProcessesListPage-C-uHadO6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])).then(i=>({default:i.ProcessesListPage}))),PR=B.lazy(()=>rt(()=>import("./ProcessDetailPage-B7z7IdqE.js"),__vite__mapDeps([16,2,1,4,17,18,19,15,14,9,6,20,21,22])).then(i=>({default:i.ProcessDetailPage}))),$R=B.lazy(()=>rt(()=>import("./McpOverview-CSpEJxKa.js"),__vite__mapDeps([23,2,24,25,26,27,12,28,14,6])).then(i=>({default:i.McpOverview}))),IR=B.lazy(()=>rt(()=>import("./McpRunsPage-wWLqHsd4.js"),__vite__mapDeps([29,2,25,26,27,5,6,7,8,15,14,9,30,12,11,10,13,31])).then(i=>({default:i.McpRunsPage}))),YR=B.lazy(()=>rt(()=>import("./McpRunDetailPage-9xdxgG4d.js"),__vite__mapDeps([32,2,25,17,19,12,33,6,34,35,11,36,13,14])).then(i=>({default:i.McpRunDetailPage}))),FR=B.lazy(()=>rt(()=>import("./McpQueryPage-CIiVMlqo.js"),__vite__mapDeps([37,12,7,8,11,2,10,13,14,9,30,15,31,5,6,4,38])).then(i=>({default:i.McpQueryPage}))),JR=B.lazy(()=>rt(()=>import("./McpQueryDetailPage-DhqEI180.js"),__vite__mapDeps([39,2,12,19,38,26,4,14,40,6,3,1,41,42,43,33,44,36,34,25,45])).then(i=>({default:i.McpQueryDetailPage}))),GR=B.lazy(()=>rt(()=>import("./EscalationsOverview-BcJ2E3X7.js"),__vite__mapDeps([46,2,4,12,28,6,14])).then(i=>({default:i.EscalationsOverview}))),QR=B.lazy(()=>rt(()=>import("./AvailableEscalationsPage-DcH592mc.js"),__vite__mapDeps([47,2,4,48,5,6,7,8,10,49,12,50,51,17,22,52,11,53,20,14,15,9,54,31,13])).then(i=>({default:i.AvailableEscalationsPage}))),XR=B.lazy(()=>rt(()=>import("./OperatorDashboard-jc0vrgDI.js"),__vite__mapDeps([55,4,2,48,5,6,7,8,12,10,31,52,11,53,20,14,15,9,54,13])).then(i=>({default:i.OperatorDashboard}))),ZR=B.lazy(()=>rt(()=>import("./index-Bn2xHDr8.js"),__vite__mapDeps([56,2,48,12,34,54,3,17,4,6,21,22,51,50,19,20,14,33])).then(i=>({default:i.EscalationDetailPage}))),KR=B.lazy(()=>rt(()=>import("./WorkflowsOverview-Doe5L-Re.js"),__vite__mapDeps([57,2,3,4,12,28,6,14])).then(i=>({default:i.WorkflowsOverview}))),WR=B.lazy(()=>rt(()=>import("./index-FuohTtaM.js"),__vite__mapDeps([58,2,3,12,14,42,43,6,7,8,59,44,19])).then(i=>({default:i.StartWorkflowPage}))),e6=B.lazy(()=>rt(()=>import("./index-FuohTtaM.js"),__vite__mapDeps([58,2,3,12,14,42,43,6,7,8,59,44,19])).then(i=>({default:i.DurableInvokePage}))),t6=B.lazy(()=>rt(()=>import("./WorkflowsDashboard-BgxslssH.js"),__vite__mapDeps([60,2,9,30,3,4,5,6,7,8,15,14,12,11,10,13,31])).then(i=>({default:()=>i.WorkflowsDashboard({tier:"durable"})}))),n6=B.lazy(()=>rt(()=>import("./WorkflowsDashboard-BgxslssH.js"),__vite__mapDeps([60,2,9,30,3,4,5,6,7,8,15,14,12,11,10,13,31])).then(i=>({default:()=>i.WorkflowsDashboard({tier:"all"})}))),s6=B.lazy(()=>rt(()=>import("./YamlWorkflowsPage-BliAckJ6.js"),__vite__mapDeps([61,2,26,5,6,62,19,12,11,8,45,41,42,43,14,59,44])).then(i=>({default:i.YamlWorkflowsPage}))),a6=B.lazy(()=>rt(()=>import("./TasksListPage-CtRkMpKU.js"),__vite__mapDeps([63,1,2,3,5,6,7,8,19,53,44,10,11,12,15,14])).then(i=>({default:i.TasksListPage}))),r6=B.lazy(()=>rt(()=>import("./TaskDetailPage-CdWo-6mu.js"),__vite__mapDeps([64,1,2,19,53,12,6,14])).then(i=>({default:i.TaskDetailPage}))),Iw=B.lazy(()=>rt(()=>import("./WorkflowExecutionPage-25iusMml.js"),__vite__mapDeps([65,2,3,4,35,11,36,19,6,1,12,34,13,14])).then(i=>({default:i.WorkflowExecutionPage}))),i6=B.lazy(()=>rt(()=>import("./AdminDashboard-BXkKGkb5.js"),__vite__mapDeps([66,1,2,4,24,18,6,14])).then(i=>({default:i.AdminDashboard}))),o6=B.lazy(()=>rt(()=>import("./index-BpT-6WgJ.js"),__vite__mapDeps([67,2,3,7,8,11,31,5,6,12,68,14,15])).then(i=>({default:i.WorkersPage}))),l6=B.lazy(()=>rt(()=>import("./index-DOkHXmyf.js"),__vite__mapDeps([69,2,3,7,8,70,49,6,11,31,5,12,20,14,68,15,71,48,42,43])).then(i=>({default:i.WorkflowConfigsPage}))),Yw=B.lazy(()=>rt(()=>import("./index-DOkHXmyf.js"),__vite__mapDeps([69,2,3,7,8,70,49,6,11,31,5,12,20,14,68,15,71,48,42,43])).then(i=>({default:i.WorkflowConfigDetailPage}))),c6=B.lazy(()=>rt(()=>import("./index-Dk2Q51o0.js"),__vite__mapDeps([72,2,24,8,70,49,6,12,11,10,5,62,41,42,43,14,31,19])).then(i=>({default:i.McpServersPage}))),Fw=B.lazy(()=>rt(()=>import("./index-CZrJ09p-.js"),__vite__mapDeps([73,2,24,71,12,40,14,6])).then(i=>({default:i.McpServerDetailPage}))),u6=B.lazy(()=>rt(()=>import("./index-D7zYZOnH.js"),__vite__mapDeps([74,2,22,5,6,7,8,10,11,9,70,49,31,12,20,14,43,48,44])).then(i=>({default:i.UsersPage}))),f6=B.lazy(()=>rt(()=>import("./RolesPage-BSxrD1vm.js"),__vite__mapDeps([75,2,48,7,8,70,49,6,12,20,14,31])).then(i=>({default:i.RolesPage}))),d6=B.lazy(()=>rt(()=>import("./index-BEtLIsML.js"),__vite__mapDeps([76,2,12,49,6,50,14])).then(i=>({default:i.MaintenancePage}))),h6=B.lazy(()=>rt(()=>import("./index-D3NyVADW.js"),__vite__mapDeps([77,2,18,7,8,34,11,5,6,31,14,49,68])).then(i=>({default:i.ControlPlanePage}))),m6=B.lazy(()=>rt(()=>import("./CredentialsPage-ClWkmLPu.js"),__vite__mapDeps([78,2,12,44,70,49,6,14])).then(i=>({default:i.CredentialsPage})));function p6(){return b.jsxDEV("div",{className:"animate-pulse space-y-4",children:[b.jsxDEV("div",{className:"h-8 bg-surface-sunken rounded w-48"},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:129,columnNumber:7},this),b.jsxDEV("div",{className:"h-40 bg-surface-sunken rounded"},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:130,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/App.tsx",lineNumber:128,columnNumber:5},this)}function Ze({children:i}){return b.jsxDEV(B.Suspense,{fallback:b.jsxDEV(p6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:137,columnNumber:25},this),children:b.jsxDEV("div",{className:"animate-page-enter",children:i},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:138,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:137,columnNumber:5},this)}const XE=new kC({defaultOptions:{queries:{staleTime:1e4,retry:(i,s)=>s instanceof Error&&s.message==="Session expired"?!1:i<1}}});window.addEventListener("auth:unauthorized",()=>{XE.clear(),sessionStorage.removeItem("lt_token"),sessionStorage.removeItem("lt_credentials"),sessionStorage.removeItem("lt_user_info"),window.location.pathname!=="/login"&&(window.location.href=`/login?returnTo=${encodeURIComponent(window.location.pathname)}`)});const b6=zC([{path:"/login",element:b.jsxDEV(HR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:174,columnNumber:30},void 0)},{path:"/connect/anthropic",element:b.jsxDEV(Pw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:175,columnNumber:42},void 0)},{path:"/connect/:provider",element:b.jsxDEV(Pw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:176,columnNumber:42},void 0)},{path:"/",element:b.jsxDEV(BR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:179,columnNumber:14},void 0),children:[{index:!0,element:b.jsxDEV(Ze,{children:b.jsxDEV($w,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:182,columnNumber:37},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:182,columnNumber:31},void 0)},{path:"processes/all",element:b.jsxDEV(Ze,{children:b.jsxDEV($w,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:185,columnNumber:47},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:185,columnNumber:41},void 0)},{path:"processes/detail/:originId",element:b.jsxDEV(Ze,{children:b.jsxDEV(PR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:186,columnNumber:60},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:186,columnNumber:54},void 0)},{path:"credentials",element:b.jsxDEV(Ze,{children:b.jsxDEV(m6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:189,columnNumber:45},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:189,columnNumber:39},void 0)},{path:"connections",element:b.jsxDEV(Wr,{to:"/credentials",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:190,columnNumber:39},void 0)},{path:"escalations",element:b.jsxDEV(Ze,{children:b.jsxDEV(GR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:193,columnNumber:45},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:193,columnNumber:39},void 0)},{path:"escalations/available",element:b.jsxDEV(Ze,{children:b.jsxDEV(QR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:194,columnNumber:55},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:194,columnNumber:49},void 0)},{path:"escalations/queue",element:b.jsxDEV(Ze,{children:b.jsxDEV(XR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:195,columnNumber:51},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:195,columnNumber:45},void 0)},{path:"escalations/detail/:id",element:b.jsxDEV(Ze,{children:b.jsxDEV(ZR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:196,columnNumber:56},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:196,columnNumber:50},void 0)},{element:b.jsxDEV(x0,{roleTypes:["admin","superadmin"],roleNames:["engineer"]},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:200,columnNumber:18},void 0),children:[{path:"workflows",element:b.jsxDEV(Ze,{children:b.jsxDEV(KR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:202,columnNumber:47},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:202,columnNumber:41},void 0)},{path:"workflows/executions",element:b.jsxDEV(Ze,{children:b.jsxDEV(n6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:203,columnNumber:58},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:203,columnNumber:52},void 0)},{path:"workflows/durable/executions",element:b.jsxDEV(Ze,{children:b.jsxDEV(t6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:204,columnNumber:66},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:204,columnNumber:60},void 0)},{path:"workflows/durable/executions/:workflowId",element:b.jsxDEV(Ze,{children:b.jsxDEV(Iw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:205,columnNumber:78},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:205,columnNumber:72},void 0)},{path:"workflows/tasks",element:b.jsxDEV(Ze,{children:b.jsxDEV(a6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:206,columnNumber:53},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:206,columnNumber:47},void 0)},{path:"workflows/tasks/detail/:id",element:b.jsxDEV(Ze,{children:b.jsxDEV(r6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:207,columnNumber:64},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:207,columnNumber:58},void 0)},{path:"workflows/executions/:workflowId",element:b.jsxDEV(Ze,{children:b.jsxDEV(Iw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:208,columnNumber:70},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:208,columnNumber:64},void 0)},{path:"workflows/start",element:b.jsxDEV(Ze,{children:b.jsxDEV(WR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:209,columnNumber:53},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:209,columnNumber:47},void 0)},{path:"workflows/durable/invoke",element:b.jsxDEV(Ze,{children:b.jsxDEV(e6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:210,columnNumber:62},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:210,columnNumber:56},void 0)},{path:"workflows/cron",element:b.jsxDEV(Wr,{to:"/workflows/start?mode=schedule",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:211,columnNumber:46},void 0)},{path:"workflows/workers",element:b.jsxDEV(Ze,{children:b.jsxDEV(o6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:212,columnNumber:55},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:212,columnNumber:49},void 0)},{path:"workflows/registry",element:b.jsxDEV(Ze,{children:b.jsxDEV(l6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:213,columnNumber:56},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:213,columnNumber:50},void 0)},{path:"workflows/registry/new",element:b.jsxDEV(Ze,{children:b.jsxDEV(Yw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:214,columnNumber:60},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:214,columnNumber:54},void 0)},{path:"workflows/registry/:workflowType",element:b.jsxDEV(Ze,{children:b.jsxDEV(Yw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:215,columnNumber:70},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:215,columnNumber:64},void 0)}]},{element:b.jsxDEV(x0,{roleTypes:["admin","superadmin"],roleNames:["engineer"]},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:221,columnNumber:18},void 0),children:[{path:"mcp",element:b.jsxDEV(Ze,{children:b.jsxDEV($R,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:223,columnNumber:41},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:223,columnNumber:35},void 0)},{path:"mcp/queries",element:b.jsxDEV(Ze,{children:b.jsxDEV(FR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:224,columnNumber:49},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:224,columnNumber:43},void 0)},{path:"mcp/queries/:workflowId",element:b.jsxDEV(Ze,{children:b.jsxDEV(JR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:225,columnNumber:61},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:225,columnNumber:55},void 0)},{path:"mcp/tools",element:b.jsxDEV(Wr,{to:"/mcp/servers",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:226,columnNumber:41},void 0)},{path:"mcp/servers",element:b.jsxDEV(Ze,{children:b.jsxDEV(c6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:227,columnNumber:49},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:227,columnNumber:43},void 0)},{path:"mcp/servers/new",element:b.jsxDEV(Ze,{children:b.jsxDEV(Fw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:228,columnNumber:53},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:228,columnNumber:47},void 0)},{path:"mcp/servers/:serverId",element:b.jsxDEV(Ze,{children:b.jsxDEV(Fw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:229,columnNumber:59},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:229,columnNumber:53},void 0)},{path:"mcp/workflows",element:b.jsxDEV(Ze,{children:b.jsxDEV(s6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:230,columnNumber:51},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:230,columnNumber:45},void 0)},{path:"mcp/executions",element:b.jsxDEV(Ze,{children:b.jsxDEV(IR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:231,columnNumber:52},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:231,columnNumber:46},void 0)},{path:"mcp/executions/:jobId",element:b.jsxDEV(Ze,{children:b.jsxDEV(YR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:232,columnNumber:59},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:232,columnNumber:53},void 0)}]},{element:b.jsxDEV(x0,{roleTypes:["admin","superadmin"]},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:238,columnNumber:18},void 0),children:[{path:"admin",element:b.jsxDEV(Ze,{children:b.jsxDEV(i6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:240,columnNumber:43},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:240,columnNumber:37},void 0)},{path:"admin/users",element:b.jsxDEV(Ze,{children:b.jsxDEV(u6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:241,columnNumber:49},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:241,columnNumber:43},void 0)},{path:"admin/bots",element:b.jsxDEV(Wr,{to:"/admin/users?tab=service-accounts",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:242,columnNumber:42},void 0)},{path:"admin/escalation-chains",element:b.jsxDEV(Wr,{to:"/admin/roles",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:243,columnNumber:55},void 0)},{path:"admin/roles",element:b.jsxDEV(Ze,{children:b.jsxDEV(f6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:244,columnNumber:49},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:244,columnNumber:43},void 0)},{path:"admin/maintenance",element:b.jsxDEV(Ze,{children:b.jsxDEV(d6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:245,columnNumber:55},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:245,columnNumber:49},void 0)},{path:"admin/controlplane",element:b.jsxDEV(Ze,{children:b.jsxDEV(h6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:246,columnNumber:56},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:246,columnNumber:50},void 0)}]}]}]);function y6(){return b.jsxDEV(VC,{client:XE,children:b.jsxDEV(_5,{children:b.jsxDEV(yT,{children:b.jsxDEV(BC,{router:b6},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:258,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:257,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:256,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:255,columnNumber:5},this)}hT.createRoot(document.getElementById("root")).render(b.jsxDEV(B.StrictMode,{children:b.jsxDEV(y6,{},void 0,!1,{fileName:"/app/dashboard/src/main.tsx",lineNumber:8,columnNumber:5},void 0)},void 0,!1,{fileName:"/app/dashboard/src/main.tsx",lineNumber:7,columnNumber:3},void 0));export{q6 as A,L6 as B,ly as C,RR as D,zE as F,W5 as J,xO as N,QE as O,H5 as S,B6 as a,Nt as b,OR as c,A6 as d,C6 as e,DR as f,O6 as g,E6 as h,Ki as i,b as j,j6 as k,M6 as l,k6 as m,V6 as n,U6 as o,_6 as p,D5 as q,T6 as r,D6 as s,R6 as t,NE as u,JE as v,GE as w,z6 as x,fy as y,S6 as z};
281
- //# sourceMappingURL=index-DYyLF-Qb.js.map
280
+ ... (truncated)`});const oe=`${h4(u.concat(we))}${ee}`;try{const H=(await Nt("/insight/mcp-query",{method:"POST",body:JSON.stringify({prompt:oe,tags:U.suggestedTags,context:U,wait:!1,direct:!0})})).workflow_id;m(H),d(le=>le.map(ie=>ie.id===De.id?{...ie,workflowId:H}:ie)),_.current&&clearInterval(_.current),_.current=setInterval(async()=>{var le;try{const ie=await Nt(`/workflows/${H}/result`),ve=(le=ie==null?void 0:ie.result)==null?void 0:le.data;if(ve){_.current&&clearInterval(_.current),_.current=null,m(null);const Ge=m4(ve);let tt;try{tt=(await Nt(`/workflow-states/${H}/execution`)).duration_ms}catch{}d(ae=>ae.map(pe=>pe.id===De.id?{...pe,content:Ge,timestamp:new Date().toISOString(),pending:!1,durationMs:tt}:pe))}}catch{}},3e3)}catch{d(Q=>Q.map(H=>H.id===De.id?{...H,content:"Failed to submit query. Please try again.",pending:!1}:H))}},[u,w]),Z=B.useCallback(async ee=>{const te=u.find(U=>U.id===ee);if(!(te!=null&&te.workflowId)||te.compilationStatus==="compiling"||te.compilationStatus==="done")return;const we=u.indexOf(te),De=u.slice(0,we).reverse().find(U=>U.role==="user");if(De){d(U=>U.map(ne=>ne.id===ee?{...ne,compilationStatus:"compiling"}:ne));try{const U=await Nt("/insight/mcp-query/describe",{method:"POST",body:JSON.stringify({prompt:De.content,summary:te.content})}),ne=await Nt("/yaml-workflows",{method:"POST",body:JSON.stringify({workflow_id:te.workflowId,task_queue:"long-tail-system",workflow_name:"mcpQuery",name:U.tool_name,description:U.description,tags:U.tags,app_id:"longtail"})});await Nt(`/yaml-workflows/${ne.id}/deploy`,{method:"POST"}),d(oe=>oe.map(W=>W.id===ee?{...W,compilationStatus:"done"}:W))}catch(U){const ne=U instanceof Error?U.message:"Compilation failed";d(oe=>oe.map(W=>W.id===ee?{...W,compilationStatus:"error",compilationError:ne}:W))}}},[u]);return b.jsxDEV(qE.Provider,{value:{helpOpen:a,setHelpOpen:o,toggleHelp:D,messages:u,sendMessage:F,pageContext:w,setPageContext:z,activeWorkflowId:p,clearMessages:q,compileMessage:Z},children:i},void 0,!1,{fileName:"/app/dashboard/src/hooks/useHelpAssistant.tsx",lineNumber:302,columnNumber:5},this)}function LE(){const i=B.useContext(qE);if(!i)throw new Error("useHelpAssistant must be used within HelpAssistantProvider");return i}function b4(){const{helpOpen:i,toggleHelp:s}=LE();return b.jsxDEV("button",{onClick:s,className:"fixed right-3 z-[45] flex items-center justify-center w-10 h-10 rounded-full bg-surface-raised shadow-lg hover:scale-110 transition-transform duration-150 border border-accent/30",style:{bottom:"calc(var(--feed-height, 32px) + 12px)"},"aria-label":i?"Close help":"Ask for help",children:i?b.jsxDEV(F0,{className:"w-5 h-5 text-text-tertiary",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpButton.tsx",lineNumber:15,columnNumber:9},this):b.jsxDEV("img",{src:"/logo512.png",alt:"Help",className:"w-8 h-8 -rotate-[120deg]"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpButton.tsx",lineNumber:17,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpButton.tsx",lineNumber:8,columnNumber:5},this)}const HE=6048e5,y4=864e5,Ow=6e4,Rw=525600,jw=43200,Mw=1440,kw=Symbol.for("constructDateFrom");function ar(i,s){return typeof i=="function"?i(s):i&&typeof i=="object"&&kw in i?i[kw](s):i instanceof Date?new i.constructor(s):new Date(s)}function ts(i,s){return ar(s||i,i)}let g4={};function wu(){return g4}function xu(i,s){var m,g,x,_;const a=wu(),o=(s==null?void 0:s.weekStartsOn)??((g=(m=s==null?void 0:s.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??a.weekStartsOn??((_=(x=a.locale)==null?void 0:x.options)==null?void 0:_.weekStartsOn)??0,u=ts(i,s==null?void 0:s.in),d=u.getDay(),p=(d<o?7:0)+d-o;return u.setDate(u.getDate()-p),u.setHours(0,0,0,0),u}function hh(i,s){return xu(i,{...s,weekStartsOn:1})}function PE(i,s){const a=ts(i,s==null?void 0:s.in),o=a.getFullYear(),u=ar(a,0);u.setFullYear(o+1,0,4),u.setHours(0,0,0,0);const d=hh(u),p=ar(a,0);p.setFullYear(o,0,4),p.setHours(0,0,0,0);const m=hh(p);return a.getTime()>=d.getTime()?o+1:a.getTime()>=m.getTime()?o:o-1}function mh(i){const s=ts(i),a=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return a.setUTCFullYear(s.getFullYear()),+i-+a}function $E(i,...s){const a=ar.bind(null,i||s.find(o=>typeof o=="object"));return s.map(a)}function Vw(i,s){const a=ts(i,s==null?void 0:s.in);return a.setHours(0,0,0,0),a}function v4(i,s,a){const[o,u]=$E(a==null?void 0:a.in,i,s),d=Vw(o),p=Vw(u),m=+d-mh(d),g=+p-mh(p);return Math.round((m-g)/y4)}function x4(i,s){const a=PE(i,s),o=ar(i,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),hh(o)}function N4(i,s){const a=+ts(i)-+ts(s);return a<0?-1:a>0?1:a}function S4(i){return ar(i,Date.now())}function w4(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function E4(i){return!(!w4(i)&&typeof i!="number"||isNaN(+ts(i)))}function _4(i){return s=>{const o=(i?Math[i]:Math.trunc)(s);return o===0?0:o}}function A4(i,s){const a=ts(i,s==null?void 0:s.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}const D4={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},C4=(i,s,a)=>{let o;const u=D4[i];return typeof u=="string"?o=u:s===1?o=u.one:o=u.other.replace("{{count}}",s.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o};function v0(i){return(s={})=>{const a=s.width?String(s.width):i.defaultWidth;return i.formats[a]||i.formats[i.defaultWidth]}}const T4={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},O4={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},R4={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},j4={date:v0({formats:T4,defaultWidth:"full"}),time:v0({formats:O4,defaultWidth:"full"}),dateTime:v0({formats:R4,defaultWidth:"full"})},M4={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},k4=(i,s,a,o)=>M4[i];function ru(i){return(s,a)=>{const o=a!=null&&a.context?String(a.context):"standalone";let u;if(o==="formatting"&&i.formattingValues){const p=i.defaultFormattingWidth||i.defaultWidth,m=a!=null&&a.width?String(a.width):p;u=i.formattingValues[m]||i.formattingValues[p]}else{const p=i.defaultWidth,m=a!=null&&a.width?String(a.width):i.defaultWidth;u=i.values[m]||i.values[p]}const d=i.argumentCallback?i.argumentCallback(s):s;return u[d]}}const V4={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},U4={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},z4={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},B4={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},q4={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},L4={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},H4=(i,s)=>{const a=Number(i),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},P4={ordinalNumber:H4,era:ru({values:V4,defaultWidth:"wide"}),quarter:ru({values:U4,defaultWidth:"wide",argumentCallback:i=>i-1}),month:ru({values:z4,defaultWidth:"wide"}),day:ru({values:B4,defaultWidth:"wide"}),dayPeriod:ru({values:q4,defaultWidth:"wide",formattingValues:L4,defaultFormattingWidth:"wide"})};function iu(i){return(s,a={})=>{const o=a.width,u=o&&i.matchPatterns[o]||i.matchPatterns[i.defaultMatchWidth],d=s.match(u);if(!d)return null;const p=d[0],m=o&&i.parsePatterns[o]||i.parsePatterns[i.defaultParseWidth],g=Array.isArray(m)?I4(m,w=>w.test(p)):$4(m,w=>w.test(p));let x;x=i.valueCallback?i.valueCallback(g):g,x=a.valueCallback?a.valueCallback(x):x;const _=s.slice(p.length);return{value:x,rest:_}}}function $4(i,s){for(const a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&s(i[a]))return a}function I4(i,s){for(let a=0;a<i.length;a++)if(s(i[a]))return a}function Y4(i){return(s,a={})=>{const o=s.match(i.matchPattern);if(!o)return null;const u=o[0],d=s.match(i.parsePattern);if(!d)return null;let p=i.valueCallback?i.valueCallback(d[0]):d[0];p=a.valueCallback?a.valueCallback(p):p;const m=s.slice(u.length);return{value:p,rest:m}}}const F4=/^(\d+)(th|st|nd|rd)?/i,J4=/\d+/i,G4={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Q4={any:[/^b/i,/^(a|c)/i]},X4={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Z4={any:[/1/i,/2/i,/3/i,/4/i]},K4={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},W4={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},eR={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},tR={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},nR={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sR={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},aR={ordinalNumber:Y4({matchPattern:F4,parsePattern:J4,valueCallback:i=>parseInt(i,10)}),era:iu({matchPatterns:G4,defaultMatchWidth:"wide",parsePatterns:Q4,defaultParseWidth:"any"}),quarter:iu({matchPatterns:X4,defaultMatchWidth:"wide",parsePatterns:Z4,defaultParseWidth:"any",valueCallback:i=>i+1}),month:iu({matchPatterns:K4,defaultMatchWidth:"wide",parsePatterns:W4,defaultParseWidth:"any"}),day:iu({matchPatterns:eR,defaultMatchWidth:"wide",parsePatterns:tR,defaultParseWidth:"any"}),dayPeriod:iu({matchPatterns:nR,defaultMatchWidth:"any",parsePatterns:sR,defaultParseWidth:"any"})},IE={code:"en-US",formatDistance:C4,formatLong:j4,formatRelative:k4,localize:P4,match:aR,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rR(i,s){const a=ts(i,s==null?void 0:s.in);return v4(a,A4(a))+1}function iR(i,s){const a=ts(i,s==null?void 0:s.in),o=+hh(a)-+x4(a);return Math.round(o/HE)+1}function YE(i,s){var _,w,D,z;const a=ts(i,s==null?void 0:s.in),o=a.getFullYear(),u=wu(),d=(s==null?void 0:s.firstWeekContainsDate)??((w=(_=s==null?void 0:s.locale)==null?void 0:_.options)==null?void 0:w.firstWeekContainsDate)??u.firstWeekContainsDate??((z=(D=u.locale)==null?void 0:D.options)==null?void 0:z.firstWeekContainsDate)??1,p=ar((s==null?void 0:s.in)||i,0);p.setFullYear(o+1,0,d),p.setHours(0,0,0,0);const m=xu(p,s),g=ar((s==null?void 0:s.in)||i,0);g.setFullYear(o,0,d),g.setHours(0,0,0,0);const x=xu(g,s);return+a>=+m?o+1:+a>=+x?o:o-1}function oR(i,s){var m,g,x,_;const a=wu(),o=(s==null?void 0:s.firstWeekContainsDate)??((g=(m=s==null?void 0:s.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((_=(x=a.locale)==null?void 0:x.options)==null?void 0:_.firstWeekContainsDate)??1,u=YE(i,s),d=ar((s==null?void 0:s.in)||i,0);return d.setFullYear(u,0,o),d.setHours(0,0,0,0),xu(d,s)}function lR(i,s){const a=ts(i,s==null?void 0:s.in),o=+xu(a,s)-+oR(a,s);return Math.round(o/HE)+1}function ct(i,s){const a=i<0?"-":"",o=Math.abs(i).toString().padStart(s,"0");return a+o}const Zr={y(i,s){const a=i.getFullYear(),o=a>0?a:1-a;return ct(s==="yy"?o%100:o,s.length)},M(i,s){const a=i.getMonth();return s==="M"?String(a+1):ct(a+1,2)},d(i,s){return ct(i.getDate(),s.length)},a(i,s){const a=i.getHours()/12>=1?"pm":"am";switch(s){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h(i,s){return ct(i.getHours()%12||12,s.length)},H(i,s){return ct(i.getHours(),s.length)},m(i,s){return ct(i.getMinutes(),s.length)},s(i,s){return ct(i.getSeconds(),s.length)},S(i,s){const a=s.length,o=i.getMilliseconds(),u=Math.trunc(o*Math.pow(10,a-3));return ct(u,s.length)}},ll={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Uw={G:function(i,s,a){const o=i.getFullYear()>0?1:0;switch(s){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},y:function(i,s,a){if(s==="yo"){const o=i.getFullYear(),u=o>0?o:1-o;return a.ordinalNumber(u,{unit:"year"})}return Zr.y(i,s)},Y:function(i,s,a,o){const u=YE(i,o),d=u>0?u:1-u;if(s==="YY"){const p=d%100;return ct(p,2)}return s==="Yo"?a.ordinalNumber(d,{unit:"year"}):ct(d,s.length)},R:function(i,s){const a=PE(i);return ct(a,s.length)},u:function(i,s){const a=i.getFullYear();return ct(a,s.length)},Q:function(i,s,a){const o=Math.ceil((i.getMonth()+1)/3);switch(s){case"Q":return String(o);case"QQ":return ct(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},q:function(i,s,a){const o=Math.ceil((i.getMonth()+1)/3);switch(s){case"q":return String(o);case"qq":return ct(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},M:function(i,s,a){const o=i.getMonth();switch(s){case"M":case"MM":return Zr.M(i,s);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},L:function(i,s,a){const o=i.getMonth();switch(s){case"L":return String(o+1);case"LL":return ct(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},w:function(i,s,a,o){const u=lR(i,o);return s==="wo"?a.ordinalNumber(u,{unit:"week"}):ct(u,s.length)},I:function(i,s,a){const o=iR(i);return s==="Io"?a.ordinalNumber(o,{unit:"week"}):ct(o,s.length)},d:function(i,s,a){return s==="do"?a.ordinalNumber(i.getDate(),{unit:"date"}):Zr.d(i,s)},D:function(i,s,a){const o=rR(i);return s==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):ct(o,s.length)},E:function(i,s,a){const o=i.getDay();switch(s){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},e:function(i,s,a,o){const u=i.getDay(),d=(u-o.weekStartsOn+8)%7||7;switch(s){case"e":return String(d);case"ee":return ct(d,2);case"eo":return a.ordinalNumber(d,{unit:"day"});case"eee":return a.day(u,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(u,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(u,{width:"short",context:"formatting"});case"eeee":default:return a.day(u,{width:"wide",context:"formatting"})}},c:function(i,s,a,o){const u=i.getDay(),d=(u-o.weekStartsOn+8)%7||7;switch(s){case"c":return String(d);case"cc":return ct(d,s.length);case"co":return a.ordinalNumber(d,{unit:"day"});case"ccc":return a.day(u,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(u,{width:"narrow",context:"standalone"});case"cccccc":return a.day(u,{width:"short",context:"standalone"});case"cccc":default:return a.day(u,{width:"wide",context:"standalone"})}},i:function(i,s,a){const o=i.getDay(),u=o===0?7:o;switch(s){case"i":return String(u);case"ii":return ct(u,s.length);case"io":return a.ordinalNumber(u,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},a:function(i,s,a){const u=i.getHours()/12>=1?"pm":"am";switch(s){case"a":case"aa":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(u,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(u,{width:"wide",context:"formatting"})}},b:function(i,s,a){const o=i.getHours();let u;switch(o===12?u=ll.noon:o===0?u=ll.midnight:u=o/12>=1?"pm":"am",s){case"b":case"bb":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(u,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(u,{width:"wide",context:"formatting"})}},B:function(i,s,a){const o=i.getHours();let u;switch(o>=17?u=ll.evening:o>=12?u=ll.afternoon:o>=4?u=ll.morning:u=ll.night,s){case"B":case"BB":case"BBB":return a.dayPeriod(u,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(u,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(u,{width:"wide",context:"formatting"})}},h:function(i,s,a){if(s==="ho"){let o=i.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return Zr.h(i,s)},H:function(i,s,a){return s==="Ho"?a.ordinalNumber(i.getHours(),{unit:"hour"}):Zr.H(i,s)},K:function(i,s,a){const o=i.getHours()%12;return s==="Ko"?a.ordinalNumber(o,{unit:"hour"}):ct(o,s.length)},k:function(i,s,a){let o=i.getHours();return o===0&&(o=24),s==="ko"?a.ordinalNumber(o,{unit:"hour"}):ct(o,s.length)},m:function(i,s,a){return s==="mo"?a.ordinalNumber(i.getMinutes(),{unit:"minute"}):Zr.m(i,s)},s:function(i,s,a){return s==="so"?a.ordinalNumber(i.getSeconds(),{unit:"second"}):Zr.s(i,s)},S:function(i,s){return Zr.S(i,s)},X:function(i,s,a){const o=i.getTimezoneOffset();if(o===0)return"Z";switch(s){case"X":return Bw(o);case"XXXX":case"XX":return Qi(o);case"XXXXX":case"XXX":default:return Qi(o,":")}},x:function(i,s,a){const o=i.getTimezoneOffset();switch(s){case"x":return Bw(o);case"xxxx":case"xx":return Qi(o);case"xxxxx":case"xxx":default:return Qi(o,":")}},O:function(i,s,a){const o=i.getTimezoneOffset();switch(s){case"O":case"OO":case"OOO":return"GMT"+zw(o,":");case"OOOO":default:return"GMT"+Qi(o,":")}},z:function(i,s,a){const o=i.getTimezoneOffset();switch(s){case"z":case"zz":case"zzz":return"GMT"+zw(o,":");case"zzzz":default:return"GMT"+Qi(o,":")}},t:function(i,s,a){const o=Math.trunc(+i/1e3);return ct(o,s.length)},T:function(i,s,a){return ct(+i,s.length)}};function zw(i,s=""){const a=i>0?"-":"+",o=Math.abs(i),u=Math.trunc(o/60),d=o%60;return d===0?a+String(u):a+String(u)+s+ct(d,2)}function Bw(i,s){return i%60===0?(i>0?"-":"+")+ct(Math.abs(i)/60,2):Qi(i,s)}function Qi(i,s=""){const a=i>0?"-":"+",o=Math.abs(i),u=ct(Math.trunc(o/60),2),d=ct(o%60,2);return a+u+s+d}const qw=(i,s)=>{switch(i){case"P":return s.date({width:"short"});case"PP":return s.date({width:"medium"});case"PPP":return s.date({width:"long"});case"PPPP":default:return s.date({width:"full"})}},FE=(i,s)=>{switch(i){case"p":return s.time({width:"short"});case"pp":return s.time({width:"medium"});case"ppp":return s.time({width:"long"});case"pppp":default:return s.time({width:"full"})}},cR=(i,s)=>{const a=i.match(/(P+)(p+)?/)||[],o=a[1],u=a[2];if(!u)return qw(i,s);let d;switch(o){case"P":d=s.dateTime({width:"short"});break;case"PP":d=s.dateTime({width:"medium"});break;case"PPP":d=s.dateTime({width:"long"});break;case"PPPP":default:d=s.dateTime({width:"full"});break}return d.replace("{{date}}",qw(o,s)).replace("{{time}}",FE(u,s))},uR={p:FE,P:cR},fR=/^D+$/,dR=/^Y+$/,hR=["D","DD","YY","YYYY"];function mR(i){return fR.test(i)}function pR(i){return dR.test(i)}function bR(i,s,a){const o=yR(i,s,a);if(console.warn(o),hR.includes(i))throw new RangeError(o)}function yR(i,s,a){const o=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${s}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const gR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xR=/^'([^]*?)'?$/,NR=/''/g,SR=/[a-zA-Z]/;function JE(i,s,a){var _,w,D,z;const o=wu(),u=o.locale??IE,d=o.firstWeekContainsDate??((w=(_=o.locale)==null?void 0:_.options)==null?void 0:w.firstWeekContainsDate)??1,p=o.weekStartsOn??((z=(D=o.locale)==null?void 0:D.options)==null?void 0:z.weekStartsOn)??0,m=ts(i,a==null?void 0:a.in);if(!E4(m))throw new RangeError("Invalid time value");let g=s.match(vR).map(q=>{const F=q[0];if(F==="p"||F==="P"){const Z=uR[F];return Z(q,u.formatLong)}return q}).join("").match(gR).map(q=>{if(q==="''")return{isToken:!1,value:"'"};const F=q[0];if(F==="'")return{isToken:!1,value:wR(q)};if(Uw[F])return{isToken:!0,value:q};if(F.match(SR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+F+"`");return{isToken:!1,value:q}});u.localize.preprocessor&&(g=u.localize.preprocessor(m,g));const x={firstWeekContainsDate:d,weekStartsOn:p,locale:u};return g.map(q=>{if(!q.isToken)return q.value;const F=q.value;(pR(F)||mR(F))&&bR(F,s,String(i));const Z=Uw[F[0]];return Z(m,F,u.localize,x)}).join("")}function wR(i){const s=i.match(xR);return s?s[1].replace(NR,"'"):i}function ER(i,s,a){const o=wu(),u=(a==null?void 0:a.locale)??o.locale??IE,d=N4(i,s);if(isNaN(d))throw new RangeError("Invalid time value");const p=Object.assign({},a,{addSuffix:a==null?void 0:a.addSuffix,comparison:d}),[m,g]=$E(a==null?void 0:a.in,...d>0?[s,i]:[i,s]),x=_4((a==null?void 0:a.roundingMethod)??"round"),_=g.getTime()-m.getTime(),w=_/Ow,D=mh(g)-mh(m),z=(_-D)/Ow,q=a==null?void 0:a.unit;let F;if(q?F=q:w<1?F="second":w<60?F="minute":w<Mw?F="hour":z<jw?F="day":z<Rw?F="month":F="year",F==="second"){const Z=x(_/1e3);return u.formatDistance("xSeconds",Z,p)}else if(F==="minute"){const Z=x(w);return u.formatDistance("xMinutes",Z,p)}else if(F==="hour"){const Z=x(w/60);return u.formatDistance("xHours",Z,p)}else if(F==="day"){const Z=x(z/Mw);return u.formatDistance("xDays",Z,p)}else if(F==="month"){const Z=x(z/jw);return Z===12&&q!=="month"?u.formatDistance("xYears",1,p):u.formatDistance("xMonths",Z,p)}else{const Z=x(z/Rw);return u.formatDistance("xYears",Z,p)}}function _R(i,s){return ER(i,S4(i),s)}function AR(i){const s=new Date(i);return s.getTime()>Date.now()?"just now":_R(s,{addSuffix:!0})}function z6(i){return i<=0?"Expired":fy(i)}function DR(i){return i==null?"--":fy(i)}function fy(i){if(i<1e3)return`${Math.round(i)}ms`;if(i<6e4){const p=i/1e3;return Number.isInteger(p)?`${p}s`:`${p.toFixed(1)}s`}const s=Math.floor(i/1e3),a=Math.floor(s/86400),o=Math.floor(s%86400/3600),u=Math.floor(s%3600/60),d=s%60;return a>0?o>0?`${a}d ${o}h`:`${a}d`:o>0?u>0?`${o}h ${u}m`:`${o}h`:d>0?`${u}m ${d}s`:`${u}m`}function B6(i,s){const a=new Date(i).getTime(),o=s?new Date(s).getTime():Date.now();return fy(o-a)}function GE({options:i,children:s,className:a=""}){const[o,u]=B.useState(!1),[d,p]=B.useState(null),[m,g]=B.useState(null),x=B.useRef(null),_=B.useRef(void 0),w=B.useRef(void 0),D=220,z=B.useCallback(()=>{if(!x.current)return;const ee=x.current.getBoundingClientRect(),te=window.innerWidth-D-8,we=Math.max(8,Math.min(ee.left,te));g({top:ee.bottom+4,left:we})},[]),q=B.useCallback(async(ee,te)=>{try{await navigator.clipboard.writeText(ee),p(te),clearTimeout(_.current),_.current=setTimeout(()=>p(null),1200)}catch{}},[]),F=B.useCallback(()=>{clearTimeout(w.current),z(),u(!0)},[z]),Z=B.useCallback(()=>{w.current=setTimeout(()=>u(!1),150)},[]);return B.useEffect(()=>()=>{clearTimeout(_.current),clearTimeout(w.current)},[]),b.jsxDEV("span",{ref:x,className:`inline-flex items-center cursor-default ${a}`,onMouseEnter:F,onMouseLeave:Z,children:[s,o&&m&&Gw.createPortal(b.jsxDEV("span",{className:"fixed z-[9999] bg-surface-raised border border-surface-border rounded shadow-lg py-1 min-w-[180px]",style:{top:m.top,left:m.left},onMouseEnter:F,onMouseLeave:Z,children:i.map(ee=>b.jsxDEV("button",{onClick:te=>{te.stopPropagation(),q(ee.value,ee.label)},className:"flex items-center justify-between w-full px-2.5 py-1 text-left hover:bg-surface-hover transition-colors",children:[b.jsxDEV("span",{className:"text-[9px] font-medium uppercase tracking-wider text-text-tertiary w-10 shrink-0",children:ee.label},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:85,columnNumber:15},this),b.jsxDEV("span",{className:"text-[10px] font-mono text-text-secondary truncate ml-2",children:d===ee.label?"✓":ee.value},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:88,columnNumber:15},this)]},ee.label,!0,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:80,columnNumber:13},this))},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:73,columnNumber:9},this),document.body)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/display/DateTooltip.tsx",lineNumber:65,columnNumber:5},this)}function CR(i,s){const a=new Date(i);switch(s){case"relative":return AR(i);case"datetime":return JE(a,"MMM d, yyyy h:mm a");case"time":return a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}}function TR(i){const s=new Date(i);return[{label:"ms",value:String(s.getTime())},{label:"utc",value:s.toISOString()},{label:"local",value:JE(s,"MMM d, yyyy h:mm:ss a")}]}function OR({date:i,format:s="relative",className:a=""}){const[,o]=B.useState(0);B.useEffect(()=>{if(s!=="relative")return;const d=setInterval(()=>o(p=>p+1),3e4);return()=>clearInterval(d)},[s]);const u=B.useMemo(()=>TR(i),[i]);return b.jsxDEV(GE,{options:u,children:b.jsxDEV("time",{dateTime:i,className:`text-xs text-text-tertiary ${a}`,children:CR(i,s)},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateValue.tsx",lineNumber:56,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DateValue.tsx",lineNumber:55,columnNumber:5},this)}function RR({ms:i,className:s=""}){const a=DR(i),o=B.useMemo(()=>i==null?[]:[{label:"ms",value:String(i)},{label:"sec",value:`${(i/1e3).toFixed(3)}s`},{label:"text",value:a}],[i,a]);return i==null?b.jsxDEV("span",{className:`text-xs text-text-tertiary ${s}`,children:"--"},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DurationValue.tsx",lineNumber:29,columnNumber:12},this):b.jsxDEV(GE,{options:o,children:b.jsxDEV("span",{className:`text-xs text-text-tertiary ${s}`,children:a},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DurationValue.tsx",lineNumber:34,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/display/DurationValue.tsx",lineNumber:33,columnNumber:5},this)}const jR=["sm","md","lg","full"],Lw={sm:"w-[28rem] max-h-[40vh]",md:"w-[36rem] max-h-[60vh]",lg:"w-[48rem] max-h-[80vh]",full:"inset-4 w-auto max-h-none"},Hw={sm:"Small",md:"Medium",lg:"Large",full:"Fullscreen"};function MR({which:i}){const s="stroke-current";switch(i){case"sm":return b.jsxDEV("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsxDEV("rect",{x:"5",y:"5",width:"7",height:"7",rx:"1.5",className:s,strokeWidth:"1.5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:27,columnNumber:75},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:27,columnNumber:15},this);case"md":return b.jsxDEV("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsxDEV("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5",className:s,strokeWidth:"1.5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:29,columnNumber:75},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:29,columnNumber:15},this);case"lg":return b.jsxDEV("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsxDEV("rect",{x:"1.5",y:"1.5",width:"11",height:"11",rx:"1.5",className:s,strokeWidth:"1.5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:31,columnNumber:75},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:31,columnNumber:15},this);case"full":return b.jsxDEV("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsxDEV("rect",{x:"0.75",y:"0.75",width:"12.5",height:"12.5",rx:"1.5",className:s,strokeWidth:"1.5"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:33,columnNumber:75},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:33,columnNumber:15},this)}}function kR({msg:i}){const[s,a]=B.useState(0);B.useEffect(()=>{const p=new Date(i.timestamp).getTime(),m=()=>a(Math.floor((Date.now()-p)/1e3));m();const g=setInterval(m,1e3);return()=>clearInterval(g)},[i.timestamp]);const o=Math.floor(s/60),u=s%60,d=o>0?`${o}m ${u}s`:`${u}s`;return b.jsxDEV("span",{className:"inline-flex flex-col gap-1.5",children:[b.jsxDEV("span",{className:"inline-flex items-center gap-1",children:[b.jsxDEV("span",{className:"text-text-tertiary",children:"Thinking"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:55,columnNumber:9},this),b.jsxDEV("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:56,columnNumber:9},this),b.jsxDEV("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse [animation-delay:150ms]"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:57,columnNumber:9},this),b.jsxDEV("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse [animation-delay:300ms]"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:58,columnNumber:9},this),b.jsxDEV("span",{className:"text-text-muted ml-1 tabular-nums",children:d},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:59,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:54,columnNumber:7},this),i.workflowId&&b.jsxDEV(uu,{to:`/workflows/executions/${i.workflowId}`,className:"inline-flex items-center gap-1 text-[10px] text-accent/70 hover:text-accent transition-colors",children:[b.jsxDEV(Y0,{className:"w-2.5 h-2.5",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:66,columnNumber:11},this),"watch execution"]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:62,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:53,columnNumber:5},this)}function VR({msg:i,compileMessage:s}){const a=i.role==="assistant";return b.jsxDEV("div",{className:`flex items-center gap-1.5 ${a?"justify-start":"justify-end"}`,children:[b.jsxDEV(OR,{date:i.timestamp,format:"time",className:"!text-[9px] text-text-muted/50"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:78,columnNumber:7},this),i.durationMs!=null&&b.jsxDEV(b.Fragment,{children:[b.jsxDEV("span",{className:"text-text-muted/30 text-[8px]",children:"·"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:81,columnNumber:11},this),b.jsxDEV(RR,{ms:i.durationMs,className:"!text-[9px] text-text-muted/50"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:82,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:80,columnNumber:9},this),i.workflowId&&b.jsxDEV(uu,{to:`/workflows/executions/${i.workflowId}`,className:"text-text-muted/40 hover:text-accent transition-colors",title:"View workflow execution",children:b.jsxDEV(Y0,{className:"w-2.5 h-2.5",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:91,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:86,columnNumber:9},this),a&&i.workflowId&&!i.pending&&b.jsxDEV("button",{onClick:()=>s(i.id),disabled:i.compilationStatus==="compiling"||i.compilationStatus==="done",className:"transition-colors",title:i.compilationStatus==="done"?"Compiled — future queries will match this pipeline":i.compilationStatus==="error"?i.compilationError??"Compilation failed":i.compilationStatus==="compiling"?"Compiling...":"Compile to fast pipeline",children:b.jsxDEV(aT,{className:`w-2.5 h-2.5 ${i.compilationStatus==="done"?"text-status-success":i.compilationStatus==="error"?"text-status-error":i.compilationStatus==="compiling"?"text-accent/40 animate-pulse":"text-text-muted/40 hover:text-accent"}`,strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:109,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:95,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:77,columnNumber:5},this)}function UR(){const{helpOpen:i,setHelpOpen:s,messages:a,sendMessage:o,pageContext:u,activeWorkflowId:d,clearMessages:p,compileMessage:m}=LE(),[g,x]=B.useState(""),[_,w]=B.useState("md"),[D,z]=B.useState(!0),q=B.useRef(null),F=B.useRef(null);if(B.useEffect(()=>{q.current&&(q.current.scrollTop=q.current.scrollHeight)},[a]),B.useEffect(()=>{i&&F.current&&F.current.focus()},[i]),B.useEffect(()=>{if(!i)return;const U=ne=>{ne.key==="Escape"&&(_==="full"?w("lg"):_==="lg"?w("md"):_==="md"?w("sm"):s(!1))};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[i,_,s]),!i)return null;const Z=()=>{const U=g.trim();!U||d||(o(U),x(""),F.current&&(F.current.style.height="auto"))},ee=U=>{U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),Z())},te=_==="full",we=u.page.replace(/-/g," "),De=te?{}:{bottom:"calc(var(--feed-height, 32px) + 76px)"};return b.jsxDEV("div",{className:`fixed z-[45] flex flex-col border border-surface-border rounded-lg overflow-hidden transition-all duration-300 ${te?Lw.full:`right-6 ${Lw[_]}`} ${D?"bg-surface-raised shadow-xl":"bg-surface-raised/[0.03] shadow-lg shadow-black/5"}`,style:De,onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[b.jsxDEV("div",{className:`flex items-center justify-between px-4 py-2.5 border-b border-surface-border shrink-0 transition-all duration-300 ${D?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[b.jsxDEV("div",{className:"min-w-0 flex-1",children:[b.jsxDEV("p",{className:"text-xs font-medium text-text-primary truncate",children:"Help Assistant"},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:206,columnNumber:11},this),b.jsxDEV("p",{className:"text-[10px] text-text-tertiary truncate",children:we},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:207,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:205,columnNumber:9},this),b.jsxDEV("div",{className:"flex items-center gap-1 ml-2",children:[b.jsxDEV("div",{className:"flex items-center gap-0.5 border border-surface-border rounded p-0.5",role:"radiogroup","aria-label":"Panel size",children:jR.map(U=>b.jsxDEV("button",{onClick:()=>w(U),className:`p-1 rounded transition-colors ${U===_?"bg-accent/15 text-accent":"text-text-muted hover:text-text-secondary hover:bg-surface-hover"}`,role:"radio","aria-checked":U===_,"aria-label":Hw[U],title:Hw[U],children:b.jsxDEV(MR,{which:U},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:225,columnNumber:17},this)},U,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:212,columnNumber:15},this))},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:210,columnNumber:11},this),a.length>0&&b.jsxDEV("button",{onClick:p,className:"p-1 text-text-tertiary hover:text-text-secondary transition-colors","aria-label":"Clear conversation",title:"Clear conversation",children:b.jsxDEV(nT,{className:"w-3.5 h-3.5",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:236,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:230,columnNumber:13},this),b.jsxDEV("button",{onClick:()=>s(!1),className:"p-1 text-text-tertiary hover:text-text-primary transition-colors","aria-label":"Close",title:"Close",children:b.jsxDEV(F0,{className:"w-3.5 h-3.5",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:245,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:239,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:209,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:202,columnNumber:7},this),b.jsxDEV("div",{ref:q,className:`flex-1 overflow-y-auto px-4 py-3 space-y-3 min-h-[120px] transition-all duration-300 ${D?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[a.length===0&&b.jsxDEV("p",{className:"text-xs text-text-tertiary text-center py-6",children:"Ask anything about what you're viewing."},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:255,columnNumber:11},this),a.map(U=>b.jsxDEV("div",{className:`text-xs leading-relaxed ${U.role==="user"?"text-right":"text-left"}`,children:[b.jsxDEV("div",{className:`inline-block max-w-[85%] px-3 py-2 rounded-md whitespace-pre-wrap ${U.role==="user"?"bg-accent/10 text-text-primary":"bg-surface-sunken text-text-secondary"}`,children:U.pending?b.jsxDEV(kR,{msg:U},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:272,columnNumber:17},this):U.role==="assistant"?b.jsxDEV(uy,{content:U.content},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:274,columnNumber:17},this):U.content},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:264,columnNumber:13},this),!U.pending&&b.jsxDEV("div",{className:"mt-0.5",children:b.jsxDEV(VR,{msg:U,compileMessage:m},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:281,columnNumber:17},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:280,columnNumber:15},this)]},U.id,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:260,columnNumber:11},this))]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:251,columnNumber:7},this),b.jsxDEV("div",{className:`border-t border-surface-border px-3 py-2.5 flex gap-2 shrink-0 transition-all duration-300 ${D?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[b.jsxDEV("textarea",{ref:F,value:g,onChange:U=>{x(U.target.value);const ne=U.target;ne.style.height="auto",ne.style.height=`${Math.min(ne.scrollHeight,120)}px`},onKeyDown:ee,placeholder:"Ask a question...",rows:2,className:"flex-1 resize-none bg-surface text-xs text-text-primary placeholder:text-text-tertiary rounded px-2.5 py-1.5 border border-surface-border focus:outline-none focus:border-accent",style:{minHeight:"2.5rem"},disabled:!!d},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:292,columnNumber:9},this),b.jsxDEV("button",{onClick:Z,disabled:!g.trim()||!!d,className:"px-2.5 py-1.5 text-accent hover:text-accent-hover disabled:text-text-muted transition-colors self-end","aria-label":"Send",children:b.jsxDEV(sT,{className:"w-4 h-4",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:314,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:308,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:289,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/HelpPanel.tsx",lineNumber:189,columnNumber:5},this)}function zR(){const{isSuperAdmin:i,hasRoleType:s,hasRole:a}=Ki(),{collapsed:o,toggle:u}=UE(),[d,p]=B.useState(!1),[m,g]=B.useState(()=>window.location.hash.startsWith("#docs")),x=Zi(),_=B.useRef(null);return B.useEffect(()=>{const w=_.current;w&&(w.classList.remove("animate-page-in"),w.offsetWidth,w.classList.add("animate-page-in"))},[x.pathname]),B.useEffect(()=>{const w=()=>{window.location.hash.startsWith("#docs")&&g(!0)};return window.addEventListener("hashchange",w),()=>window.removeEventListener("hashchange",w)},[]),b.jsxDEV("div",{className:"h-screen bg-surface flex flex-col",style:{"--feed-height":d?"224px":"32px"},children:[b.jsxDEV(O5,{onToggleEventFeed:()=>p(w=>!w),onToggleDocs:()=>g(w=>!w)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:45,columnNumber:7},this),b.jsxDEV("div",{className:"flex flex-1 overflow-hidden",children:[b.jsxDEV("aside",{className:`${o?"w-16":"w-60"} shrink-0 bg-surface-raised border-r border-surface-border flex flex-col transition-[width] duration-200 ease-out overflow-hidden relative z-20`,children:[b.jsxDEV("nav",{className:"flex-1 px-3 pt-[36px] pb-4 space-y-2 overflow-y-auto overflow-x-hidden",children:[(i||s("admin")||a("engineer"))&&b.jsxDEV(B5,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:57,columnNumber:79},this),(i||s("admin")||a("engineer"))&&b.jsxDEV(L5,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:58,columnNumber:79},this),(i||s("admin"))&&b.jsxDEV(U5,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:59,columnNumber:56},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:56,columnNumber:11},this),b.jsxDEV("button",{onClick:u,className:`shrink-0 py-3 text-text-tertiary hover:text-text-secondary transition-colors duration-150 ${o?"flex justify-center":"flex items-center px-7"}`,"aria-label":o?"Expand sidebar":"Collapse sidebar",children:o?b.jsxDEV(rT,{className:"w-4 h-4 text-accent-muted",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:71,columnNumber:15},this):b.jsxDEV(iT,{className:"w-4 h-4 text-accent-muted",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:73,columnNumber:15},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:63,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:50,columnNumber:9},this),b.jsxDEV("main",{className:"flex-1 overflow-y-auto",children:b.jsxDEV("div",{ref:_,className:`max-w-dashboard mx-auto px-10 py-10 animate-page-in ${d?"pb-60":"pb-16"}`,children:b.jsxDEV(Xd,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:81,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:80,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:79,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:48,columnNumber:7},this),b.jsxDEV(n4,{open:d,onToggle:()=>p(w=>!w)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:87,columnNumber:7},this),b.jsxDEV(f4,{open:m,onClose:()=>{g(!1),history.replaceState(null,"",window.location.pathname+window.location.search)}},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:88,columnNumber:7},this),b.jsxDEV(b4,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:89,columnNumber:7},this),b.jsxDEV(UR,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:90,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:43,columnNumber:5},this)}function BR(){const{isAuthenticated:i}=Ki(),s=Zi();return i?b.jsxDEV(A5,{children:b.jsxDEV(p4,{children:b.jsxDEV(zR,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:106,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:105,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:104,columnNumber:5},this):b.jsxDEV(Wr,{to:"/login",state:{from:s.pathname},replace:!0},void 0,!1,{fileName:"/app/dashboard/src/components/layout/Shell.tsx",lineNumber:100,columnNumber:12},this)}function QE({provider:i,className:s="w-5 h-5"}){switch(i){case"google":return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"currentColor",children:[b.jsxDEV("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:11,columnNumber:11},this),b.jsxDEV("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:12,columnNumber:11},this),b.jsxDEV("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:13,columnNumber:11},this),b.jsxDEV("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:14,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:10,columnNumber:9},this);case"github":return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"currentColor",children:b.jsxDEV("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:20,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:19,columnNumber:9},this);case"microsoft":return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"currentColor",children:[b.jsxDEV("path",{d:"M3 3h8.5v8.5H3z",fill:"#F25022"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:26,columnNumber:11},this),b.jsxDEV("path",{d:"M12.5 3H21v8.5h-8.5z",fill:"#7FBA00"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:27,columnNumber:11},this),b.jsxDEV("path",{d:"M3 12.5h8.5V21H3z",fill:"#00A4EF"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:28,columnNumber:11},this),b.jsxDEV("path",{d:"M12.5 12.5H21V21h-8.5z",fill:"#FFB900"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:29,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:25,columnNumber:9},this);case"anthropic":return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"currentColor",children:b.jsxDEV("path",{d:"M13.827 3.52h3.603L24 20.48h-3.603l-6.57-16.96zm-7.258 0h3.767L16.906 20.48h-3.674l-1.343-3.461H6.396l-1.34 3.461H1.5l5.07-16.96zm2.327 5.14l-2.065 5.326h4.108l-2.043-5.326z"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:35,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:34,columnNumber:9},this);default:return b.jsxDEV("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[b.jsxDEV("circle",{cx:"12",cy:"12",r:"10"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:41,columnNumber:11},this),b.jsxDEV("path",{d:"M12 8v4l3 3"},void 0,!1,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:42,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/OAuthIcon.tsx",lineNumber:40,columnNumber:9},this)}}async function qR(){return Nt("/auth/oauth/providers")}async function LR(i,s){const a=s?`?label=${encodeURIComponent(s)}`:"";return Nt(`/auth/oauth/connections/${i}${a}`,{method:"DELETE"})}function q6(){return ii({queryKey:["oauth-connections"],queryFn:()=>Nt("/auth/oauth/connections")})}function L6(){const i=Vs();return Sa({mutationFn:({provider:s,label:a})=>LR(s,a),onSuccess:()=>{i.invalidateQueries({queryKey:["oauth-connections"]})}})}function HR(){var ne;const{login:i,isAuthenticated:s}=Ki(),a=Qw(),o=Zi(),u=new URLSearchParams(o.search),d=u.get("token"),p=u.get("error"),m=((ne=o.state)==null?void 0:ne.from)??u.get("returnTo")??"/",g=B.useRef(!1);d&&!g.current&&(g.current=!0,i(d,void 0,{displayName:u.get("displayName"),username:u.get("username")}));const[x,_]=B.useState(""),[w,D]=B.useState(""),[z,q]=B.useState(p||""),[F,Z]=B.useState(!1),[ee,te]=B.useState(!!d),[we,De]=B.useState([]);if(B.useEffect(()=>{d||qR().then(De).catch(()=>{})},[]),B.useEffect(()=>{if(!ee)return;const oe=setTimeout(()=>a(m,{replace:!0}),1500);return()=>clearTimeout(oe)},[ee]),s&&!ee)return b.jsxDEV(Wr,{to:m,replace:!0},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:54,columnNumber:12},this);const U=async oe=>{var W,Q;if(oe.preventDefault(),q(""),!x.trim()||!w){q("Username and password are required");return}Z(!0);try{const H=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:x.trim(),password:w})}),le=await H.json();if(!H.ok){q(le.error||"Login failed");return}te(!0),i(le.token,{username:x.trim(),password:w},{displayName:(W=le.user)==null?void 0:W.display_name,username:(Q=le.user)==null?void 0:Q.external_id})}catch{q("Unable to connect to server")}finally{Z(!1)}};return b.jsxDEV("div",{className:"min-h-screen bg-surface flex items-center justify-center overflow-hidden",children:b.jsxDEV("div",{className:"w-full max-w-md p-10",children:[b.jsxDEV("div",{className:`mb-10 transition-all duration-[1500ms] ease-in ${ee?"translate-x-[120vw] -translate-y-[60vh] scale-[3] opacity-0":""}`,children:b.jsxDEV(oy,{size:"lg",hideLabel:ee},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:101,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:94,columnNumber:9},this),b.jsxDEV("form",{onSubmit:U,className:`space-y-5 transition-opacity duration-300 ${ee?"opacity-0":""}`,children:[b.jsxDEV("div",{children:[b.jsxDEV("label",{htmlFor:"username",className:"block text-sm font-medium text-text-secondary mb-2",children:"Username"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:109,columnNumber:13},this),b.jsxDEV("input",{id:"username",type:"text",value:x,onChange:oe=>_(oe.target.value),className:"input",placeholder:"Enter your username",autoFocus:!ee,autoComplete:"username"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:115,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:108,columnNumber:11},this),b.jsxDEV("div",{children:[b.jsxDEV("label",{htmlFor:"password",className:"block text-sm font-medium text-text-secondary mb-2",children:"Password"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:128,columnNumber:13},this),b.jsxDEV("input",{id:"password",type:"password",value:w,onChange:oe=>D(oe.target.value),className:"input",placeholder:"Enter your password",autoComplete:"current-password"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:134,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:127,columnNumber:11},this),z&&b.jsxDEV("p",{className:"text-sm text-status-error",children:z},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:145,columnNumber:21},this),b.jsxDEV("button",{type:"submit",className:"btn-primary w-full",disabled:F||ee,children:F?"Signing in...":"Sign In"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:147,columnNumber:11},this),we.length>0&&b.jsxDEV(b.Fragment,{children:[b.jsxDEV("div",{className:"flex items-center gap-3 mt-6",children:[b.jsxDEV("div",{className:"flex-1 h-px bg-border"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:154,columnNumber:17},this),b.jsxDEV("span",{className:"text-xs text-text-tertiary",children:"or continue with"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:155,columnNumber:17},this),b.jsxDEV("div",{className:"flex-1 h-px bg-border"},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:156,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:153,columnNumber:15},this),b.jsxDEV("div",{className:"space-y-2",children:we.filter(oe=>oe.provider!=="anthropic").map(oe=>b.jsxDEV("a",{href:`/api/auth/oauth/${oe.provider}?returnTo=${encodeURIComponent(m)}`,className:"btn-secondary w-full flex items-center justify-center gap-2",children:[b.jsxDEV(QE,{provider:oe.provider},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:165,columnNumber:21},this),"Sign in with ",oe.name]},oe.provider,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:160,columnNumber:19},this))},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:158,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:152,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:104,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:93,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/LoginPage.tsx",lineNumber:92,columnNumber:5},this)}function Pw(){const{isAuthenticated:i}=Ki(),s=Qw(),a=Zi(),o=new URLSearchParams(a.search),u=o.get("state")||"";B.useEffect(()=>{i||s(`/login?returnTo=${encodeURIComponent(a.pathname+a.search)}`)},[i]);const[d,p]=B.useState(""),[m,g]=B.useState(o.get("label")||"default"),[x,_]=B.useState(""),[w,D]=B.useState(!1),z=d.trim().startsWith("sk-ant-oat"),q=d.trim().startsWith("sk-ant-api"),F=Z=>{Z.preventDefault();const ee=d.trim();if(!ee){_("A token or API key is required");return}if(!ee.startsWith("sk-ant-")){_('Invalid format. Must start with "sk-ant-oat" (OAuth token) or "sk-ant-api" (API key)');return}D(!0),_("");const te=`/api/auth/oauth/anthropic/callback?code=${encodeURIComponent(ee)}&state=${encodeURIComponent(u)}`;window.location.href=te};return b.jsxDEV("div",{className:"min-h-screen bg-surface flex items-center justify-center",children:b.jsxDEV("div",{className:"w-full max-w-md p-10",children:[b.jsxDEV("div",{className:"mb-10",children:b.jsxDEV(oy,{size:"lg"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:67,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:66,columnNumber:9},this),b.jsxDEV("div",{className:"flex items-center gap-2 mb-6",children:[b.jsxDEV(QE,{provider:"anthropic",className:"w-6 h-6"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:71,columnNumber:11},this),b.jsxDEV("h2",{className:"text-lg font-semibold text-text-primary",children:"Connect Anthropic"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:72,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:70,columnNumber:9},this),b.jsxDEV("p",{className:"text-sm text-text-secondary mb-4",children:"Connect your Anthropic account so Claude Code tasks run under your credentials. Your token is encrypted at rest."},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:77,columnNumber:9},this),b.jsxDEV("form",{onSubmit:F,className:"space-y-5",children:[b.jsxDEV("div",{children:[b.jsxDEV("label",{htmlFor:"token",className:"block text-sm font-medium text-text-secondary mb-2",children:"OAuth Token or API Key"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:84,columnNumber:13},this),b.jsxDEV("input",{id:"token",type:"password",value:d,onChange:Z=>p(Z.target.value),className:"input",placeholder:"sk-ant-oat01-... or sk-ant-api03-...",autoFocus:!0,autoComplete:"off"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:90,columnNumber:13},this),z&&b.jsxDEV("p",{className:"text-xs text-status-success mt-1",children:"OAuth token detected — uses your Claude subscription (flat rate)"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:101,columnNumber:15},this),q&&b.jsxDEV("p",{className:"text-xs text-status-warning mt-1",children:"API key detected — billed per-token from your Anthropic API account"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:106,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:83,columnNumber:11},this),b.jsxDEV("div",{children:[b.jsxDEV("label",{htmlFor:"label",className:"block text-sm font-medium text-text-secondary mb-2",children:"Label"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:113,columnNumber:13},this),b.jsxDEV("input",{id:"label",type:"text",value:m,onChange:Z=>g(Z.target.value.replace(/\s+/g,"-").toLowerCase()),className:"input",placeholder:"default",autoComplete:"off"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:119,columnNumber:13},this),b.jsxDEV("p",{className:"text-xs text-text-tertiary mt-1",children:'A name for this credential. Use different labels to store multiple credentials (e.g., "subscription", "api-batch").'},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:128,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:112,columnNumber:11},this),x&&b.jsxDEV("p",{className:"text-sm text-status-error",children:x},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:134,columnNumber:21},this),b.jsxDEV("button",{type:"submit",className:"btn-primary w-full",disabled:w,children:w?"Validating...":"Connect"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:136,columnNumber:11},this),b.jsxDEV("a",{href:"/",className:"block text-center text-sm text-text-tertiary hover:text-text-secondary",children:"Cancel"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:144,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:82,columnNumber:9},this),b.jsxDEV("div",{className:"mt-6 space-y-3 text-xs text-text-tertiary",children:[b.jsxDEV("div",{children:[b.jsxDEV("span",{className:"font-medium text-text-secondary",children:"Recommended:"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:154,columnNumber:13},this)," ","Run"," ",b.jsxDEV("code",{className:"px-1 py-0.5 bg-surface-sunken rounded text-[11px]",children:"claude setup-token"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:156,columnNumber:13},this)," ","in your terminal to generate an OAuth token that uses your subscription."]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:153,columnNumber:11},this),b.jsxDEV("div",{children:[b.jsxDEV("span",{className:"font-medium text-text-secondary",children:"Alternative:"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:160,columnNumber:13},this)," ","Use an API key from"," ",b.jsxDEV("a",{href:"https://console.anthropic.com/settings/keys",target:"_blank",rel:"noopener noreferrer",className:"text-accent-secondary hover:underline",children:"console.anthropic.com"},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:162,columnNumber:13},this)," ","(billed per-token)."]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:159,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:152,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:65,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/ConnectAnthropicPage.tsx",lineNumber:64,columnNumber:5},this)}function x0({roleTypes:i,roleNames:s,redirectTo:a="/"}){const{isSuperAdmin:o,hasRole:u,hasRoleType:d}=Ki();return o?b.jsxDEV(Xd,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/RequireRole.tsx",lineNumber:18,columnNumber:28},this):i&&i.some(p=>d(p))?b.jsxDEV(Xd,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/RequireRole.tsx",lineNumber:21,columnNumber:66},this):s&&s.some(p=>u(p))?b.jsxDEV(Xd,{},void 0,!1,{fileName:"/app/dashboard/src/components/layout/RequireRole.tsx",lineNumber:24,columnNumber:62},this):b.jsxDEV(Wr,{to:a,replace:!0},void 0,!1,{fileName:"/app/dashboard/src/components/layout/RequireRole.tsx",lineNumber:26,columnNumber:10},this)}const $w=B.lazy(()=>rt(()=>import("./ProcessesListPage-BDpUbua2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])).then(i=>({default:i.ProcessesListPage}))),PR=B.lazy(()=>rt(()=>import("./ProcessDetailPage-69I--sry.js"),__vite__mapDeps([16,2,1,4,17,18,19,15,14,9,6,20,21,22])).then(i=>({default:i.ProcessDetailPage}))),$R=B.lazy(()=>rt(()=>import("./McpOverview-BaKTIWrG.js"),__vite__mapDeps([23,2,24,25,26,27,12,28,14,6])).then(i=>({default:i.McpOverview}))),IR=B.lazy(()=>rt(()=>import("./McpRunsPage-CcPD_tY1.js"),__vite__mapDeps([29,2,25,26,27,5,6,7,8,15,14,9,30,12,11,10,13,31])).then(i=>({default:i.McpRunsPage}))),YR=B.lazy(()=>rt(()=>import("./McpRunDetailPage-CKs1RWeV.js"),__vite__mapDeps([32,2,25,17,19,12,33,6,34,35,11,36,13,14])).then(i=>({default:i.McpRunDetailPage}))),FR=B.lazy(()=>rt(()=>import("./McpQueryPage-CVfF9dYg.js"),__vite__mapDeps([37,12,7,8,11,2,10,13,14,9,30,15,31,5,6,4,38])).then(i=>({default:i.McpQueryPage}))),JR=B.lazy(()=>rt(()=>import("./McpQueryDetailPage-CC08T5k8.js"),__vite__mapDeps([39,2,12,19,38,26,4,14,40,34,41,42,43,25,3,1,44,6,33,45,36])).then(i=>({default:i.McpQueryDetailPage}))),GR=B.lazy(()=>rt(()=>import("./EscalationsOverview-BQAT9W7r.js"),__vite__mapDeps([46,2,4,12,28,6,14])).then(i=>({default:i.EscalationsOverview}))),QR=B.lazy(()=>rt(()=>import("./AvailableEscalationsPage-CnivX4Tz.js"),__vite__mapDeps([47,2,4,48,5,6,7,8,10,49,12,50,51,17,22,52,11,53,20,14,15,9,54,31,13])).then(i=>({default:i.AvailableEscalationsPage}))),XR=B.lazy(()=>rt(()=>import("./OperatorDashboard-BGiRaRDr.js"),__vite__mapDeps([55,4,2,48,5,6,7,8,12,10,31,52,11,53,20,14,15,9,54,13])).then(i=>({default:i.OperatorDashboard}))),ZR=B.lazy(()=>rt(()=>import("./index-DwRytW9O.js"),__vite__mapDeps([56,2,48,12,34,54,3,17,4,6,21,22,51,50,19,20,14,33])).then(i=>({default:i.EscalationDetailPage}))),KR=B.lazy(()=>rt(()=>import("./WorkflowsOverview-03IRrDLg.js"),__vite__mapDeps([57,2,3,4,12,28,6,14])).then(i=>({default:i.WorkflowsOverview}))),WR=B.lazy(()=>rt(()=>import("./index-CNI7k7oB.js"),__vite__mapDeps([58,2,3,12,14,42,43,6,7,8,59,45,19])).then(i=>({default:i.StartWorkflowPage}))),e6=B.lazy(()=>rt(()=>import("./index-CNI7k7oB.js"),__vite__mapDeps([58,2,3,12,14,42,43,6,7,8,59,45,19])).then(i=>({default:i.DurableInvokePage}))),t6=B.lazy(()=>rt(()=>import("./WorkflowsDashboard-Drl3juz9.js"),__vite__mapDeps([60,2,9,30,3,4,5,6,7,8,15,14,12,11,10,13,31])).then(i=>({default:()=>i.WorkflowsDashboard({tier:"durable"})}))),n6=B.lazy(()=>rt(()=>import("./WorkflowsDashboard-Drl3juz9.js"),__vite__mapDeps([60,2,9,30,3,4,5,6,7,8,15,14,12,11,10,13,31])).then(i=>({default:()=>i.WorkflowsDashboard({tier:"all"})}))),s6=B.lazy(()=>rt(()=>import("./YamlWorkflowsPage-DC2cLxVi.js"),__vite__mapDeps([61,2,26,5,6,62,19,12,11,8,44,41,42,43,14,59,45])).then(i=>({default:i.YamlWorkflowsPage}))),a6=B.lazy(()=>rt(()=>import("./TasksListPage-C3cX94Mw.js"),__vite__mapDeps([63,1,2,3,5,6,7,8,19,53,45,10,11,12,15,14])).then(i=>({default:i.TasksListPage}))),r6=B.lazy(()=>rt(()=>import("./TaskDetailPage-BXJFX74D.js"),__vite__mapDeps([64,1,2,19,53,12,6,14])).then(i=>({default:i.TaskDetailPage}))),Iw=B.lazy(()=>rt(()=>import("./WorkflowExecutionPage-BBYWEV2P.js"),__vite__mapDeps([65,2,3,4,35,11,36,19,6,1,12,34,13,14])).then(i=>({default:i.WorkflowExecutionPage}))),i6=B.lazy(()=>rt(()=>import("./AdminDashboard-DRjkRSjJ.js"),__vite__mapDeps([66,1,2,4,24,18,6,14])).then(i=>({default:i.AdminDashboard}))),o6=B.lazy(()=>rt(()=>import("./index-b03HlbnH.js"),__vite__mapDeps([67,2,3,7,8,11,31,5,6,12,68,14,15])).then(i=>({default:i.WorkersPage}))),l6=B.lazy(()=>rt(()=>import("./index-Bxe8h1x4.js"),__vite__mapDeps([69,2,3,7,8,70,49,6,11,31,5,12,20,14,68,15,71,48,42,43])).then(i=>({default:i.WorkflowConfigsPage}))),Yw=B.lazy(()=>rt(()=>import("./index-Bxe8h1x4.js"),__vite__mapDeps([69,2,3,7,8,70,49,6,11,31,5,12,20,14,68,15,71,48,42,43])).then(i=>({default:i.WorkflowConfigDetailPage}))),c6=B.lazy(()=>rt(()=>import("./index-aRvL-dXp.js"),__vite__mapDeps([72,2,24,8,70,49,6,12,11,10,5,62,41,42,43,14,31,19])).then(i=>({default:i.McpServersPage}))),Fw=B.lazy(()=>rt(()=>import("./index-CORHB0WC.js"),__vite__mapDeps([73,2,24,71,12,40,14,6])).then(i=>({default:i.McpServerDetailPage}))),u6=B.lazy(()=>rt(()=>import("./index-B98ipWxE.js"),__vite__mapDeps([74,2,22,5,6,7,8,10,11,9,70,49,31,12,20,14,43,48,45])).then(i=>({default:i.UsersPage}))),f6=B.lazy(()=>rt(()=>import("./RolesPage-Cl23Hjet.js"),__vite__mapDeps([75,2,48,7,8,70,49,6,12,20,14,31])).then(i=>({default:i.RolesPage}))),d6=B.lazy(()=>rt(()=>import("./index-BIG3KooI.js"),__vite__mapDeps([76,2,12,49,6,50,14])).then(i=>({default:i.MaintenancePage}))),h6=B.lazy(()=>rt(()=>import("./index-Dj-z-x8M.js"),__vite__mapDeps([77,2,18,7,8,34,11,5,6,31,14,49,68])).then(i=>({default:i.ControlPlanePage}))),m6=B.lazy(()=>rt(()=>import("./CredentialsPage-qGw1kQzi.js"),__vite__mapDeps([78,2,12,45,70,49,6,14])).then(i=>({default:i.CredentialsPage})));function p6(){return b.jsxDEV("div",{className:"animate-pulse space-y-4",children:[b.jsxDEV("div",{className:"h-8 bg-surface-sunken rounded w-48"},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:129,columnNumber:7},this),b.jsxDEV("div",{className:"h-40 bg-surface-sunken rounded"},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:130,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/App.tsx",lineNumber:128,columnNumber:5},this)}function Ze({children:i}){return b.jsxDEV(B.Suspense,{fallback:b.jsxDEV(p6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:137,columnNumber:25},this),children:b.jsxDEV("div",{className:"animate-page-enter",children:i},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:138,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:137,columnNumber:5},this)}const XE=new kC({defaultOptions:{queries:{staleTime:1e4,retry:(i,s)=>s instanceof Error&&s.message==="Session expired"?!1:i<1}}});window.addEventListener("auth:unauthorized",()=>{XE.clear(),sessionStorage.removeItem("lt_token"),sessionStorage.removeItem("lt_credentials"),sessionStorage.removeItem("lt_user_info"),window.location.pathname!=="/login"&&(window.location.href=`/login?returnTo=${encodeURIComponent(window.location.pathname)}`)});const b6=zC([{path:"/login",element:b.jsxDEV(HR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:174,columnNumber:30},void 0)},{path:"/connect/anthropic",element:b.jsxDEV(Pw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:175,columnNumber:42},void 0)},{path:"/connect/:provider",element:b.jsxDEV(Pw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:176,columnNumber:42},void 0)},{path:"/",element:b.jsxDEV(BR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:179,columnNumber:14},void 0),children:[{index:!0,element:b.jsxDEV(Ze,{children:b.jsxDEV($w,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:182,columnNumber:37},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:182,columnNumber:31},void 0)},{path:"processes/all",element:b.jsxDEV(Ze,{children:b.jsxDEV($w,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:185,columnNumber:47},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:185,columnNumber:41},void 0)},{path:"processes/detail/:originId",element:b.jsxDEV(Ze,{children:b.jsxDEV(PR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:186,columnNumber:60},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:186,columnNumber:54},void 0)},{path:"credentials",element:b.jsxDEV(Ze,{children:b.jsxDEV(m6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:189,columnNumber:45},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:189,columnNumber:39},void 0)},{path:"connections",element:b.jsxDEV(Wr,{to:"/credentials",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:190,columnNumber:39},void 0)},{path:"escalations",element:b.jsxDEV(Ze,{children:b.jsxDEV(GR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:193,columnNumber:45},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:193,columnNumber:39},void 0)},{path:"escalations/available",element:b.jsxDEV(Ze,{children:b.jsxDEV(QR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:194,columnNumber:55},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:194,columnNumber:49},void 0)},{path:"escalations/queue",element:b.jsxDEV(Ze,{children:b.jsxDEV(XR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:195,columnNumber:51},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:195,columnNumber:45},void 0)},{path:"escalations/detail/:id",element:b.jsxDEV(Ze,{children:b.jsxDEV(ZR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:196,columnNumber:56},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:196,columnNumber:50},void 0)},{element:b.jsxDEV(x0,{roleTypes:["admin","superadmin"],roleNames:["engineer"]},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:200,columnNumber:18},void 0),children:[{path:"workflows",element:b.jsxDEV(Ze,{children:b.jsxDEV(KR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:202,columnNumber:47},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:202,columnNumber:41},void 0)},{path:"workflows/executions",element:b.jsxDEV(Ze,{children:b.jsxDEV(n6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:203,columnNumber:58},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:203,columnNumber:52},void 0)},{path:"workflows/durable/executions",element:b.jsxDEV(Ze,{children:b.jsxDEV(t6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:204,columnNumber:66},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:204,columnNumber:60},void 0)},{path:"workflows/durable/executions/:workflowId",element:b.jsxDEV(Ze,{children:b.jsxDEV(Iw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:205,columnNumber:78},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:205,columnNumber:72},void 0)},{path:"workflows/tasks",element:b.jsxDEV(Ze,{children:b.jsxDEV(a6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:206,columnNumber:53},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:206,columnNumber:47},void 0)},{path:"workflows/tasks/detail/:id",element:b.jsxDEV(Ze,{children:b.jsxDEV(r6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:207,columnNumber:64},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:207,columnNumber:58},void 0)},{path:"workflows/executions/:workflowId",element:b.jsxDEV(Ze,{children:b.jsxDEV(Iw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:208,columnNumber:70},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:208,columnNumber:64},void 0)},{path:"workflows/start",element:b.jsxDEV(Ze,{children:b.jsxDEV(WR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:209,columnNumber:53},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:209,columnNumber:47},void 0)},{path:"workflows/durable/invoke",element:b.jsxDEV(Ze,{children:b.jsxDEV(e6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:210,columnNumber:62},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:210,columnNumber:56},void 0)},{path:"workflows/cron",element:b.jsxDEV(Wr,{to:"/workflows/start?mode=schedule",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:211,columnNumber:46},void 0)},{path:"workflows/workers",element:b.jsxDEV(Ze,{children:b.jsxDEV(o6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:212,columnNumber:55},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:212,columnNumber:49},void 0)},{path:"workflows/registry",element:b.jsxDEV(Ze,{children:b.jsxDEV(l6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:213,columnNumber:56},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:213,columnNumber:50},void 0)},{path:"workflows/registry/new",element:b.jsxDEV(Ze,{children:b.jsxDEV(Yw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:214,columnNumber:60},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:214,columnNumber:54},void 0)},{path:"workflows/registry/:workflowType",element:b.jsxDEV(Ze,{children:b.jsxDEV(Yw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:215,columnNumber:70},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:215,columnNumber:64},void 0)}]},{element:b.jsxDEV(x0,{roleTypes:["admin","superadmin"],roleNames:["engineer"]},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:221,columnNumber:18},void 0),children:[{path:"mcp",element:b.jsxDEV(Ze,{children:b.jsxDEV($R,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:223,columnNumber:41},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:223,columnNumber:35},void 0)},{path:"mcp/queries",element:b.jsxDEV(Ze,{children:b.jsxDEV(FR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:224,columnNumber:49},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:224,columnNumber:43},void 0)},{path:"mcp/queries/:workflowId",element:b.jsxDEV(Ze,{children:b.jsxDEV(JR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:225,columnNumber:61},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:225,columnNumber:55},void 0)},{path:"mcp/tools",element:b.jsxDEV(Wr,{to:"/mcp/servers",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:226,columnNumber:41},void 0)},{path:"mcp/servers",element:b.jsxDEV(Ze,{children:b.jsxDEV(c6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:227,columnNumber:49},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:227,columnNumber:43},void 0)},{path:"mcp/servers/new",element:b.jsxDEV(Ze,{children:b.jsxDEV(Fw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:228,columnNumber:53},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:228,columnNumber:47},void 0)},{path:"mcp/servers/:serverId",element:b.jsxDEV(Ze,{children:b.jsxDEV(Fw,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:229,columnNumber:59},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:229,columnNumber:53},void 0)},{path:"mcp/workflows",element:b.jsxDEV(Ze,{children:b.jsxDEV(s6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:230,columnNumber:51},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:230,columnNumber:45},void 0)},{path:"mcp/executions",element:b.jsxDEV(Ze,{children:b.jsxDEV(IR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:231,columnNumber:52},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:231,columnNumber:46},void 0)},{path:"mcp/executions/:jobId",element:b.jsxDEV(Ze,{children:b.jsxDEV(YR,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:232,columnNumber:59},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:232,columnNumber:53},void 0)}]},{element:b.jsxDEV(x0,{roleTypes:["admin","superadmin"]},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:238,columnNumber:18},void 0),children:[{path:"admin",element:b.jsxDEV(Ze,{children:b.jsxDEV(i6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:240,columnNumber:43},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:240,columnNumber:37},void 0)},{path:"admin/users",element:b.jsxDEV(Ze,{children:b.jsxDEV(u6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:241,columnNumber:49},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:241,columnNumber:43},void 0)},{path:"admin/bots",element:b.jsxDEV(Wr,{to:"/admin/users?tab=service-accounts",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:242,columnNumber:42},void 0)},{path:"admin/escalation-chains",element:b.jsxDEV(Wr,{to:"/admin/roles",replace:!0},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:243,columnNumber:55},void 0)},{path:"admin/roles",element:b.jsxDEV(Ze,{children:b.jsxDEV(f6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:244,columnNumber:49},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:244,columnNumber:43},void 0)},{path:"admin/maintenance",element:b.jsxDEV(Ze,{children:b.jsxDEV(d6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:245,columnNumber:55},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:245,columnNumber:49},void 0)},{path:"admin/controlplane",element:b.jsxDEV(Ze,{children:b.jsxDEV(h6,{},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:246,columnNumber:56},void 0)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:246,columnNumber:50},void 0)}]}]}]);function y6(){return b.jsxDEV(VC,{client:XE,children:b.jsxDEV(_5,{children:b.jsxDEV(yT,{children:b.jsxDEV(BC,{router:b6},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:258,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:257,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:256,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/App.tsx",lineNumber:255,columnNumber:5},this)}hT.createRoot(document.getElementById("root")).render(b.jsxDEV(B.StrictMode,{children:b.jsxDEV(y6,{},void 0,!1,{fileName:"/app/dashboard/src/main.tsx",lineNumber:8,columnNumber:5},void 0)},void 0,!1,{fileName:"/app/dashboard/src/main.tsx",lineNumber:7,columnNumber:3},void 0));export{q6 as A,L6 as B,ly as C,RR as D,zE as F,W5 as J,xO as N,QE as O,H5 as S,B6 as a,Nt as b,OR as c,A6 as d,C6 as e,DR as f,O6 as g,E6 as h,Ki as i,b as j,j6 as k,M6 as l,k6 as m,V6 as n,U6 as o,_6 as p,D5 as q,T6 as r,D6 as s,R6 as t,NE as u,JE as v,GE as w,z6 as x,fy as y,S6 as z};
281
+ //# sourceMappingURL=index-BwN3KP_L.js.map