decocms 4.507.0 → 4.507.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 (385) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-qG-AEsLH.js → ActiveShapeUtils-BpUYB5M6.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-DZq02EzT.js → AlertCircle-Bty2uhsk.js} +1 -1
  3. package/dist/client/assets/{AreaChart-BtdW-Fy2.js → AreaChart-DSbx8Pux.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-C_qdjo3L.js → ArrowLeft-CGwuLtbU.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-B_lKPC5O.js → ArrowUp-BYzq623p.js} +1 -1
  6. package/dist/client/assets/{BarChart-4XWgQXi5.js → BarChart-ws0Z6t_Q.js} +1 -1
  7. package/dist/client/assets/{Building02-LYkR_QXB.js → Building02-DC1B_tJa.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CHtvdKKv.js → CategoricalChart-Bhsngimh.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-B9QHilAa.js → CheckCircle-DPGL3Hpc.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-0ysVIDar.js → ChevronSelectorVertical-BwRvUPUM.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-D4PiHnN0.js → ChevronUp-D5DP9qHs.js} +1 -1
  12. package/dist/client/assets/{Copy01-DJEr7OLy.js → Copy01-51uCRbSg.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-b36fqa11.js → CreditCard01-D8QKn2t6.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-CV1b1y4C.js → DotsVertical-Bhq6_ex6.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-UL-jymXX.js → ErrorBarContext-C8nCqXCd.js} +1 -1
  16. package/dist/client/assets/{Globe04-DKUCyty7.js → Globe04-C6aR04Lg.js} +1 -1
  17. package/dist/client/assets/{Image01-CyRCJwXT.js → Image01-8_YUB9dA.js} +1 -1
  18. package/dist/client/assets/{Key01-DWXRgH6w.js → Key01-BYJLiX2A.js} +1 -1
  19. package/dist/client/assets/{Link01-CNb9DW_9.js → Link01-BrX96Lzm.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-BU-4AKfc.js → LinkBroken01-DvM0DBf8.js} +1 -1
  21. package/dist/client/assets/{Monitor01-yE6iFgVP.js → Monitor01-D0i8fPos.js} +1 -1
  22. package/dist/client/assets/{Play-ChRMrCTB.js → Play-BefGY3fA.js} +1 -1
  23. package/dist/client/assets/{Plus-DtZhz_pb.js → Plus-Bk_sjqOf.js} +1 -1
  24. package/dist/client/assets/{SearchMd-BQTuqO8x.js → SearchMd-Cey_qFlh.js} +1 -1
  25. package/dist/client/assets/{Sector-DeEfQN_u.js → Sector-CtKVpBRQ.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-CQIeNQm_.js → ShoppingBag01-DmYaqF6W.js} +1 -1
  27. package/dist/client/assets/{Sun-kLYmwsq0.js → Sun-Vjoy_5bv.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DGImzN1R.js → SwitchHorizontal01-Cpiuomvl.js} +1 -1
  29. package/dist/client/assets/{Tool01-BRVvW2LV.js → Tool01-BxfOk1kQ.js} +1 -1
  30. package/dist/client/assets/{Trash01-Bt3rK1ka.js → Trash01-CMp64biU.js} +1 -1
  31. package/dist/client/assets/{Upload01-s7SnRMvp.js → Upload01-Dgeov9JH.js} +1 -1
  32. package/dist/client/assets/{User01-BmCbB_zb.js → User01-hKw9FGQs.js} +1 -1
  33. package/dist/client/assets/{UserSquare-DL7MdeuL.js → UserSquare-J-pPBDsM.js} +1 -1
  34. package/dist/client/assets/{Users01-BVggEmV6.js → Users01-D83kTTD4.js} +1 -1
  35. package/dist/client/assets/{XAxis-CDuxbcPP.js → XAxis-DP4n5Mz1.js} +1 -1
  36. package/dist/client/assets/{XClose-UWi3HSZE.js → XClose-BnQLG2SG.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-B4Rw_R2z.js → ZoomOut-DAA80mSj.js} +1 -1
  38. package/dist/client/assets/{access-gate-D3L-T38D.js → access-gate-BPTmRdwJ.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-8k8OTwPv.js → add-connection-dialog-DJYTiZdc.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-bu3kFNJu.js → agent-analytics-CciBDuVD.js} +1 -1
  41. package/dist/client/assets/agent-app-DiZwp2A0.js +1 -0
  42. package/dist/client/assets/{agent-assets-DJjZB71J.js → agent-assets-BtIBrBU2.js} +1 -1
  43. package/dist/client/assets/{agent-automation-5jRP2Yu0.js → agent-automation-xojgkWpW.js} +3 -3
  44. package/dist/client/assets/{agent-automations-DBSfm1Um.js → agent-automations-DI9zixMm.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-C1dugrdG.js → agent-connect-sources-CTaUDT6P.js} +1 -1
  46. package/dist/client/assets/agent-deck-jNu9-E3W.js +1 -0
  47. package/dist/client/assets/{agent-e2e-PI2OzWvI.js → agent-e2e-CMbdmVpE.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-DRdlymR5.js → agent-experiments-BAiMCicr.js} +1 -1
  49. package/dist/client/assets/{agent-file-BzADFUid.js → agent-file-IVz8YLfb.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-CPH-NeL_.js → agent-hosting--MjQUCqO.js} +1 -1
  51. package/dist/client/assets/{agent-icon-Blcoi2NV.js → agent-icon-CdvQWbsW.js} +1 -1
  52. package/dist/client/assets/agent-library-DuL0qEtT.js +1 -0
  53. package/dist/client/assets/agent-library-file-Yb6uRPKq.js +1 -0
  54. package/dist/client/assets/{agent-monitor-PGLXk9dq.js → agent-monitor-D3m53JTs.js} +1 -1
  55. package/dist/client/assets/{agent-overview-D278LRIL.js → agent-overview-CEg-2iVO.js} +1 -1
  56. package/dist/client/assets/{agent-releases-CwPpC6Zn.js → agent-releases-DiaV8DC-.js} +1 -1
  57. package/dist/client/assets/agent-settings-DdQ64SOh.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-BSI5T3i7.js → agent-site-editor-C5QM4WzO.js} +1 -1
  59. package/dist/client/assets/agent-site-editor-code-TvR4NVzG.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-D9MSMJlS.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-1BlZLcsH.js +1 -0
  62. package/dist/client/assets/agent-view-CaYqv_5j.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-CVWBSVAR.js → agent-view-guard-BUPMHzY7.js} +1 -1
  64. package/dist/client/assets/{agents-list-DYmELJk-.js → agents-list-CK-X0XMD.js} +1 -1
  65. package/dist/client/assets/{ai-providers-B3x7urKU.js → ai-providers-BRhxQzWW.js} +1 -1
  66. package/dist/client/assets/{alert-Dp8EatFO.js → alert-CpswsOed.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-qlQC4zlU.js → alert-dialog-C9FvnbJH.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-BirEZrZQ.js → analytics-sections-CbcIa337.js} +1 -1
  69. package/dist/client/assets/api-keys-C6QAXUnz.js +1 -0
  70. package/dist/client/assets/{api-keys-7UDmxa_w.js → api-keys-DlsaE7fm.js} +1 -1
  71. package/dist/client/assets/{app-editor-tLSj0Sjg.js → app-editor-BoavkVeY.js} +1 -1
  72. package/dist/client/assets/{asset-utils-DYZVbDw1.js → asset-utils-D7MF6-R7.js} +1 -1
  73. package/dist/client/assets/{auth-CLglKqB6.js → auth-MJlmDrih.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-CrJHPLPw.js → auth-catchall-BHMd9Ph5.js} +1 -1
  75. package/dist/client/assets/{auth-entry-CD3L2RvS.js → auth-entry-DL7EFmi7.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-UjhzYVxM.js → auth-split-layout-DW5pckra.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-ClVBgGv4.js → authenticate-and-persist-oauth-DjLIsCBn.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-CAEPQbgy.js → automation-list-row-BjiQRizI.js} +1 -1
  79. package/dist/client/assets/{automation-runs-dUM-MaiP.js → automation-runs-80f4mOhg.js} +1 -1
  80. package/dist/client/assets/{automations-megKF7It.js → automations-DvVYYa4T.js} +1 -1
  81. package/dist/client/assets/{autosend-CE_yiNtR.js → autosend-BfqtXC9i.js} +1 -1
  82. package/dist/client/assets/{avatar-B8cS3VPt.js → avatar-V-6seD4f.js} +1 -1
  83. package/dist/client/assets/{badge-Qzxf6tet.js → badge-xuppbiJQ.js} +1 -1
  84. package/dist/client/assets/{block-document-AKpwbifj.js → block-document-Btuft_G8.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-VkiPmc8G.js → blocks-preview-workspace-context-BgDdSp2f.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-BbjL1qhZ.js → blocks-tab-states-Db9AzGGz.js} +3 -3
  87. package/dist/client/assets/{blog-schema-DL-wxhkE.js → blog-schema-COmuQoqg.js} +1 -1
  88. package/dist/client/assets/{board-analytics-C1pwywOy.js → board-analytics-DmUIfxqn.js} +1 -1
  89. package/dist/client/assets/{buckets-DZKIT9DY.js → buckets-BUVMZHRM.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-1VLAf1m8.js → build-improve-prompt-doc-LycMDrLL.js} +1 -1
  91. package/dist/client/assets/{calendar-BuSRVV5D.js → calendar-BFQivyIG.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-DBmMi5Hs.js → capability-load-error-DT-E9Kqv.js} +1 -1
  93. package/dist/client/assets/{category-editor-DVRF9hj1.js → category-editor-D7z_VQuj.js} +1 -1
  94. package/dist/client/assets/{chart-NrDAd4pe.js → chart-Bf8aJepc.js} +1 -1
  95. package/dist/client/assets/{chat-context-Ch-VpD9W.js → chat-context-CShbCUNX.js} +1 -1
  96. package/dist/client/assets/{chat-draft-B2p2B6Yw.js → chat-draft-D5xPO9J5.js} +1 -1
  97. package/dist/client/assets/{checkbox-C0-Eo7G1.js → checkbox-CsdxV5F4.js} +1 -1
  98. package/dist/client/assets/{choose-editor-BeLyDWVx.js → choose-editor-Cob5iDz2.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-DUKgfRgt.js → cli-auth-success-BGAGjJYR.js} +1 -1
  100. package/dist/client/assets/{client-icons-DtQhx8-x.js → client-icons-C0O_MDmG.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-CQKCJYGK.js +1 -0
  102. package/dist/client/assets/{collapsible-EpmgpNpi.js → collapsible-pbpDRVGu.js} +1 -1
  103. package/dist/client/assets/{collection-detail-BTHodnm7.js → collection-detail-QEBGQhqZ.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-__Pm6Nmn.js → collection-display-button-Bo5uFmZI.js} +1 -1
  105. package/dist/client/assets/{collection-search-ehqGBK_4.js → collection-search-B8HvNhHx.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-BBPmRt9r.js → collection-table-wrapper-CME0ZXYS.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-iTmpvLeT.js → collection-tabs-P32YIIxy.js} +1 -1
  108. package/dist/client/assets/{column-rules-adUN8XvK.js → column-rules-DJkbTYf8.js} +1 -1
  109. package/dist/client/assets/{combobox-BUo7EBrO.js → combobox-95bHdh7B.js} +1 -1
  110. package/dist/client/assets/{command-BAgcQ2fh.js → command-CdQubtgL.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-CAn17bJY.js → companion-mcps-section-DT-zqSA0.js} +1 -1
  112. package/dist/client/assets/{config-BDu66MgM.js → config-CC4U9lyT.js} +1 -1
  113. package/dist/client/assets/{connect-2yc9-JJp.js → connect-D_OdkLzZ.js} +2 -2
  114. package/dist/client/assets/{connect-layout-DtIoh422.js → connect-layout-DKUDTFmt.js} +1 -1
  115. package/dist/client/assets/{connection-B8e9uIdy.js → connection-DS2m6_aA.js} +1 -1
  116. package/dist/client/assets/{connection-card-CLVSIR42.js → connection-card-C1INmiO3.js} +1 -1
  117. package/dist/client/assets/{connection-detail-DN36Ozvh.js → connection-detail-govoielY.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-CSZF_TQx.js → connection-form-helpers-Bdbv__5q.js} +1 -1
  119. package/dist/client/assets/{connections-DC5XESZs.js → connections-CS9HbJB3.js} +1 -1
  120. package/dist/client/assets/{content-tab-DUe9Pk3L.js → content-tab-DWizMuHE.js} +3 -3
  121. package/dist/client/assets/{context-DdNfBAMU.js → context-TX95KwtD.js} +1 -1
  122. package/dist/client/assets/{context-menu-DJ87apJ2.js → context-menu-CV5Kwy0Y.js} +1 -1
  123. package/dist/client/assets/{core.esm-C7s0VVJH.js → core.esm-DySokeDD.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-DoF61er3.js → create-organization-dialog-BKXj66H0.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-C775e_y-.js → daily-pulse-BnWqY20A.js} +1 -1
  126. package/dist/client/assets/{discover-C_Que9Au.js → discover-CwLdifKu.js} +1 -1
  127. package/dist/client/assets/{domain-settings-CT-S0BOV.js → domain-settings-bBNFtUzG.js} +1 -1
  128. package/dist/client/assets/{drawer-CixpU7n-.js → drawer-CY01gtte.js} +1 -1
  129. package/dist/client/assets/{editor-BKRP2Iwc.js → editor-BMsJkpc5.js} +1 -1
  130. package/dist/client/assets/{editor-classes-DZByr-lI.js → editor-classes-hvMxYRPw.js} +1 -1
  131. package/dist/client/assets/{empty-state-BZZcWHI_.js → empty-state-DbF1fVB1.js} +1 -1
  132. package/dist/client/assets/{empty-state-DQLm0d5k.js → empty-state-lMQw4wDb.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-DJs0gTBx.js → extract-connection-data-CxPHH0g-.js} +1 -1
  134. package/dist/client/assets/{feature-gate-CgRSy5_Q.js → feature-gate-yx1JPdIs.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-EueGiC9A.js → feature-paywall-BVtlmh2X.js} +1 -1
  136. package/dist/client/assets/{file-explorer-cu0ZoZ2i.js → file-explorer-ibryp6QB.js} +1 -1
  137. package/dist/client/assets/{file-preview-BJ_PkL7X.js → file-preview-C0xlzOg8.js} +1 -1
  138. package/dist/client/assets/{file-share-button-rEinR-qh.js → file-share-button-DpvTad7o.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-C2JXE2hG.js → file-type-icon-DuTvDFZv.js} +1 -1
  140. package/dist/client/assets/flat-project-ZH6vKlez.js +1 -0
  141. package/dist/client/assets/{folder-icon-Cayf6XFB.js → folder-icon-whk1wgCT.js} +1 -1
  142. package/dist/client/assets/{form-BivWj0r6.js → form-C3-gqoE3.js} +1 -1
  143. package/dist/client/assets/{general-BQtDTtDD.js → general-CWIFD_7I.js} +1 -1
  144. package/dist/client/assets/{home-DncG44Vc.js → home-DT5-zQ3E.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-CfrjUALv.js → hosted-publish-feedback-D6Ffo0E3.js} +1 -1
  146. package/dist/client/assets/{icon-button-DxqkkLQj.js → icon-button-BS-JGKQE.js} +1 -1
  147. package/dist/client/assets/{index-BtcVoJOD.js → index-2To0vSEr.js} +1 -1
  148. package/dist/client/assets/{index-BvuLMeCw.js → index-3zItT2RS.js} +3 -3
  149. package/dist/client/assets/{index-CZciUUmu.js → index-BfPVLbyp.js} +2 -2
  150. package/dist/client/assets/{index-NRMbjvM1.js → index-Bw86rqRb.js} +1 -1
  151. package/dist/client/assets/{index-TD9q6ZAx.js → index-CTZFCFor.js} +30 -30
  152. package/dist/client/assets/index-CdXcvK9e.js +1 -0
  153. package/dist/client/assets/{index-CvK4-KP3.js → index-CocrhzZC.js} +14 -14
  154. package/dist/client/assets/{index-BYmaAL9a.js → index-CylNQm53.js} +1 -1
  155. package/dist/client/assets/{index-C47EvNjt.js → index-D1WhOgDF.js} +1 -1
  156. package/dist/client/assets/{index-5vR8G6oj.js → index-D3Egkv0G.js} +1 -1
  157. package/dist/client/assets/{index-BF64aC--.js → index-DN6_-RzX.js} +1 -1
  158. package/dist/client/assets/{index-B26ImUL7.js → index-DQRAWCM4.js} +1 -1
  159. package/dist/client/assets/{index-xlh3U8dq.js → index-DbWYgc1J.js} +1 -1
  160. package/dist/client/assets/{index-C-gf76Hu.js → index-JOoGKn03.js} +1 -1
  161. package/dist/client/assets/{index-DV6FL3mH.js → index-ONAPJHIb.js} +1 -1
  162. package/dist/client/assets/{index-redirect-CCsqcmui.js → index-redirect-B7Nxq720.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-X8qh_Va6.js → infiniteQueryObserver-DjFxX3t4.js} +1 -1
  164. package/dist/client/assets/{infra-billing-fufjpAYz.js → infra-billing-C91ooPoC.js} +1 -1
  165. package/dist/client/assets/input-CAuGdxaS.js +1 -0
  166. package/dist/client/assets/{input-BSUErVvJ.js → input-zzyYgG2z.js} +3 -3
  167. package/dist/client/assets/{integration-icon-DJtlg_0w.js → integration-icon-DedJ1gFL.js} +1 -1
  168. package/dist/client/assets/{jira-icon-D0XL00z9.js → jira-icon-BH-e3sV4.js} +1 -1
  169. package/dist/client/assets/{label-B-SEr3Fs.js → label-BxQ_dsc6.js} +1 -1
  170. package/dist/client/assets/{layout-BI2BIstR.js → layout-C3yBCGKV.js} +1 -1
  171. package/dist/client/assets/legacy-agents-deep-CPUJGbk4.js +1 -0
  172. package/dist/client/assets/{legacy-main-redirect-D6tF7agn.js → legacy-main-redirect-Cd5BSaGF.js} +1 -1
  173. package/dist/client/assets/library-C1JuHwwk.js +1 -0
  174. package/dist/client/assets/{library-tab-BZkqrpuT.js → library-tab-DAuCMhST.js} +1 -1
  175. package/dist/client/assets/{login-C9lgbiSh.js → login-DCgWtHlv.js} +1 -1
  176. package/dist/client/assets/{markdown-B-jDeUMA.js → markdown-B3gUf9fq.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-Bk4hyaxU.js → mcp-app-renderer-4oVWjJbt.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-CaxV9wcl.js → mcp-oauth-DnmbC1ZC.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-V-o-AEQP.js → mcp-oauth-Dx8iOGEt.js} +1 -1
  180. package/dist/client/assets/{members-BLeFrNm9.js → members-PWoNTeHj.js} +1 -1
  181. package/dist/client/assets/{memory-BsNDNxr2.js → memory-BEuf8l8C.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-B0fqOWnH.js → mini-report-page-BQGdzpbF.js} +1 -1
  183. package/dist/client/assets/{mock-board-BFTY4RvG.js → mock-board-CSuz4opM.js} +1 -1
  184. package/dist/client/assets/{monaco-editor-D49CJi8U.js → monaco-editor-C1ThyHfg.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-BB3CDHWN.js → monitoring-stats-row-BLfBHvDR.js} +1 -1
  186. package/dist/client/assets/{multi-select-BvMK4932.js → multi-select-BGUKy-ie.js} +1 -1
  187. package/dist/client/assets/{mustache-HTehKKTG.js → mustache-BopKjK4y.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-DoLb5YVK.js → new-project-dialog--6a9GYsY.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-Blwmfj1R.js → oauth-callback-Dl9UbmC0.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-ai-provider-Dc9onjjw.js → oauth-callback-ai-provider-MlWlWjGr.js} +1 -1
  191. package/dist/client/assets/{onboarding-K-cgEcDl.js → onboarding-BvW7_lSm.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-R6WmtJ5r.js → openai-conversation-DV_TyXnN.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-Bmh9CacI.js → optimistic-project-sidebar-views-gZfWr2eJ.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-CZfhLaiW.js → order-monitor-day-tqxzccsD.js} +1 -1
  195. package/dist/client/assets/{organization-choice-dC-onaYV.js → organization-choice-qkiDWPrl.js} +1 -1
  196. package/dist/client/assets/{orgs-BOJwmOLw.js → orgs-Bsdk5WNb.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-CrsEBL3M.js → page-seo-form-C26iJCis.js} +1 -1
  198. package/dist/client/assets/{pair-CYYi6JKh.js → pair-BXKJ75t2.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-Okx-KzN5.js → plan-ladder-D42bnzq6.js} +1 -1
  200. package/dist/client/assets/{popover-gJO3R5Ii.js → popover-DZg3XzK_.js} +1 -1
  201. package/dist/client/assets/{post-calendar-BgDWtRgx.js → post-calendar-BtiCxjbq.js} +1 -1
  202. package/dist/client/assets/{post-editor-CxINLeRV.js → post-editor-CimCNunY.js} +1 -1
  203. package/dist/client/assets/{preview-content-Cfi8bwXI.js → preview-content-CxXRowEV.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-jZ9sRQON.js → preview-dialog-W6xlve7R.js} +1 -1
  205. package/dist/client/assets/{preview-panel-CN8PRsYc.js → preview-panel-Cy7WRuva.js} +1 -1
  206. package/dist/client/assets/{preview-tab-DRuTgCNI.js → preview-tab-Bo_MmH8N.js} +3 -3
  207. package/dist/client/assets/{product-picker-dialog-DB4JPBCA.js → product-picker-dialog-DRSW83x9.js} +1 -1
  208. package/dist/client/assets/{profile-DEiIcjHZ.js → profile-CtmE_8xo.js} +1 -1
  209. package/dist/client/assets/{project-app-view-Ml2wH3iy.js → project-app-view-8D3fxLxg.js} +1 -1
  210. package/dist/client/assets/{project-feed-CfssvHDQ.js → project-feed-B6d9Pblv.js} +1 -1
  211. package/dist/client/assets/{project-icon-BlJz5cOI.js → project-icon-Cd3AxOfl.js} +1 -1
  212. package/dist/client/assets/project-reports-DhGxN0x2.js +1 -0
  213. package/dist/client/assets/project-tasks-DppEghsL.js +1 -0
  214. package/dist/client/assets/{projects-Dzy3_FXd.js → projects-B8YVAgec.js} +1 -1
  215. package/dist/client/assets/{projects-empty-state-BDYeDrMv.js → projects-empty-state-BfkNTDjK.js} +1 -1
  216. package/dist/client/assets/{prompts-DV4Kjfa5.js → prompts-2NxN_gnO.js} +1 -1
  217. package/dist/client/assets/record-editor-DQiQEm3J.js +1 -0
  218. package/dist/client/assets/{redirect-editor-DFCv83sL.js → redirect-editor-S1rL9xd1.js} +1 -1
  219. package/dist/client/assets/{reports-DXYrq_BO.js → reports-BdiHuIUD.js} +1 -1
  220. package/dist/client/assets/reports-c39OWGSZ.js +1 -0
  221. package/dist/client/assets/{reports-onboarding-1VulbTO6.js → reports-onboarding-CzBiKyvA.js} +1 -1
  222. package/dist/client/assets/{reports-tab-DmNt_T04.js → reports-tab-fWUABT_U.js} +2 -2
  223. package/dist/client/assets/{repositories-D6jC23CW.js → repositories-1B0IcoSH.js} +1 -1
  224. package/dist/client/assets/repository-binding-CbZ7gDPF.js +1 -0
  225. package/dist/client/assets/{repository-import-picker-h-r8nnEf.js → repository-import-picker-CqejRBEV.js} +1 -1
  226. package/dist/client/assets/{repository-picker-FTAXO4Nx.js → repository-picker-lc5PVuph.js} +1 -1
  227. package/dist/client/assets/{require-capability-BewAou1A.js → require-capability-CLiKw7xi.js} +1 -1
  228. package/dist/client/assets/{required-auth-layout-gIZfj42y.js → required-auth-layout-obZ6miVT.js} +1 -1
  229. package/dist/client/assets/{reset-password-Bq09blPf.js → reset-password-C9jR1Ymc.js} +1 -1
  230. package/dist/client/assets/{resizable-CGzf0YCQ.js → resizable-MOzKpsY9.js} +1 -1
  231. package/dist/client/assets/{resolve-tab-icon-Daxo01Gi.js → resolve-tab-icon-DXtTUrAj.js} +1 -1
  232. package/dist/client/assets/{review-settings-DR_kj-Ru.js → review-settings-DrM5MUBI.js} +1 -1
  233. package/dist/client/assets/{roles-DWOkvlO_.js → roles-CHt9_vGR.js} +1 -1
  234. package/dist/client/assets/route-C2SFyXDw.js +1 -0
  235. package/dist/client/assets/{route-B-p6J_u6.js → route-Cd4e3z96.js} +1 -1
  236. package/dist/client/assets/route-q27BnTUy.js +1 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-rc29IhVV.js → sandbox-lifecycle-context-BlCv6a-P.js} +1 -1
  238. package/dist/client/assets/{schema-BGirdKR7.js → schema-B3PJAfvC.js} +1 -1
  239. package/dist/client/assets/{schema-DTvMW5Bj.js → schema-BpLx5lXs.js} +1 -1
  240. package/dist/client/assets/{scroll-area-D0jo1bkt.js → scroll-area-CioiKzlv.js} +1 -1
  241. package/dist/client/assets/{search-input-DIOUBltI.js → search-input-OMtFZb1f.js} +1 -1
  242. package/dist/client/assets/{search-toggle-BWyMsPKk.js → search-toggle-Rm9zqdhj.js} +1 -1
  243. package/dist/client/assets/{secret-ciphertext-ANOQlePB.js → secret-ciphertext-FPLrd6Sz.js} +1 -1
  244. package/dist/client/assets/{secret-picker--4BFyqbe.js → secret-picker-fddEeqOm.js} +1 -1
  245. package/dist/client/assets/{secrets-BxBi0DW0.js → secrets-loUpoyBS.js} +1 -1
  246. package/dist/client/assets/{sections-editor-cLAvYqLX.js → sections-editor-E9Z18ZDi.js} +2 -2
  247. package/dist/client/assets/{select-vip2MDSn.js → select-CMGxS2qh.js} +1 -1
  248. package/dist/client/assets/{select-model-Dqb1K6bc.js → select-model-CxhDhd-9.js} +1 -1
  249. package/dist/client/assets/{seo-editor-DDZSfwYW.js → seo-editor-D8MaiSNi.js} +1 -1
  250. package/dist/client/assets/{separator-BQ3AM4Ug.js → separator-BXc0zPSY.js} +1 -1
  251. package/dist/client/assets/settings-tab-Dou04qL_.js +4 -0
  252. package/dist/client/assets/{sheet-IYrYpc2B.js → sheet-BRHzkcNr.js} +1 -1
  253. package/dist/client/assets/{shell-layout-BM51_FIv.js → shell-layout-Dhz9Exq4.js} +1 -1
  254. package/dist/client/assets/site-editor-CN-mBnl3.js +1 -0
  255. package/dist/client/assets/{site-editor-toast-DbJhMk7V.js → site-editor-toast-7y5QejdX.js} +1 -1
  256. package/dist/client/assets/{skills-D2FiXzGW.js → skills-BYVm1yj9.js} +1 -1
  257. package/dist/client/assets/{slider-CwnL3HRa.js → slider-BA5URV4c.js} +1 -1
  258. package/dist/client/assets/{sortable.esm-BmwNKHYn.js → sortable.esm-BOb8_093.js} +1 -1
  259. package/dist/client/assets/{sso-DMQ-B__P.js → sso-BobuOVA-.js} +1 -1
  260. package/dist/client/assets/{suggestion-B_X9vnmO.js → suggestion-D_2yEjf4.js} +1 -1
  261. package/dist/client/assets/{switch-B9eCMptF.js → switch-DGEo5K4-.js} +1 -1
  262. package/dist/client/assets/{symbol-BnsdD8oy.js → symbol-CjppxhTH.js} +1 -1
  263. package/dist/client/assets/{synced-repos-VO9uiFX2.js → synced-repos-Dr5VcS9S.js} +1 -1
  264. package/dist/client/assets/{tab-icon-glyph-D53P8msf.js → tab-icon-glyph-DJxM1HMX.js} +1 -1
  265. package/dist/client/assets/{table-D9fzXIkZ.js → table-CM_armOG.js} +1 -1
  266. package/dist/client/assets/{tabs-BawejvDB.js → tabs-D7n9t3lM.js} +1 -1
  267. package/dist/client/assets/{task-board-ouLvp423.js → task-board-Cfny2jqU.js} +1 -1
  268. package/dist/client/assets/{task-route-CjHIKjev.js → task-route-C93dEljG.js} +1 -1
  269. package/dist/client/assets/{task-status-Buh7B1MG.js → task-status-Dc99s_5R.js} +1 -1
  270. package/dist/client/assets/taskboard-analytics-i6H3Rv1v.js +1 -0
  271. package/dist/client/assets/tasks-ByuTOhSz.js +1 -0
  272. package/dist/client/assets/{tasks-FmvKs9d3.js → tasks-Bz8Lz6cJ.js} +3 -3
  273. package/dist/client/assets/{textarea-B-TS083j.js → textarea-D-r53Xtx.js} +1 -1
  274. package/dist/client/assets/{thread-analytics-ykgOvgFb.js → thread-analytics-xhV1IkYL.js} +1 -1
  275. package/dist/client/assets/{thread-intent-S-gJClOG.js → thread-intent-b5vpifzT.js} +1 -1
  276. package/dist/client/assets/{thread-route-CQmCTEyn.js → thread-route-BJ_juaVR.js} +1 -1
  277. package/dist/client/assets/{thread-route-DtCL8-V4.js → thread-route-dlwv4_1A.js} +1 -1
  278. package/dist/client/assets/{thread-sheet-body-DacE2e8a.js → thread-sheet-body-BlfHDz0K.js} +1 -1
  279. package/dist/client/assets/{time-range-picker-BIBoZiWJ.js → time-range-picker-BbFeKJV8.js} +1 -1
  280. package/dist/client/assets/{toggle-group-DI4ttUmk.js → toggle-group-DHp1u7am.js} +1 -1
  281. package/dist/client/assets/{tool-namespace-DSuLhjHC.js → tool-namespace-BEzs43Ur.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-UylaJSAo.js → toolbar-icon-button-iqvhc0aD.js} +1 -1
  283. package/dist/client/assets/{tooltip-D3Lno7Sd.js → tooltip-OCAaNJPG.js} +1 -1
  284. package/dist/client/assets/{tooltipContext-BF4YYYQ4.js → tooltipContext-Di2WNqkv.js} +1 -1
  285. package/dist/client/assets/{track-9gnPqqM1.js → track-C14SKSTg.js} +1 -1
  286. package/dist/client/assets/{types-oDc7dHni.js → types-DSl6aKYl.js} +1 -1
  287. package/dist/client/assets/{url-slug-CzRjxv-k.js → url-slug-BDqmchWv.js} +1 -1
  288. package/dist/client/assets/{usage-stats-DadTD3M-.js → usage-stats-k4aXi0cR.js} +1 -1
  289. package/dist/client/assets/{use-ai-providers-AcvGe9-V.js → use-ai-providers-r5JMl3Dn.js} +1 -1
  290. package/dist/client/assets/{use-app-takeover-BEzFC8oO.js → use-app-takeover-C41Zrny9.js} +1 -1
  291. package/dist/client/assets/{use-automations-CN350YMB.js → use-automations-CAQWvaBW.js} +1 -1
  292. package/dist/client/assets/{use-autosave-Dav7fRBX.js → use-autosave-DVsGD-u4.js} +1 -1
  293. package/dist/client/assets/{use-chat-navigation-DlxbS2Ir.js → use-chat-navigation-B7jtkmO9.js} +1 -1
  294. package/dist/client/assets/{use-clock-tick-Biiz8lzy.js → use-clock-tick-CdAPP8z5.js} +1 -1
  295. package/dist/client/assets/{use-connect-companion-VKAyFcK2.js → use-connect-companion-XVE2U2A9.js} +1 -1
  296. package/dist/client/assets/{use-connection-OOD0tHd7.js → use-connection-Bc66r7WR.js} +1 -1
  297. package/dist/client/assets/{use-content-sync-BQvWp4_o.js → use-content-sync-Cur_tlcg.js} +1 -1
  298. package/dist/client/assets/{use-copy-Cn4Z57YH.js → use-copy-DIsWFSvt.js} +1 -1
  299. package/dist/client/assets/{use-create-virtual-mcp-CZW2rCq7.js → use-create-virtual-mcp-CC1Pm7Vq.js} +1 -1
  300. package/dist/client/assets/{use-date-fns-locale-ZV1qLyjT.js → use-date-fns-locale-BPUEmwqZ.js} +1 -1
  301. package/dist/client/assets/{use-debounced-autosave-DoWWmWzG.js → use-debounced-autosave-CitZx5FB.js} +1 -1
  302. package/dist/client/assets/{use-debounced-value-WEbEbeed.js → use-debounced-value-Cv1nzd8k.js} +1 -1
  303. package/dist/client/assets/{use-deco-credits-D1idFaA8.js → use-deco-credits-CbC5ZgVr.js} +1 -1
  304. package/dist/client/assets/{use-decopilot-events-BITSrHb-.js → use-decopilot-events-BGdkAbxA.js} +1 -1
  305. package/dist/client/assets/{use-delete-connection-KMdMK-5V.js → use-delete-connection-Cgcil9G0.js} +1 -1
  306. package/dist/client/assets/{use-deployment-admin-B_soKFRv.js → use-deployment-admin-Bq3PTYyd.js} +1 -1
  307. package/dist/client/assets/{use-ensure-project-folder-BUN6VVAV.js → use-ensure-project-folder-D4n7osah.js} +1 -1
  308. package/dist/client/assets/{use-fast-preview-draft-url-CSXqCUZ_.js → use-fast-preview-draft-url-C__pe5ue.js} +1 -1
  309. package/dist/client/assets/{use-file-configs-DMVCBG-z.js → use-file-configs-Da0V_POi.js} +1 -1
  310. package/dist/client/assets/{use-infinite-scroll-DjYaDj_j.js → use-infinite-scroll-qQBI_BkS.js} +1 -1
  311. package/dist/client/assets/{use-join-requests-Be-FCByX.js → use-join-requests-dO2c6Tc2.js} +1 -1
  312. package/dist/client/assets/{use-main-panel-tabs-Cloon3zW.js → use-main-panel-tabs-eu6gNvfS.js} +1 -1
  313. package/dist/client/assets/{use-mcp-auth-status-Bv4IbKQl.js → use-mcp-auth-status-DciS_iyB.js} +1 -1
  314. package/dist/client/assets/{use-mcp-client-fTyLcuiX.js → use-mcp-client-jKOlHdKM.js} +1 -1
  315. package/dist/client/assets/{use-mcp-prompts-CyqOUVUD.js → use-mcp-prompts-KLIBV_YA.js} +1 -1
  316. package/dist/client/assets/{use-mcp-tools-sv7pv5ex.js → use-mcp-tools-CWDoMes8.js} +1 -1
  317. package/dist/client/assets/{use-members-CvY21L2Q.js → use-members-DKFjOBdl.js} +1 -1
  318. package/dist/client/assets/{use-mobile-2T0aye5I.js → use-mobile-CmswU9_U.js} +1 -1
  319. package/dist/client/assets/{use-navigate-to-agent-BpeT4fqu.js → use-navigate-to-agent-DvsN-N9f.js} +1 -1
  320. package/dist/client/assets/{use-open-billing-url-Db0e3guK.js → use-open-billing-url-BGaG_eVz.js} +1 -1
  321. package/dist/client/assets/{use-org-auth-client-CWA2hWCM.js → use-org-auth-client-DyhHIXwn.js} +1 -1
  322. package/dist/client/assets/{use-org-fs-CPNJqv-N.js → use-org-fs-5rCZZYw5.js} +1 -1
  323. package/dist/client/assets/{use-org-repo-syncs-MWiNxGjz.js → use-org-repo-syncs-jpa15G0h.js} +1 -1
  324. package/dist/client/assets/{use-org-sso-BMLNRQyf.js → use-org-sso-meIc9b7s.js} +1 -1
  325. package/dist/client/assets/{use-organization-roles-DwFJmstu.js → use-organization-roles-1dxZeG9R.js} +1 -1
  326. package/dist/client/assets/{use-organization-settings-lug340cj.js → use-organization-settings-NMl9AK6V.js} +1 -1
  327. package/dist/client/assets/{use-panel-navigate-CfJ9Qf-l.js → use-panel-navigate-BhXVoQPa.js} +1 -1
  328. package/dist/client/assets/use-project-native-view-presence-DgH1oa2Q.js +1 -0
  329. package/dist/client/assets/{use-project-scope-C99MQSqi.js → use-project-scope-B3s9YTAH.js} +1 -1
  330. package/dist/client/assets/{use-recent-apps-BumxbfgY.js → use-recent-apps-B3eA701g.js} +1 -1
  331. package/dist/client/assets/{use-releases-CRk_-gGM.js → use-releases-B_Ivj-ji.js} +1 -1
  332. package/dist/client/assets/{use-reports-diagnostic-WXyHMxuT.js → use-reports-diagnostic-Dq1Yd1Vr.js} +1 -1
  333. package/dist/client/assets/{use-secrets-nvhTtgV_.js → use-secrets-Dg67dBxN.js} +1 -1
  334. package/dist/client/assets/{use-section-preview-base-BBIzI-Pc.js → use-section-preview-base-CYSL7sBu.js} +1 -1
  335. package/dist/client/assets/{use-tags-Dawb8nJP.js → use-tags-DRpey5ac.js} +1 -1
  336. package/dist/client/assets/{use-task-board-analytics-BaDTyaMf.js → use-task-board-analytics-CxHs3cah.js} +1 -1
  337. package/dist/client/assets/{use-task-board-events-viqZq2i-.js → use-task-board-events-CWFDTGYW.js} +1 -1
  338. package/dist/client/assets/{use-task-board-item-prs-BTOeRNoi.js → use-task-board-item-prs-D8bcpDjg.js} +1 -1
  339. package/dist/client/assets/{use-task-board-items-Dp3mGHSl.js → use-task-board-items-BbRfksII.js} +1 -1
  340. package/dist/client/assets/{use-task-metadata-Buvn0eAk.js → use-task-metadata-4c8a_mNH.js} +1 -1
  341. package/dist/client/assets/{use-thread-analytics-DOC2eb9z.js → use-thread-analytics-CMJl8EEf.js} +1 -1
  342. package/dist/client/assets/{use-thread-outputs-Bmumw8UE.js → use-thread-outputs-BOAz3j7m.js} +1 -1
  343. package/dist/client/assets/useInfiniteQuery-DOKZzanu.js +1 -0
  344. package/dist/client/assets/{useQueries-4Zja_Hbg.js → useQueries-BiefmIu_.js} +1 -1
  345. package/dist/client/assets/useSuspenseInfiniteQuery-gQb4-5BD.js +1 -0
  346. package/dist/client/assets/{users-Cbsspkn2.js → users-eo_ZMVx2.js} +1 -1
  347. package/dist/client/assets/{utils-zbsUBoHt.js → utils-DqXf9fJY.js} +1 -1
  348. package/dist/client/assets/{variant-calendar-BnIxTRkB.js → variant-calendar-1onPlYHl.js} +1 -1
  349. package/dist/client/assets/{variant-draft-pointer-DEL-ZLWj.js → variant-draft-pointer-OJYw4Y1_.js} +1 -1
  350. package/dist/client/assets/{view-mode-toggle-CGu3ANob.js → view-mode-toggle-ImzlJONT.js} +1 -1
  351. package/dist/client/assets/{virtual-mcp-DQFtuDZf.js → virtual-mcp-BX0PkQ6l.js} +1 -1
  352. package/dist/client/assets/{watch-sse-pool-C7fmCtIy.js → watch-sse-pool-CEcxThGW.js} +1 -1
  353. package/dist/client/index.html +1 -1
  354. package/dist/server/server.js +3 -3
  355. package/package.json +1 -1
  356. package/dist/client/assets/agent-app-BMA5upH5.js +0 -1
  357. package/dist/client/assets/agent-deck-BJf1WFap.js +0 -1
  358. package/dist/client/assets/agent-library-BqFtXY1m.js +0 -1
  359. package/dist/client/assets/agent-library-file-CQDlY3Yr.js +0 -1
  360. package/dist/client/assets/agent-settings-DeB5MuX_.js +0 -1
  361. package/dist/client/assets/agent-site-editor-code-Dq4KRDBk.js +0 -2
  362. package/dist/client/assets/agent-site-editor-content-Blm2auu-.js +0 -1
  363. package/dist/client/assets/agent-site-editor-preview-CCk80iIG.js +0 -1
  364. package/dist/client/assets/agent-view-Cl8uWNJN.js +0 -1
  365. package/dist/client/assets/api-keys-DSwUfsL4.js +0 -1
  366. package/dist/client/assets/cms-settings-editor-Dxh-Mvqb.js +0 -1
  367. package/dist/client/assets/flat-project-fhJMf2Fo.js +0 -1
  368. package/dist/client/assets/index-BmYzltjg.js +0 -1
  369. package/dist/client/assets/input-h8042dl0.js +0 -1
  370. package/dist/client/assets/legacy-agents-deep-jcGaNAHc.js +0 -1
  371. package/dist/client/assets/library-DntM1dnS.js +0 -1
  372. package/dist/client/assets/project-reports-CsI0AQuY.js +0 -1
  373. package/dist/client/assets/project-tasks-DLi14b92.js +0 -1
  374. package/dist/client/assets/record-editor-wOnCkFPK.js +0 -1
  375. package/dist/client/assets/reports-AMpsYdUr.js +0 -1
  376. package/dist/client/assets/repository-binding-BnejFX7t.js +0 -1
  377. package/dist/client/assets/route-G0-ZvPpf.js +0 -1
  378. package/dist/client/assets/route-UiPRedfp.js +0 -1
  379. package/dist/client/assets/settings-tab-eia9Fz-X.js +0 -4
  380. package/dist/client/assets/site-editor-C5iX5zAy.js +0 -1
  381. package/dist/client/assets/taskboard-analytics-DhwjY7M5.js +0 -1
  382. package/dist/client/assets/tasks-Ds4uIhX_.js +0 -1
  383. package/dist/client/assets/use-project-native-view-presence-DdsfKci4.js +0 -1
  384. package/dist/client/assets/useInfiniteQuery-CQY9cAw7.js +0 -1
  385. package/dist/client/assets/useSuspenseInfiniteQuery-XqqzZbmr.js +0 -1
