decocms 3.3.2 → 3.4.1

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 (268) hide show
  1. package/dist/client/assets/{AlertCircle-f1EMyhcF.js → AlertCircle-Bc3r3AGq.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DDOS_CqL.js → ArrowUpRight-DfEIENBd.js} +1 -1
  3. package/dist/client/assets/{Check-CtI-OH3k.js → Check--VLhXi5l.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Dk0E48Vj.js → CheckCircle-7xc6-R3M.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BL2fNdeZ.js → ChevronDown-66ErjaPf.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-ItYaMHNU.js → ChevronLeft-DyW6EtsM.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-TMlXoq-Z.js → ChevronRight-C87PRbBa.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-O10NbvHe.js → ChevronUp-BuPeXu8C.js} +1 -1
  9. package/dist/client/assets/{Container-B1sUXs1U.js → Container-cZo3l6OX.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DNPNHBpl.js → DotsVertical-CQgc8nSx.js} +1 -1
  11. package/dist/client/assets/{Eye-DWIY-6KS.js → Eye-DHHjYDbX.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CWRo79Yt.js → FilterLines-CWR_eJ7z.js} +1 -1
  13. package/dist/client/assets/{Globe01-Cjaw-3jR.js → Globe01-B10jCcNH.js} +1 -1
  14. package/dist/client/assets/{HardDrive-Ddx5WtDi.js → HardDrive-7KMC69UH.js} +1 -1
  15. package/dist/client/assets/{Key01-ChvR9ujt.js → Key01-CTKRB2Cd.js} +1 -1
  16. package/dist/client/assets/LayoutLeft-SQH1HcmI.js +1 -0
  17. package/dist/client/assets/{LinkExternal01-Bo28LxVY.js → LinkExternal01-CjT-4hM8.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Cx9Nl0mU.js → Monitor01-svtG00ql.js} +1 -1
  19. package/dist/client/assets/{Palette-DkgVQjRz.js → Palette-CA_16qMN.js} +1 -1
  20. package/dist/client/assets/{Play-VGEgQ-36.js → Play-CrdarOgl.js} +1 -1
  21. package/dist/client/assets/{Plus-DXVOsj8b.js → Plus-C9icoBmX.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-CxP3kNii.js → RefreshCcw01-D1tvoH2_.js} +1 -1
  23. package/dist/client/assets/{SearchMd-B9xeWi0e.js → SearchMd-Di6_vvQ1.js} +1 -1
  24. package/dist/client/assets/{Settings02-DYlioLKt.js → Settings02-BylJiOHK.js} +1 -1
  25. package/dist/client/assets/{Shield01-CLHpjaQL.js → Shield01-CDSs18-B.js} +1 -1
  26. package/dist/client/assets/{Star01-BT882_xb.js → Star01-D1DEXGAi.js} +1 -1
  27. package/dist/client/assets/{Stars01-DDxsFd_C.js → Stars01-UWs0NZ30.js} +1 -1
  28. package/dist/client/assets/{Stars02-lM9wDOP9.js → Stars02-CXAcgX2g.js} +1 -1
  29. package/dist/client/assets/{Sun-CNIfXy2-.js → Sun-CCiXRotp.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-Den03c4j.js → SwitchHorizontal01-BU3C5ze8.js} +1 -1
  31. package/dist/client/assets/{Tool01-D7SzxWeU.js → Tool01-BMk00CcA.js} +1 -1
  32. package/dist/client/assets/{Trash01-C2MDqKmR.js → Trash01-MTKniuxn.js} +1 -1
  33. package/dist/client/assets/{Upload01-BTsf5tML.js → Upload01-DsrMMWgf.js} +1 -1
  34. package/dist/client/assets/{User01-B1vfX-f8.js → User01-DShN8gQ-.js} +1 -1
  35. package/dist/client/assets/{Users01-dpqTHJ7Y.js → Users01-Bvh39Ydu.js} +1 -1
  36. package/dist/client/assets/{Users03-e9b5gRLu.js → Users03--pQkY_Pm.js} +1 -1
  37. package/dist/client/assets/{X-DvNDI9Zw.js → X-D-FyhysP.js} +1 -1
  38. package/dist/client/assets/{XCircle-DBS00WN3.js → XCircle-Pgrh_mFJ.js} +1 -1
  39. package/dist/client/assets/{XClose-BdAeKt9F.js → XClose-CXixB7oH.js} +1 -1
  40. package/dist/client/assets/{Zap-aFVcxgaa.js → Zap-BcF-Iz_3.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-CC0ClMfp.js → ZapSquare-BH297b52.js} +1 -1
  42. package/dist/client/assets/ZoomOut-qupe1GUj.js +1 -0
  43. package/dist/client/assets/{access-gate-B8AAPT1T.js → access-gate-b8qBeVwB.js} +1 -1
  44. package/dist/client/assets/{accordion-BFQ7Yu8X.js → accordion-bX483Ztz.js} +1 -1
  45. package/dist/client/assets/add-section-modal-wMptfoHV.js +1 -0
  46. package/dist/client/assets/{agent-capabilities-BE7hHGoA.js → agent-capabilities-ADaK_qqp.js} +1 -1
  47. package/dist/client/assets/agent-icon-6l7Nwe2K.js +1 -0
  48. package/dist/client/assets/{agent-icons-UJTit2wi.js → agent-icons-BDS9BBHh.js} +1 -1
  49. package/dist/client/assets/agents-list-BdFiPs3r.js +1 -0
  50. package/dist/client/assets/ai-providers-lM-GGoBl.js +1 -0
  51. package/dist/client/assets/{alert-DkX6LwPv.js → alert-Ta86Z4_L.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-DKXzP7Bt.js → alert-dialog-_2G9ccD7.js} +1 -1
  53. package/dist/client/assets/app-editor-BJ_HJXFs.js +1 -0
  54. package/dist/client/assets/{auth-catchall-CmwVLqj-.js → auth-catchall-BdHpJwKo.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-COIVkHnQ.js → auth-split-layout-DVUC3dWq.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-c065EJtO.js → automation-list-row-BNHDxEG_.js} +1 -1
  57. package/dist/client/assets/{automation-runs-CPH-3xtw.js → automation-runs-BbNb5m5Z.js} +1 -1
  58. package/dist/client/assets/automations-ChMgB7Hm.js +1 -0
  59. package/dist/client/assets/{avatar-ETg7Q-GU.js → avatar-KTqg6Pir.js} +1 -1
  60. package/dist/client/assets/{badge-C8j1DE3m.js → badge-jK5_JNPO.js} +1 -1
  61. package/dist/client/assets/brand-context-D1YLW65X.js +1 -0
  62. package/dist/client/assets/buckets-CZodJDYe.js +1 -0
  63. package/dist/client/assets/{calendar-CLbDOOHw.js → calendar-DFy-BKZq.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DVzMymKs.js → capability-load-error-DUP-Lw9V.js} +1 -1
  65. package/dist/client/assets/{card-lOxFSSkP.js → card-Ce7y-Nqu.js} +1 -1
  66. package/dist/client/assets/chat-context-CpKbwwmM.js +20 -0
  67. package/dist/client/assets/{checkbox-DWa4G7u9.js → checkbox-MO2_GITU.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BGZNVK0p.js → cli-auth-success-XZzsr92m.js} +1 -1
  69. package/dist/client/assets/collection-detail-Bv6I7A_k.js +1 -0
  70. package/dist/client/assets/{collection-display-button-NMk2O1lx.js → collection-display-button-DzXqmtbd.js} +1 -1
  71. package/dist/client/assets/{collection-search-BPGQygd8.js → collection-search-CPYfTi84.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-BXPnPT96.js → collection-table-wrapper-DgzLrzuP.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-C_qWo2-y.js → collection-tabs-CIsqNrxU.js} +1 -1
  74. package/dist/client/assets/{collections-NKJwWp8f.js → collections-B-PXiD2Y.js} +1 -1
  75. package/dist/client/assets/{command-B3U7wd2O.js → command-BHmAxNRB.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-CqBwflr-.js → connect-desktop-dialog-BQZD1I8n.js} +1 -1
  77. package/dist/client/assets/{connection-card-DG_N0P2G.js → connection-card-BHzG8ppu.js} +1 -1
  78. package/dist/client/assets/connection-detail-BlmixFGl.js +1 -0
  79. package/dist/client/assets/{connection-form-helpers-D79c5tFA.js → connection-form-helpers-CgKn2eM9.js} +1 -1
  80. package/dist/client/assets/connections-D5zy3mYf.js +1 -0
  81. package/dist/client/assets/{constants-Oykg5_q9.js → constants-DI_u-hVk.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-02ukeQqS.js → decopilot-sse-pool-DPWhf2bX.js} +1 -1
  83. package/dist/client/assets/{dialog-DCjJZndp.js → dialog-Bt3zXcK6.js} +1 -1
  84. package/dist/client/assets/{domain-settings-Jn9iDH8k.js → domain-settings-CZnFXOwr.js} +1 -1
  85. package/dist/client/assets/{drawer-BTJhbpa8.js → drawer-DeHC5s3g.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-BnsK64En.js → dropdown-menu-SwrAlbwN.js} +1 -1
  87. package/dist/client/assets/dynamic-plugin-layout-WDrQTfck.js +1 -0
  88. package/dist/client/assets/{empty-state-C-NWO5ph.js → empty-state-BJFB-AwN.js} +1 -1
  89. package/dist/client/assets/{empty-state-CKyi-9Wl.js → empty-state-DlCayRAK.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-AirIeyvr.js → extract-connection-data-CrMYEI5i.js} +1 -1
  91. package/dist/client/assets/features-BgkDxOlu.js +1 -0
  92. package/dist/client/assets/file-explorer-DrueRu5k.js +2 -0
  93. package/dist/client/assets/{file-type-icon-DM9XMqae.js → file-type-icon-BHF_Ovux.js} +1 -1
  94. package/dist/client/assets/{files-BuO1w5Lh.js → files-BCcd3t2S.js} +1 -1
  95. package/dist/client/assets/{form-DMPH0FOJ.js → form-8jBGaVW7.js} +1 -1
  96. package/dist/client/assets/general-BJkPBrz3.js +1 -0
  97. package/dist/client/assets/{generate-id-i1xx8q5L.js → generate-id-Bfx7nOJH.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-CTcBo2fn.js → github-repo-picker-F4vLHgJ-.js} +1 -1
  99. package/dist/client/assets/header-tab-button-DCSg63Wl.js +5 -0
  100. package/dist/client/assets/{hover-card-CxtN1xCB.js → hover-card-DcJvwauT.js} +1 -1
  101. package/dist/client/assets/{image-field-HoCNk-1B.js → image-field-cind3dwC.js} +1 -1
  102. package/dist/client/assets/index-BIANv7ur.js +1 -0
  103. package/dist/client/assets/{index-DtSBWsbe.js → index-Bac2tQWh.js} +1 -1
  104. package/dist/client/assets/{index-CALXjj7d.js → index-BrIVZCzt.js} +1 -1
  105. package/dist/client/assets/index-BzoFvbIH.js +1 -0
  106. package/dist/client/assets/{index-C7oVr4Gj.js → index-C0t_9xyr.js} +1 -1
  107. package/dist/client/assets/{index-N_rB2zyq.js → index-C1kxS2Io.js} +1 -1
  108. package/dist/client/assets/index-C3tcbzRj.js +3 -0
  109. package/dist/client/assets/{index-Bja6OpPs.js → index-C_oSBqFD.js} +3 -3
  110. package/dist/client/assets/index-CfGIr4vM.js +310 -0
  111. package/dist/client/assets/index-ChzbgMa2.js +1 -0
  112. package/dist/client/assets/index-D5dv4kfs.css +1 -0
  113. package/dist/client/assets/{index-CB2ubqvZ.js → index-DEWYXjIf.js} +3 -3
  114. package/dist/client/assets/{index-lU9yS_Jh.js → index-DML39Lt-.js} +1 -1
  115. package/dist/client/assets/{index-xAwaYY9z.js → index-DQj7btfC.js} +15 -15
  116. package/dist/client/assets/{index-C6M-_40T.js → index-DlcvFOU2.js} +1 -1
  117. package/dist/client/assets/{index-DUzjuDnX.js → index-d7-A3CDs.js} +1 -1
  118. package/dist/client/assets/{index-redirect-Bh1l7WCU.js → index-redirect-KnAJlqvx.js} +1 -1
  119. package/dist/client/assets/{infiniteQueryObserver-DFB-ygfX.js → infiniteQueryObserver-w8EJyyrI.js} +1 -1
  120. package/dist/client/assets/{input-D9gxUyjr.js → input-Ct22kLSY.js} +1 -1
  121. package/dist/client/assets/{integration-icon-BffTGZN4.js → integration-icon-CNf7sZ5b.js} +1 -1
  122. package/dist/client/assets/{label-BL0BsZ1B.js → label-CvDTa89d.js} +1 -1
  123. package/dist/client/assets/{layout-CfSS4bsq.js → layout-Dkxj2bFg.js} +1 -1
  124. package/dist/client/assets/{login-BuZSwsso.js → login-Dv6Rz1bY.js} +1 -1
  125. package/dist/client/assets/{members-D7WrKG_A.js → members-BQXsk1m4.js} +2 -2
  126. package/dist/client/assets/{monaco-editor-DtMcxLSi.js → monaco-editor-DR4yoUjc.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-fp6agr8k.js → monitoring-stats-row-Co70p3-n.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-d6LUyXrn.js → oauth-callback-CQPHoHy-.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-CkKiZhn4.js → oauth-callback-ai-provider-BJeYyFlX.js} +1 -1
  130. package/dist/client/assets/{onboarding-DfbOcrIX.js → onboarding-CzNreyu4.js} +1 -1
  131. package/dist/client/assets/{org-install-CFDYPwCg.js → org-install-aZxuYxoI.js} +1 -1
  132. package/dist/client/assets/{org-layout-WeQp4B6-.js → org-layout-CR6iFjC9.js} +1 -1
  133. package/dist/client/assets/org-plugin-layout-Ah6P36_M.js +1 -0
  134. package/dist/client/assets/{page-seo-form-BAg1yciU.js → page-seo-form-BzX1ts5p.js} +1 -1
  135. package/dist/client/assets/page-seo-sheet-v7xZnlYi.js +1 -0
  136. package/dist/client/assets/pair--AN1yq4g.js +39 -0
  137. package/dist/client/assets/{plugin-empty-state-9CxATRN3.js → plugin-empty-state-CIZ1bBrP.js} +1 -1
  138. package/dist/client/assets/{plugin-header-7GRdizIh.js → plugin-header-CExvgCKI.js} +1 -1
  139. package/dist/client/assets/{plugin-layout-CJOy-tZB.js → plugin-layout-DS-orBC-.js} +1 -1
  140. package/dist/client/assets/{popover-OiarPewu.js → popover-DXn7orE4.js} +1 -1
  141. package/dist/client/assets/{post-editor-BQ_9KZ48.js → post-editor-bszZQHpg.js} +3 -3
  142. package/dist/client/assets/{primitives-pd_yvF0S.js → primitives-CIXky-Gt.js} +1 -1
  143. package/dist/client/assets/profile-CZWeJMEP.js +1 -0
  144. package/dist/client/assets/project-app-view-DJMvDwFa.js +1 -0
  145. package/dist/client/assets/record-editor-C5KWfSLg.js +1 -0
  146. package/dist/client/assets/registry-CX2hi2E3.js +2 -0
  147. package/dist/client/assets/{registry-layout-D6FuqVAe.js → registry-layout-DjFUi3yC.js} +1 -1
  148. package/dist/client/assets/{require-capability-DVkbMmft.js → require-capability-DDbNSPG5.js} +1 -1
  149. package/dist/client/assets/{required-auth-layout-CRGKVRTF.js → required-auth-layout-Bpv6G5uE.js} +1 -1
  150. package/dist/client/assets/{reset-password-DsVXpYD9.js → reset-password-D1T0PiTj.js} +1 -1
  151. package/dist/client/assets/{resizable-a1gJgrB1.js → resizable-Bi3jkg9o.js} +1 -1
  152. package/dist/client/assets/roles-BBWw8puD.js +1 -0
  153. package/dist/client/assets/{save-status-DRXktsXS.js → save-status-PzXq6KUK.js} +1 -1
  154. package/dist/client/assets/{schema-form-DvpyibqS.js → schema-form-CM7pfylQ.js} +1 -1
  155. package/dist/client/assets/{scroll-area-Ds73tc0J.js → scroll-area-BNzrPnq5.js} +1 -1
  156. package/dist/client/assets/{search-input-BNN911DE.js → search-input-C76EA-t6.js} +1 -1
  157. package/dist/client/assets/secrets-DMEa7GIW.js +1 -0
  158. package/dist/client/assets/{sections-editor-6P4Yegkk.js → sections-editor--GuZPQzC.js} +2 -2
  159. package/dist/client/assets/{select-fwtyEN3G.js → select-D_4UU9rK.js} +1 -1
  160. package/dist/client/assets/{select-model-D7RFa4up.js → select-model-cV_VUU8G.js} +1 -1
  161. package/dist/client/assets/seo-editor-fhccoPNR.js +1 -0
  162. package/dist/client/assets/settings-layout-DH37q17x.js +1 -0
  163. package/dist/client/assets/{settings-section-T0fDyncu.js → settings-section-DsXtuKDY.js} +1 -1
  164. package/dist/client/assets/sheet-D01YX9h0.js +1 -0
  165. package/dist/client/assets/shell-controls-CNVI6ZJJ.js +1 -0
  166. package/dist/client/assets/{shell-layout-I9tl7R9J.js → shell-layout-xPMsY5hC.js} +1 -1
  167. package/dist/client/assets/{shell-route-loading-CdGn4Kpm.js → shell-route-loading-jPQ9XajT.js} +1 -1
  168. package/dist/client/assets/sidebar-CJNdWlwy.js +1 -0
  169. package/dist/client/assets/{skeleton-CM-Pi0cm.js → skeleton-DEf5lpEA.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-KFDeRhD3.js → sortable.esm-KhkNVCRe.js} +1 -1
  171. package/dist/client/assets/{spinner-D4UjUyLz.js → spinner-srK7FwNe.js} +1 -1
  172. package/dist/client/assets/sso-BLXKmxlD.js +1 -0
  173. package/dist/client/assets/store-DydXTg6V.js +1 -0
  174. package/dist/client/assets/store-registry-BJqdtxTv.js +2 -0
  175. package/dist/client/assets/{switch-DB7mlnDa.js → switch-Cbu6JSI9.js} +1 -1
  176. package/dist/client/assets/{tab-id-BFVzx5fb.js → tab-id-CbYpEVAZ.js} +11 -11
  177. package/dist/client/assets/{table-Cd_YQk4M.js → table-dr9K2jWM.js} +1 -1
  178. package/dist/client/assets/{tabs-Dsmq9_wP.js → tabs-CJU0nxr6.js} +1 -1
  179. package/dist/client/assets/{task-status-C990ALOP.js → task-status-Dyf8qaxz.js} +1 -1
  180. package/dist/client/assets/{textarea-DGZy_omr.js → textarea-BquesfD_.js} +1 -1
  181. package/dist/client/assets/{toggle-group-BkLJ1frl.js → toggle-group-m3q7pubc.js} +1 -1
  182. package/dist/client/assets/{toolbar-Bnt0c2J3.js → toolbar-Bkxu3n7s.js} +1 -1
  183. package/dist/client/assets/{tools-list-Dpd5zOg1.js → tools-list-CG_BLK1j.js} +1 -1
  184. package/dist/client/assets/{tooltip-BvIsFjJR.js → tooltip-Bm-whGHF.js} +1 -1
  185. package/dist/client/assets/{types-Dn1K45P2.js → types-Bkz2p_os.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-BQwBnNI3.js → use-ai-providers-B82V9Np8.js} +1 -1
  187. package/dist/client/assets/{use-automations-BEPg-aek.js → use-automations-B5qTxkL8.js} +1 -1
  188. package/dist/client/assets/{use-capability-rrurYBXm.js → use-capability-DpFGw1TU.js} +1 -1
  189. package/dist/client/assets/{use-collections-e25i0NM-.js → use-collections-iUV-5kFm.js} +1 -1
  190. package/dist/client/assets/{use-connection-BQxCYR_o.js → use-connection-DTKE65yR.js} +1 -1
  191. package/dist/client/assets/{use-copy-BKbXbMuY.js → use-copy-Dr7XRETN.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-trxCQUHO.js → use-create-virtual-mcp-DlMteKXP.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-Oryp4cAP.js → use-debounced-autosave-DFapff8c.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-DEEK0oTT.js → use-delete-connection-CU96IyMZ.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-Qrd6eZyZ.js → use-file-configs-C8ipJXZL.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-DcQNoJ7_.js → use-infinite-scroll-KU0QCoEE.js} +1 -1
  197. package/dist/client/assets/{use-list-state-BoOb09L9.js → use-list-state-DtwRJx6R.js} +1 -1
  198. package/dist/client/assets/{use-mcp-prompts-D9JZQ88U.js → use-mcp-prompts-aLA3FcF_.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-DkcEQK3V.js → use-mcp-tools-CK1DUQVb.js} +1 -1
  200. package/dist/client/assets/{use-members-DERsL77r.js → use-members-C9apz-8a.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-sJoZ-Wbv.js → use-navigate-to-agent-DRRtr51U.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-CF8P1btO.js → use-org-auth-client-CI8XyYuM.js} +1 -1
  203. package/dist/client/assets/{use-org-sso-D2JNbrnR.js → use-org-sso-CYBgAyDV.js} +1 -1
  204. package/dist/client/assets/{use-organization-roles-Ca1byRHM.js → use-organization-roles-C5ABG30J.js} +1 -1
  205. package/dist/client/assets/{use-organization-settings-CVmm-jyI.js → use-organization-settings-B4ywx3QZ.js} +1 -1
  206. package/dist/client/assets/{use-registry-connections-B6OVBI_G.js → use-registry-connections-B-c9LId-.js} +1 -1
  207. package/dist/client/assets/{use-secrets-_k7d1I4Z.js → use-secrets-D3irvtLI.js} +1 -1
  208. package/dist/client/assets/{use-status-sounds-gVglgYnC.js → use-status-sounds-BEbMXd3N.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-DdD0TD2N.js → use-view-mode-Jd_CE1Mx.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-BNfSbQBW.js → use-virtual-mcp-DsdNWb58.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-DrZL_IGs.js +1 -0
  212. package/dist/client/assets/{useRouterState-CI4Wmw4H.js → useRouterState-CU2GqlKv.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-CN1mQR7i.js +1 -0
  214. package/dist/client/assets/{user-ChT4iOGQ.js → user-sLZtiN2i.js} +1 -1
  215. package/dist/client/assets/{view-mode-toggle-DCljG_Km.js → view-mode-toggle-DSmCr2tD.js} +1 -1
  216. package/dist/client/assets/workflow-BK9KKo6T.js +1 -0
  217. package/dist/client/assets/workflow-detail-DzASvQVR.js +1 -0
  218. package/dist/client/deck-runtime/v1/deck-viewer.js +1516 -0
  219. package/dist/client/index.html +2 -2
  220. package/dist/server/cli.js +542 -539
  221. package/dist/server/migrate.js +90 -90
  222. package/dist/server/server.js +287 -287
  223. package/package.json +1 -1
  224. package/dist/client/assets/ZoomOut-Bj5jamAx.js +0 -1
  225. package/dist/client/assets/add-section-modal-BmCzDi10.js +0 -1
  226. package/dist/client/assets/agent-icon-D4vfmbIE.js +0 -1
  227. package/dist/client/assets/agents-list-LpRFwfeM.js +0 -1
  228. package/dist/client/assets/ai-providers-BqYvRcM4.js +0 -1
  229. package/dist/client/assets/app-editor-CIaq7eCO.js +0 -1
  230. package/dist/client/assets/automations-jHIRR-Gp.js +0 -1
  231. package/dist/client/assets/brand-context-pJc99xfz.js +0 -1
  232. package/dist/client/assets/buckets-CD20kw5y.js +0 -1
  233. package/dist/client/assets/chat-context-Bnval_3z.js +0 -20
  234. package/dist/client/assets/collection-detail-BQV4fFQi.js +0 -1
  235. package/dist/client/assets/connection-detail-BxZdoV6Y.js +0 -1
  236. package/dist/client/assets/connections-BKRkcjPX.js +0 -1
  237. package/dist/client/assets/dynamic-plugin-layout-DI1tAQQN.js +0 -1
  238. package/dist/client/assets/features-CCh1HKhB.js +0 -1
  239. package/dist/client/assets/file-explorer-BQmgDEDi.js +0 -2
  240. package/dist/client/assets/general-BorJGZAV.js +0 -1
  241. package/dist/client/assets/header-tab-button-CJMFloVi.js +0 -3
  242. package/dist/client/assets/index-BNc5J02Q.js +0 -1
  243. package/dist/client/assets/index-CTo6iOJE.js +0 -1
  244. package/dist/client/assets/index-DRkA4nnL.js +0 -3
  245. package/dist/client/assets/index-DzP6PZZ7.css +0 -1
  246. package/dist/client/assets/index-tZSWGe84.js +0 -1
  247. package/dist/client/assets/index-t_7wQBv1.js +0 -310
  248. package/dist/client/assets/org-plugin-layout-CtY6eOb7.js +0 -1
  249. package/dist/client/assets/page-seo-sheet-CG4OfDmr.js +0 -1
  250. package/dist/client/assets/pair-CCKXkNYO.js +0 -39
  251. package/dist/client/assets/profile-BQDabc6t.js +0 -1
  252. package/dist/client/assets/project-app-view-B6xEMwDB.js +0 -1
  253. package/dist/client/assets/record-editor-DeENCgCd.js +0 -1
  254. package/dist/client/assets/registry-C8DHcJ9B.js +0 -2
  255. package/dist/client/assets/roles-CX312B39.js +0 -1
  256. package/dist/client/assets/secrets-BeeL9rnH.js +0 -1
  257. package/dist/client/assets/seo-editor-CsFpa8ZP.js +0 -1
  258. package/dist/client/assets/settings-layout-DwCpTLea.js +0 -1
  259. package/dist/client/assets/sheet-IM6_8Cdx.js +0 -1
  260. package/dist/client/assets/shell-controls-VlzjU05Z.js +0 -1
  261. package/dist/client/assets/sidebar-CAkfGpdS.js +0 -1
  262. package/dist/client/assets/sso-B5mHZmOT.js +0 -1
  263. package/dist/client/assets/store-DVYNpmdS.js +0 -1
  264. package/dist/client/assets/store-registry-DRdcwU2X.js +0 -2
  265. package/dist/client/assets/useInfiniteQuery-Bj3r3xlf.js +0 -1
  266. package/dist/client/assets/useSuspenseInfiniteQuery-BbAiO9h1.js +0 -1
  267. package/dist/client/assets/workflow-BbaQXvps.js +0 -1
  268. package/dist/client/assets/workflow-detail-CU9YTyf_.js +0 -1
@@ -1,8 +1,8 @@
1
- import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as rs,d as ls,t as xt,E as os}from"./index-Bja6OpPs.js";import{S as as}from"./search-input-BNN911DE.js";import{P as Me}from"./index-N_rB2zyq.js";import{E as wt}from"./empty-state-CKyi-9Wl.js";import{R as ns}from"./require-capability-DVkbMmft.js";import{B as rt}from"./badge-C8j1DE3m.js";import{P as ct,a as dt,b as mt}from"./popover-OiarPewu.js";import{b as Ze,T as et,a as tt}from"./tooltip-BvIsFjJR.js";import{i as ft}from"./Check-CtI-OH3k.js";import{a as Xe}from"./Eye-DWIY-6KS.js";import{n as Mt}from"./Globe01-Cjaw-3jR.js";import{i as Vt}from"./FilterLines-CWRo79Yt.js";import{i as is}from"./Key01-ChvR9ujt.js";import{i as cs}from"./Play-VGEgQ-36.js";import{a7 as ds,a8 as ms,P as us,E as xs}from"./agent-icon-D4vfmbIE.js";import{M as _t}from"./monaco-editor-DtMcxLSi.js";import{u as fs}from"./use-members-DERsL77r.js";import{u as Dt}from"./use-connection-BQxCYR_o.js";import{S as St,u as It,W as ps}from"./constants-Oykg5_q9.js";import{a as hs}from"./use-virtual-mcp-BNfSbQBW.js";import{n as Qe}from"./Container-B1sUXs1U.js";import{c as gs}from"./SwitchHorizontal01-Den03c4j.js";import{s as js}from"./Plus-DXVOsj8b.js";import{s as vs}from"./Trash01-C2MDqKmR.js";import{I as Ge}from"./input-D9gxUyjr.js";import{g as Ns,b as Lt,f as st,a as Ut,c as pt,d as bs,e as Ft,h as Kt,A as ys,T as ws,i as Ss,M as ht}from"./automation-runs-CPH-3xtw.js";import{S as lt,a as ot,b as at,c as Fe,d as nt}from"./select-fwtyEN3G.js";import{S as Is}from"./scroll-area-Ds73tc0J.js";import{t as qt}from"./ChevronDown-BL2fNdeZ.js";import{C as Cs}from"./calendar-CLbDOOHw.js";import{T as ks}from"./textarea-DGZy_omr.js";import{C as Bt}from"./collection-tabs-C_qWo2-y.js";import{S as Ts}from"./switch-DB7mlnDa.js";import{L as Ms}from"./label-BL0BsZ1B.js";import{I as qe}from"./integration-icon-BffTGZN4.js";import{A as Ht}from"./avatar-ETg7Q-GU.js";import{A as _s,a as Ds,b as Ls}from"./alert-DkX6LwPv.js";import{C as Jt}from"./card-lOxFSSkP.js";import{K as ke}from"./monitoring-stats-row-fp6agr8k.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-BbAiO9h1.js";import{d as Rs,S as Os,a as zs,b as Es}from"./sheet-IM6_8Cdx.js";import{T as De,a as ut,b as Gt,c as Qt,d as Wt,e as oe}from"./table-Cd_YQk4M.js";import{n as Ps}from"./ChevronUp-O10NbvHe.js";import{u as As}from"./use-infinite-scroll-DcQNoJ7_.js";import{c as Vs,b as Us}from"./use-automations-BEPg-aek.js";import"./SearchMd-B9xeWi0e.js";import"./sidebar-CAkfGpdS.js";import"./use-capability-rrurYBXm.js";import"./access-gate-B8AAPT1T.js";import"./capability-load-error-DVzMymKs.js";import"./AlertCircle-f1EMyhcF.js";import"./Tool01-D7SzxWeU.js";import"./RefreshCcw01-CxP3kNii.js";import"./XCircle-DBS00WN3.js";import"./ArrowUpRight-DDOS_CqL.js";import"./ZapSquare-CC0ClMfp.js";import"./Users03-e9b5gRLu.js";import"./CheckCircle-Dk0E48Vj.js";import"./ChevronLeft-ItYaMHNU.js";import"./ChevronRight-TMlXoq-Z.js";import"./DotsVertical-DNPNHBpl.js";import"./ZoomOut-Bj5jamAx.js";import"./Star01-BT882_xb.js";import"./Palette-DkgVQjRz.js";import"./HardDrive-Ddx5WtDi.js";import"./Stars02-lM9wDOP9.js";import"./LinkExternal01-Bo28LxVY.js";import"./Monitor01-Cx9Nl0mU.js";import"./Sun-CNIfXy2-.js";import"./Settings02-DYlioLKt.js";import"./Shield01-CLHpjaQL.js";import"./Stars01-DDxsFd_C.js";import"./Upload01-BTsf5tML.js";import"./User01-B1vfX-f8.js";import"./Users01-dpqTHJ7Y.js";import"./XClose-BdAeKt9F.js";import"./X-DvNDI9Zw.js";import"./Zap-aFVcxgaa.js";import"./index-CALXjj7d.js";import"./spinner-D4UjUyLz.js";import"./use-org-auth-client-CF8P1btO.js";import"./use-collections-e25i0NM-.js";import"./useInfiniteQuery-Bj3r3xlf.js";import"./infiniteQueryObserver-DFB-ygfX.js";import"./task-status-C990ALOP.js";import"./checkbox-DWa4G7u9.js";import"./command-B3U7wd2O.js";import"./index-DtSBWsbe.js";import"./dialog-DCjJZndp.js";import"./pair-CCKXkNYO.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BKbXbMuY.js";import"./file-type-icon-DM9XMqae.js";import"./content-blocks-o63cs2vh.js";import"./types-Dn1K45P2.js";import"./chat-context-Bnval_3z.js";import"./tab-id-BFVzx5fb.js";import"./decopilot-sse-pool-02ukeQqS.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-BQwBnNI3.js";import"./use-organization-settings-CVmm-jyI.js";import"./shell-layout-I9tl7R9J.js";import"./required-auth-layout-CRGKVRTF.js";import"./useRouterState-CI4Wmw4H.js";import"./use-org-sso-D2JNbrnR.js";import"./use-navigate-to-agent-sJoZ-Wbv.js";import"./use-mcp-prompts-D9JZQ88U.js";import"./form-DMPH0FOJ.js";import"./index-C6M-_40T.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function Ks(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as rs,d as ls,t as xt,E as os}from"./index-C_oSBqFD.js";import{S as as}from"./search-input-C76EA-t6.js";import{P as Me}from"./index-C1kxS2Io.js";import{E as wt}from"./empty-state-DlCayRAK.js";import{R as ns}from"./require-capability-DDbNSPG5.js";import{B as rt}from"./badge-jK5_JNPO.js";import{P as ct,a as dt,b as mt}from"./popover-DXn7orE4.js";import{b as Ze,T as et,a as tt}from"./tooltip-Bm-whGHF.js";import{i as ft}from"./Check--VLhXi5l.js";import{a as Xe}from"./Eye-DHHjYDbX.js";import{n as Mt}from"./Globe01-B10jCcNH.js";import{i as Vt}from"./FilterLines-CWR_eJ7z.js";import{i as is}from"./Key01-CTKRB2Cd.js";import{i as cs}from"./Play-CrdarOgl.js";import{a6 as ds,a7 as ms,O as us,D as xs}from"./agent-icon-6l7Nwe2K.js";import{M as _t}from"./monaco-editor-DR4yoUjc.js";import{u as fs}from"./use-members-C9apz-8a.js";import{u as Dt}from"./use-connection-DTKE65yR.js";import{S as St,u as It,W as ps}from"./constants-DI_u-hVk.js";import{a as hs}from"./use-virtual-mcp-DsdNWb58.js";import{n as Qe}from"./Container-cZo3l6OX.js";import{c as gs}from"./SwitchHorizontal01-BU3C5ze8.js";import{s as js}from"./Plus-C9icoBmX.js";import{s as vs}from"./Trash01-MTKniuxn.js";import{I as Ge}from"./input-Ct22kLSY.js";import{g as Ns,b as Lt,f as st,a as Ut,c as pt,d as bs,e as Ft,h as Kt,A as ys,T as ws,i as Ss,M as ht}from"./automation-runs-BbNb5m5Z.js";import{S as lt,a as ot,b as at,c as Fe,d as nt}from"./select-D_4UU9rK.js";import{S as Is}from"./scroll-area-BNzrPnq5.js";import{t as qt}from"./ChevronDown-66ErjaPf.js";import{C as Cs}from"./calendar-DFy-BKZq.js";import{T as ks}from"./textarea-BquesfD_.js";import{C as Bt}from"./collection-tabs-CIsqNrxU.js";import{S as Ts}from"./switch-Cbu6JSI9.js";import{L as Ms}from"./label-CvDTa89d.js";import{I as qe}from"./integration-icon-CNf7sZ5b.js";import{A as Ht}from"./avatar-KTqg6Pir.js";import{A as _s,a as Ds,b as Ls}from"./alert-Ta86Z4_L.js";import{C as Jt}from"./card-Ce7y-Nqu.js";import{K as ke}from"./monitoring-stats-row-Co70p3-n.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-CN1mQR7i.js";import{d as Rs,S as Os,a as zs,b as Es}from"./sheet-D01YX9h0.js";import{T as De,a as ut,b as Gt,c as Qt,d as Wt,e as oe}from"./table-dr9K2jWM.js";import{n as As}from"./ChevronUp-BuPeXu8C.js";import{u as Ps}from"./use-infinite-scroll-KU0QCoEE.js";import{c as Vs,b as Us}from"./use-automations-B5qTxkL8.js";import"./SearchMd-Di6_vvQ1.js";import"./sidebar-CJNdWlwy.js";import"./LayoutLeft-SQH1HcmI.js";import"./use-capability-DpFGw1TU.js";import"./access-gate-b8qBeVwB.js";import"./capability-load-error-DUP-Lw9V.js";import"./AlertCircle-Bc3r3AGq.js";import"./Tool01-BMk00CcA.js";import"./RefreshCcw01-D1tvoH2_.js";import"./XCircle-Pgrh_mFJ.js";import"./ArrowUpRight-DfEIENBd.js";import"./ZapSquare-BH297b52.js";import"./Users03--pQkY_Pm.js";import"./CheckCircle-7xc6-R3M.js";import"./ChevronLeft-DyW6EtsM.js";import"./ChevronRight-C87PRbBa.js";import"./DotsVertical-CQgc8nSx.js";import"./ZoomOut-qupe1GUj.js";import"./Star01-D1DEXGAi.js";import"./Palette-CA_16qMN.js";import"./HardDrive-7KMC69UH.js";import"./Stars02-CXAcgX2g.js";import"./LinkExternal01-CjT-4hM8.js";import"./Monitor01-svtG00ql.js";import"./Sun-CCiXRotp.js";import"./Settings02-BylJiOHK.js";import"./Shield01-CDSs18-B.js";import"./Stars01-UWs0NZ30.js";import"./Upload01-DsrMMWgf.js";import"./User01-DShN8gQ-.js";import"./Users01-Bvh39Ydu.js";import"./XClose-CXixB7oH.js";import"./X-D-FyhysP.js";import"./Zap-BcF-Iz_3.js";import"./index-BrIVZCzt.js";import"./spinner-srK7FwNe.js";import"./use-org-auth-client-CI8XyYuM.js";import"./use-collections-iUV-5kFm.js";import"./useInfiniteQuery-DrZL_IGs.js";import"./infiniteQueryObserver-w8EJyyrI.js";import"./task-status-Dyf8qaxz.js";import"./checkbox-MO2_GITU.js";import"./command-BHmAxNRB.js";import"./index-Bac2tQWh.js";import"./dialog-Bt3zXcK6.js";import"./pair--AN1yq4g.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dr7XRETN.js";import"./file-type-icon-BHF_Ovux.js";import"./content-blocks-o63cs2vh.js";import"./types-Bkz2p_os.js";import"./chat-context-CpKbwwmM.js";import"./tab-id-CbYpEVAZ.js";import"./decopilot-sse-pool-DPWhf2bX.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-B82V9Np8.js";import"./use-organization-settings-B4ywx3QZ.js";import"./shell-layout-xPMsY5hC.js";import"./required-auth-layout-Bpv6G5uE.js";import"./useRouterState-CU2GqlKv.js";import"./use-org-sso-CYBgAyDV.js";import"./use-navigate-to-agent-DRRtr51U.js";import"./use-mcp-prompts-aLA3FcF_.js";import"./form-8jBGaVW7.js";import"./index-DlcvFOU2.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function Ks(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function $t(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function qs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=vt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,vt.maxJsonRenderSize)+`
4
4
 
5
- ... [TRUNCATED - content too large to display]`,isTruncated:!0,originalSize:r}}function Ot(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function Bs(s){const e=le.c(116),{log:r}=s,[l,a]=K.useState(!1),[o,c]=K.useState(!1),d=bt(),{org:n}=Be(),i=Rt(r.input),m=Rt(r.output),j=Hs;let v;e[0]!==r.input||e[1]!==r.output?(v=async se=>{const re=j(se==="input"?r.input:r.output);try{await navigator.clipboard.writeText(re),se==="input"?(a(!0),setTimeout(()=>a(!1),2e3)):(c(!0),setTimeout(()=>c(!1),2e3))}catch{Ce.error("Failed to copy to clipboard")}},e[0]=r.input,e[1]=r.output,e[2]=v):v=e[2];const b=v;let x;e[3]!==r.id||e[4]!==r.input||e[5]!==r.output||e[6]!==r.toolName?(x=se=>{const re=j(se==="input"?r.input:r.output),ie=new Blob([re],{type:"application/json"}),pe=URL.createObjectURL(ie),ye=document.createElement("a");ye.href=pe,ye.download=`${r.toolName}-${se}-${r.id}.json`,ye.click(),URL.revokeObjectURL(pe)},e[3]=r.id,e[4]=r.input,e[5]=r.output,e[6]=r.toolName,e[7]=x):x=e[7];const L=x;let p;e[8]!==r.connectionId||e[9]!==r.input||e[10]!==r.toolName||e[11]!==d||e[12]!==n.slug?(p=()=>{const se=crypto.randomUUID();sessionStorage.setItem(`replay-${se}`,JSON.stringify(r.input)),d({to:"/$org/settings/connections/$connectionId/$collectionName/$itemId",params:{org:n.slug,connectionId:r.connectionId,collectionName:"tools",itemId:encodeURIComponent(r.toolName)},search:{replayId:se}})},e[8]=r.connectionId,e[9]=r.input,e[10]=r.toolName,e[11]=d,e[12]=n.slug,e[13]=p):p=e[13];const g=p,[u,k]=K.useState(!1);let S;e[14]!==r.requestId?(S=async()=>{try{await navigator.clipboard.writeText(r.requestId),k(!0),setTimeout(()=>k(!1),2e3)}catch{Ce.error("Failed to copy to clipboard")}},e[14]=r.requestId,e[15]=S):S=e[15];const h=S;let T;e[16]!==r.timestamp?(T=new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[16]=r.timestamp,e[17]=T):T=e[17];const I=T,f="text-sm px-5 md:px-6 py-5 space-y-5";let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Timestamp"}),e[18]=M):M=e[18];let y;e[19]!==I?(y=t.jsxs("div",{children:[M,t.jsx("div",{className:"text-sm text-foreground",children:I})]}),e[19]=I,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Duration"}),e[21]=R):R=e[21];let C;e[22]!==r.durationMs?(C=t.jsxs("div",{children:[R,t.jsxs("div",{className:"text-sm font-mono text-foreground",children:[r.durationMs,"ms"]})]}),e[22]=r.durationMs,e[23]=C):C=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[24]=E):E=e[24];let F;e[25]!==r.userName?(F=t.jsxs("div",{children:[E,t.jsx("div",{className:"text-sm text-foreground",children:r.userName})]}),e[25]=r.userName,e[26]=F):F=e[26];let H;e[27]!==r.virtualMcpName?(H=r.virtualMcpName&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsx("div",{className:"text-sm text-foreground",children:r.virtualMcpName})]}),e[27]=r.virtualMcpName,e[28]=H):H=e[28];let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Request ID"}),e[29]=A):A=e[29];let W;e[30]!==r.requestId?(W=t.jsx("code",{className:"font-mono text-foreground text-[11px]",children:r.requestId}),e[30]=r.requestId,e[31]=W):W=e[31];let w;e[32]!==u?(w=u?t.jsx(ft,{size:12}):t.jsx(Xe,{size:12}),e[32]=u,e[33]=w):w=e[33];let _;e[34]!==h||e[35]!==w?(_=t.jsx(Z,{size:"icon",variant:"ghost",onClick:h,"aria-label":"Copy request ID",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:w}),e[34]=h,e[35]=w,e[36]=_):_=e[36];let $;e[37]!==W||e[38]!==_?($=t.jsxs("div",{children:[A,t.jsxs("div",{className:"flex items-center gap-1",children:[W,_]})]}),e[37]=W,e[38]=_,e[39]=$):$=e[39];let O;e[40]!==r.userAgent?(O=r.userAgent&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Client"}),t.jsx("div",{className:"text-sm font-mono text-foreground",children:r.userAgent})]}),e[40]=r.userAgent,e[41]=O):O=e[41];let z;e[42]!==r.properties||e[43]!==d||e[44]!==n.slug?(z=r.properties&&Object.keys(r.properties).length>0&&t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Properties"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(r.properties).map(se=>{const[re,ie]=se;return t.jsxs(ct,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(rt,{variant:"secondary",className:"font-mono text-xs px-2 py-0.5 cursor-pointer hover:bg-secondary/80 transition-colors",children:[re,"=",ie]})}),t.jsx(mt,{className:"w-auto p-1",align:"end",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:()=>{const pe={key:re,operator:"eq",value:ie};d({to:"/$org/settings/monitor",params:{org:n.slug},search:{propertyFilters:Le([pe])}})},children:[t.jsx(Vt,{size:14,className:"mr-2"}),"Filter by this property"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(`${re}=${ie}`),Ce.success("Copied filter to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(Xe,{size:14,className:"mr-2"}),"Copy filter"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(re),Ce.success("Copied key to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(is,{size:14,className:"mr-2"}),"Copy key"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(ie),Ce.success("Copied value to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(ds,{size:14,className:"mr-2"}),"Copy value"]})]})})]},re)})})]}),e[42]=r.properties,e[43]=d,e[44]=n.slug,e[45]=z):z=e[45];let V;e[46]!==C||e[47]!==F||e[48]!==H||e[49]!==$||e[50]!==O||e[51]!==z||e[52]!==y?(V=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[y,C,F,H,$,O,z]}),e[46]=C,e[47]=F,e[48]=H,e[49]=$,e[50]=O,e[51]=z,e[52]=y,e[53]=V):V=e[53];let q;e[54]!==r.errorMessage?(q=r.errorMessage&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-destructive mb-1",children:"Error"}),t.jsx("div",{className:"text-destructive font-mono text-xs bg-destructive/10 p-2 rounded break-all",children:r.errorMessage})]}),e[54]=r.errorMessage,e[55]=q):q=e[55];const J="space-y-4";let G;e[56]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Input"}),e[56]=G):G=e[56];const Q=i.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Ot(i.originalSize)," - truncated)"]});let U;e[57]!==Q?(U=t.jsxs("div",{className:"flex items-center gap-2",children:[G,Q]}),e[57]=Q,e[58]=U):U=e[58];let P;e[59]!==g||e[60]!==r.input?(P=r.input&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:g,"aria-label":"Replay tool call",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(cs,{size:14})})}),t.jsx(tt,{children:"Replay tool call"})]}),e[59]=g,e[60]=r.input,e[61]=P):P=e[61];let N;e[62]!==L||e[63]!==i?(N=i.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>L("input"),"aria-label":"Download full input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Mt,{size:14})})}),t.jsx(tt,{children:"Download full input"})]}),e[62]=L,e[63]=i,e[64]=N):N=e[64];let D;e[65]!==b?(D=()=>b("input"),e[65]=b,e[66]=D):D=e[66];let B;e[67]!==l?(B=l?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[67]=l,e[68]=B):B=e[68];let ee;e[69]!==D||e[70]!==B?(ee=t.jsx(Z,{size:"icon",variant:"ghost",onClick:D,"aria-label":"Copy input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:B}),e[69]=D,e[70]=B,e[71]=ee):ee=e[71];let X;e[72]!==P||e[73]!==N||e[74]!==ee?(X=t.jsxs("div",{className:"flex items-center gap-1",children:[P,N,ee]}),e[72]=P,e[73]=N,e[74]=ee,e[75]=X):X=e[75];let te;e[76]!==U||e[77]!==X?(te=t.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 border-b border-border",children:[U,X]}),e[76]=U,e[77]=X,e[78]=te):te=e[78];let Y;e[79]!==i?(Y=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(_t,{code:i.content,language:"json",height:"100%",readOnly:!0})}),e[79]=i,e[80]=Y):Y=e[80];let ae;e[81]!==te||e[82]!==Y?(ae=t.jsx("div",{children:t.jsxs("div",{className:"rounded-lg overflow-hidden border border-border",children:[te,Y]})}),e[81]=te,e[82]=Y,e[83]=ae):ae=e[83];const _e="rounded-lg overflow-hidden border border-border",$e="flex items-center justify-between p-1 pl-4 border-b border-border",Se="flex items-center gap-2";let ne;e[84]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Output"}),e[84]=ne):ne=e[84];const he=m.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Ot(m.originalSize)," - truncated)"]});let ge;e[85]!==ne||e[86]!==he?(ge=t.jsxs("div",{className:Se,children:[ne,he]}),e[85]=ne,e[86]=he,e[87]=ge):ge=e[87];let je;e[88]!==L||e[89]!==m.isTruncated?(je=m.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>L("output"),"aria-label":"Download full output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Mt,{size:14})})}),t.jsx(tt,{children:"Download full output"})]}),e[88]=L,e[89]=m.isTruncated,e[90]=je):je=e[90];let ve;e[91]!==b?(ve=()=>b("output"),e[91]=b,e[92]=ve):ve=e[92];let Ne;e[93]!==o?(Ne=o?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[93]=o,e[94]=Ne):Ne=e[94];let de;e[95]!==ve||e[96]!==Ne?(de=t.jsx(Z,{size:"icon",variant:"ghost",onClick:ve,"aria-label":"Copy output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:Ne}),e[95]=ve,e[96]=Ne,e[97]=de):de=e[97];let be;e[98]!==je||e[99]!==de?(be=t.jsxs("div",{className:"flex items-center gap-1",children:[je,de]}),e[98]=je,e[99]=de,e[100]=be):be=e[100];let me;e[101]!==ge||e[102]!==be?(me=t.jsxs("div",{className:$e,children:[ge,be]}),e[101]=ge,e[102]=be,e[103]=me):me=e[103];let ue;e[104]!==m.content?(ue=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(_t,{code:m.content,language:"json",height:"100%",readOnly:!0})}),e[104]=m.content,e[105]=ue):ue=e[105];let xe;e[106]!==me||e[107]!==ue?(xe=t.jsx("div",{children:t.jsxs("div",{className:_e,children:[me,ue]})}),e[106]=me,e[107]=ue,e[108]=xe):xe=e[108];let fe;e[109]!==ae||e[110]!==xe?(fe=t.jsxs("div",{className:J,children:[ae,xe]}),e[109]=ae,e[110]=xe,e[111]=fe):fe=e[111];let Re;return e[112]!==V||e[113]!==q||e[114]!==fe?(Re=t.jsxs("div",{className:f,children:[V,q,fe]}),e[112]=V,e[113]=q,e[114]=fe,e[115]=Re):Re=e[115],Re}function Hs(s){return JSON.stringify(s,null,2)}const Xt=/^now(?:-(\d+)([mhdwM]))?$/,Js={m:"minute",h:"hour",d:"day",w:"week",M:"month"};function Yt(s){const e=s.trim();if(e==="now")return{isNow:!0,offset:0,unit:null};const r=e.match(Xt);if(!r)return null;const l=r[1]?Number.parseInt(r[1],10):0,a=r[2]||null;return{isNow:!0,offset:l,unit:a}}function we(s){const e=s.trim(),r=new Date(e);if(!Number.isNaN(r.getTime())&&e.includes("-"))return{valid:!0,date:r};const l=Yt(e);if(!l)return{valid:!1,date:null,error:'Invalid expression. Use "now" or "now-Xu" (e.g., now-2d, now-3h)'};const a=new Date,o=new Date(a);if(l.offset===0||!l.unit)return{valid:!0,date:o};switch(l.unit){case"m":o.setMinutes(o.getMinutes()-l.offset);break;case"h":o.setHours(o.getHours()-l.offset);break;case"d":o.setDate(o.getDate()-l.offset);break;case"w":o.setDate(o.getDate()-l.offset*7);break;case"M":o.setMonth(o.getMonth()-l.offset);break}return{valid:!0,date:o}}function Gs(s){return s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Zt(s){const e=s.trim();return Xt.test(e)}function zt(s){const e=s.trim();if(e==="now")return"Now";const r=Yt(e);if(!r||!r.unit){const o=we(e);return o.valid&&o.date?Gs(o.date):e}const l=Js[r.unit],a=r.offset!==1?"s":"";return`${r.offset} ${l}${a} ago`}const es=[{label:"Last 5 minutes",from:"now-5m",to:"now",value:"5m"},{label:"Last 15 minutes",from:"now-15m",to:"now",value:"15m"},{label:"Last 30 minutes",from:"now-30m",to:"now",value:"30m"},{label:"Last 1 hour",from:"now-1h",to:"now",value:"1h"},{label:"Last 3 hours",from:"now-3h",to:"now",value:"3h"},{label:"Last 6 hours",from:"now-6h",to:"now",value:"6h"},{label:"Last 12 hours",from:"now-12h",to:"now",value:"12h"},{label:"Last 24 hours",from:"now-24h",to:"now",value:"24h"},{label:"Last 2 days",from:"now-2d",to:"now",value:"2d"},{label:"Last 7 days",from:"now-7d",to:"now",value:"7d"},{label:"Last 30 days",from:"now-30d",to:"now",value:"30d"}];function Qs(s,e){const r=es.find(l=>l.from===s&&l.to===e);return r?r.label:`${zt(s)} to ${zt(e)}`}function Je(s){const e=s.getFullYear(),r=String(s.getMonth()+1).padStart(2,"0"),l=String(s.getDate()).padStart(2,"0"),a=String(s.getHours()).padStart(2,"0"),o=String(s.getMinutes()).padStart(2,"0"),c=String(s.getSeconds()).padStart(2,"0");return`${e}-${r}-${l} ${a}:${o}:${c}`}function Ws(s){const e=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(!e)return null;const[,r,l,a,o,c,d]=e,n=new Date(Number(r),Number(l)-1,Number(a),Number(o),Number(c),Number(d));return Number.isNaN(n.getTime())?null:n}function gt(s){if(Zt(s))return s;const e=we(s);return e.valid&&e.date?Je(e.date):s}function Et({value:s,onChange:e,placeholder:r="now or now-2d",className:l,disabled:a,error:o}){const[c,d]=K.useState(!1),[n,i]=K.useState(()=>gt(s)),[m,j]=K.useState(),[v,b]=K.useState(!1),x=K.useRef(s);x.current!==s&&(x.current=s,v||i(gt(s)));const L=f=>{const M=f.target.value;i(M),j(void 0)},p=()=>{b(!0)},g=()=>{b(!1);const f=n.trim();if(Zt(f)){j(void 0),e(f);return}const M=Ws(f);if(M){j(void 0),e(M.toISOString()),i(Je(M));return}const y=we(f);if(y.valid&&y.date){j(void 0),e(f),i(Je(y.date));return}i(gt(s)),j(void 0)},u=f=>{if(f){const y=we(s).date||new Date;f.setHours(y.getHours()),f.setMinutes(y.getMinutes()),f.setSeconds(0),f.setMilliseconds(0);const R=f.toISOString();i(Je(f)),e(R),j(void 0)}d(!1)},k=f=>{const[M,y]=f.target.value.split(":").map(Number),C=we(s).date||new Date;C.setHours(M||0),C.setMinutes(y||0),C.setSeconds(0),C.setMilliseconds(0);const E=C.toISOString();i(Je(C)),e(E)},S=we(s),h=S.valid?S.date:new Date,T=h?`${String(h.getHours()).padStart(2,"0")}:${String(h.getMinutes()).padStart(2,"0")}`:"",I=o||m;return t.jsxs("div",{className:ce("flex gap-1",l),children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Ge,{value:n,onChange:L,onFocus:p,onBlur:g,placeholder:r,disabled:a,className:ce("text-sm h-8",I&&"border-destructive focus-visible:ring-destructive")}),I&&t.jsx("p",{className:"text-xs text-destructive mt-1",children:I})]}),t.jsxs(ct,{open:c,onOpenChange:d,children:[t.jsx(dt,{asChild:!0,children:t.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",disabled:a,children:t.jsx(ms,{className:"h-4 w-4"})})}),t.jsxs(mt,{className:"w-auto p-0",align:"end",children:[t.jsx(Cs,{mode:"single",selected:h||void 0,onSelect:u,initialFocus:!0}),t.jsxs("div",{className:"border-t p-3",children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"Time"}),t.jsx(Ge,{type:"time",value:T,onChange:k,className:"text-sm h-8"})]})]})]})]})}function Xs({value:s,onChange:e,className:r,disabled:l,quickRanges:a=es}){const[o,c]=K.useState(!1),[d,n]=K.useState(s.from),[i,m]=K.useState(s.to),[j,v]=K.useState(null),b=K.useRef({from:s.from,to:s.to});(b.current.from!==s.from||b.current.to!==s.to)&&(b.current={from:s.from,to:s.to},n(s.from),m(s.to));const x=u=>{b.current={from:u.from,to:u.to},n(u.from),m(u.to),c(!1),e({from:u.from,to:u.to})},L=()=>{const u=we(d),k=we(i);if(!u.valid||!u.date){v("Invalid 'From' date");return}if(!k.valid||!k.date){v("Invalid 'To' date");return}if(u.date>=k.date){v("'From' must be before 'To'");return}v(null),e({from:d,to:i}),c(!1)},p=u=>s.from===u.from&&s.to===u.to,g=Qs(s.from,s.to);return t.jsxs(ct,{open:o,onOpenChange:c,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:ce("gap-1.5 min-w-[160px] justify-between",r),disabled:l,children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(us,{className:"size-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:g})]}),t.jsx(qt,{className:"size-4 text-muted-foreground"})]})}),t.jsx(mt,{className:"w-[540px] p-0",align:"end",sideOffset:4,onCloseAutoFocus:u=>u.preventDefault(),style:o?void 0:{animationDuration:"0s"},children:t.jsxs("div",{className:"flex",children:[t.jsxs("div",{className:"flex-1 p-4 border-r",children:[t.jsx("h4",{className:"text-sm font-medium mb-4",children:"Absolute time range"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"From"}),t.jsx(Et,{value:d,onChange:n,placeholder:"now-24h"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"To"}),t.jsx(Et,{value:i,onChange:m,placeholder:"now"})]}),j&&t.jsx("p",{className:"text-xs text-destructive",children:j}),t.jsx(Z,{onClick:L,className:"w-full",size:"sm",children:"Apply time range"})]})]}),t.jsx("div",{className:"w-[200px]",children:t.jsx(Is,{className:"h-[280px]",children:t.jsx("div",{className:"p-2",children:a.map(u=>{const k=p(u);return t.jsx("button",{type:"button",onClick:()=>x(u),className:ce("w-full text-left px-3 py-2 text-sm rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground",k&&"bg-accent text-accent-foreground font-medium"),children:u.label},u.value)})})})})]})})]})}const ts="decopilot";async function ss(s,e){const r=await s.callTool({name:"MONITORING_STATS",arguments:e});if(r.isError)throw new Error("MONITORING_STATS tool returned an error");return r.structuredContent??r}function Ys(s,e){const r=le.c(15),{org:l}=Be();let a;r[0]!==l.id||r[1]!==l.slug?(a={connectionId:St,orgId:l.id,orgSlug:l.slug},r[0]=l.id,r[1]=l.slug,r[2]=a):a=r[2];const o=It(a);let c,d,n;r[3]!==l.id||r[4]!==s?(n={...s,excludeConnectionIds:[ts,...s.excludeConnectionIds??[]]},d=yt,c=it.monitoringStatsToolCalls(l.id,JSON.stringify(n)),r[3]=l.id,r[4]=s,r[5]=c,r[6]=d,r[7]=n):(c=r[5],d=r[6],n=r[7]);let i;r[8]!==o||r[9]!==n?(i=()=>ss(o,n),r[8]=o,r[9]=n,r[10]=i):i=r[10];let m;return r[11]!==e||r[12]!==c||r[13]!==i?(m={queryKey:c,queryFn:i,staleTime:3e4,retry:!1,...e},r[11]=e,r[12]=c,r[13]=i,r[14]=m):m=r[14],d(m)}function Zs(s,e){const r=le.c(15),{org:l}=Be();let a;r[0]!==l.id||r[1]!==l.slug?(a={connectionId:St,orgId:l.id,orgSlug:l.slug},r[0]=l.id,r[1]=l.slug,r[2]=a):a=r[2];const o=It(a);let c,d,n;r[3]!==l.id||r[4]!==s?(n={...s,connectionIds:[ts],topN:5,llmUsage:!0,userIds:s.userIds?.length?s.userIds:void 0},d=yt,c=it.monitoringStatsLlm(l.id,JSON.stringify(n)),r[3]=l.id,r[4]=s,r[5]=c,r[6]=d,r[7]=n):(c=r[5],d=r[6],n=r[7]);let i;r[8]!==o||r[9]!==n?(i=()=>ss(o,n),r[8]=o,r[9]=n,r[10]=i):i=r[10];let m;return r[11]!==e||r[12]!==c||r[13]!==i?(m={queryKey:c,queryFn:i,staleTime:3e4,retry:!1,...e},r[11]=e,r[12]=c,r[13]=i,r[14]=m):m=r[14],d(m)}function Te(s){const e=le.c(20),{title:r,value:l,action:a,children:o,className:c}=s;let d;e[0]!==c?(d=ce("pt-4 px-4 pb-6 gap-8",c),e[0]=c,e[1]=d):d=e[1];let n;e[2]!==r?(n=t.jsx("span",{className:"text-sm text-foreground/70",children:r}),e[2]=r,e[3]=n):n=e[3];let i;e[4]!==l?(i=t.jsx("span",{className:"text-4xl font-normal",children:l}),e[4]=l,e[5]=i):i=e[5];let m;e[6]!==n||e[7]!==i?(m=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[n,i]}),e[6]=n,e[7]=i,e[8]=m):m=e[8];let j;e[9]!==a?(j=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=j):j=e[10];let v;e[11]!==m||e[12]!==j?(v=t.jsxs("div",{className:"flex items-start justify-between",children:[m,j]}),e[11]=m,e[12]=j,e[13]=v):v=e[13];let b;e[14]!==o?(b=o&&t.jsx("div",{className:"flex flex-col gap-6",children:o}),e[14]=o,e[15]=b):b=e[15];let x;return e[16]!==d||e[17]!==v||e[18]!==b?(x=t.jsxs(Jt,{className:d,children:[v,b]}),e[16]=d,e[17]=v,e[18]=b,e[19]=x):x=e[19],x}function jt(s){const e=le.c(14),{metrics:r,connections:l,mode:a,total:o}=s,{org:c}=Be(),d=bt();let n,i,m;if(e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==d||e[4]!==c||e[5]!==o){m=Symbol.for("react.early_return_sentinel");e:{const v=l??[],b=new Map(r.map(tr));let x;e[9]!==a?(x=(p,g)=>{const u=Ft(p.metric,a);return Ft(g.metric,a)-u},e[9]=a,e[10]=x):x=e[10];const L=v.map(p=>({connection:p,metric:b.get(p.id)})).filter(er).sort(x).slice(0,4);if(L.length===0){m=null;break e}n="flex flex-col",i=L.map((p,g)=>{const{connection:u,metric:k}=p,S=o>0?(k.calls/o*100).toFixed(1):"0.0",h=a==="errors"?`${k.errorRate.toFixed(1)}%`:`${S}%`,T=g===L.length-1;return t.jsxs("div",{className:ce("flex items-center h-10 px-3 cursor-pointer hover:bg-accent/50 transition-colors",!T&&"border-b border-border/50"),onClick:()=>d({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:Fs(u)}}),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:u.icon,name:u.title,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-6! min-w-6! rounded-md"}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:u.title})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsx("span",{className:"text-sm text-foreground/30 tabular-nums",children:h}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:bs(k,a)})]})]},u.id)})}e[0]=l,e[1]=r,e[2]=a,e[3]=d,e[4]=c,e[5]=o,e[6]=n,e[7]=i,e[8]=m}else n=e[6],i=e[7],m=e[8];if(m!==Symbol.for("react.early_return_sentinel"))return m;let j;return e[11]!==n||e[12]!==i?(j=t.jsx("div",{className:n,children:i}),e[11]=n,e[12]=i,e[13]=j):j=e[13],j}function er(s){return s.metric}function tr(s){return[s.connectionId,s]}const Pt=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function At(s){let e=0;for(let r=0;r<s.length;r++)e=e*31+s.charCodeAt(r)>>>0;return Pt[e%Pt.length]}function He(s){const e=le.c(21),{models:r,mode:l}=s,a=l===void 0?"calls":l;if(r.length===0)return null;let o;e[0]!==a?(o=x=>a==="tokens"?(x.inputTokens??0)+(x.outputTokens??0):a==="cost"?x.costUsd??0:x.calls,e[0]=a,e[1]=o):o=e[1];const c=o;let d;e[2]!==a?(d=x=>a==="cost"?Ut(x):a==="tokens"?st(x):x.toLocaleString(),e[2]=a,e[3]=d):d=e[3];const n=d;let i;e[4]!==c?(i=(x,L)=>x+c(L),e[4]=c,e[5]=i):i=e[5];const m=r.reduce(i,0);let j,v;if(e[6]!==n||e[7]!==r||e[8]!==m||e[9]!==c){let x;e[12]!==c?(x=(g,u)=>c(u)-c(g),e[12]=c,e[13]=x):x=e[13];const L=[...r].sort(x).slice(0,4);j="flex flex-col";let p;e[14]!==n||e[15]!==m||e[16]!==c?(p=(g,u,k)=>{const S=c(g),h=m>0?(S/m*100).toFixed(1):"0.0",T=u===k.length-1;return t.jsxs("div",{className:ce("flex items-center h-10 px-3",!T&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-6 rounded-md border border-border/10 shadow-sm flex items-center justify-center shrink-0",style:{backgroundColor:`color-mix(in oklch, ${At(g.toolName)} 18%, transparent)`},children:t.jsx(Qe,{size:14,style:{color:At(g.toolName)}})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:g.toolName})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsxs("span",{className:"text-sm text-foreground/30 tabular-nums",children:[h,"%"]}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:n(S)})]})]},g.toolName)},e[14]=n,e[15]=m,e[16]=c,e[17]=p):p=e[17],v=L.map(p),e[6]=n,e[7]=r,e[8]=m,e[9]=c,e[10]=j,e[11]=v}else j=e[10],v=e[11];let b;return e[18]!==j||e[19]!==v?(b=t.jsx("div",{className:j,children:v}),e[18]=j,e[19]=v,e[20]=b):b=e[20],b}function sr(s){const e=le.c(48),{displayDateRange:r,connectionIds:l,excludeConnectionIds:a,toolName:o,status:c,connections:d,isStreaming:n,streamingRefetchInterval:i,llmUserIds:m}=s,j=Ns(r),v=n?i:!1;let b;e[0]!==v?(b={refetchInterval:v},e[0]=v,e[1]=b):b=e[1];const{data:x,isError:L}=Ys({interval:j,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:l.length>0?l:void 0,excludeConnectionIds:a,toolNames:o?[o]:void 0,status:c},b);let p;e[2]!==v?(p={refetchInterval:v},e[2]=v,e[3]=p):p=e[3];const{data:g,isError:u}=Zs({interval:j,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),userIds:m?.length?m:void 0},p),k=L||u,S=x?{totalCalls:x.totalCalls,totalErrors:x.totalErrors,avgDurationMs:x.avgDurationMs,p95DurationMs:x.p95DurationMs,data:Lt(x.timeseries,r,j)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},h=g?{totalCalls:g.totalCalls,totalErrors:g.totalErrors,avgDurationMs:g.avgDurationMs,p95DurationMs:g.p95DurationMs,data:Lt(g.timeseries,r,j)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]};let T;e[4]!==g?.topTools?(T=g?.topTools??[],e[4]=g?.topTools,e[5]=T):T=e[5];const I=T,f=g?.totalInputTokens??0,M=g?.totalOutputTokens??0,y=g?.totalTokens??0,R=g?.totalCostUsd??0;let C;e[6]!==x?.connectionBreakdown?(C=x?.connectionBreakdown??[],e[6]=x?.connectionBreakdown,e[7]=C):C=e[7];const E=C,[F,H]=K.useState("avg");let A;e[8]!==k?(A=k&&t.jsxs(_s,{variant:"destructive",children:[t.jsx(rs,{}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(Ds,{children:"Failed to load monitoring data"}),t.jsx(Ls,{children:"We couldn't fetch your monitoring stats right now. Please try again later."})]})]}),e[8]=k,e[9]=A):A=e[9];let W;e[10]===Symbol.for("react.memo_cache_sentinel")?(W=_e=>H(_e),e[10]=W):W=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(lt,{className:"w-[120px]",children:t.jsx(ot,{})}),e[11]=w):w=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(at,{children:[t.jsx(Fe,{value:"avg",children:"Avg"}),t.jsx(Fe,{value:"p95",children:"P95"})]}),e[12]=_):_=e[12];let $;e[13]!==F?($=t.jsxs(nt,{value:F,onValueChange:W,children:[w,_]}),e[13]=F,e[14]=$):$=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"AI Usage"}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),e[15]=O):O=e[15];let z;e[16]!==I?(z=t.jsx(He,{models:I,mode:"calls"}),e[16]=I,e[17]=z):z=e[17];let V;e[18]!==y?(V=st(y),e[18]=y,e[19]=V):V=e[19];let q;e[20]!==f?(q=st(f),e[20]=f,e[21]=q):q=e[21];let J;e[22]!==M?(J=st(M),e[22]=M,e[23]=J):J=e[23];let G;e[24]!==q||e[25]!==J?(G=t.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[q," in ·"," ",J," out"]}),e[24]=q,e[25]=J,e[26]=G):G=e[26];let Q;e[27]!==I?(Q=t.jsx(He,{models:I,mode:"tokens"}),e[27]=I,e[28]=Q):Q=e[28];let U;e[29]!==R?(U=R>0?Ut(R):"—",e[29]=R,e[30]=U):U=e[30];let P;e[31]!==R?(P=R===0?t.jsx("span",{className:"text-xs text-muted-foreground",children:"No provider cost data"}):void 0,e[31]=R,e[32]=P):P=e[32];let N;e[33]!==I||e[34]!==R?(N=R>0?t.jsx(He,{models:I,mode:"cost"}):t.jsx("div",{className:"flex items-center justify-center h-20 text-center text-xs text-muted-foreground px-4",children:"Cost is reported only for the deco AI Gateway and OpenRouter providers."}),e[33]=I,e[34]=R,e[35]=N):N=e[35];let D;e[36]!==I?(D=t.jsx(He,{models:I,mode:"calls"}),e[36]=I,e[37]=D):D=e[37];const B=Te,ee="AI Errors",X=h.totalErrors.toLocaleString();let te;e[38]!==h.data?(te=t.jsx(ke,{data:h.data,dataKey:"errors",colorNum:3,chartHeight:"h-[80px] md:h-[120px]"}),e[38]=h.data,e[39]=te):te=e[39];let Y;e[40]!==I||e[41]!==h.totalErrors?(Y=h.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No AI errors in this period"}):t.jsx(He,{models:I,mode:"calls"}),e[40]=I,e[41]=h.totalErrors,e[42]=Y):Y=e[42];let ae;return e[43]!==B||e[44]!==X||e[45]!==te||e[46]!==Y?(ae=t.jsxs(B,{title:ee,value:X,children:[te,Y]}),e[43]=B,e[44]=X,e[45]=te,e[46]=Y,e[47]=ae):ae=e[47],t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-2 pb-6 max-w-[1200px] mx-auto w-full overflow-auto",children:[A,t.jsxs(Te,{title:"Tool Calls",value:S.totalCalls.toLocaleString(),children:[t.jsx(ke,{data:S.data,dataKey:"calls",colorNum:1,chartHeight:"h-[120px] md:h-[180px]",variant:"area"}),t.jsx(jt,{metrics:E,connections:d,mode:"requests",total:S.totalCalls})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(Te,{title:"Latency",value:pt(F==="avg"?S.avgDurationMs:S.p95DurationMs),action:$,children:[t.jsx(ke,{data:S.data,dataKey:F,colorNum:4,chartHeight:"h-[120px] md:h-[180px]"}),t.jsx(jt,{metrics:E,connections:d,mode:"latency",total:S.totalCalls})]}),t.jsxs(Te,{title:"Errors",value:S.totalErrors.toLocaleString(),children:[t.jsx(ke,{data:S.data,dataKey:"errors",colorNum:3,chartHeight:"h-[120px] md:h-[180px]"}),S.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No errors in this period"}):t.jsx(jt,{metrics:E,connections:d,mode:"errors",total:S.totalErrors})]})]}),O,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs(Te,{title:"AI Calls",value:h.totalCalls.toLocaleString(),children:[t.jsx(ke,{data:h.data,dataKey:"calls",colorNum:1,chartHeight:"h-[80px] md:h-[120px]"}),z]}),t.jsxs(Te,{title:"Tokens",value:V,action:G,children:[t.jsx(ke,{data:h.data,dataKey:"totalTokens",colorNum:2,chartHeight:"h-[80px] md:h-[120px]"}),Q]}),t.jsxs(Te,{title:"Cost",value:U,action:P,children:[t.jsx(ke,{data:h.data,dataKey:"costUsd",colorNum:5,chartHeight:"h-[80px] md:h-[120px]"}),N]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(Te,{title:"AI Latency",value:pt(h.avgDurationMs),action:t.jsxs("span",{className:"text-xs text-muted-foreground",children:["p95: ",pt(h.p95DurationMs)]}),children:[t.jsx(ke,{data:h.data,dataKey:"avg",colorNum:4,chartHeight:"h-[80px] md:h-[120px]"}),D]}),ae]})]})}function Ke(s){const e=le.c(8),{className:r}=s;let l;e[0]!==r?(l=ce("pt-4 px-4 pb-6 gap-8",r),e[0]=r,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-10 w-14 rounded bg-muted animate-pulse"})]}),t.jsx("div",{className:"h-8 w-[120px] rounded-md bg-muted animate-pulse"})]}),e[2]=a):a=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"h-[180px] w-full rounded bg-muted/60 animate-pulse"}),e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=Array.from({length:4}).map(rr),e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsxs("div",{className:"flex flex-col gap-6",children:[o,t.jsxs("div",{className:"flex flex-col",children:[c,t.jsx("div",{className:"flex items-center h-10 px-4 gap-2",children:t.jsx("div",{className:"h-4 w-14 rounded bg-muted animate-pulse"})})]})]}),e[5]=d):d=e[5];let n;return e[6]!==l?(n=t.jsxs(Jt,{className:l,children:[a,d]}),e[6]=l,e[7]=n):n=e[7],n}function rr(s,e){return t.jsxs("div",{className:ce("flex items-center h-10 px-3",e<3&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"size-6 rounded-md bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"})]}),t.jsxs("div",{className:"flex items-center gap-2 px-3",children:[t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"})]})]},e)}function lr(){const s=le.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{}),s[0]=e):e=s[0];let r,l;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{})]}),l=t.jsx("div",{className:"border-t border-border"}),s[1]=r,s[2]=l):(r=s[1],l=s[2]);let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-8 md:pt-12 pb-6 max-w-[1200px] mx-auto w-full",children:[e,r,l,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{}),t.jsx(Ke,{})]})]}),s[3]=a):a=s[3],a}function or(s){const e=le.c(46),{log:r,connection:l,virtualMcpName:a,virtualMcpIcon:o,onClick:c,lastLogRef:d}=s;let n,i;if(e[0]!==r.timestamp){const F=new Date(r.timestamp);n=F.toLocaleDateString("en-US",{month:"short",day:"numeric"}),i=F.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=n,e[2]=i}else n=e[1],i=e[2];const m=i,j=l?.icon||null,v=l?.title??r.connectionId;let b;e[3]!==j||e[4]!==v?(b=t.jsx(De,{className:"w-12 md:w-16 px-2 md:px-4",children:t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(qe,{icon:j,name:v,size:"xs",className:"shadow-sm"})})}),e[3]=j,e[4]=v,e[5]=b):b=e[5];let x;e[6]!==r.toolName?(x=t.jsx("div",{className:"font-medium text-foreground truncate block",children:r.toolName}),e[6]=r.toolName,e[7]=x):x=e[7];const L=l?.title??r.connectionId;let p;e[8]!==L?(p=t.jsx("div",{className:"text-muted-foreground truncate block text-xs",children:L}),e[8]=L,e[9]=p):p=e[9];let g;e[10]!==x||e[11]!==p?(g=t.jsxs(De,{className:"min-w-0 pr-2 md:pr-4",children:[x,p]}),e[10]=x,e[11]=p,e[12]=g):g=e[12];let u;e[13]!==o||e[14]!==a?(u=t.jsx(De,{className:"w-36 md:w-44 px-2 md:px-3 text-muted-foreground",children:a?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:o,name:a,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"truncate",children:a})]}):t.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),e[13]=o,e[14]=a,e[15]=u):u=e[15];let k;e[16]!==r.userImage||e[17]!==r.userName?(k=t.jsx(Ht,{url:r.userImage,fallback:r.userName,shape:"circle",size:"2xs",className:"shrink-0"}),e[16]=r.userImage,e[17]=r.userName,e[18]=k):k=e[18];let S;e[19]!==r.userName?(S=t.jsx("span",{className:"truncate",children:r.userName}),e[19]=r.userName,e[20]=S):S=e[20];let h;e[21]!==k||e[22]!==S?(h=t.jsx(De,{className:"w-28 md:w-36 px-2 md:px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k,S]})}),e[21]=k,e[22]=S,e[23]=h):h=e[23];let T;e[24]!==n?(T=t.jsx("div",{children:n}),e[24]=n,e[25]=T):T=e[25];let I;e[26]!==m?(I=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:m}),e[26]=m,e[27]=I):I=e[27];let f;e[28]!==T||e[29]!==I?(f=t.jsxs(De,{className:"w-32 md:w-40 px-2 md:px-3 text-muted-foreground",children:[T,I]}),e[28]=T,e[29]=I,e[30]=f):f=e[30];let M;e[31]!==r.durationMs?(M=t.jsxs(De,{className:"w-16 md:w-20 px-2 md:px-3 text-muted-foreground font-mono",children:[r.durationMs,"ms"]}),e[31]=r.durationMs,e[32]=M):M=e[32];const y=r.isError?"destructive":"success",R=r.isError?"Error":"OK";let C;e[33]!==y||e[34]!==R?(C=t.jsx(De,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(rt,{variant:y,className:"px-1.5 md:px-2 py-0.5 md:py-1",children:R})})}),e[33]=y,e[34]=R,e[35]=C):C=e[35];let E;return e[36]!==d||e[37]!==c||e[38]!==h||e[39]!==f||e[40]!==M||e[41]!==C||e[42]!==b||e[43]!==g||e[44]!==u?(E=t.jsxs(ut,{ref:d,className:"h-14 md:h-16 transition-colors cursor-pointer hover:bg-muted/40 border-b-0",onClick:c,children:[b,g,u,h,f,M,C]}),e[36]=d,e[37]=c,e[38]=h,e[39]=f,e[40]=M,e[41]=C,e[42]=b,e[43]=g,e[44]=u,e[45]=E):E=e[45],E}function ar(s){const e=le.c(26),{connectionIds:r,virtualMcpIds:l,tool:a,status:o,search:c,logs:d,hasMore:n,onLoadMore:i,isLoadingMore:m,connections:j,virtualMcps:v,membersData:b,client:x}=s,L=j??[],p=v??[],[g,u]=K.useState(null),k=As(i,n,m),S=Kt(b),h=new Map(S.map(dr)),T=new Map(p.map(cr));let f=d.map(N=>{const D=h.get(N.userId??""),B=N.virtualMcpId?T.get(N.virtualMcpId):null;return{...N,userName:D?.name??N.userId??"Unknown",userImage:D?.image??void 0,virtualMcpName:B?.title??null,virtualMcpIcon:B?.icon??null}});if(r.length>1){let N;e[0]!==r?(N=D=>r.includes(D.connectionId),e[0]=r,e[1]=N):N=e[1],f=f.filter(N)}if(l.length>1){let N;e[2]!==l?(N=D=>D.virtualMcpId&&l.includes(D.virtualMcpId),e[2]=l,e[3]=N):N=e[3],f=f.filter(N)}const M=new Map(L.map(ir));if(c){const N=c.toLowerCase();f=f.filter(D=>D.toolName.toLowerCase().includes(N)||(M.get(D.connectionId)?.title??D.connectionId).toLowerCase().includes(N)||D.errorMessage?.toLowerCase().includes(N))}const y=g!==null?f[g]??null:null,R=yt({queryKey:it.monitoringLogDetail(y?.id??""),queryFn:async()=>{if(!x)throw new Error("MCP client is not available");const N=await x.callTool({name:"MONITORING_LOG_GET",arguments:{id:y.id}});return N.structuredContent??N},enabled:y!==null}),C=R.data?.log,E=y&&C?{...y,input:C.input,output:C.output}:y;if(f.length===0){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[4]=N):N=e[4];const D=c||r.length>0||l.length>0||a||o!=="all"?"No logs match your filters":"No logs found in this time range";let B;return e[5]!==D?(B=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(wt,{image:N,title:"No logs found",description:D})}),e[5]=D,e[6]=B):B=e[6],B}const F="flex-1 flex flex-col min-w-0",H="flex-1 min-w-0 pt-1",A="min-w-[600px] md:min-w-0",W=Qt,w="w-full border-collapse";let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(oe,{className:"w-5"}),t.jsx(oe,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),t.jsx(oe,{className:"w-36 md:w-44 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(oe,{className:"w-28 md:w-36 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(oe,{className:"w-32 md:w-40 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),t.jsx(oe,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Latency"}),t.jsx(oe,{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[7]=_):_=e[7];const $=Gt,O=f.map((N,D)=>t.jsx(or,{log:N,connection:M.get(N.connectionId),virtualMcpName:N.virtualMcpName??"",virtualMcpIcon:N.virtualMcpIcon,onClick:()=>u(D),lastLogRef:D===f.length-1?k:void 0},N.id));let z;e[8]!==$||e[9]!==O?(z=t.jsx($,{children:O}),e[8]=$,e[9]=O,e[10]=z):z=e[10];let V;e[11]!==W||e[12]!==_||e[13]!==z?(V=t.jsx("div",{className:H,children:t.jsx("div",{className:A,children:t.jsxs(W,{className:w,children:[_,z]})})}),e[11]=W,e[12]=_,e[13]=z,e[14]=V):V=e[14];const q=g!==null;let J;e[15]!==u?(J=N=>{N||u(null)},e[15]=u,e[16]=J):J=e[16];const G=y&&g!==null&&t.jsxs(t.Fragment,{children:[t.jsx(Rs,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(qe,{icon:M.get(y.connectionId)?.icon||null,name:M.get(y.connectionId)?.title??y.connectionId,size:"sm",className:"shadow-sm shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(Os,{className:"text-sm leading-snug truncate",children:y.toolName}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:M.get(y.connectionId)?.title??y.connectionId})]})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>u(nr),disabled:g===0,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous entry",children:t.jsx(Ps,{size:14})}),t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>u(N=>N!==null&&N<f.length-1?N+1:N),disabled:g===f.length-1,className:"h-7 w-7 text-muted-foreground","aria-label":"Next entry",children:t.jsx(qt,{size:14})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:R.isLoading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"size-5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"})}):R.isError?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:"Failed to load log details"}),t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>R.refetch(),children:"Retry"})]}):t.jsx(Bs,{log:E})})]});let Q;e[17]!==G?(Q=t.jsx(zs,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:G}),e[17]=G,e[18]=Q):Q=e[18];let U;e[19]!==J||e[20]!==Q||e[21]!==q?(U=t.jsx(Es,{open:q,onOpenChange:J,children:Q}),e[19]=J,e[20]=Q,e[21]=q,e[22]=U):U=e[22];let P;return e[23]!==U||e[24]!==V?(P=t.jsxs("div",{className:F,children:[V,U]}),e[23]=U,e[24]=V,e[25]=P):P=e[25],P}function nr(s){return s!==null&&s>0?s-1:s}function ir(s){return[s.id,s]}function cr(s){return[s.id,s]}function dr(s){return[s.userId,s.user]}function mr(){const s=le.c(8);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(oe,{className:"w-12 md:w-16 px-2 md:px-4"}),s[0]=e):e=s[0];let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(oe,{className:"pr-2 md:pr-4",children:t.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),s[1]=r):r=s[1];let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(oe,{className:"w-24 md:w-32 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),s[2]=l):l=s[2];let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(oe,{className:"w-20 md:w-24 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s[3]=a):a=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(oe,{className:"w-32 md:w-40 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),s[4]=o):o=s[4];let c;s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(oe,{className:"w-16 md:w-20 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s[5]=c):c=s[5];let d;s[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,l,a,o,c,t.jsx(oe,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),s[6]=d):d=s[6];let n;return s[7]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsxs(Qt,{className:"w-full border-collapse",children:[d,t.jsx(Gt,{children:Array.from({length:8}).map(ur)})]})})}),s[7]=n):n=s[7],n}function ur(s,e){return t.jsxs(ut,{className:"h-14 border-b border-border hover:bg-transparent",children:[t.jsx("td",{className:"px-2 md:px-4",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"pr-2 md:pr-4",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const Nt=Object.assign(ar,{Skeleton:mr});function xr(s){const e=le.c(34),{client:r,locator:l,baseParams:a,pageSize:o,isStreaming:c,streamingRefetchInterval:d,connectionIds:n,virtualMcpIds:i,tool:m,status:j,searchQuery:v,allConnections:b,allVirtualMcps:x,membersData:L}=s;let p;e[0]!==a||e[1]!==l?(p=it.monitoringLogsInfinite(l,JSON.stringify(a)),e[0]=a,e[1]=l,e[2]=p):p=e[2];let g;e[3]!==a||e[4]!==r||e[5]!==o?(g=async H=>{const{pageParam:A}=H,W=A===void 0?0:A;if(!r)throw new Error("MCP client is not available");const w=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...a,limit:o,offset:W}});return w.structuredContent??w},e[3]=a,e[4]=r,e[5]=o,e[6]=g):g=e[6];let u;e[7]!==o?(u=(H,A)=>{if(!((H?.logs?.length??0)<o))return A.length*o},e[7]=o,e[8]=u):u=e[8];const k=c?d:!1;let S;e[9]!==p||e[10]!==g||e[11]!==u||e[12]!==k?(S={queryKey:p,queryFn:g,initialPageParam:0,getNextPageParam:u,staleTime:0,refetchInterval:k},e[9]=p,e[10]=g,e[11]=u,e[12]=k,e[13]=S):S=e[13];const{data:h,fetchNextPage:T,hasNextPage:I,isFetchingNextPage:f}=$s(S);let M;e[14]!==h.pages?(M=h.pages.flatMap(fr),e[14]=h.pages,e[15]=M):M=e[15];const y=M;let R;e[16]!==T||e[17]!==I||e[18]!==f?(R=()=>{I&&!f&&T()},e[16]=T,e[17]=I,e[18]=f,e[19]=R):R=e[19];const C=R,E=I??!1;let F;return e[20]!==b||e[21]!==x||e[22]!==r||e[23]!==n||e[24]!==C||e[25]!==f||e[26]!==L||e[27]!==y||e[28]!==v||e[29]!==j||e[30]!==E||e[31]!==m||e[32]!==i?(F=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:t.jsx(Nt,{connectionIds:n,virtualMcpIds:i,tool:m,status:j,search:v,logs:y,hasMore:E,onLoadMore:C,isLoadingMore:f,connections:b,virtualMcps:x,membersData:L,client:r})})})}),e[20]=b,e[21]=x,e[22]=r,e[23]=n,e[24]=C,e[25]=f,e[26]=L,e[27]=y,e[28]=v,e[29]=j,e[30]=E,e[31]=m,e[32]=i,e[33]=F):F=e[33],F}function fr(s){return s.logs??[]}function pr(s){const e=le.c(15),{dateRange:r}=s,{data:l,isLoading:a}=Vs(void 0);let o;e[0]!==l?(o=l===void 0?[]:l,e[0]=l,e[1]=o):o=e[1];const c=o,[d,n]=K.useState(null),i=d??c[0]?.id??null,{data:m}=Us(i??"");let j;e[2]!==r.startDate?(j=r.startDate.toISOString(),e[2]=r.startDate,e[3]=j):j=e[3];let v;e[4]!==r.endDate?(v=r.endDate.toISOString(),e[4]=r.endDate,e[5]=v):v=e[5];let b;e[6]!==j||e[7]!==v?(b={startDate:j,endDate:v},e[6]=j,e[7]=v,e[8]=b):b=e[8];const x=b;let L;return e[9]!==m||e[10]!==c||e[11]!==i||e[12]!==a||e[13]!==x?(L=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0 gap-5 pt-1",children:a?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):c.length===0?t.jsx("div",{className:"py-16",children:t.jsx(wt,{title:"No automations",description:"Create an automation to see its runs and usage here."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(nt,{value:i??"",onValueChange:p=>n(p),children:[t.jsx(lt,{className:"w-72",children:t.jsx(ot,{placeholder:"Select an automation…"})}),t.jsx(at,{children:c.map(gr)})]})}),m?t.jsx(ys,{automationId:m.id,triggerIds:m.triggers.map(hr),range:x}):t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]})})}),e[9]=m,e[10]=c,e[11]=i,e[12]=a,e[13]=x,e[14]=L):L=e[14],L}function hr(s){return s.id}function gr(s){return t.jsx(Fe,{value:s.id,children:s.name},s.id)}const jr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function vr({connectionIds:s,virtualMcpIds:e,tool:r,status:l,hideSystem:a,propertyFilters:o,connectionOptions:c,virtualMcpOptions:d,activeFiltersCount:n,onUpdateFilters:i,onConnectionSearchChange:m,memberOptions:j,llmUserIds:v=[],onLlmUserIdsChange:b,showMemberFilter:x}){const[L,p]=K.useState(!1),[g,u]=K.useState("form"),[k,S]=K.useState(r),[h,T]=K.useState(o),[I,f]=K.useState(Ye(o)),M=K.useRef(r),y=K.useRef(Le(o));M.current!==r&&(M.current=r,k!==r&&S(r));const R=Le(o);y.current!==R&&(y.current=R,T(o),f(Ye(o)));const C=(w,_)=>{const $=[...h],O=$[w];O&&($[w]={key:_.key??O.key,operator:_.operator??O.operator,value:_.value??O.value},T($))},E=()=>{T([...h,{key:"",operator:"eq",value:""}])},F=w=>{const _=h.filter(($,O)=>O!==w);T(_),f(Ye(_)),i({propertyFilters:Le(_)})},H=()=>{i({propertyFilters:Le(h)})},A=()=>{const w=$t(I);T(w),i({propertyFilters:Le(w)})},W=()=>{if(g==="raw"){const w=$t(I);T(w),u("form")}else f(Ye(h)),u("raw")};return t.jsxs(ct,{open:L,onOpenChange:p,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:"relative",children:[t.jsx(Vt,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n>0&&t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:n}),t.jsx(rt,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:n})]})]})}),t.jsx(mt,{align:"end",className:"w-[320px]",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{children:t.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Ms,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),t.jsx(Ts,{id:"hide-system-calls",checked:a,onCheckedChange:w=>i({hideSystem:!!w})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),t.jsx(ht,{options:c,defaultValue:s,onValueChange:w=>i({connectionId:w}),onSearchChange:m,placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),t.jsx(ht,{options:d,defaultValue:e,onValueChange:w=>i({virtualMcpId:w}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),x&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Members"}),t.jsx(ht,{options:j??[],defaultValue:v,onValueChange:w=>b?.(w),placeholder:"All members",variant:"secondary",className:"w-full",maxCount:2}),t.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Filters AI usage (calls, tokens, cost) only."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),t.jsx(Ge,{id:"filter-tool",placeholder:"Filter by tool...",value:k,onChange:w=>S(w.target.value),onBlur:()=>{k!==r&&i({tool:k})},onKeyDown:w=>{w.key==="Enter"&&k!==r&&i({tool:k})},className:"w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),t.jsxs(nt,{value:l,onValueChange:w=>i({status:w}),children:[t.jsx(lt,{className:"w-full",children:t.jsx(ot,{})}),t.jsxs(at,{children:[t.jsx(Fe,{value:"all",children:"All Status"}),t.jsx(Fe,{value:"success",children:"Success Only"}),t.jsx(Fe,{value:"errors",children:"Errors Only"})]})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:W,children:g==="raw"?t.jsx(gs,{size:14}):t.jsx(xs,{size:14})})}),t.jsx(tt,{children:g==="raw"?"Switch to form view":"Switch to raw text"})]})]}),g==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ks,{placeholder:`Paste property filters here:
5
+ ... [TRUNCATED - content too large to display]`,isTruncated:!0,originalSize:r}}function Ot(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function Bs(s){const e=le.c(116),{log:r}=s,[l,a]=K.useState(!1),[o,c]=K.useState(!1),d=bt(),{org:n}=Be(),i=Rt(r.input),m=Rt(r.output),j=Hs;let v;e[0]!==r.input||e[1]!==r.output?(v=async se=>{const re=j(se==="input"?r.input:r.output);try{await navigator.clipboard.writeText(re),se==="input"?(a(!0),setTimeout(()=>a(!1),2e3)):(c(!0),setTimeout(()=>c(!1),2e3))}catch{Ce.error("Failed to copy to clipboard")}},e[0]=r.input,e[1]=r.output,e[2]=v):v=e[2];const b=v;let x;e[3]!==r.id||e[4]!==r.input||e[5]!==r.output||e[6]!==r.toolName?(x=se=>{const re=j(se==="input"?r.input:r.output),ie=new Blob([re],{type:"application/json"}),pe=URL.createObjectURL(ie),ye=document.createElement("a");ye.href=pe,ye.download=`${r.toolName}-${se}-${r.id}.json`,ye.click(),URL.revokeObjectURL(pe)},e[3]=r.id,e[4]=r.input,e[5]=r.output,e[6]=r.toolName,e[7]=x):x=e[7];const L=x;let p;e[8]!==r.connectionId||e[9]!==r.input||e[10]!==r.toolName||e[11]!==d||e[12]!==n.slug?(p=()=>{const se=crypto.randomUUID();sessionStorage.setItem(`replay-${se}`,JSON.stringify(r.input)),d({to:"/$org/settings/connections/$connectionId/$collectionName/$itemId",params:{org:n.slug,connectionId:r.connectionId,collectionName:"tools",itemId:encodeURIComponent(r.toolName)},search:{replayId:se}})},e[8]=r.connectionId,e[9]=r.input,e[10]=r.toolName,e[11]=d,e[12]=n.slug,e[13]=p):p=e[13];const g=p,[u,k]=K.useState(!1);let S;e[14]!==r.requestId?(S=async()=>{try{await navigator.clipboard.writeText(r.requestId),k(!0),setTimeout(()=>k(!1),2e3)}catch{Ce.error("Failed to copy to clipboard")}},e[14]=r.requestId,e[15]=S):S=e[15];const h=S;let T;e[16]!==r.timestamp?(T=new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[16]=r.timestamp,e[17]=T):T=e[17];const I=T,f="text-sm px-5 md:px-6 py-5 space-y-5";let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Timestamp"}),e[18]=M):M=e[18];let y;e[19]!==I?(y=t.jsxs("div",{children:[M,t.jsx("div",{className:"text-sm text-foreground",children:I})]}),e[19]=I,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Duration"}),e[21]=R):R=e[21];let C;e[22]!==r.durationMs?(C=t.jsxs("div",{children:[R,t.jsxs("div",{className:"text-sm font-mono text-foreground",children:[r.durationMs,"ms"]})]}),e[22]=r.durationMs,e[23]=C):C=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[24]=E):E=e[24];let F;e[25]!==r.userName?(F=t.jsxs("div",{children:[E,t.jsx("div",{className:"text-sm text-foreground",children:r.userName})]}),e[25]=r.userName,e[26]=F):F=e[26];let H;e[27]!==r.virtualMcpName?(H=r.virtualMcpName&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsx("div",{className:"text-sm text-foreground",children:r.virtualMcpName})]}),e[27]=r.virtualMcpName,e[28]=H):H=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Request ID"}),e[29]=P):P=e[29];let W;e[30]!==r.requestId?(W=t.jsx("code",{className:"font-mono text-foreground text-[11px]",children:r.requestId}),e[30]=r.requestId,e[31]=W):W=e[31];let w;e[32]!==u?(w=u?t.jsx(ft,{size:12}):t.jsx(Xe,{size:12}),e[32]=u,e[33]=w):w=e[33];let _;e[34]!==h||e[35]!==w?(_=t.jsx(Z,{size:"icon",variant:"ghost",onClick:h,"aria-label":"Copy request ID",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:w}),e[34]=h,e[35]=w,e[36]=_):_=e[36];let $;e[37]!==W||e[38]!==_?($=t.jsxs("div",{children:[P,t.jsxs("div",{className:"flex items-center gap-1",children:[W,_]})]}),e[37]=W,e[38]=_,e[39]=$):$=e[39];let O;e[40]!==r.userAgent?(O=r.userAgent&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Client"}),t.jsx("div",{className:"text-sm font-mono text-foreground",children:r.userAgent})]}),e[40]=r.userAgent,e[41]=O):O=e[41];let z;e[42]!==r.properties||e[43]!==d||e[44]!==n.slug?(z=r.properties&&Object.keys(r.properties).length>0&&t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Properties"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(r.properties).map(se=>{const[re,ie]=se;return t.jsxs(ct,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(rt,{variant:"secondary",className:"font-mono text-xs px-2 py-0.5 cursor-pointer hover:bg-secondary/80 transition-colors",children:[re,"=",ie]})}),t.jsx(mt,{className:"w-auto p-1",align:"end",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:()=>{const pe={key:re,operator:"eq",value:ie};d({to:"/$org/settings/monitor",params:{org:n.slug},search:{propertyFilters:Le([pe])}})},children:[t.jsx(Vt,{size:14,className:"mr-2"}),"Filter by this property"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(`${re}=${ie}`),Ce.success("Copied filter to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(Xe,{size:14,className:"mr-2"}),"Copy filter"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(re),Ce.success("Copied key to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(is,{size:14,className:"mr-2"}),"Copy key"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(ie),Ce.success("Copied value to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(ds,{size:14,className:"mr-2"}),"Copy value"]})]})})]},re)})})]}),e[42]=r.properties,e[43]=d,e[44]=n.slug,e[45]=z):z=e[45];let V;e[46]!==C||e[47]!==F||e[48]!==H||e[49]!==$||e[50]!==O||e[51]!==z||e[52]!==y?(V=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[y,C,F,H,$,O,z]}),e[46]=C,e[47]=F,e[48]=H,e[49]=$,e[50]=O,e[51]=z,e[52]=y,e[53]=V):V=e[53];let q;e[54]!==r.errorMessage?(q=r.errorMessage&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-destructive mb-1",children:"Error"}),t.jsx("div",{className:"text-destructive font-mono text-xs bg-destructive/10 p-2 rounded break-all",children:r.errorMessage})]}),e[54]=r.errorMessage,e[55]=q):q=e[55];const J="space-y-4";let G;e[56]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Input"}),e[56]=G):G=e[56];const Q=i.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Ot(i.originalSize)," - truncated)"]});let U;e[57]!==Q?(U=t.jsxs("div",{className:"flex items-center gap-2",children:[G,Q]}),e[57]=Q,e[58]=U):U=e[58];let A;e[59]!==g||e[60]!==r.input?(A=r.input&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:g,"aria-label":"Replay tool call",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(cs,{size:14})})}),t.jsx(tt,{children:"Replay tool call"})]}),e[59]=g,e[60]=r.input,e[61]=A):A=e[61];let N;e[62]!==L||e[63]!==i?(N=i.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>L("input"),"aria-label":"Download full input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Mt,{size:14})})}),t.jsx(tt,{children:"Download full input"})]}),e[62]=L,e[63]=i,e[64]=N):N=e[64];let D;e[65]!==b?(D=()=>b("input"),e[65]=b,e[66]=D):D=e[66];let B;e[67]!==l?(B=l?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[67]=l,e[68]=B):B=e[68];let ee;e[69]!==D||e[70]!==B?(ee=t.jsx(Z,{size:"icon",variant:"ghost",onClick:D,"aria-label":"Copy input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:B}),e[69]=D,e[70]=B,e[71]=ee):ee=e[71];let X;e[72]!==A||e[73]!==N||e[74]!==ee?(X=t.jsxs("div",{className:"flex items-center gap-1",children:[A,N,ee]}),e[72]=A,e[73]=N,e[74]=ee,e[75]=X):X=e[75];let te;e[76]!==U||e[77]!==X?(te=t.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 border-b border-border",children:[U,X]}),e[76]=U,e[77]=X,e[78]=te):te=e[78];let Y;e[79]!==i?(Y=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(_t,{code:i.content,language:"json",height:"100%",readOnly:!0})}),e[79]=i,e[80]=Y):Y=e[80];let ae;e[81]!==te||e[82]!==Y?(ae=t.jsx("div",{children:t.jsxs("div",{className:"rounded-lg overflow-hidden border border-border",children:[te,Y]})}),e[81]=te,e[82]=Y,e[83]=ae):ae=e[83];const _e="rounded-lg overflow-hidden border border-border",$e="flex items-center justify-between p-1 pl-4 border-b border-border",Se="flex items-center gap-2";let ne;e[84]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Output"}),e[84]=ne):ne=e[84];const he=m.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Ot(m.originalSize)," - truncated)"]});let ge;e[85]!==ne||e[86]!==he?(ge=t.jsxs("div",{className:Se,children:[ne,he]}),e[85]=ne,e[86]=he,e[87]=ge):ge=e[87];let je;e[88]!==L||e[89]!==m.isTruncated?(je=m.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>L("output"),"aria-label":"Download full output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Mt,{size:14})})}),t.jsx(tt,{children:"Download full output"})]}),e[88]=L,e[89]=m.isTruncated,e[90]=je):je=e[90];let ve;e[91]!==b?(ve=()=>b("output"),e[91]=b,e[92]=ve):ve=e[92];let Ne;e[93]!==o?(Ne=o?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[93]=o,e[94]=Ne):Ne=e[94];let de;e[95]!==ve||e[96]!==Ne?(de=t.jsx(Z,{size:"icon",variant:"ghost",onClick:ve,"aria-label":"Copy output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:Ne}),e[95]=ve,e[96]=Ne,e[97]=de):de=e[97];let be;e[98]!==je||e[99]!==de?(be=t.jsxs("div",{className:"flex items-center gap-1",children:[je,de]}),e[98]=je,e[99]=de,e[100]=be):be=e[100];let me;e[101]!==ge||e[102]!==be?(me=t.jsxs("div",{className:$e,children:[ge,be]}),e[101]=ge,e[102]=be,e[103]=me):me=e[103];let ue;e[104]!==m.content?(ue=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(_t,{code:m.content,language:"json",height:"100%",readOnly:!0})}),e[104]=m.content,e[105]=ue):ue=e[105];let xe;e[106]!==me||e[107]!==ue?(xe=t.jsx("div",{children:t.jsxs("div",{className:_e,children:[me,ue]})}),e[106]=me,e[107]=ue,e[108]=xe):xe=e[108];let fe;e[109]!==ae||e[110]!==xe?(fe=t.jsxs("div",{className:J,children:[ae,xe]}),e[109]=ae,e[110]=xe,e[111]=fe):fe=e[111];let Re;return e[112]!==V||e[113]!==q||e[114]!==fe?(Re=t.jsxs("div",{className:f,children:[V,q,fe]}),e[112]=V,e[113]=q,e[114]=fe,e[115]=Re):Re=e[115],Re}function Hs(s){return JSON.stringify(s,null,2)}const Xt=/^now(?:-(\d+)([mhdwM]))?$/,Js={m:"minute",h:"hour",d:"day",w:"week",M:"month"};function Yt(s){const e=s.trim();if(e==="now")return{isNow:!0,offset:0,unit:null};const r=e.match(Xt);if(!r)return null;const l=r[1]?Number.parseInt(r[1],10):0,a=r[2]||null;return{isNow:!0,offset:l,unit:a}}function we(s){const e=s.trim(),r=new Date(e);if(!Number.isNaN(r.getTime())&&e.includes("-"))return{valid:!0,date:r};const l=Yt(e);if(!l)return{valid:!1,date:null,error:'Invalid expression. Use "now" or "now-Xu" (e.g., now-2d, now-3h)'};const a=new Date,o=new Date(a);if(l.offset===0||!l.unit)return{valid:!0,date:o};switch(l.unit){case"m":o.setMinutes(o.getMinutes()-l.offset);break;case"h":o.setHours(o.getHours()-l.offset);break;case"d":o.setDate(o.getDate()-l.offset);break;case"w":o.setDate(o.getDate()-l.offset*7);break;case"M":o.setMonth(o.getMonth()-l.offset);break}return{valid:!0,date:o}}function Gs(s){return s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Zt(s){const e=s.trim();return Xt.test(e)}function zt(s){const e=s.trim();if(e==="now")return"Now";const r=Yt(e);if(!r||!r.unit){const o=we(e);return o.valid&&o.date?Gs(o.date):e}const l=Js[r.unit],a=r.offset!==1?"s":"";return`${r.offset} ${l}${a} ago`}const es=[{label:"Last 5 minutes",from:"now-5m",to:"now",value:"5m"},{label:"Last 15 minutes",from:"now-15m",to:"now",value:"15m"},{label:"Last 30 minutes",from:"now-30m",to:"now",value:"30m"},{label:"Last 1 hour",from:"now-1h",to:"now",value:"1h"},{label:"Last 3 hours",from:"now-3h",to:"now",value:"3h"},{label:"Last 6 hours",from:"now-6h",to:"now",value:"6h"},{label:"Last 12 hours",from:"now-12h",to:"now",value:"12h"},{label:"Last 24 hours",from:"now-24h",to:"now",value:"24h"},{label:"Last 2 days",from:"now-2d",to:"now",value:"2d"},{label:"Last 7 days",from:"now-7d",to:"now",value:"7d"},{label:"Last 30 days",from:"now-30d",to:"now",value:"30d"}];function Qs(s,e){const r=es.find(l=>l.from===s&&l.to===e);return r?r.label:`${zt(s)} to ${zt(e)}`}function Je(s){const e=s.getFullYear(),r=String(s.getMonth()+1).padStart(2,"0"),l=String(s.getDate()).padStart(2,"0"),a=String(s.getHours()).padStart(2,"0"),o=String(s.getMinutes()).padStart(2,"0"),c=String(s.getSeconds()).padStart(2,"0");return`${e}-${r}-${l} ${a}:${o}:${c}`}function Ws(s){const e=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(!e)return null;const[,r,l,a,o,c,d]=e,n=new Date(Number(r),Number(l)-1,Number(a),Number(o),Number(c),Number(d));return Number.isNaN(n.getTime())?null:n}function gt(s){if(Zt(s))return s;const e=we(s);return e.valid&&e.date?Je(e.date):s}function Et({value:s,onChange:e,placeholder:r="now or now-2d",className:l,disabled:a,error:o}){const[c,d]=K.useState(!1),[n,i]=K.useState(()=>gt(s)),[m,j]=K.useState(),[v,b]=K.useState(!1),x=K.useRef(s);x.current!==s&&(x.current=s,v||i(gt(s)));const L=f=>{const M=f.target.value;i(M),j(void 0)},p=()=>{b(!0)},g=()=>{b(!1);const f=n.trim();if(Zt(f)){j(void 0),e(f);return}const M=Ws(f);if(M){j(void 0),e(M.toISOString()),i(Je(M));return}const y=we(f);if(y.valid&&y.date){j(void 0),e(f),i(Je(y.date));return}i(gt(s)),j(void 0)},u=f=>{if(f){const y=we(s).date||new Date;f.setHours(y.getHours()),f.setMinutes(y.getMinutes()),f.setSeconds(0),f.setMilliseconds(0);const R=f.toISOString();i(Je(f)),e(R),j(void 0)}d(!1)},k=f=>{const[M,y]=f.target.value.split(":").map(Number),C=we(s).date||new Date;C.setHours(M||0),C.setMinutes(y||0),C.setSeconds(0),C.setMilliseconds(0);const E=C.toISOString();i(Je(C)),e(E)},S=we(s),h=S.valid?S.date:new Date,T=h?`${String(h.getHours()).padStart(2,"0")}:${String(h.getMinutes()).padStart(2,"0")}`:"",I=o||m;return t.jsxs("div",{className:ce("flex gap-1",l),children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Ge,{value:n,onChange:L,onFocus:p,onBlur:g,placeholder:r,disabled:a,className:ce("text-sm h-8",I&&"border-destructive focus-visible:ring-destructive")}),I&&t.jsx("p",{className:"text-xs text-destructive mt-1",children:I})]}),t.jsxs(ct,{open:c,onOpenChange:d,children:[t.jsx(dt,{asChild:!0,children:t.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",disabled:a,children:t.jsx(ms,{className:"h-4 w-4"})})}),t.jsxs(mt,{className:"w-auto p-0",align:"end",children:[t.jsx(Cs,{mode:"single",selected:h||void 0,onSelect:u,initialFocus:!0}),t.jsxs("div",{className:"border-t p-3",children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"Time"}),t.jsx(Ge,{type:"time",value:T,onChange:k,className:"text-sm h-8"})]})]})]})]})}function Xs({value:s,onChange:e,className:r,disabled:l,quickRanges:a=es}){const[o,c]=K.useState(!1),[d,n]=K.useState(s.from),[i,m]=K.useState(s.to),[j,v]=K.useState(null),b=K.useRef({from:s.from,to:s.to});(b.current.from!==s.from||b.current.to!==s.to)&&(b.current={from:s.from,to:s.to},n(s.from),m(s.to));const x=u=>{b.current={from:u.from,to:u.to},n(u.from),m(u.to),c(!1),e({from:u.from,to:u.to})},L=()=>{const u=we(d),k=we(i);if(!u.valid||!u.date){v("Invalid 'From' date");return}if(!k.valid||!k.date){v("Invalid 'To' date");return}if(u.date>=k.date){v("'From' must be before 'To'");return}v(null),e({from:d,to:i}),c(!1)},p=u=>s.from===u.from&&s.to===u.to,g=Qs(s.from,s.to);return t.jsxs(ct,{open:o,onOpenChange:c,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:ce("gap-1.5 min-w-[160px] justify-between",r),disabled:l,children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(us,{className:"size-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:g})]}),t.jsx(qt,{className:"size-4 text-muted-foreground"})]})}),t.jsx(mt,{className:"w-[540px] p-0",align:"end",sideOffset:4,onCloseAutoFocus:u=>u.preventDefault(),style:o?void 0:{animationDuration:"0s"},children:t.jsxs("div",{className:"flex",children:[t.jsxs("div",{className:"flex-1 p-4 border-r",children:[t.jsx("h4",{className:"text-sm font-medium mb-4",children:"Absolute time range"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"From"}),t.jsx(Et,{value:d,onChange:n,placeholder:"now-24h"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"To"}),t.jsx(Et,{value:i,onChange:m,placeholder:"now"})]}),j&&t.jsx("p",{className:"text-xs text-destructive",children:j}),t.jsx(Z,{onClick:L,className:"w-full",size:"sm",children:"Apply time range"})]})]}),t.jsx("div",{className:"w-[200px]",children:t.jsx(Is,{className:"h-[280px]",children:t.jsx("div",{className:"p-2",children:a.map(u=>{const k=p(u);return t.jsx("button",{type:"button",onClick:()=>x(u),className:ce("w-full text-left px-3 py-2 text-sm rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground",k&&"bg-accent text-accent-foreground font-medium"),children:u.label},u.value)})})})})]})})]})}const ts="decopilot";async function ss(s,e){const r=await s.callTool({name:"MONITORING_STATS",arguments:e});if(r.isError)throw new Error("MONITORING_STATS tool returned an error");return r.structuredContent??r}function Ys(s,e){const r=le.c(15),{org:l}=Be();let a;r[0]!==l.id||r[1]!==l.slug?(a={connectionId:St,orgId:l.id,orgSlug:l.slug},r[0]=l.id,r[1]=l.slug,r[2]=a):a=r[2];const o=It(a);let c,d,n;r[3]!==l.id||r[4]!==s?(n={...s,excludeConnectionIds:[ts,...s.excludeConnectionIds??[]]},d=yt,c=it.monitoringStatsToolCalls(l.id,JSON.stringify(n)),r[3]=l.id,r[4]=s,r[5]=c,r[6]=d,r[7]=n):(c=r[5],d=r[6],n=r[7]);let i;r[8]!==o||r[9]!==n?(i=()=>ss(o,n),r[8]=o,r[9]=n,r[10]=i):i=r[10];let m;return r[11]!==e||r[12]!==c||r[13]!==i?(m={queryKey:c,queryFn:i,staleTime:3e4,retry:!1,...e},r[11]=e,r[12]=c,r[13]=i,r[14]=m):m=r[14],d(m)}function Zs(s,e){const r=le.c(15),{org:l}=Be();let a;r[0]!==l.id||r[1]!==l.slug?(a={connectionId:St,orgId:l.id,orgSlug:l.slug},r[0]=l.id,r[1]=l.slug,r[2]=a):a=r[2];const o=It(a);let c,d,n;r[3]!==l.id||r[4]!==s?(n={...s,connectionIds:[ts],topN:5,llmUsage:!0,userIds:s.userIds?.length?s.userIds:void 0},d=yt,c=it.monitoringStatsLlm(l.id,JSON.stringify(n)),r[3]=l.id,r[4]=s,r[5]=c,r[6]=d,r[7]=n):(c=r[5],d=r[6],n=r[7]);let i;r[8]!==o||r[9]!==n?(i=()=>ss(o,n),r[8]=o,r[9]=n,r[10]=i):i=r[10];let m;return r[11]!==e||r[12]!==c||r[13]!==i?(m={queryKey:c,queryFn:i,staleTime:3e4,retry:!1,...e},r[11]=e,r[12]=c,r[13]=i,r[14]=m):m=r[14],d(m)}function Te(s){const e=le.c(20),{title:r,value:l,action:a,children:o,className:c}=s;let d;e[0]!==c?(d=ce("pt-4 px-4 pb-6 gap-8",c),e[0]=c,e[1]=d):d=e[1];let n;e[2]!==r?(n=t.jsx("span",{className:"text-sm text-foreground/70",children:r}),e[2]=r,e[3]=n):n=e[3];let i;e[4]!==l?(i=t.jsx("span",{className:"text-4xl font-normal",children:l}),e[4]=l,e[5]=i):i=e[5];let m;e[6]!==n||e[7]!==i?(m=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[n,i]}),e[6]=n,e[7]=i,e[8]=m):m=e[8];let j;e[9]!==a?(j=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=j):j=e[10];let v;e[11]!==m||e[12]!==j?(v=t.jsxs("div",{className:"flex items-start justify-between",children:[m,j]}),e[11]=m,e[12]=j,e[13]=v):v=e[13];let b;e[14]!==o?(b=o&&t.jsx("div",{className:"flex flex-col gap-6",children:o}),e[14]=o,e[15]=b):b=e[15];let x;return e[16]!==d||e[17]!==v||e[18]!==b?(x=t.jsxs(Jt,{className:d,children:[v,b]}),e[16]=d,e[17]=v,e[18]=b,e[19]=x):x=e[19],x}function jt(s){const e=le.c(14),{metrics:r,connections:l,mode:a,total:o}=s,{org:c}=Be(),d=bt();let n,i,m;if(e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==d||e[4]!==c||e[5]!==o){m=Symbol.for("react.early_return_sentinel");e:{const v=l??[],b=new Map(r.map(tr));let x;e[9]!==a?(x=(p,g)=>{const u=Ft(p.metric,a);return Ft(g.metric,a)-u},e[9]=a,e[10]=x):x=e[10];const L=v.map(p=>({connection:p,metric:b.get(p.id)})).filter(er).sort(x).slice(0,4);if(L.length===0){m=null;break e}n="flex flex-col",i=L.map((p,g)=>{const{connection:u,metric:k}=p,S=o>0?(k.calls/o*100).toFixed(1):"0.0",h=a==="errors"?`${k.errorRate.toFixed(1)}%`:`${S}%`,T=g===L.length-1;return t.jsxs("div",{className:ce("flex items-center h-10 px-3 cursor-pointer hover:bg-accent/50 transition-colors",!T&&"border-b border-border/50"),onClick:()=>d({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:Fs(u)}}),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:u.icon,name:u.title,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-6! min-w-6! rounded-md"}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:u.title})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsx("span",{className:"text-sm text-foreground/30 tabular-nums",children:h}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:bs(k,a)})]})]},u.id)})}e[0]=l,e[1]=r,e[2]=a,e[3]=d,e[4]=c,e[5]=o,e[6]=n,e[7]=i,e[8]=m}else n=e[6],i=e[7],m=e[8];if(m!==Symbol.for("react.early_return_sentinel"))return m;let j;return e[11]!==n||e[12]!==i?(j=t.jsx("div",{className:n,children:i}),e[11]=n,e[12]=i,e[13]=j):j=e[13],j}function er(s){return s.metric}function tr(s){return[s.connectionId,s]}const At=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function Pt(s){let e=0;for(let r=0;r<s.length;r++)e=e*31+s.charCodeAt(r)>>>0;return At[e%At.length]}function He(s){const e=le.c(21),{models:r,mode:l}=s,a=l===void 0?"calls":l;if(r.length===0)return null;let o;e[0]!==a?(o=x=>a==="tokens"?(x.inputTokens??0)+(x.outputTokens??0):a==="cost"?x.costUsd??0:x.calls,e[0]=a,e[1]=o):o=e[1];const c=o;let d;e[2]!==a?(d=x=>a==="cost"?Ut(x):a==="tokens"?st(x):x.toLocaleString(),e[2]=a,e[3]=d):d=e[3];const n=d;let i;e[4]!==c?(i=(x,L)=>x+c(L),e[4]=c,e[5]=i):i=e[5];const m=r.reduce(i,0);let j,v;if(e[6]!==n||e[7]!==r||e[8]!==m||e[9]!==c){let x;e[12]!==c?(x=(g,u)=>c(u)-c(g),e[12]=c,e[13]=x):x=e[13];const L=[...r].sort(x).slice(0,4);j="flex flex-col";let p;e[14]!==n||e[15]!==m||e[16]!==c?(p=(g,u,k)=>{const S=c(g),h=m>0?(S/m*100).toFixed(1):"0.0",T=u===k.length-1;return t.jsxs("div",{className:ce("flex items-center h-10 px-3",!T&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-6 rounded-md border border-border/10 shadow-sm flex items-center justify-center shrink-0",style:{backgroundColor:`color-mix(in oklch, ${Pt(g.toolName)} 18%, transparent)`},children:t.jsx(Qe,{size:14,style:{color:Pt(g.toolName)}})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:g.toolName})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsxs("span",{className:"text-sm text-foreground/30 tabular-nums",children:[h,"%"]}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:n(S)})]})]},g.toolName)},e[14]=n,e[15]=m,e[16]=c,e[17]=p):p=e[17],v=L.map(p),e[6]=n,e[7]=r,e[8]=m,e[9]=c,e[10]=j,e[11]=v}else j=e[10],v=e[11];let b;return e[18]!==j||e[19]!==v?(b=t.jsx("div",{className:j,children:v}),e[18]=j,e[19]=v,e[20]=b):b=e[20],b}function sr(s){const e=le.c(48),{displayDateRange:r,connectionIds:l,excludeConnectionIds:a,toolName:o,status:c,connections:d,isStreaming:n,streamingRefetchInterval:i,llmUserIds:m}=s,j=Ns(r),v=n?i:!1;let b;e[0]!==v?(b={refetchInterval:v},e[0]=v,e[1]=b):b=e[1];const{data:x,isError:L}=Ys({interval:j,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:l.length>0?l:void 0,excludeConnectionIds:a,toolNames:o?[o]:void 0,status:c},b);let p;e[2]!==v?(p={refetchInterval:v},e[2]=v,e[3]=p):p=e[3];const{data:g,isError:u}=Zs({interval:j,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),userIds:m?.length?m:void 0},p),k=L||u,S=x?{totalCalls:x.totalCalls,totalErrors:x.totalErrors,avgDurationMs:x.avgDurationMs,p95DurationMs:x.p95DurationMs,data:Lt(x.timeseries,r,j)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},h=g?{totalCalls:g.totalCalls,totalErrors:g.totalErrors,avgDurationMs:g.avgDurationMs,p95DurationMs:g.p95DurationMs,data:Lt(g.timeseries,r,j)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]};let T;e[4]!==g?.topTools?(T=g?.topTools??[],e[4]=g?.topTools,e[5]=T):T=e[5];const I=T,f=g?.totalInputTokens??0,M=g?.totalOutputTokens??0,y=g?.totalTokens??0,R=g?.totalCostUsd??0;let C;e[6]!==x?.connectionBreakdown?(C=x?.connectionBreakdown??[],e[6]=x?.connectionBreakdown,e[7]=C):C=e[7];const E=C,[F,H]=K.useState("avg");let P;e[8]!==k?(P=k&&t.jsxs(_s,{variant:"destructive",children:[t.jsx(rs,{}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(Ds,{children:"Failed to load monitoring data"}),t.jsx(Ls,{children:"We couldn't fetch your monitoring stats right now. Please try again later."})]})]}),e[8]=k,e[9]=P):P=e[9];let W;e[10]===Symbol.for("react.memo_cache_sentinel")?(W=_e=>H(_e),e[10]=W):W=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(lt,{className:"w-[120px]",children:t.jsx(ot,{})}),e[11]=w):w=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(at,{children:[t.jsx(Fe,{value:"avg",children:"Avg"}),t.jsx(Fe,{value:"p95",children:"P95"})]}),e[12]=_):_=e[12];let $;e[13]!==F?($=t.jsxs(nt,{value:F,onValueChange:W,children:[w,_]}),e[13]=F,e[14]=$):$=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"AI Usage"}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),e[15]=O):O=e[15];let z;e[16]!==I?(z=t.jsx(He,{models:I,mode:"calls"}),e[16]=I,e[17]=z):z=e[17];let V;e[18]!==y?(V=st(y),e[18]=y,e[19]=V):V=e[19];let q;e[20]!==f?(q=st(f),e[20]=f,e[21]=q):q=e[21];let J;e[22]!==M?(J=st(M),e[22]=M,e[23]=J):J=e[23];let G;e[24]!==q||e[25]!==J?(G=t.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[q," in ·"," ",J," out"]}),e[24]=q,e[25]=J,e[26]=G):G=e[26];let Q;e[27]!==I?(Q=t.jsx(He,{models:I,mode:"tokens"}),e[27]=I,e[28]=Q):Q=e[28];let U;e[29]!==R?(U=R>0?Ut(R):"—",e[29]=R,e[30]=U):U=e[30];let A;e[31]!==R?(A=R===0?t.jsx("span",{className:"text-xs text-muted-foreground",children:"No provider cost data"}):void 0,e[31]=R,e[32]=A):A=e[32];let N;e[33]!==I||e[34]!==R?(N=R>0?t.jsx(He,{models:I,mode:"cost"}):t.jsx("div",{className:"flex items-center justify-center h-20 text-center text-xs text-muted-foreground px-4",children:"Cost is reported only for the deco AI Gateway and OpenRouter providers."}),e[33]=I,e[34]=R,e[35]=N):N=e[35];let D;e[36]!==I?(D=t.jsx(He,{models:I,mode:"calls"}),e[36]=I,e[37]=D):D=e[37];const B=Te,ee="AI Errors",X=h.totalErrors.toLocaleString();let te;e[38]!==h.data?(te=t.jsx(ke,{data:h.data,dataKey:"errors",colorNum:3,chartHeight:"h-[80px] md:h-[120px]"}),e[38]=h.data,e[39]=te):te=e[39];let Y;e[40]!==I||e[41]!==h.totalErrors?(Y=h.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No AI errors in this period"}):t.jsx(He,{models:I,mode:"calls"}),e[40]=I,e[41]=h.totalErrors,e[42]=Y):Y=e[42];let ae;return e[43]!==B||e[44]!==X||e[45]!==te||e[46]!==Y?(ae=t.jsxs(B,{title:ee,value:X,children:[te,Y]}),e[43]=B,e[44]=X,e[45]=te,e[46]=Y,e[47]=ae):ae=e[47],t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-2 pb-6 max-w-[1200px] mx-auto w-full overflow-auto",children:[P,t.jsxs(Te,{title:"Tool Calls",value:S.totalCalls.toLocaleString(),children:[t.jsx(ke,{data:S.data,dataKey:"calls",colorNum:1,chartHeight:"h-[120px] md:h-[180px]",variant:"area"}),t.jsx(jt,{metrics:E,connections:d,mode:"requests",total:S.totalCalls})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(Te,{title:"Latency",value:pt(F==="avg"?S.avgDurationMs:S.p95DurationMs),action:$,children:[t.jsx(ke,{data:S.data,dataKey:F,colorNum:4,chartHeight:"h-[120px] md:h-[180px]"}),t.jsx(jt,{metrics:E,connections:d,mode:"latency",total:S.totalCalls})]}),t.jsxs(Te,{title:"Errors",value:S.totalErrors.toLocaleString(),children:[t.jsx(ke,{data:S.data,dataKey:"errors",colorNum:3,chartHeight:"h-[120px] md:h-[180px]"}),S.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No errors in this period"}):t.jsx(jt,{metrics:E,connections:d,mode:"errors",total:S.totalErrors})]})]}),O,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs(Te,{title:"AI Calls",value:h.totalCalls.toLocaleString(),children:[t.jsx(ke,{data:h.data,dataKey:"calls",colorNum:1,chartHeight:"h-[80px] md:h-[120px]"}),z]}),t.jsxs(Te,{title:"Tokens",value:V,action:G,children:[t.jsx(ke,{data:h.data,dataKey:"totalTokens",colorNum:2,chartHeight:"h-[80px] md:h-[120px]"}),Q]}),t.jsxs(Te,{title:"Cost",value:U,action:A,children:[t.jsx(ke,{data:h.data,dataKey:"costUsd",colorNum:5,chartHeight:"h-[80px] md:h-[120px]"}),N]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(Te,{title:"AI Latency",value:pt(h.avgDurationMs),action:t.jsxs("span",{className:"text-xs text-muted-foreground",children:["p95: ",pt(h.p95DurationMs)]}),children:[t.jsx(ke,{data:h.data,dataKey:"avg",colorNum:4,chartHeight:"h-[80px] md:h-[120px]"}),D]}),ae]})]})}function Ke(s){const e=le.c(8),{className:r}=s;let l;e[0]!==r?(l=ce("pt-4 px-4 pb-6 gap-8",r),e[0]=r,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-10 w-14 rounded bg-muted animate-pulse"})]}),t.jsx("div",{className:"h-8 w-[120px] rounded-md bg-muted animate-pulse"})]}),e[2]=a):a=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"h-[180px] w-full rounded bg-muted/60 animate-pulse"}),e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=Array.from({length:4}).map(rr),e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsxs("div",{className:"flex flex-col gap-6",children:[o,t.jsxs("div",{className:"flex flex-col",children:[c,t.jsx("div",{className:"flex items-center h-10 px-4 gap-2",children:t.jsx("div",{className:"h-4 w-14 rounded bg-muted animate-pulse"})})]})]}),e[5]=d):d=e[5];let n;return e[6]!==l?(n=t.jsxs(Jt,{className:l,children:[a,d]}),e[6]=l,e[7]=n):n=e[7],n}function rr(s,e){return t.jsxs("div",{className:ce("flex items-center h-10 px-3",e<3&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"size-6 rounded-md bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"})]}),t.jsxs("div",{className:"flex items-center gap-2 px-3",children:[t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"})]})]},e)}function lr(){const s=le.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{}),s[0]=e):e=s[0];let r,l;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{})]}),l=t.jsx("div",{className:"border-t border-border"}),s[1]=r,s[2]=l):(r=s[1],l=s[2]);let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-8 md:pt-12 pb-6 max-w-[1200px] mx-auto w-full",children:[e,r,l,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{}),t.jsx(Ke,{})]})]}),s[3]=a):a=s[3],a}function or(s){const e=le.c(46),{log:r,connection:l,virtualMcpName:a,virtualMcpIcon:o,onClick:c,lastLogRef:d}=s;let n,i;if(e[0]!==r.timestamp){const F=new Date(r.timestamp);n=F.toLocaleDateString("en-US",{month:"short",day:"numeric"}),i=F.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=n,e[2]=i}else n=e[1],i=e[2];const m=i,j=l?.icon||null,v=l?.title??r.connectionId;let b;e[3]!==j||e[4]!==v?(b=t.jsx(De,{className:"w-12 md:w-16 px-2 md:px-4",children:t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(qe,{icon:j,name:v,size:"xs",className:"shadow-sm"})})}),e[3]=j,e[4]=v,e[5]=b):b=e[5];let x;e[6]!==r.toolName?(x=t.jsx("div",{className:"font-medium text-foreground truncate block",children:r.toolName}),e[6]=r.toolName,e[7]=x):x=e[7];const L=l?.title??r.connectionId;let p;e[8]!==L?(p=t.jsx("div",{className:"text-muted-foreground truncate block text-xs",children:L}),e[8]=L,e[9]=p):p=e[9];let g;e[10]!==x||e[11]!==p?(g=t.jsxs(De,{className:"min-w-0 pr-2 md:pr-4",children:[x,p]}),e[10]=x,e[11]=p,e[12]=g):g=e[12];let u;e[13]!==o||e[14]!==a?(u=t.jsx(De,{className:"w-36 md:w-44 px-2 md:px-3 text-muted-foreground",children:a?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:o,name:a,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"truncate",children:a})]}):t.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),e[13]=o,e[14]=a,e[15]=u):u=e[15];let k;e[16]!==r.userImage||e[17]!==r.userName?(k=t.jsx(Ht,{url:r.userImage,fallback:r.userName,shape:"circle",size:"2xs",className:"shrink-0"}),e[16]=r.userImage,e[17]=r.userName,e[18]=k):k=e[18];let S;e[19]!==r.userName?(S=t.jsx("span",{className:"truncate",children:r.userName}),e[19]=r.userName,e[20]=S):S=e[20];let h;e[21]!==k||e[22]!==S?(h=t.jsx(De,{className:"w-28 md:w-36 px-2 md:px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k,S]})}),e[21]=k,e[22]=S,e[23]=h):h=e[23];let T;e[24]!==n?(T=t.jsx("div",{children:n}),e[24]=n,e[25]=T):T=e[25];let I;e[26]!==m?(I=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:m}),e[26]=m,e[27]=I):I=e[27];let f;e[28]!==T||e[29]!==I?(f=t.jsxs(De,{className:"w-32 md:w-40 px-2 md:px-3 text-muted-foreground",children:[T,I]}),e[28]=T,e[29]=I,e[30]=f):f=e[30];let M;e[31]!==r.durationMs?(M=t.jsxs(De,{className:"w-16 md:w-20 px-2 md:px-3 text-muted-foreground font-mono",children:[r.durationMs,"ms"]}),e[31]=r.durationMs,e[32]=M):M=e[32];const y=r.isError?"destructive":"success",R=r.isError?"Error":"OK";let C;e[33]!==y||e[34]!==R?(C=t.jsx(De,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(rt,{variant:y,className:"px-1.5 md:px-2 py-0.5 md:py-1",children:R})})}),e[33]=y,e[34]=R,e[35]=C):C=e[35];let E;return e[36]!==d||e[37]!==c||e[38]!==h||e[39]!==f||e[40]!==M||e[41]!==C||e[42]!==b||e[43]!==g||e[44]!==u?(E=t.jsxs(ut,{ref:d,className:"h-14 md:h-16 transition-colors cursor-pointer hover:bg-muted/40 border-b-0",onClick:c,children:[b,g,u,h,f,M,C]}),e[36]=d,e[37]=c,e[38]=h,e[39]=f,e[40]=M,e[41]=C,e[42]=b,e[43]=g,e[44]=u,e[45]=E):E=e[45],E}function ar(s){const e=le.c(26),{connectionIds:r,virtualMcpIds:l,tool:a,status:o,search:c,logs:d,hasMore:n,onLoadMore:i,isLoadingMore:m,connections:j,virtualMcps:v,membersData:b,client:x}=s,L=j??[],p=v??[],[g,u]=K.useState(null),k=Ps(i,n,m),S=Kt(b),h=new Map(S.map(dr)),T=new Map(p.map(cr));let f=d.map(N=>{const D=h.get(N.userId??""),B=N.virtualMcpId?T.get(N.virtualMcpId):null;return{...N,userName:D?.name??N.userId??"Unknown",userImage:D?.image??void 0,virtualMcpName:B?.title??null,virtualMcpIcon:B?.icon??null}});if(r.length>1){let N;e[0]!==r?(N=D=>r.includes(D.connectionId),e[0]=r,e[1]=N):N=e[1],f=f.filter(N)}if(l.length>1){let N;e[2]!==l?(N=D=>D.virtualMcpId&&l.includes(D.virtualMcpId),e[2]=l,e[3]=N):N=e[3],f=f.filter(N)}const M=new Map(L.map(ir));if(c){const N=c.toLowerCase();f=f.filter(D=>D.toolName.toLowerCase().includes(N)||(M.get(D.connectionId)?.title??D.connectionId).toLowerCase().includes(N)||D.errorMessage?.toLowerCase().includes(N))}const y=g!==null?f[g]??null:null,R=yt({queryKey:it.monitoringLogDetail(y?.id??""),queryFn:async()=>{if(!x)throw new Error("MCP client is not available");const N=await x.callTool({name:"MONITORING_LOG_GET",arguments:{id:y.id}});return N.structuredContent??N},enabled:y!==null}),C=R.data?.log,E=y&&C?{...y,input:C.input,output:C.output}:y;if(f.length===0){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[4]=N):N=e[4];const D=c||r.length>0||l.length>0||a||o!=="all"?"No logs match your filters":"No logs found in this time range";let B;return e[5]!==D?(B=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(wt,{image:N,title:"No logs found",description:D})}),e[5]=D,e[6]=B):B=e[6],B}const F="flex-1 flex flex-col min-w-0",H="flex-1 min-w-0 pt-1",P="min-w-[600px] md:min-w-0",W=Qt,w="w-full border-collapse";let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(oe,{className:"w-5"}),t.jsx(oe,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),t.jsx(oe,{className:"w-36 md:w-44 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(oe,{className:"w-28 md:w-36 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(oe,{className:"w-32 md:w-40 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),t.jsx(oe,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Latency"}),t.jsx(oe,{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[7]=_):_=e[7];const $=Gt,O=f.map((N,D)=>t.jsx(or,{log:N,connection:M.get(N.connectionId),virtualMcpName:N.virtualMcpName??"",virtualMcpIcon:N.virtualMcpIcon,onClick:()=>u(D),lastLogRef:D===f.length-1?k:void 0},N.id));let z;e[8]!==$||e[9]!==O?(z=t.jsx($,{children:O}),e[8]=$,e[9]=O,e[10]=z):z=e[10];let V;e[11]!==W||e[12]!==_||e[13]!==z?(V=t.jsx("div",{className:H,children:t.jsx("div",{className:P,children:t.jsxs(W,{className:w,children:[_,z]})})}),e[11]=W,e[12]=_,e[13]=z,e[14]=V):V=e[14];const q=g!==null;let J;e[15]!==u?(J=N=>{N||u(null)},e[15]=u,e[16]=J):J=e[16];const G=y&&g!==null&&t.jsxs(t.Fragment,{children:[t.jsx(Rs,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(qe,{icon:M.get(y.connectionId)?.icon||null,name:M.get(y.connectionId)?.title??y.connectionId,size:"sm",className:"shadow-sm shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(Os,{className:"text-sm leading-snug truncate",children:y.toolName}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:M.get(y.connectionId)?.title??y.connectionId})]})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>u(nr),disabled:g===0,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous entry",children:t.jsx(As,{size:14})}),t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>u(N=>N!==null&&N<f.length-1?N+1:N),disabled:g===f.length-1,className:"h-7 w-7 text-muted-foreground","aria-label":"Next entry",children:t.jsx(qt,{size:14})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:R.isLoading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"size-5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"})}):R.isError?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:"Failed to load log details"}),t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>R.refetch(),children:"Retry"})]}):t.jsx(Bs,{log:E})})]});let Q;e[17]!==G?(Q=t.jsx(zs,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:G}),e[17]=G,e[18]=Q):Q=e[18];let U;e[19]!==J||e[20]!==Q||e[21]!==q?(U=t.jsx(Es,{open:q,onOpenChange:J,children:Q}),e[19]=J,e[20]=Q,e[21]=q,e[22]=U):U=e[22];let A;return e[23]!==U||e[24]!==V?(A=t.jsxs("div",{className:F,children:[V,U]}),e[23]=U,e[24]=V,e[25]=A):A=e[25],A}function nr(s){return s!==null&&s>0?s-1:s}function ir(s){return[s.id,s]}function cr(s){return[s.id,s]}function dr(s){return[s.userId,s.user]}function mr(){const s=le.c(8);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(oe,{className:"w-12 md:w-16 px-2 md:px-4"}),s[0]=e):e=s[0];let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(oe,{className:"pr-2 md:pr-4",children:t.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),s[1]=r):r=s[1];let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(oe,{className:"w-24 md:w-32 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),s[2]=l):l=s[2];let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(oe,{className:"w-20 md:w-24 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s[3]=a):a=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(oe,{className:"w-32 md:w-40 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),s[4]=o):o=s[4];let c;s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(oe,{className:"w-16 md:w-20 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s[5]=c):c=s[5];let d;s[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,l,a,o,c,t.jsx(oe,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),s[6]=d):d=s[6];let n;return s[7]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsxs(Qt,{className:"w-full border-collapse",children:[d,t.jsx(Gt,{children:Array.from({length:8}).map(ur)})]})})}),s[7]=n):n=s[7],n}function ur(s,e){return t.jsxs(ut,{className:"h-14 border-b border-border hover:bg-transparent",children:[t.jsx("td",{className:"px-2 md:px-4",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"pr-2 md:pr-4",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const Nt=Object.assign(ar,{Skeleton:mr});function xr(s){const e=le.c(34),{client:r,locator:l,baseParams:a,pageSize:o,isStreaming:c,streamingRefetchInterval:d,connectionIds:n,virtualMcpIds:i,tool:m,status:j,searchQuery:v,allConnections:b,allVirtualMcps:x,membersData:L}=s;let p;e[0]!==a||e[1]!==l?(p=it.monitoringLogsInfinite(l,JSON.stringify(a)),e[0]=a,e[1]=l,e[2]=p):p=e[2];let g;e[3]!==a||e[4]!==r||e[5]!==o?(g=async H=>{const{pageParam:P}=H,W=P===void 0?0:P;if(!r)throw new Error("MCP client is not available");const w=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...a,limit:o,offset:W}});return w.structuredContent??w},e[3]=a,e[4]=r,e[5]=o,e[6]=g):g=e[6];let u;e[7]!==o?(u=(H,P)=>{if(!((H?.logs?.length??0)<o))return P.length*o},e[7]=o,e[8]=u):u=e[8];const k=c?d:!1;let S;e[9]!==p||e[10]!==g||e[11]!==u||e[12]!==k?(S={queryKey:p,queryFn:g,initialPageParam:0,getNextPageParam:u,staleTime:0,refetchInterval:k},e[9]=p,e[10]=g,e[11]=u,e[12]=k,e[13]=S):S=e[13];const{data:h,fetchNextPage:T,hasNextPage:I,isFetchingNextPage:f}=$s(S);let M;e[14]!==h.pages?(M=h.pages.flatMap(fr),e[14]=h.pages,e[15]=M):M=e[15];const y=M;let R;e[16]!==T||e[17]!==I||e[18]!==f?(R=()=>{I&&!f&&T()},e[16]=T,e[17]=I,e[18]=f,e[19]=R):R=e[19];const C=R,E=I??!1;let F;return e[20]!==b||e[21]!==x||e[22]!==r||e[23]!==n||e[24]!==C||e[25]!==f||e[26]!==L||e[27]!==y||e[28]!==v||e[29]!==j||e[30]!==E||e[31]!==m||e[32]!==i?(F=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:t.jsx(Nt,{connectionIds:n,virtualMcpIds:i,tool:m,status:j,search:v,logs:y,hasMore:E,onLoadMore:C,isLoadingMore:f,connections:b,virtualMcps:x,membersData:L,client:r})})})}),e[20]=b,e[21]=x,e[22]=r,e[23]=n,e[24]=C,e[25]=f,e[26]=L,e[27]=y,e[28]=v,e[29]=j,e[30]=E,e[31]=m,e[32]=i,e[33]=F):F=e[33],F}function fr(s){return s.logs??[]}function pr(s){const e=le.c(15),{dateRange:r}=s,{data:l,isLoading:a}=Vs(void 0);let o;e[0]!==l?(o=l===void 0?[]:l,e[0]=l,e[1]=o):o=e[1];const c=o,[d,n]=K.useState(null),i=d??c[0]?.id??null,{data:m}=Us(i??"");let j;e[2]!==r.startDate?(j=r.startDate.toISOString(),e[2]=r.startDate,e[3]=j):j=e[3];let v;e[4]!==r.endDate?(v=r.endDate.toISOString(),e[4]=r.endDate,e[5]=v):v=e[5];let b;e[6]!==j||e[7]!==v?(b={startDate:j,endDate:v},e[6]=j,e[7]=v,e[8]=b):b=e[8];const x=b;let L;return e[9]!==m||e[10]!==c||e[11]!==i||e[12]!==a||e[13]!==x?(L=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0 gap-5 pt-1",children:a?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):c.length===0?t.jsx("div",{className:"py-16",children:t.jsx(wt,{title:"No automations",description:"Create an automation to see its runs and usage here."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(nt,{value:i??"",onValueChange:p=>n(p),children:[t.jsx(lt,{className:"w-72",children:t.jsx(ot,{placeholder:"Select an automation…"})}),t.jsx(at,{children:c.map(gr)})]})}),m?t.jsx(ys,{automationId:m.id,triggerIds:m.triggers.map(hr),range:x}):t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]})})}),e[9]=m,e[10]=c,e[11]=i,e[12]=a,e[13]=x,e[14]=L):L=e[14],L}function hr(s){return s.id}function gr(s){return t.jsx(Fe,{value:s.id,children:s.name},s.id)}const jr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function vr({connectionIds:s,virtualMcpIds:e,tool:r,status:l,hideSystem:a,propertyFilters:o,connectionOptions:c,virtualMcpOptions:d,activeFiltersCount:n,onUpdateFilters:i,onConnectionSearchChange:m,memberOptions:j,llmUserIds:v=[],onLlmUserIdsChange:b,showMemberFilter:x}){const[L,p]=K.useState(!1),[g,u]=K.useState("form"),[k,S]=K.useState(r),[h,T]=K.useState(o),[I,f]=K.useState(Ye(o)),M=K.useRef(r),y=K.useRef(Le(o));M.current!==r&&(M.current=r,k!==r&&S(r));const R=Le(o);y.current!==R&&(y.current=R,T(o),f(Ye(o)));const C=(w,_)=>{const $=[...h],O=$[w];O&&($[w]={key:_.key??O.key,operator:_.operator??O.operator,value:_.value??O.value},T($))},E=()=>{T([...h,{key:"",operator:"eq",value:""}])},F=w=>{const _=h.filter(($,O)=>O!==w);T(_),f(Ye(_)),i({propertyFilters:Le(_)})},H=()=>{i({propertyFilters:Le(h)})},P=()=>{const w=$t(I);T(w),i({propertyFilters:Le(w)})},W=()=>{if(g==="raw"){const w=$t(I);T(w),u("form")}else f(Ye(h)),u("raw")};return t.jsxs(ct,{open:L,onOpenChange:p,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:"relative",children:[t.jsx(Vt,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n>0&&t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:n}),t.jsx(rt,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:n})]})]})}),t.jsx(mt,{align:"end",className:"w-[320px]",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{children:t.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Ms,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),t.jsx(Ts,{id:"hide-system-calls",checked:a,onCheckedChange:w=>i({hideSystem:!!w})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),t.jsx(ht,{options:c,defaultValue:s,onValueChange:w=>i({connectionId:w}),onSearchChange:m,placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),t.jsx(ht,{options:d,defaultValue:e,onValueChange:w=>i({virtualMcpId:w}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),x&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Members"}),t.jsx(ht,{options:j??[],defaultValue:v,onValueChange:w=>b?.(w),placeholder:"All members",variant:"secondary",className:"w-full",maxCount:2}),t.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Filters AI usage (calls, tokens, cost) only."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),t.jsx(Ge,{id:"filter-tool",placeholder:"Filter by tool...",value:k,onChange:w=>S(w.target.value),onBlur:()=>{k!==r&&i({tool:k})},onKeyDown:w=>{w.key==="Enter"&&k!==r&&i({tool:k})},className:"w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),t.jsxs(nt,{value:l,onValueChange:w=>i({status:w}),children:[t.jsx(lt,{className:"w-full",children:t.jsx(ot,{})}),t.jsxs(at,{children:[t.jsx(Fe,{value:"all",children:"All Status"}),t.jsx(Fe,{value:"success",children:"Success Only"}),t.jsx(Fe,{value:"errors",children:"Errors Only"})]})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:W,children:g==="raw"?t.jsx(gs,{size:14}):t.jsx(xs,{size:14})})}),t.jsx(tt,{children:g==="raw"?"Switch to form view":"Switch to raw text"})]})]}),g==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ks,{placeholder:`Paste property filters here:
6
6
  thread_id=abc123
7
7
  user~test
8
- debug?`,value:I,onChange:w=>f(w.target.value),onBlur:A,onKeyDown:w=>{w.key==="Enter"&&w.metaKey&&A()},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:[h.map((w,_)=>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 ",_+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>F(_),children:t.jsx(vs,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ge,{placeholder:"Key (e.g., thread_id)",value:w.key,onChange:$=>C(_,{key:$.target.value}),onBlur:H,onKeyDown:$=>{$.key==="Enter"&&H()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:w.operator,onValueChange:$=>{const O=[...h],z=O[_];z&&(O[_]={...z,operator:$,value:$==="exists"?"":z.value},T(O),i({propertyFilters:Le(O)}))},children:[t.jsx(lt,{className:"w-28",children:t.jsx(ot,{})}),t.jsx(at,{children:jr.map($=>t.jsx(Fe,{value:$.value,children:$.label},$.value))})]})]}),w.operator!=="exists"&&t.jsx(Ge,{placeholder:"Value",value:w.value,onChange:$=>C(_,{value:$.target.value}),onBlur:H,onKeyDown:$=>{$.key==="Enter"&&H()},className:"w-full font-mono text-sm"})]},_)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:E,children:[t.jsx(js,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),T([]),f(""),i({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),p(!1)},children:"Clear all filters"})]})})]})}function Nr(s){const e=le.c(113),{tab:r,dateRange:l,displayDateRange:a,connectionIds:o,virtualMcpIds:c,tool:d,status:n,search:i,streaming:m,hideSystem:j,activeFiltersCount:v,from:b,to:x,propertyFilters:L,onUpdateFilters:p,onTimeRangeChange:g,onStreamingToggle:u,onTabChange:k}=s,S=Dt(),h=hs(),{data:T}=fs(),[I,f]=K.useState(""),M=I||void 0;let y;e[0]!==M?(y={searchTerm:M},e[0]=M,e[1]=y):y=e[1];const R=Dt(y);let C;e[2]!==R?(C=R??[],e[2]=R,e[3]=C):C=e[3];let E;e[4]!==C?(E=C.map(wr),e[4]=C,e[5]=E):E=e[5];const F=E;let H;e[6]!==h?(H=h.map(yr),e[6]=h,e[7]=H):H=e[7];const A=H,{pageSize:W,streamingRefetchInterval:w}=vt,{org:_,locator:$}=Be();let O;e[8]!==_.id||e[9]!==_.slug?(O={connectionId:St,orgId:_.id,orgSlug:_.slug},e[8]=_.id,e[9]=_.slug,e[10]=O):O=e[10];const z=It(O);let V;e[11]!==L?(V=qs(L),e[11]=L,e[12]=V):V=e[12];const q=V;let J;e[13]!==j||e[14]!==_.id?(J=j?[ps.SELF(_.id)]:void 0,e[13]=j,e[14]=_.id,e[15]=J):J=e[15];const G=J;let Q;e[16]===Symbol.for("react.memo_cache_sentinel")?(Q=[],e[16]=Q):Q=e[16];const[U,P]=K.useState(Q);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[D,B]=K.useState(N);let ee;e[18]===Symbol.for("react.memo_cache_sentinel")?(ee=[],e[18]=ee):ee=e[18];const[X,te]=K.useState(ee),[Y,ae]=K.useState("all"),_e=(D.length>0?1:0)+(X.length>0?1:0)+(Y!=="all"?1:0);let $e;e[19]!==T?($e=Kt(T).map(br),e[19]=T,e[20]=$e):$e=e[20];const Se=$e;let ne;e[21]!==l.startDate?(ne=l.startDate.toISOString(),e[21]=l.startDate,e[22]=ne):ne=e[22];let he;e[23]!==l.endDate?(he=l.endDate.toISOString(),e[23]=l.endDate,e[24]=he):he=e[24];const ge=o.length===1?o[0]:void 0,je=c.length===1?c[0]:void 0,ve=d||void 0,Ne=n==="errors"?!0:n==="success"?!1:void 0;let de;e[25]!==G||e[26]!==q||e[27]!==ne||e[28]!==he||e[29]!==ge||e[30]!==je||e[31]!==ve||e[32]!==Ne?(de={startDate:ne,endDate:he,connectionId:ge,excludeConnectionIds:G,virtualMcpId:je,toolName:ve,isError:Ne,...q},e[25]=G,e[26]=q,e[27]=ne,e[28]=he,e[29]=ge,e[30]=je,e[31]=ve,e[32]=Ne,e[33]=de):de=e[33];const be=de;let me;e[34]===Symbol.for("react.memo_cache_sentinel")?(me={id:"overview",label:"Overview"},e[34]=me):me=e[34];let ue;e[35]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"audit",label:"Audit"},e[35]=ue):ue=e[35];let xe;e[36]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"threads",label:"Threads"},e[36]=xe):xe=e[36];let fe;e[37]===Symbol.for("react.memo_cache_sentinel")?(fe=[me,ue,xe,{id:"automations",label:"Automations"}],e[37]=fe):fe=e[37];const Re=fe;let se;e[38]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx(Me.Title,{children:"Monitoring"}),e[38]=se):se=e[38];let re;e[39]!==k?(re=Ie=>k(Ie),e[39]=k,e[40]=re):re=e[40];let ie;e[41]!==re||e[42]!==r?(ie=t.jsx(Bt,{tabs:Re,activeTab:r,onTabChange:re}),e[41]=re,e[42]=r,e[43]=ie):ie=e[43];let pe;e[44]!==v||e[45]!==o||e[46]!==F||e[47]!==I||e[48]!==j||e[49]!==m||e[50]!==U||e[51]!==Se||e[52]!==u||e[53]!==p||e[54]!==L||e[55]!==n||e[56]!==r||e[57]!==d||e[58]!==c||e[59]!==A?(pe=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:m?"secondary":"outline",className:"gap-1.5",onClick:u,children:[m&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),m&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(vr,{connectionIds:o,virtualMcpIds:c,tool:d,status:n,hideSystem:j,propertyFilters:L,connectionOptions:F,virtualMcpOptions:A,activeFiltersCount:v,onUpdateFilters:p,connectionSearchTerm:I,onConnectionSearchChange:f,memberOptions:Se,llmUserIds:U,onLlmUserIdsChange:P,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=o,e[46]=F,e[47]=I,e[48]=j,e[49]=m,e[50]=U,e[51]=Se,e[52]=u,e[53]=p,e[54]=L,e[55]=n,e[56]=r,e[57]=d,e[58]=c,e[59]=A,e[60]=pe):pe=e[60];let ye;e[61]!==Se||e[62]!==r||e[63]!==_e||e[64]!==D||e[65]!==Y||e[66]!==X||e[67]!==A?(ye=r==="threads"&&t.jsx(ws,{filterAgentIds:D,filterUserIds:X,filterStatus:Y,virtualMcpOptions:A,memberOptions:Se,activeFiltersCount:_e,onUpdateFilters:Ie=>{const{filterAgentIds:Ct,filterUserIds:kt,filterStatus:Tt}=Ie;Ct!==void 0&&B(Ct),kt!==void 0&&te(kt),Tt!==void 0&&ae(Tt)}}),e[61]=Se,e[62]=r,e[63]=_e,e[64]=D,e[65]=Y,e[66]=X,e[67]=A,e[68]=ye):ye=e[68];let Oe;e[69]!==b||e[70]!==x?(Oe={from:b,to:x},e[69]=b,e[70]=x,e[71]=Oe):Oe=e[71];let ze;e[72]!==g||e[73]!==Oe?(ze=t.jsx(Xs,{value:Oe,onChange:g}),e[72]=g,e[73]=Oe,e[74]=ze):ze=e[74];let Ee;e[75]!==pe||e[76]!==ye||e[77]!==ze?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[pe,ye,ze]}),e[75]=pe,e[76]=ye,e[77]=ze,e[78]=Ee):Ee=e[78];let Pe;e[79]!==ie||e[80]!==Ee?(Pe=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ie,Ee]}),e[79]=ie,e[80]=Ee,e[81]=Pe):Pe=e[81];let Ae;e[82]!==p||e[83]!==i||e[84]!==r?(Ae=(r==="audit"||r==="threads")&&t.jsx(as,{value:i,onChange:Ie=>p({search:Ie}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Ie=>{Ie.key==="Escape"&&(p({search:""}),Ie.target.blur())},className:"w-full md:w-[375px]"}),e[82]=p,e[83]=i,e[84]=r,e[85]=Ae):Ae=e[85];let Ve;e[86]!==Pe||e[87]!==Ae?(Ve=t.jsx(Me.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[se,Pe,Ae]})}),e[86]=Pe,e[87]=Ae,e[88]=Ve):Ve=e[88];let Ue;e[89]!==S||e[90]!==h||e[91]!==be||e[92]!==z||e[93]!==o||e[94]!==l||e[95]!==a||e[96]!==G||e[97]!==m||e[98]!==U||e[99]!==$||e[100]!==T||e[101]!==i||e[102]!==n||e[103]!==r||e[104]!==D||e[105]!==Y||e[106]!==X||e[107]!==d||e[108]!==c?(Ue=r==="automations"?t.jsx(pr,{dateRange:l}):r==="threads"?t.jsx(Ss,{client:z,locator:$,membersData:T,allConnections:S,allVirtualMcps:h,dateRange:l,searchQuery:i,filterAgentIds:D,filterUserIds:X,filterStatus:Y}):r==="audit"?t.jsx(xr,{client:z,locator:$,baseParams:be,pageSize:W,isStreaming:m,streamingRefetchInterval:w,connectionIds:o,virtualMcpIds:c,tool:d,status:n,searchQuery:i,allConnections:S,allVirtualMcps:h,membersData:T}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(sr,{displayDateRange:a,connectionIds:o,excludeConnectionIds:G,toolName:d||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:m,streamingRefetchInterval:w,llmUserIds:U})}),e[89]=S,e[90]=h,e[91]=be,e[92]=z,e[93]=o,e[94]=l,e[95]=a,e[96]=G,e[97]=m,e[98]=U,e[99]=$,e[100]=T,e[101]=i,e[102]=n,e[103]=r,e[104]=D,e[105]=Y,e[106]=X,e[107]=d,e[108]=c,e[109]=Ue):Ue=e[109];let We;return e[110]!==Ve||e[111]!==Ue?(We=t.jsxs(t.Fragment,{children:[Ve,Ue]}),e[110]=Ve,e[111]=Ue,e[112]=We):We=e[112],We}function br(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:l=>{const{className:a}=l;return t.jsx(Ht,{url:r,fallback:e,shape:"circle",size:"2xs",className:ce("shrink-0",a)})}}}function yr(s){const e=s.icon,r=s.title??"Decopilot";return{value:s.id??"",label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:ce("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:ce("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function _o(){const s=le.c(83),{org:e}=Be(),r=bt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/settings/monitor"},s[0]=l):l=s[0];const a=ls(l),{tab:o,from:c,to:d,connectionId:n,virtualMcpId:i,tool:m,search:j,status:v,streaming:b,propertyFilters:x,hideSystem:L}=a,p=o===void 0?"overview":o;let g;s[1]!==n?(g=n===void 0?[]:n,s[1]=n,s[2]=g):g=s[2];const u=g;let k;s[3]!==i?(k=i===void 0?[]:i,s[3]=i,s[4]=k):k=s[4];const S=k,h=b===void 0?!0:b,T=x===void 0?"":x,I=L===void 0?!1:L;let f,M,y,R,C,E,F;if(s[5]!==u.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==T||s[11]!==a||s[12]!==v||s[13]!==h||s[14]!==d||s[15]!==m||s[16]!==S.length){C=Ks(T);let P;s[24]!==r||s[25]!==e.slug||s[26]!==a?(P=X=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...X}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=P):P=s[27],F=P;let N;s[28]!==F?(N=X=>{F({from:X.from,to:X.to})},s[28]=F,s[29]=N):N=s[29],R=N;let D,B;if(s[30]!==c||s[31]!==h||s[32]!==d){const X=we(c),te=we(d);B=X.date||new Date(Date.now()-18e5);const Y=te.date||new Date;y={startDate:B,endDate:Y},D=Y,h&&d==="now"&&(D=new Date(Y),D.setHours(D.getHours()+1)),s[30]=c,s[31]=h,s[32]=d,s[33]=y,s[34]=D,s[35]=B}else y=s[33],D=s[34],B=s[35];let ee;s[36]!==D||s[37]!==B?(ee={startDate:B,endDate:D},s[36]=D,s[37]=B,s[38]=ee):ee=s[38],M=ee,f=0,u.length>0&&f++,S.length>0&&f++,m&&f++,v!=="all"&&f++,I&&f++,E=C.filter(Sr),s[5]=u.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=T,s[11]=a,s[12]=v,s[13]=h,s[14]=d,s[15]=m,s[16]=S.length,s[17]=f,s[18]=M,s[19]=y,s[20]=R,s[21]=C,s[22]=E,s[23]=F}else f=s[17],M=s[18],y=s[19],R=s[20],C=s[21],E=s[22],F=s[23];const H=E;H.length>0&&(f=f+H.length);let A;s[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Me.Body,{className:"!pb-3",children:t.jsx(Me.Title,{children:"Monitoring"})}),s[39]=A):A=s[39];let W;s[40]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsxs(t.Fragment,{children:[A,t.jsx(Me.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(wt,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=W):W=s[40];let w;s[41]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Me.Title,{children:"Monitoring"}),s[41]=w):w=s[41];let _;s[42]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=_):_=s[42];let $;s[43]!==F?($=P=>F({tab:P}),s[43]=F,s[44]=$):$=s[44];let O;s[45]!==$||s[46]!==p?(O=t.jsx(Me.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[w,t.jsx(Bt,{tabs:_,activeTab:p,onTabChange:$})]})}),s[45]=$,s[46]=p,s[47]=O):O=s[47];let z;s[48]!==p?(z=p==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(Nt.Skeleton,{})}):p==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(Nt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(lr,{})}),s[48]=p,s[49]=z):z=s[49];let V;s[50]!==O||s[51]!==z?(V=t.jsxs(t.Fragment,{children:[O,z]}),s[50]=O,s[51]=z,s[52]=V):V=s[52];let q;s[53]!==R?(q=P=>{xt("monitoring_time_range_changed",{from:P.from,to:P.to}),R(P)},s[53]=R,s[54]=q):q=s[54];let J;s[55]!==h||s[56]!==F?(J=()=>{xt("monitoring_live_toggled",{enabled:!h}),F({streaming:!h})},s[55]=h,s[56]=F,s[57]=J):J=s[57];let G;s[58]!==p||s[59]!==F?(G=P=>{P!==p&&xt("monitoring_tab_changed",{from_tab:p,to_tab:P}),F({tab:P})},s[58]=p,s[59]=F,s[60]=G):G=s[60];let Q;s[61]!==f||s[62]!==u||s[63]!==M||s[64]!==y||s[65]!==c||s[66]!==I||s[67]!==C||s[68]!==j||s[69]!==v||s[70]!==h||s[71]!==q||s[72]!==J||s[73]!==G||s[74]!==p||s[75]!==d||s[76]!==m||s[77]!==F||s[78]!==S?(Q=t.jsx(Nr,{tab:p,dateRange:M,displayDateRange:y,connectionIds:u,virtualMcpIds:S,tool:m,status:v,search:j,streaming:h,hideSystem:I,activeFiltersCount:f,from:c,to:d,propertyFilters:C,onUpdateFilters:F,onTimeRangeChange:q,onStreamingToggle:J,onTabChange:G}),s[61]=f,s[62]=u,s[63]=M,s[64]=y,s[65]=c,s[66]=I,s[67]=C,s[68]=j,s[69]=v,s[70]=h,s[71]=q,s[72]=J,s[73]=G,s[74]=p,s[75]=d,s[76]=m,s[77]=F,s[78]=S,s[79]=Q):Q=s[79];let U;return s[80]!==V||s[81]!==Q?(U=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(Me,{children:t.jsx(os,{fallback:W,children:t.jsx(K.Suspense,{fallback:V,children:Q})})})}),s[80]=V,s[81]=Q,s[82]=U):U=s[82],U}function Sr(s){return s.key.trim()}export{_o as default};
8
+ debug?`,value:I,onChange:w=>f(w.target.value),onBlur:P,onKeyDown:w=>{w.key==="Enter"&&w.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:[h.map((w,_)=>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 ",_+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>F(_),children:t.jsx(vs,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ge,{placeholder:"Key (e.g., thread_id)",value:w.key,onChange:$=>C(_,{key:$.target.value}),onBlur:H,onKeyDown:$=>{$.key==="Enter"&&H()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:w.operator,onValueChange:$=>{const O=[...h],z=O[_];z&&(O[_]={...z,operator:$,value:$==="exists"?"":z.value},T(O),i({propertyFilters:Le(O)}))},children:[t.jsx(lt,{className:"w-28",children:t.jsx(ot,{})}),t.jsx(at,{children:jr.map($=>t.jsx(Fe,{value:$.value,children:$.label},$.value))})]})]}),w.operator!=="exists"&&t.jsx(Ge,{placeholder:"Value",value:w.value,onChange:$=>C(_,{value:$.target.value}),onBlur:H,onKeyDown:$=>{$.key==="Enter"&&H()},className:"w-full font-mono text-sm"})]},_)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:E,children:[t.jsx(js,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),T([]),f(""),i({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),p(!1)},children:"Clear all filters"})]})})]})}function Nr(s){const e=le.c(113),{tab:r,dateRange:l,displayDateRange:a,connectionIds:o,virtualMcpIds:c,tool:d,status:n,search:i,streaming:m,hideSystem:j,activeFiltersCount:v,from:b,to:x,propertyFilters:L,onUpdateFilters:p,onTimeRangeChange:g,onStreamingToggle:u,onTabChange:k}=s,S=Dt(),h=hs(),{data:T}=fs(),[I,f]=K.useState(""),M=I||void 0;let y;e[0]!==M?(y={searchTerm:M},e[0]=M,e[1]=y):y=e[1];const R=Dt(y);let C;e[2]!==R?(C=R??[],e[2]=R,e[3]=C):C=e[3];let E;e[4]!==C?(E=C.map(wr),e[4]=C,e[5]=E):E=e[5];const F=E;let H;e[6]!==h?(H=h.map(yr),e[6]=h,e[7]=H):H=e[7];const P=H,{pageSize:W,streamingRefetchInterval:w}=vt,{org:_,locator:$}=Be();let O;e[8]!==_.id||e[9]!==_.slug?(O={connectionId:St,orgId:_.id,orgSlug:_.slug},e[8]=_.id,e[9]=_.slug,e[10]=O):O=e[10];const z=It(O);let V;e[11]!==L?(V=qs(L),e[11]=L,e[12]=V):V=e[12];const q=V;let J;e[13]!==j||e[14]!==_.id?(J=j?[ps.SELF(_.id)]:void 0,e[13]=j,e[14]=_.id,e[15]=J):J=e[15];const G=J;let Q;e[16]===Symbol.for("react.memo_cache_sentinel")?(Q=[],e[16]=Q):Q=e[16];const[U,A]=K.useState(Q);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[D,B]=K.useState(N);let ee;e[18]===Symbol.for("react.memo_cache_sentinel")?(ee=[],e[18]=ee):ee=e[18];const[X,te]=K.useState(ee),[Y,ae]=K.useState("all"),_e=(D.length>0?1:0)+(X.length>0?1:0)+(Y!=="all"?1:0);let $e;e[19]!==T?($e=Kt(T).map(br),e[19]=T,e[20]=$e):$e=e[20];const Se=$e;let ne;e[21]!==l.startDate?(ne=l.startDate.toISOString(),e[21]=l.startDate,e[22]=ne):ne=e[22];let he;e[23]!==l.endDate?(he=l.endDate.toISOString(),e[23]=l.endDate,e[24]=he):he=e[24];const ge=o.length===1?o[0]:void 0,je=c.length===1?c[0]:void 0,ve=d||void 0,Ne=n==="errors"?!0:n==="success"?!1:void 0;let de;e[25]!==G||e[26]!==q||e[27]!==ne||e[28]!==he||e[29]!==ge||e[30]!==je||e[31]!==ve||e[32]!==Ne?(de={startDate:ne,endDate:he,connectionId:ge,excludeConnectionIds:G,virtualMcpId:je,toolName:ve,isError:Ne,...q},e[25]=G,e[26]=q,e[27]=ne,e[28]=he,e[29]=ge,e[30]=je,e[31]=ve,e[32]=Ne,e[33]=de):de=e[33];const be=de;let me;e[34]===Symbol.for("react.memo_cache_sentinel")?(me={id:"overview",label:"Overview"},e[34]=me):me=e[34];let ue;e[35]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"audit",label:"Audit"},e[35]=ue):ue=e[35];let xe;e[36]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"threads",label:"Threads"},e[36]=xe):xe=e[36];let fe;e[37]===Symbol.for("react.memo_cache_sentinel")?(fe=[me,ue,xe,{id:"automations",label:"Automations"}],e[37]=fe):fe=e[37];const Re=fe;let se;e[38]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx(Me.Title,{children:"Monitoring"}),e[38]=se):se=e[38];let re;e[39]!==k?(re=Ie=>k(Ie),e[39]=k,e[40]=re):re=e[40];let ie;e[41]!==re||e[42]!==r?(ie=t.jsx(Bt,{tabs:Re,activeTab:r,onTabChange:re}),e[41]=re,e[42]=r,e[43]=ie):ie=e[43];let pe;e[44]!==v||e[45]!==o||e[46]!==F||e[47]!==I||e[48]!==j||e[49]!==m||e[50]!==U||e[51]!==Se||e[52]!==u||e[53]!==p||e[54]!==L||e[55]!==n||e[56]!==r||e[57]!==d||e[58]!==c||e[59]!==P?(pe=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:m?"secondary":"outline",className:"gap-1.5",onClick:u,children:[m&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),m&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(vr,{connectionIds:o,virtualMcpIds:c,tool:d,status:n,hideSystem:j,propertyFilters:L,connectionOptions:F,virtualMcpOptions:P,activeFiltersCount:v,onUpdateFilters:p,connectionSearchTerm:I,onConnectionSearchChange:f,memberOptions:Se,llmUserIds:U,onLlmUserIdsChange:A,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=o,e[46]=F,e[47]=I,e[48]=j,e[49]=m,e[50]=U,e[51]=Se,e[52]=u,e[53]=p,e[54]=L,e[55]=n,e[56]=r,e[57]=d,e[58]=c,e[59]=P,e[60]=pe):pe=e[60];let ye;e[61]!==Se||e[62]!==r||e[63]!==_e||e[64]!==D||e[65]!==Y||e[66]!==X||e[67]!==P?(ye=r==="threads"&&t.jsx(ws,{filterAgentIds:D,filterUserIds:X,filterStatus:Y,virtualMcpOptions:P,memberOptions:Se,activeFiltersCount:_e,onUpdateFilters:Ie=>{const{filterAgentIds:Ct,filterUserIds:kt,filterStatus:Tt}=Ie;Ct!==void 0&&B(Ct),kt!==void 0&&te(kt),Tt!==void 0&&ae(Tt)}}),e[61]=Se,e[62]=r,e[63]=_e,e[64]=D,e[65]=Y,e[66]=X,e[67]=P,e[68]=ye):ye=e[68];let Oe;e[69]!==b||e[70]!==x?(Oe={from:b,to:x},e[69]=b,e[70]=x,e[71]=Oe):Oe=e[71];let ze;e[72]!==g||e[73]!==Oe?(ze=t.jsx(Xs,{value:Oe,onChange:g}),e[72]=g,e[73]=Oe,e[74]=ze):ze=e[74];let Ee;e[75]!==pe||e[76]!==ye||e[77]!==ze?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[pe,ye,ze]}),e[75]=pe,e[76]=ye,e[77]=ze,e[78]=Ee):Ee=e[78];let Ae;e[79]!==ie||e[80]!==Ee?(Ae=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ie,Ee]}),e[79]=ie,e[80]=Ee,e[81]=Ae):Ae=e[81];let Pe;e[82]!==p||e[83]!==i||e[84]!==r?(Pe=(r==="audit"||r==="threads")&&t.jsx(as,{value:i,onChange:Ie=>p({search:Ie}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Ie=>{Ie.key==="Escape"&&(p({search:""}),Ie.target.blur())},className:"w-full md:w-[375px]"}),e[82]=p,e[83]=i,e[84]=r,e[85]=Pe):Pe=e[85];let Ve;e[86]!==Ae||e[87]!==Pe?(Ve=t.jsx(Me.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[se,Ae,Pe]})}),e[86]=Ae,e[87]=Pe,e[88]=Ve):Ve=e[88];let Ue;e[89]!==S||e[90]!==h||e[91]!==be||e[92]!==z||e[93]!==o||e[94]!==l||e[95]!==a||e[96]!==G||e[97]!==m||e[98]!==U||e[99]!==$||e[100]!==T||e[101]!==i||e[102]!==n||e[103]!==r||e[104]!==D||e[105]!==Y||e[106]!==X||e[107]!==d||e[108]!==c?(Ue=r==="automations"?t.jsx(pr,{dateRange:l}):r==="threads"?t.jsx(Ss,{client:z,locator:$,membersData:T,allConnections:S,allVirtualMcps:h,dateRange:l,searchQuery:i,filterAgentIds:D,filterUserIds:X,filterStatus:Y}):r==="audit"?t.jsx(xr,{client:z,locator:$,baseParams:be,pageSize:W,isStreaming:m,streamingRefetchInterval:w,connectionIds:o,virtualMcpIds:c,tool:d,status:n,searchQuery:i,allConnections:S,allVirtualMcps:h,membersData:T}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(sr,{displayDateRange:a,connectionIds:o,excludeConnectionIds:G,toolName:d||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:m,streamingRefetchInterval:w,llmUserIds:U})}),e[89]=S,e[90]=h,e[91]=be,e[92]=z,e[93]=o,e[94]=l,e[95]=a,e[96]=G,e[97]=m,e[98]=U,e[99]=$,e[100]=T,e[101]=i,e[102]=n,e[103]=r,e[104]=D,e[105]=Y,e[106]=X,e[107]=d,e[108]=c,e[109]=Ue):Ue=e[109];let We;return e[110]!==Ve||e[111]!==Ue?(We=t.jsxs(t.Fragment,{children:[Ve,Ue]}),e[110]=Ve,e[111]=Ue,e[112]=We):We=e[112],We}function br(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:l=>{const{className:a}=l;return t.jsx(Ht,{url:r,fallback:e,shape:"circle",size:"2xs",className:ce("shrink-0",a)})}}}function yr(s){const e=s.icon,r=s.title??"Decopilot";return{value:s.id??"",label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:ce("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:ce("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Do(){const s=le.c(83),{org:e}=Be(),r=bt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/settings/monitor"},s[0]=l):l=s[0];const a=ls(l),{tab:o,from:c,to:d,connectionId:n,virtualMcpId:i,tool:m,search:j,status:v,streaming:b,propertyFilters:x,hideSystem:L}=a,p=o===void 0?"overview":o;let g;s[1]!==n?(g=n===void 0?[]:n,s[1]=n,s[2]=g):g=s[2];const u=g;let k;s[3]!==i?(k=i===void 0?[]:i,s[3]=i,s[4]=k):k=s[4];const S=k,h=b===void 0?!0:b,T=x===void 0?"":x,I=L===void 0?!1:L;let f,M,y,R,C,E,F;if(s[5]!==u.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==T||s[11]!==a||s[12]!==v||s[13]!==h||s[14]!==d||s[15]!==m||s[16]!==S.length){C=Ks(T);let A;s[24]!==r||s[25]!==e.slug||s[26]!==a?(A=X=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...X}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=A):A=s[27],F=A;let N;s[28]!==F?(N=X=>{F({from:X.from,to:X.to})},s[28]=F,s[29]=N):N=s[29],R=N;let D,B;if(s[30]!==c||s[31]!==h||s[32]!==d){const X=we(c),te=we(d);B=X.date||new Date(Date.now()-18e5);const Y=te.date||new Date;y={startDate:B,endDate:Y},D=Y,h&&d==="now"&&(D=new Date(Y),D.setHours(D.getHours()+1)),s[30]=c,s[31]=h,s[32]=d,s[33]=y,s[34]=D,s[35]=B}else y=s[33],D=s[34],B=s[35];let ee;s[36]!==D||s[37]!==B?(ee={startDate:B,endDate:D},s[36]=D,s[37]=B,s[38]=ee):ee=s[38],M=ee,f=0,u.length>0&&f++,S.length>0&&f++,m&&f++,v!=="all"&&f++,I&&f++,E=C.filter(Sr),s[5]=u.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=T,s[11]=a,s[12]=v,s[13]=h,s[14]=d,s[15]=m,s[16]=S.length,s[17]=f,s[18]=M,s[19]=y,s[20]=R,s[21]=C,s[22]=E,s[23]=F}else f=s[17],M=s[18],y=s[19],R=s[20],C=s[21],E=s[22],F=s[23];const H=E;H.length>0&&(f=f+H.length);let P;s[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Me.Body,{className:"!pb-3",children:t.jsx(Me.Title,{children:"Monitoring"})}),s[39]=P):P=s[39];let W;s[40]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsxs(t.Fragment,{children:[P,t.jsx(Me.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(wt,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=W):W=s[40];let w;s[41]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Me.Title,{children:"Monitoring"}),s[41]=w):w=s[41];let _;s[42]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=_):_=s[42];let $;s[43]!==F?($=A=>F({tab:A}),s[43]=F,s[44]=$):$=s[44];let O;s[45]!==$||s[46]!==p?(O=t.jsx(Me.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[w,t.jsx(Bt,{tabs:_,activeTab:p,onTabChange:$})]})}),s[45]=$,s[46]=p,s[47]=O):O=s[47];let z;s[48]!==p?(z=p==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(Nt.Skeleton,{})}):p==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(Nt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(lr,{})}),s[48]=p,s[49]=z):z=s[49];let V;s[50]!==O||s[51]!==z?(V=t.jsxs(t.Fragment,{children:[O,z]}),s[50]=O,s[51]=z,s[52]=V):V=s[52];let q;s[53]!==R?(q=A=>{xt("monitoring_time_range_changed",{from:A.from,to:A.to}),R(A)},s[53]=R,s[54]=q):q=s[54];let J;s[55]!==h||s[56]!==F?(J=()=>{xt("monitoring_live_toggled",{enabled:!h}),F({streaming:!h})},s[55]=h,s[56]=F,s[57]=J):J=s[57];let G;s[58]!==p||s[59]!==F?(G=A=>{A!==p&&xt("monitoring_tab_changed",{from_tab:p,to_tab:A}),F({tab:A})},s[58]=p,s[59]=F,s[60]=G):G=s[60];let Q;s[61]!==f||s[62]!==u||s[63]!==M||s[64]!==y||s[65]!==c||s[66]!==I||s[67]!==C||s[68]!==j||s[69]!==v||s[70]!==h||s[71]!==q||s[72]!==J||s[73]!==G||s[74]!==p||s[75]!==d||s[76]!==m||s[77]!==F||s[78]!==S?(Q=t.jsx(Nr,{tab:p,dateRange:M,displayDateRange:y,connectionIds:u,virtualMcpIds:S,tool:m,status:v,search:j,streaming:h,hideSystem:I,activeFiltersCount:f,from:c,to:d,propertyFilters:C,onUpdateFilters:F,onTimeRangeChange:q,onStreamingToggle:J,onTabChange:G}),s[61]=f,s[62]=u,s[63]=M,s[64]=y,s[65]=c,s[66]=I,s[67]=C,s[68]=j,s[69]=v,s[70]=h,s[71]=q,s[72]=J,s[73]=G,s[74]=p,s[75]=d,s[76]=m,s[77]=F,s[78]=S,s[79]=Q):Q=s[79];let U;return s[80]!==V||s[81]!==Q?(U=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(Me,{children:t.jsx(os,{fallback:W,children:t.jsx(K.Suspense,{fallback:V,children:Q})})})}),s[80]=V,s[81]=Q,s[82]=U):U=s[82],U}function Sr(s){return s.key.trim()}export{Do as default};
@@ -1 +1 @@
1
- import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-Ds73tc0J.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:v}=x,B=b&&!P,y=Q(D),F=new RegExp(`\\s${y}$`),h=j?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const K=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=K+u.index;let p=I+u[0].length;return B&&F.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:j=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:F="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:K=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,O=A||i&&R;if(!w&&!k&&!O)return;const $=O&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),O&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=K({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(F),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
1
+ import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-BNzrPnq5.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:v}=x,B=b&&!P,y=Q(D),F=new RegExp(`\\s${y}$`),h=j?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const K=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=K+u.index;let p=I+u[0].length;return B&&F.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:j=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:F="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:K=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,O=A||i&&R;if(!w&&!k&&!O)return;const $=O&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),O&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=K({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(F),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};