@decocms/mesh 2.132.0 → 2.133.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/client/assets/{AlertCircle-Dvy3oHwl.js → AlertCircle-DtdVhcv9.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-C1Pd8crU.js → AlignLeft-CRHzRLnb.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-B0XF9QfR.js → ArrowDown-CD9f6dVF.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-Ddv8Es1G.js → ArrowLeft-Dse_UWo5.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CjPyEOxC.js → ArrowUp-C5pU0t20.js} +1 -1
  6. package/dist/client/assets/{Check-BGWNBpXb.js → Check-llxZXJNk.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CDdaecse.js → CheckCircle-naMxBwcc.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-DgNkGXSd.js → CheckDone01-DArNoCeR.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-yC2IepeU.js → CheckVerified02-B5N8FkZi.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-CxLgy5uI.js → ChevronDown-BPvdqfh0.js} +1 -1
  11. package/dist/client/assets/ChevronLeft-BmfUl3Br.js +1 -0
  12. package/dist/client/assets/{ChevronRight-B-dZm0Fo.js → ChevronRight-bI92hTEK.js} +1 -1
  13. package/dist/client/assets/{Clock-DjTfMWYb.js → Clock-DCqyBdVg.js} +1 -1
  14. package/dist/client/assets/{Code01-C4dpeKsY.js → Code01-Cw3aSJX_.js} +1 -1
  15. package/dist/client/assets/{Container-CH2V2ATa.js → Container-BcN3rU1W.js} +1 -1
  16. package/dist/client/assets/{Copy01-Ba42JLNP.js → Copy01-DOsfcAr7.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-Dbafm5jn.js → Dataflow03-BzHLq4N3.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-DF0XToJT.js → DotsHorizontal-jg8p8szZ.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-D-x0DTAA.js → DotsVertical-D7GBR06C.js} +1 -1
  20. package/dist/client/assets/{Download01-x2RmdAQh.js → Download01-Dqv2OtJR.js} +1 -1
  21. package/dist/client/assets/{Edit01-NXKv8M2Y.js → Edit01-PGiGF51x.js} +1 -1
  22. package/dist/client/assets/{Eye-Da9OHWjs.js → Eye-BHQjRrk8.js} +1 -1
  23. package/dist/client/assets/{File02-BBbAYdh-.js → File02-8H6UbpEV.js} +1 -1
  24. package/dist/client/assets/{File06-CZSeKcKm.js → File06-C1Sd5E1A.js} +1 -1
  25. package/dist/client/assets/{FilterLines-CR4t6v_B.js → FilterLines-C4D0sIiB.js} +1 -1
  26. package/dist/client/assets/{Globe01-sstJp1qH.js → Globe01-DvHitX1A.js} +1 -1
  27. package/dist/client/assets/{Globe02-DED7nhMo.js → Globe02-8eZbLs7z.js} +1 -1
  28. package/dist/client/assets/{Grid01-C85povgK.js → Grid01-CfCG1RrY.js} +1 -1
  29. package/dist/client/assets/{Hash02-B-r__uQj.js → Hash02-B4zt7eqf.js} +1 -1
  30. package/dist/client/assets/{Home02-P9zxIWnB.js → Home02-BgWCBPhH.js} +1 -1
  31. package/dist/client/assets/{Image01-CyQ-9pmM.js → Image01-B8svV61f.js} +1 -1
  32. package/dist/client/assets/{Inbox01-DUxLR6jm.js → Inbox01-DktY8c3P.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-ORvzz6Jj.js → InfoCircle-DDBpFLdR.js} +1 -1
  34. package/dist/client/assets/{Key01-B3LfJVTz.js → Key01-eAlJ77G3.js} +1 -1
  35. package/dist/client/assets/{LayersTwo01-D0hB1mlt.js → LayersTwo01-Cre7WmYe.js} +1 -1
  36. package/dist/client/assets/{LayoutLeft-CIizJ9p-.js → LayoutLeft-BdPuu6bH.js} +1 -1
  37. package/dist/client/assets/{LinkExternal01-zIQsCZyp.js → LinkExternal01-1-7TA6Ra.js} +1 -1
  38. package/dist/client/assets/{List-Dy03iFlP.js → List-uQZNVPQ-.js} +1 -1
  39. package/dist/client/assets/{Loading01-DvHkBn5K.js → Loading01-DUUFtL7S.js} +1 -1
  40. package/dist/client/assets/{Lock01-b36hjLYg.js → Lock01-BqRcOfbm.js} +1 -1
  41. package/dist/client/assets/{Play-B4gSKcOc.js → Play-DTlFqxwD.js} +1 -1
  42. package/dist/client/assets/{Plus-C48LE9QF.js → Plus-2wrCLrAD.js} +1 -1
  43. package/dist/client/assets/{RefreshCcw01-B_P3Otqi.js → RefreshCcw01-CmQ_Zyfb.js} +1 -1
  44. package/dist/client/assets/{Rows03-RYFV31vk.js → Rows03-CeP6X8F6.js} +1 -1
  45. package/dist/client/assets/{Save01-C9eXS7Z1.js → Save01-Cq59fc-a.js} +1 -1
  46. package/dist/client/assets/{SearchMd-Bec1mZCp.js → SearchMd-DOdaT51-.js} +1 -1
  47. package/dist/client/assets/{Settings01-CGjDKLLq.js → Settings01-jEDDrq49.js} +1 -1
  48. package/dist/client/assets/{Shield01-QPvxKI9B.js → Shield01-_lpY_BlD.js} +1 -1
  49. package/dist/client/assets/{Terminal-Dg9FTns0.js → Terminal-CZIzfu4H.js} +1 -1
  50. package/dist/client/assets/{Trash01-DfwWsbuW.js → Trash01-DJpn1VG4.js} +1 -1
  51. package/dist/client/assets/{Upload01-CBnp-ZgO.js → Upload01-c6QpJwvP.js} +1 -1
  52. package/dist/client/assets/{Users03-zNQ-U5kI.js → Users03--eiqKjb_.js} +1 -1
  53. package/dist/client/assets/{X-BaOBrQh9.js → X-BGHsyt4s.js} +1 -1
  54. package/dist/client/assets/{XCircle-CGBoiIiF.js → XCircle-BJSW1V34.js} +1 -1
  55. package/dist/client/assets/{XClose-D5oa0b17.js → XClose-CYrOe1GU.js} +1 -1
  56. package/dist/client/assets/{Zap-B8kjj6jV.js → Zap-Div5wKlF.js} +1 -1
  57. package/dist/client/assets/{agent-connections-preview-CpRlCZek.js → agent-connections-preview-B33aUr8j.js} +1 -1
  58. package/dist/client/assets/agent-detail-B1r6DbgP.js +2 -0
  59. package/dist/client/assets/agents--1wlh1On.js +1 -0
  60. package/dist/client/assets/{alert-dialog-CHhoNaC0.js → alert-dialog-WtbKGn3h.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-Bks-N8b9.js → auth-catchall-C-FIrDOU.js} +1 -1
  62. package/dist/client/assets/{avatar-DX9xarA9.js → avatar-C0Za2Leb.js} +1 -1
  63. package/dist/client/assets/{badge-CMOYVtO8.js → badge-zns1OAW0.js} +1 -1
  64. package/dist/client/assets/{binder-CN-yhtfQ.js → binder-C2Kwp5aI.js} +1 -1
  65. package/dist/client/assets/{breadcrumb-CtNnsyqL.js → breadcrumb-BF7wgZMj.js} +1 -1
  66. package/dist/client/assets/{card-BECXECFc.js → card-yVoc5Dl_.js} +1 -1
  67. package/dist/client/assets/{chart-CA07zGfe.js → chart-C09J-0j8.js} +1 -1
  68. package/dist/client/assets/{checkbox-Bs5NWE_x.js → checkbox-C_yzLnRo.js} +1 -1
  69. package/dist/client/assets/{circle-alert-CEhC-Q81.js → circle-alert-DEWKfuYJ.js} +1 -1
  70. package/dist/client/assets/collapsible-e1478K7w.js +23 -0
  71. package/dist/client/assets/{collection-detail-CNXxywSm.js → collection-detail-12bPsl9i.js} +3 -3
  72. package/dist/client/assets/{collection-search-aEfiIRVT.js → collection-search-g7bCyEl4.js} +1 -1
  73. package/dist/client/assets/collection-tab-hxaftEha.js +1 -0
  74. package/dist/client/assets/{collection-table-wrapper-hM0ppyEG.js → collection-table-wrapper-Bx_0GgHe.js} +1 -1
  75. package/dist/client/assets/{collection-tabs-Dc6gZtTz.js → collection-tabs-CGvjmn7e.js} +1 -1
  76. package/dist/client/assets/{command-DI3JwfrE.js → command-DvXRXkaf.js} +1 -1
  77. package/dist/client/assets/{connect-C0SuJwzK.js → connect-BHcfLUsx.js} +1 -1
  78. package/dist/client/assets/{connection-card-CzCUOjTN.js → connection-card-Of-LfoL9.js} +1 -1
  79. package/dist/client/assets/connection-detail-Bfp_CthH.js +1 -0
  80. package/dist/client/assets/connections-CMRFgF2z.js +1 -0
  81. package/dist/client/assets/constants-BMZNxJu4.js +1 -0
  82. package/dist/client/assets/{constants-0JLhMmM7.js → constants-DLWxw8L_.js} +1 -1
  83. package/dist/client/assets/{create-organization-dialog-BRKsH8XB.js → create-organization-dialog-DHmNDQVx.js} +1 -1
  84. package/dist/client/assets/{create-project-dialog-BUAUU3kY.js → create-project-dialog-BURFxz7l.js} +1 -1
  85. package/dist/client/assets/{danger--r_qw5of.js → danger-D0vNOgTj.js} +1 -1
  86. package/dist/client/assets/{danger-zone-fH4LWpAE.js → danger-zone-Dhz8OLxh.js} +1 -1
  87. package/dist/client/assets/decopilot-events-C1i2IOcF.js +1 -0
  88. package/dist/client/assets/{dependencies-CfLZZ12D.js → dependencies-DQgcVkpb.js} +1 -1
  89. package/dist/client/assets/{dialog-CzmRWg_H.js → dialog-B8ODwZHJ.js} +1 -1
  90. package/dist/client/assets/{dropdown-menu-bZQdGgsX.js → dropdown-menu-Bv0kDZGf.js} +1 -1
  91. package/dist/client/assets/{dynamic-plugin-layout-B44KCK2N.js → dynamic-plugin-layout-CfJ2iWdk.js} +1 -1
  92. package/dist/client/assets/editable-task-title-BECK0S9m.js +16 -0
  93. package/dist/client/assets/{empty-state-BuKC-FeY.js → empty-state-CS91-o6R.js} +1 -1
  94. package/dist/client/assets/{env-vars-editor-BUYd05S1.js → env-vars-editor-BoUKrNdn.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-CDK2P3aY.js → extract-connection-data-DPrPXrw7.js} +1 -1
  96. package/dist/client/assets/{file-browser-B8HL2Mki.js → file-browser-Dyg6fn_p.js} +2 -2
  97. package/dist/client/assets/{form-EW4LFI0z.js → form-Bqy3P0kv.js} +1 -1
  98. package/dist/client/assets/{general-B-SJAejg.js → general-CcOfiluy.js} +1 -1
  99. package/dist/client/assets/{grid-view-B2G72x7D.js → grid-view-uc2-Xd10.js} +1 -1
  100. package/dist/client/assets/{home-C_Jstend.js → home-DYjBdnSm.js} +1 -1
  101. package/dist/client/assets/{index-RIE02s6T.js → index-1pfseT2B.js} +1 -1
  102. package/dist/client/assets/{index-BeKO7nFo.js → index-5XdaBbnC.js} +1 -1
  103. package/dist/client/assets/{index-hfshaOuF.js → index-B1uFfuid.js} +1 -1
  104. package/dist/client/assets/{index-gksA6r5d.js → index-BLvVZqmB.js} +1 -1
  105. package/dist/client/assets/{index-kE57LLiG.js → index-Br7gqIns.js} +22 -22
  106. package/dist/client/assets/{index-Cp50RRud.js → index-CLZkaGlC.js} +1 -1
  107. package/dist/client/assets/index-CUEtQJPr.css +1 -0
  108. package/dist/client/assets/index-CjU9lWJN.js +1 -0
  109. package/dist/client/assets/{index-CzFqQvXW.js → index-DVHuYwO5.js} +4 -4
  110. package/dist/client/assets/{index-V5ecgDUm.js → index-tDb6lai2.js} +1 -1
  111. package/dist/client/assets/{infiniteQueryObserver-B0QSZ6Wg.js → infiniteQueryObserver-BU31NXJd.js} +1 -1
  112. package/dist/client/assets/{input-Rcf9et7W.js → input-CImrwNsE.js} +1 -1
  113. package/dist/client/assets/{integration-icon-Cr629JYK.js → integration-icon-CqdgwTQM.js} +1 -1
  114. package/dist/client/assets/{label-DdGHGWov.js → label-BEcdY3zl.js} +1 -1
  115. package/dist/client/assets/{layout-CUeJn5m4.js → layout-Cegg55DQ.js} +1 -1
  116. package/dist/client/assets/{layout-DvurrRZC.js → layout-D1FJR7dQ.js} +1 -1
  117. package/dist/client/assets/localstorage-keys-B3yhvN27.js +1 -0
  118. package/dist/client/assets/{login-C70j40x2.js → login-gpMZSjc_.js} +1 -1
  119. package/dist/client/assets/{markdown-BsZjpnFH.js → markdown-DigmZCi5.js} +1 -1
  120. package/dist/client/assets/{mcp-app-renderer-aRjr0jcc.js → mcp-app-renderer-elbh_bK3.js} +1 -1
  121. package/dist/client/assets/{mcp-oauth-Dk3osgIf.js → mcp-oauth-BJK3oSr3.js} +1 -1
  122. package/dist/client/assets/{mcp-server-card-znSfWcaP.js → mcp-server-card-B_3KckAV.js} +1 -1
  123. package/dist/client/assets/{mcp-server-detail-Csm9j29j.js → mcp-server-detail-BGmK7vBO.js} +2 -2
  124. package/dist/client/assets/{members-WbcVb7yX.js → members-DkvmaHrL.js} +1 -1
  125. package/dist/client/assets/{monitoring-dashboard-edit-ChxkdsCv.js → monitoring-dashboard-edit-Dq449CGn.js} +1 -1
  126. package/dist/client/assets/{monitoring-dashboard-view-CL8P3Zx7.js → monitoring-dashboard-view-KyEbCseW.js} +2 -2
  127. package/dist/client/assets/{monitoring-Dth-Uzfq.js → monitoring-mMb4oyh8.js} +2 -2
  128. package/dist/client/assets/{oauth-callback-CXzK_RYv.js → oauth-callback-BWIw_10O.js} +1 -1
  129. package/dist/client/assets/page-LuWQuTOB.js +1 -0
  130. package/dist/client/assets/{page-CCrDZNhS.js → page-MLghIZgZ.js} +1 -1
  131. package/dist/client/assets/{plugin-empty-state-D7gmiZlA.js → plugin-empty-state-BYi0xCDZ.js} +1 -1
  132. package/dist/client/assets/{plugin-empty-state-BIuYztei.js → plugin-empty-state-CfkX75Qn.js} +1 -1
  133. package/dist/client/assets/{plugin-header-BLBENlfU.js → plugin-header-Bpxodj_N.js} +1 -1
  134. package/dist/client/assets/{plugin-header-CmlDS_hv.js → plugin-header-C8NyMNoe.js} +1 -1
  135. package/dist/client/assets/plugins-VAc5tGcP.js +1 -0
  136. package/dist/client/assets/{popover-C5F2AcFP.js → popover-R_PT2IPW.js} +1 -1
  137. package/dist/client/assets/{project-app-view-NryMJvXO.js → project-app-view-Bai-Qf0R.js} +1 -1
  138. package/dist/client/assets/project-layout-daZ99y7q.js +1 -0
  139. package/dist/client/assets/{project-plugins-QbLHCPXi.js → project-plugins-D9btRO1g.js} +1 -1
  140. package/dist/client/assets/{projects-list-B_wyuNYf.js → projects-list-DLyGtlCx.js} +1 -1
  141. package/dist/client/assets/{ranking-layout-CVBOyQIw.js → ranking-layout-Difw19Tu.js} +1 -1
  142. package/dist/client/assets/{readme-viewer-BmxWIpiS.js → readme-viewer-DMIs62Jq.js} +1 -1
  143. package/dist/client/assets/{registry-layout-DHUM9TZu.js → registry-layout-DUQv-gnE.js} +1 -1
  144. package/dist/client/assets/{registry-utils-DRX9Fl5Z.js → registry-utils-BL3Z-ZuV.js} +1 -1
  145. package/dist/client/assets/{reports-layout-GUNpInzx.js → reports-layout-DOweGRAi.js} +1 -1
  146. package/dist/client/assets/{reset-password-C_jAWNzd.js → reset-password-gTGJs4eA.js} +1 -1
  147. package/dist/client/assets/{resizable-CmbMtBt6.js → resizable-C-gCkuLt.js} +1 -1
  148. package/dist/client/assets/{save-actions-CH-zbfme.js → save-actions-CdZGxDIR.js} +1 -1
  149. package/dist/client/assets/{scroll-area-B5BKtcc-.js → scroll-area-DsCd8vj6.js} +1 -1
  150. package/dist/client/assets/{select-CSl7KVC3.js → select-CZ5oa2ZG.js} +1 -1
  151. package/dist/client/assets/shell-layout-D95AudRc.js +3 -0
  152. package/dist/client/assets/{sidebar-settings-98pHpdNk.js → sidebar-settings-DoYo5_2f.js} +1 -1
  153. package/dist/client/assets/{skeleton-BGGjmBE-.js → skeleton-DIOpAjh1.js} +1 -1
  154. package/dist/client/assets/{spinner-BubUCjpb.js → spinner-B-yGP95y.js} +1 -1
  155. package/dist/client/assets/{store-invite-BidZUMAQ.js → store-invite-COyr13nI.js} +1 -1
  156. package/dist/client/assets/{switch-D_s2nP_j.js → switch-C_rwAMG7.js} +1 -1
  157. package/dist/client/assets/{table-C7IfzCau.js → table-BwN-DdG1.js} +1 -1
  158. package/dist/client/assets/tabs-CTOkjsDF.js +1 -0
  159. package/dist/client/assets/tasks-CxbK_rAM.js +1 -0
  160. package/dist/client/assets/tasks-panel-CI07RnJW.js +1 -0
  161. package/dist/client/assets/{textarea-CumbsokS.js → textarea-BOlS_fKd.js} +1 -1
  162. package/dist/client/assets/{time-range-picker-Brh1Ym1N.js → time-range-picker-DWAp9G7R.js} +4 -4
  163. package/dist/client/assets/{toggle-group-DaSKpJH5.js → toggle-group-CRwxfPk7.js} +1 -1
  164. package/dist/client/assets/{tools-list-BvNNjQQL.js → tools-list-CQrrEoBF.js} +1 -1
  165. package/dist/client/assets/{tooltip-BGn6dJhi.js → tooltip-BsUirxUt.js} +1 -1
  166. package/dist/client/assets/{topbar-portal-mNbAP1zZ.js → topbar-portal-Cy4hr4gX.js} +1 -1
  167. package/dist/client/assets/{types-CnosXlf3.js → types-gEqZqH3b.js} +1 -1
  168. package/dist/client/assets/{use-binding-Ctbwf5zu.js → use-binding-Dx_NAnJa.js} +1 -1
  169. package/dist/client/assets/{use-connection-CmCfM9T5.js → use-connection-CwB1S0Lk.js} +1 -1
  170. package/dist/client/assets/{use-copy-Dn5NzC6Z.js → use-copy-uCRP4yn6.js} +1 -1
  171. package/dist/client/assets/{use-create-virtual-mcp-b6Af6scy.js → use-create-virtual-mcp-Bm7L9HAR.js} +1 -1
  172. package/dist/client/assets/{use-install-from-registry-D4coW5d-.js → use-install-from-registry-CMYlie1K.js} +1 -1
  173. package/dist/client/assets/use-list-state-EN77XpOY.js +1 -0
  174. package/dist/client/assets/{use-llm-CPv795TN.js → use-llm-C5Q0H0cZ.js} +1 -1
  175. package/dist/client/assets/{use-mcp-resources--6yZ25c2.js → use-mcp-resources-kkSzYGiM.js} +1 -1
  176. package/dist/client/assets/{use-mcp-tools-BTHDM3P3.js → use-mcp-tools-CT-LTM8z.js} +1 -1
  177. package/dist/client/assets/{use-members-Dzw-FOpA.js → use-members-CYCHCBAZ.js} +1 -1
  178. package/dist/client/assets/{use-mobile-DIBT-lEk.js → use-mobile-Bot_hVI8.js} +1 -1
  179. package/dist/client/assets/{use-project-Bd8syAM2.js → use-project-C5wS8512.js} +1 -1
  180. package/dist/client/assets/{use-settings-modal-D-rqbyuf.js → use-settings-modal-TyiexX8v.js} +1 -1
  181. package/dist/client/assets/{use-view-mode-k6uWDVq8.js → use-view-mode-CS5zZIj8.js} +1 -1
  182. package/dist/client/assets/{use-virtual-mcp-CaM9kbfY.js → use-virtual-mcp-CGnbrFrJ.js} +1 -1
  183. package/dist/client/assets/useInfiniteQuery-CutnJ4kj.js +1 -0
  184. package/dist/client/assets/{useMutation-DsQcwaJP.js → useMutation-BskhtN65.js} +1 -1
  185. package/dist/client/assets/useQuery-CxvwMb--.js +1 -0
  186. package/dist/client/assets/useSuspenseInfiniteQuery-DrLfXfJc.js +1 -0
  187. package/dist/client/assets/user-BRVh4xuS.js +1 -0
  188. package/dist/client/assets/workflow-D7s-e1ZH.js +1 -0
  189. package/dist/client/index.html +2 -2
  190. package/dist/server/cli.js +2 -1
  191. package/dist/server/server.js +2 -1
  192. package/package.json +1 -1
  193. package/dist/client/assets/AlertOctagon-Y8Xx5Uc4.js +0 -1
  194. package/dist/client/assets/agent-detail-ge8lRsMy.js +0 -2
  195. package/dist/client/assets/agents-CYp6eaDL.js +0 -1
  196. package/dist/client/assets/collapsible-KhZqz8s6.js +0 -1
  197. package/dist/client/assets/collection-tab-ByOYG4eu.js +0 -1
  198. package/dist/client/assets/connection-detail-FUvYBL_f.js +0 -1
  199. package/dist/client/assets/connections-CZWiV45b.js +0 -1
  200. package/dist/client/assets/constants-BnCnMsvC.js +0 -1
  201. package/dist/client/assets/context-CnW_lI9R.js +0 -23
  202. package/dist/client/assets/decopilot-events-Brt4gAR6.js +0 -1
  203. package/dist/client/assets/editable-thread-title-BT5MJN2M.js +0 -16
  204. package/dist/client/assets/index-Bl1kPuE1.css +0 -1
  205. package/dist/client/assets/index-CLgM5v39.js +0 -1
  206. package/dist/client/assets/localstorage-keys-DtK7peUq.js +0 -1
  207. package/dist/client/assets/page-JQWUx5cS.js +0 -1
  208. package/dist/client/assets/plugins-kPtsND7u.js +0 -1
  209. package/dist/client/assets/project-layout-CDz2d0hE.js +0 -1
  210. package/dist/client/assets/shell-layout-DH6hyOML.js +0 -3
  211. package/dist/client/assets/tabs-BzChyqs4.js +0 -1
  212. package/dist/client/assets/tasks-fA5J94Ed.js +0 -1
  213. package/dist/client/assets/use-list-state-pp-Ywt5d.js +0 -1
  214. package/dist/client/assets/use-mcp-prompts-Bvv0Gku4.js +0 -1
  215. package/dist/client/assets/use-preferences-fTjyFgCz.js +0 -1
  216. package/dist/client/assets/useInfiniteQuery-BRjF-D1B.js +0 -1
  217. package/dist/client/assets/useQuery-BE7O7fKt.js +0 -1
  218. package/dist/client/assets/useSuspenseInfiniteQuery-BSW1dpRq.js +0 -1
  219. package/dist/client/assets/workflow-BfURwr1_.js +0 -1