@@ -1,4 +1,4 @@
1
- import{az as Yt,c as Z,b as ee,r as w,j as t,B,ah as Zt,l as Pt,a2 as $t,D as et,q as tt,s as st,v as ot,aM as at,w as nt,t as X,b1 as es,X as ts,T as ss,V as os,as,aq as ns,ar as is,U as Oe,aW as rs,h as Le,y as Ke,aE as ls,b9 as pt,I as xt,ba as cs,al as ds,a_ as Ye,n as Xe,f as ms}from"./index-TD9q6ZAx.js";import{C as us}from"./index-BmYzltjg.js";import{b as it,O as fs,a as ps,a4 as xs,h as gt,aw as gs,V as ht,ax as hs,f as js,N as Me,ay as zt}from"./agent-icon-Blcoi2NV.js";import{n as jt}from"./ShoppingBag01-CQIeNQm_.js";import{t as rt}from"./ChevronUp-D4PiHnN0.js";import{e as ys}from"./UserSquare-DL7MdeuL.js";import{e as lt,b as Et,t as Ot}from"./Tool01-BRVvW2LV.js";import{a as bs}from"./Image01-CyRCJwXT.js";import{i as vs}from"./SearchMd-BQTuqO8x.js";import{B as Kt}from"./badge-Qzxf6tet.js";import{C as Ft}from"./checkbox-C0-Eo7G1.js";import{S as ct}from"./switch-B9eCMptF.js";import{a as Mt,b as Rt,P as Lt}from"./popover-gJO3R5Ii.js";import{C as Cs,a as yt,b as Ns,d as Ss,e as ks,c as Ts}from"./command-BAgcQ2fh.js";import{g as ws,s as Ds}from"./tool-namespace-DSuLhjHC.js";import{u as dt}from"./use-connection-OOD0tHd7.js";import{u as _s}from"./use-mcp-client-fTyLcuiX.js";import{u as Is}from"./use-mcp-tools-sv7pv5ex.js";import{I as As}from"./integration-icon-DJtlg_0w.js";import{M as Ps}from"./select-model-Dqb1K6bc.js";import{u as $s}from"./use-ai-providers-AcvGe9-V.js";import{U as zs,b as Es}from"./build-improve-prompt-doc-1VLAf1m8.js";import{a as ve,c as Os,d as Ks}from"./use-automations-CN350YMB.js";import{c as Fs,b as Ms,h as Rs,t as Ls}from"./chat-context-Ch-VpD9W.js";import{b as Vs,C as Us,a as Ws}from"./collapsible-EpmgpNpi.js";import{c as Bs,T as Gs,a as Hs}from"./tooltip-D3Lno7Sd.js";import{a as Js}from"./shell-layout-BM51_FIv.js";import{i as Vt}from"./ArrowLeft-C_qdjo3L.js";import{i as Xs}from"./ArrowUp-B_lKPC5O.js";import{s as qs}from"./Trash01-Bt3rK1ka.js";import{s as mt}from"./XClose-UWi3HSZE.js";import{u as bt}from"./use-debounced-autosave-DoWWmWzG.js";import{T as Qs,a as Ys}from"./input-h8042dl0.js";import{u as Zs,a as eo,J as Ut}from"./jira-icon-D0XL00z9.js";import{s as to}from"./Plus-DtZhz_pb.js";import{i as ut}from"./ZoomOut-B4Rw_R2z.js";import{l as We,H as so}from"./config-BDu66MgM.js";import{C as oo}from"./task-board-ouLvp423.js";import{M as Wt}from"./multi-select-BvMK4932.js";import{S as ge,b as he,a as je,d as ye,c as be}from"./select-vip2MDSn.js";import{b as ao,a as no,T as vt}from"./tabs-BawejvDB.js";import{a as qe}from"./Copy01-DJEr7OLy.js";import{MonacoCodeEditor as io}from"./monaco-editor-D49CJi8U.js";import{A as Ct,a as Nt,b as St,c as kt,g as Tt,d as wt,e as Dt,f as _t}from"./alert-dialog-qlQC4zlU.js";import{A as ro}from"./automation-runs-dUM-MaiP.js";import{C as lo}from"./collection-tabs-iTmpvLeT.js";import{a as co}from"./use-panel-navigate-CfJ9Qf-l.js";import"./use-mobile-2T0aye5I.js";import"./use-app-takeover-BEzFC8oO.js";import"./sheet-IYrYpc2B.js";import"./use-project-native-view-presence-DdsfKci4.js";import"./thread-route-DtCL8-V4.js";import"./thread-intent-S-gJClOG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C7fmCtIy.js";import"./slugify-CEUa2lfQ.js";import"./use-file-configs-DMVCBG-z.js";import"./use-organization-settings-lug340cj.js";import"./schema-DTvMW5Bj.js";import"./repository-binding-BnejFX7t.js";import"./site-slug-DebpOoQq.js";import"./toolbar-icon-button-UylaJSAo.js";import"./resizable-CGzf0YCQ.js";import"./icon-button-DxqkkLQj.js";import"./use-project-scope-C99MQSqi.js";import"./AlertCircle-DZq02EzT.js";import"./LinkBroken01-BU-4AKfc.js";import"./Building02-LYkR_QXB.js";import"./CheckCircle-B9QHilAa.js";import"./ChevronSelectorVertical-0ysVIDar.js";import"./CreditCard01-b36fqa11.js";import"./DotsVertical-CV1b1y4C.js";import"./Globe04-DKUCyty7.js";import"./SwitchHorizontal01-DGImzN1R.js";import"./Key01-DWXRgH6w.js";import"./Link01-CNb9DW_9.js";import"./Monitor01-yE6iFgVP.js";import"./Sun-kLYmwsq0.js";import"./Play-ChRMrCTB.js";import"./Upload01-s7SnRMvp.js";import"./User01-BmCbB_zb.js";import"./Users01-BVggEmV6.js";import"./index-C-gf76Hu.js";import"./auth-CLglKqB6.js";import"./drawer-CixpU7n-.js";import"./index-BF64aC--.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-B8cS3VPt.js";import"./autosend-CE_yiNtR.js";import"./use-decopilot-events-BITSrHb-.js";import"./use-chat-navigation-DlxbS2Ir.js";import"./location-BjlyegC2.js";import"./index-B26ImUL7.js";import"./use-clock-tick-Biiz8lzy.js";import"./project-icon-BlJz5cOI.js";import"./new-project-dialog-DoLb5YVK.js";import"./label-B-SEr3Fs.js";import"./repository-import-picker-h-r8nnEf.js";import"./use-navigate-to-agent-BpeT4fqu.js";import"./repository-picker-FTAXO4Nx.js";import"./useInfiniteQuery-CQY9cAw7.js";import"./infiniteQueryObserver-X8qh_Va6.js";import"./collection-search-ehqGBK_4.js";import"./use-debounced-value-WEbEbeed.js";import"./required-auth-layout-gIZfj42y.js";import"./use-org-sso-BMLNRQyf.js";import"./suggestion-B_X9vnmO.js";import"./usage-stats-DadTD3M-.js";import"./form-BivWj0r6.js";import"./utils-CVEq3hMx.js";import"./markdown-B-jDeUMA.js";import"./use-copy-Cn4Z57YH.js";import"./format-time-CAj8AQXM.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-prompts-CyqOUVUD.js";import"./use-org-fs-CPNJqv-N.js";import"./core.esm-C7s0VVJH.js";import"./index-BdQq_4o_.js";import"./editor-BKRP2Iwc.js";import"./table-D9fzXIkZ.js";import"./empty-state-BZZcWHI_.js";import"./use-infinite-scroll-DjYaDj_j.js";import"./use-members-CvY21L2Q.js";import"./use-org-auth-client-CWA2hWCM.js";import"./task-status-Buh7B1MG.js";import"./thread-sheet-body-DacE2e8a.js";import"./useSuspenseInfiniteQuery-XqqzZbmr.js";import"./pair-CYYi6JKh.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Bk4hyaxU.js";import"./types-oDc7dHni.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-thread-outputs-Bmumw8UE.js";import"./file-type-icon-C2JXE2hG.js";const Qe={fast:{labelKey:"automations.automationConfig.tierFast",subtitleKey:"automations.automationConfig.tierFastSubtitle",icon:js},smart:{labelKey:"automations.automationConfig.tierSmart",subtitleKey:"automations.automationConfig.tierSmartSubtitle",icon:Ot},thinking:{labelKey:"automations.automationConfig.tierThinking",subtitleKey:"automations.automationConfig.tierThinkingSubtitle",icon:hs}},mo=["fast","smart","thinking"];function uo(r){const e=Z.c(19),{tier:s,onSelect:n}=r,a=ee(),[i,c]=w.useState(!1),o=Qe[s].icon;let j;e[0]!==o?(j=t.jsx(o,{size:14,className:"text-muted-foreground"}),e[0]=o,e[1]=j):j=e[1];const d=Qe[s];let m;e[2]!==a||e[3]!==d.labelKey?(m=a(d.labelKey),e[2]=a,e[3]=d.labelKey,e[4]=m):m=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14,className:"text-muted-foreground"}),e[5]=x):x=e[5];let f;e[6]!==j||e[7]!==m?(f=t.jsx(Mt,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[j,m,x]})}),e[6]=j,e[7]=m,e[8]=f):f=e[8];let g;e[9]!==n||e[10]!==a||e[11]!==s?(g=mo.map(p=>{const l=Qe[p],y=l.icon;return t.jsxs("button",{type:"button",onClick:()=>{n(p),c(!1)},className:Pt("flex items-start gap-2 px-2 py-1.5 rounded-lg text-left hover:bg-muted"),children:[t.jsx(y,{size:16,className:"shrink-0 text-muted-foreground mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"text-sm",children:a(l.labelKey)}),t.jsx("div",{className:"text-xs text-muted-foreground",children:a(l.subtitleKey)})]}),p===s&&t.jsx(Zt,{size:14,className:"text-foreground mt-0.5"})]},p)}),e[9]=n,e[10]=a,e[11]=s,e[12]=g):g=e[12];let u;e[13]!==g?(u=t.jsx(Rt,{align:"start",className:"p-1 w-64",children:t.jsx("div",{className:"flex flex-col",children:g})}),e[13]=g,e[14]=u):u=e[14];let h;return e[15]!==i||e[16]!==f||e[17]!==u?(h=t.jsxs(Lt,{open:i,onOpenChange:c,children:[f,u]}),e[15]=i,e[16]=f,e[17]=u,e[18]=h):h=e[18],h}function fo(r){const e=Z.c(27),{tier:s,onTierChange:n,override:a,onOverrideChange:i}=r,c=ee(),[o,j]=w.useState(a!==null);let d;e[0]!==c?(d=c("automations.automationConfig.modelLabel"),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==d?(m=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:d}),e[2]=d,e[3]=m):m=e[3];let x;e[4]!==i||e[5]!==n||e[6]!==a||e[7]!==c||e[8]!==s||e[9]!==o?(x=o?t.jsx(w.Suspense,{fallback:t.jsx(B,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:c("automations.automationConfig.loadingModels")}),children:t.jsx(po,{override:a,onOverrideChange:i})}):t.jsx(uo,{tier:s,onSelect:n}),e[4]=i,e[5]=n,e[6]=a,e[7]=c,e[8]=s,e[9]=o,e[10]=x):x=e[10];let f;e[11]!==i?(f=y=>{j(y),y||i(null)},e[11]=i,e[12]=f):f=e[12];let g;e[13]!==f||e[14]!==o?(g=t.jsx(ct,{checked:o,onCheckedChange:f,className:"cursor-pointer"}),e[13]=f,e[14]=o,e[15]=g):g=e[15];let u;e[16]!==c?(u=c("automations.automationConfig.specificModel"),e[16]=c,e[17]=u):u=e[17];let h;e[18]!==g||e[19]!==u?(h=t.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none",children:[g,u]}),e[18]=g,e[19]=u,e[20]=h):h=e[20];let p;e[21]!==x||e[22]!==h?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[x,h]}),e[21]=x,e[22]=h,e[23]=p):p=e[23];let l;return e[24]!==m||e[25]!==p?(l=t.jsxs("div",{className:"flex flex-col gap-2",children:[m,p]}),e[24]=m,e[25]=p,e[26]=l):l=e[26],l}function po(r){const e=Z.c(25),{override:s,onOverrideChange:n}=r,a=ee(),i=$s(),c=i[0]?.id??null;let o;e[0]!==c||e[1]!==i||e[2]!==s?.credentialId?(o=i.some(l=>l.id===s?.credentialId)?s?.credentialId??null:c,e[0]=c,e[1]=i,e[2]=s?.credentialId,e[3]=o):o=e[3];const[j,d]=w.useState(o);let m;e[4]!==j||e[5]!==c||e[6]!==i?(m=i.some(l=>l.id===j)?j:c,e[4]=j,e[5]=c,e[6]=i,e[7]=m):m=e[7];const x=m;let f;e[8]!==i||e[9]!==s?(f=s&&i.some(l=>l.id===s.credentialId)?{modelId:s.modelId,title:s.title||s.modelId,keyId:s.credentialId,providerId:"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[8]=i,e[9]=s,e[10]=f):f=e[10];const g=f;if(i.length===0){let l;e[11]!==a?(l=a("automations.automationConfig.connectAiProviderHint"),e[11]=a,e[12]=l):l=e[12];let y;return e[13]!==l?(y=t.jsx("span",{className:"text-xs text-muted-foreground italic",children:l}),e[13]=l,e[14]=y):y=e[14],y}let u;e[15]!==a?(u=a("automations.automationConfig.pickModelPlaceholder"),e[15]=a,e[16]=u):u=e[16];let h;e[17]!==x||e[18]!==n?(h=l=>{const y=l.keyId??x??"";d(y),n({modelId:l.modelId,credentialId:y,title:l.title??l.modelId})},e[17]=x,e[18]=n,e[19]=h):h=e[19];let p;return e[20]!==x||e[21]!==g||e[22]!==u||e[23]!==h?(p=t.jsx("div",{className:"w-fit max-w-full",children:t.jsx(Ps,{variant:"bordered",placeholder:u,model:g,credentialId:x,onCredentialChange:d,onModelChange:h})}),e[20]=x,e[21]=g,e[22]=u,e[23]=h,e[24]=p):p=e[24],p}const Bt=[{key:"capabilities",headingKey:"automations.automationConfig.builtinCapabilities",icon:lt,tools:[{name:"web_search",titleKey:"automations.automationConfig.toolWebSearch",descriptionKey:"automations.automationConfig.toolWebSearchDesc",icon:it},{name:"generate_image",titleKey:"automations.automationConfig.toolGenerateImage",descriptionKey:"automations.automationConfig.toolGenerateImageDesc",icon:bs},{name:"subtask",titleKey:"automations.automationConfig.toolSubtask",descriptionKey:"automations.automationConfig.toolSubtaskDesc",icon:Yt},{name:"user_ask",titleKey:"automations.automationConfig.toolAskUser",descriptionKey:"automations.automationConfig.toolAskUserDesc",icon:fs}]},{key:"files",headingKey:"automations.automationConfig.filesCode",icon:gt,tools:[{name:"read",titleKey:"automations.automationConfig.toolReadFile",descriptionKey:"automations.automationConfig.toolReadFileDesc",icon:ps},{name:"write",titleKey:"automations.automationConfig.toolWriteFile",descriptionKey:"automations.automationConfig.toolWriteFileDesc",icon:Et},{name:"edit",titleKey:"automations.automationConfig.toolEditFile",descriptionKey:"automations.automationConfig.toolEditFileDesc",icon:xs},{name:"grep",titleKey:"automations.automationConfig.toolSearchContent",descriptionKey:"automations.automationConfig.toolSearchContentDesc",icon:vs},{name:"glob",titleKey:"automations.automationConfig.toolFindFiles",descriptionKey:"automations.automationConfig.toolFindFilesDesc",icon:gt},{name:"bash",titleKey:"automations.automationConfig.toolRunCommand",descriptionKey:"automations.automationConfig.toolRunCommandDesc",icon:gs}]},{key:"context",headingKey:"automations.automationConfig.context",icon:ht,tools:[{name:"read_resource",titleKey:"automations.automationConfig.toolReadResource",descriptionKey:"automations.automationConfig.toolReadResourceDesc",icon:ht},{name:"read_prompt",titleKey:"automations.automationConfig.toolReadPrompt",descriptionKey:"automations.automationConfig.toolReadPromptDesc",icon:jt},{name:"skill",titleKey:"automations.automationConfig.toolLoadSkill",descriptionKey:"automations.automationConfig.toolLoadSkillDesc",icon:jt}]}],xo=Bt.flatMap(r=>r.tools.map(e=>e.name));function go(r){const e=r.replace(/[_-]+/g," ").trim();return e?e.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()):r}function ho(r){const e=Z.c(12),{agentId:s,value:n,onChange:a}=r,i=ee();let c;e[0]!==i?(c=i("automations.automationConfig.toolsLabel"),e[0]=i,e[1]=c):c=e[1];let o;e[2]!==c?(o=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:c}),e[2]=c,e[3]=o):o=e[3];let j;e[4]!==s||e[5]!==a||e[6]!==i||e[7]!==n?(j=s?t.jsx(w.Suspense,{fallback:t.jsxs(B,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:[t.jsx(lt,{size:14}),i("automations.automationConfig.loadingTools")]}),children:t.jsx(jo,{agentId:s,value:n,onChange:a})}):t.jsx("span",{className:"text-xs text-muted-foreground italic",children:i("automations.automationConfig.pickAgentFirst")}),e[4]=s,e[5]=a,e[6]=i,e[7]=n,e[8]=j):j=e[8];let d;return e[9]!==o||e[10]!==j?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[o,j]}),e[9]=o,e[10]=j,e[11]=d):d=e[11],d}function It(r){const e=Z.c(17),{value:s,checked:n,onToggle:a,title:i,description:c,leading:o}=r;let j;e[0]!==n?(j=t.jsx(Ft,{checked:n,className:"pointer-events-none mt-0.5"}),e[0]=n,e[1]=j):j=e[1];let d;e[2]!==o?(d=o&&t.jsx("span",{className:"mt-px shrink-0",children:o}),e[2]=o,e[3]=d):d=e[3];let m;e[4]!==i?(m=t.jsx("span",{className:"truncate text-sm leading-tight",children:i}),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==c?(x=c&&t.jsx("span",{className:"line-clamp-2 text-xs leading-snug text-muted-foreground",children:c}),e[6]=c,e[7]=x):x=e[7];let f;e[8]!==m||e[9]!==x?(f=t.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[m,x]}),e[8]=m,e[9]=x,e[10]=f):f=e[10];let g;return e[11]!==a||e[12]!==j||e[13]!==d||e[14]!==f||e[15]!==s?(g=t.jsxs(Ns,{value:s,onSelect:a,className:"items-start gap-2.5 py-2",children:[j,d,f]}),e[11]=a,e[12]=j,e[13]=d,e[14]=f,e[15]=s,e[16]=g):g=e[16],g}function At(r){const e=Z.c(27),{conn:s,label:n,icon:a,on:i,total:c,onToggle:o}=r,j=ee(),d=i===c;let m;e[0]!==a||e[1]!==s?(m=s?t.jsx(As,{icon:s.icon,name:s.title,size:"2xs"}):a?t.jsx(a,{size:14,className:"text-muted-foreground"}):t.jsx(ys,{size:14,className:"text-muted-foreground"}),e[0]=a,e[1]=s,e[2]=m):m=e[2];let x;e[3]!==s?.title||e[4]!==n||e[5]!==j?(x=s?.title??n??j("automations.automationConfig.otherTools"),e[3]=s?.title,e[4]=n,e[5]=j,e[6]=x):x=e[6];let f;e[7]!==x?(f=t.jsx("span",{className:"truncate",children:x}),e[7]=x,e[8]=f):f=e[8];let g;e[9]!==i||e[10]!==c?(g=t.jsxs("span",{className:"text-[11px] font-normal tabular-nums text-muted-foreground/70",children:[i,"/",c]}),e[9]=i,e[10]=c,e[11]=g):g=e[11];let u;e[12]!==o?(u=v=>{v.stopPropagation(),o()},e[12]=o,e[13]=u):u=e[13];let h;e[14]!==d||e[15]!==j?(h=j(d?"automations.automationConfig.none":"automations.automationConfig.all"),e[14]=d,e[15]=j,e[16]=h):h=e[16];let p;e[17]!==u||e[18]!==h?(p=t.jsx("button",{type:"button",onClick:u,className:"text-[11px] font-medium text-primary hover:underline",children:h}),e[17]=u,e[18]=h,e[19]=p):p=e[19];let l;e[20]!==g||e[21]!==p?(l=t.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[g,p]}),e[20]=g,e[21]=p,e[22]=l):l=e[22];let y;return e[23]!==m||e[24]!==f||e[25]!==l?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[m,f,l]}),e[23]=m,e[24]=f,e[25]=l,e[26]=y):y=e[26],y}function jo(r){const e=Z.c(83),{agentId:s,value:n,onChange:a}=r,i=ee(),{org:c}=$t(),[o,j]=w.useState(!1);let d;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(d={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=d):d=e[3];const m=_s(d);let x;e[4]!==m?(x={client:m},e[4]=m,e[5]=x):x=e[5];const{data:f,isLoading:g}=Is(x),u=dt();let h,p,l,y,v,N,S,b,T,D,_,k,A;if(e[6]!==u||e[7]!==f?.tools||e[8]!==g||e[9]!==a||e[10]!==o||e[11]!==i||e[12]!==n){const q=new Map(u.map(No)),H=new Map;for(const I of f?.tools??[]){const E=ws(I._meta)??"__other__",Y=Ds(I.name,E==="__other__"?void 0:E),P=I.title,xe=P&&P!==I.name?P:go(Y);H.has(E)||H.set(E,{clientId:E,conn:q.get(E),tools:[]}),H.get(E).tools.push({name:I.name,display:xe,description:I.description})}const W=[...H.values()].sort(Co),G=(f?.tools??[]).map(vo),J=[...xo,...G],V=n===null?new Set(J):new Set(n),U=J.every(I=>V.has(I)),z=I=>a(J.every(E=>I.has(E))?null:[...I]),ae=I=>{const E=new Set(V);E.has(I)?E.delete(I):E.add(I),z(E)},ne=(I,E)=>{const Y=new Set(V);for(const P of I)E?Y.add(P):Y.delete(P);z(Y)};y=Lt,A=o,v=j;let Q;e[26]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(lt,{size:14,className:"text-muted-foreground"}),e[26]=Q):Q=e[26];let ie;e[27]!==U||e[28]!==i?(ie=i(U?"automations.automationConfig.allTools":"automations.automationConfig.tools"),e[27]=U,e[28]=i,e[29]=ie):ie=e[29];const ue=!U&&t.jsxs(Kt,{variant:"secondary",className:"ml-0.5 h-5 px-1.5 text-[11px] tabular-nums",children:[V.size,"/",J.length]});let me;e[30]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(rt,{size:14,className:"text-muted-foreground"}),e[30]=me):me=e[30],e[31]!==ie||e[32]!==ue?(N=t.jsx(Mt,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[Q,ie,ue,me]})}),e[31]=ie,e[32]=ue,e[33]=N):N=e[33],l=Rt,_="p-0 w-80",k="start",p=Ss;let te;e[34]!==i?(te=i("automations.automationConfig.searchToolsPlaceholder"),e[34]=i,e[35]=te):te=e[35],e[36]!==te?(T=t.jsx(ks,{placeholder:te}),e[36]=te,e[37]=T):T=e[37];const fe=U?i("automations.automationConfig.allToolsEnabled",{count:J.length}):i("automations.automationConfig.toolsEnabledCount",{enabled:V.size,total:J.length});let se;e[38]!==fe?(se=t.jsx("span",{className:"text-xs text-muted-foreground",children:fe}),e[38]=fe,e[39]=se):se=e[39];let re;e[40]!==a?(re=()=>a(null),e[40]=a,e[41]=re):re=e[41];let le;e[42]!==i?(le=i("automations.automationConfig.selectAll"),e[42]=i,e[43]=le):le=e[43];let C;e[44]!==U||e[45]!==re||e[46]!==le?(C=t.jsx("button",{type:"button",onClick:re,disabled:U,className:"text-xs font-medium text-primary hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:le}),e[44]=U,e[45]=re,e[46]=le,e[47]=C):C=e[47];let M;e[48]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[48]=M):M=e[48];let O;e[49]!==a?(O=()=>a([]),e[49]=a,e[50]=O):O=e[50];const pe=V.size===0;let oe;e[51]!==i?(oe=i("automations.automationConfig.clear"),e[51]=i,e[52]=oe):oe=e[52];let ce;e[53]!==O||e[54]!==pe||e[55]!==oe?(ce=t.jsx("button",{type:"button",onClick:O,disabled:pe,className:"text-xs font-medium text-muted-foreground hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:oe}),e[53]=O,e[54]=pe,e[55]=oe,e[56]=ce):ce=e[56];let de;e[57]!==C||e[58]!==ce?(de=t.jsxs("div",{className:"flex items-center gap-2",children:[C,M,ce]}),e[57]=C,e[58]=ce,e[59]=de):de=e[59],e[60]!==se||e[61]!==de?(D=t.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[se,de]}),e[60]=se,e[61]=de,e[62]=D):D=e[62],h=Ts,S="max-h-80",b=g?t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("automations.automationConfig.loadingTools")}):t.jsxs(t.Fragment,{children:[t.jsx(Cs,{children:i("automations.automationConfig.noToolsFound")}),Bt.map(I=>{const E=I.tools.map(bo),Y=E.filter(P=>V.has(P)).length;return t.jsx(yt,{heading:t.jsx(At,{label:i(I.headingKey),icon:I.icon,on:Y,total:E.length,onToggle:()=>ne(E,Y!==E.length)}),children:I.tools.map(P=>t.jsx(It,{value:`${i(P.titleKey)} ${P.name}`,checked:V.has(P.name),onToggle:()=>ae(P.name),title:i(P.titleKey),description:i(P.descriptionKey),leading:t.jsx(P.icon,{size:16,className:"text-muted-foreground"})},P.name))},I.key)}),W.map(I=>{const E=I.tools.map(yo),Y=E.filter(P=>V.has(P)).length;return t.jsx(yt,{heading:t.jsx(At,{conn:I.conn,on:Y,total:E.length,onToggle:()=>ne(E,Y!==E.length)}),children:I.tools.map(P=>t.jsx(It,{value:`${P.display} ${P.name} ${I.conn?.title??""}`,checked:V.has(P.name),onToggle:()=>ae(P.name),title:P.display,description:P.description},P.name))},I.clientId)})]}),e[6]=u,e[7]=f?.tools,e[8]=g,e[9]=a,e[10]=o,e[11]=i,e[12]=n,e[13]=h,e[14]=p,e[15]=l,e[16]=y,e[17]=v,e[18]=N,e[19]=S,e[20]=b,e[21]=T,e[22]=D,e[23]=_,e[24]=k,e[25]=A}else h=e[13],p=e[14],l=e[15],y=e[16],v=e[17],N=e[18],S=e[19],b=e[20],T=e[21],D=e[22],_=e[23],k=e[24],A=e[25];let $;e[63]!==h||e[64]!==S||e[65]!==b?($=t.jsx(h,{className:S,children:b}),e[63]=h,e[64]=S,e[65]=b,e[66]=$):$=e[66];let R;e[67]!==p||e[68]!==$||e[69]!==T||e[70]!==D?(R=t.jsxs(p,{children:[T,D,$]}),e[67]=p,e[68]=$,e[69]=T,e[70]=D,e[71]=R):R=e[71];let K;e[72]!==l||e[73]!==R||e[74]!==_||e[75]!==k?(K=t.jsx(l,{className:_,align:k,children:R}),e[72]=l,e[73]=R,e[74]=_,e[75]=k,e[76]=K):K=e[76];let F;return e[77]!==y||e[78]!==v||e[79]!==N||e[80]!==K||e[81]!==A?(F=t.jsxs(y,{open:A,onOpenChange:v,children:[N,K]}),e[77]=y,e[78]=v,e[79]=N,e[80]=K,e[81]=A,e[82]=F):F=e[82],F}function yo(r){return r.name}function bo(r){return r.name}function vo(r){return r.name}function Co(r,e){return(r.conn?.title??r.clientId).localeCompare(e.conn?.title??e.clientId)}function No(r){return[r.id,r]}function Re(r){const e=r.trim().split(/\s+/);return e.length!==5?!1:e.every(s=>/^[\d*/,-]+$/.test(s))}function So(r){if(!r)return"Unknown schedule";const e=r.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return`Every ${s[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const a=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(a){const o=parseInt(a[1]??"1");return o%7===0?`Every ${o/7} weeks`:`Every ${o} days`}const i=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(i){const o=(i[2]??"0").padStart(2,"0"),j=(i[1]??"0").padStart(2,"0");return`Every day at ${o}:${j} UTC`}const c=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(c){const j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(c[3]??"0")]??"day",d=(c[2]??"0").padStart(2,"0"),m=(c[1]??"0").padStart(2,"0");return`Every ${j} at ${d}:${m} UTC`}return r}function ko(r,e){const s=Math.max(1,r);switch(e){case"minutes":return s===1?"* * * * *":`*/${s} * * * *`;case"hours":return s===1?"0 * * * *":`0 */${s} * * *`;case"days":return s===1?"0 0 * * *":`0 0 */${s} * *`;case"weeks":return s===1?"0 0 * * 1":`0 0 */${s*7} * *`}}function To(r){const e=r.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return{count:parseInt(s[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const a=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);return a?{count:parseInt(a[1]),unit:"days"}:null}function wo(r,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[r]??r:r}const Do=[{label:"5 minutes",cron:"*/5 * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}],Ze=oo.filter(r=>!so.includes(r)),Gt=["any","earlier","later","statuses"],_o=r=>Ze.some(e=>e===r),Io=r=>Gt.some(e=>e===r);function Ao({automationId:r,open:e,onOpenChange:s}){const n=ee(),{triggerAdd:a}=ve(),[i,c]=w.useState("in_progress"),[o,j]=w.useState("any"),[d,m]=w.useState([]),x=Ze.filter(l=>l!==i),f=d.filter(l=>l!==i),g=o!=="statuses"||f.length>0,u=l=>{l||(c("in_progress"),j("any"),m([])),s(l)},h=async()=>{try{await a.mutateAsync({automation_id:r,type:"board_column_transition",column_key:i,from:o==="statuses"?{kind:o,statuses:f}:{kind:o}}),X.success(n("automations.addStarterPopover.starterAdded")),u(!1)}catch(l){X.error(l instanceof Error?l.message:n("automations.addStarterPopover.failedAddStarter"))}},p=l=>n(l==="any"?"automations.columnTransitionDialog.fromAny":l==="earlier"?"automations.columnTransitionDialog.fromEarlier":l==="later"?"automations.columnTransitionDialog.fromLater":"automations.columnTransitionDialog.fromColumns");return t.jsx(et,{open:e,onOpenChange:u,children:t.jsxs(tt,{className:"max-w-md",children:[t.jsxs(st,{children:[t.jsx(ot,{children:n("automations.columnTransitionDialog.title")}),t.jsx(at,{children:n("automations.columnTransitionDialog.description")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n("automations.columnTransitionDialog.column")}),t.jsxs(ge,{value:i,onValueChange:l=>{_o(l)&&c(l)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Ze.map(l=>{const{label:y,visual:v}=We(l,n),N=v.icon;return t.jsxs(be,{value:l,children:[t.jsx(N,{size:14,className:Pt("shrink-0",v.iconClassName)}),y]},l)})})]})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n("automations.columnTransitionDialog.origin")}),t.jsxs(ge,{value:o,onValueChange:l=>{Io(l)&&j(l)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Gt.map(l=>t.jsx(be,{value:l,children:p(l)},l))})]}),o==="statuses"&&t.jsx(Wt,{options:x.map(l=>({label:We(l,n).label,value:l})),defaultValue:f,onValueChange:m,placeholder:n("automations.columnTransitionDialog.columnsPlaceholder"),modalPopover:!0,className:"max-w-none"},i)]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("automations.columnTransitionDialog.help")})]}),t.jsxs(nt,{children:[t.jsx(B,{variant:"ghost",onClick:()=>u(!1),children:n("automations.columnTransitionDialog.cancel")}),t.jsx(B,{disabled:!g||a.isPending,onClick:h,children:n("automations.columnTransitionDialog.add")})]})]})})}const Ht=["any","earlier","later","statuses"],Po=r=>Ht.some(e=>e===r);function $o({automationId:r,boardId:e,open:s,onOpenChange:n}){const a=ee(),{triggerAdd:i}=ve(),c=Zs(s?e:null),[o,j]=w.useState(null),[d,m]=w.useState("any"),[x,f]=w.useState([]),g=(c.data??[]).flatMap(b=>b.statuses.map(T=>({column:b.name,status:T}))),u=o??g[0]?.status??null,h=g.map(b=>b.status).filter(b=>b!==u),p=x.filter(b=>b!==u),l=u!==null&&(d!=="statuses"||p.length>0),y=b=>{b||(j(null),m("any"),f([])),n(b)},v=async()=>{if(u)try{await i.mutateAsync({automation_id:r,type:"jira_transition",jira_status:u,from:d==="statuses"?{kind:d,statuses:p}:{kind:d}}),X.success(a("automations.addStarterPopover.starterAdded")),y(!1)}catch(b){X.error(b instanceof Error?b.message:a("automations.addStarterPopover.failedAddStarter"))}},N=b=>a(b==="any"?"automations.jiraTransitionDialog.fromAny":b==="earlier"?"automations.jiraTransitionDialog.fromEarlier":b==="later"?"automations.jiraTransitionDialog.fromLater":"automations.jiraTransitionDialog.fromStatuses");let S;return c.isPending?S=t.jsx(es,{className:"h-9 w-full"}):c.isError||g.length===0?S=t.jsx("p",{className:"text-xs text-muted-foreground",children:a("automations.jiraTransitionDialog.noStatuses")}):S=t.jsxs(ge,{value:u??void 0,onValueChange:j,children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:g.map(b=>t.jsxs(be,{value:b.status,children:[b.status,b.column!==b.status&&t.jsx("span",{className:"text-muted-foreground",children:b.column})]},b.status))})]}),t.jsx(et,{open:s,onOpenChange:y,children:t.jsxs(tt,{className:"max-w-md",children:[t.jsxs(st,{children:[t.jsx(ot,{children:a("automations.jiraTransitionDialog.title")}),t.jsx(at,{children:a("automations.jiraTransitionDialog.description")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:a("automations.jiraTransitionDialog.status")}),S]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:a("automations.jiraTransitionDialog.origin")}),t.jsxs(ge,{value:d,onValueChange:b=>{Po(b)&&m(b)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Ht.map(b=>t.jsx(be,{value:b,children:N(b)},b))})]}),d==="statuses"&&t.jsx(Wt,{options:h.map(b=>({label:b,value:b})),defaultValue:p,onValueChange:f,placeholder:a("automations.jiraTransitionDialog.statusesPlaceholder"),modalPopover:!0,className:"max-w-none"},u)]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("automations.jiraTransitionDialog.help")})]}),t.jsxs(nt,{children:[t.jsx(B,{variant:"ghost",onClick:()=>y(!1),children:a("automations.jiraTransitionDialog.cancel")}),t.jsx(B,{disabled:!l||i.isPending,onClick:v,children:a("automations.jiraTransitionDialog.add")})]})]})})}function zo({automationId:r,open:e,onOpenChange:s,onCustomSelect:n,onEventSelect:a,onWebhookCreated:i}){const c=ee(),{triggerAdd:o}=ve(),[j,d]=w.useState(!1),[m,x]=w.useState(!1),[f,g]=w.useState(!1),u=eo().data?.boardId??null,h=e??j,p=v=>{s?s(v):d(v)},l=async v=>{try{await o.mutateAsync({automation_id:r,type:"cron",cron_expression:v}),X.success(c("automations.addStarterPopover.starterAdded")),p(!1)}catch(N){const S=N instanceof Error?N.message:c("automations.addStarterPopover.failedAddStarter");X.error(S)}},y=async()=>{try{const v=await o.mutateAsync({automation_id:r,type:"webhook"});p(!1),v.webhook?i?.(v.webhook):X.success(c("automations.addStarterPopover.webhookStarterAdded"))}catch(v){const N=v instanceof Error?v.message:c("automations.addStarterPopover.failedAddWebhookStarter");X.error(N)}};return t.jsxs(t.Fragment,{children:[t.jsxs(ts,{open:h,onOpenChange:p,children:[t.jsx(ss,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",children:[t.jsx(to,{size:14}),c("automations.addStarterPopover.addStarter")]})}),t.jsxs(os,{align:"end",className:"w-[240px]",children:[t.jsxs(as,{children:[t.jsxs(ns,{className:"gap-2.5",children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.every")]}),t.jsx(is,{className:"w-[160px]",children:Do.map(v=>t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>l(v.cron),disabled:o.isPending,children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.everyUnit",{unit:v.label})]},v.cron))})]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),n?.()},children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.customCron")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),a?.()},children:[t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.event")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),x(!0)},children:[t.jsx(zt,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.cardEntersColumn")]}),u&&t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),g(!0)},children:[t.jsx(Ut,{size:14,className:"shrink-0"}),c("automations.addStarterPopover.jiraIssueEntersStatus")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{y()},disabled:o.isPending,children:[t.jsx(it,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.webhook")]})]})]}),t.jsx(Ao,{automationId:r,open:m,onOpenChange:x}),u&&t.jsx($o,{automationId:r,boardId:u,open:f,onOpenChange:g})]})}function Jt(r){const e=Z.c(39),{open:s,onOpenChange:n,url:a,token:i,title:c,description:o}=r,j=c===void 0?"Webhook ready":c,d=o===void 0?"Send a POST to this URL with the bearer token to fire the automation. The token is shown once — copy it now.":o,m=ee(),[x,f]=w.useState(null),[g,u]=w.useState("curl"),[h,p]=w.useState("header"),l=w.useId();let y;e[0]!==m?(y=async(W,G)=>{try{await navigator.clipboard.writeText(W),f(G),X.success(m("automations.webhookSecretDialog.copied")),setTimeout(()=>f(null),1500)}catch{X.error(m("automations.webhookSecretDialog.failedCopy"))}},e[0]=m,e[1]=y):y=e[1];const v=y;let N;e[2]!==h||e[3]!==i||e[4]!==a?(N=a&&i&&h==="url"?`${a.replace(/\/$/,"")}/${i}`:a??"",e[2]=h,e[3]=i,e[4]=a,e[5]=N):N=e[5];const S=N,b=a&&i?h==="header"?`curl -X POST "${S}" \\
1
+ import{az as Yt,c as Z,b as ee,r as w,j as t,B,ah as Zt,l as Pt,a2 as $t,D as et,q as tt,s as st,v as ot,aM as at,w as nt,t as X,b1 as es,X as ts,T as ss,V as os,as,aq as ns,ar as is,U as Oe,aW as rs,h as Le,y as Ke,aE as ls,b9 as pt,I as xt,ba as cs,al as ds,a_ as Ye,n as Xe,f as ms}from"./index-CTZFCFor.js";import{C as us}from"./index-CdXcvK9e.js";import{b as it,N as fs,a as ps,a4 as xs,h as gt,aw as gs,U as ht,ax as hs,f as js,M as Me,ay as zt}from"./agent-icon-CdvQWbsW.js";import{n as jt}from"./ShoppingBag01-DmYaqF6W.js";import{t as rt}from"./ChevronUp-D5DP9qHs.js";import{e as ys}from"./UserSquare-J-pPBDsM.js";import{e as lt,b as Et,t as Ot}from"./Tool01-BxfOk1kQ.js";import{a as bs}from"./Image01-8_YUB9dA.js";import{i as vs}from"./SearchMd-Cey_qFlh.js";import{B as Kt}from"./badge-xuppbiJQ.js";import{C as Ft}from"./checkbox-CsdxV5F4.js";import{S as ct}from"./switch-DGEo5K4-.js";import{a as Mt,b as Rt,P as Lt}from"./popover-DZg3XzK_.js";import{C as Cs,a as yt,b as Ns,d as Ss,e as ks,c as Ts}from"./command-CdQubtgL.js";import{g as ws,s as Ds}from"./tool-namespace-BEzs43Ur.js";import{u as dt}from"./use-connection-Bc66r7WR.js";import{u as _s}from"./use-mcp-client-jKOlHdKM.js";import{u as Is}from"./use-mcp-tools-CWDoMes8.js";import{I as As}from"./integration-icon-DedJ1gFL.js";import{M as Ps}from"./select-model-CxhDhd-9.js";import{u as $s}from"./use-ai-providers-r5JMl3Dn.js";import{U as zs,b as Es}from"./build-improve-prompt-doc-LycMDrLL.js";import{a as ve,c as Os,d as Ks}from"./use-automations-CAQWvaBW.js";import{c as Fs,b as Ms,h as Rs,t as Ls}from"./chat-context-CShbCUNX.js";import{b as Us,C as Vs,a as Ws}from"./collapsible-pbpDRVGu.js";import{c as Bs,T as Gs,a as Hs}from"./tooltip-OCAaNJPG.js";import{a as Js}from"./shell-layout-Dhz9Exq4.js";import{i as Ut}from"./ArrowLeft-CGwuLtbU.js";import{i as Xs}from"./ArrowUp-BYzq623p.js";import{s as qs}from"./Trash01-CMp64biU.js";import{s as mt}from"./XClose-BnQLG2SG.js";import{u as bt}from"./use-debounced-autosave-CitZx5FB.js";import{T as Qs,a as Ys}from"./input-CAuGdxaS.js";import{u as Zs,a as eo,J as Vt}from"./jira-icon-BH-e3sV4.js";import{s as to}from"./Plus-Bk_sjqOf.js";import{i as ut}from"./ZoomOut-DAA80mSj.js";import{l as We,H as so}from"./config-CC4U9lyT.js";import{C as oo}from"./task-board-Cfny2jqU.js";import{M as Wt}from"./multi-select-BGUKy-ie.js";import{S as ge,b as he,a as je,d as ye,c as be}from"./select-CMGxS2qh.js";import{b as ao,a as no,T as vt}from"./tabs-D7n9t3lM.js";import{a as qe}from"./Copy01-51uCRbSg.js";import{MonacoCodeEditor as io}from"./monaco-editor-C1ThyHfg.js";import{A as Ct,a as Nt,b as St,c as kt,g as Tt,d as wt,e as Dt,f as _t}from"./alert-dialog-C9FvnbJH.js";import{A as ro}from"./automation-runs-80f4mOhg.js";import{C as lo}from"./collection-tabs-P32YIIxy.js";import{a as co}from"./use-panel-navigate-BhXVoQPa.js";import"./use-mobile-CmswU9_U.js";import"./use-app-takeover-C41Zrny9.js";import"./sheet-BRHzkcNr.js";import"./use-project-native-view-presence-DgH1oa2Q.js";import"./thread-route-dlwv4_1A.js";import"./thread-intent-b5vpifzT.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CEcxThGW.js";import"./slugify-CEUa2lfQ.js";import"./use-file-configs-Da0V_POi.js";import"./use-organization-settings-NMl9AK6V.js";import"./schema-BpLx5lXs.js";import"./repository-binding-CbZ7gDPF.js";import"./site-slug-DebpOoQq.js";import"./toolbar-icon-button-iqvhc0aD.js";import"./resizable-MOzKpsY9.js";import"./icon-button-BS-JGKQE.js";import"./use-project-scope-B3s9YTAH.js";import"./AlertCircle-Bty2uhsk.js";import"./LinkBroken01-DvM0DBf8.js";import"./Building02-DC1B_tJa.js";import"./CheckCircle-DPGL3Hpc.js";import"./ChevronSelectorVertical-BwRvUPUM.js";import"./CreditCard01-D8QKn2t6.js";import"./DotsVertical-Bhq6_ex6.js";import"./Globe04-C6aR04Lg.js";import"./SwitchHorizontal01-Cpiuomvl.js";import"./Key01-BYJLiX2A.js";import"./Link01-BrX96Lzm.js";import"./Monitor01-D0i8fPos.js";import"./Sun-Vjoy_5bv.js";import"./Play-BefGY3fA.js";import"./Upload01-Dgeov9JH.js";import"./User01-hKw9FGQs.js";import"./Users01-D83kTTD4.js";import"./index-JOoGKn03.js";import"./auth-MJlmDrih.js";import"./drawer-CY01gtte.js";import"./index-DN6_-RzX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-V-6seD4f.js";import"./autosend-BfqtXC9i.js";import"./use-decopilot-events-BGdkAbxA.js";import"./use-chat-navigation-B7jtkmO9.js";import"./location-BjlyegC2.js";import"./index-DQRAWCM4.js";import"./use-clock-tick-CdAPP8z5.js";import"./project-icon-Cd3AxOfl.js";import"./new-project-dialog--6a9GYsY.js";import"./label-BxQ_dsc6.js";import"./repository-import-picker-CqejRBEV.js";import"./use-navigate-to-agent-DvsN-N9f.js";import"./repository-picker-lc5PVuph.js";import"./useInfiniteQuery-DOKZzanu.js";import"./infiniteQueryObserver-DjFxX3t4.js";import"./collection-search-B8HvNhHx.js";import"./use-debounced-value-Cv1nzd8k.js";import"./required-auth-layout-obZ6miVT.js";import"./use-org-sso-meIc9b7s.js";import"./suggestion-D_2yEjf4.js";import"./usage-stats-k4aXi0cR.js";import"./form-C3-gqoE3.js";import"./utils-CVEq3hMx.js";import"./markdown-B3gUf9fq.js";import"./use-copy-DIsWFSvt.js";import"./format-time-CAj8AQXM.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-prompts-KLIBV_YA.js";import"./use-org-fs-5rCZZYw5.js";import"./core.esm-DySokeDD.js";import"./index-BdQq_4o_.js";import"./editor-BMsJkpc5.js";import"./table-CM_armOG.js";import"./empty-state-DbF1fVB1.js";import"./use-infinite-scroll-qQBI_BkS.js";import"./use-members-DKFjOBdl.js";import"./use-org-auth-client-DyhHIXwn.js";import"./task-status-Dc99s_5R.js";import"./thread-sheet-body-BlfHDz0K.js";import"./useSuspenseInfiniteQuery-gQb4-5BD.js";import"./pair-BXKJ75t2.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-4oVWjJbt.js";import"./types-DSl6aKYl.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-thread-outputs-BOAz3j7m.js";import"./file-type-icon-DuTvDFZv.js";const Qe={fast:{labelKey:"automations.automationConfig.tierFast",subtitleKey:"automations.automationConfig.tierFastSubtitle",icon:js},smart:{labelKey:"automations.automationConfig.tierSmart",subtitleKey:"automations.automationConfig.tierSmartSubtitle",icon:Ot},thinking:{labelKey:"automations.automationConfig.tierThinking",subtitleKey:"automations.automationConfig.tierThinkingSubtitle",icon:hs}},mo=["fast","smart","thinking"];function uo(r){const e=Z.c(19),{tier:s,onSelect:n}=r,a=ee(),[i,c]=w.useState(!1),o=Qe[s].icon;let j;e[0]!==o?(j=t.jsx(o,{size:14,className:"text-muted-foreground"}),e[0]=o,e[1]=j):j=e[1];const d=Qe[s];let m;e[2]!==a||e[3]!==d.labelKey?(m=a(d.labelKey),e[2]=a,e[3]=d.labelKey,e[4]=m):m=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14,className:"text-muted-foreground"}),e[5]=x):x=e[5];let f;e[6]!==j||e[7]!==m?(f=t.jsx(Mt,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[j,m,x]})}),e[6]=j,e[7]=m,e[8]=f):f=e[8];let g;e[9]!==n||e[10]!==a||e[11]!==s?(g=mo.map(p=>{const l=Qe[p],y=l.icon;return t.jsxs("button",{type:"button",onClick:()=>{n(p),c(!1)},className:Pt("flex items-start gap-2 px-2 py-1.5 rounded-lg text-left hover:bg-muted"),children:[t.jsx(y,{size:16,className:"shrink-0 text-muted-foreground mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"text-sm",children:a(l.labelKey)}),t.jsx("div",{className:"text-xs text-muted-foreground",children:a(l.subtitleKey)})]}),p===s&&t.jsx(Zt,{size:14,className:"text-foreground mt-0.5"})]},p)}),e[9]=n,e[10]=a,e[11]=s,e[12]=g):g=e[12];let u;e[13]!==g?(u=t.jsx(Rt,{align:"start",className:"p-1 w-64",children:t.jsx("div",{className:"flex flex-col",children:g})}),e[13]=g,e[14]=u):u=e[14];let h;return e[15]!==i||e[16]!==f||e[17]!==u?(h=t.jsxs(Lt,{open:i,onOpenChange:c,children:[f,u]}),e[15]=i,e[16]=f,e[17]=u,e[18]=h):h=e[18],h}function fo(r){const e=Z.c(27),{tier:s,onTierChange:n,override:a,onOverrideChange:i}=r,c=ee(),[o,j]=w.useState(a!==null);let d;e[0]!==c?(d=c("automations.automationConfig.modelLabel"),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==d?(m=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:d}),e[2]=d,e[3]=m):m=e[3];let x;e[4]!==i||e[5]!==n||e[6]!==a||e[7]!==c||e[8]!==s||e[9]!==o?(x=o?t.jsx(w.Suspense,{fallback:t.jsx(B,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:c("automations.automationConfig.loadingModels")}),children:t.jsx(po,{override:a,onOverrideChange:i})}):t.jsx(uo,{tier:s,onSelect:n}),e[4]=i,e[5]=n,e[6]=a,e[7]=c,e[8]=s,e[9]=o,e[10]=x):x=e[10];let f;e[11]!==i?(f=y=>{j(y),y||i(null)},e[11]=i,e[12]=f):f=e[12];let g;e[13]!==f||e[14]!==o?(g=t.jsx(ct,{checked:o,onCheckedChange:f,className:"cursor-pointer"}),e[13]=f,e[14]=o,e[15]=g):g=e[15];let u;e[16]!==c?(u=c("automations.automationConfig.specificModel"),e[16]=c,e[17]=u):u=e[17];let h;e[18]!==g||e[19]!==u?(h=t.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none",children:[g,u]}),e[18]=g,e[19]=u,e[20]=h):h=e[20];let p;e[21]!==x||e[22]!==h?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[x,h]}),e[21]=x,e[22]=h,e[23]=p):p=e[23];let l;return e[24]!==m||e[25]!==p?(l=t.jsxs("div",{className:"flex flex-col gap-2",children:[m,p]}),e[24]=m,e[25]=p,e[26]=l):l=e[26],l}function po(r){const e=Z.c(25),{override:s,onOverrideChange:n}=r,a=ee(),i=$s(),c=i[0]?.id??null;let o;e[0]!==c||e[1]!==i||e[2]!==s?.credentialId?(o=i.some(l=>l.id===s?.credentialId)?s?.credentialId??null:c,e[0]=c,e[1]=i,e[2]=s?.credentialId,e[3]=o):o=e[3];const[j,d]=w.useState(o);let m;e[4]!==j||e[5]!==c||e[6]!==i?(m=i.some(l=>l.id===j)?j:c,e[4]=j,e[5]=c,e[6]=i,e[7]=m):m=e[7];const x=m;let f;e[8]!==i||e[9]!==s?(f=s&&i.some(l=>l.id===s.credentialId)?{modelId:s.modelId,title:s.title||s.modelId,keyId:s.credentialId,providerId:"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[8]=i,e[9]=s,e[10]=f):f=e[10];const g=f;if(i.length===0){let l;e[11]!==a?(l=a("automations.automationConfig.connectAiProviderHint"),e[11]=a,e[12]=l):l=e[12];let y;return e[13]!==l?(y=t.jsx("span",{className:"text-xs text-muted-foreground italic",children:l}),e[13]=l,e[14]=y):y=e[14],y}let u;e[15]!==a?(u=a("automations.automationConfig.pickModelPlaceholder"),e[15]=a,e[16]=u):u=e[16];let h;e[17]!==x||e[18]!==n?(h=l=>{const y=l.keyId??x??"";d(y),n({modelId:l.modelId,credentialId:y,title:l.title??l.modelId})},e[17]=x,e[18]=n,e[19]=h):h=e[19];let p;return e[20]!==x||e[21]!==g||e[22]!==u||e[23]!==h?(p=t.jsx("div",{className:"w-fit max-w-full",children:t.jsx(Ps,{variant:"bordered",placeholder:u,model:g,credentialId:x,onCredentialChange:d,onModelChange:h})}),e[20]=x,e[21]=g,e[22]=u,e[23]=h,e[24]=p):p=e[24],p}const Bt=[{key:"capabilities",headingKey:"automations.automationConfig.builtinCapabilities",icon:lt,tools:[{name:"web_search",titleKey:"automations.automationConfig.toolWebSearch",descriptionKey:"automations.automationConfig.toolWebSearchDesc",icon:it},{name:"generate_image",titleKey:"automations.automationConfig.toolGenerateImage",descriptionKey:"automations.automationConfig.toolGenerateImageDesc",icon:bs},{name:"subtask",titleKey:"automations.automationConfig.toolSubtask",descriptionKey:"automations.automationConfig.toolSubtaskDesc",icon:Yt},{name:"user_ask",titleKey:"automations.automationConfig.toolAskUser",descriptionKey:"automations.automationConfig.toolAskUserDesc",icon:fs}]},{key:"files",headingKey:"automations.automationConfig.filesCode",icon:gt,tools:[{name:"read",titleKey:"automations.automationConfig.toolReadFile",descriptionKey:"automations.automationConfig.toolReadFileDesc",icon:ps},{name:"write",titleKey:"automations.automationConfig.toolWriteFile",descriptionKey:"automations.automationConfig.toolWriteFileDesc",icon:Et},{name:"edit",titleKey:"automations.automationConfig.toolEditFile",descriptionKey:"automations.automationConfig.toolEditFileDesc",icon:xs},{name:"grep",titleKey:"automations.automationConfig.toolSearchContent",descriptionKey:"automations.automationConfig.toolSearchContentDesc",icon:vs},{name:"glob",titleKey:"automations.automationConfig.toolFindFiles",descriptionKey:"automations.automationConfig.toolFindFilesDesc",icon:gt},{name:"bash",titleKey:"automations.automationConfig.toolRunCommand",descriptionKey:"automations.automationConfig.toolRunCommandDesc",icon:gs}]},{key:"context",headingKey:"automations.automationConfig.context",icon:ht,tools:[{name:"read_resource",titleKey:"automations.automationConfig.toolReadResource",descriptionKey:"automations.automationConfig.toolReadResourceDesc",icon:ht},{name:"read_prompt",titleKey:"automations.automationConfig.toolReadPrompt",descriptionKey:"automations.automationConfig.toolReadPromptDesc",icon:jt},{name:"skill",titleKey:"automations.automationConfig.toolLoadSkill",descriptionKey:"automations.automationConfig.toolLoadSkillDesc",icon:jt}]}],xo=Bt.flatMap(r=>r.tools.map(e=>e.name));function go(r){const e=r.replace(/[_-]+/g," ").trim();return e?e.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()):r}function ho(r){const e=Z.c(12),{agentId:s,value:n,onChange:a}=r,i=ee();let c;e[0]!==i?(c=i("automations.automationConfig.toolsLabel"),e[0]=i,e[1]=c):c=e[1];let o;e[2]!==c?(o=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:c}),e[2]=c,e[3]=o):o=e[3];let j;e[4]!==s||e[5]!==a||e[6]!==i||e[7]!==n?(j=s?t.jsx(w.Suspense,{fallback:t.jsxs(B,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:[t.jsx(lt,{size:14}),i("automations.automationConfig.loadingTools")]}),children:t.jsx(jo,{agentId:s,value:n,onChange:a})}):t.jsx("span",{className:"text-xs text-muted-foreground italic",children:i("automations.automationConfig.pickAgentFirst")}),e[4]=s,e[5]=a,e[6]=i,e[7]=n,e[8]=j):j=e[8];let d;return e[9]!==o||e[10]!==j?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[o,j]}),e[9]=o,e[10]=j,e[11]=d):d=e[11],d}function It(r){const e=Z.c(17),{value:s,checked:n,onToggle:a,title:i,description:c,leading:o}=r;let j;e[0]!==n?(j=t.jsx(Ft,{checked:n,className:"pointer-events-none mt-0.5"}),e[0]=n,e[1]=j):j=e[1];let d;e[2]!==o?(d=o&&t.jsx("span",{className:"mt-px shrink-0",children:o}),e[2]=o,e[3]=d):d=e[3];let m;e[4]!==i?(m=t.jsx("span",{className:"truncate text-sm leading-tight",children:i}),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==c?(x=c&&t.jsx("span",{className:"line-clamp-2 text-xs leading-snug text-muted-foreground",children:c}),e[6]=c,e[7]=x):x=e[7];let f;e[8]!==m||e[9]!==x?(f=t.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[m,x]}),e[8]=m,e[9]=x,e[10]=f):f=e[10];let g;return e[11]!==a||e[12]!==j||e[13]!==d||e[14]!==f||e[15]!==s?(g=t.jsxs(Ns,{value:s,onSelect:a,className:"items-start gap-2.5 py-2",children:[j,d,f]}),e[11]=a,e[12]=j,e[13]=d,e[14]=f,e[15]=s,e[16]=g):g=e[16],g}function At(r){const e=Z.c(27),{conn:s,label:n,icon:a,on:i,total:c,onToggle:o}=r,j=ee(),d=i===c;let m;e[0]!==a||e[1]!==s?(m=s?t.jsx(As,{icon:s.icon,name:s.title,size:"2xs"}):a?t.jsx(a,{size:14,className:"text-muted-foreground"}):t.jsx(ys,{size:14,className:"text-muted-foreground"}),e[0]=a,e[1]=s,e[2]=m):m=e[2];let x;e[3]!==s?.title||e[4]!==n||e[5]!==j?(x=s?.title??n??j("automations.automationConfig.otherTools"),e[3]=s?.title,e[4]=n,e[5]=j,e[6]=x):x=e[6];let f;e[7]!==x?(f=t.jsx("span",{className:"truncate",children:x}),e[7]=x,e[8]=f):f=e[8];let g;e[9]!==i||e[10]!==c?(g=t.jsxs("span",{className:"text-[11px] font-normal tabular-nums text-muted-foreground/70",children:[i,"/",c]}),e[9]=i,e[10]=c,e[11]=g):g=e[11];let u;e[12]!==o?(u=v=>{v.stopPropagation(),o()},e[12]=o,e[13]=u):u=e[13];let h;e[14]!==d||e[15]!==j?(h=j(d?"automations.automationConfig.none":"automations.automationConfig.all"),e[14]=d,e[15]=j,e[16]=h):h=e[16];let p;e[17]!==u||e[18]!==h?(p=t.jsx("button",{type:"button",onClick:u,className:"text-[11px] font-medium text-primary hover:underline",children:h}),e[17]=u,e[18]=h,e[19]=p):p=e[19];let l;e[20]!==g||e[21]!==p?(l=t.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[g,p]}),e[20]=g,e[21]=p,e[22]=l):l=e[22];let y;return e[23]!==m||e[24]!==f||e[25]!==l?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[m,f,l]}),e[23]=m,e[24]=f,e[25]=l,e[26]=y):y=e[26],y}function jo(r){const e=Z.c(83),{agentId:s,value:n,onChange:a}=r,i=ee(),{org:c}=$t(),[o,j]=w.useState(!1);let d;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(d={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=d):d=e[3];const m=_s(d);let x;e[4]!==m?(x={client:m},e[4]=m,e[5]=x):x=e[5];const{data:f,isLoading:g}=Is(x),u=dt();let h,p,l,y,v,N,S,b,T,D,_,k,A;if(e[6]!==u||e[7]!==f?.tools||e[8]!==g||e[9]!==a||e[10]!==o||e[11]!==i||e[12]!==n){const q=new Map(u.map(No)),H=new Map;for(const I of f?.tools??[]){const E=ws(I._meta)??"__other__",Y=Ds(I.name,E==="__other__"?void 0:E),P=I.title,xe=P&&P!==I.name?P:go(Y);H.has(E)||H.set(E,{clientId:E,conn:q.get(E),tools:[]}),H.get(E).tools.push({name:I.name,display:xe,description:I.description})}const W=[...H.values()].sort(Co),G=(f?.tools??[]).map(vo),J=[...xo,...G],U=n===null?new Set(J):new Set(n),V=J.every(I=>U.has(I)),z=I=>a(J.every(E=>I.has(E))?null:[...I]),ae=I=>{const E=new Set(U);E.has(I)?E.delete(I):E.add(I),z(E)},ne=(I,E)=>{const Y=new Set(U);for(const P of I)E?Y.add(P):Y.delete(P);z(Y)};y=Lt,A=o,v=j;let Q;e[26]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(lt,{size:14,className:"text-muted-foreground"}),e[26]=Q):Q=e[26];let ie;e[27]!==V||e[28]!==i?(ie=i(V?"automations.automationConfig.allTools":"automations.automationConfig.tools"),e[27]=V,e[28]=i,e[29]=ie):ie=e[29];const ue=!V&&t.jsxs(Kt,{variant:"secondary",className:"ml-0.5 h-5 px-1.5 text-[11px] tabular-nums",children:[U.size,"/",J.length]});let me;e[30]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(rt,{size:14,className:"text-muted-foreground"}),e[30]=me):me=e[30],e[31]!==ie||e[32]!==ue?(N=t.jsx(Mt,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[Q,ie,ue,me]})}),e[31]=ie,e[32]=ue,e[33]=N):N=e[33],l=Rt,_="p-0 w-80",k="start",p=Ss;let te;e[34]!==i?(te=i("automations.automationConfig.searchToolsPlaceholder"),e[34]=i,e[35]=te):te=e[35],e[36]!==te?(T=t.jsx(ks,{placeholder:te}),e[36]=te,e[37]=T):T=e[37];const fe=V?i("automations.automationConfig.allToolsEnabled",{count:J.length}):i("automations.automationConfig.toolsEnabledCount",{enabled:U.size,total:J.length});let se;e[38]!==fe?(se=t.jsx("span",{className:"text-xs text-muted-foreground",children:fe}),e[38]=fe,e[39]=se):se=e[39];let re;e[40]!==a?(re=()=>a(null),e[40]=a,e[41]=re):re=e[41];let le;e[42]!==i?(le=i("automations.automationConfig.selectAll"),e[42]=i,e[43]=le):le=e[43];let C;e[44]!==V||e[45]!==re||e[46]!==le?(C=t.jsx("button",{type:"button",onClick:re,disabled:V,className:"text-xs font-medium text-primary hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:le}),e[44]=V,e[45]=re,e[46]=le,e[47]=C):C=e[47];let M;e[48]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[48]=M):M=e[48];let O;e[49]!==a?(O=()=>a([]),e[49]=a,e[50]=O):O=e[50];const pe=U.size===0;let oe;e[51]!==i?(oe=i("automations.automationConfig.clear"),e[51]=i,e[52]=oe):oe=e[52];let ce;e[53]!==O||e[54]!==pe||e[55]!==oe?(ce=t.jsx("button",{type:"button",onClick:O,disabled:pe,className:"text-xs font-medium text-muted-foreground hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:oe}),e[53]=O,e[54]=pe,e[55]=oe,e[56]=ce):ce=e[56];let de;e[57]!==C||e[58]!==ce?(de=t.jsxs("div",{className:"flex items-center gap-2",children:[C,M,ce]}),e[57]=C,e[58]=ce,e[59]=de):de=e[59],e[60]!==se||e[61]!==de?(D=t.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[se,de]}),e[60]=se,e[61]=de,e[62]=D):D=e[62],h=Ts,S="max-h-80",b=g?t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("automations.automationConfig.loadingTools")}):t.jsxs(t.Fragment,{children:[t.jsx(Cs,{children:i("automations.automationConfig.noToolsFound")}),Bt.map(I=>{const E=I.tools.map(bo),Y=E.filter(P=>U.has(P)).length;return t.jsx(yt,{heading:t.jsx(At,{label:i(I.headingKey),icon:I.icon,on:Y,total:E.length,onToggle:()=>ne(E,Y!==E.length)}),children:I.tools.map(P=>t.jsx(It,{value:`${i(P.titleKey)} ${P.name}`,checked:U.has(P.name),onToggle:()=>ae(P.name),title:i(P.titleKey),description:i(P.descriptionKey),leading:t.jsx(P.icon,{size:16,className:"text-muted-foreground"})},P.name))},I.key)}),W.map(I=>{const E=I.tools.map(yo),Y=E.filter(P=>U.has(P)).length;return t.jsx(yt,{heading:t.jsx(At,{conn:I.conn,on:Y,total:E.length,onToggle:()=>ne(E,Y!==E.length)}),children:I.tools.map(P=>t.jsx(It,{value:`${P.display} ${P.name} ${I.conn?.title??""}`,checked:U.has(P.name),onToggle:()=>ae(P.name),title:P.display,description:P.description},P.name))},I.clientId)})]}),e[6]=u,e[7]=f?.tools,e[8]=g,e[9]=a,e[10]=o,e[11]=i,e[12]=n,e[13]=h,e[14]=p,e[15]=l,e[16]=y,e[17]=v,e[18]=N,e[19]=S,e[20]=b,e[21]=T,e[22]=D,e[23]=_,e[24]=k,e[25]=A}else h=e[13],p=e[14],l=e[15],y=e[16],v=e[17],N=e[18],S=e[19],b=e[20],T=e[21],D=e[22],_=e[23],k=e[24],A=e[25];let $;e[63]!==h||e[64]!==S||e[65]!==b?($=t.jsx(h,{className:S,children:b}),e[63]=h,e[64]=S,e[65]=b,e[66]=$):$=e[66];let R;e[67]!==p||e[68]!==$||e[69]!==T||e[70]!==D?(R=t.jsxs(p,{children:[T,D,$]}),e[67]=p,e[68]=$,e[69]=T,e[70]=D,e[71]=R):R=e[71];let K;e[72]!==l||e[73]!==R||e[74]!==_||e[75]!==k?(K=t.jsx(l,{className:_,align:k,children:R}),e[72]=l,e[73]=R,e[74]=_,e[75]=k,e[76]=K):K=e[76];let F;return e[77]!==y||e[78]!==v||e[79]!==N||e[80]!==K||e[81]!==A?(F=t.jsxs(y,{open:A,onOpenChange:v,children:[N,K]}),e[77]=y,e[78]=v,e[79]=N,e[80]=K,e[81]=A,e[82]=F):F=e[82],F}function yo(r){return r.name}function bo(r){return r.name}function vo(r){return r.name}function Co(r,e){return(r.conn?.title??r.clientId).localeCompare(e.conn?.title??e.clientId)}function No(r){return[r.id,r]}function Re(r){const e=r.trim().split(/\s+/);return e.length!==5?!1:e.every(s=>/^[\d*/,-]+$/.test(s))}function So(r){if(!r)return"Unknown schedule";const e=r.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return`Every ${s[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const a=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(a){const o=parseInt(a[1]??"1");return o%7===0?`Every ${o/7} weeks`:`Every ${o} days`}const i=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(i){const o=(i[2]??"0").padStart(2,"0"),j=(i[1]??"0").padStart(2,"0");return`Every day at ${o}:${j} UTC`}const c=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(c){const j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(c[3]??"0")]??"day",d=(c[2]??"0").padStart(2,"0"),m=(c[1]??"0").padStart(2,"0");return`Every ${j} at ${d}:${m} UTC`}return r}function ko(r,e){const s=Math.max(1,r);switch(e){case"minutes":return s===1?"* * * * *":`*/${s} * * * *`;case"hours":return s===1?"0 * * * *":`0 */${s} * * *`;case"days":return s===1?"0 0 * * *":`0 0 */${s} * *`;case"weeks":return s===1?"0 0 * * 1":`0 0 */${s*7} * *`}}function To(r){const e=r.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return{count:parseInt(s[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const a=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);return a?{count:parseInt(a[1]),unit:"days"}:null}function wo(r,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[r]??r:r}const Do=[{label:"5 minutes",cron:"*/5 * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}],Ze=oo.filter(r=>!so.includes(r)),Gt=["any","earlier","later","statuses"],_o=r=>Ze.some(e=>e===r),Io=r=>Gt.some(e=>e===r);function Ao({automationId:r,open:e,onOpenChange:s}){const n=ee(),{triggerAdd:a}=ve(),[i,c]=w.useState("in_progress"),[o,j]=w.useState("any"),[d,m]=w.useState([]),x=Ze.filter(l=>l!==i),f=d.filter(l=>l!==i),g=o!=="statuses"||f.length>0,u=l=>{l||(c("in_progress"),j("any"),m([])),s(l)},h=async()=>{try{await a.mutateAsync({automation_id:r,type:"board_column_transition",column_key:i,from:o==="statuses"?{kind:o,statuses:f}:{kind:o}}),X.success(n("automations.addStarterPopover.starterAdded")),u(!1)}catch(l){X.error(l instanceof Error?l.message:n("automations.addStarterPopover.failedAddStarter"))}},p=l=>n(l==="any"?"automations.columnTransitionDialog.fromAny":l==="earlier"?"automations.columnTransitionDialog.fromEarlier":l==="later"?"automations.columnTransitionDialog.fromLater":"automations.columnTransitionDialog.fromColumns");return t.jsx(et,{open:e,onOpenChange:u,children:t.jsxs(tt,{className:"max-w-md",children:[t.jsxs(st,{children:[t.jsx(ot,{children:n("automations.columnTransitionDialog.title")}),t.jsx(at,{children:n("automations.columnTransitionDialog.description")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n("automations.columnTransitionDialog.column")}),t.jsxs(ge,{value:i,onValueChange:l=>{_o(l)&&c(l)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Ze.map(l=>{const{label:y,visual:v}=We(l,n),N=v.icon;return t.jsxs(be,{value:l,children:[t.jsx(N,{size:14,className:Pt("shrink-0",v.iconClassName)}),y]},l)})})]})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n("automations.columnTransitionDialog.origin")}),t.jsxs(ge,{value:o,onValueChange:l=>{Io(l)&&j(l)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Gt.map(l=>t.jsx(be,{value:l,children:p(l)},l))})]}),o==="statuses"&&t.jsx(Wt,{options:x.map(l=>({label:We(l,n).label,value:l})),defaultValue:f,onValueChange:m,placeholder:n("automations.columnTransitionDialog.columnsPlaceholder"),modalPopover:!0,className:"max-w-none"},i)]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("automations.columnTransitionDialog.help")})]}),t.jsxs(nt,{children:[t.jsx(B,{variant:"ghost",onClick:()=>u(!1),children:n("automations.columnTransitionDialog.cancel")}),t.jsx(B,{disabled:!g||a.isPending,onClick:h,children:n("automations.columnTransitionDialog.add")})]})]})})}const Ht=["any","earlier","later","statuses"],Po=r=>Ht.some(e=>e===r);function $o({automationId:r,boardId:e,open:s,onOpenChange:n}){const a=ee(),{triggerAdd:i}=ve(),c=Zs(s?e:null),[o,j]=w.useState(null),[d,m]=w.useState("any"),[x,f]=w.useState([]),g=(c.data??[]).flatMap(b=>b.statuses.map(T=>({column:b.name,status:T}))),u=o??g[0]?.status??null,h=g.map(b=>b.status).filter(b=>b!==u),p=x.filter(b=>b!==u),l=u!==null&&(d!=="statuses"||p.length>0),y=b=>{b||(j(null),m("any"),f([])),n(b)},v=async()=>{if(u)try{await i.mutateAsync({automation_id:r,type:"jira_transition",jira_status:u,from:d==="statuses"?{kind:d,statuses:p}:{kind:d}}),X.success(a("automations.addStarterPopover.starterAdded")),y(!1)}catch(b){X.error(b instanceof Error?b.message:a("automations.addStarterPopover.failedAddStarter"))}},N=b=>a(b==="any"?"automations.jiraTransitionDialog.fromAny":b==="earlier"?"automations.jiraTransitionDialog.fromEarlier":b==="later"?"automations.jiraTransitionDialog.fromLater":"automations.jiraTransitionDialog.fromStatuses");let S;return c.isPending?S=t.jsx(es,{className:"h-9 w-full"}):c.isError||g.length===0?S=t.jsx("p",{className:"text-xs text-muted-foreground",children:a("automations.jiraTransitionDialog.noStatuses")}):S=t.jsxs(ge,{value:u??void 0,onValueChange:j,children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:g.map(b=>t.jsxs(be,{value:b.status,children:[b.status,b.column!==b.status&&t.jsx("span",{className:"text-muted-foreground",children:b.column})]},b.status))})]}),t.jsx(et,{open:s,onOpenChange:y,children:t.jsxs(tt,{className:"max-w-md",children:[t.jsxs(st,{children:[t.jsx(ot,{children:a("automations.jiraTransitionDialog.title")}),t.jsx(at,{children:a("automations.jiraTransitionDialog.description")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:a("automations.jiraTransitionDialog.status")}),S]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:a("automations.jiraTransitionDialog.origin")}),t.jsxs(ge,{value:d,onValueChange:b=>{Po(b)&&m(b)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Ht.map(b=>t.jsx(be,{value:b,children:N(b)},b))})]}),d==="statuses"&&t.jsx(Wt,{options:h.map(b=>({label:b,value:b})),defaultValue:p,onValueChange:f,placeholder:a("automations.jiraTransitionDialog.statusesPlaceholder"),modalPopover:!0,className:"max-w-none"},u)]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("automations.jiraTransitionDialog.help")})]}),t.jsxs(nt,{children:[t.jsx(B,{variant:"ghost",onClick:()=>y(!1),children:a("automations.jiraTransitionDialog.cancel")}),t.jsx(B,{disabled:!l||i.isPending,onClick:v,children:a("automations.jiraTransitionDialog.add")})]})]})})}function zo({automationId:r,open:e,onOpenChange:s,onCustomSelect:n,onEventSelect:a,onWebhookCreated:i}){const c=ee(),{triggerAdd:o}=ve(),[j,d]=w.useState(!1),[m,x]=w.useState(!1),[f,g]=w.useState(!1),u=eo().data?.boardId??null,h=e??j,p=v=>{s?s(v):d(v)},l=async v=>{try{await o.mutateAsync({automation_id:r,type:"cron",cron_expression:v}),X.success(c("automations.addStarterPopover.starterAdded")),p(!1)}catch(N){const S=N instanceof Error?N.message:c("automations.addStarterPopover.failedAddStarter");X.error(S)}},y=async()=>{try{const v=await o.mutateAsync({automation_id:r,type:"webhook"});p(!1),v.webhook?i?.(v.webhook):X.success(c("automations.addStarterPopover.webhookStarterAdded"))}catch(v){const N=v instanceof Error?v.message:c("automations.addStarterPopover.failedAddWebhookStarter");X.error(N)}};return t.jsxs(t.Fragment,{children:[t.jsxs(ts,{open:h,onOpenChange:p,children:[t.jsx(ss,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",children:[t.jsx(to,{size:14}),c("automations.addStarterPopover.addStarter")]})}),t.jsxs(os,{align:"end",className:"w-[240px]",children:[t.jsxs(as,{children:[t.jsxs(ns,{className:"gap-2.5",children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.every")]}),t.jsx(is,{className:"w-[160px]",children:Do.map(v=>t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>l(v.cron),disabled:o.isPending,children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.everyUnit",{unit:v.label})]},v.cron))})]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),n?.()},children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.customCron")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),a?.()},children:[t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.event")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),x(!0)},children:[t.jsx(zt,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.cardEntersColumn")]}),u&&t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),g(!0)},children:[t.jsx(Vt,{size:14,className:"shrink-0"}),c("automations.addStarterPopover.jiraIssueEntersStatus")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{y()},disabled:o.isPending,children:[t.jsx(it,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.webhook")]})]})]}),t.jsx(Ao,{automationId:r,open:m,onOpenChange:x}),u&&t.jsx($o,{automationId:r,boardId:u,open:f,onOpenChange:g})]})}function Jt(r){const e=Z.c(39),{open:s,onOpenChange:n,url:a,token:i,title:c,description:o}=r,j=c===void 0?"Webhook ready":c,d=o===void 0?"Send a POST to this URL with the bearer token to fire the automation. The token is shown once — copy it now.":o,m=ee(),[x,f]=w.useState(null),[g,u]=w.useState("curl"),[h,p]=w.useState("header"),l=w.useId();let y;e[0]!==m?(y=async(W,G)=>{try{await navigator.clipboard.writeText(W),f(G),X.success(m("automations.webhookSecretDialog.copied")),setTimeout(()=>f(null),1500)}catch{X.error(m("automations.webhookSecretDialog.failedCopy"))}},e[0]=m,e[1]=y):y=e[1];const v=y;let N;e[2]!==h||e[3]!==i||e[4]!==a?(N=a&&i&&h==="url"?`${a.replace(/\/$/,"")}/${i}`:a??"",e[2]=h,e[3]=i,e[4]=a,e[5]=N):N=e[5];const S=N,b=a&&i?h==="header"?`curl -X POST "${S}" \\
2
2
  -H "Authorization: Bearer ${i}" \\
3
3
  -H "Content-Type: application/json" \\
4
4
  -d '{"hello":"world"}'`:`curl -X POST "${S}" \\
@@ -16,5 +16,5 @@ import{az as Yt,c as Z,b as ee,r as w,j as t,B,ah as Zt,l as Pt,a2 as $t,D as et
16
16
  "Content-Type": "application/json",
17
17
  },
18
18
  body: JSON.stringify({ hello: "world" }),
19
- });`:"",D=g==="curl"?b:T;let _;e[6]!==j?(_=t.jsx(ot,{children:j}),e[6]=j,e[7]=_):_=e[7];let k;e[8]!==d?(k=t.jsx(at,{children:d}),e[8]=d,e[9]=k):k=e[9];let A;e[10]!==_||e[11]!==k?(A=t.jsxs(st,{children:[_,k]}),e[10]=_,e[11]=k,e[12]=A):A=e[12];let $;e[13]!==h||e[14]!==x||e[15]!==v||e[16]!==S||e[17]!==g||e[18]!==D||e[19]!==m||e[20]!==i||e[21]!==l||e[22]!==a?($=a&&i?t.jsxs("div",{className:"flex flex-col gap-3 min-w-0",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.url")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:S}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(S,"url"),children:[t.jsx(qe,{size:13}),m(x==="url"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.tokenLabel")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:i}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(i,"token"),children:[t.jsx(qe,{size:13}),m(x==="token"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.snippet")}),t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ao,{value:g,onValueChange:W=>u(W),children:t.jsxs(no,{className:"h-8 p-[2px]",children:[t.jsx(vt,{value:"curl",className:"h-7 px-2.5 text-xs",children:"curl"}),t.jsx(vt,{value:"fetch",className:"h-7 px-2.5 text-xs",children:"fetch"})]})}),t.jsxs("label",{htmlFor:l,className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none",children:[t.jsx(Ft,{id:l,checked:h==="url",onCheckedChange:W=>p(W?"url":"header")}),m("automations.webhookSecretDialog.tokenInUrl")]})]}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(D,"example"),children:[t.jsx(qe,{size:13}),m(x==="example"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]}),t.jsx("div",{className:"rounded-md border overflow-hidden min-w-0",children:t.jsx(io,{code:D,language:g==="curl"?"shell":"typescript",readOnly:!0,disableDiagnostics:!0,height:180})})]})]}):null,e[13]=h,e[14]=x,e[15]=v,e[16]=S,e[17]=g,e[18]=D,e[19]=m,e[20]=i,e[21]=l,e[22]=a,e[23]=$):$=e[23];let R;e[24]!==n?(R=()=>n(!1),e[24]=n,e[25]=R):R=e[25];let K;e[26]!==m?(K=m("automations.webhookSecretDialog.done"),e[26]=m,e[27]=K):K=e[27];let F;e[28]!==K||e[29]!==R?(F=t.jsx(nt,{children:t.jsx(B,{onClick:R,children:K})}),e[28]=K,e[29]=R,e[30]=F):F=e[30];let q;e[31]!==F||e[32]!==A||e[33]!==$?(q=t.jsxs(tt,{className:"max-w-lg",children:[A,$,F]}),e[31]=F,e[32]=A,e[33]=$,e[34]=q):q=e[34];let H;return e[35]!==n||e[36]!==s||e[37]!==q?(H=t.jsx(et,{open:s,onOpenChange:n,children:q}),e[35]=n,e[36]=s,e[37]=q,e[38]=H):H=e[38],H}async function Eo(r){const{cronExpression:e,automationId:s,oldTriggerId:n,addTrigger:a,removeTrigger:i}=r,c=await a({automation_id:s,type:"cron",cron_expression:e});try{await i({trigger_id:n,automation_id:s})}catch(o){throw await i({trigger_id:c.id,automation_id:s}).catch(()=>{}),o}}function Xt(r){const e=Z.c(153),{trigger:s,automationId:n,connectionName:a,readOnly:i}=r,c=i===void 0?!1:i,o=ee(),{triggerAdd:j,triggerRemove:d,triggerRotateToken:m}=ve(),[x,f]=w.useState(!1),[g,u]=w.useState(!1),[h,p]=w.useState(null);let l;e[0]!==s.cron_expression?(l=s.cron_expression?To(s.cron_expression):null,e[0]=s.cron_expression,e[1]=l):l=e[1];const y=l,[v,N]=w.useState(y?.count??1),[S,b]=w.useState(!1),[T,D]=w.useState(s.cron_expression??""),_=d.isPending||j.isPending||m.isPending,k=s.type==="cron",A=s.type==="webhook",$=s.type==="board_column_transition";let R;e[2]!==o||e[3]!==s.type?(R=s.type==="board_pr_ready"?o("automations.triggerCard.prReady"):s.type==="linked_chat_run"?o("automations.triggerCard.linkedChatRun"):s.type==="board_pr_merged"?o("automations.triggerCard.prMerged"):s.type==="chat_pr_opened"?o("automations.triggerCard.chatPrOpened"):null,e[2]=o,e[3]=s.type,e[4]=R):R=e[4];const K=R,F=s.type==="jira_transition";let q;e[5]!==n||e[6]!==d||e[7]!==o||e[8]!==s.id?(q=async()=>{try{await d.mutateAsync({trigger_id:s.id,automation_id:n}),X.success(o("automations.triggerCard.starterRemoved"))}catch{X.error(o("automations.triggerCard.failedToRemoveStarter"))}f(!1)},e[5]=n,e[6]=d,e[7]=o,e[8]=s.id,e[9]=q):q=e[9];const H=q;let W;e[10]!==j||e[11]!==n||e[12]!==d||e[13]!==s.id?(W=L=>Eo({cronExpression:L,automationId:n,oldTriggerId:s.id,addTrigger:Fe=>j.mutateAsync(Fe),removeTrigger:Fe=>d.mutateAsync(Fe)}),e[10]=j,e[11]=n,e[12]=d,e[13]=s.id,e[14]=W):W=e[14];const G=W;let J;e[15]!==T||e[16]!==G||e[17]!==o||e[18]!==s.cron_expression?(J=async()=>{const L=T.trim();if(!L||!Re(L)||L===s.cron_expression){b(!1),D(s.cron_expression??"");return}try{await G(L),b(!1)}catch{X.error(o("automations.triggerCard.failedToUpdateStarter")),D(s.cron_expression??""),b(!1)}},e[15]=T,e[16]=G,e[17]=o,e[18]=s.cron_expression,e[19]=J):J=e[19];const V=J;let U;e[20]!==n||e[21]!==m||e[22]!==o||e[23]!==s.id?(U=async()=>{u(!1);try{const L=await m.mutateAsync({trigger_id:s.id,automation_id:n});p({url:L.url,token:L.token})}catch{X.error(o("automations.triggerCard.failedToRotateToken"))}},e[20]=n,e[21]=m,e[22]=o,e[23]=s.id,e[24]=U):U=e[24];const z=U;let ae;e[25]!==y||e[26]!==G||e[27]!==o||e[28]!==s.cron_expression?(ae=async L=>{if(!y)return;const Fe=y.unit==="minutes"?5:1,Je=Math.max(Fe,L);Je!==L&&N(Je);const ft=ko(Je,y.unit);if(ft!==s.cron_expression)try{await G(ft)}catch{X.error(o("automations.triggerCard.failedToUpdateStarter")),N(y.count)}},e[25]=y,e[26]=G,e[27]=o,e[28]=s.cron_expression,e[29]=ae):ae=e[29];const ne=ae;let Q;e[30]!==$||e[31]!==k||e[32]!==F||e[33]!==A||e[34]!==K?(Q=k?t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}):F?t.jsx(Ut,{size:14,className:"shrink-0"}):$||K?t.jsx(zt,{size:14,className:"text-muted-foreground shrink-0"}):A?t.jsx(it,{size:14,className:"text-muted-foreground shrink-0"}):t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),e[30]=$,e[31]=k,e[32]=F,e[33]=A,e[34]=K,e[35]=Q):Q=e[35];let ie;e[36]!==a||e[37]!==v||e[38]!==T||e[39]!==ne||e[40]!==V||e[41]!==y||e[42]!==$||e[43]!==k||e[44]!==S||e[45]!==F||e[46]!==_||e[47]!==A||e[48]!==K||e[49]!==o||e[50]!==s.column_key||e[51]!==s.cron_expression||e[52]!==s.event_type||e[53]!==s.from||e[54]!==s.params?(ie=y&&k?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:o("automations.triggerCard.every")}),t.jsx("input",{type:"number",min:y.unit==="minutes"?5:1,value:v,onChange:L=>N(parseInt(L.target.value)||1),onBlur:()=>ne(v),onKeyDown:L=>{L.key==="Enter"&&L.target.blur(),L.key==="Escape"&&N(y.count)},disabled:_,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:wo(y.unit,v)})]}):k&&S?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:T,onChange:L=>D(L.target.value),onBlur:V,onKeyDown:L=>{L.key==="Enter"&&L.target.blur(),L.key==="Escape"&&(b(!1),D(s.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),T&&!Re(T)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:o("automations.triggerCard.invalid")})]}):t.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[t.jsx("span",{className:"text-sm font-mono text-xs text-muted-foreground truncate",children:k?So(s.cron_expression??""):$?o("automations.triggerCard.cardEntersColumn",{lane:We(s.column_key??"",o).label}):K||(F?o("automations.triggerCard.issueEntersJiraStatus",{status:s.column_key??""}):A?o("automations.triggerCard.webhookPostToFire"):`${s.event_type}${a?` · ${a}`:""}`)}),$&&t.jsx(Ko,{from:s.from}),F&&t.jsx(Fo,{from:s.from}),!k&&!A&&!$&&!K&&!F&&s.params&&Object.keys(s.params).length>0&&t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:Object.entries(s.params).map(Oo).join(", ")})]}),e[36]=a,e[37]=v,e[38]=T,e[39]=ne,e[40]=V,e[41]=y,e[42]=$,e[43]=k,e[44]=S,e[45]=F,e[46]=_,e[47]=A,e[48]=K,e[49]=o,e[50]=s.column_key,e[51]=s.cron_expression,e[52]=s.event_type,e[53]=s.from,e[54]=s.params,e[55]=ie):ie=e[55];let ue;e[56]!==_?(ue=_&&t.jsx(Le,{className:"size-[13px] text-muted-foreground"}),e[56]=_,e[57]=ue):ue=e[57];let me;e[58]!==y||e[59]!==k||e[60]!==S||e[61]!==o||e[62]!==s.cron_expression?(me=k&&!y&&!S&&t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":o("automations.triggerCard.editSchedule"),onClick:()=>{D(s.cron_expression??""),b(!0)},children:t.jsx(Et,{size:13,className:"text-muted-foreground"})}),e[58]=y,e[59]=k,e[60]=S,e[61]=o,e[62]=s.cron_expression,e[63]=me):me=e[63];let te;e[64]!==A||e[65]!==o?(te=A&&t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",title:o("automations.triggerCard.rotateToken"),"aria-label":o("automations.triggerCard.rotateToken"),onClick:()=>u(!0),children:t.jsx(rs,{size:13,className:"text-muted-foreground"})}),e[64]=A,e[65]=o,e[66]=te):te=e[66];let fe;e[67]!==c||e[68]!==o?(fe=!c&&t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":o("automations.triggerCard.removeStarter"),onClick:()=>f(!0),children:t.jsx(mt,{size:13,className:"text-muted-foreground"})}),e[67]=c,e[68]=o,e[69]=fe):fe=e[69];let se;e[70]!==ue||e[71]!==me||e[72]!==te||e[73]!==fe?(se=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[ue,me,te,fe]}),e[70]=ue,e[71]=me,e[72]=te,e[73]=fe,e[74]=se):se=e[74];let re;e[75]!==ie||e[76]!==se||e[77]!==Q?(re=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[Q,ie,se]}),e[75]=ie,e[76]=se,e[77]=Q,e[78]=re):re=e[78];let le;e[79]!==o?(le=o("automations.triggerCard.removeStarter"),e[79]=o,e[80]=le):le=e[80];let C;e[81]!==le?(C=t.jsx(Ct,{children:le}),e[81]=le,e[82]=C):C=e[82];let M;e[83]!==o?(M=o("automations.triggerCard.confirmRemoveStarter"),e[83]=o,e[84]=M):M=e[84];let O;e[85]!==M?(O=t.jsx(Nt,{children:M}),e[85]=M,e[86]=O):O=e[86];let pe;e[87]!==C||e[88]!==O?(pe=t.jsxs(St,{children:[C,O]}),e[87]=C,e[88]=O,e[89]=pe):pe=e[89];let oe;e[90]!==o?(oe=o("automations.triggerCard.cancel"),e[90]=o,e[91]=oe):oe=e[91];let ce;e[92]!==oe?(ce=t.jsx(kt,{children:oe}),e[92]=oe,e[93]=ce):ce=e[93];let de;e[94]!==o?(de=o("automations.triggerCard.remove"),e[94]=o,e[95]=de):de=e[95];let I;e[96]!==H||e[97]!==de?(I=t.jsx(Tt,{onClick:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:de}),e[96]=H,e[97]=de,e[98]=I):I=e[98];let E;e[99]!==ce||e[100]!==I?(E=t.jsxs(wt,{children:[ce,I]}),e[99]=ce,e[100]=I,e[101]=E):E=e[101];let Y;e[102]!==pe||e[103]!==E?(Y=t.jsxs(Dt,{children:[pe,E]}),e[102]=pe,e[103]=E,e[104]=Y):Y=e[104];let P;e[105]!==x||e[106]!==Y?(P=t.jsx(_t,{open:x,onOpenChange:f,children:Y}),e[105]=x,e[106]=Y,e[107]=P):P=e[107];let xe;e[108]!==o?(xe=o("automations.triggerCard.rotateWebhookToken"),e[108]=o,e[109]=xe):xe=e[109];let Ce;e[110]!==xe?(Ce=t.jsx(Ct,{children:xe}),e[110]=xe,e[111]=Ce):Ce=e[111];let Ne;e[112]!==o?(Ne=o("automations.triggerCard.rotateWebhookTokenDescription"),e[112]=o,e[113]=Ne):Ne=e[113];let Se;e[114]!==Ne?(Se=t.jsx(Nt,{children:Ne}),e[114]=Ne,e[115]=Se):Se=e[115];let ke;e[116]!==Ce||e[117]!==Se?(ke=t.jsxs(St,{children:[Ce,Se]}),e[116]=Ce,e[117]=Se,e[118]=ke):ke=e[118];let Te;e[119]!==o?(Te=o("automations.triggerCard.cancel"),e[119]=o,e[120]=Te):Te=e[120];let we;e[121]!==Te?(we=t.jsx(kt,{children:Te}),e[121]=Te,e[122]=we):we=e[122];let De;e[123]!==o?(De=o("automations.triggerCard.rotate"),e[123]=o,e[124]=De):De=e[124];let _e;e[125]!==z||e[126]!==De?(_e=t.jsx(Tt,{onClick:z,children:De}),e[125]=z,e[126]=De,e[127]=_e):_e=e[127];let Ie;e[128]!==we||e[129]!==_e?(Ie=t.jsxs(wt,{children:[we,_e]}),e[128]=we,e[129]=_e,e[130]=Ie):Ie=e[130];let Ae;e[131]!==ke||e[132]!==Ie?(Ae=t.jsxs(Dt,{children:[ke,Ie]}),e[131]=ke,e[132]=Ie,e[133]=Ae):Ae=e[133];let Pe;e[134]!==g||e[135]!==Ae?(Pe=t.jsx(_t,{open:g,onOpenChange:u,children:Ae}),e[134]=g,e[135]=Ae,e[136]=Pe):Pe=e[136];const Be=h!==null;let Ve;e[137]===Symbol.for("react.memo_cache_sentinel")?(Ve=L=>{L||p(null)},e[137]=Ve):Ve=e[137];const Ge=h?.url??null,He=h?.token??null;let $e;e[138]!==o?($e=o("automations.triggerCard.newWebhookToken"),e[138]=o,e[139]=$e):$e=e[139];let ze;e[140]!==o?(ze=o("automations.triggerCard.newWebhookTokenDescription"),e[140]=o,e[141]=ze):ze=e[141];let Ee;e[142]!==Be||e[143]!==Ge||e[144]!==He||e[145]!==$e||e[146]!==ze?(Ee=t.jsx(Jt,{open:Be,onOpenChange:Ve,url:Ge,token:He,title:$e,description:ze}),e[142]=Be,e[143]=Ge,e[144]=He,e[145]=$e,e[146]=ze,e[147]=Ee):Ee=e[147];let Ue;return e[148]!==re||e[149]!==P||e[150]!==Pe||e[151]!==Ee?(Ue=t.jsxs(t.Fragment,{children:[re,P,Pe,Ee]}),e[148]=re,e[149]=P,e[150]=Pe,e[151]=Ee,e[152]=Ue):Ue=e[152],Ue}function Oo(r){const[e,s]=r;return`${e}: ${s}`}function Ko(r){const e=Z.c(10),{from:s}=r,n=ee();let a;e[0]!==s||e[1]!==n?(a=!s||s.kind==="any"?null:s.kind==="earlier"?n("automations.triggerCard.fromEarlier"):s.kind==="later"?n("automations.triggerCard.fromLater"):s.kind==="statuses"?n("automations.triggerCard.fromColumns",{columns:s.statuses.map(m=>We(m,n).label).join(", ")}):null,e[0]=s,e[1]=n,e[2]=a):a=e[2];const i=a;let c;e[3]!==n?(c=n("automations.triggerCard.unownedOnly"),e[3]=n,e[4]=c):c=e[4];let o;e[5]!==i||e[6]!==c?(o=[i,c].filter(Boolean),e[5]=i,e[6]=c,e[7]=o):o=e[7];const j=o.join(" · ");let d;return e[8]!==j?(d=t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:j}),e[8]=j,e[9]=d):d=e[9],d}function Fo(r){const e=Z.c(6),{from:s}=r,n=ee();if(!s||s.kind==="any")return null;let a;e[0]!==s.kind||e[1]!==s.statuses||e[2]!==n?(a=s.kind==="earlier"?n("automations.triggerCard.fromEarlier"):s.kind==="later"?n("automations.triggerCard.fromLater"):s.kind==="statuses"?n("automations.triggerCard.fromColumns",{columns:s.statuses.join(", ")}):null,e[0]=s.kind,e[1]=s.statuses,e[2]=n,e[3]=a):a=e[3];let i;return e[4]!==a?(i=t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:a}),e[4]=a,e[5]=i):i=e[5],i}function Mo(r){const e=Z.c(70),{automationId:s,onDone:n}=r,a=ee();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={binding:"TRIGGER"},e[0]=i):i=e[0];const c=dt(i),[o,j]=w.useState(),[d,m]=w.useState();let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x={},e[1]=x):x=e[1];const[f,g]=w.useState(x),{triggerAdd:u}=ve(),{data:h,isLoading:p}=Os(o);let l,y,v,N,S,b;if(e[2]!==u||e[3]!==s||e[4]!==o||e[5]!==d||e[6]!==p||e[7]!==n||e[8]!==f||e[9]!==a||e[10]!==c||e[11]!==h){const _=h?.find(U=>U.type===d);let k;e[18]!==u||e[19]!==s||e[20]!==o||e[21]!==d||e[22]!==n||e[23]!==f||e[24]!==a?(k=async()=>{if(!(!o||!d))try{await u.mutateAsync({automation_id:s,type:"event",event_type:d,connection_id:o,params:f}),Ke("automation_trigger_added",{automation_id:s,trigger_type:"event",connection_id:o,event_type:d}),X.success(a("automations.eventTriggerForm.successAdded")),n()}catch{X.error(a("automations.eventTriggerForm.errorFailed"))}},e[18]=u,e[19]=s,e[20]=o,e[21]=d,e[22]=n,e[23]=f,e[24]=a,e[25]=k):k=e[25],l=k,y="flex flex-col gap-3 px-3 py-3 rounded-lg border border-border bg-background";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),e[26]=A):A=e[26];let $;e[27]!==a?($=a("automations.eventTriggerForm.title"),e[27]=a,e[28]=$):$=e[28];let R;e[29]!==$?(R=t.jsx("span",{className:"text-sm font-medium",children:$}),e[29]=$,e[30]=R):R=e[30];let K;e[31]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(mt,{size:13}),e[31]=K):K=e[31];let F;e[32]!==n?(F=t.jsx("button",{type:"button",className:"ml-auto shrink-0 p-0.5 text-muted-foreground hover:text-foreground rounded-lg",onClick:n,children:K}),e[32]=n,e[33]=F):F=e[33],e[34]!==R||e[35]!==F?(v=t.jsxs("div",{className:"flex items-center gap-2",children:[A,R,F]}),e[34]=R,e[35]=F,e[36]=v):v=e[36];const q=o??"";let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=U=>{j(U),m(void 0),g({})},e[37]=H):H=e[37];let W;e[38]!==a?(W=a("automations.eventTriggerForm.selectConnectionPlaceholder"),e[38]=a,e[39]=W):W=e[39];let G;e[40]!==W?(G=t.jsx(he,{className:"w-full",children:t.jsx(je,{placeholder:W})}),e[40]=W,e[41]=G):G=e[41];let J;e[42]!==a||e[43]!==c?(J=c.length===0?t.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:a("automations.eventTriggerForm.noConnectionsWithTrigger")}):c.map(Vo),e[42]=a,e[43]=c,e[44]=J):J=e[44];let V;e[45]!==J?(V=t.jsx(ye,{children:J}),e[45]=J,e[46]=V):V=e[46],e[47]!==q||e[48]!==G||e[49]!==V?(N=t.jsxs(ge,{value:q,onValueChange:H,children:[G,V]}),e[47]=q,e[48]=G,e[49]=V,e[50]=N):N=e[50],e[51]!==o||e[52]!==d||e[53]!==p||e[54]!==a||e[55]!==h?(S=o&&t.jsxs(ge,{value:d??"",onValueChange:U=>{m(U),g({})},children:[t.jsx(he,{className:"w-full",children:p?t.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(Le,{className:"size-[13px]"}),a("automations.eventTriggerForm.loadingEvents")]}):t.jsx(je,{placeholder:a("automations.eventTriggerForm.selectEventTypePlaceholder"),children:d??a("automations.eventTriggerForm.selectEventTypePlaceholder")})}),t.jsx(ye,{children:h?.map(Lo)})]}),e[51]=o,e[52]=d,e[53]=p,e[54]=a,e[55]=h,e[56]=S):S=e[56],b=_?.paramsSchema&&Object.keys(_.paramsSchema).length>0&&t.jsx("div",{className:"flex flex-col gap-2",children:Object.entries(_.paramsSchema).map(U=>{const[z,ae]=U;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("label",{className:"text-xs text-muted-foreground",children:[z,ae.description&&t.jsxs("span",{className:"text-muted-foreground/60",children:[" ","— ",ae.description]})]}),ae.enum?t.jsxs(ge,{value:f[z]??"",onValueChange:ne=>g(Q=>({...Q,[z]:ne})),children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{placeholder:a("automations.eventTriggerForm.selectParamPlaceholder",{key:z})})}),t.jsx(ye,{children:ae.enum.map(Ro)})]}):t.jsx("input",{type:"text",value:f[z]??"",onChange:ne=>g(Q=>({...Q,[z]:ne.target.value})),placeholder:ae.description??z,className:"text-sm border border-border rounded-md bg-background px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-ring"})]},z)})}),e[2]=u,e[3]=s,e[4]=o,e[5]=d,e[6]=p,e[7]=n,e[8]=f,e[9]=a,e[10]=c,e[11]=h,e[12]=l,e[13]=y,e[14]=v,e[15]=N,e[16]=S,e[17]=b}else l=e[12],y=e[13],v=e[14],N=e[15],S=e[16],b=e[17];let T;e[57]!==u||e[58]!==o||e[59]!==d||e[60]!==l||e[61]!==a?(T=o&&d&&t.jsx(B,{size:"sm",onClick:l,disabled:u.isPending,children:u.isPending?t.jsx(Le,{className:"size-[13px]"}):a("automations.eventTriggerForm.addTriggerButton")}),e[57]=u,e[58]=o,e[59]=d,e[60]=l,e[61]=a,e[62]=T):T=e[62];let D;return e[63]!==y||e[64]!==v||e[65]!==N||e[66]!==S||e[67]!==b||e[68]!==T?(D=t.jsxs("div",{className:y,children:[v,N,S,b,T]}),e[63]=y,e[64]=v,e[65]=N,e[66]=S,e[67]=b,e[68]=T,e[69]=D):D=e[69],D}function Ro(r){return t.jsx(be,{value:r,children:r},r)}function Lo(r){return t.jsx(be,{value:r.type,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:r.type}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r.description})]})},r.type)}function Vo(r){return t.jsx(be,{value:r.id,children:r.title},r.id)}const Uo=30;function Wo(r,e){switch(e.type){case"accumulate":{const s=r??{start:e.now,fields:new Set,saveCount:0},n=new Set(s.fields);for(const a of e.fields)n.add(a);return{...s,fields:n,saveCount:s.saveCount+1}}case"reset":return null}}function Bo({automationId:r,automation:e,onBack:s,onDelete:n}){const a=ee(),i=e.virtual_mcp_id,{org:c}=$t(),{update:o,triggerAdd:j,run:d}=ve(),m=dt(),x=new Map(m.map(C=>[C.id,C.title])),{openTask:f}=Fs(),{openSidePanel:g}=Js(),{sendMessage:u}=Ms(),h=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[p,l]=w.useState(h),[y,v]=w.useState(!1),[N,S]=w.useState(!1),[b,T]=w.useState(!1),[D,_]=w.useState(""),[k,A]=w.useState(!1),[$,R]=w.useState(null),[K,F]=w.useState(!1),[q,H]=w.useState(!1),[W,G]=w.useState(!1),J=async()=>{if(K)return;const M=Rs(p).filter(O=>O.type==="text").map(O=>O.text).join(`
20
- `);if(M.trim()){F(!0);try{se(),Ke("automation_improve_clicked",{automation_id:r,agent_id:i,instructions_length:M.length}),g(),await u({tiptapDoc:Es({managerAgentId:cs.AUTOMATION_MANAGER(c.id),managerName:"Automation Manager",kind:"automation",id:r,instructions:M})})}finally{F(!1)}}},V=e.models?.tier??"smart",U=e.models?.modelId&&e.models?.credentialId?{modelId:e.models.modelId,credentialId:e.models.credentialId,title:e.models.modelTitle??e.models.modelId}:null,z=ls({defaultValues:{name:e.name,active:e.active,tier:V,modelOverride:U,tools:e.tools??null,maxAgentSteps:e.maxAgentSteps??null}}),ae=z.watch("active"),[ne,Q]=w.useReducer(Wo,null),ie=()=>{ne!==null&&(Ke("automation_updated",{automation_id:r,agent_id:i,fields:Array.from(ne.fields),save_count:ne.saveCount,edit_duration_ms:Date.now()-ne.start}),Q({type:"reset"}))},ue=async()=>{const C=z.control._formState.dirtyFields,M=Object.keys(C);if(M.length===0&&!W)return!0;const O=z.getValues(),pe=z.control._defaultValues;z.reset(O,{keepValues:!0});const oe=W;G(!1);const ce={tier:O.tier,...O.modelOverride?{modelId:O.modelOverride.modelId,credentialId:O.modelOverride.credentialId,modelTitle:O.modelOverride.title}:{}},de={id:r,name:O.name,active:O.active,models:ce,tools:O.tools,maxAgentSteps:O.maxAgentSteps,messages:Ls(p),temperature:0};try{await o.mutateAsync(de)}catch{return z.reset(pe,{keepValues:!0}),oe&&G(!0),!1}const I=[...M];return oe&&I.push("messages"),Q({type:"accumulate",now:Date.now(),fields:I}),fe(),!0},{schedule:me,flush:te}=bt({save:ue}),{schedule:fe,flush:se}=bt({delayMs:3e4,save:async()=>ie()});w.useEffect(()=>{const C=z.watch(()=>me());return()=>C.unsubscribe()},[]);const re=C=>{if(l(C),!q){H(!0);return}G(!0),me()},le=async()=>{Ke("automation_test_clicked",{automation_id:r,agent_id:i});const C=await te();if(se(),!!C){if(!p){X.error(a("automations.automationDetail.noInstructionsConfigured"));return}try{const M=await d.mutateAsync(r);M.threadId&&(g(),f(M.threadId))}catch{}}};return t.jsxs(t.Fragment,{children:[s&&t.jsx("div",{className:"flex items-center pb-4 shrink-0",children:t.jsxs(B,{variant:"ghost",size:"sm",onClick:s,children:[t.jsx(Vt,{size:14}),a("automations.automationDetail.backToList")]})}),t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsx(pt,{control:z.control,name:"name",render:({field:C})=>t.jsx(xt,{...C,placeholder:a("automations.automationDetail.automationNamePlaceholder"),className:"border border-transparent shadow-none px-0 text-lg font-medium h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent flex-1",style:{boxShadow:"none"}})}),n&&t.jsx(B,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:n,children:t.jsx(qs,{size:14})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pt,{control:z.control,name:"active",render:({field:C})=>t.jsx(ct,{checked:C.value,onCheckedChange:M=>{C.onChange(M),te()},className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:a(ae?"automations.automationDetail.active":"automations.automationDetail.inactive")}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx(zs,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:a("automations.automationDetail.starter")}),t.jsx(zo,{automationId:r,open:y,onOpenChange:v,onCustomSelect:()=>{T(!0),A(!1),_("")},onEventSelect:()=>{A(!0),T(!1)},onWebhookCreated:C=>{Ke("automation_trigger_added",{automation_id:r,trigger_type:"webhook"}),R(C)}})]}),e.triggers.length===0&&!b?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:[a("automations.automationDetail.whenShouldRun")," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>v(!0),children:a("automations.automationDetail.addStarter")})," ",a("automations.automationDetail.toGetGoing")]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(C=>t.jsx(Xt,{trigger:C,automationId:r,connectionName:C.connection_id?x.get(C.connection_id):void 0},C.id))}),b&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:D,onChange:C=>_(C.target.value),onBlur:async()=>{const C=D.trim();if(!(!C||!Re(C)))try{await j.mutateAsync({automation_id:r,type:"cron",cron_expression:C}),Ke("automation_trigger_added",{automation_id:r,trigger_type:"cron"}),X.success(a("automations.automationDetail.starterAdded")),T(!1),_("")}catch{X.error(a("automations.automationDetail.failedToAddStarter"))}},onKeyDown:async C=>{const M=D.trim();C.key==="Enter"&&M&&Re(M)&&C.target.blur(),C.key==="Escape"&&(T(!1),_(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),D&&!Re(D)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:a("automations.automationDetail.invalid")}),j.isPending&&t.jsx(Le,{className:"size-[13px] text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity rounded-lg",onClick:()=>{T(!1),_("")},children:t.jsx(mt,{size:13})})]}),k&&t.jsx(w.Suspense,{fallback:t.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 rounded-lg border border-border bg-background",children:[t.jsx(Le,{className:"size-[13px] text-muted-foreground"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:a("automations.automationDetail.loadingConnections")})]}),children:t.jsx(Mo,{automationId:r,onDone:()=>A(!1)})}),t.jsx(Jt,{open:$!==null,onOpenChange:C=>{C||R(null)},url:$?.url??null,token:$?.token??null})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:a("automations.automationDetail.instructions")}),t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",disabled:K||!p,onClick:J,children:[t.jsx(Ot,{size:13}),a("automations.automationDetail.improve")]})]}),t.jsx(Qs,{tiptapDoc:p,setTiptapDoc:re,placeholder:a("automations.automationDetail.instructionsPlaceholder"),children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Ys,{virtualMcpId:i||null,className:"max-h-[45vh]"}),t.jsx("div",{className:"@container/chat-bottom flex items-center justify-end gap-1.5 p-2.5",children:t.jsxs(Bs,{children:[t.jsx(Gs,{asChild:!0,children:t.jsxs(B,{type:"button",variant:"default",className:"h-8 gap-1.5 px-3 text-sm font-medium",onClick:le,disabled:!i,children:[t.jsx(Xs,{size:16}),a("automations.automationDetail.test")]})}),t.jsx(Hs,{children:a("automations.automationDetail.testAutomation")})]})})]})})]}),t.jsxs(Vs,{open:N,onOpenChange:S,className:"flex flex-col gap-2.5",children:[t.jsxs(Us,{className:"group flex w-fit cursor-pointer items-center gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:a("automations.automationDetail.advanced")}),t.jsx(rt,{size:14,className:"text-muted-foreground/60 transition-transform group-data-[state=open]:rotate-180"})]}),t.jsxs(Ws,{className:"flex flex-col gap-5 pt-0.5",children:[t.jsx(fo,{tier:z.watch("tier"),onTierChange:C=>z.setValue("tier",C,{shouldDirty:!0}),override:z.watch("modelOverride"),onOverrideChange:C=>z.setValue("modelOverride",C,{shouldDirty:!0})}),t.jsx(ho,{agentId:i||null,value:z.watch("tools"),onChange:C=>z.setValue("tools",C,{shouldDirty:!0})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:a("automations.automationDetail.maxSteps")}),t.jsx(xt,{type:"number",min:1,max:100,className:"w-40",placeholder:a("automations.automationDetail.maxStepsPlaceholder",{default:Uo}),value:z.watch("maxAgentSteps")??"",onChange:C=>{const M=C.target.value.trim(),O=M===""?null:Number(M);z.setValue("maxAgentSteps",O===null||Number.isNaN(O)?null:O,{shouldDirty:!0})}})]})]})]})]})]})}function Go(r){const e=Z.c(55),{automation:s}=r,n=ee(),{update:a}=ve();let i;e[0]!==s.name?(i=t.jsx("h2",{className:"text-lg font-medium text-foreground",children:s.name}),e[0]=s.name,e[1]=i):i=e[1];let c;e[2]!==n?(c=n("automations.builtin.badge"),e[2]=n,e[3]=c):c=e[3];let o;e[4]!==c?(o=t.jsx(Kt,{variant:"muted",children:c}),e[4]=c,e[5]=o):o=e[5];let j;e[6]!==i||e[7]!==o?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[i,o]}),e[6]=i,e[7]=o,e[8]=j):j=e[8];let d;e[9]!==s.id||e[10]!==a?(d=_=>a.mutate({id:s.id,active:_}),e[9]=s.id,e[10]=a,e[11]=d):d=e[11];let m;e[12]!==s.active||e[13]!==d||e[14]!==a.isPending?(m=t.jsx(ct,{checked:s.active,disabled:a.isPending,onCheckedChange:d,className:"cursor-pointer"}),e[12]=s.active,e[13]=d,e[14]=a.isPending,e[15]=m):m=e[15];let x;e[16]!==s.active||e[17]!==n?(x=s.active?n("automations.automationDetail.active"):n("automations.automationDetail.inactive"),e[16]=s.active,e[17]=n,e[18]=x):x=e[18];let f;e[19]!==x?(f=t.jsx("span",{className:"text-sm text-muted-foreground",children:x}),e[19]=x,e[20]=f):f=e[20];let g;e[21]!==m||e[22]!==f?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[m,f]}),e[21]=m,e[22]=f,e[23]=g):g=e[23];let u;e[24]!==j||e[25]!==g?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[j,g]}),e[24]=j,e[25]=g,e[26]=u):u=e[26];let h;e[27]!==n?(h=n("automations.automationDetail.starter"),e[27]=n,e[28]=h):h=e[28];let p;e[29]!==h?(p=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:h}),e[29]=h,e[30]=p):p=e[30];let l;if(e[31]!==s.id||e[32]!==s.triggers){let _;e[34]!==s.id?(_=k=>t.jsx(Xt,{trigger:k,automationId:s.id,readOnly:!0},k.id),e[34]=s.id,e[35]=_):_=e[35],l=s.triggers.map(_),e[31]=s.id,e[32]=s.triggers,e[33]=l}else l=e[33];let y;e[36]!==p||e[37]!==l?(y=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[p,l]}),e[36]=p,e[37]=l,e[38]=y):y=e[38];let v;e[39]!==n?(v=n("automations.automationDetail.instructions"),e[39]=n,e[40]=v):v=e[40];let N;e[41]!==v?(N=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:v}),e[41]=v,e[42]=N):N=e[42];let S;e[43]!==s.system_key||e[44]!==n?(S=s.system_key==="implementer"?n("automations.builtin.implementerDescription"):s.system_key==="reviewer"?n("automations.builtin.reviewerDescription"):s.system_key==="linked_chats"?n("automations.builtin.linkedChatsDescription"):s.system_key==="pr_merged"?n("automations.builtin.prMergedDescription"):s.system_key==="chat_pr"?n("automations.builtin.chatPrDescription"):n("automations.builtin.description"),e[43]=s.system_key,e[44]=n,e[45]=S):S=e[45];let b;e[46]!==S?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:S}),e[46]=S,e[47]=b):b=e[47];let T;e[48]!==N||e[49]!==b?(T=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[N,b]}),e[48]=N,e[49]=b,e[50]=T):T=e[50];let D;return e[51]!==u||e[52]!==y||e[53]!==T?(D=t.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,T]}),e[51]=u,e[52]=y,e[53]=T,e[54]=D):D=e[54],D}const qt=[{key:"24h",labelKey:"mainPanelTabs.automationTab.last24hours",ms:1440*60*1e3},{key:"7d",labelKey:"mainPanelTabs.automationTab.last7days",ms:10080*60*1e3},{key:"30d",labelKey:"mainPanelTabs.automationTab.last30days",ms:720*60*60*1e3}];function Qt(r){const e=qt.find(n=>n.key===r).ms,s=Date.now();return{startDate:new Date(s-e).toISOString(),endDate:new Date(s).toISOString()}}function Ho(r){const e=Z.c(16),{automationId:s,triggerIds:n}=r,a=ee(),[i,c]=w.useState("30d"),[o,j]=w.useState(Jo);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=p=>{const l=p;c(l),j(Qt(l))},e[0]=d):d=e[0];let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(he,{className:"w-44",children:t.jsx(je,{})}),e[1]=m):m=e[1];let x;e[2]!==a?(x=qt.map(p=>t.jsx(be,{value:p.key,children:a(p.labelKey)},p.key)),e[2]=a,e[3]=x):x=e[3];let f;e[4]!==x?(f=t.jsx(ye,{children:x}),e[4]=x,e[5]=f):f=e[5];let g;e[6]!==f||e[7]!==i?(g=t.jsx("div",{className:"flex items-center justify-end",children:t.jsxs(ge,{value:i,onValueChange:d,children:[m,f]})}),e[6]=f,e[7]=i,e[8]=g):g=e[8];let u;e[9]!==s||e[10]!==o||e[11]!==n?(u=t.jsx(ro,{automationId:s,triggerIds:n,range:o}),e[9]=s,e[10]=o,e[11]=n,e[12]=u):u=e[12];let h;return e[13]!==g||e[14]!==u?(h=t.jsxs("div",{className:"flex flex-col gap-5",children:[g,u]}),e[13]=g,e[14]=u,e[15]=h):h=e[15],h}function Jo(){return Qt("30d")}function Xo(r){const e=Z.c(5),{tabId:s}=r;let n;e[0]!==s?(n=ds(s),e[0]=s,e[1]=n):n=e[1];const a=n;if(!a)return null;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ye,{}),e[2]=i):i=e[2];let c;return e[3]!==a.id?(c=t.jsx(w.Suspense,{fallback:i,children:t.jsx(qo,{id:a.id})}),e[3]=a.id,e[4]=c):c=e[4],c}function qo(r){const e=Z.c(41),{id:s}=r,n=ee(),{openPanel:a}=co(),{data:i,isLoading:c}=Ks(s),[o,j]=w.useState("settings");let d;e[0]!==a?(d=()=>a("automations"),e[0]=a,e[1]=d):d=e[1];const m=d;if(c){let k;return e[2]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ye,{}),e[2]=k):k=e[2],k}if(!i){let k;e[3]!==n?(k=n("mainPanelTabs.automationTab.automationNotFound"),e[3]=n,e[4]=k):k=e[4];let A;return e[5]!==k?(A=t.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:k}),e[5]=k,e[6]=A):A=e[6],A}let x;e[7]!==i.triggers?(x=i.triggers.map(Qo),e[7]=i.triggers,e[8]=x):x=e[8];const f=x;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Vt,{size:14}),e[9]=g):g=e[9];let u;e[10]!==n?(u=n("mainPanelTabs.automationTab.backToList"),e[10]=n,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs(B,{variant:"ghost",size:"sm",onClick:m,children:[g,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let p;e[15]!==n?(p=n("mainPanelTabs.automationTab.settings"),e[15]=n,e[16]=p):p=e[16];let l;e[17]!==p?(l={id:"settings",label:p},e[17]=p,e[18]=l):l=e[18];let y;e[19]!==n?(y=n("mainPanelTabs.automationTab.runs"),e[19]=n,e[20]=y):y=e[20];let v;e[21]!==y?(v={id:"runs",label:y},e[21]=y,e[22]=v):v=e[22];let N;e[23]!==l||e[24]!==v?(N=[l,v],e[23]=l,e[24]=v,e[25]=N):N=e[25];let S;e[26]===Symbol.for("react.memo_cache_sentinel")?(S=k=>j(k),e[26]=S):S=e[26];let b;e[27]!==N||e[28]!==o?(b=t.jsx(lo,{placement:"page",tabs:N,activeTab:o,onTabChange:S}),e[27]=N,e[28]=o,e[29]=b):b=e[29];let T;e[30]!==b||e[31]!==h?(T=t.jsxs("div",{className:"flex items-center justify-between pb-4 shrink-0",children:[h,b]}),e[30]=b,e[31]=h,e[32]=T):T=e[32];let D;e[33]!==i||e[34]!==s||e[35]!==o||e[36]!==f?(D=o==="settings"?i.system_key?t.jsx(Go,{automation:i}):t.jsx(Bo,{automationId:s,automation:i}):t.jsx(w.Suspense,{fallback:t.jsx(Ye,{}),children:t.jsx(Ho,{automationId:s,triggerIds:f})}),e[33]=i,e[34]=s,e[35]=o,e[36]=f,e[37]=D):D=e[37];let _;return e[38]!==T||e[39]!==D?(_=t.jsx(Xe,{children:t.jsx(Xe.Content,{children:t.jsxs(Xe.Container,{children:[T,D]})})}),e[38]=T,e[39]=D,e[40]=_):_=e[40],_}function Qo(r){return r.id}function Yo(){const r=Z.c(3);let e;r[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},r[0]=e):e=r[0];const{automationId:s}=ms(e);let n;return r[1]!==s?(n=s?t.jsx(Xo,{tabId:`automation:${s}`}):null,r[1]=s,r[2]=n):n=r[2],n}function wi(){const r=Z.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(us.Content,{children:t.jsx(Yo,{})}),r[0]=e):e=r[0],e}export{wi as default};
19
+ });`:"",D=g==="curl"?b:T;let _;e[6]!==j?(_=t.jsx(ot,{children:j}),e[6]=j,e[7]=_):_=e[7];let k;e[8]!==d?(k=t.jsx(at,{children:d}),e[8]=d,e[9]=k):k=e[9];let A;e[10]!==_||e[11]!==k?(A=t.jsxs(st,{children:[_,k]}),e[10]=_,e[11]=k,e[12]=A):A=e[12];let $;e[13]!==h||e[14]!==x||e[15]!==v||e[16]!==S||e[17]!==g||e[18]!==D||e[19]!==m||e[20]!==i||e[21]!==l||e[22]!==a?($=a&&i?t.jsxs("div",{className:"flex flex-col gap-3 min-w-0",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.url")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:S}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(S,"url"),children:[t.jsx(qe,{size:13}),m(x==="url"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.tokenLabel")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:i}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(i,"token"),children:[t.jsx(qe,{size:13}),m(x==="token"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.snippet")}),t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ao,{value:g,onValueChange:W=>u(W),children:t.jsxs(no,{className:"h-8 p-[2px]",children:[t.jsx(vt,{value:"curl",className:"h-7 px-2.5 text-xs",children:"curl"}),t.jsx(vt,{value:"fetch",className:"h-7 px-2.5 text-xs",children:"fetch"})]})}),t.jsxs("label",{htmlFor:l,className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none",children:[t.jsx(Ft,{id:l,checked:h==="url",onCheckedChange:W=>p(W?"url":"header")}),m("automations.webhookSecretDialog.tokenInUrl")]})]}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(D,"example"),children:[t.jsx(qe,{size:13}),m(x==="example"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]}),t.jsx("div",{className:"rounded-md border overflow-hidden min-w-0",children:t.jsx(io,{code:D,language:g==="curl"?"shell":"typescript",readOnly:!0,disableDiagnostics:!0,height:180})})]})]}):null,e[13]=h,e[14]=x,e[15]=v,e[16]=S,e[17]=g,e[18]=D,e[19]=m,e[20]=i,e[21]=l,e[22]=a,e[23]=$):$=e[23];let R;e[24]!==n?(R=()=>n(!1),e[24]=n,e[25]=R):R=e[25];let K;e[26]!==m?(K=m("automations.webhookSecretDialog.done"),e[26]=m,e[27]=K):K=e[27];let F;e[28]!==K||e[29]!==R?(F=t.jsx(nt,{children:t.jsx(B,{onClick:R,children:K})}),e[28]=K,e[29]=R,e[30]=F):F=e[30];let q;e[31]!==F||e[32]!==A||e[33]!==$?(q=t.jsxs(tt,{className:"max-w-lg",children:[A,$,F]}),e[31]=F,e[32]=A,e[33]=$,e[34]=q):q=e[34];let H;return e[35]!==n||e[36]!==s||e[37]!==q?(H=t.jsx(et,{open:s,onOpenChange:n,children:q}),e[35]=n,e[36]=s,e[37]=q,e[38]=H):H=e[38],H}async function Eo(r){const{cronExpression:e,automationId:s,oldTriggerId:n,addTrigger:a,removeTrigger:i}=r,c=await a({automation_id:s,type:"cron",cron_expression:e});try{await i({trigger_id:n,automation_id:s})}catch(o){throw await i({trigger_id:c.id,automation_id:s}).catch(()=>{}),o}}function Xt(r){const e=Z.c(153),{trigger:s,automationId:n,connectionName:a,readOnly:i}=r,c=i===void 0?!1:i,o=ee(),{triggerAdd:j,triggerRemove:d,triggerRotateToken:m}=ve(),[x,f]=w.useState(!1),[g,u]=w.useState(!1),[h,p]=w.useState(null);let l;e[0]!==s.cron_expression?(l=s.cron_expression?To(s.cron_expression):null,e[0]=s.cron_expression,e[1]=l):l=e[1];const y=l,[v,N]=w.useState(y?.count??1),[S,b]=w.useState(!1),[T,D]=w.useState(s.cron_expression??""),_=d.isPending||j.isPending||m.isPending,k=s.type==="cron",A=s.type==="webhook",$=s.type==="board_column_transition";let R;e[2]!==o||e[3]!==s.type?(R=s.type==="board_pr_ready"?o("automations.triggerCard.prReady"):s.type==="linked_chat_run"?o("automations.triggerCard.linkedChatRun"):s.type==="board_pr_merged"?o("automations.triggerCard.prMerged"):s.type==="chat_pr_opened"?o("automations.triggerCard.chatPrOpened"):null,e[2]=o,e[3]=s.type,e[4]=R):R=e[4];const K=R,F=s.type==="jira_transition";let q;e[5]!==n||e[6]!==d||e[7]!==o||e[8]!==s.id?(q=async()=>{try{await d.mutateAsync({trigger_id:s.id,automation_id:n}),X.success(o("automations.triggerCard.starterRemoved"))}catch{X.error(o("automations.triggerCard.failedToRemoveStarter"))}f(!1)},e[5]=n,e[6]=d,e[7]=o,e[8]=s.id,e[9]=q):q=e[9];const H=q;let W;e[10]!==j||e[11]!==n||e[12]!==d||e[13]!==s.id?(W=L=>Eo({cronExpression:L,automationId:n,oldTriggerId:s.id,addTrigger:Fe=>j.mutateAsync(Fe),removeTrigger:Fe=>d.mutateAsync(Fe)}),e[10]=j,e[11]=n,e[12]=d,e[13]=s.id,e[14]=W):W=e[14];const G=W;let J;e[15]!==T||e[16]!==G||e[17]!==o||e[18]!==s.cron_expression?(J=async()=>{const L=T.trim();if(!L||!Re(L)||L===s.cron_expression){b(!1),D(s.cron_expression??"");return}try{await G(L),b(!1)}catch{X.error(o("automations.triggerCard.failedToUpdateStarter")),D(s.cron_expression??""),b(!1)}},e[15]=T,e[16]=G,e[17]=o,e[18]=s.cron_expression,e[19]=J):J=e[19];const U=J;let V;e[20]!==n||e[21]!==m||e[22]!==o||e[23]!==s.id?(V=async()=>{u(!1);try{const L=await m.mutateAsync({trigger_id:s.id,automation_id:n});p({url:L.url,token:L.token})}catch{X.error(o("automations.triggerCard.failedToRotateToken"))}},e[20]=n,e[21]=m,e[22]=o,e[23]=s.id,e[24]=V):V=e[24];const z=V;let ae;e[25]!==y||e[26]!==G||e[27]!==o||e[28]!==s.cron_expression?(ae=async L=>{if(!y)return;const Fe=y.unit==="minutes"?5:1,Je=Math.max(Fe,L);Je!==L&&N(Je);const ft=ko(Je,y.unit);if(ft!==s.cron_expression)try{await G(ft)}catch{X.error(o("automations.triggerCard.failedToUpdateStarter")),N(y.count)}},e[25]=y,e[26]=G,e[27]=o,e[28]=s.cron_expression,e[29]=ae):ae=e[29];const ne=ae;let Q;e[30]!==$||e[31]!==k||e[32]!==F||e[33]!==A||e[34]!==K?(Q=k?t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}):F?t.jsx(Vt,{size:14,className:"shrink-0"}):$||K?t.jsx(zt,{size:14,className:"text-muted-foreground shrink-0"}):A?t.jsx(it,{size:14,className:"text-muted-foreground shrink-0"}):t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),e[30]=$,e[31]=k,e[32]=F,e[33]=A,e[34]=K,e[35]=Q):Q=e[35];let ie;e[36]!==a||e[37]!==v||e[38]!==T||e[39]!==ne||e[40]!==U||e[41]!==y||e[42]!==$||e[43]!==k||e[44]!==S||e[45]!==F||e[46]!==_||e[47]!==A||e[48]!==K||e[49]!==o||e[50]!==s.column_key||e[51]!==s.cron_expression||e[52]!==s.event_type||e[53]!==s.from||e[54]!==s.params?(ie=y&&k?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:o("automations.triggerCard.every")}),t.jsx("input",{type:"number",min:y.unit==="minutes"?5:1,value:v,onChange:L=>N(parseInt(L.target.value)||1),onBlur:()=>ne(v),onKeyDown:L=>{L.key==="Enter"&&L.target.blur(),L.key==="Escape"&&N(y.count)},disabled:_,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:wo(y.unit,v)})]}):k&&S?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:T,onChange:L=>D(L.target.value),onBlur:U,onKeyDown:L=>{L.key==="Enter"&&L.target.blur(),L.key==="Escape"&&(b(!1),D(s.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),T&&!Re(T)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:o("automations.triggerCard.invalid")})]}):t.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[t.jsx("span",{className:"text-sm font-mono text-xs text-muted-foreground truncate",children:k?So(s.cron_expression??""):$?o("automations.triggerCard.cardEntersColumn",{lane:We(s.column_key??"",o).label}):K||(F?o("automations.triggerCard.issueEntersJiraStatus",{status:s.column_key??""}):A?o("automations.triggerCard.webhookPostToFire"):`${s.event_type}${a?` · ${a}`:""}`)}),$&&t.jsx(Ko,{from:s.from}),F&&t.jsx(Fo,{from:s.from}),!k&&!A&&!$&&!K&&!F&&s.params&&Object.keys(s.params).length>0&&t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:Object.entries(s.params).map(Oo).join(", ")})]}),e[36]=a,e[37]=v,e[38]=T,e[39]=ne,e[40]=U,e[41]=y,e[42]=$,e[43]=k,e[44]=S,e[45]=F,e[46]=_,e[47]=A,e[48]=K,e[49]=o,e[50]=s.column_key,e[51]=s.cron_expression,e[52]=s.event_type,e[53]=s.from,e[54]=s.params,e[55]=ie):ie=e[55];let ue;e[56]!==_?(ue=_&&t.jsx(Le,{className:"size-[13px] text-muted-foreground"}),e[56]=_,e[57]=ue):ue=e[57];let me;e[58]!==y||e[59]!==k||e[60]!==S||e[61]!==o||e[62]!==s.cron_expression?(me=k&&!y&&!S&&t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":o("automations.triggerCard.editSchedule"),onClick:()=>{D(s.cron_expression??""),b(!0)},children:t.jsx(Et,{size:13,className:"text-muted-foreground"})}),e[58]=y,e[59]=k,e[60]=S,e[61]=o,e[62]=s.cron_expression,e[63]=me):me=e[63];let te;e[64]!==A||e[65]!==o?(te=A&&t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",title:o("automations.triggerCard.rotateToken"),"aria-label":o("automations.triggerCard.rotateToken"),onClick:()=>u(!0),children:t.jsx(rs,{size:13,className:"text-muted-foreground"})}),e[64]=A,e[65]=o,e[66]=te):te=e[66];let fe;e[67]!==c||e[68]!==o?(fe=!c&&t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":o("automations.triggerCard.removeStarter"),onClick:()=>f(!0),children:t.jsx(mt,{size:13,className:"text-muted-foreground"})}),e[67]=c,e[68]=o,e[69]=fe):fe=e[69];let se;e[70]!==ue||e[71]!==me||e[72]!==te||e[73]!==fe?(se=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[ue,me,te,fe]}),e[70]=ue,e[71]=me,e[72]=te,e[73]=fe,e[74]=se):se=e[74];let re;e[75]!==ie||e[76]!==se||e[77]!==Q?(re=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[Q,ie,se]}),e[75]=ie,e[76]=se,e[77]=Q,e[78]=re):re=e[78];let le;e[79]!==o?(le=o("automations.triggerCard.removeStarter"),e[79]=o,e[80]=le):le=e[80];let C;e[81]!==le?(C=t.jsx(Ct,{children:le}),e[81]=le,e[82]=C):C=e[82];let M;e[83]!==o?(M=o("automations.triggerCard.confirmRemoveStarter"),e[83]=o,e[84]=M):M=e[84];let O;e[85]!==M?(O=t.jsx(Nt,{children:M}),e[85]=M,e[86]=O):O=e[86];let pe;e[87]!==C||e[88]!==O?(pe=t.jsxs(St,{children:[C,O]}),e[87]=C,e[88]=O,e[89]=pe):pe=e[89];let oe;e[90]!==o?(oe=o("automations.triggerCard.cancel"),e[90]=o,e[91]=oe):oe=e[91];let ce;e[92]!==oe?(ce=t.jsx(kt,{children:oe}),e[92]=oe,e[93]=ce):ce=e[93];let de;e[94]!==o?(de=o("automations.triggerCard.remove"),e[94]=o,e[95]=de):de=e[95];let I;e[96]!==H||e[97]!==de?(I=t.jsx(Tt,{onClick:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:de}),e[96]=H,e[97]=de,e[98]=I):I=e[98];let E;e[99]!==ce||e[100]!==I?(E=t.jsxs(wt,{children:[ce,I]}),e[99]=ce,e[100]=I,e[101]=E):E=e[101];let Y;e[102]!==pe||e[103]!==E?(Y=t.jsxs(Dt,{children:[pe,E]}),e[102]=pe,e[103]=E,e[104]=Y):Y=e[104];let P;e[105]!==x||e[106]!==Y?(P=t.jsx(_t,{open:x,onOpenChange:f,children:Y}),e[105]=x,e[106]=Y,e[107]=P):P=e[107];let xe;e[108]!==o?(xe=o("automations.triggerCard.rotateWebhookToken"),e[108]=o,e[109]=xe):xe=e[109];let Ce;e[110]!==xe?(Ce=t.jsx(Ct,{children:xe}),e[110]=xe,e[111]=Ce):Ce=e[111];let Ne;e[112]!==o?(Ne=o("automations.triggerCard.rotateWebhookTokenDescription"),e[112]=o,e[113]=Ne):Ne=e[113];let Se;e[114]!==Ne?(Se=t.jsx(Nt,{children:Ne}),e[114]=Ne,e[115]=Se):Se=e[115];let ke;e[116]!==Ce||e[117]!==Se?(ke=t.jsxs(St,{children:[Ce,Se]}),e[116]=Ce,e[117]=Se,e[118]=ke):ke=e[118];let Te;e[119]!==o?(Te=o("automations.triggerCard.cancel"),e[119]=o,e[120]=Te):Te=e[120];let we;e[121]!==Te?(we=t.jsx(kt,{children:Te}),e[121]=Te,e[122]=we):we=e[122];let De;e[123]!==o?(De=o("automations.triggerCard.rotate"),e[123]=o,e[124]=De):De=e[124];let _e;e[125]!==z||e[126]!==De?(_e=t.jsx(Tt,{onClick:z,children:De}),e[125]=z,e[126]=De,e[127]=_e):_e=e[127];let Ie;e[128]!==we||e[129]!==_e?(Ie=t.jsxs(wt,{children:[we,_e]}),e[128]=we,e[129]=_e,e[130]=Ie):Ie=e[130];let Ae;e[131]!==ke||e[132]!==Ie?(Ae=t.jsxs(Dt,{children:[ke,Ie]}),e[131]=ke,e[132]=Ie,e[133]=Ae):Ae=e[133];let Pe;e[134]!==g||e[135]!==Ae?(Pe=t.jsx(_t,{open:g,onOpenChange:u,children:Ae}),e[134]=g,e[135]=Ae,e[136]=Pe):Pe=e[136];const Be=h!==null;let Ue;e[137]===Symbol.for("react.memo_cache_sentinel")?(Ue=L=>{L||p(null)},e[137]=Ue):Ue=e[137];const Ge=h?.url??null,He=h?.token??null;let $e;e[138]!==o?($e=o("automations.triggerCard.newWebhookToken"),e[138]=o,e[139]=$e):$e=e[139];let ze;e[140]!==o?(ze=o("automations.triggerCard.newWebhookTokenDescription"),e[140]=o,e[141]=ze):ze=e[141];let Ee;e[142]!==Be||e[143]!==Ge||e[144]!==He||e[145]!==$e||e[146]!==ze?(Ee=t.jsx(Jt,{open:Be,onOpenChange:Ue,url:Ge,token:He,title:$e,description:ze}),e[142]=Be,e[143]=Ge,e[144]=He,e[145]=$e,e[146]=ze,e[147]=Ee):Ee=e[147];let Ve;return e[148]!==re||e[149]!==P||e[150]!==Pe||e[151]!==Ee?(Ve=t.jsxs(t.Fragment,{children:[re,P,Pe,Ee]}),e[148]=re,e[149]=P,e[150]=Pe,e[151]=Ee,e[152]=Ve):Ve=e[152],Ve}function Oo(r){const[e,s]=r;return`${e}: ${s}`}function Ko(r){const e=Z.c(10),{from:s}=r,n=ee();let a;e[0]!==s||e[1]!==n?(a=!s||s.kind==="any"?null:s.kind==="earlier"?n("automations.triggerCard.fromEarlier"):s.kind==="later"?n("automations.triggerCard.fromLater"):s.kind==="statuses"?n("automations.triggerCard.fromColumns",{columns:s.statuses.map(m=>We(m,n).label).join(", ")}):null,e[0]=s,e[1]=n,e[2]=a):a=e[2];const i=a;let c;e[3]!==n?(c=n("automations.triggerCard.unownedOnly"),e[3]=n,e[4]=c):c=e[4];let o;e[5]!==i||e[6]!==c?(o=[i,c].filter(Boolean),e[5]=i,e[6]=c,e[7]=o):o=e[7];const j=o.join(" · ");let d;return e[8]!==j?(d=t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:j}),e[8]=j,e[9]=d):d=e[9],d}function Fo(r){const e=Z.c(6),{from:s}=r,n=ee();if(!s||s.kind==="any")return null;let a;e[0]!==s.kind||e[1]!==s.statuses||e[2]!==n?(a=s.kind==="earlier"?n("automations.triggerCard.fromEarlier"):s.kind==="later"?n("automations.triggerCard.fromLater"):s.kind==="statuses"?n("automations.triggerCard.fromColumns",{columns:s.statuses.join(", ")}):null,e[0]=s.kind,e[1]=s.statuses,e[2]=n,e[3]=a):a=e[3];let i;return e[4]!==a?(i=t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:a}),e[4]=a,e[5]=i):i=e[5],i}function Mo(r){const e=Z.c(70),{automationId:s,onDone:n}=r,a=ee();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={binding:"TRIGGER"},e[0]=i):i=e[0];const c=dt(i),[o,j]=w.useState(),[d,m]=w.useState();let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x={},e[1]=x):x=e[1];const[f,g]=w.useState(x),{triggerAdd:u}=ve(),{data:h,isLoading:p}=Os(o);let l,y,v,N,S,b;if(e[2]!==u||e[3]!==s||e[4]!==o||e[5]!==d||e[6]!==p||e[7]!==n||e[8]!==f||e[9]!==a||e[10]!==c||e[11]!==h){const _=h?.find(V=>V.type===d);let k;e[18]!==u||e[19]!==s||e[20]!==o||e[21]!==d||e[22]!==n||e[23]!==f||e[24]!==a?(k=async()=>{if(!(!o||!d))try{await u.mutateAsync({automation_id:s,type:"event",event_type:d,connection_id:o,params:f}),Ke("automation_trigger_added",{automation_id:s,trigger_type:"event",connection_id:o,event_type:d}),X.success(a("automations.eventTriggerForm.successAdded")),n()}catch{X.error(a("automations.eventTriggerForm.errorFailed"))}},e[18]=u,e[19]=s,e[20]=o,e[21]=d,e[22]=n,e[23]=f,e[24]=a,e[25]=k):k=e[25],l=k,y="flex flex-col gap-3 px-3 py-3 rounded-lg border border-border bg-background";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),e[26]=A):A=e[26];let $;e[27]!==a?($=a("automations.eventTriggerForm.title"),e[27]=a,e[28]=$):$=e[28];let R;e[29]!==$?(R=t.jsx("span",{className:"text-sm font-medium",children:$}),e[29]=$,e[30]=R):R=e[30];let K;e[31]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(mt,{size:13}),e[31]=K):K=e[31];let F;e[32]!==n?(F=t.jsx("button",{type:"button",className:"ml-auto shrink-0 p-0.5 text-muted-foreground hover:text-foreground rounded-lg",onClick:n,children:K}),e[32]=n,e[33]=F):F=e[33],e[34]!==R||e[35]!==F?(v=t.jsxs("div",{className:"flex items-center gap-2",children:[A,R,F]}),e[34]=R,e[35]=F,e[36]=v):v=e[36];const q=o??"";let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=V=>{j(V),m(void 0),g({})},e[37]=H):H=e[37];let W;e[38]!==a?(W=a("automations.eventTriggerForm.selectConnectionPlaceholder"),e[38]=a,e[39]=W):W=e[39];let G;e[40]!==W?(G=t.jsx(he,{className:"w-full",children:t.jsx(je,{placeholder:W})}),e[40]=W,e[41]=G):G=e[41];let J;e[42]!==a||e[43]!==c?(J=c.length===0?t.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:a("automations.eventTriggerForm.noConnectionsWithTrigger")}):c.map(Uo),e[42]=a,e[43]=c,e[44]=J):J=e[44];let U;e[45]!==J?(U=t.jsx(ye,{children:J}),e[45]=J,e[46]=U):U=e[46],e[47]!==q||e[48]!==G||e[49]!==U?(N=t.jsxs(ge,{value:q,onValueChange:H,children:[G,U]}),e[47]=q,e[48]=G,e[49]=U,e[50]=N):N=e[50],e[51]!==o||e[52]!==d||e[53]!==p||e[54]!==a||e[55]!==h?(S=o&&t.jsxs(ge,{value:d??"",onValueChange:V=>{m(V),g({})},children:[t.jsx(he,{className:"w-full",children:p?t.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(Le,{className:"size-[13px]"}),a("automations.eventTriggerForm.loadingEvents")]}):t.jsx(je,{placeholder:a("automations.eventTriggerForm.selectEventTypePlaceholder"),children:d??a("automations.eventTriggerForm.selectEventTypePlaceholder")})}),t.jsx(ye,{children:h?.map(Lo)})]}),e[51]=o,e[52]=d,e[53]=p,e[54]=a,e[55]=h,e[56]=S):S=e[56],b=_?.paramsSchema&&Object.keys(_.paramsSchema).length>0&&t.jsx("div",{className:"flex flex-col gap-2",children:Object.entries(_.paramsSchema).map(V=>{const[z,ae]=V;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("label",{className:"text-xs text-muted-foreground",children:[z,ae.description&&t.jsxs("span",{className:"text-muted-foreground/60",children:[" ","— ",ae.description]})]}),ae.enum?t.jsxs(ge,{value:f[z]??"",onValueChange:ne=>g(Q=>({...Q,[z]:ne})),children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{placeholder:a("automations.eventTriggerForm.selectParamPlaceholder",{key:z})})}),t.jsx(ye,{children:ae.enum.map(Ro)})]}):t.jsx("input",{type:"text",value:f[z]??"",onChange:ne=>g(Q=>({...Q,[z]:ne.target.value})),placeholder:ae.description??z,className:"text-sm border border-border rounded-md bg-background px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-ring"})]},z)})}),e[2]=u,e[3]=s,e[4]=o,e[5]=d,e[6]=p,e[7]=n,e[8]=f,e[9]=a,e[10]=c,e[11]=h,e[12]=l,e[13]=y,e[14]=v,e[15]=N,e[16]=S,e[17]=b}else l=e[12],y=e[13],v=e[14],N=e[15],S=e[16],b=e[17];let T;e[57]!==u||e[58]!==o||e[59]!==d||e[60]!==l||e[61]!==a?(T=o&&d&&t.jsx(B,{size:"sm",onClick:l,disabled:u.isPending,children:u.isPending?t.jsx(Le,{className:"size-[13px]"}):a("automations.eventTriggerForm.addTriggerButton")}),e[57]=u,e[58]=o,e[59]=d,e[60]=l,e[61]=a,e[62]=T):T=e[62];let D;return e[63]!==y||e[64]!==v||e[65]!==N||e[66]!==S||e[67]!==b||e[68]!==T?(D=t.jsxs("div",{className:y,children:[v,N,S,b,T]}),e[63]=y,e[64]=v,e[65]=N,e[66]=S,e[67]=b,e[68]=T,e[69]=D):D=e[69],D}function Ro(r){return t.jsx(be,{value:r,children:r},r)}function Lo(r){return t.jsx(be,{value:r.type,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:r.type}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r.description})]})},r.type)}function Uo(r){return t.jsx(be,{value:r.id,children:r.title},r.id)}const Vo=30;function Wo(r,e){switch(e.type){case"accumulate":{const s=r??{start:e.now,fields:new Set,saveCount:0},n=new Set(s.fields);for(const a of e.fields)n.add(a);return{...s,fields:n,saveCount:s.saveCount+1}}case"reset":return null}}function Bo({automationId:r,automation:e,onBack:s,onDelete:n}){const a=ee(),i=e.virtual_mcp_id,{org:c}=$t(),{update:o,triggerAdd:j,run:d}=ve(),m=dt(),x=new Map(m.map(C=>[C.id,C.title])),{openTask:f}=Fs(),{openSidePanel:g}=Js(),{sendMessage:u}=Ms(),h=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[p,l]=w.useState(h),[y,v]=w.useState(!1),[N,S]=w.useState(!1),[b,T]=w.useState(!1),[D,_]=w.useState(""),[k,A]=w.useState(!1),[$,R]=w.useState(null),[K,F]=w.useState(!1),[q,H]=w.useState(!1),[W,G]=w.useState(!1),J=async()=>{if(K)return;const M=Rs(p).filter(O=>O.type==="text").map(O=>O.text).join(`
20
+ `);if(M.trim()){F(!0);try{se(),Ke("automation_improve_clicked",{automation_id:r,agent_id:i,instructions_length:M.length}),g(),await u({tiptapDoc:Es({managerAgentId:cs.AUTOMATION_MANAGER(c.id),managerName:"Automation Manager",kind:"automation",id:r,instructions:M})})}finally{F(!1)}}},U=e.models?.tier??"smart",V=e.models?.modelId&&e.models?.credentialId?{modelId:e.models.modelId,credentialId:e.models.credentialId,title:e.models.modelTitle??e.models.modelId}:null,z=ls({defaultValues:{name:e.name,active:e.active,tier:U,modelOverride:V,tools:e.tools??null,maxAgentSteps:e.maxAgentSteps??null}}),ae=z.watch("active"),[ne,Q]=w.useReducer(Wo,null),ie=()=>{ne!==null&&(Ke("automation_updated",{automation_id:r,agent_id:i,fields:Array.from(ne.fields),save_count:ne.saveCount,edit_duration_ms:Date.now()-ne.start}),Q({type:"reset"}))},ue=async()=>{const C=z.control._formState.dirtyFields,M=Object.keys(C);if(M.length===0&&!W)return!0;const O=z.getValues(),pe=z.control._defaultValues;z.reset(O,{keepValues:!0});const oe=W;G(!1);const ce={tier:O.tier,...O.modelOverride?{modelId:O.modelOverride.modelId,credentialId:O.modelOverride.credentialId,modelTitle:O.modelOverride.title}:{}},de={id:r,name:O.name,active:O.active,models:ce,tools:O.tools,maxAgentSteps:O.maxAgentSteps,messages:Ls(p),temperature:0};try{await o.mutateAsync(de)}catch{return z.reset(pe,{keepValues:!0}),oe&&G(!0),!1}const I=[...M];return oe&&I.push("messages"),Q({type:"accumulate",now:Date.now(),fields:I}),fe(),!0},{schedule:me,flush:te}=bt({save:ue}),{schedule:fe,flush:se}=bt({delayMs:3e4,save:async()=>ie()});w.useEffect(()=>{const C=z.watch(()=>me());return()=>C.unsubscribe()},[]);const re=C=>{if(l(C),!q){H(!0);return}G(!0),me()},le=async()=>{Ke("automation_test_clicked",{automation_id:r,agent_id:i});const C=await te();if(se(),!!C){if(!p){X.error(a("automations.automationDetail.noInstructionsConfigured"));return}try{const M=await d.mutateAsync(r);M.threadId&&(g(),f(M.threadId))}catch{}}};return t.jsxs(t.Fragment,{children:[s&&t.jsx("div",{className:"flex items-center pb-4 shrink-0",children:t.jsxs(B,{variant:"ghost",size:"sm",onClick:s,children:[t.jsx(Ut,{size:14}),a("automations.automationDetail.backToList")]})}),t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsx(pt,{control:z.control,name:"name",render:({field:C})=>t.jsx(xt,{...C,placeholder:a("automations.automationDetail.automationNamePlaceholder"),className:"border border-transparent shadow-none px-0 text-lg font-medium h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent flex-1",style:{boxShadow:"none"}})}),n&&t.jsx(B,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:n,children:t.jsx(qs,{size:14})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pt,{control:z.control,name:"active",render:({field:C})=>t.jsx(ct,{checked:C.value,onCheckedChange:M=>{C.onChange(M),te()},className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:a(ae?"automations.automationDetail.active":"automations.automationDetail.inactive")}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx(zs,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:a("automations.automationDetail.starter")}),t.jsx(zo,{automationId:r,open:y,onOpenChange:v,onCustomSelect:()=>{T(!0),A(!1),_("")},onEventSelect:()=>{A(!0),T(!1)},onWebhookCreated:C=>{Ke("automation_trigger_added",{automation_id:r,trigger_type:"webhook"}),R(C)}})]}),e.triggers.length===0&&!b?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:[a("automations.automationDetail.whenShouldRun")," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>v(!0),children:a("automations.automationDetail.addStarter")})," ",a("automations.automationDetail.toGetGoing")]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(C=>t.jsx(Xt,{trigger:C,automationId:r,connectionName:C.connection_id?x.get(C.connection_id):void 0},C.id))}),b&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:D,onChange:C=>_(C.target.value),onBlur:async()=>{const C=D.trim();if(!(!C||!Re(C)))try{await j.mutateAsync({automation_id:r,type:"cron",cron_expression:C}),Ke("automation_trigger_added",{automation_id:r,trigger_type:"cron"}),X.success(a("automations.automationDetail.starterAdded")),T(!1),_("")}catch{X.error(a("automations.automationDetail.failedToAddStarter"))}},onKeyDown:async C=>{const M=D.trim();C.key==="Enter"&&M&&Re(M)&&C.target.blur(),C.key==="Escape"&&(T(!1),_(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),D&&!Re(D)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:a("automations.automationDetail.invalid")}),j.isPending&&t.jsx(Le,{className:"size-[13px] text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity rounded-lg",onClick:()=>{T(!1),_("")},children:t.jsx(mt,{size:13})})]}),k&&t.jsx(w.Suspense,{fallback:t.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 rounded-lg border border-border bg-background",children:[t.jsx(Le,{className:"size-[13px] text-muted-foreground"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:a("automations.automationDetail.loadingConnections")})]}),children:t.jsx(Mo,{automationId:r,onDone:()=>A(!1)})}),t.jsx(Jt,{open:$!==null,onOpenChange:C=>{C||R(null)},url:$?.url??null,token:$?.token??null})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:a("automations.automationDetail.instructions")}),t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",disabled:K||!p,onClick:J,children:[t.jsx(Ot,{size:13}),a("automations.automationDetail.improve")]})]}),t.jsx(Qs,{tiptapDoc:p,setTiptapDoc:re,placeholder:a("automations.automationDetail.instructionsPlaceholder"),children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Ys,{virtualMcpId:i||null,className:"max-h-[45vh]"}),t.jsx("div",{className:"@container/chat-bottom flex items-center justify-end gap-1.5 p-2.5",children:t.jsxs(Bs,{children:[t.jsx(Gs,{asChild:!0,children:t.jsxs(B,{type:"button",variant:"default",className:"h-8 gap-1.5 px-3 text-sm font-medium",onClick:le,disabled:!i,children:[t.jsx(Xs,{size:16}),a("automations.automationDetail.test")]})}),t.jsx(Hs,{children:a("automations.automationDetail.testAutomation")})]})})]})})]}),t.jsxs(Us,{open:N,onOpenChange:S,className:"flex flex-col gap-2.5",children:[t.jsxs(Vs,{className:"group flex w-fit cursor-pointer items-center gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:a("automations.automationDetail.advanced")}),t.jsx(rt,{size:14,className:"text-muted-foreground/60 transition-transform group-data-[state=open]:rotate-180"})]}),t.jsxs(Ws,{className:"flex flex-col gap-5 pt-0.5",children:[t.jsx(fo,{tier:z.watch("tier"),onTierChange:C=>z.setValue("tier",C,{shouldDirty:!0}),override:z.watch("modelOverride"),onOverrideChange:C=>z.setValue("modelOverride",C,{shouldDirty:!0})}),t.jsx(ho,{agentId:i||null,value:z.watch("tools"),onChange:C=>z.setValue("tools",C,{shouldDirty:!0})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:a("automations.automationDetail.maxSteps")}),t.jsx(xt,{type:"number",min:1,max:100,className:"w-40",placeholder:a("automations.automationDetail.maxStepsPlaceholder",{default:Vo}),value:z.watch("maxAgentSteps")??"",onChange:C=>{const M=C.target.value.trim(),O=M===""?null:Number(M);z.setValue("maxAgentSteps",O===null||Number.isNaN(O)?null:O,{shouldDirty:!0})}})]})]})]})]})]})}function Go(r){const e=Z.c(55),{automation:s}=r,n=ee(),{update:a}=ve();let i;e[0]!==s.name?(i=t.jsx("h2",{className:"text-lg font-medium text-foreground",children:s.name}),e[0]=s.name,e[1]=i):i=e[1];let c;e[2]!==n?(c=n("automations.builtin.badge"),e[2]=n,e[3]=c):c=e[3];let o;e[4]!==c?(o=t.jsx(Kt,{variant:"muted",children:c}),e[4]=c,e[5]=o):o=e[5];let j;e[6]!==i||e[7]!==o?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[i,o]}),e[6]=i,e[7]=o,e[8]=j):j=e[8];let d;e[9]!==s.id||e[10]!==a?(d=_=>a.mutate({id:s.id,active:_}),e[9]=s.id,e[10]=a,e[11]=d):d=e[11];let m;e[12]!==s.active||e[13]!==d||e[14]!==a.isPending?(m=t.jsx(ct,{checked:s.active,disabled:a.isPending,onCheckedChange:d,className:"cursor-pointer"}),e[12]=s.active,e[13]=d,e[14]=a.isPending,e[15]=m):m=e[15];let x;e[16]!==s.active||e[17]!==n?(x=s.active?n("automations.automationDetail.active"):n("automations.automationDetail.inactive"),e[16]=s.active,e[17]=n,e[18]=x):x=e[18];let f;e[19]!==x?(f=t.jsx("span",{className:"text-sm text-muted-foreground",children:x}),e[19]=x,e[20]=f):f=e[20];let g;e[21]!==m||e[22]!==f?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[m,f]}),e[21]=m,e[22]=f,e[23]=g):g=e[23];let u;e[24]!==j||e[25]!==g?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[j,g]}),e[24]=j,e[25]=g,e[26]=u):u=e[26];let h;e[27]!==n?(h=n("automations.automationDetail.starter"),e[27]=n,e[28]=h):h=e[28];let p;e[29]!==h?(p=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:h}),e[29]=h,e[30]=p):p=e[30];let l;if(e[31]!==s.id||e[32]!==s.triggers){let _;e[34]!==s.id?(_=k=>t.jsx(Xt,{trigger:k,automationId:s.id,readOnly:!0},k.id),e[34]=s.id,e[35]=_):_=e[35],l=s.triggers.map(_),e[31]=s.id,e[32]=s.triggers,e[33]=l}else l=e[33];let y;e[36]!==p||e[37]!==l?(y=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[p,l]}),e[36]=p,e[37]=l,e[38]=y):y=e[38];let v;e[39]!==n?(v=n("automations.automationDetail.instructions"),e[39]=n,e[40]=v):v=e[40];let N;e[41]!==v?(N=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:v}),e[41]=v,e[42]=N):N=e[42];let S;e[43]!==s.system_key||e[44]!==n?(S=s.system_key==="implementer"?n("automations.builtin.implementerDescription"):s.system_key==="reviewer"?n("automations.builtin.reviewerDescription"):s.system_key==="linked_chats"?n("automations.builtin.linkedChatsDescription"):s.system_key==="pr_merged"?n("automations.builtin.prMergedDescription"):s.system_key==="chat_pr"?n("automations.builtin.chatPrDescription"):n("automations.builtin.description"),e[43]=s.system_key,e[44]=n,e[45]=S):S=e[45];let b;e[46]!==S?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:S}),e[46]=S,e[47]=b):b=e[47];let T;e[48]!==N||e[49]!==b?(T=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[N,b]}),e[48]=N,e[49]=b,e[50]=T):T=e[50];let D;return e[51]!==u||e[52]!==y||e[53]!==T?(D=t.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,T]}),e[51]=u,e[52]=y,e[53]=T,e[54]=D):D=e[54],D}const qt=[{key:"24h",labelKey:"mainPanelTabs.automationTab.last24hours",ms:1440*60*1e3},{key:"7d",labelKey:"mainPanelTabs.automationTab.last7days",ms:10080*60*1e3},{key:"30d",labelKey:"mainPanelTabs.automationTab.last30days",ms:720*60*60*1e3}];function Qt(r){const e=qt.find(n=>n.key===r).ms,s=Date.now();return{startDate:new Date(s-e).toISOString(),endDate:new Date(s).toISOString()}}function Ho(r){const e=Z.c(16),{automationId:s,triggerIds:n}=r,a=ee(),[i,c]=w.useState("30d"),[o,j]=w.useState(Jo);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=p=>{const l=p;c(l),j(Qt(l))},e[0]=d):d=e[0];let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(he,{className:"w-44",children:t.jsx(je,{})}),e[1]=m):m=e[1];let x;e[2]!==a?(x=qt.map(p=>t.jsx(be,{value:p.key,children:a(p.labelKey)},p.key)),e[2]=a,e[3]=x):x=e[3];let f;e[4]!==x?(f=t.jsx(ye,{children:x}),e[4]=x,e[5]=f):f=e[5];let g;e[6]!==f||e[7]!==i?(g=t.jsx("div",{className:"flex items-center justify-end",children:t.jsxs(ge,{value:i,onValueChange:d,children:[m,f]})}),e[6]=f,e[7]=i,e[8]=g):g=e[8];let u;e[9]!==s||e[10]!==o||e[11]!==n?(u=t.jsx(ro,{automationId:s,triggerIds:n,range:o}),e[9]=s,e[10]=o,e[11]=n,e[12]=u):u=e[12];let h;return e[13]!==g||e[14]!==u?(h=t.jsxs("div",{className:"flex flex-col gap-5",children:[g,u]}),e[13]=g,e[14]=u,e[15]=h):h=e[15],h}function Jo(){return Qt("30d")}function Xo(r){const e=Z.c(5),{tabId:s}=r;let n;e[0]!==s?(n=ds(s),e[0]=s,e[1]=n):n=e[1];const a=n;if(!a)return null;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ye,{}),e[2]=i):i=e[2];let c;return e[3]!==a.id?(c=t.jsx(w.Suspense,{fallback:i,children:t.jsx(qo,{id:a.id})}),e[3]=a.id,e[4]=c):c=e[4],c}function qo(r){const e=Z.c(41),{id:s}=r,n=ee(),{openPanel:a}=co(),{data:i,isLoading:c}=Ks(s),[o,j]=w.useState("settings");let d;e[0]!==a?(d=()=>a("automations"),e[0]=a,e[1]=d):d=e[1];const m=d;if(c){let k;return e[2]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ye,{}),e[2]=k):k=e[2],k}if(!i){let k;e[3]!==n?(k=n("mainPanelTabs.automationTab.automationNotFound"),e[3]=n,e[4]=k):k=e[4];let A;return e[5]!==k?(A=t.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:k}),e[5]=k,e[6]=A):A=e[6],A}let x;e[7]!==i.triggers?(x=i.triggers.map(Qo),e[7]=i.triggers,e[8]=x):x=e[8];const f=x;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ut,{size:14}),e[9]=g):g=e[9];let u;e[10]!==n?(u=n("mainPanelTabs.automationTab.backToList"),e[10]=n,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs(B,{variant:"ghost",size:"sm",onClick:m,children:[g,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let p;e[15]!==n?(p=n("mainPanelTabs.automationTab.settings"),e[15]=n,e[16]=p):p=e[16];let l;e[17]!==p?(l={id:"settings",label:p},e[17]=p,e[18]=l):l=e[18];let y;e[19]!==n?(y=n("mainPanelTabs.automationTab.runs"),e[19]=n,e[20]=y):y=e[20];let v;e[21]!==y?(v={id:"runs",label:y},e[21]=y,e[22]=v):v=e[22];let N;e[23]!==l||e[24]!==v?(N=[l,v],e[23]=l,e[24]=v,e[25]=N):N=e[25];let S;e[26]===Symbol.for("react.memo_cache_sentinel")?(S=k=>j(k),e[26]=S):S=e[26];let b;e[27]!==N||e[28]!==o?(b=t.jsx(lo,{placement:"page",tabs:N,activeTab:o,onTabChange:S}),e[27]=N,e[28]=o,e[29]=b):b=e[29];let T;e[30]!==b||e[31]!==h?(T=t.jsxs("div",{className:"flex items-center justify-between pb-4 shrink-0",children:[h,b]}),e[30]=b,e[31]=h,e[32]=T):T=e[32];let D;e[33]!==i||e[34]!==s||e[35]!==o||e[36]!==f?(D=o==="settings"?i.system_key?t.jsx(Go,{automation:i}):t.jsx(Bo,{automationId:s,automation:i}):t.jsx(w.Suspense,{fallback:t.jsx(Ye,{}),children:t.jsx(Ho,{automationId:s,triggerIds:f})}),e[33]=i,e[34]=s,e[35]=o,e[36]=f,e[37]=D):D=e[37];let _;return e[38]!==T||e[39]!==D?(_=t.jsx(Xe,{children:t.jsx(Xe.Content,{children:t.jsxs(Xe.Container,{children:[T,D]})})}),e[38]=T,e[39]=D,e[40]=_):_=e[40],_}function Qo(r){return r.id}function Yo(){const r=Z.c(3);let e;r[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},r[0]=e):e=r[0];const{automationId:s}=ms(e);let n;return r[1]!==s?(n=s?t.jsx(Xo,{tabId:`automation:${s}`}):null,r[1]=s,r[2]=n):n=r[2],n}function wi(){const r=Z.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(us.Content,{children:t.jsx(Yo,{})}),r[0]=e):e=r[0],e}export{wi as default};
@@ -1 +1 @@
1
- import{c as S,b as O,r as G,j as e,n as m,y as Q,B as V,a_ as U}from"./index-TD9q6ZAx.js";import{C as W}from"./index-BmYzltjg.js";import{s as X}from"./Plus-DtZhz_pb.js";import{B as Y}from"./agent-icon-Blcoi2NV.js";import{i as F}from"./ZoomOut-B4Rw_R2z.js";import{S as Z}from"./search-input-DIOUBltI.js";import{E as $}from"./empty-state-BZZcWHI_.js";import{u as tt,a as et,b as it}from"./use-automations-CN350YMB.js";import{a as ot}from"./use-panel-navigate-CfJ9Qf-l.js";import{A as st}from"./automation-list-row-CAEPQbgy.js";import{b as rt}from"./thread-route-DtCL8-V4.js";import"./use-mobile-2T0aye5I.js";import"./use-app-takeover-BEzFC8oO.js";import"./sheet-IYrYpc2B.js";import"./tooltip-D3Lno7Sd.js";import"./index-B26ImUL7.js";import"./use-project-native-view-presence-DdsfKci4.js";import"./thread-intent-S-gJClOG.js";import"./use-mcp-client-fTyLcuiX.js";import"./auth-CLglKqB6.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C7fmCtIy.js";import"./task-board-ouLvp423.js";import"./schema-DTvMW5Bj.js";import"./slugify-CEUa2lfQ.js";import"./use-file-configs-DMVCBG-z.js";import"./use-organization-settings-lug340cj.js";import"./repository-binding-BnejFX7t.js";import"./site-slug-DebpOoQq.js";import"./toolbar-icon-button-UylaJSAo.js";import"./shell-layout-BM51_FIv.js";import"./avatar-B8cS3VPt.js";import"./User01-BmCbB_zb.js";import"./Building02-LYkR_QXB.js";import"./UserSquare-DL7MdeuL.js";import"./XClose-UWi3HSZE.js";import"./use-project-scope-C99MQSqi.js";import"./CheckCircle-B9QHilAa.js";import"./Monitor01-yE6iFgVP.js";import"./use-clock-tick-Biiz8lzy.js";import"./Tool01-BRVvW2LV.js";import"./command-BAgcQ2fh.js";import"./index-C-gf76Hu.js";import"./SearchMd-BQTuqO8x.js";import"./integration-icon-DJtlg_0w.js";import"./LinkBroken01-BU-4AKfc.js";import"./project-icon-BlJz5cOI.js";import"./new-project-dialog-DoLb5YVK.js";import"./ArrowLeft-C_qdjo3L.js";import"./label-B-SEr3Fs.js";import"./repository-import-picker-h-r8nnEf.js";import"./use-navigate-to-agent-BpeT4fqu.js";import"./repository-picker-FTAXO4Nx.js";import"./useInfiniteQuery-CQY9cAw7.js";import"./infiniteQueryObserver-X8qh_Va6.js";import"./collection-search-ehqGBK_4.js";import"./ShoppingBag01-CQIeNQm_.js";import"./use-debounced-value-WEbEbeed.js";import"./required-auth-layout-gIZfj42y.js";import"./autosend-CE_yiNtR.js";import"./use-org-sso-BMLNRQyf.js";import"./Image01-CyRCJwXT.js";import"./resizable-CGzf0YCQ.js";import"./icon-button-DxqkkLQj.js";import"./AlertCircle-DZq02EzT.js";import"./ArrowUp-B_lKPC5O.js";import"./ChevronUp-D4PiHnN0.js";import"./ChevronSelectorVertical-0ysVIDar.js";import"./Copy01-DJEr7OLy.js";import"./CreditCard01-b36fqa11.js";import"./DotsVertical-CV1b1y4C.js";import"./Globe04-DKUCyty7.js";import"./SwitchHorizontal01-DGImzN1R.js";import"./Key01-DWXRgH6w.js";import"./Link01-CNb9DW_9.js";import"./Sun-kLYmwsq0.js";import"./Play-ChRMrCTB.js";import"./Trash01-Bt3rK1ka.js";import"./Upload01-s7SnRMvp.js";import"./Users01-BVggEmV6.js";import"./badge-Qzxf6tet.js";import"./alert-dialog-qlQC4zlU.js";function nt(o){if(!(o instanceof Error))return!1;const t=o.message.toLowerCase();return t.includes("relation")&&t.includes("does not exist")}function mt(o){const t=S.c(45),{virtualMcpId:r}=o,i=O(),{openPanel:n}=ot(),{data:B,error:D}=tt(r),b=B===void 0?[]:B,{create:y}=et(),[_,H]=G.useState("");if(D&&nt(D)){let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Y,{size:48,className:"text-muted-foreground"}),t[0]=s):s=t[0];let x;t[1]!==i?(x=i("automations.setupRequired.title"),t[1]=i,t[2]=x):x=t[2];let h;t[3]!==i?(h=i("automations.setupRequired.description"),t[3]=i,t[4]=h):h=t[4];let j;t[5]!==n?(j=()=>n("settings"),t[5]=n,t[6]=j):j=t[6];let g;t[7]!==i?(g=i("automations.setupRequired.goToSetup"),t[7]=i,t[8]=g):g=t[8];let C;t[9]!==j||t[10]!==g?(C=e.jsx(V,{size:"sm",onClick:j,children:g}),t[9]=j,t[10]=g,t[11]=C):C=t[11];let N;return t[12]!==x||t[13]!==h||t[14]!==C?(N=e.jsx(m,{children:e.jsx(m.Content,{children:e.jsx(m.Container,{children:e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:s,title:x,description:h,actions:C})})})})}),t[12]=x,t[13]=h,t[14]=C,t[15]=N):N=t[15],N}const J=_.toLowerCase(),M=b.filter(s=>s.name.toLowerCase().includes(J));let w;t[16]!==n?(w=s=>n(`automation:${s}`),t[16]=n,t[17]=w):w=t[17];const q=w,R=async()=>{if(y.isPending)return;Q("automation_new_clicked",{virtual_mcp_id:r,existing_count:b.length});const s=await y.mutateAsync(it(r));q(s.id)},K=y.isPending;let A;t[18]===Symbol.for("react.memo_cache_sentinel")?(A=e.jsx(X,{size:14}),t[18]=A):A=t[18];let a;t[19]!==i?(a=i("automations.automationsList.newAutomation"),t[19]=i,t[20]=a):a=t[20];let L;t[21]!==y.isPending||t[22]!==R||t[23]!==a?(L=e.jsxs(V,{size:"sm",onClick:R,disabled:K,children:[A,a]}),t[21]=y.isPending,t[22]=R,t[23]=a,t[24]=L):L=t[24];const P=L,T=m,E=m,k=m;let l;t[25]!==i?(l=i("automations.automationsList.title"),t[25]=i,t[26]=l):l=t[26];let c;t[27]!==P||t[28]!==l?(c=e.jsx(m.Title,{actions:P,children:l}),t[27]=P,t[28]=l,t[29]=c):c=t[29];const z=b.length>0&&e.jsx(Z,{value:_,onChange:H,placeholder:i("automations.automationsList.searchPlaceholder"),className:"w-full md:w-[375px]"});let p;t[30]!==z?(p=e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:z}),t[30]=z,t[31]=p):p=t[31];let u;t[32]!==c||t[33]!==p?(u=e.jsxs("div",{className:"flex flex-col gap-6",children:[c,p]}),t[32]=c,t[33]=p,t[34]=u):u=t[34];const I=b.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:e.jsx(F,{size:48,className:"text-muted-foreground"}),title:i("automations.automationsList.emptyTitle"),description:i("automations.automationsList.emptyDescription"),actions:!1})}):M.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:e.jsx(F,{size:48,className:"text-muted-foreground"}),title:i("automations.automationsList.noResultsTitle"),description:i("automations.automationsList.noResultsDescription",{search:_})})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:M.map(s=>e.jsx(st,{automation:s,onClick:()=>q(s.id)},s.id))});let d;t[35]!==u||t[36]!==I||t[37]!==k.Container?(d=e.jsxs(k.Container,{children:[u,I]}),t[35]=u,t[36]=I,t[37]=k.Container,t[38]=d):d=t[38];let f;t[39]!==d||t[40]!==E.Content?(f=e.jsx(E.Content,{children:d}),t[39]=d,t[40]=E.Content,t[41]=f):f=t[41];let v;return t[42]!==T||t[43]!==f?(v=e.jsx(T,{children:f}),t[42]=T,t[43]=f,t[44]=v):v=t[44],v}function at(o){const t=S.c(3),{virtualMcpId:r}=o;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=e.jsx(U,{}),t[0]=i):i=t[0];let n;return t[1]!==r?(n=e.jsx(G.Suspense,{fallback:i,children:e.jsx(mt,{virtualMcpId:r})}),t[1]=r,t[2]=n):n=t[2],n}function lt(){const o=S.c(2),t=rt();let r;return o[0]!==t?(r=e.jsx(at,{virtualMcpId:t}),o[0]=t,o[1]=r):r=o[1],r}function Me(){const o=S.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(W.Content,{children:e.jsx(lt,{})}),o[0]=t):t=o[0],t}export{Me as default};
1
+ import{c as S,b as O,r as G,j as e,n as m,y as Q,B as V,a_ as U}from"./index-CTZFCFor.js";import{C as W}from"./index-CdXcvK9e.js";import{s as X}from"./Plus-Bk_sjqOf.js";import{B as Y}from"./agent-icon-CdvQWbsW.js";import{i as F}from"./ZoomOut-DAA80mSj.js";import{S as Z}from"./search-input-OMtFZb1f.js";import{E as $}from"./empty-state-DbF1fVB1.js";import{u as tt,a as et,b as it}from"./use-automations-CAQWvaBW.js";import{a as ot}from"./use-panel-navigate-BhXVoQPa.js";import{A as st}from"./automation-list-row-BjiQRizI.js";import{b as rt}from"./thread-route-dlwv4_1A.js";import"./use-mobile-CmswU9_U.js";import"./use-app-takeover-C41Zrny9.js";import"./sheet-BRHzkcNr.js";import"./tooltip-OCAaNJPG.js";import"./index-DQRAWCM4.js";import"./use-project-native-view-presence-DgH1oa2Q.js";import"./thread-intent-b5vpifzT.js";import"./use-mcp-client-jKOlHdKM.js";import"./auth-MJlmDrih.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CEcxThGW.js";import"./task-board-Cfny2jqU.js";import"./schema-BpLx5lXs.js";import"./slugify-CEUa2lfQ.js";import"./use-file-configs-Da0V_POi.js";import"./use-organization-settings-NMl9AK6V.js";import"./repository-binding-CbZ7gDPF.js";import"./site-slug-DebpOoQq.js";import"./toolbar-icon-button-iqvhc0aD.js";import"./shell-layout-Dhz9Exq4.js";import"./avatar-V-6seD4f.js";import"./User01-hKw9FGQs.js";import"./Building02-DC1B_tJa.js";import"./UserSquare-J-pPBDsM.js";import"./XClose-BnQLG2SG.js";import"./use-project-scope-B3s9YTAH.js";import"./CheckCircle-DPGL3Hpc.js";import"./Monitor01-D0i8fPos.js";import"./use-clock-tick-CdAPP8z5.js";import"./Tool01-BxfOk1kQ.js";import"./command-CdQubtgL.js";import"./index-JOoGKn03.js";import"./SearchMd-Cey_qFlh.js";import"./integration-icon-DedJ1gFL.js";import"./LinkBroken01-DvM0DBf8.js";import"./project-icon-Cd3AxOfl.js";import"./new-project-dialog--6a9GYsY.js";import"./ArrowLeft-CGwuLtbU.js";import"./label-BxQ_dsc6.js";import"./repository-import-picker-CqejRBEV.js";import"./use-navigate-to-agent-DvsN-N9f.js";import"./repository-picker-lc5PVuph.js";import"./useInfiniteQuery-DOKZzanu.js";import"./infiniteQueryObserver-DjFxX3t4.js";import"./collection-search-B8HvNhHx.js";import"./ShoppingBag01-DmYaqF6W.js";import"./use-debounced-value-Cv1nzd8k.js";import"./required-auth-layout-obZ6miVT.js";import"./autosend-BfqtXC9i.js";import"./use-org-sso-meIc9b7s.js";import"./Image01-8_YUB9dA.js";import"./resizable-MOzKpsY9.js";import"./icon-button-BS-JGKQE.js";import"./AlertCircle-Bty2uhsk.js";import"./ArrowUp-BYzq623p.js";import"./ChevronUp-D5DP9qHs.js";import"./ChevronSelectorVertical-BwRvUPUM.js";import"./Copy01-51uCRbSg.js";import"./CreditCard01-D8QKn2t6.js";import"./DotsVertical-Bhq6_ex6.js";import"./Globe04-C6aR04Lg.js";import"./SwitchHorizontal01-Cpiuomvl.js";import"./Key01-BYJLiX2A.js";import"./Link01-BrX96Lzm.js";import"./Sun-Vjoy_5bv.js";import"./Play-BefGY3fA.js";import"./Trash01-CMp64biU.js";import"./Upload01-Dgeov9JH.js";import"./Users01-D83kTTD4.js";import"./badge-xuppbiJQ.js";import"./alert-dialog-C9FvnbJH.js";function nt(o){if(!(o instanceof Error))return!1;const t=o.message.toLowerCase();return t.includes("relation")&&t.includes("does not exist")}function mt(o){const t=S.c(45),{virtualMcpId:r}=o,i=O(),{openPanel:n}=ot(),{data:B,error:D}=tt(r),b=B===void 0?[]:B,{create:y}=et(),[_,H]=G.useState("");if(D&&nt(D)){let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Y,{size:48,className:"text-muted-foreground"}),t[0]=s):s=t[0];let x;t[1]!==i?(x=i("automations.setupRequired.title"),t[1]=i,t[2]=x):x=t[2];let h;t[3]!==i?(h=i("automations.setupRequired.description"),t[3]=i,t[4]=h):h=t[4];let j;t[5]!==n?(j=()=>n("settings"),t[5]=n,t[6]=j):j=t[6];let g;t[7]!==i?(g=i("automations.setupRequired.goToSetup"),t[7]=i,t[8]=g):g=t[8];let C;t[9]!==j||t[10]!==g?(C=e.jsx(V,{size:"sm",onClick:j,children:g}),t[9]=j,t[10]=g,t[11]=C):C=t[11];let N;return t[12]!==x||t[13]!==h||t[14]!==C?(N=e.jsx(m,{children:e.jsx(m.Content,{children:e.jsx(m.Container,{children:e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:s,title:x,description:h,actions:C})})})})}),t[12]=x,t[13]=h,t[14]=C,t[15]=N):N=t[15],N}const J=_.toLowerCase(),M=b.filter(s=>s.name.toLowerCase().includes(J));let w;t[16]!==n?(w=s=>n(`automation:${s}`),t[16]=n,t[17]=w):w=t[17];const q=w,R=async()=>{if(y.isPending)return;Q("automation_new_clicked",{virtual_mcp_id:r,existing_count:b.length});const s=await y.mutateAsync(it(r));q(s.id)},K=y.isPending;let A;t[18]===Symbol.for("react.memo_cache_sentinel")?(A=e.jsx(X,{size:14}),t[18]=A):A=t[18];let a;t[19]!==i?(a=i("automations.automationsList.newAutomation"),t[19]=i,t[20]=a):a=t[20];let L;t[21]!==y.isPending||t[22]!==R||t[23]!==a?(L=e.jsxs(V,{size:"sm",onClick:R,disabled:K,children:[A,a]}),t[21]=y.isPending,t[22]=R,t[23]=a,t[24]=L):L=t[24];const P=L,T=m,E=m,k=m;let l;t[25]!==i?(l=i("automations.automationsList.title"),t[25]=i,t[26]=l):l=t[26];let c;t[27]!==P||t[28]!==l?(c=e.jsx(m.Title,{actions:P,children:l}),t[27]=P,t[28]=l,t[29]=c):c=t[29];const z=b.length>0&&e.jsx(Z,{value:_,onChange:H,placeholder:i("automations.automationsList.searchPlaceholder"),className:"w-full md:w-[375px]"});let p;t[30]!==z?(p=e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:z}),t[30]=z,t[31]=p):p=t[31];let u;t[32]!==c||t[33]!==p?(u=e.jsxs("div",{className:"flex flex-col gap-6",children:[c,p]}),t[32]=c,t[33]=p,t[34]=u):u=t[34];const I=b.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:e.jsx(F,{size:48,className:"text-muted-foreground"}),title:i("automations.automationsList.emptyTitle"),description:i("automations.automationsList.emptyDescription"),actions:!1})}):M.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:e.jsx(F,{size:48,className:"text-muted-foreground"}),title:i("automations.automationsList.noResultsTitle"),description:i("automations.automationsList.noResultsDescription",{search:_})})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:M.map(s=>e.jsx(st,{automation:s,onClick:()=>q(s.id)},s.id))});let d;t[35]!==u||t[36]!==I||t[37]!==k.Container?(d=e.jsxs(k.Container,{children:[u,I]}),t[35]=u,t[36]=I,t[37]=k.Container,t[38]=d):d=t[38];let f;t[39]!==d||t[40]!==E.Content?(f=e.jsx(E.Content,{children:d}),t[39]=d,t[40]=E.Content,t[41]=f):f=t[41];let v;return t[42]!==T||t[43]!==f?(v=e.jsx(T,{children:f}),t[42]=T,t[43]=f,t[44]=v):v=t[44],v}function at(o){const t=S.c(3),{virtualMcpId:r}=o;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=e.jsx(U,{}),t[0]=i):i=t[0];let n;return t[1]!==r?(n=e.jsx(G.Suspense,{fallback:i,children:e.jsx(mt,{virtualMcpId:r})}),t[1]=r,t[2]=n):n=t[2],n}function lt(){const o=S.c(2),t=rt();let r;return o[0]!==t?(r=e.jsx(at,{virtualMcpId:t}),o[0]=t,o[1]=r):r=o[1],r}function Me(){const o=S.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(W.Content,{children:e.jsx(lt,{})}),o[0]=t):t=o[0],t}export{Me as default};
@@ -1 +1 @@
1
- import{c as M,j as i,r as _,H as F,b as w,a2 as L,W as U,J as W,e as $}from"./index-TD9q6ZAx.js";import{C as D}from"./index-BmYzltjg.js";import{u as B}from"./use-mcp-client-fTyLcuiX.js";import{C as H,a as J}from"./companion-mcps-section-CAn17bJY.js";import{c as K}from"./use-connect-companion-VKAyFcK2.js";import{C as v,a as q}from"./connect-layout-DtIoh422.js";import{p as z}from"./self-tool-result-8OxPN9Nm.js";import{a as G}from"./use-panel-navigate-CfJ9Qf-l.js";import"./use-mobile-2T0aye5I.js";import"./use-app-takeover-BEzFC8oO.js";import"./sheet-IYrYpc2B.js";import"./tooltip-D3Lno7Sd.js";import"./index-B26ImUL7.js";import"./use-project-native-view-presence-DdsfKci4.js";import"./thread-route-DtCL8-V4.js";import"./thread-intent-S-gJClOG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C7fmCtIy.js";import"./task-board-ouLvp423.js";import"./schema-DTvMW5Bj.js";import"./slugify-CEUa2lfQ.js";import"./use-file-configs-DMVCBG-z.js";import"./use-organization-settings-lug340cj.js";import"./repository-binding-BnejFX7t.js";import"./site-slug-DebpOoQq.js";import"./agent-icon-Blcoi2NV.js";import"./AlertCircle-DZq02EzT.js";import"./Tool01-BRVvW2LV.js";import"./ArrowUp-B_lKPC5O.js";import"./ArrowLeft-C_qdjo3L.js";import"./LinkBroken01-BU-4AKfc.js";import"./ShoppingBag01-CQIeNQm_.js";import"./ZoomOut-B4Rw_R2z.js";import"./Building02-LYkR_QXB.js";import"./CheckCircle-B9QHilAa.js";import"./ChevronUp-D4PiHnN0.js";import"./ChevronSelectorVertical-0ysVIDar.js";import"./UserSquare-DL7MdeuL.js";import"./Copy01-DJEr7OLy.js";import"./CreditCard01-b36fqa11.js";import"./DotsVertical-CV1b1y4C.js";import"./Image01-CyRCJwXT.js";import"./Globe04-DKUCyty7.js";import"./SwitchHorizontal01-DGImzN1R.js";import"./Key01-DWXRgH6w.js";import"./Link01-CNb9DW_9.js";import"./Monitor01-yE6iFgVP.js";import"./Sun-kLYmwsq0.js";import"./Play-ChRMrCTB.js";import"./Plus-DtZhz_pb.js";import"./SearchMd-BQTuqO8x.js";import"./Trash01-Bt3rK1ka.js";import"./Upload01-s7SnRMvp.js";import"./User01-BmCbB_zb.js";import"./Users01-BVggEmV6.js";import"./XClose-UWi3HSZE.js";import"./toolbar-icon-button-UylaJSAo.js";import"./shell-layout-BM51_FIv.js";import"./avatar-B8cS3VPt.js";import"./use-project-scope-C99MQSqi.js";import"./use-clock-tick-Biiz8lzy.js";import"./command-BAgcQ2fh.js";import"./index-C-gf76Hu.js";import"./integration-icon-DJtlg_0w.js";import"./project-icon-BlJz5cOI.js";import"./new-project-dialog-DoLb5YVK.js";import"./label-B-SEr3Fs.js";import"./repository-import-picker-h-r8nnEf.js";import"./use-navigate-to-agent-BpeT4fqu.js";import"./repository-picker-FTAXO4Nx.js";import"./useInfiniteQuery-CQY9cAw7.js";import"./infiniteQueryObserver-X8qh_Va6.js";import"./collection-search-ehqGBK_4.js";import"./use-debounced-value-WEbEbeed.js";import"./required-auth-layout-gIZfj42y.js";import"./autosend-CE_yiNtR.js";import"./use-org-sso-BMLNRQyf.js";import"./resizable-CGzf0YCQ.js";import"./icon-button-DxqkkLQj.js";import"./auth-CLglKqB6.js";import"./site-url-en5df9c-.js";import"./companions-core-DzyeM-yJ.js";import"./metadata-D72DunRR.js";import"./github-repo-scope-ByTYKy_L.js";import"./form-BivWj0r6.js";import"./provision-repo-scoped-github-connection-lckxpDHD.js";import"./useQueries-4Zja_Hbg.js";import"./authenticate-and-persist-oauth-ClVBgGv4.js";import"./mcp-oauth-V-o-AEQP.js";import"./mcp-oauth-CaxV9wcl.js";import"./track-9gnPqqM1.js";import"./extract-connection-data-DJs0gTBx.js";import"./connection-B8e9uIdy.js";import"./url-slug-CzRjxv-k.js";function Q(o){const t=M.c(7),{onClose:l}=o,n=w();let r;t[0]!==n?(r=n("routes.reportsOnboarding.connectModal.loadError"),t[0]=n,t[1]=r):r=t[1];let e;t[2]!==r?(e=i.jsx("p",{className:"text-sm text-muted-foreground",children:r}),t[2]=r,t[3]=e):e=t[3];let s;return t[4]!==l||t[5]!==e?(s=i.jsx(v,{onClose:l,footer:null,children:e}),t[4]=l,t[5]=e,t[6]=s):s=t[6],s}function V(){const o=M.c(10),{closePanel:t}=G();let l;o[0]!==t?(l=()=>t(),o[0]=t,o[1]=l):l=o[1];const n=l;let r;o[2]!==n?(r=()=>i.jsx(Q,{onClose:n}),o[2]=n,o[3]=r):r=o[3];let e;o[4]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(H,{}),o[4]=e):e=o[4];let s;o[5]!==n?(s=i.jsx(_.Suspense,{fallback:i.jsx(v,{onClose:n,footer:null,children:e}),children:i.jsx(X,{onDone:n,onClose:n})}),o[5]=n,o[6]=s):s=o[6];let m;return o[7]!==r||o[8]!==s?(m=i.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:i.jsx(F,{fallback:r,children:s})}),o[7]=r,o[8]=s,o[9]=m):m=o[9],m}function X(o){const t=M.c(46),{onDone:l,onClose:n}=o,r=w(),{org:e}=L();let s;t[0]!==e.id?(s=U.REPORTS(e.id),t[0]=e.id,t[1]=s):s=t[1];const m=s;let b;t[2]!==e.id||t[3]!==e.slug?(b={connectionId:W,orgId:e.id,orgSlug:e.slug},t[2]=e.id,t[3]=e.slug,t[4]=b):b=t[4];const a=B(b);let P;t[5]!==m||t[6]!==e||t[7]!==a?(P={selfClient:a,org:e,cdConnectionId:m},t[5]=m,t[6]=e,t[7]=a,t[8]=P):P=t[8];const c=K(P),[I,k]=_.useState(!1),[R,N]=_.useState(null);let y;t[9]!==a?(y={mutationFn:async A=>z(await a.callTool({name:"REPORTS_RUN",arguments:{siteUrl:A}})),retry:!1},t[9]=a,t[10]=y):y=t[10];const p=$(y);let E;t[11]!==l||t[12]!==p||t[13]!==c||t[14]!==r?(E=async()=>{if(N(null),c)try{await p.mutateAsync(c)}catch{N(r("routes.reportsOnboarding.connectModal.somethingWentWrong"));return}l()},t[11]=l,t[12]=p,t[13]=c,t[14]=r,t[15]=E):E=t[15];const O=E;let u;t[16]!==R?(u=R?i.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:R}):null,t[16]=R,t[17]=u):u=t[17];let f;t[18]!==p.isPending||t[19]!==r?(f=p.isPending?r("routes.reportsOnboarding.connectSourcesTab.refreshing"):r("routes.reportsOnboarding.connectSourcesTab.refresh"),t[18]=p.isPending,t[19]=r,t[20]=f):f=t[20];let d;t[21]!==O?(d=()=>{O()},t[21]=O,t[22]=d):d=t[22];let x;t[23]!==I||t[24]!==p.isPending||t[25]!==f||t[26]!==d?(x=i.jsx(q,{ready:I,pending:p.isPending,label:f,onClick:d}),t[23]=I,t[24]=p.isPending,t[25]=f,t[26]=d,t[27]=x):x=t[27];let g;t[28]!==u||t[29]!==x?(g=i.jsxs(i.Fragment,{children:[u,x]}),t[28]=u,t[29]=x,t[30]=g):g=t[30];let C;t[31]!==r?(C=r("routes.reportsOnboarding.connectSourcesTab.title"),t[31]=r,t[32]=C):C=t[32];let h;t[33]!==C?(h=i.jsx("h2",{className:"text-xl font-medium leading-tight text-foreground",children:C}),t[33]=C,t[34]=h):h=t[34];let S;t[35]!==m||t[36]!==e||t[37]!==c?(S=i.jsx(J,{org:e,cdConnectionId:m,siteUrl:c,onReadinessChange:k}),t[35]=m,t[36]=e,t[37]=c,t[38]=S):S=t[38];let j;t[39]!==h||t[40]!==S?(j=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto",children:[h,S]}),t[39]=h,t[40]=S,t[41]=j):j=t[41];let T;return t[42]!==n||t[43]!==g||t[44]!==j?(T=i.jsx(v,{onClose:n,footer:g,children:j}),t[42]=n,t[43]=g,t[44]=j,t[45]=T):T=t[45],T}function $o(){const o=M.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(D.Content,{children:i.jsx(V,{})}),o[0]=t):t=o[0],t}export{$o as default};
1
+ import{c as M,j as i,r as _,H as F,b as w,a2 as L,W as U,J as W,e as $}from"./index-CTZFCFor.js";import{C as D}from"./index-CdXcvK9e.js";import{u as B}from"./use-mcp-client-jKOlHdKM.js";import{C as H,a as J}from"./companion-mcps-section-DT-zqSA0.js";import{c as K}from"./use-connect-companion-XVE2U2A9.js";import{C as v,a as q}from"./connect-layout-DKUDTFmt.js";import{p as z}from"./self-tool-result-8OxPN9Nm.js";import{a as G}from"./use-panel-navigate-BhXVoQPa.js";import"./use-mobile-CmswU9_U.js";import"./use-app-takeover-C41Zrny9.js";import"./sheet-BRHzkcNr.js";import"./tooltip-OCAaNJPG.js";import"./index-DQRAWCM4.js";import"./use-project-native-view-presence-DgH1oa2Q.js";import"./thread-route-dlwv4_1A.js";import"./thread-intent-b5vpifzT.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CEcxThGW.js";import"./task-board-Cfny2jqU.js";import"./schema-BpLx5lXs.js";import"./slugify-CEUa2lfQ.js";import"./use-file-configs-Da0V_POi.js";import"./use-organization-settings-NMl9AK6V.js";import"./repository-binding-CbZ7gDPF.js";import"./site-slug-DebpOoQq.js";import"./agent-icon-CdvQWbsW.js";import"./AlertCircle-Bty2uhsk.js";import"./Tool01-BxfOk1kQ.js";import"./ArrowUp-BYzq623p.js";import"./ArrowLeft-CGwuLtbU.js";import"./LinkBroken01-DvM0DBf8.js";import"./ShoppingBag01-DmYaqF6W.js";import"./ZoomOut-DAA80mSj.js";import"./Building02-DC1B_tJa.js";import"./CheckCircle-DPGL3Hpc.js";import"./ChevronUp-D5DP9qHs.js";import"./ChevronSelectorVertical-BwRvUPUM.js";import"./UserSquare-J-pPBDsM.js";import"./Copy01-51uCRbSg.js";import"./CreditCard01-D8QKn2t6.js";import"./DotsVertical-Bhq6_ex6.js";import"./Image01-8_YUB9dA.js";import"./Globe04-C6aR04Lg.js";import"./SwitchHorizontal01-Cpiuomvl.js";import"./Key01-BYJLiX2A.js";import"./Link01-BrX96Lzm.js";import"./Monitor01-D0i8fPos.js";import"./Sun-Vjoy_5bv.js";import"./Play-BefGY3fA.js";import"./Plus-Bk_sjqOf.js";import"./SearchMd-Cey_qFlh.js";import"./Trash01-CMp64biU.js";import"./Upload01-Dgeov9JH.js";import"./User01-hKw9FGQs.js";import"./Users01-D83kTTD4.js";import"./XClose-BnQLG2SG.js";import"./toolbar-icon-button-iqvhc0aD.js";import"./shell-layout-Dhz9Exq4.js";import"./avatar-V-6seD4f.js";import"./use-project-scope-B3s9YTAH.js";import"./use-clock-tick-CdAPP8z5.js";import"./command-CdQubtgL.js";import"./index-JOoGKn03.js";import"./integration-icon-DedJ1gFL.js";import"./project-icon-Cd3AxOfl.js";import"./new-project-dialog--6a9GYsY.js";import"./label-BxQ_dsc6.js";import"./repository-import-picker-CqejRBEV.js";import"./use-navigate-to-agent-DvsN-N9f.js";import"./repository-picker-lc5PVuph.js";import"./useInfiniteQuery-DOKZzanu.js";import"./infiniteQueryObserver-DjFxX3t4.js";import"./collection-search-B8HvNhHx.js";import"./use-debounced-value-Cv1nzd8k.js";import"./required-auth-layout-obZ6miVT.js";import"./autosend-BfqtXC9i.js";import"./use-org-sso-meIc9b7s.js";import"./resizable-MOzKpsY9.js";import"./icon-button-BS-JGKQE.js";import"./auth-MJlmDrih.js";import"./site-url-en5df9c-.js";import"./companions-core-DzyeM-yJ.js";import"./metadata-D72DunRR.js";import"./github-repo-scope-ByTYKy_L.js";import"./form-C3-gqoE3.js";import"./provision-repo-scoped-github-connection-lckxpDHD.js";import"./useQueries-BiefmIu_.js";import"./authenticate-and-persist-oauth-DjLIsCBn.js";import"./mcp-oauth-Dx8iOGEt.js";import"./mcp-oauth-DnmbC1ZC.js";import"./track-C14SKSTg.js";import"./extract-connection-data-CxPHH0g-.js";import"./connection-DS2m6_aA.js";import"./url-slug-BDqmchWv.js";function Q(o){const t=M.c(7),{onClose:l}=o,n=w();let r;t[0]!==n?(r=n("routes.reportsOnboarding.connectModal.loadError"),t[0]=n,t[1]=r):r=t[1];let e;t[2]!==r?(e=i.jsx("p",{className:"text-sm text-muted-foreground",children:r}),t[2]=r,t[3]=e):e=t[3];let s;return t[4]!==l||t[5]!==e?(s=i.jsx(v,{onClose:l,footer:null,children:e}),t[4]=l,t[5]=e,t[6]=s):s=t[6],s}function V(){const o=M.c(10),{closePanel:t}=G();let l;o[0]!==t?(l=()=>t(),o[0]=t,o[1]=l):l=o[1];const n=l;let r;o[2]!==n?(r=()=>i.jsx(Q,{onClose:n}),o[2]=n,o[3]=r):r=o[3];let e;o[4]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(H,{}),o[4]=e):e=o[4];let s;o[5]!==n?(s=i.jsx(_.Suspense,{fallback:i.jsx(v,{onClose:n,footer:null,children:e}),children:i.jsx(X,{onDone:n,onClose:n})}),o[5]=n,o[6]=s):s=o[6];let m;return o[7]!==r||o[8]!==s?(m=i.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:i.jsx(F,{fallback:r,children:s})}),o[7]=r,o[8]=s,o[9]=m):m=o[9],m}function X(o){const t=M.c(46),{onDone:l,onClose:n}=o,r=w(),{org:e}=L();let s;t[0]!==e.id?(s=U.REPORTS(e.id),t[0]=e.id,t[1]=s):s=t[1];const m=s;let b;t[2]!==e.id||t[3]!==e.slug?(b={connectionId:W,orgId:e.id,orgSlug:e.slug},t[2]=e.id,t[3]=e.slug,t[4]=b):b=t[4];const a=B(b);let P;t[5]!==m||t[6]!==e||t[7]!==a?(P={selfClient:a,org:e,cdConnectionId:m},t[5]=m,t[6]=e,t[7]=a,t[8]=P):P=t[8];const c=K(P),[I,k]=_.useState(!1),[R,N]=_.useState(null);let y;t[9]!==a?(y={mutationFn:async A=>z(await a.callTool({name:"REPORTS_RUN",arguments:{siteUrl:A}})),retry:!1},t[9]=a,t[10]=y):y=t[10];const p=$(y);let E;t[11]!==l||t[12]!==p||t[13]!==c||t[14]!==r?(E=async()=>{if(N(null),c)try{await p.mutateAsync(c)}catch{N(r("routes.reportsOnboarding.connectModal.somethingWentWrong"));return}l()},t[11]=l,t[12]=p,t[13]=c,t[14]=r,t[15]=E):E=t[15];const O=E;let u;t[16]!==R?(u=R?i.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:R}):null,t[16]=R,t[17]=u):u=t[17];let f;t[18]!==p.isPending||t[19]!==r?(f=p.isPending?r("routes.reportsOnboarding.connectSourcesTab.refreshing"):r("routes.reportsOnboarding.connectSourcesTab.refresh"),t[18]=p.isPending,t[19]=r,t[20]=f):f=t[20];let d;t[21]!==O?(d=()=>{O()},t[21]=O,t[22]=d):d=t[22];let x;t[23]!==I||t[24]!==p.isPending||t[25]!==f||t[26]!==d?(x=i.jsx(q,{ready:I,pending:p.isPending,label:f,onClick:d}),t[23]=I,t[24]=p.isPending,t[25]=f,t[26]=d,t[27]=x):x=t[27];let g;t[28]!==u||t[29]!==x?(g=i.jsxs(i.Fragment,{children:[u,x]}),t[28]=u,t[29]=x,t[30]=g):g=t[30];let C;t[31]!==r?(C=r("routes.reportsOnboarding.connectSourcesTab.title"),t[31]=r,t[32]=C):C=t[32];let h;t[33]!==C?(h=i.jsx("h2",{className:"text-xl font-medium leading-tight text-foreground",children:C}),t[33]=C,t[34]=h):h=t[34];let S;t[35]!==m||t[36]!==e||t[37]!==c?(S=i.jsx(J,{org:e,cdConnectionId:m,siteUrl:c,onReadinessChange:k}),t[35]=m,t[36]=e,t[37]=c,t[38]=S):S=t[38];let j;t[39]!==h||t[40]!==S?(j=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto",children:[h,S]}),t[39]=h,t[40]=S,t[41]=j):j=t[41];let T;return t[42]!==n||t[43]!==g||t[44]!==j?(T=i.jsx(v,{onClose:n,footer:g,children:j}),t[42]=n,t[43]=g,t[44]=j,t[45]=T):T=t[45],T}function $o(){const o=M.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(D.Content,{children:i.jsx(V,{})}),o[0]=t):t=o[0],t}export{$o as default};
@@ -0,0 +1 @@
1
+ import{c,j as e,b1 as b,u as g}from"./index-CTZFCFor.js";import{C as j}from"./index-CdXcvK9e.js";import{F as v,H as S}from"./file-share-button-DpvTad7o.js";import{u as k,b as y,e as _}from"./use-org-fs-5rCZZYw5.js";import{S as w}from"./settings-tab-Dou04qL_.js";import{b as M}from"./thread-route-dlwv4_1A.js";import"./use-mobile-CmswU9_U.js";import"./use-app-takeover-C41Zrny9.js";import"./sheet-BRHzkcNr.js";import"./tooltip-OCAaNJPG.js";import"./index-DQRAWCM4.js";import"./use-project-native-view-presence-DgH1oa2Q.js";import"./use-panel-navigate-BhXVoQPa.js";import"./use-project-scope-B3s9YTAH.js";import"./repository-binding-CbZ7gDPF.js";import"./use-mcp-client-jKOlHdKM.js";import"./auth-MJlmDrih.js";import"./thread-intent-b5vpifzT.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CEcxThGW.js";import"./task-board-Cfny2jqU.js";import"./schema-BpLx5lXs.js";import"./slugify-CEUa2lfQ.js";import"./use-file-configs-Da0V_POi.js";import"./use-organization-settings-NMl9AK6V.js";import"./site-slug-DebpOoQq.js";import"./agent-icon-CdvQWbsW.js";import"./AlertCircle-Bty2uhsk.js";import"./Tool01-BxfOk1kQ.js";import"./ArrowUp-BYzq623p.js";import"./ArrowLeft-CGwuLtbU.js";import"./LinkBroken01-DvM0DBf8.js";import"./ShoppingBag01-DmYaqF6W.js";import"./ZoomOut-DAA80mSj.js";import"./Building02-DC1B_tJa.js";import"./CheckCircle-DPGL3Hpc.js";import"./ChevronUp-D5DP9qHs.js";import"./ChevronSelectorVertical-BwRvUPUM.js";import"./UserSquare-J-pPBDsM.js";import"./Copy01-51uCRbSg.js";import"./CreditCard01-D8QKn2t6.js";import"./DotsVertical-Bhq6_ex6.js";import"./Image01-8_YUB9dA.js";import"./Globe04-C6aR04Lg.js";import"./SwitchHorizontal01-Cpiuomvl.js";import"./Key01-BYJLiX2A.js";import"./Link01-BrX96Lzm.js";import"./Monitor01-D0i8fPos.js";import"./Sun-Vjoy_5bv.js";import"./Play-BefGY3fA.js";import"./Plus-Bk_sjqOf.js";import"./SearchMd-Cey_qFlh.js";import"./Trash01-CMp64biU.js";import"./Upload01-Dgeov9JH.js";import"./User01-hKw9FGQs.js";import"./Users01-D83kTTD4.js";import"./XClose-BnQLG2SG.js";import"./toolbar-icon-button-iqvhc0aD.js";import"./shell-layout-Dhz9Exq4.js";import"./avatar-V-6seD4f.js";import"./use-clock-tick-CdAPP8z5.js";import"./command-CdQubtgL.js";import"./index-JOoGKn03.js";import"./integration-icon-DedJ1gFL.js";import"./project-icon-Cd3AxOfl.js";import"./new-project-dialog--6a9GYsY.js";import"./label-BxQ_dsc6.js";import"./repository-import-picker-CqejRBEV.js";import"./use-navigate-to-agent-DvsN-N9f.js";import"./repository-picker-lc5PVuph.js";import"./useInfiniteQuery-DOKZzanu.js";import"./infiniteQueryObserver-DjFxX3t4.js";import"./collection-search-B8HvNhHx.js";import"./use-debounced-value-Cv1nzd8k.js";import"./required-auth-layout-obZ6miVT.js";import"./autosend-BfqtXC9i.js";import"./use-org-sso-meIc9b7s.js";import"./resizable-MOzKpsY9.js";import"./icon-button-BS-JGKQE.js";import"./popover-DZg3XzK_.js";import"./extract-connection-data-CxPHH0g-.js";import"./metadata-D72DunRR.js";import"./connection-DS2m6_aA.js";import"./url-slug-BDqmchWv.js";import"./chat-context-CShbCUNX.js";import"./use-decopilot-events-BGdkAbxA.js";import"./use-ai-providers-r5JMl3Dn.js";import"./use-chat-navigation-B7jtkmO9.js";import"./location-BjlyegC2.js";import"./build-improve-prompt-doc-LycMDrLL.js";import"./empty-state-DbF1fVB1.js";import"./use-date-fns-locale-BPUEmwqZ.js";import"./differenceInSeconds-C3x8sHUj.js";import"./mcp-oauth-Dx8iOGEt.js";import"./mcp-oauth-DnmbC1ZC.js";import"./alert-dialog-C9FvnbJH.js";import"./textarea-D-r53Xtx.js";import"./use-connection-Bc66r7WR.js";import"./use-debounced-autosave-CitZx5FB.js";import"./add-connection-dialog-DJYTiZdc.js";import"./connection-card-C1INmiO3.js";import"./connection-slug-CITJ0kGN.js";import"./drawer-CY01gtte.js";import"./form-C3-gqoE3.js";import"./select-CMGxS2qh.js";import"./index-BdQq_4o_.js";import"./schema-B3PJAfvC.js";import"./connection-form-helpers-Bdbv__5q.js";import"./authenticate-and-persist-oauth-DjLIsCBn.js";import"./collection-tabs-P32YIIxy.js";import"./badge-xuppbiJQ.js";import"./use-infinite-scroll-qQBI_BkS.js";import"./useSuspenseInfiniteQuery-gQb4-5BD.js";import"./file-type-icon-DuTvDFZv.js";import"./checkbox-CsdxV5F4.js";import"./search-input-OMtFZb1f.js";import"./use-mcp-auth-status-DciS_iyB.js";import"./types-DSl6aKYl.js";import"./use-mcp-tools-CWDoMes8.js";import"./use-mcp-prompts-KLIBV_YA.js";import"./utils-CVEq3hMx.js";import"./switch-DGEo5K4-.js";import"./scroll-area-CioiKzlv.js";import"./optimistic-project-sidebar-views-gZfWr2eJ.js";import"./format-time-CAj8AQXM.js";import"./use-copy-DIsWFSvt.js";import"./virtual-mcp-BX0PkQ6l.js";import"./sandbox-url-D3mC8qhT.js";import"./secret-picker-fddEeqOm.js";import"./use-secrets-Dg67dBxN.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./serial-task-queue-CGOeQgpr.js";const x="home";function P(i){const t=c.c(5),{label:r}=i;let p;t[0]===Symbol.for("react.memo_cache_sentinel")?(p=e.jsx(b,{className:"aspect-video w-2/3 max-w-xl"}),t[0]=p):p=t[0];let o;t[1]!==r?(o=r&&e.jsx("p",{className:"text-xs text-muted-foreground",children:r}),t[1]=r,t[2]=o):o=t[2];let m;return t[3]!==o?(m=e.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-background",children:[p,o]}),t[3]=o,t[4]=m):m=t[4],m}function D(i){const t=c.c(15),{path:r}=i;let p;t[0]===Symbol.for("react.memo_cache_sentinel")?(p={refetchIntervalWhenAbsent:2e3},t[0]=p):p=t[0];const o=k(x,r,p),m=y(x)(r);if(o.isPending||!o.data){const h=!o.isPending&&!o.data?"Waiting for the deck to sync…":void 0;let l;return t[1]!==h?(l=e.jsx(P,{label:h}),t[1]=h,t[2]=l):l=t[2],l}let s;t[3]!==o.data?(s=_(o.data),t[3]=o.data,t[4]=s):s=t[4];const f=o.data.shareMode??"private",u=o.data.effectivePublic??!1,d=window.location.origin+m;let a;t[5]!==r||t[6]!==f||t[7]!==u||t[8]!==d?(a=e.jsx(v,{volume:x,path:r,shareMode:f,effectivePublic:u,url:d}),t[5]=r,t[6]=f,t[7]=u,t[8]=d,t[9]=a):a=t[9];let n;return t[10]!==r||t[11]!==m||t[12]!==s||t[13]!==a?(n=e.jsx(S,{readUrl:m,marker:s,title:r,savePath:r,trailing:a}),t[10]=r,t[11]=m,t[12]=s,t[13]=a,t[14]=n):n=t[14],n}function C(){const i=c.c(4);let t;i[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},i[0]=t):t=i[0];const r=g(t),p=M(),o="path"in r&&typeof r.path=="string"?r.path:void 0;let m;return i[1]!==o||i[2]!==p?(m=o?e.jsx(D,{path:o},o):e.jsx(w,{virtualMcpId:p}),i[1]=o,i[2]=p,i[3]=m):m=i[3],m}function rr(){const i=c.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(j.Content,{children:e.jsx(C,{})}),i[0]=t):t=i[0],t}export{rr as default};