@@ -1 +1 @@
1
- import{r as C,c as we,e as Be,j as t,$ as Fe,E as Te,u as Ee,m as Me,n as Re,K as ve,aD as ze,B as re,t as pe}from"./index-CzFqQvXW.js";import{h as $e}from"./use-connection-CmCfM9T5.js";import{u as Oe,a as Ae}from"./constants-0JLhMmM7.js";import{I as le}from"./input-Rcf9et7W.js";import{I as ke}from"./integration-icon-Cr629JYK.js";import{C as We}from"./checkbox-Bs5NWE_x.js";import{a as Le,b as Ve,P as Ue}from"./popover-C5F2AcFP.js";import{i as Ge}from"./AlignLeft-C1Pd8crU.js";import{t as Ie}from"./ChevronDown-CxLgy5uI.js";import{S as je,a as be,b as ye,c as Ne,d as w,n as Ke}from"./select-CSl7KVC3.js";import{s as qe}from"./Hash02-B-r__uQj.js";import{i as He}from"./Play-B4gSKcOc.js";import{s as Qe}from"./Plus-C48LE9QF.js";import{s as Je}from"./Trash01-DfwWsbuW.js";import{T as Ye,a as Se}from"./toggle-group-DaSKpJH5.js";import{a as Ze,V as Xe}from"./layout-DvurrRZC.js";import{S as et}from"./save-actions-CH-zbfme.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-CtNnsyqL.js";import"./useMutation-DsQcwaJP.js";import"./Container-CH2V2ATa.js";import"./Check-BGWNBpXb.js";import"./index-gksA6r5d.js";import"./index-BeKO7nFo.js";import"./localstorage-keys-DtK7peUq.js";import"./useQuery-BE7O7fKt.js";import"./tooltip-BGn6dJhi.js";import"./Save01-C9eXS7Z1.js";import"./Loading01-DvHkBn5K.js";import"./ChevronRight-B-dZm0Fo.js";const _e=({size:l=24,color:e="currentColor",...s})=>C.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},C.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const x=s.matchedRecords??0;let h;e[6]!==x?(h=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[x," records matched"]}),e[6]=x,e[7]=h):h=e[7];let f;return e[8]!==m||e[9]!==h?(f=t.jsxs("div",{className:"text-center py-4",children:[m,h]}),e[8]=m,e[9]=h,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let x;return e[18]!==c||e[19]!==m?(x=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=x):x=e[20],x}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,N)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},N),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let x;e[30]!==s.timeseries.length?(x=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=x):x=e[31];let h;return e[32]!==m||e[33]!==x?(h=t.jsxs("div",{className:"py-2",children:[m,x]}),e[32]=m,e[33]=x,e[34]=h):h=e[34],h}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:x,onPreview:h,previewResult:f,isPreviewing:u}=l,N=!m;let z;e[0]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Ke,{size:14}),e[0]=z):z=e[0];let D;e[1]!==d||e[2]!==N?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:N,children:z}),e[1]=d,e[2]=N,e[3]=D):D=e[3];const ae=!x;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ie,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let S;e[11]!==s.type?(S=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=S):S=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let _;e[15]!==k||e[16]!==S||e[17]!==F?(_=t.jsxs("div",{className:"flex items-center gap-2",children:[k,S,F]}),e[15]=k,e[16]=S,e[17]=F,e[18]=_):_=e[18];let P;e[19]!==u?(P=u?t.jsx(Fe,{size:14,className:"animate-spin"}):t.jsx(He,{size:14}),e[19]=u,e[20]=P):P=e[20];let B;e[21]!==u||e[22]!==h||e[23]!==P?(B=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:h,disabled:u,children:P}),e[21]=u,e[22]=h,e[23]=P,e[24]=B):B=e[24];const $=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let O;e[27]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Je,{size:14}),e[27]=O):O=e[27];let E;e[28]!==j||e[29]!==$||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:$,style:T,children:O}),e[28]=j,e[29]=$,e[30]=T,e[31]=E):E=e[31];let M;e[32]!==B||e[33]!==E?(M=t.jsxs("div",{className:"flex items-center gap-1",children:[B,E]}),e[32]=B,e[33]=E,e[34]=M):M=e[34];let R;e[35]!==_||e[36]!==M?(R=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[_,M]}),e[35]=_,e[36]=M,e[37]=R):R=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let y;e[46]!==o||e[47]!==s?(y=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=y):y=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(qe,{size:14})}),e[49]=I):I=e[49];let A;e[50]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=A):A=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Ge,{size:14})}),e[51]=ne):ne=e[51];let W;e[52]!==y||e[53]!==s.type?(W=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:y,className:"w-full h-10",children:[I,A,ne]})]}),e[52]=y,e[53]=s.type,e[54]=W):W=e[54];let L;e[55]!==n||e[56]!==W?(L=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,W]}),e[55]=n,e[56]=W,e[57]=L):L=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let G;e[65]!==s.sourceFrom?(G=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=G):G=e[66];let K;e[67]!==U||e[68]!==G?(K=t.jsxs("div",{children:[oe,U,G]}),e[67]=U,e[68]=G,e[69]=K):K=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let q;e[71]!==o||e[72]!==s?(q=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=q):q=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let H;e[76]!==q||e[77]!==s.sourceFrom?(H=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:q,children:[me,de]})]}),e[76]=q,e[77]=s.sourceFrom,e[78]=H):H=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let xe;e[83]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=xe):xe=e[83];let he;e[84]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=he):he=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[xe,he]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==H||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[H,J]}),e[88]=H,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==L||e[98]!==K||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[L,K,Y,Z,X]}),e[97]=L,e[98]=K,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==R||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[R,se]}),e[110]=R,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=Ee(),j=Me(),i=Oe({connectionId:Ae,orgId:e.id}),d=$e(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,x]=C.useState(c?.name??""),[h,f]=C.useState(c?.description??""),[u,N]=C.useState(c?.widgets?.map(De)??[{...Ce}]),[z,D]=C.useState(!1),[ae,g]=C.useState(!1),[p,k]=C.useState(c?.filters?.connectionIds??[]),[S,F]=C.useState(c?.filters?.toolNames?.[0]??""),[_,P]=C.useState({}),[B,$]=C.useState(new Set),ie=()=>{N([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{N(u.filter((a,n)=>n!==r)),g(!0)},O=(r,a)=>{const n=[...u];n[r]=a,N(n),g(!0),P(v=>{const y={...v};return delete y[a.id],y})},E=async r=>{if(i){$(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),S.trim()&&(v.toolNames=[S.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(A=>({...A,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{$(a=>{const n=new Set(a);return n.delete(r.id),n})}}},M=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),S.trim()&&(r.toolNames=[S.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:h.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const R=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ze,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:R,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:M,onUndo:()=>{x(c?.name??""),f(c?.description??""),N(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:z})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{x(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:h,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Ie,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ue,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx(We,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:S,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>O(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],y=n[a];n[a-1]=y,n[a]=v,N(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],y=n[a+1];n[a]=y,n[a+1]=v,N(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:_[r.id]??null,isPreviewing:B.has(r.id)},r.id))})]})]})})]})}function Wt(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Be(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Fe,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(Te,{fallback:o,children:t.jsx(C.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Wt as default};
1
+ import{r as C,c as we,e as Be,j as t,$ as Fe,E as Te,u as Ee,n as Me,m as Re,K as ve,aD as ze,B as re,t as pe}from"./index-DVHuYwO5.js";import{h as $e}from"./use-connection-CwB1S0Lk.js";import{u as Oe,a as Ae}from"./constants-DLWxw8L_.js";import{I as le}from"./input-CImrwNsE.js";import{I as ke}from"./integration-icon-CqdgwTQM.js";import{C as We}from"./checkbox-C_yzLnRo.js";import{a as Le,b as Ve,P as Ue}from"./popover-R_PT2IPW.js";import{i as Ge}from"./AlignLeft-CRHzRLnb.js";import{t as Ie}from"./ChevronDown-BPvdqfh0.js";import{S as je,a as be,b as ye,c as Ne,d as w,n as Ke}from"./select-CZ5oa2ZG.js";import{s as qe}from"./Hash02-B4zt7eqf.js";import{i as He}from"./Play-DTlFqxwD.js";import{s as Qe}from"./Plus-2wrCLrAD.js";import{s as Je}from"./Trash01-DJpn1VG4.js";import{T as Ye,a as Se}from"./toggle-group-CRwxfPk7.js";import{a as Ze,V as Xe}from"./layout-D1FJR7dQ.js";import{S as et}from"./save-actions-CdZGxDIR.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-BF7wgZMj.js";import"./useMutation-BskhtN65.js";import"./Container-BcN3rU1W.js";import"./Check-llxZXJNk.js";import"./index-BLvVZqmB.js";import"./index-5XdaBbnC.js";import"./localstorage-keys-B3yhvN27.js";import"./useQuery-CxvwMb--.js";import"./tooltip-BsUirxUt.js";import"./Save01-Cq59fc-a.js";import"./Loading01-DUUFtL7S.js";import"./ChevronRight-bI92hTEK.js";const _e=({size:l=24,color:e="currentColor",...s})=>C.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},C.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const x=s.matchedRecords??0;let h;e[6]!==x?(h=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[x," records matched"]}),e[6]=x,e[7]=h):h=e[7];let f;return e[8]!==m||e[9]!==h?(f=t.jsxs("div",{className:"text-center py-4",children:[m,h]}),e[8]=m,e[9]=h,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let x;return e[18]!==c||e[19]!==m?(x=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=x):x=e[20],x}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,N)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},N),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let x;e[30]!==s.timeseries.length?(x=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=x):x=e[31];let h;return e[32]!==m||e[33]!==x?(h=t.jsxs("div",{className:"py-2",children:[m,x]}),e[32]=m,e[33]=x,e[34]=h):h=e[34],h}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:x,onPreview:h,previewResult:f,isPreviewing:u}=l,N=!m;let z;e[0]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Ke,{size:14}),e[0]=z):z=e[0];let D;e[1]!==d||e[2]!==N?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:N,children:z}),e[1]=d,e[2]=N,e[3]=D):D=e[3];const ae=!x;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ie,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let S;e[11]!==s.type?(S=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=S):S=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let _;e[15]!==k||e[16]!==S||e[17]!==F?(_=t.jsxs("div",{className:"flex items-center gap-2",children:[k,S,F]}),e[15]=k,e[16]=S,e[17]=F,e[18]=_):_=e[18];let P;e[19]!==u?(P=u?t.jsx(Fe,{size:14,className:"animate-spin"}):t.jsx(He,{size:14}),e[19]=u,e[20]=P):P=e[20];let B;e[21]!==u||e[22]!==h||e[23]!==P?(B=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:h,disabled:u,children:P}),e[21]=u,e[22]=h,e[23]=P,e[24]=B):B=e[24];const $=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let O;e[27]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Je,{size:14}),e[27]=O):O=e[27];let E;e[28]!==j||e[29]!==$||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:$,style:T,children:O}),e[28]=j,e[29]=$,e[30]=T,e[31]=E):E=e[31];let M;e[32]!==B||e[33]!==E?(M=t.jsxs("div",{className:"flex items-center gap-1",children:[B,E]}),e[32]=B,e[33]=E,e[34]=M):M=e[34];let R;e[35]!==_||e[36]!==M?(R=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[_,M]}),e[35]=_,e[36]=M,e[37]=R):R=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let y;e[46]!==o||e[47]!==s?(y=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=y):y=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(qe,{size:14})}),e[49]=I):I=e[49];let A;e[50]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=A):A=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Ge,{size:14})}),e[51]=ne):ne=e[51];let W;e[52]!==y||e[53]!==s.type?(W=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:y,className:"w-full h-10",children:[I,A,ne]})]}),e[52]=y,e[53]=s.type,e[54]=W):W=e[54];let L;e[55]!==n||e[56]!==W?(L=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,W]}),e[55]=n,e[56]=W,e[57]=L):L=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let G;e[65]!==s.sourceFrom?(G=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=G):G=e[66];let K;e[67]!==U||e[68]!==G?(K=t.jsxs("div",{children:[oe,U,G]}),e[67]=U,e[68]=G,e[69]=K):K=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let q;e[71]!==o||e[72]!==s?(q=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=q):q=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let H;e[76]!==q||e[77]!==s.sourceFrom?(H=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:q,children:[me,de]})]}),e[76]=q,e[77]=s.sourceFrom,e[78]=H):H=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let xe;e[83]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=xe):xe=e[83];let he;e[84]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=he):he=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[xe,he]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==H||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[H,J]}),e[88]=H,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==L||e[98]!==K||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[L,K,Y,Z,X]}),e[97]=L,e[98]=K,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==R||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[R,se]}),e[110]=R,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=Ee(),j=Me(),i=Oe({connectionId:Ae,orgId:e.id}),d=$e(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,x]=C.useState(c?.name??""),[h,f]=C.useState(c?.description??""),[u,N]=C.useState(c?.widgets?.map(De)??[{...Ce}]),[z,D]=C.useState(!1),[ae,g]=C.useState(!1),[p,k]=C.useState(c?.filters?.connectionIds??[]),[S,F]=C.useState(c?.filters?.toolNames?.[0]??""),[_,P]=C.useState({}),[B,$]=C.useState(new Set),ie=()=>{N([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{N(u.filter((a,n)=>n!==r)),g(!0)},O=(r,a)=>{const n=[...u];n[r]=a,N(n),g(!0),P(v=>{const y={...v};return delete y[a.id],y})},E=async r=>{if(i){$(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),S.trim()&&(v.toolNames=[S.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(A=>({...A,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{$(a=>{const n=new Set(a);return n.delete(r.id),n})}}},M=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),S.trim()&&(r.toolNames=[S.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:h.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const R=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ze,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:R,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:M,onUndo:()=>{x(c?.name??""),f(c?.description??""),N(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:z})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{x(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:h,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Ie,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ue,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx(We,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:S,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>O(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],y=n[a];n[a-1]=y,n[a]=v,N(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],y=n[a+1];n[a]=y,n[a+1]=v,N(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:_[r.id]??null,isPreviewing:B.has(r.id)},r.id))})]})]})})]})}function Wt(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Be(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Fe,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(Te,{fallback:o,children:t.jsx(C.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Wt as default};
@@ -1,4 +1,4 @@
1
- import{r as C,j as t,B as R,c as D,m as xe,$ as re,E as ge,u as fe,n as ne,K as oe,aD as pe,e as he,b as je}from"./index-CzFqQvXW.js";import{a as be,u as ye}from"./constants-0JLhMmM7.js";import{p as ee,a as ce,s as ve,b as Ne,e as me,i as we,T as ke}from"./time-range-picker-Brh1Ym1N.js";import{V as Se,a as $e}from"./layout-DvurrRZC.js";import{b as de,c as Ce,d as Fe,e as Re,B as De,a as Te}from"./breadcrumb-CtNnsyqL.js";import{B as _e}from"./badge-CMOYVtO8.js";import{I as ue}from"./input-Rcf9et7W.js";import{a as Pe,b as Ie,P as Me}from"./popover-C5F2AcFP.js";import{S as ze,a as Be,b as Ee,c as Oe,d as Ae}from"./select-CSl7KVC3.js";import{T as Ke}from"./textarea-CumbsokS.js";import{T as Le,a as Ve,b as qe}from"./tooltip-BGn6dJhi.js";import{i as Qe}from"./Code01-C4dpeKsY.js";import{i as We}from"./FilterLines-CR4t6v_B.js";import{c as Ge}from"./Grid01-C85povgK.js";import{s as He}from"./Plus-C48LE9QF.js";import{s as Ye}from"./Trash01-DfwWsbuW.js";import{s as Ue}from"./XClose-D5oa0b17.js";import"./Check-BGWNBpXb.js";import"./Copy01-Ba42JLNP.js";import"./Download01-x2RmdAQh.js";import"./Key01-B3LfJVTz.js";import"./Play-B4gSKcOc.js";import"./scroll-area-B5BKtcc-.js";import"./spinner-BubUCjpb.js";import"./ChevronDown-CxLgy5uI.js";import"./Clock-DjTfMWYb.js";import"./ChevronRight-B-dZm0Fo.js";import"./index-BeKO7nFo.js";import"./localstorage-keys-DtK7peUq.js";import"./useQuery-BE7O7fKt.js";import"./useMutation-DsQcwaJP.js";import"./index-gksA6r5d.js";const Je=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Xe({value:s,onChange:e}){const[r,i]=C.useState(!1),[l,n]=C.useState("raw"),[c,o]=C.useState(s),[m,d]=C.useState(ee(s)),g=C.useRef(s);g.current!==s&&(g.current=s,o(s),d(ee(s)));const f=()=>{e(c.filter(a=>a.key.trim()))},p=()=>{const a=ce(m);o(a),e(a)},j=()=>{if(l==="raw"){const a=ce(m);o(a),n("form")}else d(ee(c)),n("raw")},v=(a,x)=>{const u=[...c],h=u[a];h&&(u[a]={key:x.key??h.key,operator:x.operator??h.operator,value:x.value??h.value},o(u))},b=()=>{o([...c,{key:"",operator:"eq",value:""}])},w=a=>{const x=c.filter((u,h)=>h!==a);o(x),d(ee(x)),e(x.filter(u=>u.key.trim()))},y=()=>{o([]),d(""),e([]),i(!1)},k=s.filter(a=>a.key.trim()).length;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[s.filter(a=>a.key.trim()).map((a,x)=>{const u=a.operator==="exists"?`${a.key}?`:a.operator==="contains"?`${a.key}~${a.value}`:a.operator==="in"?`${a.key}@${a.value}`:`${a.key}=${a.value}`;return t.jsxs(_e,{variant:"secondary",className:"gap-1 pl-2 pr-1 h-7 text-xs font-mono font-normal cursor-default",children:[u,t.jsx("button",{type:"button",className:"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20 transition-colors",onClick:()=>{const h=s.filter(($,F)=>F!==x);e(h)},children:t.jsx(Ue,{size:12})})]},`${a.key}-${x}`)}),t.jsxs(Pe,{open:r,onOpenChange:i,children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(R,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),k===0?t.jsx("span",{className:"text-sm",children:"Filter"}):t.jsx("span",{className:"text-sm",children:k})]})}),t.jsxs(Me,{className:"w-[380px] p-4",align:"end",sideOffset:4,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Property Filters"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:l==="raw"?t.jsx(Ge,{size:14}):t.jsx(Qe,{size:14})})}),t.jsx(qe,{children:l==="raw"?"Switch to form view":"Switch to raw text"})]})]}),l==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ke,{placeholder:`Paste property filters here:
1
+ import{r as C,j as t,B as R,c as D,n as xe,$ as re,E as ge,u as fe,m as ne,K as oe,aD as pe,e as he,b as je}from"./index-DVHuYwO5.js";import{a as be,u as ye}from"./constants-DLWxw8L_.js";import{p as ee,a as ce,s as ve,b as Ne,e as me,i as we,T as ke}from"./time-range-picker-DWAp9G7R.js";import{V as Se,a as $e}from"./layout-D1FJR7dQ.js";import{b as de,c as Ce,d as Fe,e as Re,B as De,a as Te}from"./breadcrumb-BF7wgZMj.js";import{B as _e}from"./badge-zns1OAW0.js";import{I as ue}from"./input-CImrwNsE.js";import{a as Pe,b as Ie,P as Me}from"./popover-R_PT2IPW.js";import{S as ze,a as Be,b as Ee,c as Oe,d as Ae}from"./select-CZ5oa2ZG.js";import{T as Ke}from"./textarea-BOlS_fKd.js";import{T as Le,a as Ve,b as qe}from"./tooltip-BsUirxUt.js";import{i as Qe}from"./Code01-Cw3aSJX_.js";import{i as We}from"./FilterLines-C4D0sIiB.js";import{c as Ge}from"./Grid01-CfCG1RrY.js";import{s as He}from"./Plus-2wrCLrAD.js";import{s as Ye}from"./Trash01-DJpn1VG4.js";import{s as Ue}from"./XClose-CYrOe1GU.js";import"./Check-llxZXJNk.js";import"./Copy01-DOsfcAr7.js";import"./Download01-Dqv2OtJR.js";import"./Key01-eAlJ77G3.js";import"./Play-DTlFqxwD.js";import"./scroll-area-DsCd8vj6.js";import"./spinner-B-yGP95y.js";import"./ChevronDown-BPvdqfh0.js";import"./Clock-DCqyBdVg.js";import"./ChevronLeft-BmfUl3Br.js";import"./ChevronRight-bI92hTEK.js";import"./index-5XdaBbnC.js";import"./localstorage-keys-B3yhvN27.js";import"./useQuery-CxvwMb--.js";import"./useMutation-BskhtN65.js";import"./index-BLvVZqmB.js";const Je=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Xe({value:s,onChange:e}){const[r,i]=C.useState(!1),[l,n]=C.useState("raw"),[c,o]=C.useState(s),[m,d]=C.useState(ee(s)),g=C.useRef(s);g.current!==s&&(g.current=s,o(s),d(ee(s)));const f=()=>{e(c.filter(a=>a.key.trim()))},p=()=>{const a=ce(m);o(a),e(a)},j=()=>{if(l==="raw"){const a=ce(m);o(a),n("form")}else d(ee(c)),n("raw")},v=(a,x)=>{const u=[...c],h=u[a];h&&(u[a]={key:x.key??h.key,operator:x.operator??h.operator,value:x.value??h.value},o(u))},b=()=>{o([...c,{key:"",operator:"eq",value:""}])},w=a=>{const x=c.filter((u,h)=>h!==a);o(x),d(ee(x)),e(x.filter(u=>u.key.trim()))},y=()=>{o([]),d(""),e([]),i(!1)},k=s.filter(a=>a.key.trim()).length;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[s.filter(a=>a.key.trim()).map((a,x)=>{const u=a.operator==="exists"?`${a.key}?`:a.operator==="contains"?`${a.key}~${a.value}`:a.operator==="in"?`${a.key}@${a.value}`:`${a.key}=${a.value}`;return t.jsxs(_e,{variant:"secondary",className:"gap-1 pl-2 pr-1 h-7 text-xs font-mono font-normal cursor-default",children:[u,t.jsx("button",{type:"button",className:"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20 transition-colors",onClick:()=>{const h=s.filter(($,F)=>F!==x);e(h)},children:t.jsx(Ue,{size:12})})]},`${a.key}-${x}`)}),t.jsxs(Pe,{open:r,onOpenChange:i,children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(R,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),k===0?t.jsx("span",{className:"text-sm",children:"Filter"}):t.jsx("span",{className:"text-sm",children:k})]})}),t.jsxs(Me,{className:"w-[380px] p-4",align:"end",sideOffset:4,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Property Filters"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:l==="raw"?t.jsx(Ge,{size:14}):t.jsx(Qe,{size:14})})}),t.jsx(qe,{children:l==="raw"?"Switch to form view":"Switch to raw text"})]})]}),l==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ke,{placeholder:`Paste property filters here:
2
2
  thread_id=abc123
3
3
  user~test
4
- debug?`,value:m,onChange:a=>d(a.target.value),onBlur:p,onKeyDown:a=>{a.key==="Enter"&&a.metaKey&&p()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[c.map((a,x)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",x+1]}),t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>w(x),children:t.jsx(Ye,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ue,{placeholder:"Key (e.g., thread_id)",value:a.key,onChange:u=>v(x,{key:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"flex-1 font-mono text-sm"}),t.jsxs(ze,{value:a.operator,onValueChange:u=>{const h=[...c],$=h[x];$&&(h[x]={...$,operator:u,value:u==="exists"?"":$.value},o(h),e(h.filter(F=>F.key.trim())))},children:[t.jsx(Be,{className:"w-28",children:t.jsx(Ee,{})}),t.jsx(Oe,{children:Je.map(u=>t.jsx(Ae,{value:u.value,children:u.label},u.value))})]})]}),a.operator!=="exists"&&t.jsx(ue,{placeholder:"Value",value:a.value,onChange:u=>v(x,{value:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"w-full font-mono text-sm"})]},x)),t.jsxs(R,{variant:"outline",size:"sm",className:"w-full",onClick:b,children:[t.jsx(He,{size:14,className:"mr-1.5"}),"Add filter"]})]}),k>0&&t.jsx(R,{variant:"ghost",size:"sm",className:"w-full mt-3 text-muted-foreground",onClick:y,children:"Clear all filters"})]})]})]})}function G(s,e){return e||Number.isInteger(s)?s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString():s>=1e6?`${(s/1e6).toFixed(2)}M`:s>=1e3?`${(s/1e3).toFixed(2)}K`:s.toFixed(2)}function ae(s){return{sum:"Total",avg:"Average",min:"Minimum",max:"Maximum",count:"Count",last:"Latest"}[s]??s}function le(s){const e=D.c(7),{name:r,subtitle:i}=s;let l;e[0]!==r?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:r}),e[0]=r,e[1]=l):l=e[1];let n;e[2]!==i?(n=t.jsx("div",{className:"text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==l||e[5]!==n?(c=t.jsxs("div",{className:"px-4 py-3",children:[l,n]}),e[4]=l,e[5]=n,e[6]=c):c=e[6],c}function Ze(s){const e=D.c(13),{widget:r,result:i}=s,l=i?.value??0,n=r.aggregation.fn==="count",c=r.name;let o;e[0]!==r.aggregation.fn?(o=ae(r.aggregation.fn),e[0]=r.aggregation.fn,e[1]=o):o=e[1];let m;e[2]!==o||e[3]!==r.name?(m=t.jsx(le,{name:c,subtitle:o}),e[2]=o,e[3]=r.name,e[4]=m):m=e[4];let d;e[5]!==n||e[6]!==l?(d=G(l,n),e[5]=n,e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=t.jsx("div",{className:"px-4 pb-4 mt-auto",children:t.jsx("div",{className:"text-4xl font-bold tabular-nums",children:d})}),e[8]=d,e[9]=g):g=e[9];let f;return e[10]!==m||e[11]!==g?(f=t.jsxs("div",{className:"border rounded-lg bg-card flex flex-col h-full",children:[m,g]}),e[10]=m,e[11]=g,e[12]=f):f=e[12],f}function et(s){const e=D.c(15),{widget:r,result:i}=s;let l,n;e[0]!==i?.groups?(l=i?.groups??[],n=Math.max(...l.map(tt),1),e[0]=i?.groups,e[1]=l,e[2]=n):(l=e[1],n=e[2]);const c=n;let o;e[3]!==r.aggregation.fn||e[4]!==r.aggregation.groupBy?(o=r.aggregation.groupBy?`Grouped by ${r.aggregation.groupBy}`:ae(r.aggregation.fn),e[3]=r.aggregation.fn,e[4]=r.aggregation.groupBy,e[5]=o):o=e[5];let m;e[6]!==o||e[7]!==r.name?(m=t.jsx(le,{name:r.name,subtitle:o}),e[6]=o,e[7]=r.name,e[8]=m):m=e[8];let d;e[9]!==l||e[10]!==c?(d=t.jsx("div",{className:"max-h-[300px] overflow-auto",children:l.length===0?t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No data available for this query"}):t.jsx("div",{className:"divide-y",children:l.map(f=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[t.jsx("span",{className:"text-sm truncate flex-1 min-w-0",children:f.key||"(empty)"}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 w-32",children:[t.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${f.value/c*100}%`}})}),t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground w-10 text-right",children:G(f.value,!0)})]})]},f.key))})}),e[9]=l,e[10]=c,e[11]=d):d=e[11];let g;return e[12]!==m||e[13]!==d?(g=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden flex flex-col h-full",children:[m,d]}),e[12]=m,e[13]=d,e[14]=g):g=e[14],g}function tt(s){return s.value}function st(s){const e=D.c(37),{widget:r,result:i}=s;let l,n,c,o,m,d,g,f,p;if(e[0]!==i?.timeseries||e[1]!==r.aggregation.fn||e[2]!==r.aggregation.interval||e[3]!==r.name){p=i?.timeseries??[],n=Math.max(...p.map(at),1);const a=p.reduce(rt,0);l=r.aggregation.fn==="count",f="border rounded-lg bg-card overflow-hidden flex flex-col h-full",d="flex items-start justify-between pr-4";const x=r.name;let u;e[13]!==r.aggregation.fn?(u=ae(r.aggregation.fn),e[13]=r.aggregation.fn,e[14]=u):u=e[14];const h=`${u} per ${r.aggregation.interval}`;e[15]!==h||e[16]!==r.name?(g=t.jsx(le,{name:x,subtitle:h}),e[15]=h,e[16]=r.name,e[17]=g):g=e[17],m="text-right pt-3",c="text-lg font-semibold tabular-nums leading-tight",o=G(a,l),e[0]=i?.timeseries,e[1]=r.aggregation.fn,e[2]=r.aggregation.interval,e[3]=r.name,e[4]=l,e[5]=n,e[6]=c,e[7]=o,e[8]=m,e[9]=d,e[10]=g,e[11]=f,e[12]=p}else l=e[4],n=e[5],c=e[6],o=e[7],m=e[8],d=e[9],g=e[10],f=e[11],p=e[12];let j;e[18]!==c||e[19]!==o?(j=t.jsx("div",{className:c,children:o}),e[18]=c,e[19]=o,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"total"}),e[21]=v):v=e[21];let b;e[22]!==m||e[23]!==j?(b=t.jsxs("div",{className:m,children:[j,v]}),e[22]=m,e[23]=j,e[24]=b):b=e[24];let w;e[25]!==d||e[26]!==g||e[27]!==b?(w=t.jsxs("div",{className:d,children:[g,b]}),e[25]=d,e[26]=g,e[27]=b,e[28]=w):w=e[28];let y;e[29]!==l||e[30]!==n||e[31]!==p?(y=t.jsx("div",{className:"px-4 pb-3 flex-1 flex flex-col min-h-0",children:p.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No data available"}):t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("div",{className:"text-[10px] text-muted-foreground mb-1 tabular-nums",children:G(n,l)}),t.jsx("div",{className:"flex items-end gap-[2px] flex-1",children:p.map((a,x)=>t.jsx("div",{className:"group relative flex-1 bg-primary/70 rounded-t transition-all hover:bg-primary cursor-default",style:{height:`${a.value/n*100}%`,minHeight:a.value>0?"3px":"0px"},children:t.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-10 pointer-events-none",children:t.jsx("div",{className:"bg-foreground text-background text-[10px] px-1.5 py-0.5 rounded whitespace-nowrap tabular-nums",children:G(a.value,l)})})},x))}),t.jsx("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1.5 tabular-nums",children:p.length>0&&(()=>{const a=new Date(p[0].timestamp),x=new Date(p[p.length-1].timestamp),$=x.getTime()-a.getTime()>864e5?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a.toLocaleString([],$)}),t.jsx("span",{children:x.toLocaleString([],$)})]})})()})]})}),e[29]=l,e[30]=n,e[31]=p,e[32]=y):y=e[32];let k;return e[33]!==w||e[34]!==y||e[35]!==f?(k=t.jsxs("div",{className:f,children:[w,y]}),e[33]=w,e[34]=y,e[35]=f,e[36]=k):k=e[36],k}function rt(s,e){return s+e.value}function at(s){return s.value}function lt(s){const e=D.c(81),{dashboardId:r,timeRange:i,propertyFilters:l,onEdit:n,onRefresh:c,onTimeRangeChange:o,onPropertyFiltersChange:m}=s,{org:d,project:g,locator:f}=fe();let p;e[0]!==d.id?(p={connectionId:be,orgId:d.id},e[0]=d.id,e[1]=p):p=e[1];const j=ye(p);let v;e[2]!==r||e[3]!==f?(v=oe.monitoringDashboardDetails(f,r),e[2]=r,e[3]=f,e[4]=v):v=e[4];let b;e[5]!==j||e[6]!==r?(b=async()=>{if(!j)throw new Error("MCP client not available");const N=await j.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:r}});return N.structuredContent??N},e[5]=j,e[6]=r,e[7]=b):b=e[7];let w;e[8]!==v||e[9]!==b?(w={queryKey:v,queryFn:b},e[8]=v,e[9]=b,e[10]=w):w=e[10];const{data:y}=ne(w);let k,a,x;if(e[11]!==r||e[12]!==f||e[13]!==l||e[14]!==i.from||e[15]!==i.to){const N=l.filter(ot),S=ve(N);k=N.length>0?Ne(N):void 0,x=ne,a=oe.monitoringDashboardQuery(f,r,i.from,i.to,S||void 0),e[11]=r,e[12]=f,e[13]=l,e[14]=i.from,e[15]=i.to,e[16]=k,e[17]=a,e[18]=x}else k=e[16],a=e[17],x=e[18];let u;e[19]!==k||e[20]!==j||e[21]!==r||e[22]!==i.from||e[23]!==i.to?(u=async()=>{if(!j)throw new Error("MCP client not available");const N=me(i.from),S=me(i.to),W=N.date||new Date(Date.now()-864e5),se=S.date||new Date,ie=await j.callTool({name:"MONITORING_DASHBOARD_QUERY",arguments:{dashboardId:r,timeRange:{startDate:W.toISOString(),endDate:se.toISOString()},...k?{propertyFilters:k}:{}}});return ie.structuredContent??ie},e[19]=k,e[20]=j,e[21]=r,e[22]=i.from,e[23]=i.to,e[24]=u):u=e[24];let h;e[25]!==a||e[26]!==u?(h={queryKey:a,queryFn:u,refetchInterval:3e4},e[25]=a,e[26]=u,e[27]=h):h=e[27];const{data:$,isRefetching:F}=x(h);if(!y){let N;return e[28]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"}),e[28]=N):N=e[28],N}let H;e[29]!==$?.results?(H=new Map($?.results?.map(nt)??[]),e[29]=$?.results,e[30]=H):H=e[30];const Q=H;let T;e[31]!==d.slug||e[32]!==g.slug?(T={org:d.slug,project:g.slug},e[31]=d.slug,e[32]=g.slug,e[33]=T):T=e[33];let Y;e[34]===Symbol.for("react.memo_cache_sentinel")?(Y={tab:"dashboards"},e[34]=Y):Y=e[34];let _;e[35]!==T?(_=t.jsx(de,{children:t.jsx(Fe,{asChild:!0,children:t.jsx(pe,{to:"/$org/$project/monitoring",params:T,search:Y,children:"Monitoring"})})}),e[35]=T,e[36]=_):_=e[36];let U;e[37]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Re,{}),e[37]=U):U=e[37];let P;e[38]!==y.name?(P=t.jsx(de,{children:t.jsx(Ce,{children:y.name})}),e[38]=y.name,e[39]=P):P=e[39];let J;e[40]!==_||e[41]!==P?(J=t.jsx(De,{children:t.jsxs(Te,{children:[_,U,P]})}),e[40]=_,e[41]=P,e[42]=J):J=e[42];const te=J;let I;e[43]!==n?(I=n&&t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:n,children:t.jsx(we,{size:14})}),e[43]=n,e[44]=I):I=e[44];let X;e[45]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(re,{size:14}),e[45]=X):X=e[45];let M;e[46]!==c?(M=t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:c,children:X}),e[46]=c,e[47]=M):M=e[47];let z;e[48]!==m||e[49]!==l?(z=t.jsx(Xe,{value:l,onChange:m}),e[48]=m,e[49]=l,e[50]=z):z=e[50];let B;e[51]!==i.from||e[52]!==i.to?(B={from:i.from,to:i.to},e[51]=i.from,e[52]=i.to,e[53]=B):B=e[53];let E;e[54]!==o||e[55]!==B?(E=t.jsx(ke,{value:B,onChange:o,className:"min-w-0"}),e[54]=o,e[55]=B,e[56]=E):E=e[56];let O;e[57]!==I||e[58]!==M||e[59]!==z||e[60]!==E?(O=t.jsxs(Se,{children:[I,M,z,E]}),e[57]=I,e[58]=M,e[59]=z,e[60]=E,e[61]=O):O=e[61];let A;e[62]!==y.description?(A=y.description&&t.jsx("div",{className:"mb-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:y.description})}),e[62]=y.description,e[63]=A):A=e[63];let K;if(e[64]!==y.widgets||e[65]!==Q){let N;e[67]!==Q?(N=S=>{const W=Q.get(S.id),se=S.type==="metric"?"":"col-span-2";return t.jsxs("div",{className:se,children:[S.type==="metric"&&t.jsx(Ze,{widget:S,result:W}),S.type==="table"&&t.jsx(et,{widget:S,result:W}),S.type==="timeseries"&&t.jsx(st,{widget:S,result:W})]},S.id)},e[67]=Q,e[68]=N):N=e[68],K=y.widgets.map(N),e[64]=y.widgets,e[65]=Q,e[66]=K}else K=e[66];let L;e[69]!==K?(L=t.jsx("div",{className:"grid grid-cols-5 gap-4",ref:it,children:K}),e[69]=K,e[70]=L):L=e[70];let V;e[71]!==F?(V=F&&t.jsxs("div",{className:"fixed bottom-4 right-4 bg-background border rounded-lg px-3 py-2 shadow-lg flex items-center gap-2 text-sm",children:[t.jsx(re,{size:14,className:"animate-spin"}),"Refreshing..."]}),e[71]=F,e[72]=V):V=e[72];let q;e[73]!==A||e[74]!==L||e[75]!==V?(q=t.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[A,L,V]}),e[73]=A,e[74]=L,e[75]=V,e[76]=q):q=e[76];let Z;return e[77]!==te||e[78]!==O||e[79]!==q?(Z=t.jsxs($e,{breadcrumb:te,children:[O,q]}),e[77]=te,e[78]=O,e[79]=q,e[80]=Z):Z=e[80],Z}function it(s){if(!s)return;const e=()=>{const i=(s.clientWidth-64)/5;s.style.gridAutoRows=`${i}px`};e(),new ResizeObserver(e).observe(s)}function nt(s){return[s.widgetId,s]}function ot(s){return s.key.trim()}function ct(s){const e=D.c(13),{dashboardId:r,onEdit:i}=s,l=xe();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"now-24h",to:"now"},e[0]=n):n=e[0];const[c,o]=C.useState(n);let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[1]=m):m=e[1];const[d,g]=C.useState(m);let f;e[2]!==r||e[3]!==l?(f=()=>{l.invalidateQueries({predicate:w=>w.queryKey[0]==="monitoringDashboardQuery"&&w.queryKey[2]===r})},e[2]=r,e[3]=l,e[4]=f):f=e[4];const p=f;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard"}),e[5]=j):j=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})}),e[6]=v):v=e[6];let b;return e[7]!==r||e[8]!==p||e[9]!==i||e[10]!==d||e[11]!==c?(b=t.jsx(ge,{fallback:j,children:t.jsx(C.Suspense,{fallback:v,children:t.jsx(lt,{dashboardId:r,timeRange:c,propertyFilters:d,onEdit:i,onRefresh:p,onTimeRangeChange:o,onPropertyFiltersChange:g})})}),e[7]=r,e[8]=p,e[9]=i,e[10]=d,e[11]=c,e[12]=b):b=e[12],b}function Lt(){const s=D.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{dashboardId:r}=he(e),{org:i,project:l}=fe(),n=je();let c;s[1]!==r||s[2]!==n||s[3]!==i.slug||s[4]!==l.slug?(c=()=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:i.slug,project:l.slug,dashboardId:r}})},s[1]=r,s[2]=n,s[3]=i.slug,s[4]=l.slug,s[5]=c):c=s[5];const o=c;let m;return s[6]!==r||s[7]!==o?(m=t.jsx(ct,{dashboardId:r,onEdit:o}),s[6]=r,s[7]=o,s[8]=m):m=s[8],m}export{Lt as default};
4
+ debug?`,value:m,onChange:a=>d(a.target.value),onBlur:p,onKeyDown:a=>{a.key==="Enter"&&a.metaKey&&p()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[c.map((a,x)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",x+1]}),t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>w(x),children:t.jsx(Ye,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ue,{placeholder:"Key (e.g., thread_id)",value:a.key,onChange:u=>v(x,{key:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"flex-1 font-mono text-sm"}),t.jsxs(ze,{value:a.operator,onValueChange:u=>{const h=[...c],$=h[x];$&&(h[x]={...$,operator:u,value:u==="exists"?"":$.value},o(h),e(h.filter(F=>F.key.trim())))},children:[t.jsx(Be,{className:"w-28",children:t.jsx(Ee,{})}),t.jsx(Oe,{children:Je.map(u=>t.jsx(Ae,{value:u.value,children:u.label},u.value))})]})]}),a.operator!=="exists"&&t.jsx(ue,{placeholder:"Value",value:a.value,onChange:u=>v(x,{value:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"w-full font-mono text-sm"})]},x)),t.jsxs(R,{variant:"outline",size:"sm",className:"w-full",onClick:b,children:[t.jsx(He,{size:14,className:"mr-1.5"}),"Add filter"]})]}),k>0&&t.jsx(R,{variant:"ghost",size:"sm",className:"w-full mt-3 text-muted-foreground",onClick:y,children:"Clear all filters"})]})]})]})}function G(s,e){return e||Number.isInteger(s)?s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString():s>=1e6?`${(s/1e6).toFixed(2)}M`:s>=1e3?`${(s/1e3).toFixed(2)}K`:s.toFixed(2)}function ae(s){return{sum:"Total",avg:"Average",min:"Minimum",max:"Maximum",count:"Count",last:"Latest"}[s]??s}function le(s){const e=D.c(7),{name:r,subtitle:i}=s;let l;e[0]!==r?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:r}),e[0]=r,e[1]=l):l=e[1];let n;e[2]!==i?(n=t.jsx("div",{className:"text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==l||e[5]!==n?(c=t.jsxs("div",{className:"px-4 py-3",children:[l,n]}),e[4]=l,e[5]=n,e[6]=c):c=e[6],c}function Ze(s){const e=D.c(13),{widget:r,result:i}=s,l=i?.value??0,n=r.aggregation.fn==="count",c=r.name;let o;e[0]!==r.aggregation.fn?(o=ae(r.aggregation.fn),e[0]=r.aggregation.fn,e[1]=o):o=e[1];let m;e[2]!==o||e[3]!==r.name?(m=t.jsx(le,{name:c,subtitle:o}),e[2]=o,e[3]=r.name,e[4]=m):m=e[4];let d;e[5]!==n||e[6]!==l?(d=G(l,n),e[5]=n,e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=t.jsx("div",{className:"px-4 pb-4 mt-auto",children:t.jsx("div",{className:"text-4xl font-bold tabular-nums",children:d})}),e[8]=d,e[9]=g):g=e[9];let f;return e[10]!==m||e[11]!==g?(f=t.jsxs("div",{className:"border rounded-lg bg-card flex flex-col h-full",children:[m,g]}),e[10]=m,e[11]=g,e[12]=f):f=e[12],f}function et(s){const e=D.c(15),{widget:r,result:i}=s;let l,n;e[0]!==i?.groups?(l=i?.groups??[],n=Math.max(...l.map(tt),1),e[0]=i?.groups,e[1]=l,e[2]=n):(l=e[1],n=e[2]);const c=n;let o;e[3]!==r.aggregation.fn||e[4]!==r.aggregation.groupBy?(o=r.aggregation.groupBy?`Grouped by ${r.aggregation.groupBy}`:ae(r.aggregation.fn),e[3]=r.aggregation.fn,e[4]=r.aggregation.groupBy,e[5]=o):o=e[5];let m;e[6]!==o||e[7]!==r.name?(m=t.jsx(le,{name:r.name,subtitle:o}),e[6]=o,e[7]=r.name,e[8]=m):m=e[8];let d;e[9]!==l||e[10]!==c?(d=t.jsx("div",{className:"max-h-[300px] overflow-auto",children:l.length===0?t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No data available for this query"}):t.jsx("div",{className:"divide-y",children:l.map(f=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[t.jsx("span",{className:"text-sm truncate flex-1 min-w-0",children:f.key||"(empty)"}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 w-32",children:[t.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${f.value/c*100}%`}})}),t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground w-10 text-right",children:G(f.value,!0)})]})]},f.key))})}),e[9]=l,e[10]=c,e[11]=d):d=e[11];let g;return e[12]!==m||e[13]!==d?(g=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden flex flex-col h-full",children:[m,d]}),e[12]=m,e[13]=d,e[14]=g):g=e[14],g}function tt(s){return s.value}function st(s){const e=D.c(37),{widget:r,result:i}=s;let l,n,c,o,m,d,g,f,p;if(e[0]!==i?.timeseries||e[1]!==r.aggregation.fn||e[2]!==r.aggregation.interval||e[3]!==r.name){p=i?.timeseries??[],n=Math.max(...p.map(at),1);const a=p.reduce(rt,0);l=r.aggregation.fn==="count",f="border rounded-lg bg-card overflow-hidden flex flex-col h-full",d="flex items-start justify-between pr-4";const x=r.name;let u;e[13]!==r.aggregation.fn?(u=ae(r.aggregation.fn),e[13]=r.aggregation.fn,e[14]=u):u=e[14];const h=`${u} per ${r.aggregation.interval}`;e[15]!==h||e[16]!==r.name?(g=t.jsx(le,{name:x,subtitle:h}),e[15]=h,e[16]=r.name,e[17]=g):g=e[17],m="text-right pt-3",c="text-lg font-semibold tabular-nums leading-tight",o=G(a,l),e[0]=i?.timeseries,e[1]=r.aggregation.fn,e[2]=r.aggregation.interval,e[3]=r.name,e[4]=l,e[5]=n,e[6]=c,e[7]=o,e[8]=m,e[9]=d,e[10]=g,e[11]=f,e[12]=p}else l=e[4],n=e[5],c=e[6],o=e[7],m=e[8],d=e[9],g=e[10],f=e[11],p=e[12];let j;e[18]!==c||e[19]!==o?(j=t.jsx("div",{className:c,children:o}),e[18]=c,e[19]=o,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"total"}),e[21]=v):v=e[21];let b;e[22]!==m||e[23]!==j?(b=t.jsxs("div",{className:m,children:[j,v]}),e[22]=m,e[23]=j,e[24]=b):b=e[24];let w;e[25]!==d||e[26]!==g||e[27]!==b?(w=t.jsxs("div",{className:d,children:[g,b]}),e[25]=d,e[26]=g,e[27]=b,e[28]=w):w=e[28];let y;e[29]!==l||e[30]!==n||e[31]!==p?(y=t.jsx("div",{className:"px-4 pb-3 flex-1 flex flex-col min-h-0",children:p.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No data available"}):t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("div",{className:"text-[10px] text-muted-foreground mb-1 tabular-nums",children:G(n,l)}),t.jsx("div",{className:"flex items-end gap-[2px] flex-1",children:p.map((a,x)=>t.jsx("div",{className:"group relative flex-1 bg-primary/70 rounded-t transition-all hover:bg-primary cursor-default",style:{height:`${a.value/n*100}%`,minHeight:a.value>0?"3px":"0px"},children:t.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-10 pointer-events-none",children:t.jsx("div",{className:"bg-foreground text-background text-[10px] px-1.5 py-0.5 rounded whitespace-nowrap tabular-nums",children:G(a.value,l)})})},x))}),t.jsx("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1.5 tabular-nums",children:p.length>0&&(()=>{const a=new Date(p[0].timestamp),x=new Date(p[p.length-1].timestamp),$=x.getTime()-a.getTime()>864e5?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a.toLocaleString([],$)}),t.jsx("span",{children:x.toLocaleString([],$)})]})})()})]})}),e[29]=l,e[30]=n,e[31]=p,e[32]=y):y=e[32];let k;return e[33]!==w||e[34]!==y||e[35]!==f?(k=t.jsxs("div",{className:f,children:[w,y]}),e[33]=w,e[34]=y,e[35]=f,e[36]=k):k=e[36],k}function rt(s,e){return s+e.value}function at(s){return s.value}function lt(s){const e=D.c(81),{dashboardId:r,timeRange:i,propertyFilters:l,onEdit:n,onRefresh:c,onTimeRangeChange:o,onPropertyFiltersChange:m}=s,{org:d,project:g,locator:f}=fe();let p;e[0]!==d.id?(p={connectionId:be,orgId:d.id},e[0]=d.id,e[1]=p):p=e[1];const j=ye(p);let v;e[2]!==r||e[3]!==f?(v=oe.monitoringDashboardDetails(f,r),e[2]=r,e[3]=f,e[4]=v):v=e[4];let b;e[5]!==j||e[6]!==r?(b=async()=>{if(!j)throw new Error("MCP client not available");const N=await j.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:r}});return N.structuredContent??N},e[5]=j,e[6]=r,e[7]=b):b=e[7];let w;e[8]!==v||e[9]!==b?(w={queryKey:v,queryFn:b},e[8]=v,e[9]=b,e[10]=w):w=e[10];const{data:y}=ne(w);let k,a,x;if(e[11]!==r||e[12]!==f||e[13]!==l||e[14]!==i.from||e[15]!==i.to){const N=l.filter(ot),S=ve(N);k=N.length>0?Ne(N):void 0,x=ne,a=oe.monitoringDashboardQuery(f,r,i.from,i.to,S||void 0),e[11]=r,e[12]=f,e[13]=l,e[14]=i.from,e[15]=i.to,e[16]=k,e[17]=a,e[18]=x}else k=e[16],a=e[17],x=e[18];let u;e[19]!==k||e[20]!==j||e[21]!==r||e[22]!==i.from||e[23]!==i.to?(u=async()=>{if(!j)throw new Error("MCP client not available");const N=me(i.from),S=me(i.to),W=N.date||new Date(Date.now()-864e5),se=S.date||new Date,ie=await j.callTool({name:"MONITORING_DASHBOARD_QUERY",arguments:{dashboardId:r,timeRange:{startDate:W.toISOString(),endDate:se.toISOString()},...k?{propertyFilters:k}:{}}});return ie.structuredContent??ie},e[19]=k,e[20]=j,e[21]=r,e[22]=i.from,e[23]=i.to,e[24]=u):u=e[24];let h;e[25]!==a||e[26]!==u?(h={queryKey:a,queryFn:u,refetchInterval:3e4},e[25]=a,e[26]=u,e[27]=h):h=e[27];const{data:$,isRefetching:F}=x(h);if(!y){let N;return e[28]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"}),e[28]=N):N=e[28],N}let H;e[29]!==$?.results?(H=new Map($?.results?.map(nt)??[]),e[29]=$?.results,e[30]=H):H=e[30];const Q=H;let T;e[31]!==d.slug||e[32]!==g.slug?(T={org:d.slug,project:g.slug},e[31]=d.slug,e[32]=g.slug,e[33]=T):T=e[33];let Y;e[34]===Symbol.for("react.memo_cache_sentinel")?(Y={tab:"dashboards"},e[34]=Y):Y=e[34];let _;e[35]!==T?(_=t.jsx(de,{children:t.jsx(Fe,{asChild:!0,children:t.jsx(pe,{to:"/$org/$project/monitoring",params:T,search:Y,children:"Monitoring"})})}),e[35]=T,e[36]=_):_=e[36];let U;e[37]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Re,{}),e[37]=U):U=e[37];let P;e[38]!==y.name?(P=t.jsx(de,{children:t.jsx(Ce,{children:y.name})}),e[38]=y.name,e[39]=P):P=e[39];let J;e[40]!==_||e[41]!==P?(J=t.jsx(De,{children:t.jsxs(Te,{children:[_,U,P]})}),e[40]=_,e[41]=P,e[42]=J):J=e[42];const te=J;let I;e[43]!==n?(I=n&&t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:n,children:t.jsx(we,{size:14})}),e[43]=n,e[44]=I):I=e[44];let X;e[45]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(re,{size:14}),e[45]=X):X=e[45];let M;e[46]!==c?(M=t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:c,children:X}),e[46]=c,e[47]=M):M=e[47];let z;e[48]!==m||e[49]!==l?(z=t.jsx(Xe,{value:l,onChange:m}),e[48]=m,e[49]=l,e[50]=z):z=e[50];let B;e[51]!==i.from||e[52]!==i.to?(B={from:i.from,to:i.to},e[51]=i.from,e[52]=i.to,e[53]=B):B=e[53];let E;e[54]!==o||e[55]!==B?(E=t.jsx(ke,{value:B,onChange:o,className:"min-w-0"}),e[54]=o,e[55]=B,e[56]=E):E=e[56];let O;e[57]!==I||e[58]!==M||e[59]!==z||e[60]!==E?(O=t.jsxs(Se,{children:[I,M,z,E]}),e[57]=I,e[58]=M,e[59]=z,e[60]=E,e[61]=O):O=e[61];let A;e[62]!==y.description?(A=y.description&&t.jsx("div",{className:"mb-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:y.description})}),e[62]=y.description,e[63]=A):A=e[63];let K;if(e[64]!==y.widgets||e[65]!==Q){let N;e[67]!==Q?(N=S=>{const W=Q.get(S.id),se=S.type==="metric"?"":"col-span-2";return t.jsxs("div",{className:se,children:[S.type==="metric"&&t.jsx(Ze,{widget:S,result:W}),S.type==="table"&&t.jsx(et,{widget:S,result:W}),S.type==="timeseries"&&t.jsx(st,{widget:S,result:W})]},S.id)},e[67]=Q,e[68]=N):N=e[68],K=y.widgets.map(N),e[64]=y.widgets,e[65]=Q,e[66]=K}else K=e[66];let L;e[69]!==K?(L=t.jsx("div",{className:"grid grid-cols-5 gap-4",ref:it,children:K}),e[69]=K,e[70]=L):L=e[70];let V;e[71]!==F?(V=F&&t.jsxs("div",{className:"fixed bottom-4 right-4 bg-background border rounded-lg px-3 py-2 shadow-lg flex items-center gap-2 text-sm",children:[t.jsx(re,{size:14,className:"animate-spin"}),"Refreshing..."]}),e[71]=F,e[72]=V):V=e[72];let q;e[73]!==A||e[74]!==L||e[75]!==V?(q=t.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[A,L,V]}),e[73]=A,e[74]=L,e[75]=V,e[76]=q):q=e[76];let Z;return e[77]!==te||e[78]!==O||e[79]!==q?(Z=t.jsxs($e,{breadcrumb:te,children:[O,q]}),e[77]=te,e[78]=O,e[79]=q,e[80]=Z):Z=e[80],Z}function it(s){if(!s)return;const e=()=>{const i=(s.clientWidth-64)/5;s.style.gridAutoRows=`${i}px`};e(),new ResizeObserver(e).observe(s)}function nt(s){return[s.widgetId,s]}function ot(s){return s.key.trim()}function ct(s){const e=D.c(13),{dashboardId:r,onEdit:i}=s,l=xe();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"now-24h",to:"now"},e[0]=n):n=e[0];const[c,o]=C.useState(n);let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[1]=m):m=e[1];const[d,g]=C.useState(m);let f;e[2]!==r||e[3]!==l?(f=()=>{l.invalidateQueries({predicate:w=>w.queryKey[0]==="monitoringDashboardQuery"&&w.queryKey[2]===r})},e[2]=r,e[3]=l,e[4]=f):f=e[4];const p=f;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard"}),e[5]=j):j=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})}),e[6]=v):v=e[6];let b;return e[7]!==r||e[8]!==p||e[9]!==i||e[10]!==d||e[11]!==c?(b=t.jsx(ge,{fallback:j,children:t.jsx(C.Suspense,{fallback:v,children:t.jsx(lt,{dashboardId:r,timeRange:c,propertyFilters:d,onEdit:i,onRefresh:p,onTimeRangeChange:o,onPropertyFiltersChange:g})})}),e[7]=r,e[8]=p,e[9]=i,e[10]=d,e[11]=c,e[12]=b):b=e[12],b}function Vt(){const s=D.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{dashboardId:r}=he(e),{org:i,project:l}=fe(),n=je();let c;s[1]!==r||s[2]!==n||s[3]!==i.slug||s[4]!==l.slug?(c=()=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:i.slug,project:l.slug,dashboardId:r}})},s[1]=r,s[2]=n,s[3]=i.slug,s[4]=l.slug,s[5]=c):c=s[5];const o=c;let m;return s[6]!==r||s[7]!==o?(m=t.jsx(ct,{dashboardId:r,onEdit:o}),s[6]=r,s[7]=o,s[8]=m):m=s[8],m}export{Vt as default};
@@ -1,4 +1,4 @@
1
- import{r as m,c9 as We,bH as sn,ch as on,c as Q,v as Ne,j as n,E as qt,u as Ze,m as ln,b as Vt,n as cn,K as nt,B as ge,t as St,O as aa,a as un}from"./index-CzFqQvXW.js";import{E as Ht,C as dn}from"./collection-search-aEfiIRVT.js";import{P as pe}from"./index-BeKO7nFo.js";import{B as mn,a as fn,b as pn,c as vn}from"./breadcrumb-CtNnsyqL.js";import{E as hn,i as gn,d as xn,e as tr,b as yn,M as bn,T as jn,p as Qe,s as Re,a as rr}from"./time-range-picker-Brh1Ym1N.js";import{I as st}from"./integration-icon-Cr629JYK.js";import{B as it}from"./badge-CMOYVtO8.js";import{t as Et}from"./ChevronDown-CxLgy5uI.js";import{i as Pn}from"./ChevronRight-B-dZm0Fo.js";import{c as me,b as Tt,d as wn,e as Nn,a as On,T as he}from"./table-C7IfzCau.js";import{as as Sn,at as Je,a2 as Ae,i as He,au as na,r as qe,V as gt,av as sa,X as xt,aw as V,Y as H,ax as ze,ay as ot,az as lt,aA as ke,aB as ar,O as Ke,a3 as In,a9 as Gt,aC as kn,aD as Cn,aE as An,aF as En,_ as Fe,a5 as Mt,w as Tn,l as ue,m as Ie,aG as Mn,p as Oe,v as Se,z as Ut,x as Dn,y as ct,B as ia,D as yt,c as bt,R as oa,S as la,C as ca,F as jt,G as ua,H as da,K as ma,L as _n,I as fa,d as Ge,M as Ln,N as $n,Z as Pt,P as pa,Q as Bn,T as wt,U as nr,a0 as va,a1 as ha,k as ga,a4 as Rn,aH as zn,ad as Kn,n as Fn,q as Ee,t as Te,aI as xa,aJ as Wn,aK as qn,A as sr,aL as Vn,aM as ir,E as Hn,aN as Gn,aO as ya,aP as Un,aQ as ba,aR as Zn,aS as Yn,aT as or,aU as Xn,$ as Qn,am as ja,an as Pa,aq as wa,ar as Jn,ao as Na,ap as es}from"./chart-CA07zGfe.js";import{u as Zt,a as Yt,W as ts}from"./constants-0JLhMmM7.js";import{i as rs}from"./DotsVertical-D-x0DTAA.js";import{s as Oa}from"./Plus-C48LE9QF.js";import{s as Sa}from"./Trash01-DfwWsbuW.js";import{C as as}from"./connection-card-CzCUOjTN.js";import{D as ns,a as ss,b as is,c as lr}from"./dropdown-menu-bZQdGgsX.js";import{f as os,a as ls,b as cs,c as us,d as ds,e as ms,A as fs,h as ps}from"./alert-dialog-CHhoNaC0.js";import{u as vs}from"./use-members-Dzw-FOpA.js";import{u as hs}from"./useSuspenseInfiniteQuery-BSW1dpRq.js";import{h as Ia}from"./use-connection-CmCfM9T5.js";import{b as gs}from"./use-virtual-mcp-CaM9kbfY.js";import{i as xs}from"./Code01-C4dpeKsY.js";import{n as Dt}from"./Container-CH2V2ATa.js";import{i as ys}from"./FilterLines-CR4t6v_B.js";import{c as bs}from"./Grid01-C85povgK.js";import{I as It}from"./input-Rcf9et7W.js";import{C as cr}from"./checkbox-Bs5NWE_x.js";import{c as js,d as Ps,e as ur,a as ws,C as Ns,b as Os}from"./command-DI3JwfrE.js";import{b as ka,P as Ca,a as Aa}from"./popover-C5F2AcFP.js";import{S as dr,a as mr,b as fr,c as pr,d as et}from"./select-CSl7KVC3.js";import{T as Ss}from"./textarea-CumbsokS.js";import{T as Is,a as ks,b as Cs}from"./tooltip-BGn6dJhi.js";import{C as As}from"./collection-tabs-Dc6gZtTz.js";import{S as Es}from"./switch-D_s2nP_j.js";import{L as Ts}from"./label-DdGHGWov.js";import{u as Ms}from"./use-mcp-tools-BTHDM3P3.js";import"./Loading01-DvHkBn5K.js";import"./SearchMd-Bec1mZCp.js";import"./localstorage-keys-DtK7peUq.js";import"./useQuery-BE7O7fKt.js";import"./useMutation-DsQcwaJP.js";import"./Check-BGWNBpXb.js";import"./Copy01-Ba42JLNP.js";import"./Download01-x2RmdAQh.js";import"./Key01-B3LfJVTz.js";import"./Play-B4gSKcOc.js";import"./scroll-area-B5BKtcc-.js";import"./spinner-BubUCjpb.js";import"./Clock-DjTfMWYb.js";import"./index-hfshaOuF.js";import"./card-BECXECFc.js";import"./infiniteQueryObserver-B0QSZ6Wg.js";import"./index-Cp50RRud.js";import"./index-gksA6r5d.js";const _t=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.createElement("path",{d:"M21 21H6.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C3 19.48 3 18.92 3 17.8V3m4 7.5v7m4.5-12v12m4.5-7v7m4.5-12v12"}));_t.displayName="BarChart07";const Ea=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.createElement("path",{d:"M9.5 15V9m5 6V9m7.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ea.displayName="PauseCircle";const Ta=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),m.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}));Ta.displayName="PlayCircle";const Ma=Math.cos,ut=Math.sin,de=Math.sqrt,dt=Math.PI,Nt=2*dt,Xt={draw(t,e){const r=de(e/dt);t.moveTo(r,0),t.arc(0,0,r,0,Nt)}},Ds={draw(t,e){const r=de(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Da=de(1/3),_s=Da*2,Ls={draw(t,e){const r=de(e/_s),a=r*Da;t.moveTo(0,-r),t.lineTo(a,0),t.lineTo(0,r),t.lineTo(-a,0),t.closePath()}},$s={draw(t,e){const r=de(e),a=-r/2;t.rect(a,a,r,r)}},Bs=.8908130915292852,_a=ut(dt/10)/ut(7*dt/10),Rs=ut(Nt/10)*_a,zs=-Ma(Nt/10)*_a,Ks={draw(t,e){const r=de(e*Bs),a=Rs*r,i=zs*r;t.moveTo(0,-r),t.lineTo(a,i);for(let s=1;s<5;++s){const o=Nt*s/5,l=Ma(o),c=ut(o);t.lineTo(c*r,-l*r),t.lineTo(l*a-c*i,c*a+l*i)}t.closePath()}},kt=de(3),Fs={draw(t,e){const r=-de(e/(kt*3));t.moveTo(0,r*2),t.lineTo(-kt*r,-r),t.lineTo(kt*r,-r),t.closePath()}},ne=-.5,se=de(3)/2,Lt=1/de(12),Ws=(Lt/2+1)*3,qs={draw(t,e){const r=de(e/Ws),a=r/2,i=r*Lt,s=a,o=r*Lt+r,l=-s,c=o;t.moveTo(a,i),t.lineTo(s,o),t.lineTo(l,c),t.lineTo(ne*a-se*i,se*a+ne*i),t.lineTo(ne*s-se*o,se*s+ne*o),t.lineTo(ne*l-se*c,se*l+ne*c),t.lineTo(ne*a+se*i,ne*i-se*a),t.lineTo(ne*s+se*o,ne*o-se*s),t.lineTo(ne*l+se*c,ne*c-se*l),t.closePath()}};function Vs(t,e){let r=null,a=Sn(i);t=typeof t=="function"?t:Je(t||Xt),e=typeof e=="function"?e:Je(e===void 0?64:+e);function i(){let s;if(r||(r=s=a()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:Je(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:Je(+s),i):e},i.context=function(s){return arguments.length?(r=s??null,i):r},i}var Hs=["type","size","sizeType"];function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},$t.apply(null,arguments)}function vr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function hr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vr(Object(r),!0).forEach(function(a){Gs(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Gs(t,e,r){return(e=Us(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Us(t){var e=Zs(t,"string");return typeof e=="symbol"?e:e+""}function Zs(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ys(t,e){if(t==null)return{};var r,a,i=Xs(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Xs(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var La={symbolCircle:Xt,symbolCross:Ds,symbolDiamond:Ls,symbolSquare:$s,symbolStar:Ks,symbolTriangle:Fs,symbolWye:qs},Qs=Math.PI/180,Js=t=>{var e="symbol".concat(na(t));return La[e]||Xt},ei=(t,e,r)=>{if(e==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*Qs;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},ti=(t,e)=>{La["symbol".concat(na(t))]=e},$a=t=>{var{type:e="circle",size:r=64,sizeType:a="area"}=t,i=Ys(t,Hs),s=hr(hr({},i),{},{type:e,size:r,sizeType:a}),o="circle";typeof e=="string"&&(o=e);var l=()=>{var f=Js(o),g=Vs().type(f).size(ei(r,a,o)),y=g();if(y!==null)return y},{className:c,cx:u,cy:d}=s,v=Ae(s);return He(u)&&He(d)&&He(r)?m.createElement("path",$t({},v,{className:We("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};$a.registerSymbol=ti;var ri=["radius"],ai=["radius"],gr,xr,yr,br,jr,Pr,wr,Nr,Or,Sr;function Ir(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function kr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ir(Object(r),!0).forEach(function(a){ni(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ir(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function ni(t,e,r){return(e=si(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function si(t){var e=ii(t,"string");return typeof e=="symbol"?e:e+""}function ii(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mt(){return mt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},mt.apply(null,arguments)}function Cr(t,e){if(t==null)return{};var r,a,i=oi(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function oi(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function fe(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Ar=(t,e,r,a,i)=>{var s=ze(r),o=ze(a),l=Math.min(Math.abs(s)/2,Math.abs(o)/2),c=o>=0?1:-1,u=s>=0?1:-1,d=o>=0&&s>=0||o<0&&s<0?1:0,v;if(l>0&&Array.isArray(i)){for(var f=[0,0,0,0],g=0,y=4;g<y;g++){var x,b=(x=i[g])!==null&&x!==void 0?x:0;f[g]=b>l?l:b}v=V(gr||(gr=fe(["M",",",""])),t,e+c*f[0]),f[0]>0&&(v+=V(xr||(xr=fe(["A ",",",",0,0,",",",",",""])),f[0],f[0],d,t+u*f[0],e)),v+=V(yr||(yr=fe(["L ",",",""])),t+r-u*f[1],e),f[1]>0&&(v+=V(br||(br=fe(["A ",",",",0,0,",`,
1
+ import{r as m,c7 as We,bH as sn,ch as on,c as Q,v as Ne,j as n,E as qt,u as Ze,n as ln,b as Vt,m as cn,K as nt,B as ge,t as St,O as aa,a as un}from"./index-DVHuYwO5.js";import{E as Ht,C as dn}from"./collection-search-g7bCyEl4.js";import{P as pe}from"./index-5XdaBbnC.js";import{B as mn,a as fn,b as pn,c as vn}from"./breadcrumb-BF7wgZMj.js";import{E as hn,i as gn,d as xn,e as tr,b as yn,M as bn,T as jn,p as Qe,s as Re,a as rr}from"./time-range-picker-DWAp9G7R.js";import{I as st}from"./integration-icon-CqdgwTQM.js";import{B as it}from"./badge-zns1OAW0.js";import{t as Et}from"./ChevronDown-BPvdqfh0.js";import{i as Pn}from"./ChevronRight-bI92hTEK.js";import{c as me,b as Tt,d as wn,e as Nn,a as On,T as he}from"./table-BwN-DdG1.js";import{as as Sn,at as Je,a2 as Ae,i as He,au as na,r as qe,V as gt,av as sa,X as xt,aw as V,Y as H,ax as ze,ay as ot,az as lt,aA as ke,aB as ar,O as Ke,a3 as In,a9 as Gt,aC as kn,aD as Cn,aE as An,aF as En,_ as Fe,a5 as Mt,w as Tn,l as ue,m as Ie,aG as Mn,p as Oe,v as Se,z as Ut,x as Dn,y as ct,B as ia,D as yt,c as bt,R as oa,S as la,C as ca,F as jt,G as ua,H as da,K as ma,L as _n,I as fa,d as Ge,M as Ln,N as $n,Z as Pt,P as pa,Q as Bn,T as wt,U as nr,a0 as va,a1 as ha,k as ga,a4 as Rn,aH as zn,ad as Kn,n as Fn,q as Ee,t as Te,aI as xa,aJ as Wn,aK as qn,A as sr,aL as Vn,aM as ir,E as Hn,aN as Gn,aO as ya,aP as Un,aQ as ba,aR as Zn,aS as Yn,aT as or,aU as Xn,$ as Qn,am as ja,an as Pa,aq as wa,ar as Jn,ao as Na,ap as es}from"./chart-C09J-0j8.js";import{u as Zt,a as Yt,W as ts}from"./constants-DLWxw8L_.js";import{i as rs}from"./DotsVertical-D7GBR06C.js";import{s as Oa}from"./Plus-2wrCLrAD.js";import{s as Sa}from"./Trash01-DJpn1VG4.js";import{C as as}from"./connection-card-Of-LfoL9.js";import{D as ns,a as ss,b as is,c as lr}from"./dropdown-menu-Bv0kDZGf.js";import{f as os,a as ls,b as cs,c as us,d as ds,e as ms,A as fs,h as ps}from"./alert-dialog-WtbKGn3h.js";import{u as vs}from"./use-members-CYCHCBAZ.js";import{u as hs}from"./useSuspenseInfiniteQuery-DrLfXfJc.js";import{h as Ia}from"./use-connection-CwB1S0Lk.js";import{b as gs}from"./use-virtual-mcp-CGnbrFrJ.js";import{i as xs}from"./Code01-Cw3aSJX_.js";import{n as Dt}from"./Container-BcN3rU1W.js";import{i as ys}from"./FilterLines-C4D0sIiB.js";import{c as bs}from"./Grid01-CfCG1RrY.js";import{I as It}from"./input-CImrwNsE.js";import{C as cr}from"./checkbox-C_yzLnRo.js";import{c as js,d as Ps,e as ur,a as ws,C as Ns,b as Os}from"./command-DvXRXkaf.js";import{b as ka,P as Ca,a as Aa}from"./popover-R_PT2IPW.js";import{S as dr,a as mr,b as fr,c as pr,d as et}from"./select-CZ5oa2ZG.js";import{T as Ss}from"./textarea-BOlS_fKd.js";import{T as Is,a as ks,b as Cs}from"./tooltip-BsUirxUt.js";import{C as As}from"./collection-tabs-CGvjmn7e.js";import{S as Es}from"./switch-C_rwAMG7.js";import{L as Ts}from"./label-BEcdY3zl.js";import{u as Ms}from"./use-mcp-tools-CT-LTM8z.js";import"./Loading01-DUUFtL7S.js";import"./SearchMd-DOdaT51-.js";import"./localstorage-keys-B3yhvN27.js";import"./useQuery-CxvwMb--.js";import"./useMutation-BskhtN65.js";import"./Check-llxZXJNk.js";import"./Copy01-DOsfcAr7.js";import"./Download01-Dqv2OtJR.js";import"./Key01-eAlJ77G3.js";import"./Play-DTlFqxwD.js";import"./scroll-area-DsCd8vj6.js";import"./spinner-B-yGP95y.js";import"./Clock-DCqyBdVg.js";import"./ChevronLeft-BmfUl3Br.js";import"./index-B1uFfuid.js";import"./card-yVoc5Dl_.js";import"./infiniteQueryObserver-BU31NXJd.js";import"./index-CLZkaGlC.js";import"./index-BLvVZqmB.js";const _t=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.createElement("path",{d:"M21 21H6.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C3 19.48 3 18.92 3 17.8V3m4 7.5v7m4.5-12v12m4.5-7v7m4.5-12v12"}));_t.displayName="BarChart07";const Ea=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.createElement("path",{d:"M9.5 15V9m5 6V9m7.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ea.displayName="PauseCircle";const Ta=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),m.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}));Ta.displayName="PlayCircle";const Ma=Math.cos,ut=Math.sin,de=Math.sqrt,dt=Math.PI,Nt=2*dt,Xt={draw(t,e){const r=de(e/dt);t.moveTo(r,0),t.arc(0,0,r,0,Nt)}},Ds={draw(t,e){const r=de(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Da=de(1/3),_s=Da*2,Ls={draw(t,e){const r=de(e/_s),a=r*Da;t.moveTo(0,-r),t.lineTo(a,0),t.lineTo(0,r),t.lineTo(-a,0),t.closePath()}},$s={draw(t,e){const r=de(e),a=-r/2;t.rect(a,a,r,r)}},Bs=.8908130915292852,_a=ut(dt/10)/ut(7*dt/10),Rs=ut(Nt/10)*_a,zs=-Ma(Nt/10)*_a,Ks={draw(t,e){const r=de(e*Bs),a=Rs*r,i=zs*r;t.moveTo(0,-r),t.lineTo(a,i);for(let s=1;s<5;++s){const o=Nt*s/5,l=Ma(o),c=ut(o);t.lineTo(c*r,-l*r),t.lineTo(l*a-c*i,c*a+l*i)}t.closePath()}},kt=de(3),Fs={draw(t,e){const r=-de(e/(kt*3));t.moveTo(0,r*2),t.lineTo(-kt*r,-r),t.lineTo(kt*r,-r),t.closePath()}},ne=-.5,se=de(3)/2,Lt=1/de(12),Ws=(Lt/2+1)*3,qs={draw(t,e){const r=de(e/Ws),a=r/2,i=r*Lt,s=a,o=r*Lt+r,l=-s,c=o;t.moveTo(a,i),t.lineTo(s,o),t.lineTo(l,c),t.lineTo(ne*a-se*i,se*a+ne*i),t.lineTo(ne*s-se*o,se*s+ne*o),t.lineTo(ne*l-se*c,se*l+ne*c),t.lineTo(ne*a+se*i,ne*i-se*a),t.lineTo(ne*s+se*o,ne*o-se*s),t.lineTo(ne*l+se*c,ne*c-se*l),t.closePath()}};function Vs(t,e){let r=null,a=Sn(i);t=typeof t=="function"?t:Je(t||Xt),e=typeof e=="function"?e:Je(e===void 0?64:+e);function i(){let s;if(r||(r=s=a()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:Je(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:Je(+s),i):e},i.context=function(s){return arguments.length?(r=s??null,i):r},i}var Hs=["type","size","sizeType"];function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},$t.apply(null,arguments)}function vr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function hr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vr(Object(r),!0).forEach(function(a){Gs(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Gs(t,e,r){return(e=Us(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Us(t){var e=Zs(t,"string");return typeof e=="symbol"?e:e+""}function Zs(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ys(t,e){if(t==null)return{};var r,a,i=Xs(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Xs(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var La={symbolCircle:Xt,symbolCross:Ds,symbolDiamond:Ls,symbolSquare:$s,symbolStar:Ks,symbolTriangle:Fs,symbolWye:qs},Qs=Math.PI/180,Js=t=>{var e="symbol".concat(na(t));return La[e]||Xt},ei=(t,e,r)=>{if(e==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*Qs;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},ti=(t,e)=>{La["symbol".concat(na(t))]=e},$a=t=>{var{type:e="circle",size:r=64,sizeType:a="area"}=t,i=Ys(t,Hs),s=hr(hr({},i),{},{type:e,size:r,sizeType:a}),o="circle";typeof e=="string"&&(o=e);var l=()=>{var f=Js(o),g=Vs().type(f).size(ei(r,a,o)),y=g();if(y!==null)return y},{className:c,cx:u,cy:d}=s,v=Ae(s);return He(u)&&He(d)&&He(r)?m.createElement("path",$t({},v,{className:We("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};$a.registerSymbol=ti;var ri=["radius"],ai=["radius"],gr,xr,yr,br,jr,Pr,wr,Nr,Or,Sr;function Ir(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function kr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ir(Object(r),!0).forEach(function(a){ni(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ir(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function ni(t,e,r){return(e=si(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function si(t){var e=ii(t,"string");return typeof e=="symbol"?e:e+""}function ii(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mt(){return mt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},mt.apply(null,arguments)}function Cr(t,e){if(t==null)return{};var r,a,i=oi(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function oi(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function fe(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Ar=(t,e,r,a,i)=>{var s=ze(r),o=ze(a),l=Math.min(Math.abs(s)/2,Math.abs(o)/2),c=o>=0?1:-1,u=s>=0?1:-1,d=o>=0&&s>=0||o<0&&s<0?1:0,v;if(l>0&&Array.isArray(i)){for(var f=[0,0,0,0],g=0,y=4;g<y;g++){var x,b=(x=i[g])!==null&&x!==void 0?x:0;f[g]=b>l?l:b}v=V(gr||(gr=fe(["M",",",""])),t,e+c*f[0]),f[0]>0&&(v+=V(xr||(xr=fe(["A ",",",",0,0,",",",",",""])),f[0],f[0],d,t+u*f[0],e)),v+=V(yr||(yr=fe(["L ",",",""])),t+r-u*f[1],e),f[1]>0&&(v+=V(br||(br=fe(["A ",",",",0,0,",`,
2
2
  `,",",""])),f[1],f[1],d,t+r,e+c*f[1])),v+=V(jr||(jr=fe(["L ",",",""])),t+r,e+a-c*f[2]),f[2]>0&&(v+=V(Pr||(Pr=fe(["A ",",",",0,0,",`,
3
3
  `,",",""])),f[2],f[2],d,t+r-u*f[2],e+a)),v+=V(wr||(wr=fe(["L ",",",""])),t+u*f[3],e+a),f[3]>0&&(v+=V(Nr||(Nr=fe(["A ",",",",0,0,",`,
4
4
  `,",",""])),f[3],f[3],d,t,e+a-c*f[3])),v+="Z"}else if(l>0&&i===+i&&i>0){var h=Math.min(l,i);v=V(Or||(Or=fe(["M ",",",`
@@ -28,4 +28,4 @@ import{r as m,c9 as We,bH as sn,ch as on,c as Q,v as Ne,j as n,E as qt,u as Ze,m
28
28
  A`,",",",0,0,",",",",","Z"])),C.x,C.y,s,s,+(d<0),P.x,P.y,a,a,+(S>180),+(d>0),j.x,j.y,s,s,+(d<0),w.x,w.y)}else p+=V(Br||(Br=Ce(["L",",","Z"])),e,r);return p},di={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},mi=t=>{var e=qe(t,di),{cx:r,cy:a,innerRadius:i,outerRadius:s,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:v}=e;if(s<i||u===d)return null;var f=We("recharts-sector",v),g=s-i,y=ot(o,g,0,!0),x;return y>0&&Math.abs(u-d)<360?x=ui({cx:r,cy:a,innerRadius:i,outerRadius:s,cornerRadius:Math.min(y,g/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):x=Ba({cx:r,cy:a,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d}),m.createElement("path",Bt({},Ae(e),{className:f,d:x}))},Qt=t=>null;Qt.displayName="Cell";var Ct={},Rr;function fi(){return Rr||(Rr=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const i=r[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${i}]`}let a=r;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(r)===a}t.isPlainObject=e})(Ct)),Ct}var At,zr;function pi(){return zr||(zr=1,At=fi().isPlainObject),At}var vi=pi();const hi=sn(vi);var Kr,Fr,Wr,qr,Vr;function Hr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function Gr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Hr(Object(r),!0).forEach(function(a){gi(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function gi(t,e,r){return(e=xi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xi(t){var e=yi(t,"string");return typeof e=="symbol"?e:e+""}function yi(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ft(){return ft=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},ft.apply(null,arguments)}function Ve(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Ur=(t,e,r,a,i)=>{var s=r-a,o;return o=V(Kr||(Kr=Ve(["M ",",",""])),t,e),o+=V(Fr||(Fr=Ve(["L ",",",""])),t+r,e),o+=V(Wr||(Wr=Ve(["L ",",",""])),t+r-s/2,e+i),o+=V(qr||(qr=Ve(["L ",",",""])),t+r-s/2-a,e+i),o+=V(Vr||(Vr=Ve(["L ",","," Z"])),t,e),o},bi={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ji=t=>{var e=qe(t,bi),{x:r,y:a,upperWidth:i,lowerWidth:s,height:o,className:l}=e,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:v}=e,f=m.useRef(null),[g,y]=m.useState(-1),x=m.useRef(i),b=m.useRef(s),h=m.useRef(o),p=m.useRef(r),j=m.useRef(a),w=gt(t,"trapezoid-");if(m.useEffect(()=>{if(f.current&&f.current.getTotalLength)try{var I=f.current.getTotalLength();I&&y(I)}catch{}},[]),r!==+r||a!==+a||i!==+i||s!==+s||o!==+o||i===0&&s===0||o===0)return null;var N=We("recharts-trapezoid",l);if(!v)return m.createElement("g",null,m.createElement("path",ft({},Ae(e),{className:N,d:Ur(r,a,i,s,o)})));var P=x.current,C=b.current,O=h.current,S=p.current,E=j.current,M="0px ".concat(g===-1?1:g,"px"),D="".concat(g,"px 0px"),k=sa(["strokeDasharray"],u,c);return m.createElement(xt,{animationId:w,key:w,canBegin:g>0,duration:u,easing:c,isActive:v,begin:d},I=>{var T=H(P,i,I),_=H(C,s,I),L=H(O,o,I),R=H(S,r,I),$=H(E,a,I);f.current&&(x.current=T,b.current=_,h.current=L,p.current=R,j.current=$);var K=I>0?{transition:k,strokeDasharray:D}:{strokeDasharray:M};return m.createElement("path",ft({},Ae(e),{className:N,d:Ur(R,$,T,_,L),ref:f,style:Gr(Gr({},K),e.style)}))})},Pi=["option","shapeType","activeClassName"];function wi(t,e){if(t==null)return{};var r,a,i=Ni(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Ni(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function pt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(r),!0).forEach(function(a){Oi(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Oi(t,e,r){return(e=Si(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Si(t){var e=Ii(t,"string");return typeof e=="symbol"?e:e+""}function Ii(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ki(t,e){return pt(pt({},e),t)}function Ci(t,e){return t==="symbols"}function Yr(t){var{shapeType:e,elementProps:r}=t;switch(e){case"rectangle":return m.createElement(li,r);case"trapezoid":return m.createElement(ji,r);case"sector":return m.createElement(mi,r);case"symbols":if(Ci(e))return m.createElement($a,r);break;case"curve":return m.createElement(In,r);default:return null}}function Ai(t){return m.isValidElement(t)?t.props:t}function Ra(t){var{option:e,shapeType:r,activeClassName:a="recharts-active-shape"}=t,i=wi(t,Pi),s;if(m.isValidElement(e))s=m.cloneElement(e,pt(pt({},i),Ai(e)));else if(typeof e=="function")s=e(i,i.index);else if(hi(e)&&typeof e!="boolean"){var o=ki(e,i);s=m.createElement(Yr,{shapeType:r,elementProps:o})}else{var l=i;s=m.createElement(Yr,{shapeType:r,elementProps:l})}return i.isActive?m.createElement(Ke,{className:a},s):s}var za=(t,e,r)=>{var a=Gt();return(i,s)=>o=>{t?.(i,s,o),a(kn({activeIndex:String(s),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},Ka=t=>{var e=Gt();return(r,a)=>i=>{t?.(r,a,i),e(Cn())}},Fa=(t,e,r)=>{var a=Gt();return(i,s)=>o=>{t?.(i,s,o),a(An({activeIndex:String(s),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},Xr=(t,e,r)=>{var a=r??t;if(!Fe(a))return ot(a,e,0)},Ei=(t,e,r)=>{var a={},i=t.filter(En),s=t.filter(u=>u.stackId==null),o=i.reduce((u,d)=>{var v=u[d.stackId];return v==null&&(v=[]),v.push(d),u[d.stackId]=v,u},a),l=Object.entries(o).map(u=>{var d,[v,f]=u,g=f.map(x=>x.dataKey),y=Xr(e,r,(d=f[0])===null||d===void 0?void 0:d.barSize);return{stackId:v,dataKeys:g,barSize:y}}),c=s.map(u=>{var d=[u.dataKey].filter(f=>f!=null),v=Xr(e,r,u.barSize);return{stackId:void 0,dataKeys:d,barSize:v}});return[...l,...c]};function Qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function rt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(r),!0).forEach(function(a){Ti(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Ti(t,e,r){return(e=Mi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mi(t){var e=Di(t,"string");return typeof e=="symbol"?e:e+""}function Di(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _i(t,e,r,a,i){var s,o=a.length;if(!(o<1)){var l=ot(t,r,0,!0),c,u=[];if(Mt((s=a[0])===null||s===void 0?void 0:s.barSize)){var d=!1,v=r/o,f=a.reduce((p,j)=>p+(j.barSize||0),0);f+=(o-1)*l,f>=r&&(f-=(o-1)*l,l=0),f>=r&&v>0&&(d=!0,v*=.9,f=o*v);var g=(r-f)/2>>0,y={offset:g-l,size:0};c=a.reduce((p,j)=>{var w,N={stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:y.offset+y.size+l,size:d?v:(w=j.barSize)!==null&&w!==void 0?w:0}},P=[...p,N];return y=N.position,P},u)}else{var x=ot(e,r,0,!0);r-2*x-(o-1)*l<=0&&(l=0);var b=(r-2*x-(o-1)*l)/o;b>1&&(b>>=0);var h=Mt(i)?Math.min(b,i):b;c=a.reduce((p,j,w)=>[...p,{stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:x+(b+l)*w+(b-h)/2,size:h}}],u)}return c}}var Li=(t,e,r,a,i,s,o)=>{var l=Fe(o)?e:o,c=_i(r,a,i!==s?i:s,t,l);return i!==s&&c!=null&&(c=c.map(u=>rt(rt({},u),{},{position:rt(rt({},u.position),{},{offset:u.position.offset-i/2})}))),c},$i=(t,e)=>{var r=Tn(e);if(!(!t||r==null||e==null)){var{stackId:a}=e;if(a!=null){var i=t[a];if(i){var{stackedData:s}=i;if(s)return s.find(o=>o.key===r)}}}},Bi=(t,e)=>{if(!(t==null||e==null)){var r=t.find(a=>a.stackId===e.stackId&&e.dataKey!=null&&a.dataKeys.includes(e.dataKey));if(r!=null)return r.position}};function Ri(t,e){return t&&typeof t=="object"&&"zIndex"in t&&typeof t.zIndex=="number"&&Mt(t.zIndex)?t.zIndex:e}var zi=["children"];function Ki(t,e){if(t==null)return{};var r,a,i=Fi(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Fi(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Wi={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},qi=m.createContext(Wi);function Wa(t){var{children:e}=t,r=Ki(t,zi);return m.createElement(qi.Provider,{value:r},e)}var qa=(t,e,r,a)=>Oe(t,"xAxis",e,a),Va=(t,e,r,a)=>Se(t,"xAxis",e,a),Ha=(t,e,r,a)=>Oe(t,"yAxis",r,a),Ga=(t,e,r,a)=>Se(t,"yAxis",r,a),Vi=ue([Ie,qa,Ha,Va,Ga],(t,e,r,a,i)=>Dn(t,"xAxis")?ct(e,a,!1):ct(r,i,!1)),Hi=(t,e,r,a,i)=>i;function Gi(t){return t.type==="line"}var Ui=ue([Ut,Hi],(t,e)=>t.filter(Gi).find(r=>r.id===e)),Zi=ue([Ie,qa,Ha,Va,Ga,Ui,Vi,Mn],(t,e,r,a,i,s,o,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(s==null||e==null||r==null||a==null||i==null||a.length===0||i.length===0||o==null||t!=="horizontal"&&t!=="vertical")){var{dataKey:v,data:f}=s,g;if(f!=null&&f.length>0?g=f:g=c?.slice(u,d+1),g!=null)return ho({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:i,dataKey:v,bandSize:o,displayedData:g})}}),Yi=["id"],Xi=["type","layout","connectNulls","needClip","shape"],Qi=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Ue(){return Ue=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Ue.apply(null,arguments)}function Jr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function ve(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(r),!0).forEach(function(a){Ji(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Ji(t,e,r){return(e=eo(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eo(t){var e=to(t,"string");return typeof e=="symbol"?e:e+""}function to(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jt(t,e){if(t==null)return{};var r,a,i=ro(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function ro(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var ao=t=>{var{dataKey:e,name:r,stroke:a,legendType:i,hide:s}=t;return[{inactive:s,dataKey:e,type:i,color:a,value:jt(r,e),payload:t}]},no=m.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:i,fill:s,name:o,hide:l,unit:c,tooltipType:u,id:d}=t,v={dataDefinedOnItem:r,getPosition:da,settings:{stroke:a,strokeWidth:i,fill:s,dataKey:e,nameKey:void 0,name:jt(o,e),hide:l,type:u,color:a,unit:c,graphicalItemId:d}};return m.createElement(ua,{tooltipEntrySettings:v})}),Ua=(t,e)=>"".concat(e,"px ").concat(t-e,"px");function so(t,e){for(var r=t.length%2!==0?[...t,0]:t,a=[],i=0;i<e;++i)a=[...a,...r];return a}var io=(t,e,r)=>{var a=r.reduce((g,y)=>g+y);if(!a)return Ua(e,t);for(var i=Math.floor(t/a),s=t%a,o=e-t,l=[],c=0,u=0;c<r.length;u+=(d=r[c])!==null&&d!==void 0?d:0,++c){var d,v=r[c];if(v!=null&&u+v>s){l=[...r.slice(0,c),s-u];break}}var f=l.length%2===0?[0,o]:[o];return[...so(r,i),...l,...f].map(g=>"".concat(g,"px")).join(", ")};function oo(t){var{clipPathId:e,points:r,props:a}=t,{dot:i,dataKey:s,needClip:o}=a,{id:l}=a,c=Jt(a,Yi),u=ga(c);return m.createElement(Rn,{points:r,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:s,baseProps:u,needClip:o,clipPathId:e})}function lo(t){var{showLabels:e,children:r,points:a}=t,i=m.useMemo(()=>a?.map(s=>{var o,l,c={x:(o=s.x)!==null&&o!==void 0?o:0,y:(l=s.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ve(ve({},c),{},{value:s.value,payload:s.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[a]);return m.createElement(ha,{value:e?i:void 0},r)}function ea(t){var{clipPathId:e,pathRef:r,points:a,strokeDasharray:i,props:s}=t,{type:o,layout:l,connectNulls:c,needClip:u,shape:d}=s,v=Jt(s,Xi),f=ve(ve({},Ae(v)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(e,")"):void 0,points:a,type:o,layout:l,connectNulls:c,strokeDasharray:i??s.strokeDasharray});return m.createElement(m.Fragment,null,a?.length>1&&m.createElement(Ra,Ue({shapeType:"curve",option:d},f,{pathRef:r})),m.createElement(oo,{points:a,clipPathId:e,props:s}))}function co(t){try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch{return 0}}function uo(t){var{clipPathId:e,props:r,pathRef:a,previousPointsRef:i,longestAnimatedLengthRef:s}=t,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:v,animateNewValues:f,width:g,height:y,onAnimationEnd:x,onAnimationStart:b}=r,h=i.current,p=gt(o,"recharts-line-"),j=m.useRef(p),[w,N]=m.useState(!1),P=!w,C=m.useCallback(()=>{typeof x=="function"&&x(),N(!1)},[x]),O=m.useCallback(()=>{typeof b=="function"&&b(),N(!0)},[b]),S=co(a.current),E=m.useRef(0);j.current!==p&&(E.current=s.current,j.current=p);var M=E.current;return m.createElement(lo,{points:o,showLabels:P},r.children,m.createElement(xt,{animationId:p,begin:u,duration:d,isActive:c,easing:v,onAnimationEnd:C,onAnimationStart:O,key:p},D=>{var k=H(M,S+M,D),I=Math.min(k,S),T;if(c)if(l){var _="".concat(l).split(/[,\s]+/gim).map($=>parseFloat($));T=io(I,S,_)}else T=Ua(S,I);else T=l==null?void 0:String(l);if(D>0&&S>0&&(i.current=o,s.current=Math.max(s.current,I)),h){var L=h.length/o.length,R=D===1?o:o.map(($,K)=>{var z=Math.floor(K*L);if(h[z]){var A=h[z];return ve(ve({},$),{},{x:H(A.x,$.x,D),y:H(A.y,$.y,D)})}return f?ve(ve({},$),{},{x:H(g*2,$.x,D),y:H(y/2,$.y,D)}):ve(ve({},$),{},{x:$.x,y:$.y})});return i.current=R,m.createElement(ea,{props:r,points:R,clipPathId:e,pathRef:a,strokeDasharray:T})}return m.createElement(ea,{props:r,points:o,clipPathId:e,pathRef:a,strokeDasharray:T})}),m.createElement(va,{label:r.label}))}function mo(t){var{clipPathId:e,props:r}=t,a=m.useRef(null),i=m.useRef(0),s=m.useRef(null);return m.createElement(uo,{props:r,clipPathId:e,previousPointsRef:a,longestAnimatedLengthRef:i,pathRef:s})}var fo=(t,e)=>{var r,a;return{x:(r=t.x)!==null&&r!==void 0?r:void 0,y:(a=t.y)!==null&&a!==void 0?a:void 0,value:t.value,errorVal:wt(t.payload,e)}};class po extends m.Component{render(){var{hide:e,dot:r,points:a,className:i,xAxisId:s,yAxisId:o,top:l,left:c,width:u,height:d,id:v,needClip:f,zIndex:g}=this.props;if(e)return null;var y=We("recharts-line",i),x=v,{r:b,strokeWidth:h}=Ln(r),p=$n(r),j=b*2+h,w=f?"url(#clipPath-".concat(p?"":"dots-").concat(x,")"):void 0;return m.createElement(Pt,{zIndex:g},m.createElement(Ke,{className:y},f&&m.createElement("defs",null,m.createElement(pa,{clipPathId:x,xAxisId:s,yAxisId:o}),!p&&m.createElement("clipPath",{id:"clipPath-dots-".concat(x)},m.createElement("rect",{x:c-j/2,y:l-j/2,width:u+j,height:d+j}))),m.createElement(Wa,{xAxisId:s,yAxisId:o,data:a,dataPointFormatter:fo,errorBarOffset:0},m.createElement(mo,{props:this.props,clipPathId:x}))),m.createElement(Bn,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:w}))}}var Za={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:yt.line,type:"linear"};function vo(t){var e=qe(t,Za),{activeDot:r,animateNewValues:a,animationBegin:i,animationDuration:s,animationEasing:o,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:v,legendType:f,xAxisId:g,yAxisId:y,id:x}=e,b=Jt(e,Qi),{needClip:h}=ma(g,y),p=_n(),j=fa(),w=bt(),N=Ge(E=>Zi(E,g,y,w,x));if(j!=="horizontal"&&j!=="vertical"||N==null||p==null)return null;var{height:P,width:C,x:O,y:S}=p;return m.createElement(po,Ue({},b,{id:x,connectNulls:l,dot:c,activeDot:r,animateNewValues:a,animationBegin:i,animationDuration:s,animationEasing:o,isAnimationActive:d,hide:u,label:v,legendType:f,xAxisId:g,yAxisId:y,points:N,layout:j,height:P,width:C,left:O,top:S,needClip:h}))}function ho(t){var{layout:e,xAxis:r,yAxis:a,xAxisTicks:i,yAxisTicks:s,dataKey:o,bandSize:l,displayedData:c}=t;return c.map((u,d)=>{var v=wt(u,o);if(e==="horizontal"){var f=nr({axis:r,ticks:i,bandSize:l,entry:u,index:d}),g=Fe(v)?null:a.scale.map(v);return{x:f,y:g??null,value:v,payload:u}}var y=Fe(v)?null:r.scale.map(v),x=nr({axis:a,ticks:s,bandSize:l,entry:u,index:d});return y==null||x==null?null:{x:y,y:x,value:v,payload:u}}).filter(Boolean)}function go(t){var e=qe(t,Za),r=bt();return m.createElement(oa,{id:e.id,type:"line"},a=>m.createElement(m.Fragment,null,m.createElement(la,{legendPayload:ao(e)}),m.createElement(no,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),m.createElement(ca,{type:"line",id:a,data:e.data,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,hide:e.hide,isPanorama:r}),m.createElement(vo,Ue({},e,{id:a}))))}var Ya=m.memo(go,ia);Ya.displayName="Line";function Rt(){return Rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Rt.apply(null,arguments)}function vt(t){return m.createElement(Ra,Rt({shapeType:"rectangle",activeClassName:"recharts-active-bar"},t))}var xo=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(a,i)=>{if(He(e))return e;var s=He(a)||Fe(a);return s?e(a,i):(s||on(!1),r)}},yo=(t,e,r)=>r,bo=(t,e)=>e,Ye=ue([Ut,bo],(t,e)=>t.filter(r=>r.type==="bar").find(r=>r.id===e)),jo=ue([Ye],t=>t?.maxBarSize),Po=(t,e,r,a)=>a,wo=ue([Ie,Ut,Ee,Te,yo],(t,e,r,a,i)=>e.filter(s=>t==="horizontal"?s.xAxisId===r:s.yAxisId===a).filter(s=>s.isPanorama===i).filter(s=>s.hide===!1).filter(s=>s.type==="bar")),No=(t,e,r)=>{var a=Ie(t),i=Ee(t,e),s=Te(t,e);if(!(i==null||s==null))return a==="horizontal"?sr(t,"yAxis",s,r):sr(t,"xAxis",i,r)},Oo=(t,e)=>{var r=Ie(t),a=Ee(t,e),i=Te(t,e);if(!(a==null||i==null))return r==="horizontal"?ir(t,"xAxis",a):ir(t,"yAxis",i)},So=ue([wo,Vn,Oo],Ei),Io=(t,e,r)=>{var a,i,s=Ye(t,e);if(s==null)return 0;var o=Ee(t,e),l=Te(t,e);if(o==null||l==null)return 0;var c=Ie(t),u=xa(t),{maxBarSize:d}=s,v=Fe(d)?u:d,f,g;return c==="horizontal"?(f=Oe(t,"xAxis",o,r),g=Se(t,"xAxis",o,r)):(f=Oe(t,"yAxis",l,r),g=Se(t,"yAxis",l,r)),(a=(i=ct(f,g,!0))!==null&&i!==void 0?i:v)!==null&&a!==void 0?a:0},Xa=(t,e,r)=>{var a=Ie(t),i=Ee(t,e),s=Te(t,e);if(!(i==null||s==null)){var o,l;return a==="horizontal"?(o=Oe(t,"xAxis",i,r),l=Se(t,"xAxis",i,r)):(o=Oe(t,"yAxis",s,r),l=Se(t,"yAxis",s,r)),ct(o,l)}},ko=ue([So,xa,Wn,qn,Io,Xa,jo],Li),Co=(t,e,r)=>{var a=Ee(t,e);if(a!=null)return Oe(t,"xAxis",a,r)},Ao=(t,e,r)=>{var a=Te(t,e);if(a!=null)return Oe(t,"yAxis",a,r)},Eo=(t,e,r)=>{var a=Ee(t,e);if(a!=null)return Se(t,"xAxis",a,r)},To=(t,e,r)=>{var a=Te(t,e);if(a!=null)return Se(t,"yAxis",a,r)},Mo=ue([ko,Ye],Bi),Do=ue([No,Ye],$i),_o=ue([zn,Kn,Co,Ao,Eo,To,Mo,Ie,Fn,Xa,Do,Ye,Po],(t,e,r,a,i,s,o,l,c,u,d,v,f)=>{var{chartData:g,dataStartIndex:y,dataEndIndex:x}=c;if(!(v==null||o==null||e==null||l!=="horizontal"&&l!=="vertical"||r==null||a==null||i==null||s==null||u==null)){var{data:b}=v,h;if(b!=null&&b.length>0?h=b:h=g?.slice(y,x+1),h!=null)return cl({layout:l,barSettings:v,pos:o,parentViewBox:e,bandSize:u,xAxis:r,yAxis:a,xAxisTicks:i,yAxisTicks:s,stackedData:d,displayedData:h,offset:t,cells:f,dataStartIndex:y})}}),Lo=["index"];function zt(){return zt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},zt.apply(null,arguments)}function $o(t,e){if(t==null)return{};var r,a,i=Bo(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Bo(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Qa=m.createContext(void 0),Ro=t=>{var e=m.useContext(Qa);if(e!=null)return e.stackId;if(t!=null)return Hn(t)},zo=(t,e)=>"recharts-bar-stack-clip-path-".concat(t,"-").concat(e),Ko=t=>{var e=m.useContext(Qa);if(e!=null){var{stackId:r}=e;return"url(#".concat(zo(r,t),")")}},Ja=t=>{var{index:e}=t,r=$o(t,Lo),a=Ko(e);return m.createElement(Ke,zt({className:"recharts-bar-stack-layer",clipPath:a},r))},Fo=["onMouseEnter","onMouseLeave","onClick"],Wo=["value","background","tooltipPosition"],qo=["id"],Vo=["onMouseEnter","onClick","onMouseLeave"];function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function ta(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ta(Object(r),!0).forEach(function(a){Ho(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ta(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Ho(t,e,r){return(e=Go(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Go(t){var e=Uo(t,"string");return typeof e=="symbol"?e:e+""}function Uo(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ht(t,e){if(t==null)return{};var r,a,i=Zo(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Zo(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Yo=t=>{var{dataKey:e,name:r,fill:a,legendType:i,hide:s}=t;return[{inactive:s,dataKey:e,type:i,color:a,value:jt(r,e),payload:t}]},Xo=m.memo(t=>{var{dataKey:e,stroke:r,strokeWidth:a,fill:i,name:s,hide:o,unit:l,tooltipType:c,id:u}=t,d={dataDefinedOnItem:void 0,getPosition:da,settings:{stroke:r,strokeWidth:a,fill:i,dataKey:e,nameKey:void 0,name:jt(s,e),hide:o,type:c,color:i,unit:l,graphicalItemId:u}};return m.createElement(ua,{tooltipEntrySettings:d})});function Qo(t){var e=Ge(ya),{data:r,dataKey:a,background:i,allOtherBarProps:s}=t,{onMouseEnter:o,onMouseLeave:l,onClick:c}=s,u=ht(s,Fo),d=za(o,a,s.id),v=Ka(l),f=Fa(c,a,s.id);if(!i||r==null)return null;var g=Un(i);return m.createElement(Pt,{zIndex:Ri(i,yt.barBackground)},r.map((y,x)=>{var{value:b,background:h,tooltipPosition:p}=y,j=ht(y,Wo);if(!h)return null;var w=d(y,x),N=v(y,x),P=f(y,x),C=J(J(J(J(J({option:i,isActive:String(x)===e},j),{},{fill:"#eee"},h),g),ba(u,y,x)),{},{onMouseEnter:w,onMouseLeave:N,onClick:P,dataKey:a,index:x,className:"recharts-bar-background-rectangle"});return m.createElement(vt,xe({key:"background-bar-".concat(x)},C))}))}function Jo(t){var{showLabels:e,children:r,rects:a}=t,i=a?.map(s=>{var o={x:s.x,y:s.y,width:s.width,lowerWidth:s.width,upperWidth:s.width,height:s.height};return J(J({},o),{},{value:s.value,payload:s.payload,parentViewBox:s.parentViewBox,viewBox:o,fill:s.fill})});return m.createElement(ha,{value:e?i:void 0},r)}function el(t){var{shape:e,activeBar:r,baseProps:a,entry:i,index:s,dataKey:o}=t,l=Ge(ya),c=Ge(Xn),u=r&&String(s)===l&&(c==null||o===c),d=u?r:e;return u?m.createElement(Pt,{zIndex:yt.activeBar},m.createElement(Ja,{index:s},m.createElement(vt,xe({},a,{name:String(a.name)},i,{isActive:u,option:d,index:s,dataKey:o})))):m.createElement(vt,xe({},a,{name:String(a.name)},i,{isActive:u,option:d,index:s,dataKey:o}))}function tl(t){var{shape:e,baseProps:r,entry:a,index:i,dataKey:s}=t;return m.createElement(vt,xe({},r,{name:String(r.name)},a,{isActive:!1,option:e,index:i,dataKey:s}))}function rl(t){var e,{data:r,props:a}=t,i=(e=ga(a))!==null&&e!==void 0?e:{},{id:s}=i,o=ht(i,qo),{shape:l,dataKey:c,activeBar:u}=a,{onMouseEnter:d,onClick:v,onMouseLeave:f}=a,g=ht(a,Vo),y=za(d,c,s),x=Ka(f),b=Fa(v,c,s);return r?m.createElement(m.Fragment,null,r.map((h,p)=>m.createElement(Ja,xe({index:p,key:"rectangle-".concat(h?.x,"-").concat(h?.y,"-").concat(h?.value,"-").concat(p),className:"recharts-bar-rectangle"},ba(g,h,p),{onMouseEnter:y(h,p),onMouseLeave:x(h,p),onClick:b(h,p)}),u?m.createElement(el,{shape:l,activeBar:u,baseProps:o,entry:h,index:p,dataKey:c}):m.createElement(tl,{shape:l,baseProps:o,entry:h,index:p,dataKey:c})))):null}function al(t){var{props:e,previousRectanglesRef:r}=t,{data:a,layout:i,isAnimationActive:s,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:u,onAnimationStart:d}=e,v=r.current,f=gt(e,"recharts-bar-"),[g,y]=m.useState(!1),x=!g,b=m.useCallback(()=>{typeof u=="function"&&u(),y(!1)},[u]),h=m.useCallback(()=>{typeof d=="function"&&d(),y(!0)},[d]);return m.createElement(Jo,{showLabels:x,rects:a},m.createElement(xt,{animationId:f,begin:o,duration:l,isActive:s,easing:c,onAnimationEnd:b,onAnimationStart:h,key:f},p=>{var j=p===1?a:a?.map((w,N)=>{var P=v&&v[N];if(P)return J(J({},w),{},{x:H(P.x,w.x,p),y:H(P.y,w.y,p),width:H(P.width,w.width,p),height:H(P.height,w.height,p)});if(i==="horizontal"){var C=H(0,w.height,p),O=H(w.stackedBarStart,w.y,p);return J(J({},w),{},{y:O,height:C})}var S=H(0,w.width,p),E=H(w.stackedBarStart,w.x,p);return J(J({},w),{},{width:S,x:E})});return p>0&&(r.current=j??null),j==null?null:m.createElement(Ke,null,m.createElement(rl,{props:e,data:j}))}),m.createElement(va,{label:e.label}),e.children)}function nl(t){var e=m.useRef(null);return m.createElement(al,{previousRectanglesRef:e,props:t})}var en=0,sl=(t,e)=>{var r=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:r,errorVal:wt(t,e)}};class il extends m.PureComponent{render(){var{hide:e,data:r,dataKey:a,className:i,xAxisId:s,yAxisId:o,needClip:l,background:c,id:u}=this.props;if(e||r==null)return null;var d=We("recharts-bar",i),v=u;return m.createElement(Ke,{className:d,id:u},l&&m.createElement("defs",null,m.createElement(pa,{clipPathId:v,xAxisId:s,yAxisId:o})),m.createElement(Ke,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(v,")"):void 0},m.createElement(Qo,{data:r,dataKey:a,background:c,allOtherBarProps:this.props}),m.createElement(nl,this.props)))}}var ol={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:en,xAxisId:0,yAxisId:0,zIndex:yt.bar};function ll(t){var{xAxisId:e,yAxisId:r,hide:a,legendType:i,minPointSize:s,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:d}=t,{needClip:v}=ma(e,r),f=fa(),g=bt(),y=Gn(t.children,Qt),x=Ge(p=>_o(p,t.id,g,y));if(f!=="vertical"&&f!=="horizontal")return null;var b,h=x?.[0];return h==null||h.height==null||h.width==null?b=0:b=f==="vertical"?h.height/2:h.width/2,m.createElement(Wa,{xAxisId:e,yAxisId:r,data:x,dataPointFormatter:sl,errorBarOffset:b},m.createElement(il,xe({},t,{layout:f,needClip:v,data:x,xAxisId:e,yAxisId:r,hide:a,legendType:i,minPointSize:s,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:d})))}function cl(t){var{layout:e,barSettings:{dataKey:r,minPointSize:a},pos:i,bandSize:s,xAxis:o,yAxis:l,xAxisTicks:c,yAxisTicks:u,stackedData:d,displayedData:v,offset:f,cells:g,parentViewBox:y,dataStartIndex:x}=t,b=e==="horizontal"?l:o,h=d?b.scale.domain():null,p=Zn({numericAxis:b}),j=b.scale.map(p);return v.map((w,N)=>{var P,C,O,S,E,M;if(d){var D=d[N+x];if(D==null)return null;P=Yn(D,h)}else P=wt(w,r),Array.isArray(P)||(P=[p,P]);var k=xo(a,en)(P[1],N);if(e==="horizontal"){var I,T=l.scale.map(P[0]),_=l.scale.map(P[1]);if(T==null||_==null)return null;C=or({axis:o,ticks:c,bandSize:s,offset:i.offset,entry:w,index:N}),O=(I=_??T)!==null&&I!==void 0?I:void 0,S=i.size;var L=T-_;if(E=Qn(L)?0:L,M={x:C,y:f.top,width:S,height:f.height},Math.abs(k)>0&&Math.abs(E)<Math.abs(k)){var R=lt(E||k)*(Math.abs(k)-Math.abs(E));O-=R,E+=R}}else{var $=o.scale.map(P[0]),K=o.scale.map(P[1]);if($==null||K==null)return null;if(C=$,O=or({axis:l,ticks:u,bandSize:s,offset:i.offset,entry:w,index:N}),S=K-$,E=i.size,M={x:f.left,y:O,width:f.width,height:E},Math.abs(k)>0&&Math.abs(S)<Math.abs(k)){var z=lt(S||k)*(Math.abs(k)-Math.abs(S));S+=z}}if(C==null||O==null||S==null||E==null)return null;var A=J(J({},w),{},{stackedBarStart:j,x:C,y:O,width:S,height:E,value:d?P:P[1],payload:w,background:M,tooltipPosition:{x:C+S/2,y:O+E/2},parentViewBox:y},g&&g[N]&&g[N].props);return A}).filter(Boolean)}function ul(t){var e=qe(t,ol),r=Ro(e.stackId),a=bt();return m.createElement(oa,{id:e.id,type:"bar"},i=>m.createElement(m.Fragment,null,m.createElement(la,{legendPayload:Yo(e)}),m.createElement(Xo,{dataKey:e.dataKey,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:i}),m.createElement(ca,{type:"bar",id:i,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:r,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:a}),m.createElement(Pt,{zIndex:e.zIndex},m.createElement(ll,xe({},e,{id:i})))))}var tn=m.memo(ul,ia);tn.displayName="Bar";var dl=["axis"],ml=m.forwardRef((t,e)=>m.createElement(ja,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:dl,tooltipPayloadSearcher:Pa,categoricalChartProps:t,ref:e})),fl=["axis","item"],pl=m.forwardRef((t,e)=>m.createElement(ja,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:fl,tooltipPayloadSearcher:Pa,categoricalChartProps:t,ref:e}));function vl(t){const e=Q.c(49),{log:r,isExpanded:a,connection:i,virtualMcpName:s,onToggle:o,lastLogRef:l}=t;let c,u;if(e[0]!==r.timestamp){const I=new Date(r.timestamp);c=I.toLocaleDateString("en-US",{month:"short",day:"numeric"}),u=I.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=c,e[2]=u}else c=e[1],u=e[2];const d=u,v=a?"bg-muted/30 hover:bg-accent/80":"hover:bg-muted/40";let f;e[3]!==v?(f=Ne("h-14 md:h-16 transition-colors cursor-pointer",v),e[3]=v,e[4]=f):f=e[4];let g;e[5]!==a?(g=n.jsx(me,{className:"w-10 md:w-12 px-2 md:px-4",children:n.jsx("div",{className:"flex items-center justify-center",children:a?n.jsx(Et,{size:16,className:"text-muted-foreground"}):n.jsx(Pn,{size:16,className:"text-muted-foreground"})})}),e[5]=a,e[6]=g):g=e[6];const y=i?.icon||null;let x;e[7]!==r.connectionTitle||e[8]!==y?(x=n.jsx(me,{className:"w-12 md:w-16 px-2 md:px-4",children:n.jsx("div",{className:"flex items-center justify-center",children:n.jsx(st,{icon:y,name:r.connectionTitle,size:"xs",className:"shadow-sm"})})}),e[7]=r.connectionTitle,e[8]=y,e[9]=x):x=e[9];let b;e[10]!==r.toolName?(b=n.jsx("div",{className:"text-xs font-medium text-foreground truncate block",children:r.toolName}),e[10]=r.toolName,e[11]=b):b=e[11];let h;e[12]!==r.connectionTitle?(h=n.jsx("div",{className:"text-xs text-muted-foreground truncate block",children:r.connectionTitle}),e[12]=r.connectionTitle,e[13]=h):h=e[13];let p;e[14]!==b||e[15]!==h?(p=n.jsxs(me,{className:"min-w-0 pr-2 md:pr-4",children:[b,h]}),e[14]=b,e[15]=h,e[16]=p):p=e[16];let j;e[17]!==s?(j=n.jsx(me,{className:"w-24 md:w-32 px-2 md:px-3 text-xs text-muted-foreground",children:n.jsx("div",{className:"truncate",children:s})}),e[17]=s,e[18]=j):j=e[18];let w;e[19]!==r.userName?(w=n.jsx(me,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:r.userName}),e[19]=r.userName,e[20]=w):w=e[20];let N;e[21]!==c?(N=n.jsx(me,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:c}),e[21]=c,e[22]=N):N=e[22];let P;e[23]!==d?(P=n.jsx(me,{className:"w-20 md:w-28 px-2 md:px-3 text-xs text-muted-foreground",children:d}),e[23]=d,e[24]=P):P=e[24];let C;e[25]!==r.durationMs?(C=n.jsxs(me,{className:"w-16 md:w-20 px-2 md:px-3 text-xs text-muted-foreground font-mono text-right",children:[r.durationMs,"ms"]}),e[25]=r.durationMs,e[26]=C):C=e[26];const O=r.isError?"destructive":"success",S=r.isError?"Error":"OK";let E;e[27]!==O||e[28]!==S?(E=n.jsx(me,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:n.jsx("div",{className:"flex items-center justify-end",children:n.jsx(it,{variant:O,className:"text-xs px-1.5 md:px-2 py-0.5 md:py-1",children:S})})}),e[27]=O,e[28]=S,e[29]=E):E=e[29];let M;e[30]!==l||e[31]!==o||e[32]!==j||e[33]!==w||e[34]!==N||e[35]!==P||e[36]!==C||e[37]!==E||e[38]!==f||e[39]!==g||e[40]!==x||e[41]!==p?(M=n.jsxs(Tt,{ref:l,className:f,onClick:o,children:[g,x,p,j,w,N,P,C,E]}),e[30]=l,e[31]=o,e[32]=j,e[33]=w,e[34]=N,e[35]=P,e[36]=C,e[37]=E,e[38]=f,e[39]=g,e[40]=x,e[41]=p,e[42]=M):M=e[42];let D;e[43]!==a||e[44]!==r?(D=a&&n.jsx(Tt,{children:n.jsx(me,{colSpan:9,className:"p-0",children:n.jsx(hn,{log:r})})}),e[43]=a,e[44]=r,e[45]=D):D=e[45];let k;return e[46]!==M||e[47]!==D?(k=n.jsxs(m.Fragment,{children:[M,D]}),e[46]=M,e[47]=D,e[48]=k):k=e[48],k}function Ot(t){const e=Q.c(24),{title:r,description:a,action:i,children:s,className:o,noPadding:l,onTitleClick:c}=t,u=l===void 0?!1:l;let d;e[0]!==r?(d=typeof r=="string"?n.jsx("div",{className:"text-sm font-medium text-foreground",children:r}):r,e[0]=r,e[1]=d):d=e[1];const v=d;let f;e[2]!==o?(f=Ne("bg-background flex flex-col",o),e[2]=o,e[3]=f):f=e[3];let g;e[4]!==c||e[5]!==v?(g=c?n.jsx("button",{onClick:c,className:"text-left hover:text-foreground transition-colors cursor-pointer",children:v}):v,e[4]=c,e[5]=v,e[6]=g):g=e[6];let y;e[7]!==a?(y=a?n.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a}):null,e[7]=a,e[8]=y):y=e[8];let x;e[9]!==g||e[10]!==y?(x=n.jsxs("div",{className:"min-w-0",children:[g,y]}),e[9]=g,e[10]=y,e[11]=x):x=e[11];let b;e[12]!==i?(b=i?n.jsx("div",{className:"shrink-0",children:i}):null,e[12]=i,e[13]=b):b=e[13];let h;e[14]!==x||e[15]!==b?(h=n.jsxs("header",{className:"flex items-center justify-between gap-4 p-5",children:[x,b]}),e[14]=x,e[15]=b,e[16]=h):h=e[16];let p;e[17]!==s||e[18]!==u?(p=u?n.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-h-0",children:s}):n.jsx("div",{className:"px-5 pb-5 pt-2",children:s}),e[17]=s,e[18]=u,e[19]=p):p=e[19];let j;return e[20]!==f||e[21]!==h||e[22]!==p?(j=n.jsxs("div",{className:f,children:[h,p]}),e[20]=f,e[21]=h,e[22]=p,e[23]=j):j=e[23],j}function Kt(t,e){if(t.length===0)return 0;const r=[...t].sort((i,s)=>i-s),a=Math.max(0,Math.min(r.length-1,Math.ceil(e*r.length)-1));return r[a]??0}function hl(t,e){return e<=9e7?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function gl(t,e){const o=e-t;return o<=36e5?Math.max(1,Math.min(60,Math.ceil(o/6e4))):o<=9e7?Math.max(1,Math.min(25,Math.ceil(o/36e5))):Math.max(1,Math.min(31,Math.ceil(o/864e5)))}function xl(t,e,r,a){const i=e.getTime(),s=r.getTime(),o=Math.max(1,s-i),l=gl(i,s),c=Math.max(1,Math.floor(o/l)),u=[];for(let d=0;d<l;d++){const v=new Date(i+d*c),f=v.toISOString();u.push({t:f,ts:v.getTime(),label:hl(v,o),calls:0,errors:0,durations:[]})}for(const d of t){const v=new Date(d.timestamp).getTime(),f=Math.floor((v-i)/c),g=Math.max(0,Math.min(l-1,f)),y=u[g];y&&(y.calls+=1,d.isError&&(y.errors+=1),Number.isFinite(d.durationMs)&&y.durations.push(d.durationMs))}return u.map(d=>({t:d.t,ts:d.ts,label:d.label,calls:d.calls,errors:d.errors,errorRate:d.calls>0?d.errors/d.calls*100:0,avg:Math.round(d.durations.length>0?d.durations.reduce((v,f)=>v+f,0)/d.durations.length:0),p50:Math.round(Kt(d.durations,.5)),p95:Math.round(Kt(d.durations,.95))}))}function yl(t,e,r,a){const i=a??t.length,s=t.filter(d=>d.isError).length,o=t.map(d=>d.durationMs),l=o.length>0?o.reduce((d,v)=>d+v,0)/o.length:0,c=Kt(o,.95),u=xl(t,e.startDate,e.endDate);return{totalCalls:i,totalErrors:s,avgDurationMs:l,p95DurationMs:c,data:u}}function bl(t){const e=Q.c(29),{data:r,dataKey:a,colorNum:i,chartHeight:s}=t,o=`var(--chart-${i})`;let l;e[0]!==s?(l=Ne(s,"w-full"),e[0]=s,e[1]=l):l=e[1];let c;e[2]!==o||e[3]!==a?(c={label:a,color:o},e[2]=o,e[3]=a,e[4]=c):c=e[4];let u;e[5]!==a||e[6]!==c?(u={[a]:c},e[5]=a,e[6]=c,e[7]=u):u=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d={left:0,right:0,top:0,bottom:0},e[8]=d):d=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(wa,{content:n.jsx(Jn,{indicator:"line",labelFormatter:jl})}),e[9]=v):v=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=[0,0,0,0],e[10]=f):f=e[10];let g;if(e[11]!==o||e[12]!==r||e[13]!==a){let h;e[15]!==o||e[16]!==a?(h=(p,j)=>n.jsx(Qt,{fill:p[a]===0?"var(--muted-foreground)":o,fillOpacity:p[a]===0?.25:1},`cell-${j}`),e[15]=o,e[16]=a,e[17]=h):h=e[17],g=r.map(h),e[11]=o,e[12]=r,e[13]=a,e[14]=g}else g=e[14];let y;e[18]!==o||e[19]!==a||e[20]!==g?(y=n.jsx(tn,{dataKey:a,fill:o,radius:f,minPointSize:1,children:g}),e[18]=o,e[19]=a,e[20]=g,e[21]=y):y=e[21];let x;e[22]!==r||e[23]!==y?(x=n.jsxs(pl,{data:r,margin:d,children:[v,y]}),e[22]=r,e[23]=y,e[24]=x):x=e[24];let b;return e[25]!==l||e[26]!==u||e[27]!==x?(b=n.jsx(Na,{className:l,config:u,children:x}),e[25]=l,e[26]=u,e[27]=x,e[28]=b):b=e[28],b}function jl(t,e){const r=Array.isArray(e)?e[0]:void 0;return r&&typeof r=="object"&&"payload"in r?r.payload?.label??"":""}function Pl(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",children:[...Array(3)].map(wl)}),t[0]=e):e=t[0],e}function wl(t,e){return n.jsx(Ot,{title:n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("div",{className:"h-4 w-16 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-5 md:h-6 w-12 rounded bg-muted animate-pulse"})]}),children:n.jsxs("div",{className:"flex flex-col w-full",children:[n.jsx("div",{className:"h-[30px] md:h-[40px] w-full rounded bg-muted animate-pulse"}),n.jsx("div",{className:"space-y-1.5 mt-2",children:Array.from({length:3}).map(Nl)})]})},e)}function Nl(t,e){return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"size-4 rounded-sm bg-muted animate-pulse shrink-0"}),n.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-1.5 flex-1 bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-8 rounded bg-muted animate-pulse shrink-0"})]},e)}function Ol(){const{org:t,project:e,locator:r}=Ze(),a=ln(),i=Vt(),s=Zt({connectionId:Yt,orgId:t.id}),[o,l]=m.useState(null),[c,u]=m.useState(!1),[d,v]=m.useState(!1),{data:f}=cn({queryKey:nt.monitoringDashboards(r),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const p=await s.callTool({name:"MONITORING_DASHBOARD_LIST",arguments:{}});return p.structuredContent??p}}),g=f?.dashboards??[],y=async()=>{if(s){v(!0);try{const p=await s.callTool({name:"MONITORING_DASHBOARD_CREATE",arguments:{name:"Untitled Dashboard",widgets:[{id:crypto.randomUUID(),name:"New Widget",type:"metric",source:{path:"$.usage.total_tokens",from:"output"},aggregation:{fn:"sum"}}]}}),j=(p.structuredContent??p).id;a.invalidateQueries({queryKey:nt.monitoringDashboards(r)}),i({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:j}})}catch(p){St.error("Failed to create dashboard"),console.error(p)}finally{v(!1)}}},x=p=>{i({to:"/$org/$project/monitoring/dashboards/$dashboardId",params:{org:t.slug,project:e.slug,dashboardId:p}})},b=p=>{i({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:p}})},h=async p=>{if(s){u(!0);try{await s.callTool({name:"MONITORING_DASHBOARD_DELETE",arguments:{id:p}}),St.success("Dashboard deleted"),a.invalidateQueries({queryKey:nt.monitoringDashboards(r)})}catch(j){St.error("Failed to delete dashboard"),console.error(j)}finally{u(!1),l(null)}}};return n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[g.length===0?n.jsx(Ht,{title:"No dashboards yet",description:"Create a dashboard to aggregate and visualize your monitoring data",image:n.jsx(_t,{size:48,className:"text-muted-foreground/50"}),actions:n.jsxs(ge,{onClick:y,size:"sm",disabled:d,children:[n.jsx(Oa,{size:16,className:"mr-1.5"}),"Create Dashboard"]})}):n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:g.map(p=>n.jsx(as,{connection:{id:p.id,title:p.name,description:p.description},fallbackIcon:n.jsx(_t,{}),onClick:()=>x(p.id),headerActions:n.jsxs(ns,{children:[n.jsx(ss,{asChild:!0,children:n.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:j=>j.stopPropagation(),children:n.jsx(rs,{size:20})})}),n.jsxs(is,{align:"end",onClick:j=>j.stopPropagation(),children:[n.jsxs(lr,{onClick:()=>b(p.id),children:[n.jsx(gn,{size:16}),"Edit"]}),n.jsxs(lr,{onClick:()=>l(p.id),className:"text-destructive",children:[n.jsx(Sa,{size:16}),"Delete"]})]})]}),footer:n.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[n.jsxs("span",{children:[p.widgets.length," widget",p.widgets.length!==1?"s":""]}),n.jsx("span",{children:"·"}),n.jsx("span",{children:new Date(p.createdAt).toLocaleDateString()})]})},p.id))}),n.jsx(os,{open:!!o,onOpenChange:()=>l(null),children:n.jsxs(ls,{children:[n.jsxs(cs,{children:[n.jsx(us,{children:"Delete Dashboard"}),n.jsx(ds,{children:"Are you sure you want to delete this dashboard? This action cannot be undone."})]}),n.jsxs(ms,{children:[n.jsx(fs,{disabled:c,children:"Cancel"}),n.jsx(ps,{disabled:c,onClick:()=>o&&h(o),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c?"Deleting...":"Delete"})]})]})})]})}function Sl(){const t=Q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{children:[n.jsx("div",{className:"h-6 w-40 bg-muted rounded animate-pulse"}),n.jsx("div",{className:"h-4 w-64 bg-muted rounded animate-pulse mt-2"})]}),n.jsx("div",{className:"h-8 w-32 bg-muted rounded animate-pulse"})]}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[e,n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(Il)})]}),t[1]=r):r=t[1],r}function Il(t){return n.jsxs("div",{className:"border rounded-lg p-4",children:[n.jsx("div",{className:"h-5 w-32 bg-muted rounded animate-pulse mb-2"}),n.jsx("div",{className:"h-4 w-full bg-muted rounded animate-pulse mb-3"}),n.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]},t)}function kl(){const t=Q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboards"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(qt,{fallback:e,children:n.jsx(m.Suspense,{fallback:n.jsx(Sl,{}),children:n.jsx(Ol,{})})}),t[1]=r):r=t[1],r}function Cl(t,e,r=!1){const a=m.useRef(null),i=m.useRef(t),s=m.useRef(e),o=m.useRef(r);return i.current=t,s.current=e,o.current=r,c=>{a.current&&a.current.disconnect(),a.current=new IntersectionObserver(u=>{u[0]?.isIntersecting&&s.current&&!o.current&&i.current()}),c&&a.current.observe(c)}}function ra(t){const e=Q.c(72),{options:r,onValueChange:a,defaultValue:i,placeholder:s,variant:o,animation:l,maxCount:c,modalPopover:u,asChild:d,className:v,disabled:f}=t;let g;e[0]!==i?(g=i===void 0?[]:i,e[0]=i,e[1]=g):g=e[1];const y=g,x=s===void 0?"Select items":s,b=o===void 0?"default":o,h=l===void 0?0:l,p=c===void 0?3:c,j=u===void 0?!1:u,w=d===void 0?!1:d,N=f===void 0?!1:f,[P,C]=m.useState(y),[O,S]=m.useState(!1);let E,M;e[2]!==y||e[3]!==P?(E=()=>{JSON.stringify(P)!==JSON.stringify(y)&&C(y)},M=[y,P],e[2]=y,e[3]=P,e[4]=E,e[5]=M):(E=e[4],M=e[5]),m.useEffect(E,M);let D;e[6]!==a||e[7]!==P?(D=W=>{if(W.key==="Enter")S(!0);else if(W.key==="Backspace"&&!W.currentTarget.value){const q=[...P];q.pop(),C(q),a(q)}},e[6]=a,e[7]=P,e[8]=D):D=e[8];const k=D;let I;e[9]!==a||e[10]!==P?(I=W=>{const q=P.includes(W.value)?P.filter(Pe=>Pe!==W.value):[...P,W.value];C(q),a(q)},e[9]=a,e[10]=P,e[11]=I):I=e[11];const T=I;let _;e[12]!==a?(_=()=>{C([]),a([])},e[12]=a,e[13]=_):_=e[13];const L=_;let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{S(Ml)},e[14]=R):R=e[14];const $=R;let K;e[15]!==L||e[16]!==a||e[17]!==r||e[18]!==P.length?(K=()=>{if(P.length===r.length)L();else{const W=r.map(Tl);C(W),a(W)}},e[15]=L,e[16]=a,e[17]=r,e[18]=P.length,e[19]=K):K=e[19];const z=K;let A;e[20]!==w?(A=w?{}:{variant:"outline"},e[20]=w,e[21]=A):A=e[21];let B;e[22]!==v?(B=Ne("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",v),e[22]=v,e[23]=B):B=e[23];let F;e[24]!==h||e[25]!==p||e[26]!==r||e[27]!==x||e[28]!==P||e[29]!==b?(F=P.length>0?n.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[P.slice(0,p).map(W=>{const q=r.find(we=>we.value===W),Pe=q?.icon;return n.jsxs(it,{variant:b==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${h}s`},children:[Pe&&n.jsx(Pe,{className:"h-3 w-3 shrink-0"}),n.jsx("span",{className:"truncate",children:q?.label})]},W)}),P.length>p&&n.jsxs(it,{variant:b==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${h}s`},children:["+",P.length-p]})]}),n.jsx("div",{className:"flex items-center shrink-0 ml-2",children:n.jsx(Et,{size:20,className:"shrink-0 opacity-50"})})]}):n.jsxs("div",{className:"flex items-center justify-between w-full",children:[n.jsx("span",{className:"text-sm text-muted-foreground",children:x}),n.jsx(Et,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=h,e[25]=p,e[26]=r,e[27]=x,e[28]=P,e[29]=b,e[30]=F):F=e[30];let U;e[31]!==N||e[32]!==A||e[33]!==B||e[34]!==F?(U=n.jsx(ka,{asChild:!0,children:n.jsx(ge,{ref:null,...A,onClick:$,className:B,disabled:N,children:F})}),e[31]=N,e[32]=A,e[33]=B,e[34]=F,e[35]=U):U=e[35];let Z;e[36]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>S(!1),e[36]=Z):Z=e[36];let G;e[37]!==k?(G=n.jsx(js,{placeholder:"Search...",onKeyDown:k,className:"rounded-t-xl"}),e[37]=k,e[38]=G):G=e[38];let X;e[39]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(Ps,{children:"No results found."}),e[39]=X):X=e[39];let Y;e[40]!==z?(Y=()=>{z()},e[40]=z,e[41]=Y):Y=e[41];let ee;e[42]!==z?(ee=W=>{W.stopPropagation(),z()},e[42]=z,e[43]=ee):ee=e[43];const ie=P.length===r.length&&r.length>0;let oe;e[44]!==ie||e[45]!==z?(oe=n.jsx(cr,{checked:ie,onCheckedChange:z,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:El}),e[44]=ie,e[45]=z,e[46]=oe):oe=e[46];let ye;e[47]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx("span",{children:"(Select All)"}),e[47]=ye):ye=e[47];let le;e[48]!==ee||e[49]!==oe?(le=n.jsxs("div",{className:"flex items-center w-full",onClick:ee,children:[oe,ye]}),e[48]=ee,e[49]=oe,e[50]=le):le=e[50];let be;e[51]!==Y||e[52]!==le?(be=n.jsx(ur,{onSelect:Y,className:"cursor-pointer",children:le},"all"),e[51]=Y,e[52]=le,e[53]=be):be=e[53];let te;if(e[54]!==r||e[55]!==P||e[56]!==T){let W;e[58]!==P||e[59]!==T?(W=q=>{const Pe=P.includes(q.value);return n.jsx(ur,{onSelect:()=>{T(q)},className:"cursor-pointer",children:n.jsxs("div",{className:"flex items-center w-full",onClick:we=>{we.stopPropagation(),T(q)},children:[n.jsx(cr,{checked:Pe,onCheckedChange:()=>{T(q)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Al}),q.icon&&n.jsx(q.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),n.jsx("span",{children:q.label})]})},q.value)},e[58]=P,e[59]=T,e[60]=W):W=e[60],te=r.map(W),e[54]=r,e[55]=P,e[56]=T,e[57]=te}else te=e[57];let re;e[61]!==be||e[62]!==te?(re=n.jsxs(ws,{className:"rounded-b-xl",children:[X,n.jsxs(Ns,{children:[be,te]})]}),e[61]=be,e[62]=te,e[63]=re):re=e[63];let ce;e[64]!==G||e[65]!==re?(ce=n.jsx(Ca,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:Z,children:n.jsxs(Os,{className:"rounded-xl",children:[G,re]})}),e[64]=G,e[65]=re,e[66]=ce):ce=e[66];let je;return e[67]!==O||e[68]!==j||e[69]!==U||e[70]!==ce?(je=n.jsxs(Aa,{open:O,onOpenChange:S,modal:j,children:[U,ce]}),e[67]=O,e[68]=j,e[69]=U,e[70]=ce,e[71]=je):je=e[71],je}function Al(t){return t.stopPropagation()}function El(t){return t.stopPropagation()}function Tl(t){return t.value}function Ml(t){return!t}function Dl(){const t=Date.now(),e=300*1e3,r=Math.floor(t/e)*e,a=new Date(r);return{startDate:new Date(r-1440*60*1e3).toISOString(),endDate:a.toISOString()}}function _l(t){const e=Q.c(12);let r;e[0]!==t?(r=t??Dl(),e[0]=t,e[1]=r):r=e[1];const a=r,{org:i}=Ze();let s;e[2]!==i.id?(s={connectionId:Yt,orgId:i.id},e[2]=i.id,e[3]=s):s=e[3];const o=Zt(s);let l;e[4]!==a?(l={...a,limit:2e3,offset:0},e[4]=a,e[5]=l):l=e[5];let c;e[6]!==o||e[7]!==l?(c={client:o,toolName:"MONITORING_LOGS_LIST",toolArguments:l,staleTime:3e4,select:Ll},e[6]=o,e[7]=l,e[8]=c):c=e[8];const u=Ms(c);let d;return e[9]!==a||e[10]!==u?(d={...u,dateRange:a},e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function Ll(t){return t.structuredContent??t}function $l(t,e){if(t.length===0)return 0;const r=[...t].sort((i,s)=>i-s),a=Math.max(0,Math.min(r.length-1,Math.ceil(e*r.length)-1));return Math.round(r[a]??0)}function Bl(t,e,r,a=10){const s=e.getTime(),l=(r.getTime()-s)/24,c=new Map;for(const p of t){const j=p.toolName||"Unknown",w=c.get(j);c.set(j,{count:(w?.count??0)+1,connectionId:w?.connectionId||p.connectionId})}const u=[...c.entries()].sort((p,j)=>j[1].count-p[1].count).slice(0,a).map(([p,j])=>({name:p,connectionId:j.connectionId})),d=u.map(p=>p.name),v=[];for(let p=0;p<24;p++){const j=new Date(s+p*l),w=new Map;for(const N of d)w.set(N,{calls:0,errors:0,durations:[]});v.push({t:j.toISOString(),ts:j.getTime(),label:j.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),tools:w})}for(const p of t){const j=new Date(p.timestamp).getTime(),w=Math.floor((j-s)/l),N=Math.max(0,Math.min(23,w)),P=v[N];if(!P)continue;const C=p.toolName||"Unknown",O=P.tools.get(C);O&&(O.calls+=1,p.isError&&(O.errors+=1),Number.isFinite(p.durationMs)&&O.durations.push(p.durationMs))}const f=[],g=[],y=[],x=[];for(const p of v){const j={t:p.t,ts:p.ts,label:p.label},w={...j},N={...j},P={...j},C={...j};for(const O of d){const S=p.tools.get(O);w[O]=S.calls,C[O]=S.errors,N[O]=S.durations.length>0?Math.round(S.durations.reduce((E,M)=>E+M,0)/S.durations.length):0,P[O]=$l(S.durations,.95)}f.push(w),g.push(N),y.push(P),x.push(C)}const b={},h=new Map;return u.forEach((p,j)=>{const N=`var(--chart-${j%5+1})`;h.set(p.name,N),b[p.name]={label:p.name,color:N}}),{callsBuckets:f,latencyAvgBuckets:g,latencyP95Buckets:y,errorsBuckets:x,topTools:u,chartConfig:b,toolColors:h}}const Rl={calls:"Top Tools — Calls","latency-avg":"Top Tools — Avg Latency","latency-p95":"Top Tools — P95 Latency",errors:"Top Tools — Errors"};function zl(t,e){return e==="latency-avg"||e==="latency-p95"?t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`:String(t)}function Kl(t){const e=Q.c(5),{metricsMode:r,dateRange:a}=t,{org:i}=Ze(),s=Vt(),o=Ia()??[],{data:l,dateRange:c}=_l(a),u=l?.logs??[],d=new Date(c.startDate),v=new Date(c.endDate),{callsBuckets:f,latencyAvgBuckets:g,latencyP95Buckets:y,errorsBuckets:x,topTools:b,chartConfig:h,toolColors:p}=Bl(u,d,v,10),j=r==="latency-avg"?g:r==="latency-p95"?y:r==="errors"?x:f,w=new Map(o.map(Wl));let N;e[0]!==s||e[1]!==i.slug?(N=()=>{s({to:"/$org/$project/monitoring",params:{org:i.slug,project:aa}})},e[0]=s,e[1]=i.slug,e[2]=N):N=e[2];const P=N,C=Rl[r];let O;return e[3]!==C?(O=n.jsx("p",{className:"text-sm text-muted-foreground",children:C}),e[3]=C,e[4]=O):O=e[4],n.jsx(Ot,{title:n.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,n.jsx("div",{className:"flex items-center gap-3",children:b.slice(0,3).map(S=>{const E=w.get(S.connectionId||"");return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(st,{icon:E?.icon||null,name:S.name,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0 size-4! min-w-4! aspect-square rounded-sm"}),n.jsx("span",{className:"text-[10px] text-foreground truncate max-w-32",children:S.name})]},S.name)})})]}),onTitleClick:P,children:b.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No tool activity in this time range"}):n.jsx("div",{className:"flex flex-col gap-2 w-full h-full",children:n.jsx(Na,{className:"flex-1 min-h-0 max-h-[140px] w-full",config:h,children:n.jsxs(ml,{data:j,margin:{left:8,right:8,top:5,bottom:5},children:[n.jsx(es,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",minTickGap:60}),n.jsx(wa,{content:S=>{const{active:E,payload:M}=S;if(!E||!M||M.length===0)return null;const D=M[0]&&typeof M[0]=="object"&&"payload"in M[0]?M[0].payload?.label??"":"";return n.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:[n.jsx("div",{className:"mb-1.5 text-xs text-muted-foreground",children:D}),n.jsx("div",{className:"flex flex-col gap-1",children:[...M].sort(Fl).map(k=>{const I=String(k.dataKey??""),T=typeof k.value=="number"?k.value:0,_=typeof k.color=="string"?k.color:void 0;if(!T||T===0)return null;const L=b.find($=>$.name===I),R=w.get(L?.connectionId||"");return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:_}}),n.jsx(st,{icon:R?.icon||null,name:I,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0"}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:[I,":"]}),n.jsx("span",{className:"text-xs font-medium",children:zl(T,r)})]},I)})})]})}}),b.map(S=>n.jsx(Ya,{type:"monotone",dataKey:S.name,stroke:p.get(S.name),strokeWidth:2,animationDuration:200,dot:!1,activeDot:{r:4}},S.name))]})})})})}function Fl(t,e){const r=typeof t.value=="number"?t.value:0;return(typeof e.value=="number"?e.value:0)-r}function Wl(t){return[t.id,t]}function ql(){const t=Q.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[e,n.jsx("div",{className:"flex items-center gap-2",children:Array.from({length:3}).map(Vl)})]}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ot,{title:r,children:n.jsx("div",{className:"flex flex-col gap-2 w-full h-full",children:n.jsx("div",{className:"flex-1 min-h-0 max-h-[140px] w-full rounded bg-muted animate-pulse"})})}),t[2]=a):a=t[2],a}function Vl(t,e){return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"size-4 aspect-square rounded-md bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-16 rounded bg-muted animate-pulse"})]},e)}const Ft={Content:Kl,Skeleton:ql};function Hl(t){const e=new Map;for(const a of t){if(!a.connectionId)continue;const i=e.get(a.connectionId)??{requests:0,errors:0,totalLatency:0};e.set(a.connectionId,{requests:i.requests+1,errors:i.errors+(a.isError?1:0),totalLatency:i.totalLatency+a.durationMs})}const r=new Map;for(const[a,i]of e)r.set(a,{connectionId:a,requests:i.requests,errors:i.errors,errorRate:i.requests>0?i.errors/i.requests*100:0,avgLatencyMs:i.requests>0?i.totalLatency/i.requests:0});return r}function at(t,e){return e==="requests"?t.requests:e==="errors"?t.errorRate:t.avgLatencyMs}function Wt(t){return t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`}function Gl(t,e){return e==="requests"?t.requests.toLocaleString():e==="errors"?`${t.errorRate.toFixed(1)}%`:Wt(t.avgLatencyMs)}const Ul=[{id:"calls",dataKey:"calls",colorNum:1,barColor:"bg-chart-1",leaderboardMode:"requests",chartMetrics:["calls"],renderTitle:t=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Tool Calls"}),n.jsx("p",{className:"text-sm md:text-lg font-medium",children:t.totalCalls.toLocaleString()})]}),getNextMetric:()=>"calls"},{id:"latency",dataKey:t=>t==="latency-avg"?"avg":"p95",colorNum:4,barColor:"bg-chart-4",leaderboardMode:"latency",chartMetrics:["latency-avg","latency-p95"],renderTitle:(t,e)=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Latency"}),n.jsxs("div",{className:"flex items-baseline gap-3",children:[n.jsxs("div",{className:Ne("pb-0.5",e==="latency-avg"?"border-b-2 border-chart-4":"border-b-2 border-transparent"),children:[n.jsx("span",{className:"text-sm md:text-lg font-medium",children:Wt(t.avgDurationMs)}),n.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"avg"})]}),n.jsxs("div",{className:Ne("pb-0.5",e==="latency-p95"?"border-b-2 border-chart-4":"border-b-2 border-transparent"),children:[n.jsx("span",{className:"text-sm md:text-lg font-medium",children:Wt(t.p95DurationMs)}),n.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"p95"})]})]})]}),getNextMetric:t=>t==="latency-avg"?"latency-p95":"latency-avg"},{id:"errors",dataKey:"errors",colorNum:3,barColor:"bg-chart-3",leaderboardMode:"errors",chartMetrics:["errors"],renderTitle:t=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Errors"}),n.jsx("p",{className:"text-sm md:text-lg font-medium",children:t.totalErrors.toLocaleString()})]}),getNextMetric:()=>"errors"}];function Zl(t){const e=Q.c(12),{logs:r,connections:a,mode:i,barColor:s}=t;let o,l,c;if(e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==i){c=Symbol.for("react.early_return_sentinel");e:{const d=Hl(r),v=a??[];let f;e[7]!==i?(f=(x,b)=>at(b.metric,i)-at(x.metric,i),e[7]=i,e[8]=f):f=e[8];const g=v.map(x=>({connection:x,metric:d.get(x.id)})).filter(Yl).sort(f).slice(0,5),y=g[0]?.metric?at(g[0].metric,i):1;if(g.length===0){c=null;break e}o="space-y-1.5 mt-2",l=g.map(x=>{const{connection:b,metric:h}=x,p=at(h,i),j=y>0?Math.min(p/y*100,100):0;return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(st,{icon:b.icon,name:b.title,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0 size-4! min-w-4!"}),n.jsx("span",{className:"text-[10px] text-foreground truncate min-w-0 w-20",children:b.title}),n.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1",children:n.jsx("div",{className:Ne("h-full",s),style:{width:`${j}%`}})}),n.jsx("span",{className:"text-[10px] tabular-nums shrink-0 text-foreground",children:Gl(h,i)})]},b.id)})}e[0]=s,e[1]=a,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=c}else o=e[4],l=e[5],c=e[6];if(c!==Symbol.for("react.early_return_sentinel"))return c;let u;return e[9]!==o||e[10]!==l?(u=n.jsx("div",{className:o,children:l}),e[9]=o,e[10]=l,e[11]=u):u=e[11],u}function Yl(t){return t.metric}function Xl(t){const e=Q.c(14),{displayDateRange:r,connectionIds:a,logs:i,total:s,connections:o,selectedMetric:l,onMetricSelect:c}=t;let u,d;if(e[0]!==i||e[1]!==a||e[2]!==o||e[3]!==r||e[4]!==c||e[5]!==l||e[6]!==s){let f=i;if(a.length>1){let x;e[9]!==a?(x=b=>a.includes(b.connectionId),e[9]=a,e[10]=x):x=e[10],f=f.filter(x)}const g=a.length>1?void 0:s,y=yl(f,r,void 0,g);u="grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0 border-b border-border",d=Ul.map(x=>{const{id:b,dataKey:h,colorNum:p,barColor:j,leaderboardMode:w,chartMetrics:N,renderTitle:P,getNextMetric:C}=x,O=N.includes(l),S=()=>{c(O?C(l):N[0])};return n.jsxs("div",{className:"bg-background relative cursor-pointer",onClick:S,children:[O&&n.jsx("div",{className:"absolute top-0 left-0 right-0 h-0.5 z-10",style:{backgroundColor:`var(--chart-${p})`}}),n.jsx(Ot,{title:P(y,l),children:n.jsxs("div",{className:"flex flex-col w-full",children:[n.jsx(bl,{data:y.data,dataKey:typeof h=="function"?h(l):h,colorNum:p,chartHeight:"h-[30px] md:h-[40px]"}),n.jsx(Zl,{logs:f,connections:o,mode:w,barColor:j})]})})]},b)}),e[0]=i,e[1]=a,e[2]=o,e[3]=r,e[4]=c,e[5]=l,e[6]=s,e[7]=u,e[8]=d}else u=e[7],d=e[8];let v;return e[11]!==u||e[12]!==d?(v=n.jsx("div",{className:u,children:d}),e[11]=u,e[12]=d,e[13]=v):v=e[13],v}const rn=Object.assign(Xl,{Skeleton:Pl}),Ql=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Jl({connectionIds:t,virtualMcpIds:e,tool:r,status:a,hideSystem:i,propertyFilters:s,connectionOptions:o,virtualMcpOptions:l,activeFiltersCount:c,onUpdateFilters:u}){const[d,v]=m.useState(!1),[f,g]=m.useState("raw"),[y,x]=m.useState(r),[b,h]=m.useState(s),[p,j]=m.useState(Qe(s)),w=m.useRef(r),N=m.useRef(Re(s));w.current!==r&&(w.current=r,y!==r&&x(r));const P=Re(s);N.current!==P&&(N.current=P,h(s),j(Qe(s)));const C=(k,I)=>{const T=[...b],_=T[k];_&&(T[k]={key:I.key??_.key,operator:I.operator??_.operator,value:I.value??_.value},h(T))},O=()=>{h([...b,{key:"",operator:"eq",value:""}])},S=k=>{const I=b.filter((T,_)=>_!==k);h(I),j(Qe(I)),u({propertyFilters:Re(I)})},E=()=>{u({propertyFilters:Re(b)})},M=()=>{const k=rr(p);h(k),u({propertyFilters:Re(k)})},D=()=>{if(f==="raw"){const k=rr(p);h(k),g("form")}else j(Qe(b)),g("raw")};return n.jsxs(Aa,{open:d,onOpenChange:v,children:[n.jsx(ka,{asChild:!0,children:n.jsxs(ge,{variant:"outline",size:"sm",children:[n.jsx(ys,{size:16}),"Filters",c>0&&n.jsx(it,{variant:"default",className:"ml-1 h-5 w-5 rounded-full p-0 flex items-center justify-center text-xs",children:c})]})}),n.jsx(Ca,{align:"end",className:"w-[320px]",children:n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{children:n.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(Ts,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),n.jsx(Es,{id:"hide-system-calls",checked:i,onCheckedChange:k=>u({hideSystem:!!k})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),n.jsx(ra,{options:o,defaultValue:t,onValueChange:k=>u({connectionId:k}),placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),n.jsx(ra,{options:l,defaultValue:e,onValueChange:k=>u({virtualMcpId:k}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),n.jsx(It,{id:"filter-tool",placeholder:"Filter by tool...",value:y,onChange:k=>x(k.target.value),onBlur:()=>{y!==r&&u({tool:y})},onKeyDown:k=>{k.key==="Enter"&&y!==r&&u({tool:y})},className:"w-full"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),n.jsxs(dr,{value:a,onValueChange:k=>u({status:k}),children:[n.jsx(mr,{className:"w-full",children:n.jsx(fr,{})}),n.jsxs(pr,{children:[n.jsx(et,{value:"all",children:"All Status"}),n.jsx(et,{value:"success",children:"Success Only"}),n.jsx(et,{value:"errors",children:"Errors Only"})]})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),n.jsxs(Is,{children:[n.jsx(ks,{asChild:!0,children:n.jsx(ge,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:D,children:f==="raw"?n.jsx(bs,{size:14}):n.jsx(xs,{size:14})})}),n.jsx(Cs,{children:f==="raw"?"Switch to form view":"Switch to raw text"})]})]}),f==="raw"?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(Ss,{placeholder:`Paste property filters here:
29
29
  thread_id=abc123
30
30
  user~test
31
- debug?`,value:p,onChange:k=>j(k.target.value),onBlur:M,onKeyDown:k=>{k.key==="Enter"&&k.metaKey&&M()},className:"font-mono text-sm min-h-[80px] resize-none"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):n.jsxs("div",{className:"space-y-3",children:[b.map((k,I)=>n.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",I+1]}),n.jsx(ge,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>S(I),children:n.jsx(Sa,{size:12})})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(It,{placeholder:"Key (e.g., thread_id)",value:k.key,onChange:T=>C(I,{key:T.target.value}),onBlur:E,onKeyDown:T=>{T.key==="Enter"&&E()},className:"flex-1 font-mono text-sm"}),n.jsxs(dr,{value:k.operator,onValueChange:T=>{const _=[...b],L=_[I];L&&(_[I]={...L,operator:T,value:T==="exists"?"":L.value},h(_),u({propertyFilters:Re(_)}))},children:[n.jsx(mr,{className:"w-28",children:n.jsx(fr,{})}),n.jsx(pr,{children:Ql.map(T=>n.jsx(et,{value:T.value,children:T.label},T.value))})]})]}),k.operator!=="exists"&&n.jsx(It,{placeholder:"Value",value:k.value,onChange:T=>C(I,{value:T.target.value}),onBlur:E,onKeyDown:T=>{T.key==="Enter"&&E()},className:"w-full font-mono text-sm"})]},I)),n.jsxs(ge,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[n.jsx(Oa,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),c>0&&n.jsx(ge,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{x(""),h([]),j(""),u({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),v(!1)},children:"Clear all filters"})]})})]})}function ec(t){const e=Q.c(17),{connectionIds:r,virtualMcpIds:a,tool:i,status:s,search:o,logs:l,hasMore:c,onLoadMore:u,isLoadingMore:d,connections:v,virtualMcps:f,membersData:g}=t,y=v??[],x=f??[];let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=new Set,e[0]=b):b=e[0];const[h,p]=m.useState(b),j=Cl(u,c,d),w=g?.data?.members??[],N=new Map(w.map(ac)),P=new Map(x.map(rc));let O=l.map(A=>{const B=N.get(A.userId??""),F=A.virtualMcpId?P.get(A.virtualMcpId):null;return{...A,userName:B?.name??A.userId??"Unknown",userImage:B?.image,virtualMcpName:F?.title??null}});if(r.length>1){let A;e[1]!==r?(A=B=>r.includes(B.connectionId),e[1]=r,e[2]=A):A=e[2],O=O.filter(A)}if(a.length>1){let A;e[3]!==a?(A=B=>B.virtualMcpId&&a.includes(B.virtualMcpId),e[3]=a,e[4]=A):A=e[4],O=O.filter(A)}if(o){const A=o.toLowerCase();O=O.filter(B=>B.toolName.toLowerCase().includes(A)||B.connectionTitle.toLowerCase().includes(A)||B.errorMessage?.toLowerCase().includes(A))}let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=A=>{p(B=>{const F=new Set(B);return F.has(A.id)?F.delete(A.id):F.add(A.id),F})},e[5]=S):S=e[5];const E=S,M=new Map(y.map(tc));if(O.length===0){let A;e[6]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[6]=A):A=e[6];const B=o||r.length>0||a.length>0||i||s!=="all"?"No logs match your filters":"No logs found in this time range";let F;return e[7]!==B?(F=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Ht,{image:A,title:"No logs found",description:B})}),e[7]=B,e[8]=F):F=e[8],F}const D="flex-1 flex flex-col overflow-hidden",k="flex-1 overflow-auto",I="min-w-[600px] md:min-w-0 bg-background",T=Nn,_="w-full border-collapse";let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(On,{className:"border-b-0 z-20",children:n.jsxs(Tt,{className:"h-9 hover:bg-transparent border-b border-border",children:[n.jsx(he,{className:"w-10 md:w-12 px-2 md:px-4"}),n.jsx(he,{className:"w-5"}),n.jsx(he,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),n.jsx(he,{className:"w-24 md:w-32 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),n.jsx(he,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User Name"}),n.jsx(he,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),n.jsx(he,{className:"w-20 md:w-28 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Time"}),n.jsx(he,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Latency"}),n.jsx(he,{className:"w-16 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right pr-3 md:pr-5",children:"Status"})]})}),e[9]=L):L=e[9];const R=wn,$=O.map((A,B)=>n.jsx(vl,{log:A,isExpanded:h.has(A.id),connection:M.get(A.connectionId),virtualMcpName:A.virtualMcpName??"",onToggle:()=>E(A),lastLogRef:B===O.length-1?j:void 0},A.id));let K;e[10]!==R||e[11]!==$?(K=n.jsx(R,{children:$}),e[10]=R,e[11]=$,e[12]=K):K=e[12];let z;return e[13]!==T||e[14]!==L||e[15]!==K?(z=n.jsx("div",{className:D,children:n.jsx("div",{className:k,children:n.jsx("div",{className:I,children:n.jsxs(T,{className:_,children:[L,K]})})})}),e[13]=T,e[14]=L,e[15]=K,e[16]=z):z=e[16],z}function tc(t){return[t.id,t]}function rc(t){return[t.id,t]}function ac(t){return[t.userId,t.user]}function nc(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-muted-foreground",children:"Loading logs..."})}),t[0]=e):e=t[0],e}const an=Object.assign(ec,{Skeleton:nc});function sc(t){const e=Q.c(94),{tab:r,dateRange:a,displayDateRange:i,connectionIds:s,virtualMcpIds:o,tool:l,status:c,search:u,streaming:d,hideSystem:v,activeFiltersCount:f,from:g,to:y,propertyFilters:x,onUpdateFilters:b,onTimeRangeChange:h,onStreamingToggle:p,onTabChange:j}=t,w=Ia(),N=gs(),{data:P}=vs();let C;e[0]!==w?(C=w??[],e[0]=w,e[1]=C):C=e[1];let O;e[2]!==C?(O=C.map(lc),e[2]=C,e[3]=O):O=e[3];const S=O;let E;e[4]!==N?(E=N.map(oc),e[4]=N,e[5]=E):E=e[5];const M=E,{pageSize:D,streamingRefetchInterval:k}=bn,{org:I,locator:T}=Ze();let _;e[6]!==I.id?(_={connectionId:Yt,orgId:I.id},e[6]=I.id,e[7]=_):_=e[7];const L=Zt(_);let R,$,K;if(e[8]!==s[0]||e[9]!==s.length||e[10]!==a.endDate||e[11]!==a.startDate||e[12]!==v||e[13]!==T||e[14]!==I.id||e[15]!==x||e[16]!==c||e[17]!==l||e[18]!==o[0]||e[19]!==o.length){const ae=yn(x),Be=v?[ts.SELF(I.id)]:void 0;R={startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:s.length===1?s[0]:void 0,excludeConnectionIds:Be,virtualMcpId:o.length===1?o[0]:void 0,toolName:l||void 0,isError:c==="errors"?!0:c==="success"?!1:void 0,...ae},K=hs,$=nt.monitoringLogsInfinite(T,JSON.stringify(R)),e[8]=s[0],e[9]=s.length,e[10]=a.endDate,e[11]=a.startDate,e[12]=v,e[13]=T,e[14]=I.id,e[15]=x,e[16]=c,e[17]=l,e[18]=o[0],e[19]=o.length,e[20]=R,e[21]=$,e[22]=K}else R=e[20],$=e[21],K=e[22];let z;e[23]!==R||e[24]!==L?(z=async ae=>{const{pageParam:Be}=ae,nn=Be===void 0?0:Be;if(!L)throw new Error("MCP client is not available");const er=await L.callTool({name:"MONITORING_LOGS_LIST",arguments:{...R,limit:D,offset:nn}});return er.structuredContent??er},e[23]=R,e[24]=L,e[25]=z):z=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=(ae,Be)=>{if(!((ae?.logs?.length??0)<D))return Be.length*D},e[26]=A):A=e[26];const B=d?k:!1;let F;e[27]!==$||e[28]!==z||e[29]!==B?(F={queryKey:$,queryFn:z,initialPageParam:0,getNextPageParam:A,staleTime:0,refetchInterval:B},e[27]=$,e[28]=z,e[29]=B,e[30]=F):F=e[30];const{data:U,fetchNextPage:Z,hasNextPage:G,isFetchingNextPage:X}=K(F);let Y;e[31]!==U?.pages?(Y=U?.pages.flatMap(ic)??[],e[31]=U?.pages,e[32]=Y):Y=e[32];const ee=Y,ie=U?.pages[0]?.total;let oe;e[33]!==Z||e[34]!==G||e[35]!==X?(oe=()=>{G&&!X&&Z()},e[33]=Z,e[34]=G,e[35]=X,e[36]=oe):oe=e[36];const ye=oe,[le,be]=m.useState("calls");let te;e[37]!==i.startDate?(te=i.startDate.toISOString(),e[37]=i.startDate,e[38]=te):te=e[38];let re;e[39]!==i.endDate?(re=i.endDate.toISOString(),e[39]=i.endDate,e[40]=re):re=e[40];let ce;e[41]!==te||e[42]!==re?(ce={startDate:te,endDate:re},e[41]=te,e[42]=re,e[43]=ce):ce=e[43];const je=ce;let W;e[44]===Symbol.for("react.memo_cache_sentinel")?(W={id:"logs",label:"Connections"},e[44]=W):W=e[44];let q;e[45]===Symbol.for("react.memo_cache_sentinel")?(q=[W,{id:"dashboards",label:"Dashboards"}],e[45]=q):q=e[45];const Pe=q;let we;e[46]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx(pe.Header.Left,{children:n.jsx(mn,{children:n.jsx(fn,{children:n.jsx(pn,{children:n.jsx(vn,{children:"Monitoring"})})})})}),e[46]=we):we=e[46];let Me;e[47]!==f||e[48]!==s||e[49]!==S||e[50]!==g||e[51]!==v||e[52]!==d||e[53]!==p||e[54]!==h||e[55]!==b||e[56]!==x||e[57]!==c||e[58]!==r||e[59]!==y||e[60]!==l||e[61]!==o||e[62]!==M?(Me=r==="logs"&&n.jsx(pe.Header.Right,{children:n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(Jl,{connectionIds:s,virtualMcpIds:o,tool:l,status:c,hideSystem:v,propertyFilters:x,connectionOptions:S,virtualMcpOptions:M,activeFiltersCount:f,onUpdateFilters:b}),n.jsxs(ge,{variant:d?"secondary":"outline",size:"sm",className:Ne("h-7 px-2 sm:px-3 gap-1.5",d&&"bg-muted hover:bg-muted/80"),onClick:p,children:[d?n.jsx(Ea,{size:16,className:"animate-pulse"}):n.jsx(Ta,{size:16}),n.jsx("span",{className:"hidden sm:inline",children:d?"Streaming":"Stream"})]}),n.jsx(jn,{value:{from:g,to:y},onChange:h})]})}),e[47]=f,e[48]=s,e[49]=S,e[50]=g,e[51]=v,e[52]=d,e[53]=p,e[54]=h,e[55]=b,e[56]=x,e[57]=c,e[58]=r,e[59]=y,e[60]=l,e[61]=o,e[62]=M,e[63]=Me):Me=e[63];let De;e[64]!==Me?(De=n.jsxs(pe.Header,{children:[we,Me]}),e[64]=Me,e[65]=De):De=e[65];let _e;e[66]!==j?(_e=ae=>j(ae),e[66]=j,e[67]=_e):_e=e[67];let Le;e[68]!==_e||e[69]!==r?(Le=n.jsx("div",{className:"px-5 py-3 border-b border-border",children:n.jsx(As,{tabs:Pe,activeTab:r,onTabChange:_e})}),e[68]=_e,e[69]=r,e[70]=Le):Le=e[70];let $e;e[71]!==w||e[72]!==ee||e[73]!==N||e[74]!==je||e[75]!==s||e[76]!==i||e[77]!==ye||e[78]!==G||e[79]!==X||e[80]!==P||e[81]!==b||e[82]!==u||e[83]!==c||e[84]!==r||e[85]!==l||e[86]!==le||e[87]!==ie||e[88]!==o?($e=r==="dashboards"?n.jsx(kl,{}):n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx("div",{className:"border-b border-border relative z-10",children:n.jsx(qt,{fallback:null,children:n.jsx(m.Suspense,{fallback:n.jsx(Ft.Skeleton,{}),children:n.jsx(Ft.Content,{metricsMode:le,dateRange:je})})})}),n.jsx(rn,{displayDateRange:i,connectionIds:s,logs:ee,total:ie,connections:w,selectedMetric:le,onMetricSelect:be}),n.jsx(dn,{value:u,onChange:ae=>b({search:ae}),placeholder:"Search by tool name, connection, or error...",className:"border-t",onKeyDown:ae=>{ae.key==="Escape"&&(b({search:""}),ae.target.blur())}}),n.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:n.jsx(an,{connectionIds:s,virtualMcpIds:o,tool:l,status:c,search:u,logs:ee,hasMore:G??!1,onLoadMore:ye,isLoadingMore:X,connections:w,virtualMcps:N,membersData:P})})]}),e[71]=w,e[72]=ee,e[73]=N,e[74]=je,e[75]=s,e[76]=i,e[77]=ye,e[78]=G,e[79]=X,e[80]=P,e[81]=b,e[82]=u,e[83]=c,e[84]=r,e[85]=l,e[86]=le,e[87]=ie,e[88]=o,e[89]=$e):$e=e[89];let Xe;return e[90]!==De||e[91]!==Le||e[92]!==$e?(Xe=n.jsxs(n.Fragment,{children:[De,Le,$e]}),e[90]=De,e[91]=Le,e[92]=$e,e[93]=Xe):Xe=e[93],Xe}function ic(t){return t?.logs??[]}function oc(t){return{value:t.id??"",label:t.title??"Decopilot"}}function lc(t){return{value:t.id,label:t.title||t.id}}function du(){const t=Q.c(68),{org:e}=Ze(),r=Vt();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/$project/monitoring"},t[0]=a):a=t[0];const i=un(a),{tab:s,from:o,to:l,connectionId:c,virtualMcpId:u,tool:d,search:v,status:f,streaming:g,propertyFilters:y,hideSystem:x}=i,b=s===void 0?"logs":s;let h;t[1]!==c?(h=c===void 0?[]:c,t[1]=c,t[2]=h):h=t[2];const p=h;let j;t[3]!==u?(j=u===void 0?[]:u,t[3]=u,t[4]=j):j=t[4];const w=j,N=g===void 0?!0:g,P=y===void 0?"":y,C=x===void 0?!1:x;let O,S,E,M,D,k,I;if(t[5]!==p.length||t[6]!==o||t[7]!==C||t[8]!==r||t[9]!==e.slug||t[10]!==P||t[11]!==i||t[12]!==f||t[13]!==N||t[14]!==l||t[15]!==d||t[16]!==w.length){D=xn(P);let F;t[24]!==r||t[25]!==e.slug||t[26]!==i?(F=Y=>{r({to:"/$org/$project/monitoring",params:{org:e.slug,project:aa},search:{...i,...Y}})},t[24]=r,t[25]=e.slug,t[26]=i,t[27]=F):F=t[27],I=F;let U;t[28]!==I?(U=Y=>{I({from:Y.from,to:Y.to})},t[28]=I,t[29]=U):U=t[29],M=U;let Z,G;if(t[30]!==o||t[31]!==N||t[32]!==l){const Y=tr(o),ee=tr(l);G=Y.date||new Date(Date.now()-18e5);const ie=ee.date||new Date;E={startDate:G,endDate:ie},Z=ie,N&&l==="now"&&(Z=new Date(ie),Z.setHours(Z.getHours()+1)),t[30]=o,t[31]=N,t[32]=l,t[33]=E,t[34]=Z,t[35]=G}else E=t[33],Z=t[34],G=t[35];let X;t[36]!==Z||t[37]!==G?(X={startDate:G,endDate:Z},t[36]=Z,t[37]=G,t[38]=X):X=t[38],S=X,O=0,p.length>0&&O++,w.length>0&&O++,d&&O++,f!=="all"&&O++,C&&O++,k=D.filter(cc),t[5]=p.length,t[6]=o,t[7]=C,t[8]=r,t[9]=e.slug,t[10]=P,t[11]=i,t[12]=f,t[13]=N,t[14]=l,t[15]=d,t[16]=w.length,t[17]=O,t[18]=S,t[19]=E,t[20]=M,t[21]=D,t[22]=k,t[23]=I}else O=t[17],S=t[18],E=t[19],M=t[20],D=t[21],k=t[22],I=t[23];const T=k;T.length>0&&(O=O+T.length);let _;t[39]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(pe.Header,{children:n.jsx(pe.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[39]=_):_=t[39];let L;t[40]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-[0.5px] bg-border shrink-0 border-b",children:n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load monitoring data"})}),t[40]=L):L=t[40];let R;t[41]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsxs(n.Fragment,{children:[_,n.jsx(pe.Content,{children:n.jsxs("div",{className:"flex flex-col overflow-auto md:overflow-hidden h-full",children:[L,n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Ht,{title:"Failed to load logs",description:"There was an error loading the monitoring data. Please try again."})})]})})]}),t[41]=R):R=t[41];let $;t[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(pe.Header,{children:n.jsx(pe.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[42]=$):$=t[42];let K;t[43]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsxs(n.Fragment,{children:[$,n.jsx(pe.Content,{children:n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx("div",{className:"border-b border-border",children:n.jsx(Ft.Skeleton,{})}),n.jsx(rn.Skeleton,{}),n.jsx(an.Skeleton,{})]})})]}),t[43]=K):K=t[43];let z;t[44]!==N||t[45]!==I?(z=()=>I({streaming:!N}),t[44]=N,t[45]=I,t[46]=z):z=t[46];let A;t[47]!==I?(A=F=>I({tab:F}),t[47]=I,t[48]=A):A=t[48];let B;return t[49]!==O||t[50]!==p||t[51]!==S||t[52]!==E||t[53]!==o||t[54]!==M||t[55]!==C||t[56]!==D||t[57]!==v||t[58]!==f||t[59]!==N||t[60]!==z||t[61]!==A||t[62]!==b||t[63]!==l||t[64]!==d||t[65]!==I||t[66]!==w?(B=n.jsx(pe,{children:n.jsx(qt,{fallback:R,children:n.jsx(m.Suspense,{fallback:K,children:n.jsx(sc,{tab:b,dateRange:S,displayDateRange:E,connectionIds:p,virtualMcpIds:w,tool:d,status:f,search:v,streaming:N,hideSystem:C,activeFiltersCount:O,from:o,to:l,propertyFilters:D,onUpdateFilters:I,onTimeRangeChange:M,onStreamingToggle:z,onTabChange:A})})})}),t[49]=O,t[50]=p,t[51]=S,t[52]=E,t[53]=o,t[54]=M,t[55]=C,t[56]=D,t[57]=v,t[58]=f,t[59]=N,t[60]=z,t[61]=A,t[62]=b,t[63]=l,t[64]=d,t[65]=I,t[66]=w,t[67]=B):B=t[67],B}function cc(t){return t.key.trim()}export{du as default};
31
+ debug?`,value:p,onChange:k=>j(k.target.value),onBlur:M,onKeyDown:k=>{k.key==="Enter"&&k.metaKey&&M()},className:"font-mono text-sm min-h-[80px] resize-none"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):n.jsxs("div",{className:"space-y-3",children:[b.map((k,I)=>n.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",I+1]}),n.jsx(ge,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>S(I),children:n.jsx(Sa,{size:12})})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(It,{placeholder:"Key (e.g., thread_id)",value:k.key,onChange:T=>C(I,{key:T.target.value}),onBlur:E,onKeyDown:T=>{T.key==="Enter"&&E()},className:"flex-1 font-mono text-sm"}),n.jsxs(dr,{value:k.operator,onValueChange:T=>{const _=[...b],L=_[I];L&&(_[I]={...L,operator:T,value:T==="exists"?"":L.value},h(_),u({propertyFilters:Re(_)}))},children:[n.jsx(mr,{className:"w-28",children:n.jsx(fr,{})}),n.jsx(pr,{children:Ql.map(T=>n.jsx(et,{value:T.value,children:T.label},T.value))})]})]}),k.operator!=="exists"&&n.jsx(It,{placeholder:"Value",value:k.value,onChange:T=>C(I,{value:T.target.value}),onBlur:E,onKeyDown:T=>{T.key==="Enter"&&E()},className:"w-full font-mono text-sm"})]},I)),n.jsxs(ge,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[n.jsx(Oa,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),c>0&&n.jsx(ge,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{x(""),h([]),j(""),u({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),v(!1)},children:"Clear all filters"})]})})]})}function ec(t){const e=Q.c(17),{connectionIds:r,virtualMcpIds:a,tool:i,status:s,search:o,logs:l,hasMore:c,onLoadMore:u,isLoadingMore:d,connections:v,virtualMcps:f,membersData:g}=t,y=v??[],x=f??[];let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=new Set,e[0]=b):b=e[0];const[h,p]=m.useState(b),j=Cl(u,c,d),w=g?.data?.members??[],N=new Map(w.map(ac)),P=new Map(x.map(rc));let O=l.map(A=>{const B=N.get(A.userId??""),F=A.virtualMcpId?P.get(A.virtualMcpId):null;return{...A,userName:B?.name??A.userId??"Unknown",userImage:B?.image,virtualMcpName:F?.title??null}});if(r.length>1){let A;e[1]!==r?(A=B=>r.includes(B.connectionId),e[1]=r,e[2]=A):A=e[2],O=O.filter(A)}if(a.length>1){let A;e[3]!==a?(A=B=>B.virtualMcpId&&a.includes(B.virtualMcpId),e[3]=a,e[4]=A):A=e[4],O=O.filter(A)}if(o){const A=o.toLowerCase();O=O.filter(B=>B.toolName.toLowerCase().includes(A)||B.connectionTitle.toLowerCase().includes(A)||B.errorMessage?.toLowerCase().includes(A))}let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=A=>{p(B=>{const F=new Set(B);return F.has(A.id)?F.delete(A.id):F.add(A.id),F})},e[5]=S):S=e[5];const E=S,M=new Map(y.map(tc));if(O.length===0){let A;e[6]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[6]=A):A=e[6];const B=o||r.length>0||a.length>0||i||s!=="all"?"No logs match your filters":"No logs found in this time range";let F;return e[7]!==B?(F=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Ht,{image:A,title:"No logs found",description:B})}),e[7]=B,e[8]=F):F=e[8],F}const D="flex-1 flex flex-col overflow-hidden",k="flex-1 overflow-auto",I="min-w-[600px] md:min-w-0 bg-background",T=Nn,_="w-full border-collapse";let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(On,{className:"border-b-0 z-20",children:n.jsxs(Tt,{className:"h-9 hover:bg-transparent border-b border-border",children:[n.jsx(he,{className:"w-10 md:w-12 px-2 md:px-4"}),n.jsx(he,{className:"w-5"}),n.jsx(he,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),n.jsx(he,{className:"w-24 md:w-32 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),n.jsx(he,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User Name"}),n.jsx(he,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),n.jsx(he,{className:"w-20 md:w-28 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Time"}),n.jsx(he,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Latency"}),n.jsx(he,{className:"w-16 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right pr-3 md:pr-5",children:"Status"})]})}),e[9]=L):L=e[9];const R=wn,$=O.map((A,B)=>n.jsx(vl,{log:A,isExpanded:h.has(A.id),connection:M.get(A.connectionId),virtualMcpName:A.virtualMcpName??"",onToggle:()=>E(A),lastLogRef:B===O.length-1?j:void 0},A.id));let K;e[10]!==R||e[11]!==$?(K=n.jsx(R,{children:$}),e[10]=R,e[11]=$,e[12]=K):K=e[12];let z;return e[13]!==T||e[14]!==L||e[15]!==K?(z=n.jsx("div",{className:D,children:n.jsx("div",{className:k,children:n.jsx("div",{className:I,children:n.jsxs(T,{className:_,children:[L,K]})})})}),e[13]=T,e[14]=L,e[15]=K,e[16]=z):z=e[16],z}function tc(t){return[t.id,t]}function rc(t){return[t.id,t]}function ac(t){return[t.userId,t.user]}function nc(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-muted-foreground",children:"Loading logs..."})}),t[0]=e):e=t[0],e}const an=Object.assign(ec,{Skeleton:nc});function sc(t){const e=Q.c(94),{tab:r,dateRange:a,displayDateRange:i,connectionIds:s,virtualMcpIds:o,tool:l,status:c,search:u,streaming:d,hideSystem:v,activeFiltersCount:f,from:g,to:y,propertyFilters:x,onUpdateFilters:b,onTimeRangeChange:h,onStreamingToggle:p,onTabChange:j}=t,w=Ia(),N=gs(),{data:P}=vs();let C;e[0]!==w?(C=w??[],e[0]=w,e[1]=C):C=e[1];let O;e[2]!==C?(O=C.map(lc),e[2]=C,e[3]=O):O=e[3];const S=O;let E;e[4]!==N?(E=N.map(oc),e[4]=N,e[5]=E):E=e[5];const M=E,{pageSize:D,streamingRefetchInterval:k}=bn,{org:I,locator:T}=Ze();let _;e[6]!==I.id?(_={connectionId:Yt,orgId:I.id},e[6]=I.id,e[7]=_):_=e[7];const L=Zt(_);let R,$,K;if(e[8]!==s[0]||e[9]!==s.length||e[10]!==a.endDate||e[11]!==a.startDate||e[12]!==v||e[13]!==T||e[14]!==I.id||e[15]!==x||e[16]!==c||e[17]!==l||e[18]!==o[0]||e[19]!==o.length){const ae=yn(x),Be=v?[ts.SELF(I.id)]:void 0;R={startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:s.length===1?s[0]:void 0,excludeConnectionIds:Be,virtualMcpId:o.length===1?o[0]:void 0,toolName:l||void 0,isError:c==="errors"?!0:c==="success"?!1:void 0,...ae},K=hs,$=nt.monitoringLogsInfinite(T,JSON.stringify(R)),e[8]=s[0],e[9]=s.length,e[10]=a.endDate,e[11]=a.startDate,e[12]=v,e[13]=T,e[14]=I.id,e[15]=x,e[16]=c,e[17]=l,e[18]=o[0],e[19]=o.length,e[20]=R,e[21]=$,e[22]=K}else R=e[20],$=e[21],K=e[22];let z;e[23]!==R||e[24]!==L?(z=async ae=>{const{pageParam:Be}=ae,nn=Be===void 0?0:Be;if(!L)throw new Error("MCP client is not available");const er=await L.callTool({name:"MONITORING_LOGS_LIST",arguments:{...R,limit:D,offset:nn}});return er.structuredContent??er},e[23]=R,e[24]=L,e[25]=z):z=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=(ae,Be)=>{if(!((ae?.logs?.length??0)<D))return Be.length*D},e[26]=A):A=e[26];const B=d?k:!1;let F;e[27]!==$||e[28]!==z||e[29]!==B?(F={queryKey:$,queryFn:z,initialPageParam:0,getNextPageParam:A,staleTime:0,refetchInterval:B},e[27]=$,e[28]=z,e[29]=B,e[30]=F):F=e[30];const{data:U,fetchNextPage:Z,hasNextPage:G,isFetchingNextPage:X}=K(F);let Y;e[31]!==U?.pages?(Y=U?.pages.flatMap(ic)??[],e[31]=U?.pages,e[32]=Y):Y=e[32];const ee=Y,ie=U?.pages[0]?.total;let oe;e[33]!==Z||e[34]!==G||e[35]!==X?(oe=()=>{G&&!X&&Z()},e[33]=Z,e[34]=G,e[35]=X,e[36]=oe):oe=e[36];const ye=oe,[le,be]=m.useState("calls");let te;e[37]!==i.startDate?(te=i.startDate.toISOString(),e[37]=i.startDate,e[38]=te):te=e[38];let re;e[39]!==i.endDate?(re=i.endDate.toISOString(),e[39]=i.endDate,e[40]=re):re=e[40];let ce;e[41]!==te||e[42]!==re?(ce={startDate:te,endDate:re},e[41]=te,e[42]=re,e[43]=ce):ce=e[43];const je=ce;let W;e[44]===Symbol.for("react.memo_cache_sentinel")?(W={id:"logs",label:"Connections"},e[44]=W):W=e[44];let q;e[45]===Symbol.for("react.memo_cache_sentinel")?(q=[W,{id:"dashboards",label:"Dashboards"}],e[45]=q):q=e[45];const Pe=q;let we;e[46]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx(pe.Header.Left,{children:n.jsx(mn,{children:n.jsx(fn,{children:n.jsx(pn,{children:n.jsx(vn,{children:"Monitoring"})})})})}),e[46]=we):we=e[46];let Me;e[47]!==f||e[48]!==s||e[49]!==S||e[50]!==g||e[51]!==v||e[52]!==d||e[53]!==p||e[54]!==h||e[55]!==b||e[56]!==x||e[57]!==c||e[58]!==r||e[59]!==y||e[60]!==l||e[61]!==o||e[62]!==M?(Me=r==="logs"&&n.jsx(pe.Header.Right,{children:n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(Jl,{connectionIds:s,virtualMcpIds:o,tool:l,status:c,hideSystem:v,propertyFilters:x,connectionOptions:S,virtualMcpOptions:M,activeFiltersCount:f,onUpdateFilters:b}),n.jsxs(ge,{variant:d?"secondary":"outline",size:"sm",className:Ne("h-7 px-2 sm:px-3 gap-1.5",d&&"bg-muted hover:bg-muted/80"),onClick:p,children:[d?n.jsx(Ea,{size:16,className:"animate-pulse"}):n.jsx(Ta,{size:16}),n.jsx("span",{className:"hidden sm:inline",children:d?"Streaming":"Stream"})]}),n.jsx(jn,{value:{from:g,to:y},onChange:h})]})}),e[47]=f,e[48]=s,e[49]=S,e[50]=g,e[51]=v,e[52]=d,e[53]=p,e[54]=h,e[55]=b,e[56]=x,e[57]=c,e[58]=r,e[59]=y,e[60]=l,e[61]=o,e[62]=M,e[63]=Me):Me=e[63];let De;e[64]!==Me?(De=n.jsxs(pe.Header,{children:[we,Me]}),e[64]=Me,e[65]=De):De=e[65];let _e;e[66]!==j?(_e=ae=>j(ae),e[66]=j,e[67]=_e):_e=e[67];let Le;e[68]!==_e||e[69]!==r?(Le=n.jsx("div",{className:"px-5 py-3 border-b border-border",children:n.jsx(As,{tabs:Pe,activeTab:r,onTabChange:_e})}),e[68]=_e,e[69]=r,e[70]=Le):Le=e[70];let $e;e[71]!==w||e[72]!==ee||e[73]!==N||e[74]!==je||e[75]!==s||e[76]!==i||e[77]!==ye||e[78]!==G||e[79]!==X||e[80]!==P||e[81]!==b||e[82]!==u||e[83]!==c||e[84]!==r||e[85]!==l||e[86]!==le||e[87]!==ie||e[88]!==o?($e=r==="dashboards"?n.jsx(kl,{}):n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx("div",{className:"border-b border-border relative z-10",children:n.jsx(qt,{fallback:null,children:n.jsx(m.Suspense,{fallback:n.jsx(Ft.Skeleton,{}),children:n.jsx(Ft.Content,{metricsMode:le,dateRange:je})})})}),n.jsx(rn,{displayDateRange:i,connectionIds:s,logs:ee,total:ie,connections:w,selectedMetric:le,onMetricSelect:be}),n.jsx(dn,{value:u,onChange:ae=>b({search:ae}),placeholder:"Search by tool name, connection, or error...",className:"border-t",onKeyDown:ae=>{ae.key==="Escape"&&(b({search:""}),ae.target.blur())}}),n.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:n.jsx(an,{connectionIds:s,virtualMcpIds:o,tool:l,status:c,search:u,logs:ee,hasMore:G??!1,onLoadMore:ye,isLoadingMore:X,connections:w,virtualMcps:N,membersData:P})})]}),e[71]=w,e[72]=ee,e[73]=N,e[74]=je,e[75]=s,e[76]=i,e[77]=ye,e[78]=G,e[79]=X,e[80]=P,e[81]=b,e[82]=u,e[83]=c,e[84]=r,e[85]=l,e[86]=le,e[87]=ie,e[88]=o,e[89]=$e):$e=e[89];let Xe;return e[90]!==De||e[91]!==Le||e[92]!==$e?(Xe=n.jsxs(n.Fragment,{children:[De,Le,$e]}),e[90]=De,e[91]=Le,e[92]=$e,e[93]=Xe):Xe=e[93],Xe}function ic(t){return t?.logs??[]}function oc(t){return{value:t.id??"",label:t.title??"Decopilot"}}function lc(t){return{value:t.id,label:t.title||t.id}}function mu(){const t=Q.c(68),{org:e}=Ze(),r=Vt();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/$project/monitoring"},t[0]=a):a=t[0];const i=un(a),{tab:s,from:o,to:l,connectionId:c,virtualMcpId:u,tool:d,search:v,status:f,streaming:g,propertyFilters:y,hideSystem:x}=i,b=s===void 0?"logs":s;let h;t[1]!==c?(h=c===void 0?[]:c,t[1]=c,t[2]=h):h=t[2];const p=h;let j;t[3]!==u?(j=u===void 0?[]:u,t[3]=u,t[4]=j):j=t[4];const w=j,N=g===void 0?!0:g,P=y===void 0?"":y,C=x===void 0?!1:x;let O,S,E,M,D,k,I;if(t[5]!==p.length||t[6]!==o||t[7]!==C||t[8]!==r||t[9]!==e.slug||t[10]!==P||t[11]!==i||t[12]!==f||t[13]!==N||t[14]!==l||t[15]!==d||t[16]!==w.length){D=xn(P);let F;t[24]!==r||t[25]!==e.slug||t[26]!==i?(F=Y=>{r({to:"/$org/$project/monitoring",params:{org:e.slug,project:aa},search:{...i,...Y}})},t[24]=r,t[25]=e.slug,t[26]=i,t[27]=F):F=t[27],I=F;let U;t[28]!==I?(U=Y=>{I({from:Y.from,to:Y.to})},t[28]=I,t[29]=U):U=t[29],M=U;let Z,G;if(t[30]!==o||t[31]!==N||t[32]!==l){const Y=tr(o),ee=tr(l);G=Y.date||new Date(Date.now()-18e5);const ie=ee.date||new Date;E={startDate:G,endDate:ie},Z=ie,N&&l==="now"&&(Z=new Date(ie),Z.setHours(Z.getHours()+1)),t[30]=o,t[31]=N,t[32]=l,t[33]=E,t[34]=Z,t[35]=G}else E=t[33],Z=t[34],G=t[35];let X;t[36]!==Z||t[37]!==G?(X={startDate:G,endDate:Z},t[36]=Z,t[37]=G,t[38]=X):X=t[38],S=X,O=0,p.length>0&&O++,w.length>0&&O++,d&&O++,f!=="all"&&O++,C&&O++,k=D.filter(cc),t[5]=p.length,t[6]=o,t[7]=C,t[8]=r,t[9]=e.slug,t[10]=P,t[11]=i,t[12]=f,t[13]=N,t[14]=l,t[15]=d,t[16]=w.length,t[17]=O,t[18]=S,t[19]=E,t[20]=M,t[21]=D,t[22]=k,t[23]=I}else O=t[17],S=t[18],E=t[19],M=t[20],D=t[21],k=t[22],I=t[23];const T=k;T.length>0&&(O=O+T.length);let _;t[39]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(pe.Header,{children:n.jsx(pe.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[39]=_):_=t[39];let L;t[40]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-[0.5px] bg-border shrink-0 border-b",children:n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load monitoring data"})}),t[40]=L):L=t[40];let R;t[41]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsxs(n.Fragment,{children:[_,n.jsx(pe.Content,{children:n.jsxs("div",{className:"flex flex-col overflow-auto md:overflow-hidden h-full",children:[L,n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Ht,{title:"Failed to load logs",description:"There was an error loading the monitoring data. Please try again."})})]})})]}),t[41]=R):R=t[41];let $;t[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(pe.Header,{children:n.jsx(pe.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[42]=$):$=t[42];let K;t[43]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsxs(n.Fragment,{children:[$,n.jsx(pe.Content,{children:n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx("div",{className:"border-b border-border",children:n.jsx(Ft.Skeleton,{})}),n.jsx(rn.Skeleton,{}),n.jsx(an.Skeleton,{})]})})]}),t[43]=K):K=t[43];let z;t[44]!==N||t[45]!==I?(z=()=>I({streaming:!N}),t[44]=N,t[45]=I,t[46]=z):z=t[46];let A;t[47]!==I?(A=F=>I({tab:F}),t[47]=I,t[48]=A):A=t[48];let B;return t[49]!==O||t[50]!==p||t[51]!==S||t[52]!==E||t[53]!==o||t[54]!==M||t[55]!==C||t[56]!==D||t[57]!==v||t[58]!==f||t[59]!==N||t[60]!==z||t[61]!==A||t[62]!==b||t[63]!==l||t[64]!==d||t[65]!==I||t[66]!==w?(B=n.jsx(pe,{children:n.jsx(qt,{fallback:R,children:n.jsx(m.Suspense,{fallback:K,children:n.jsx(sc,{tab:b,dateRange:S,displayDateRange:E,connectionIds:p,virtualMcpIds:w,tool:d,status:f,search:v,streaming:N,hideSystem:C,activeFiltersCount:O,from:o,to:l,propertyFilters:D,onUpdateFilters:I,onTimeRangeChange:M,onStreamingToggle:z,onTabChange:A})})})}),t[49]=O,t[50]=p,t[51]=S,t[52]=E,t[53]=o,t[54]=M,t[55]=C,t[56]=D,t[57]=v,t[58]=f,t[59]=N,t[60]=z,t[61]=A,t[62]=b,t[63]=l,t[64]=d,t[65]=I,t[66]=w,t[67]=B):B=t[67],B}function cc(t){return t.key.trim()}export{mu as default};
@@ -1 +1 @@
1
- import{r as i,j as e}from"./index-CzFqQvXW.js";import{i as n}from"./Loading01-DvHkBn5K.js";import{h as l}from"./mcp-oauth-Dk3osgIf.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
1
+ import{r as i,j as e}from"./index-DVHuYwO5.js";import{i as n}from"./Loading01-DUUFtL7S.js";import{h as l}from"./mcp-oauth-BJK3oSr3.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};