decocms 4.353.1 → 4.353.3

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 (259) hide show
  1. package/dist/client/assets/{AlertCircle-By2j9C_h.js → AlertCircle-E3JxJl5F.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BwXnXhM2.js → AreaChart-DpWoX4rW.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CLFyRFWt.js → ArrowLeft-5wrvjTRT.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-Bq9jtZNV.js → ArrowRight-C3sUuSbM.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Y7F1Y0NP.js → ArrowUp-BXkuhFOO.js} +1 -1
  6. package/dist/client/assets/{Check-DtJz5CyC.js → Check-DcBf9sZc.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-ClRZ9asP.js → CheckCircle-Bt9gqhgc.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-7ndg2F4q.js → ChevronRight-Q3xfX8rO.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-C4DufZYV.js → ChevronSelectorVertical-C5pa1SPJ.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-CmuRSYhH.js → ChevronUp-Dl6d_B-P.js} +1 -1
  11. package/dist/client/assets/{Copy01-BElBKoh2.js → Copy01-DulnG-OE.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-D4lEpyaH.js → CreditCard01-bvPgO5VX.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-DiplKn_T.js → DotsVertical-D_-s7KYn.js} +1 -1
  14. package/dist/client/assets/{Download01-Bzz2G5Kj.js → Download01-DlkceQGS.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-BHWQK1JY.js → ErrorBarContext-EcdvQCyX.js} +1 -1
  16. package/dist/client/assets/{Eye-B7REDyFv.js → Eye-sU9sO8WN.js} +1 -1
  17. package/dist/client/assets/{GitBranch01-BQiQ4mM-.js → GitBranch01-Z1QMJ6tG.js} +1 -1
  18. package/dist/client/assets/{Globe01-DUjVIoVq.js → Globe01-BMQFtmgH.js} +1 -1
  19. package/dist/client/assets/{HardDrive-kaC1opdZ.js → HardDrive-C7a3RGiD.js} +1 -1
  20. package/dist/client/assets/{Image01-8O_6iuTv.js → Image01-CLjxhDoC.js} +1 -1
  21. package/dist/client/assets/{Key01-BQzEkKQh.js → Key01-D_P7IilT.js} +1 -1
  22. package/dist/client/assets/{Link01-BACsxhB0.js → Link01-BNTv-t8F.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-Dk6Zucn2.js → LinkExternal01-Dx_BNbmV.js} +1 -1
  24. package/dist/client/assets/{Monitor01-CbKNiqr8.js → Monitor01-C24k-Sa1.js} +1 -1
  25. package/dist/client/assets/{Package-BAN8XEaQ.js → Package-pXQrH8PF.js} +1 -1
  26. package/dist/client/assets/{Palette-C0PweN-j.js → Palette-TXvYKu7E.js} +1 -1
  27. package/dist/client/assets/{Play-CZ8aVG1p.js → Play--oBkDBBT.js} +1 -1
  28. package/dist/client/assets/{Plus-C5q9r8Yq.js → Plus-BEvurd-g.js} +1 -1
  29. package/dist/client/assets/{SearchLg-DU49HkCE.js → SearchLg-CQpx8RWT.js} +1 -1
  30. package/dist/client/assets/{SearchMd-uXEQKukA.js → SearchMd-BUdPa-6c.js} +1 -1
  31. package/dist/client/assets/{Sector-DiAMnBjh.js → Sector-TFmllsEq.js} +1 -1
  32. package/dist/client/assets/{Settings02-DwuLSkBY.js → Settings02-BxCFXuSh.js} +1 -1
  33. package/dist/client/assets/{Share07-C_cFG6Xi.js → Share07-3E1X7nqo.js} +1 -1
  34. package/dist/client/assets/{Shield01-DvZSc7Oj.js → Shield01-C8u-Jn2o.js} +1 -1
  35. package/dist/client/assets/{Stars01-CTkN8nwO.js → Stars01--xyClkAV.js} +1 -1
  36. package/dist/client/assets/{Sun-e_VbNYUc.js → Sun-Bhh0NpMa.js} +1 -1
  37. package/dist/client/assets/{Tool01-DiP-VfPS.js → Tool01-ejvtqNUf.js} +1 -1
  38. package/dist/client/assets/{Tool02-BpeNPtsX.js → Tool02-BCmYiB10.js} +1 -1
  39. package/dist/client/assets/{Trash01-Cov4gega.js → Trash01-Bb6p09ja.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-DX0UAuhC.js → TrendUp01-Creeu049.js} +1 -1
  41. package/dist/client/assets/{Upload01-Ds6WOlmq.js → Upload01-CxRtt8qB.js} +1 -1
  42. package/dist/client/assets/{User01-BxtDJJLV.js → User01-rBlUmrBY.js} +1 -1
  43. package/dist/client/assets/{UserSquare-BScHWlu5.js → UserSquare-BHfOZp8B.js} +1 -1
  44. package/dist/client/assets/{Users01-CWTzt_XW.js → Users01-DLV_RdvI.js} +1 -1
  45. package/dist/client/assets/{Users03-CtDg4K2K.js → Users03-DddF1TqD.js} +1 -1
  46. package/dist/client/assets/{XCircle-eMk4c7gh.js → XCircle-LXGrpA4S.js} +1 -1
  47. package/dist/client/assets/{XClose-B4-UAFEe.js → XClose-Bd0dvJr4.js} +1 -1
  48. package/dist/client/assets/{Zap-DDliJhy5.js → Zap-CGvgKfSJ.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-fvPdZlv2.js → ZoomOut-D3P9Ibv5.js} +1 -1
  50. package/dist/client/assets/{access-gate-C3u_edpI.js → access-gate-BXhfCkGa.js} +1 -1
  51. package/dist/client/assets/{agent-icon-DihyHOkk.js → agent-icon-DhDR9pbB.js} +1 -1
  52. package/dist/client/assets/{agents-list-BdUIVDlP.js → agents-list-BVwwS8ct.js} +1 -1
  53. package/dist/client/assets/{ai-providers-DNXaEnQ7.js → ai-providers-BIPb61RX.js} +1 -1
  54. package/dist/client/assets/{alert-CXRq9TDQ.js → alert-CWa0nS4M.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-Cx3V33Ia.js → alert-dialog-CAZzUepb.js} +1 -1
  56. package/dist/client/assets/{analytics-tab-CrNywoc1.js → analytics-tab-BSy0BXW-.js} +1 -1
  57. package/dist/client/assets/api-keys--rTvFkDO.js +1 -0
  58. package/dist/client/assets/{api-keys-C9ORw6lT.js → api-keys-Cx23YmN0.js} +1 -1
  59. package/dist/client/assets/app-editor-Bsx1QXuN.js +1 -0
  60. package/dist/client/assets/{auth-DEscJ-p8.js → auth-B1dQXzXf.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-CRMuaMPd.js → auth-catchall-BukkWTeD.js} +1 -1
  62. package/dist/client/assets/{auth-entry-BIsWPagx.js → auth-entry-Rnhv1-vb.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-aSzvkEJP.js → auth-split-layout-fpMm_2Kw.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-CPNaFLRt.js → authenticate-and-persist-oauth-Dll5rtLu.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-D-eHNBas.js → automation-list-row-CtrZaABJ.js} +1 -1
  66. package/dist/client/assets/{automation-runs-D2i7IGT3.js → automation-runs-BYtrux4r.js} +1 -1
  67. package/dist/client/assets/{automations-CbwHtQK9.js → automations-CwwStoBl.js} +1 -1
  68. package/dist/client/assets/{autosend-c3jhTwyu.js → autosend-B5qFnyuj.js} +1 -1
  69. package/dist/client/assets/{avatar-CSVds7s9.js → avatar-BB14yoAu.js} +1 -1
  70. package/dist/client/assets/{badge-CbAXfrh1.js → badge-f_n8y1ac.js} +1 -1
  71. package/dist/client/assets/{block-document-Dn8M3Q-R.js → block-document-BqOvsWZl.js} +1 -1
  72. package/dist/client/assets/{breadcrumb-DXwWUI9-.js → breadcrumb-8ZxvuFiK.js} +1 -1
  73. package/dist/client/assets/{buckets-XqZuBcxI.js → buckets-CA6zHXAz.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-DWi6msRH.js → bulk-category-panel-CbR-da5E.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-DK1Gssfp.js → capability-load-error-RPlDTdHX.js} +1 -1
  76. package/dist/client/assets/{cards--bJPoKNH.js → cards-CBPjxLa9.js} +1 -1
  77. package/dist/client/assets/{category-editor-DyCVFCzu.js → category-editor-DlxjFOm9.js} +1 -1
  78. package/dist/client/assets/{cdn-tab-DWkUY1rK.js → cdn-tab-CmWmMnZt.js} +1 -1
  79. package/dist/client/assets/{chart-Czf8mq9Y.js → chart-DHMJ_Fen.js} +1 -1
  80. package/dist/client/assets/{chat-context-vFocVRrK.js → chat-context-DmXwXnDo.js} +1 -1
  81. package/dist/client/assets/{checkbox-BIlq0R1A.js → checkbox-BGLxm9uy.js} +1 -1
  82. package/dist/client/assets/{choose-editor-CWhePzsY.js → choose-editor-BxB5TvvN.js} +1 -1
  83. package/dist/client/assets/{cli-auth-success-qUpw9FlG.js → cli-auth-success-BNb9IjMC.js} +1 -1
  84. package/dist/client/assets/{client-icons-8awZ77pq.js → client-icons-Db2UnV5d.js} +1 -1
  85. package/dist/client/assets/{collection-detail-BSb_iHaU.js → collection-detail-CH7LxJp1.js} +1 -1
  86. package/dist/client/assets/{collection-display-button-BgKm-x5K.js → collection-display-button-Co2bUcMK.js} +1 -1
  87. package/dist/client/assets/{collection-search-BEIQf1eX.js → collection-search-UTZXFt4Q.js} +1 -1
  88. package/dist/client/assets/{collection-table-wrapper-DqIDMpFs.js → collection-table-wrapper-C8yjjwOX.js} +1 -1
  89. package/dist/client/assets/{collection-tabs-CrHhe1M8.js → collection-tabs-CwN0B_Pf.js} +1 -1
  90. package/dist/client/assets/{command-CRPbocXF.js → command-B98c7WqP.js} +1 -1
  91. package/dist/client/assets/{commerce-onboarding-K8GATpuN.js → commerce-onboarding-BSdpkqfp.js} +1 -1
  92. package/dist/client/assets/{connect-D6G05mCG.js → connect-Clqz1fX8.js} +1 -1
  93. package/dist/client/assets/{connect-layout-Ca7df3Q2.js → connect-layout-B-m8vhLZ.js} +1 -1
  94. package/dist/client/assets/{connection-BUrnKBTa.js → connection-Baq9uuRA.js} +1 -1
  95. package/dist/client/assets/{connection-card-DQjfjxQT.js → connection-card-CQBoI4NK.js} +1 -1
  96. package/dist/client/assets/{connection-detail-aiGwzeXF.js → connection-detail-9cM-Kug2.js} +1 -1
  97. package/dist/client/assets/{connection-form-helpers-B94yKi66.js → connection-form-helpers-D3I6R7D7.js} +1 -1
  98. package/dist/client/assets/{connections-BrXq_4kl.js → connections-DAv_CMwR.js} +1 -1
  99. package/dist/client/assets/{create-organization-dialog-Dvm-dXbQ.js → create-organization-dialog-BSXNupoU.js} +1 -1
  100. package/dist/client/assets/{decopilot-sse-pool-D0I66ByR.js → decopilot-sse-pool-D7tJXNHa.js} +1 -1
  101. package/dist/client/assets/{dialog-CfgV-qVB.js → dialog-BcLMOByU.js} +1 -1
  102. package/dist/client/assets/{domain-settings-pYlQmfc7.js → domain-settings-7Zad37u1.js} +1 -1
  103. package/dist/client/assets/{drawer-CoEXHfmd.js → drawer-B1NW8E3x.js} +1 -1
  104. package/dist/client/assets/{dropdown-menu-DRwBzGIq.js → dropdown-menu-D7i0SxXV.js} +1 -1
  105. package/dist/client/assets/{e2e-tab-BIcxRbPU.js → e2e-tab-DazSEuYg.js} +1 -1
  106. package/dist/client/assets/{editor-BdhS35FB.js → editor-ippCmmbR.js} +1 -1
  107. package/dist/client/assets/{empty-state-DPaZu9kk.js → empty-state-BgLU51Vd.js} +1 -1
  108. package/dist/client/assets/{empty-state-D-gX4dvL.js → empty-state-DM3_pMfp.js} +1 -1
  109. package/dist/client/assets/{extract-connection-data-CArTv0uG.js → extract-connection-data-BoLP7osc.js} +1 -1
  110. package/dist/client/assets/{file-explorer-DZ3pWFus.js → file-explorer-BLUqOUER.js} +1 -1
  111. package/dist/client/assets/{file-type-icon-DUyWqx-C.js → file-type-icon-BYhIzAa1.js} +1 -1
  112. package/dist/client/assets/{folder-icon-B-HyPTtu.js → folder-icon-CwXn4AyO.js} +1 -1
  113. package/dist/client/assets/{form-DrY8yvZX.js → form-emd0pLrx.js} +1 -1
  114. package/dist/client/assets/{general-b2t9z4fm.js → general-CU6-paZH.js} +1 -1
  115. package/dist/client/assets/{github-icon-CAzO5mZS.js → github-icon-Ddl_iahE.js} +1 -1
  116. package/dist/client/assets/{hooks-DFLcSIED.js → hooks-BXnnpNP2.js} +1 -1
  117. package/dist/client/assets/{hosting-tab-BRj0pFax.js → hosting-tab-DFrB1f4n.js} +1 -1
  118. package/dist/client/assets/{index-DI4VoLrH.js → index-B155LPbb.js} +1 -1
  119. package/dist/client/assets/{index-DDibe0vy.js → index-B6Qztu7w.js} +1 -1
  120. package/dist/client/assets/{index-Bii84JkG.js → index-BGZGCjW3.js} +1 -1
  121. package/dist/client/assets/{index-D3ka9FUE.js → index-BpcAzWBm.js} +1 -1
  122. package/dist/client/assets/{index-Dd_5_vj7.js → index-C2u03I99.js} +6 -6
  123. package/dist/client/assets/{index-sl5xMzr8.js → index-CLIo3u_B.js} +1 -1
  124. package/dist/client/assets/{index--SjsOk_W.js → index-DRkBnnDV.js} +1 -1
  125. package/dist/client/assets/{index-Ceg1_k49.js → index-DUT6nJ0k.js} +34 -34
  126. package/dist/client/assets/{index-Cg6lhI8G.js → index-DtwtZ-IF.js} +1 -1
  127. package/dist/client/assets/{index-B8snFUwT.js → index-QxX33JMN.js} +1 -1
  128. package/dist/client/assets/{index-8lmZYDMG.js → index-UAT0Ugws.js} +1 -1
  129. package/dist/client/assets/{index-redirect-COshTEhH.js → index-redirect-Dko3sLoa.js} +1 -1
  130. package/dist/client/assets/{infiniteQueryObserver-D2egSehE.js → infiniteQueryObserver-_WWuNywl.js} +1 -1
  131. package/dist/client/assets/{infra-billing-COgehA1N.js → infra-billing-BRyC4KaN.js} +1 -1
  132. package/dist/client/assets/{input-DrL2uw5z.js → input-nTzU91Mx.js} +1 -1
  133. package/dist/client/assets/{integration-icon-CZvFO42R.js → integration-icon-BDztQ5cY.js} +1 -1
  134. package/dist/client/assets/{invite-member-dialog-US1UYTXW.js → invite-member-dialog-BGY-IXwn.js} +1 -1
  135. package/dist/client/assets/{label-LxS1bm9q.js → label-CzQPlhNa.js} +1 -1
  136. package/dist/client/assets/{layout-BYcfzsdy.js → layout-CEw3dC5B.js} +1 -1
  137. package/dist/client/assets/{login-CT3wEx2T.js → login-D85DR3Ah.js} +1 -1
  138. package/dist/client/assets/{markdown-lXj1INAJ.js → markdown-BSBehimV.js} +1 -1
  139. package/dist/client/assets/{mcp-app-renderer-GBYwvyir.js → mcp-app-renderer-Dss-lPF7.js} +1 -1
  140. package/dist/client/assets/{mcp-oauth-BqZhLYIS.js → mcp-oauth-wwHQqpAF.js} +1 -1
  141. package/dist/client/assets/{members-HWE6dLqI.js → members-CjPht-NX.js} +1 -1
  142. package/dist/client/assets/{monaco-editor-wexodSPy.js → monaco-editor-DLi1fBoM.js} +1 -1
  143. package/dist/client/assets/{monitoring-stats-row-BQy_WBMC.js → monitoring-stats-row-DUJGuPy8.js} +1 -1
  144. package/dist/client/assets/{multi-select-gZ9t-le2.js → multi-select-DzWhgIJ1.js} +1 -1
  145. package/dist/client/assets/{oauth-callback-D879I90C.js → oauth-callback-DaEH82g5.js} +1 -1
  146. package/dist/client/assets/{oauth-callback-ai-provider-DnG5zZkc.js → oauth-callback-ai-provider-CAVr6VjO.js} +1 -1
  147. package/dist/client/assets/{onboarding-OO2P3yPO.js → onboarding-BNSol5LG.js} +1 -1
  148. package/dist/client/assets/{org-layout-D4mNECmy.js → org-layout-2aaJifjf.js} +1 -1
  149. package/dist/client/assets/{organization-choice-DzBo4RLg.js → organization-choice-BxdkzE9M.js} +1 -1
  150. package/dist/client/assets/{orgs-BFihWIQe.js → orgs-C96XsjF1.js} +1 -1
  151. package/dist/client/assets/{page-seo-form-DGGff7lk.js → page-seo-form-Dajg9YA8.js} +1 -1
  152. package/dist/client/assets/{popover-DOf_4xx6.js → popover-C6l187hN.js} +1 -1
  153. package/dist/client/assets/{post-calendar-CNTGUlFS.js → post-calendar-2Zkl-BP9.js} +1 -1
  154. package/dist/client/assets/post-editor-CjKrN_EU.js +1 -0
  155. package/dist/client/assets/{primitives-zLHmcTAo.js → primitives-DF23fVl8.js} +1 -1
  156. package/dist/client/assets/{profile-cCqyA8Ja.js → profile-B0sS95St.js} +1 -1
  157. package/dist/client/assets/{project-app-view-C1jCCMVt.js → project-app-view-sT4Y0JxU.js} +1 -1
  158. package/dist/client/assets/{project-icon-BFwhZSp9.js → project-icon-BlPTx8oi.js} +1 -1
  159. package/dist/client/assets/{prompts-Dwmbu0Np.js → prompts-rbfDqujB.js} +1 -1
  160. package/dist/client/assets/record-editor-bloQwNK8.js +1 -0
  161. package/dist/client/assets/redirect-editor-gp8iHlR5.js +1 -0
  162. package/dist/client/assets/registry-OGXiDY2Z.js +2 -0
  163. package/dist/client/assets/{registry-layout-CvXlOJU1.js → registry-layout-BAkEhg5l.js} +1 -1
  164. package/dist/client/assets/{reports-SY7ls9wK.js → reports-CwXky7GH.js} +1 -1
  165. package/dist/client/assets/{repositories-CAJRwjjR.js → repositories-yd8Ul7SD.js} +1 -1
  166. package/dist/client/assets/{repository-import-picker-CcuhK8KL.js → repository-import-picker-C3w0PiVH.js} +1 -1
  167. package/dist/client/assets/{repository-picker-pmpKaly5.js → repository-picker-C4CZp3MU.js} +1 -1
  168. package/dist/client/assets/{require-capability-fhOtzzgy.js → require-capability-BdKwutyX.js} +1 -1
  169. package/dist/client/assets/{required-auth-layout-idv8x7x8.js → required-auth-layout-93tqpRkY.js} +1 -1
  170. package/dist/client/assets/{reset-password-BYYRuta-.js → reset-password-C3ZsGd6g.js} +1 -1
  171. package/dist/client/assets/{review-settings-B6yWeIK2.js → review-settings-D95bvWPh.js} +1 -1
  172. package/dist/client/assets/{roles-CLjg9UDg.js → roles-BJ6zj9nx.js} +1 -1
  173. package/dist/client/assets/{schema-CiLixz9_.js → schema-CFEiOtLA.js} +1 -1
  174. package/dist/client/assets/{scroll-area-DzluEXsy.js → scroll-area-BOySaxD0.js} +1 -1
  175. package/dist/client/assets/{search-input-BX8DiJsW.js → search-input-DUWljVnz.js} +1 -1
  176. package/dist/client/assets/{secrets-DUAWZ98j.js → secrets-CgLtiVlT.js} +1 -1
  177. package/dist/client/assets/{sections-editor-B2ypZCej.js → sections-editor-3Y-LBL-o.js} +1 -1
  178. package/dist/client/assets/{select-DIdZKaGA.js → select--YmYaxmK.js} +1 -1
  179. package/dist/client/assets/{select-model-Bmc_IflO.js → select-model-B4Uv5muK.js} +1 -1
  180. package/dist/client/assets/{self-tool-result-CcEdQYdW.js → self-tool-result-AyNwJbG6.js} +1 -1
  181. package/dist/client/assets/{seo-editor-B6fIoJ6g.js → seo-editor-TiFFSdb7.js} +1 -1
  182. package/dist/client/assets/settings-layout-D7qlVLDA.js +1 -0
  183. package/dist/client/assets/{settings-sidebar-JhyKCctU.js → settings-sidebar-B_1RLpfh.js} +1 -1
  184. package/dist/client/assets/{shell-controls-BSAWJ8_h.js → shell-controls-CTK3gHCI.js} +1 -1
  185. package/dist/client/assets/{shell-layout-BOk75fzD.js → shell-layout-B22hODgv.js} +1 -1
  186. package/dist/client/assets/{skill-preview-d1ikiBY-.js → skill-preview-DRHUEJVJ.js} +1 -1
  187. package/dist/client/assets/{skills-CKjtDzEK.js → skills-DwzIu4cm.js} +1 -1
  188. package/dist/client/assets/{sso-CwanbBFG.js → sso-B6J8AlwI.js} +1 -1
  189. package/dist/client/assets/{store-DoJTCfZE.js → store-D3yDed-8.js} +1 -1
  190. package/dist/client/assets/store-registry-DRvrfbhX.js +2 -0
  191. package/dist/client/assets/{switch-DWS_n8np.js → switch-BYIj8PI7.js} +1 -1
  192. package/dist/client/assets/{synced-repos-DNieP13m.js → synced-repos-DnBoJm1P.js} +1 -1
  193. package/dist/client/assets/{table-DNkC1wLV.js → table-CqFpqhID.js} +1 -1
  194. package/dist/client/assets/{tabs-BLn8Kked.js → tabs-DDf5n_xV.js} +1 -1
  195. package/dist/client/assets/{task-board-DmcFtfUx.js → task-board-lWmcu4Co.js} +1 -1
  196. package/dist/client/assets/{task-route-DZPLe-B9.js → task-route-D4H3I1R6.js} +1 -1
  197. package/dist/client/assets/{tasks-RQ_utwCB.js → tasks-DvkhGjTO.js} +1 -1
  198. package/dist/client/assets/{textarea-Bp0YSowj.js → textarea-C1aSGNC3.js} +1 -1
  199. package/dist/client/assets/{thread-intent-ORO-5RVo.js → thread-intent-vqlN-Qxo.js} +1 -1
  200. package/dist/client/assets/{thread-route-CyqHsBb9.js → thread-route-B3e5Tda5.js} +1 -1
  201. package/dist/client/assets/{toggle-group-Sx9Ilxuz.js → toggle-group-BjAwDDKA.js} +1 -1
  202. package/dist/client/assets/{toolbar-ltwdGReV.js → toolbar-BLRY0HL2.js} +1 -1
  203. package/dist/client/assets/{toolbar-icon-button-Tm_h2TNj.js → toolbar-icon-button-5UGRKFNN.js} +1 -1
  204. package/dist/client/assets/{track-BHpDVvAH.js → track-CJx3bP8K.js} +1 -1
  205. package/dist/client/assets/{types-B5MaGOK6.js → types-Ddpb-WgT.js} +1 -1
  206. package/dist/client/assets/{use-ai-providers-CmRwu5qS.js → use-ai-providers-BtpFLOIn.js} +1 -1
  207. package/dist/client/assets/{use-automations-BaXflKli.js → use-automations-DiV9QPxk.js} +1 -1
  208. package/dist/client/assets/{use-autosave-DjAKx87A.js → use-autosave-B5kNDOFY.js} +1 -1
  209. package/dist/client/assets/{use-connection-C5dXNJfY.js → use-connection-DX58UuSA.js} +1 -1
  210. package/dist/client/assets/{use-copy-DfCCIZWO.js → use-copy-DLjo2bvP.js} +1 -1
  211. package/dist/client/assets/{use-create-virtual-mcp-DyXGuUPk.js → use-create-virtual-mcp-tcXSChgr.js} +1 -1
  212. package/dist/client/assets/{use-date-fns-locale-Ccez_eX3.js → use-date-fns-locale-Cph_mCcr.js} +1 -1
  213. package/dist/client/assets/{use-debounced-autosave-D5vdniSK.js → use-debounced-autosave-4AsL4ff_.js} +1 -1
  214. package/dist/client/assets/{use-debounced-value-CVI3Nkn9.js → use-debounced-value-C29guU-e.js} +1 -1
  215. package/dist/client/assets/{use-decopilot-events-BP3lej2d.js → use-decopilot-events-Q4t3F4hO.js} +1 -1
  216. package/dist/client/assets/{use-delete-connection-C1ibWMLe.js → use-delete-connection-D9sQ-WXK.js} +1 -1
  217. package/dist/client/assets/{use-deployment-admin-VkuEQo8y.js → use-deployment-admin-BKFe5K4O.js} +1 -1
  218. package/dist/client/assets/{use-destination-route-Cw0TUIyr.js → use-destination-route-WqBY8_Ir.js} +1 -1
  219. package/dist/client/assets/{use-file-configs-CRqq6Ves.js → use-file-configs-zbdT3ThS.js} +1 -1
  220. package/dist/client/assets/{use-infinite-scroll-DhZf6RoS.js → use-infinite-scroll-ClP3OMZ-.js} +1 -1
  221. package/dist/client/assets/{use-join-requests-0QfutR5n.js → use-join-requests-Ze6mJG8q.js} +1 -1
  222. package/dist/client/assets/{use-mcp-auth-status-LUmJ83XV.js → use-mcp-auth-status-Dk8XntDR.js} +1 -1
  223. package/dist/client/assets/{use-mcp-client-BcROUps9.js → use-mcp-client--YVzCD1z.js} +1 -1
  224. package/dist/client/assets/{use-mcp-prompts-DWLbs_s3.js → use-mcp-prompts-Bc0EWgJT.js} +1 -1
  225. package/dist/client/assets/{use-mcp-tools-COWpSqiZ.js → use-mcp-tools-DqUvw4PN.js} +1 -1
  226. package/dist/client/assets/{use-members-C0Onrn8e.js → use-members-Bs_MyInl.js} +1 -1
  227. package/dist/client/assets/{use-navigate-to-agent-DcKrqbCS.js → use-navigate-to-agent--y5rORM7.js} +1 -1
  228. package/dist/client/assets/{use-org-auth-client-FZjGtOyz.js → use-org-auth-client-BQIU3Rma.js} +1 -1
  229. package/dist/client/assets/{use-org-notice-DzQOJOvN.js → use-org-notice-Da5eqAmY.js} +1 -1
  230. package/dist/client/assets/{use-org-sso-DzOu_DpG.js → use-org-sso-DXlt4kVn.js} +1 -1
  231. package/dist/client/assets/{use-organization-roles-Crj5cYZD.js → use-organization-roles-Dimu7DpY.js} +1 -1
  232. package/dist/client/assets/{use-organization-settings-hhHskEVV.js → use-organization-settings-C5neW7QU.js} +1 -1
  233. package/dist/client/assets/{use-panel-navigate-aHl6aSg5.js → use-panel-navigate-B6118RbX.js} +1 -1
  234. package/dist/client/assets/{use-registry-connections-CdzuMgKr.js → use-registry-connections-6IQlIdqF.js} +1 -1
  235. package/dist/client/assets/{use-secrets-BHCCLhVt.js → use-secrets-C76oUyfR.js} +1 -1
  236. package/dist/client/assets/{use-section-preview-base-myzqahqj.js → use-section-preview-base-DPAZUTZ8.js} +1 -1
  237. package/dist/client/assets/{use-status-sounds-CjGtA2Q-.js → use-status-sounds-DMqZ2hqA.js} +1 -1
  238. package/dist/client/assets/{use-tags-BqSbUDkT.js → use-tags-BktmVtv2.js} +1 -1
  239. package/dist/client/assets/{use-view-mode-gEh4Oyt7.js → use-view-mode-rPICwpqX.js} +1 -1
  240. package/dist/client/assets/{use-virtual-mcp-CEps1p0k.js → use-virtual-mcp-DZ4N2SOx.js} +1 -1
  241. package/dist/client/assets/useInfiniteQuery-CD3_KbWn.js +1 -0
  242. package/dist/client/assets/useSuspenseInfiniteQuery-FkRnzD7Y.js +1 -0
  243. package/dist/client/assets/{users-BcR1ZszK.js → users-C37G02aq.js} +1 -1
  244. package/dist/client/assets/{variant-calendar-BwvIIXQ7.js → variant-calendar-D7tq8k0B.js} +1 -1
  245. package/dist/client/assets/{view-mode-toggle-2rrCAg88.js → view-mode-toggle-Dl55lCCc.js} +1 -1
  246. package/dist/client/index.html +1 -1
  247. package/dist/server/cli.js +1 -1
  248. package/dist/server/server.js +1 -1
  249. package/package.json +1 -1
  250. package/dist/client/assets/api-keys-CPVff9LX.js +0 -1
  251. package/dist/client/assets/app-editor-D1bdSfpw.js +0 -1
  252. package/dist/client/assets/post-editor-7YG7uQ_6.js +0 -1
  253. package/dist/client/assets/record-editor-pS9jKDcr.js +0 -1
  254. package/dist/client/assets/redirect-editor-CdAeFteN.js +0 -1
  255. package/dist/client/assets/registry-FfgkVtUE.js +0 -2
  256. package/dist/client/assets/settings-layout-Dh0Ktinq.js +0 -1
  257. package/dist/client/assets/store-registry-D7aaoaSC.js +0 -2
  258. package/dist/client/assets/useInfiniteQuery-C-YCoX5D.js +0 -1
  259. package/dist/client/assets/useSuspenseInfiniteQuery-ATLTIcvJ.js +0 -1
@@ -1 +1 @@
1
- import{b_ as wn,b as ae,G as je,a as Yt,F as Dn,J as Tn,aq as Fn,ar as An,j as s,B as be,t as ce,c as Y,r as H,I as Bn,M as In,K as ue,l as re,h as Xe,o as ie,a4 as Je,a1 as Ze,a2 as et,n as it,d as Pn,a7 as kt,m as rt,bz as En,e as Oe,bp as Vn,ap as Mn}from"./index-Ceg1_k49.js";import{C as On}from"./collection-search-BEIQf1eX.js";import{g as Ln,b as Rn,a as $n,e as Kn}from"./extract-connection-data-CArTv0uG.js";import{u as Wt,a as Xt,g as zn,C as pt}from"./connection-card-DQjfjxQT.js";import{D as Jt,b as Zt,c as en,d as tn,h as Un,e as Qn}from"./dialog-CfgV-qVB.js";import{D as nn,a as sn,c as qn,b as on,e as Gn,f as rn,g as an,d as Hn}from"./drawer-CoEXHfmd.js";import{d as me,a as pe,e as ge,b as he,c as xe,F as Et}from"./form-DrY8yvZX.js";import{I as _e}from"./input-DrL2uw5z.js";import{S as Yn,b as Wn,a as Xn,d as Jn,c as $e}from"./select-DIdZKaGA.js";import{T as Zn}from"./textarea-Bp0YSowj.js";import{b as ln}from"./use-connection-C5dXNJfY.js";import{n as tt,a as gt,i as cn}from"./Tool02-BpeNPtsX.js";import{j as ht,aN as es,aO as ts,aP as Vt,aQ as ns,t as ss,aR as os,aa as is,aS as rs,p as as,aT as ls,a8 as xt,a7 as cs,ae as ds}from"./agent-icon-DihyHOkk.js";import{b as us,d as fs}from"./UserSquare-BScHWlu5.js";import{s as ms}from"./XClose-B4-UAFEe.js";import{c as ps,i as Ge,a as Mt,E as gs,p as hs,b as xs,d as js}from"./connection-form-helpers-B94yKi66.js";import{a as jt}from"./authenticate-and-persist-oauth-CPNaFLRt.js";import{g as ys}from"./connection-slug-CITJ0kGN.js";import{C as bs}from"./collection-tabs-CrHhe1M8.js";import{u as Ot}from"./use-infinite-scroll-DhZf6RoS.js";import{B as He}from"./badge-CbAXfrh1.js";import{u as vs}from"./useSuspenseInfiniteQuery-ATLTIcvJ.js";import{S as Cs,u as ks,f as Ns}from"./use-mcp-client-BcROUps9.js";import{i as nt}from"./Check-DtJz5CyC.js";import{s as _s}from"./Plus-C5q9r8Yq.js";import{g as st}from"./metadata-dUsYcpuu.js";import{u as Ss}from"./use-ai-providers-CmRwu5qS.js";import{a as ws}from"./use-file-configs-CRqq6Ves.js";import{d as Ds}from"./use-organization-settings-hhHskEVV.js";import{r as Ts}from"./site-slug-uya6Wp4-.js";import{T as Fs,C as Nt,c as As,d as Bs,S as yt}from"./task-board-DmcFtfUx.js";import{a as Is}from"./decopilot-sse-pool-D0I66ByR.js";import{u as Ps}from"./use-decopilot-events-BP3lej2d.js";import{A as Lt}from"./avatar-CSVds7s9.js";import{h as ot,D as dn,b as un,g as fn,c as mn}from"./dropdown-menu-DRwBzGIq.js";import{a as _t,b as St,P as wt}from"./popover-DOf_4xx6.js";import{e as Le,a as Dt,c as Tt,d as Ce,b as Ft,C as At}from"./command-CRPbocXF.js";import{t as ze}from"./ChevronUp-CmuRSYhH.js";import{s as Es}from"./TrendUp01-DX0UAuhC.js";import{a as Vs}from"./Settings02-DwuLSkBY.js";import{s as Rt}from"./User01-BxtDJJLV.js";import{G as Ms}from"./github-icon-CAzO5mZS.js";import{P as Os}from"./project-icon-BFwhZSp9.js";import{g as $t}from"./get-initials-D-f_fDFw.js";import{p as Ls,a as Rs}from"./github-repo-CTPv5ZM2.js";import{i as $s}from"./AlertCircle-By2j9C_h.js";import{i as Ks}from"./CheckCircle-ClRZ9asP.js";import{a as pn}from"./DotsVertical-DiplKn_T.js";import{s as zs}from"./Eye-B7REDyFv.js";import{i as Us}from"./Shield01-DvZSc7Oj.js";const Qs=wn("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function qs({open:t,onOpenChange:e,onCreated:n}){const o=ae(),{org:r}=je(),{data:a}=Yt.useSession(),{stdioEnabled:i}=Dn(),m=Tn(),c=ln(),d=Wt(),p=Xt(d,"").items,l=Fn({resolver:An(ps),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=l.watch("ui_type"),j=l.watch("connection_url"),g=l.watch("npx_package"),x=Ge({uiType:f,connectionUrl:j??"",npxPackage:g??""})??Mt({uiType:f,connectionUrl:j??"",registryItems:p}),y=h=>{const _=h.trim();if(!_)return;const w=!!l.formState.dirtyFields.title,P=!!l.formState.dirtyFields.description,V=!!l.formState.dirtyFields.env_vars,N=F=>{if(F&&(!w&&!l.getValues("title").trim()&&F.title&&l.setValue("title",F.title,{shouldDirty:!1}),!P&&!(l.getValues("description")??"").trim()&&F.description&&l.setValue("description",F.description,{shouldDirty:!1}),!V&&F.envVarKeys?.length)){const $=l.getValues("env_vars")??[],I=new Set($.map(R=>R.key)),B=F.envVarKeys.filter(R=>!I.has(R));B.length>0&&l.setValue("env_vars",[...$,...B.map(R=>({key:R,value:""}))],{shouldDirty:!0})}},T=hs(_);if(T&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",T.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),N(Ge({uiType:"NPX",npxPackage:T.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";l.setValue("ui_type",F,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),N(Ge({uiType:F,connectionUrl:_})??Mt({uiType:F,connectionUrl:_,registryItems:p}));return}f==="NPX"&&N(Ge({uiType:"NPX",npxPackage:_}))},S=h=>{h||l.reset(),e(h)},b=async h=>{let _,w=null,P=null,V=null;h.ui_type==="NPX"?(_="STDIO",w="",V=xs(h.npx_package||"",h.env_vars||[])):h.ui_type==="STDIO"?(_="STDIO",w="",V=js(h.stdio_command||"",h.stdio_args||"",h.stdio_cwd,h.env_vars||[])):(_=h.ui_type,w=h.connection_url||"",P=h.connection_token||null);const N=Ln("conn");try{await c.create.mutateAsync({id:N,title:h.title,description:h.description||null,connection_type:_,connection_url:w,connection_token:P,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:r.id,icon:h.icon??null,app_name:null,app_id:null,connection_headers:V,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),n?.(N)}catch{ce.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},k=o("connections.createConnectionDialog.title"),v=o("connections.createConnectionDialog.description"),C=l.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),D=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(me,{control:l.control,name:"ui_type",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.typeLabel")}),s.jsxs(Yn,{value:h.value,onValueChange:h.onChange,children:[s.jsx(he,{children:s.jsx(Wn,{children:s.jsx(Xn,{})})}),s.jsxs(Jn,{children:[s.jsx($e,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),s.jsx($e,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),s.jsx($e,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),i&&s.jsxs(s.Fragment,{children:[s.jsx($e,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(tt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),s.jsx($e,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(us,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(xe,{})]})}),f==="NPX"&&s.jsx(me,{control:l.control,name:"npx_package",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("npx_package",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),f==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(me,{control:l.control,name:"stdio_command",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.commandLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"stdio_args",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.argumentsLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"stdio_cwd",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...h,value:h.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(xe,{})]})})]}),(f==="NPX"||f==="STDIO")&&s.jsx(me,{control:l.control,name:"env_vars",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(he,{children:s.jsx(gs,{value:h.value??[],onChange:h.onChange})}),s.jsx(xe,{})]})}),f!=="NPX"&&f!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(me,{control:l.control,name:"connection_url",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.urlLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("connection_url",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"connection_token",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:x?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(he,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...h,value:h.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"title",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.nameLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...h})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"description",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.descriptionLabel")}),s.jsx(he,{children:s.jsx(Zn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...h,value:h.value??""})}),s.jsx(xe,{})]})})]});return m?s.jsx(nn,{open:t,onOpenChange:S,children:s.jsxs(sn,{className:"max-h-[90vh]",children:[s.jsx(qn,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(on,{children:k}),s.jsx(Gn,{className:"mt-1",children:v})]}),s.jsx(rn,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(ms,{size:16})})})]})}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:D}),s.jsx(an,{children:s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(Jt,{open:t,onOpenChange:S,children:s.jsxs(Zt,{className:"sm:max-w-[525px]",children:[s.jsxs(en,{children:[s.jsx(tn,{children:k}),s.jsx(Un,{children:v})]}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"py-4",children:D}),s.jsxs(Qn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:o("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function Gs(t){const e=Y.c(72),{mode:n,agentId:o,addedConnectionIds:r,onAdd:a,onCloneAndAdd:i,onConnectAndAdd:m,connectingItemId:c,search:d,onCreateConnection:u,onBrowseNavigate:p,defaultTab:l}=t,f=n===void 0?"add":n,j=l===void 0?"connected":l,g=ae(),{org:x}=je(),y=H.useDeferredValue(d),S=d!==y;let b;e[0]!==y?(b=y.trim().toLowerCase(),e[0]=y,e[1]=b):b=e[1];const k=b;let v;e[2]!==j?(v=A=>A??j,e[2]=j,e[3]=v):v=e[3];const[C,D]=Bn(In.connectionsTab(x.slug)+(j==="all"?":home-modal":":agent-modal"),v);let h;e[4]!==C||e[5]!==D?(h=A=>{A!==C&&ie("connections_dialog_tab_changed",{to_tab:A}),D(A)},e[4]=C,e[5]=D,e[6]=h):h=e[6];const _=h;let w;e[7]!==x.id||e[8]!==x.slug?(w={connectionId:Cs,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=w):w=e[9];const P=ks(w),V=y?.trim().split(/\s+/).filter(Boolean)??[],N=V.length>0?{operator:"or",conditions:V.flatMap(to)}:void 0,T={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},F=JSON.stringify(T),{data:$,fetchNextPage:I,hasNextPage:B,isFetchingNextPage:R}=vs({queryKey:ue.collectionListInfinite(P,x.id,"","CONNECTIONS",F),queryFn:async A=>{const{pageParam:q}=A,ye=q===void 0?0:q;return(await P.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:ye}})).structuredContent},initialPageParam:0,getNextPageParam:Zs,staleTime:3e4}),G=$?.pages.flatMap(Js)??[],E=zn(G),U=new Set(G.filter(Xs).map(Ws)),M=Wt(),Q=Xt(M,y),Z=Ot(Q.loadMore,Q.hasMore,Q.isLoadingMore),ee=Ot(I,B??!1,R),K=C==="all"||!!k,ne=K?Q.items.filter(A=>{const q=Rn(A);if(q&&U.has(q))return!1;if(!k)return!0;const ye=st(A._meta),ke=[A.title,A.description,A.name,A.server?.title,A.server?.description,A.server?.name,ye?.friendly_name,ye?.friendlyName].filter(Boolean).join(" ").toLowerCase();return V.some(fe=>ke.includes(fe.toLowerCase()))}):[],W=ne.filter(Ys),X=ne.filter(Hs);let J;e[10]!==r?(J=A=>A.some(q=>r.has(q.id)),e[10]=r,e[11]=J):J=e[11];const te=J;let se;e[12]!==r||e[13]!==o||e[14]!==c||e[15]!==te||e[16]!==f||e[17]!==a||e[18]!==p||e[19]!==i||e[20]!==g?(se=(A,q,ye,ke,fe)=>{const qe=te(fe),Me=fe.find(Ne=>!r.has(Ne.id)),le=fe[0];if(f==="browse"){const Ne=ys(le);return s.jsx(pt,{connection:{title:q,icon:ye,description:fe.length>1?`${fe.length} instances`:ke??void 0},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{ie("connection_browse_clicked",{app_name:le.app_name??null,connection_id:le.id,instances_count:fe.length}),p?.(Ne)}},A)}return s.jsx(pt,{connection:{title:q,icon:ye,description:ke},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[qe&&s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(ie("connection_add_clicked",{action:"use_existing",app_name:le.app_name??null,connection_id:Me.id}),o&&ie("agent_connection_attached",{agent_id:o,connection_id:Me.id,app_name:le.app_name??null,mode:"existing"}),a(Me.id)):(ie("connection_add_clicked",{action:"clone",app_name:le.app_name??null,base_connection_id:le.id}),i(le))},children:g("virtualMcp.connectionDialogContent.add")})]})},A)},e[12]=r,e[13]=o,e[14]=c,e[15]=te,e[16]=f,e[17]=a,e[18]=p,e[19]=i,e[20]=g,e[21]=se):se=e[21];const O=se;let L;e[22]!==c||e[23]!==f||e[24]!==m||e[25]!==g?(L=A=>{const q=st(A._meta),ye=q?.friendlyName||q?.friendly_name||A.server?.title||A.title||A.server?.name||A.name||A.id||"",ke=A.server?.description||A.description||null,fe=A.server?.icons?.[0]?.src||$n(A.server?.repository)||null,qe=q?.official===!0,Me=q?.verified===!0,le=q?.owner==="deco";return s.jsx(pt,{connection:{title:ye,description:ke,icon:fe},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[le&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:g("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByDeco")})]}),!le&&qe&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!le&&!qe&&Me&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),ie("connection_add_clicked",{action:"connect_new",registry_item_id:A.id,app_name:q?.friendlyName||A.server?.name||A.name||null}),m(A)},children:c===A.id?s.jsx(Xe,{className:"size-3.5"}):g(f==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${A.id}`)},e[22]=c,e[23]=f,e[24]=m,e[25]=g,e[26]=L):L=e[26];const oe=L;let z;e[27]!==C||e[28]!==_||e[29]!==u||e[30]!==k||e[31]!==g?(z=!k&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(bs,{tabs:[{id:"all",label:g("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:g("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:A=>_(A)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{ie("connections_dialog_custom_clicked"),u()},children:[s.jsx(_s,{size:12}),g("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=u,e[30]=k,e[31]=g,e[32]=z):z=e[32];const ve=S&&"opacity-50 pointer-events-none";let de;e[33]!==ve?(de=re("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=de):de=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Te;e[35]!==O?(Te=A=>{if(A.type==="group")return O(A.key,A.title,A.icon,null,A.connections);const q=A.connection;return O(q.id,q.title,q.icon,q.description??null,[q])},e[35]=O,e[36]=Te):Te=e[36];const ct=E.map(Te);let Fe;e[37]!==ee?(Fe=s.jsx("div",{ref:ee,className:"col-span-full h-1"}),e[37]=ee,e[38]=Fe):Fe=e[38];let Ae;e[39]!==R?(Ae=R&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[39]=R,e[40]=Ae):Ae=e[40];const dt=K&&W.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(gt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ut=K&&W.map(oe),ft=K&&X.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),mt=K&&X.map(oe);let Be;e[41]!==Z||e[42]!==M||e[43]!==K?(Be=K&&M.length>0&&s.jsx("div",{ref:Z,className:"col-span-full h-1"}),e[41]=Z,e[42]=M,e[43]=K,e[44]=Be):Be=e[44];let Ie;e[45]!==Q.isLoadingMore||e[46]!==K?(Ie=K&&Q.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[45]=Q.isLoadingMore,e[46]=K,e[47]=Ie):Ie=e[47];let Pe;e[48]!==ct||e[49]!==Fe||e[50]!==Ae||e[51]!==dt||e[52]!==ut||e[53]!==ft||e[54]!==mt||e[55]!==Be||e[56]!==Ie?(Pe=s.jsxs("div",{className:De,children:[ct,Fe,Ae,dt,ut,ft,mt,Be,Ie]}),e[48]=ct,e[49]=Fe,e[50]=Ae,e[51]=dt,e[52]=ut,e[53]=ft,e[54]=mt,e[55]=Be,e[56]=Ie,e[57]=Pe):Pe=e[57];let Ee;e[58]!==C||e[59]!==E.length||e[60]!==X||e[61]!==d||e[62]!==g||e[63]!==W?(Ee=E.length===0&&W.length===0&&X.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?g("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):g(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=E.length,e[60]=X,e[61]=d,e[62]=g,e[63]=W,e[64]=Ee):Ee=e[64];let Ve;e[65]!==de||e[66]!==Pe||e[67]!==Ee?(Ve=s.jsxs("div",{className:de,children:[Pe,Ee]}),e[65]=de,e[66]=Pe,e[67]=Ee,e[68]=Ve):Ve=e[68];let Qe;return e[69]!==z||e[70]!==Ve?(Qe=s.jsxs(s.Fragment,{children:[z,Ve]}),e[69]=z,e[70]=Ve,e[71]=Qe):Qe=e[71],Qe}function Hs(t){return!t.verified&&!st(t._meta)?.verified&&!t.meta?.verified}function Ys(t){return t.verified||st(t._meta)?.verified||t.meta?.verified}function Ws(t){return t.app_name}function Xs(t){return t.app_name}function Js(t){return t?.items??[]}function Zs(t,e){if(t?.hasMore)return e.reduce(eo,0)}function eo(t,e){return t+(e?.items?.length??0)}function to(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function Ji({open:t,onOpenChange:e,defaultTab:n,initialSearch:o="",...r}){const a=ae(),i=r.mode??"add",m="agentId"in r?r.agentId:void 0,c="addedConnectionIds"in r?r.addedConnectionIds??new Set:new Set,d="onAdd"in r&&r.onAdd?r.onAdd:N=>{},u=(N,T,F)=>{m&&ie("agent_connection_attached",{agent_id:m,connection_id:N,app_name:T,mode:F})},[p,l]=H.useState(null),[f,j]=H.useState(o),[g,x]=H.useState(!1),[y,S]=H.useState(t);t!==y&&(S(t),t&&j(o));const{org:b}=je(),{data:k}=Yt.useSession(),v=ln(),C=it(),D=Pn(),h=N=>{e(!1),D({to:"/$org/settings/connections/$appSlug",params:{org:b.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const T=N.queryKey;return T[1]===b.id&&T[3]==="collection"&&T[4]==="CONNECTIONS"}})},w=async(N,T)=>{ie("connection_oauth_succeeded",{connection_id:N,flow:T});const F=new URL(`/api/${b.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ue.isMCPAuthenticated(F.href,null)}),_()},P=async N=>{l(N.app_name??N.id);try{const F=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await v.create.mutateAsync({title:F,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,B=await jt({connectionId:I,orgId:b.id,orgSlug:b.slug,persistFallback:R=>v.update.mutateAsync({id:I,data:{connection_token:R}}).then(()=>{})});if(B.ran&&!B.ok){ie("connection_oauth_failed",{connection_id:I,flow:"clone",error:B.error??"no_token"}),ce.error(a("virtualMcp.addConnectionDialog.authenticationFailedError",{error:B.error??"no token received"})),await v.delete.mutateAsync(I);return}B.ran&&await w(I,"clone"),u(I,N.app_name??null,"clone"),d(I)}catch(T){console.error("Failed to add connection:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},V=async N=>{if(!(!b||!k?.user?.id)){l(N.id);try{const T=Kn(N,b.id,k.user.id,{remoteIndex:0}),F=T.connection_type==="STDIO",$=!!T.connection_url,I=F&&T.connection_headers&&typeof T.connection_headers=="object"&&"command"in T.connection_headers;if(!$&&!I){ce.error(a("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:B}=await v.create.mutateAsync(T),R=await jt({connectionId:B,orgId:b.id,orgSlug:b.slug,persistFallback:G=>v.update.mutateAsync({id:B,data:{connection_token:G}}).then(()=>{})});if(R.ran&&!R.ok){ie("connection_oauth_failed",{connection_id:B,flow:"connect_new",error:R.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:R.error??"no token received"})}),u(B,T.app_name??null,"new"),d(B);return}R.ran?(await w(B,"connect_new"),ce.success(a("virtualMcp.addConnectionDialog.connectedAuthenticated"))):ce.success(a("virtualMcp.addConnectionDialog.connected")),u(B,T.app_name??null,"new"),d(B)}catch(T){console.error("Failed to connect:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return s.jsxs(Jt,{open:t,onOpenChange:e,children:[s.jsxs(Zt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(en,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(tn,{className:"text-base font-semibold",children:a(i==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(On,{value:f,onChange:j,placeholder:a("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(H.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),children:s.jsx(Gs,{mode:i,agentId:m,addedConnectionIds:c,onAdd:d,onCloneAndAdd:P,onConnectAndAdd:V,connectingItemId:p,search:f,onCreateConnection:()=>x(!0),onBrowseNavigate:h,defaultTab:n})})]}),s.jsx(qs,{open:g,onOpenChange:x,onCreated:async N=>{x(!1);const T=await jt({connectionId:N,orgId:b.id,orgSlug:b.slug,persistFallback:F=>v.update.mutateAsync({id:N,data:{connection_token:F}}).then(()=>{})});if(T.ran&&!T.ok){ie("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:T.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:T.error??"no token received"})}),u(N,null,"custom"),d(N),e(!1);return}T.ran&&await w(N,"custom_create"),u(N,null,"custom"),d(N),e(!1)}})]})}const Kt=new Map;function Zi(){const{org:t}=je(),e=kt(),n=Ss(),o=n.find(x=>x.providerId==="deco"),{data:r,isLoading:a,refetch:i,isFetching:m}=rt({queryKey:ue.aiProviderCredits(t.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=r?.balanceCents??null,d=c!=null?c/100:null,u=H.useRef(new Map);if(c!=null){const x=Kt.get(t.id);u.current.get(t.id)&&x!=null&&c>x&&ie("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Kt.set(t.id,c),u.current.set(t.id,!0)}const p=!!o,l=c!=null&&c>0,f=c!=null&&c===0,j=c!=null&&c===200,g=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:d,hasCredits:l,isZeroBalance:f,isInitialFreeCredit:j,hasOnlyDecoProvider:g,isLoading:a,isFetching:m,refetch:i}}const no=4,so="TASK";function oo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,no)||so}function io(t,e){return e==null?null:`${oo(t)}-${String(e).padStart(2,"0")}`}const ro=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function ao(t){const e=ro.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function zt(t){const e=Y.c(8),{size:n,className:o}=t,r=n===void 0?16:n;let a;e[0]!==r?(a={width:r,height:r},e[0]=r,e[1]=a):a=e[1];let i;e[2]!==o?(i=re("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=i):i=e[3];let m;return e[4]!==r||e[5]!==a||e[6]!==i?(m=s.jsx("img",{src:Ns,alt:"Super Agent",width:r,height:r,style:a,className:i}),e[4]=r,e[5]=a,e[6]=i,e[7]=m):m=e[7],m}const Ue=["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations"],lo=["overview","reports","board","site-editor"],Bt=1,co=["assets","hosting","e2e","analytics","cdn"];function er(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const o=e?.id===t?e:n?.id===t?n:null;return{project:o,resolvedScopeId:o?t:null}}function tr(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function gn(t,e){const n=new Set(t??[]);if(e!==Bt)for(const o of lo)n.add(o);return Ue.filter(o=>n.has(o))}function uo(t){return Ue.some(e=>e===t)}function fo(t){return co.some(e=>e===t)}function mo(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,automations:!0}}function nr(t,e,n){const o=mo(e,n);return t?o:{...o,overview:!0,reports:!0,board:!0}}function sr(t,e,n){const o=new Set(gn(t,n));return Ue.filter(r=>e[r]&&o.has(r))}function or(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ir(t){return Ue.filter(e=>t[e])}function po(t,e,n){return!uo(t)||e[t]?!1:fo(t)?!(t==="assets"?n.assets:n.siteAccess):!0}function rr(t,e,n,o,r){return po(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!o.includes("content")||t==="code"&&r&&!o.includes("code")}function ar(t,e,n,o){const r=new Set(gn(t,o));return n?r.add(e):r.delete(e),Ue.filter(a=>r.has(a))}function Ke(t,e){return ue.optimisticProjectSidebarViews(t,e)}function Ye(t){return typeof t=="object"&&t!==null}function hn(t,e){return t[1]===e&&t[3]==="collection"&&t[4]==="VIRTUAL_MCP"}function go(t,e){if(!Ye(t))return t;if("item"in t&&Ye(t.item)&&t.item.id===e.id)return{...t,item:e};if(!("structuredContent"in t)||!Ye(t.structuredContent))return t;const n=t.structuredContent.items;if(!Array.isArray(n))return t;let o=!1;const r=n.map(a=>!Ye(a)||a.id!==e.id?a:(o=!0,e));return o?{...t,structuredContent:{...t.structuredContent,items:r}}:t}function lr(t,e,n){t.setQueriesData({predicate:o=>hn(o.queryKey,e)},o=>go(o,n))}function cr(t,e,n){const o=t.getQueriesData({predicate:r=>hn(r.queryKey,e)&&r.queryKey[5]===n});for(const[,r]of o)if(r?.item?.id===n)return r.item;return null}function It(t,e,n){return t.getQueryData(Ke(e,n))??null}function ho(t,e){if(e)return{sidebarViews:[...e.views],sidebarViewsVersion:Bt};const n=t?.sidebarViews;return{sidebarViews:n===null?null:n?[...n]:void 0,sidebarViewsVersion:t?.sidebarViewsVersion}}function dr(t,e,n){return e?{sidebarViews:[...e.views],sidebarViewsVersion:Bt}:n===void 0?{sidebarViews:t.sidebarViews===null?null:t.sidebarViews?[...t.sidebarViews]:void 0,sidebarViewsVersion:t.sidebarViewsVersion}:ho(n,null)}function xo(t,e,n,o,r){const a=It(t,e,n),i={revision:(a?.revision??0)+1,views:[...o],rollbackViews:a?[...a.rollbackViews]:[...r]};return t.setQueryData(Ke(e,n),i),{revision:i.revision,views:[...i.views],persistedViews:[...i.rollbackViews]}}function jo(t,e,n){const o=It(t,e,n);return o?{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}:null}function xn(t,e){const n=new Set(t),o=new Set(e);return n.size===o.size&&[...n].every(r=>o.has(r))}function ur(t){return t?!xn(t.views,t.persistedViews):!1}function yo(t,e,n,{snapshot:o,saved:r,authoritativeViews:a}){if(!o)return{settledLatest:!1,reconciledViews:null};const i=It(t,e,n);if(!i||o.revision>i.revision)return{settledLatest:!1,reconciledViews:null};const m=a!==void 0?[...a]:r?[...o.views]:null,c={...i,rollbackViews:m??i.rollbackViews};return c.rollbackViews!==i.rollbackViews&&t.setQueryData(Ke(e,n),c),o.revision!==i.revision?{settledLatest:!1,reconciledViews:null}:(t.setQueryData(Ke(e,n),null),{settledLatest:!0,reconciledViews:r?m&&!xn(m,o.views)?m:null:[...c.rollbackViews]})}function fr(t){const e=Y.c(5),{org:n}=je(),o=t??"";let r;e[0]!==n.id||e[1]!==o?(r=Ke(n.id,o),e[0]=n.id,e[1]=o,e[2]=r):r=e[2];let a;e[3]!==r?(a={queryKey:r,queryFn:bo,enabled:!1,staleTime:Number.POSITIVE_INFINITY},e[3]=r,e[4]=a):a=e[4];const{data:i}=rt(a);return i?.views}async function bo(){return null}function mr(t){const e=Y.c(4),{org:n}=je(),o=it();let r;return e[0]!==n||e[1]!==o||e[2]!==t?(r={stage:(a,i)=>xo(o,n.id,t,a,i),snapshot:()=>jo(o,n.id,t),settle:a=>yo(o,n.id,t,a)},e[0]=n,e[1]=o,e[2]=t,e[3]=r):r=e[3],r}function vo(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(o=>{const r=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===n||r===n||r===`deco-assets-${n}`})??null}function pr(t){const e=Y.c(10),{org:n}=je(),o=En(),r=Ds(),a=ws(),i=Ts(t),m=o.hostingEnabled===!0,c=o.monitorEnabled===!0||o.auth.localMode===!0,d=(m||c)&&!!i,u=rt({queryKey:ue.hostingAccess(n.slug,i??""),queryFn:async()=>{const v=await fetch(`/api/${n.slug}/hosting/${encodeURIComponent(i??"")}/access`);return v.ok?await v.json():{owned:!1,canWrite:!1}},enabled:d,staleTime:6e4}),p=u.data?.owned===!0,l=!!vo(a.data?.configs??[],i),f=m&&p&&r.hosting,j=m&&p&&r.e2e,g=m&&p&&r.analytics,x=c&&p&&r.monitor;let y;e[0]!==l||e[1]!==f||e[2]!==j||e[3]!==g||e[4]!==x?(y={assets:l,hosting:f,e2e:j,analytics:g,cdn:x},e[0]=l,e[1]=f,e[2]=j,e[3]=g,e[4]=x,e[5]=y):y=e[5];const S=!!i&&a.isPending,b=d&&u.isPending;let k;return e[6]!==y||e[7]!==S||e[8]!==b?(k={presence:y,assetsPending:S,siteAccessPending:b},e[6]=y,e[7]=S,e[8]=b,e[9]=k):k=e[9],k}const Ut=()=>0;function Co(t){const{orgSlug:e,enabled:n=!0,onUpdate:o,onDelete:r,onResync:a}=t,i=H.useRef(o);i.current=o;const m=H.useRef(r);m.current=r;const c=H.useRef(a);c.current=a;const d=H.useRef(null),u=H.useRef(n),p=H.useRef(e);(!d.current||u.current!==n||p.current!==e)&&(u.current=n,p.current=e,d.current=f=>{if(!n||!e)return()=>{};const j=g=>{let x;try{x=JSON.parse(g.data)}catch{return}x.data&&(g.type===Fs?m.current?.(x.data.id):i.current(x.data)),f()};return Is.subscribe(e,j,()=>c.current?.())}),H.useSyncExternalStore(d.current,Ut,Ut)}function ko(t,e){return{queryKey:ue.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function No(){const t=Y.c(21),{org:e,locator:n}=je(),o=it();let r;t[0]!==n?(r=ue.taskBoardItems(n),t[0]=n,t[1]=r):r=t[1];const a=r;let i;t[2]!==n||t[3]!==o||t[4]!==a?(i=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.some(j=>j.id===l.id)?f.items.map(j=>j.id===l.id?l:j):[l,...f.items]}),o.invalidateQueries({queryKey:ue.taskBoardActivity(n,l.id)})},t[2]=n,t[3]=o,t[4]=a,t[5]=i):i=t[5];let m,c;t[6]!==o||t[7]!==a?(m=()=>{o.invalidateQueries({queryKey:a})},c=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.filter(j=>j.id!==l)})},t[6]=o,t[7]=a,t[8]=m,t[9]=c):(m=t[8],c=t[9]);let d;t[10]!==e.slug||t[11]!==i||t[12]!==m||t[13]!==c?(d={orgSlug:e.slug,onUpdate:i,onResync:m,onDelete:c},t[10]=e.slug,t[11]=i,t[12]=m,t[13]=c,t[14]=d):d=t[14],Co(d);let u;t[15]!==o||t[16]!==a?(u=l=>{const f=l.subject,j=l.data.status;o.cancelQueries({queryKey:a}),o.setQueryData(a,g=>g&&{...g,items:g.items.map(x=>x.threads.some(y=>y.threadId===f)?{...x,threads:x.threads.map(y=>y.threadId===f?{...y,status:j}:y)}:x)})},t[15]=o,t[16]=a,t[17]=u):u=t[17];let p;t[18]!==e.slug||t[19]!==u?(p={orgSlug:e.slug,onTaskStatus:u},t[18]=e.slug,t[19]=u,t[20]=p):p=t[20],Ps(p)}function gr(){const t=Y.c(9),{locator:e}=je(),n=kt();let o;t[0]!==e||t[1]!==n?(o=ko(e,n),t[0]=e,t[1]=n,t[2]=o):o=t[2];const r=rt(o);No();let a;t[3]!==r.data?.items?(a=r.data?.items??[],t[3]=r.data?.items,t[4]=a):a=t[4];let i;return t[5]!==r.error||t[6]!==r.isLoading||t[7]!==a?(i={items:a,isLoading:r.isLoading,error:r.error},t[5]=r.error,t[6]=r.isLoading,t[7]=a,t[8]=i):i=t[8],i}function hr(){const t=Y.c(70),{org:e,locator:n}=je(),o=kt(),r=it(),a=ae();let i;t[0]!==n?(i=ue.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const m=i;let c;t[2]!==r||t[3]!==m?(c=()=>r.invalidateQueries({queryKey:m}),t[2]=r,t[3]=m,t[4]=c):c=t[4];const d=c;let u;t[5]!==o?(u=E=>o.call("TASK_BOARD_ITEM_CREATE",E),t[5]=o,t[6]=u):u=t[6];let p;t[7]!==d||t[8]!==u?(p={mutationFn:u,onSuccess:d},t[7]=d,t[8]=u,t[9]=p):p=t[9];const l=Oe(p);let f;t[10]!==o?(f=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[10]=o,t[11]=f):f=t[11];let j;t[12]!==r||t[13]!==m?(j=async E=>{await r.cancelQueries({queryKey:m});const U=r.getQueryData(m);return r.setQueryData(m,M=>M&&{...M,items:M.items.map(Q=>Q.id===E.id?{...Q,...E}:Q)}),{previous:U}},t[12]=r,t[13]=m,t[14]=j):j=t[14];let g;t[15]!==e?(g=(E,U)=>{U.status==="done"&&ie("task_marked_done",{organization_id:e.id,task_board_item_id:U.id})},t[15]=e,t[16]=g):g=t[16];let x;t[17]!==r||t[18]!==m?(x=(E,U,M)=>{M?.previous&&r.setQueryData(m,M.previous)},t[17]=r,t[18]=m,t[19]=x):x=t[19];let y;t[20]!==d||t[21]!==n||t[22]!==r?(y=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[20]=d,t[21]=n,t[22]=r,t[23]=y):y=t[23];let S;t[24]!==f||t[25]!==j||t[26]!==g||t[27]!==x||t[28]!==y?(S={mutationFn:f,onMutate:j,onSuccess:g,onError:x,onSettled:y},t[24]=f,t[25]=j,t[26]=g,t[27]=x,t[28]=y,t[29]=S):S=t[29];const b=Oe(S);let k;t[30]!==o?(k=E=>o.call("TASK_BOARD_ITEM_DELETE",{id:E}),t[30]=o,t[31]=k):k=t[31];let v;t[32]!==d||t[33]!==a?(v=E=>{ce.error(E instanceof Error&&E.message?E.message:a("taskBoard.taskBoard.deleteError")),d()},t[32]=d,t[33]=a,t[34]=v):v=t[34];let C;t[35]!==d||t[36]!==k||t[37]!==v?(C={mutationFn:k,onSuccess:d,onError:v},t[35]=d,t[36]=k,t[37]=v,t[38]=C):C=t[38];const D=Oe(C);let h;t[39]!==o?(h=async E=>{const U=await Promise.allSettled(E.map(M=>o.call("TASK_BOARD_ITEM_DELETE",{id:M})));return{total:E.length,failed:U.filter(_o).length}},t[39]=o,t[40]=h):h=t[40];let _,w;t[41]!==a?(_=E=>{const{total:U,failed:M}=E;M!==0&&ce.error(a("taskBoard.taskBoard.deleteBulkError",{failed:String(M),total:String(U)}))},w=()=>ce.error(a("taskBoard.taskBoard.deleteError")),t[41]=a,t[42]=_,t[43]=w):(_=t[42],w=t[43]);let P;t[44]!==d||t[45]!==h||t[46]!==_||t[47]!==w?(P={mutationFn:h,onSuccess:_,onError:w,onSettled:d},t[44]=d,t[45]=h,t[46]=_,t[47]=w,t[48]=P):P=t[48];const V=Oe(P);let N;t[49]!==o?(N=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[49]=o,t[50]=N):N=t[50];let T;t[51]!==d||t[52]!==N?(T={mutationFn:N,onSuccess:d},t[51]=d,t[52]=N,t[53]=T):T=t[53];const F=Oe(T);let $;t[54]!==o?($=E=>o.call("TASK_BOARD_ITEM_RERUN",E),t[54]=o,t[55]=$):$=t[55];let I;t[56]!==d||t[57]!==n||t[58]!==r?(I=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[56]=d,t[57]=n,t[58]=r,t[59]=I):I=t[59];let B;t[60]!==$||t[61]!==I?(B={mutationFn:$,onSettled:I},t[60]=$,t[61]=I,t[62]=B):B=t[62];const R=Oe(B);let G;return t[63]!==l||t[64]!==F||t[65]!==D||t[66]!==V||t[67]!==R||t[68]!==b?(G={create:l,update:b,remove:D,removeMany:V,link:F,rerun:R},t[63]=l,t[64]=F,t[65]=D,t[66]=V,t[67]=R,t[68]=b,t[69]=G):G=t[69],G}function _o(t){return t.status==="rejected"}const So=["ended_after_delivery","superseded"];function wo(t){return!!t&&So.includes(t)}function xr(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function jr(t){return t.failureKind!=="superseded"}function jn(t){return t.threads.some(e=>e.status==="requires_action")}function yr(t){return t.status==="in_review"&&!t.assigneeId}function br(t){return jn(t)}function vr(t){return t.status==="in_progress"&&jn(t)?"text-warning animate-pulse":bn(t.status).iconClassName}function Cr(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!wo(n.failureKind))?"failed":null}function kr(t,e,n){const o=t.findIndex(u=>u.id===n),r=e===n?t[o+1]?.id??null:e,a=t.filter(u=>u.id!==n),i=r?a.findIndex(u=>u.id===r):-1,m=i===-1?a.length:i,c=a[m-1],d=a[m];return c&&d?(c.sortOrder+d.sortOrder)/2:c?c.sortOrder+1:d?d.sortOrder-1:0}function Nr(t,e){return Array.from({length:e},(n,o)=>t-(e-1-o)*1e-4)}const Do=["archived"],yn={triage:{labelKey:"taskBoard.config.statusBacklog",icon:$s,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:pn,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:is,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:zs,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:os,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:fs,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:ss,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Ks,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Vn,iconClassName:"text-muted-foreground"}},To={icon:pn,iconClassName:"text-muted-foreground"},Fo=yn;function bn(t){return Fo[t]??To}function _r(t,e){const n=yn[t];return{label:n?e(n.labelKey):t,visual:bn(t)}}const Sr=["bug","feature","chore","spike","security"],wr={bug:{labelKey:"taskBoard.config.typeBug",icon:Qs,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:ls,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:as,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:rs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Us,iconClassName:"text-purple-500"}};function bt(t){return Bs.includes(t)}function Dr(t){return Nt.filter(e=>t||!bt(e))}function Tr({deliveryEnabled:t,shownLanes:e,occupied:n}){const o=Nt.filter(i=>t||!bt(i)||n.includes(i)),r=o.filter(i=>Do.includes(i)||!t&&bt(i)),a=r.filter(i=>!e.includes(i));return{lanes:o.filter(i=>!a.includes(i)),hidden:a,hideable:r}}const Qt="lane:";function Ao(t){return Nt.includes(t)}function Fr({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),o=n.startsWith(Qt)?n.slice(Qt.length):e(n);return o!==void 0&&Ao(o)?o:null}const Bo=["none","low","medium","high","urgent"],We={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Vt,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ns,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Vt,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:ts,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:es,iconClassName:"text-destructive"}};function Ar(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Io*864e5?"soon":null}const Io=3;function qt(t){return`color-mix(in oklab, ${t??As} var(--user-color-strength), transparent)`}function vn(t){return t?.projects.length===1?t.projects[0]:void 0}function Po(t){return vn(t)?t.repo:t.projects.length>1?t.projects.map(e=>e.title).join(", "):null}function Cn(t){const e=Y.c(6),{entry:n}=t;let o;e[0]!==n?(o=vn(n),e[0]=n,e[1]=o):o=e[1];const r=o;if(r){let i;return e[2]!==r.icon||e[3]!==r.title?(i=s.jsx(Os,{icon:r.icon,name:r.title}),e[2]=r.icon,e[3]=r.title,e[4]=i):i=e[4],i}let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:s.jsx(Ms,{className:"size-3"})}),e[5]=a):a=e[5],a}function Eo(t){const e=Y.c(14),{entry:n}=t;let o;e[0]!==n?(o=Po(n),e[0]=n,e[1]=o):o=e[1];const r=o;let a;e[2]!==n?(a=s.jsx(Cn,{entry:n}),e[2]=n,e[3]=a):a=e[3];let i;e[4]!==n.title?(i=s.jsx("span",{className:"truncate",children:n.title}),e[4]=n.title,e[5]=i):i=e[5];let m;e[6]!==r?(m=r&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[6]=r,e[7]=m):m=e[7];let c;e[8]!==i||e[9]!==m?(c=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[i,m]}),e[8]=i,e[9]=m,e[10]=c):c=e[10];let d;return e[11]!==a||e[12]!==c?(d=s.jsxs(s.Fragment,{children:[a,c]}),e[11]=a,e[12]=c,e[13]=d):d=e[13],d}const at="__no_repo__";function Se(t){return(t??"").trim().toLowerCase()}function Vo(t,e){const n=(t.created_at??"").localeCompare(e.created_at??"");return n!==0?n:t.id.localeCompare(e.id)}function Mo(t){return t.projects.length===1?t.projects[0]?.title??t.repo??t.id:t.repo??t.id}function Br(t,e=[]){const n=new Map,o=new Map,r=[],a=u=>{const p=Se(u),l=n.get(p);if(l)return l;const f={id:p,kind:"repo",repo:u.trim(),title:u.trim(),projects:[]};return n.set(p,f),f};for(const u of t){const p=Ls(u);if(p){const f=a(p);f.projects.push(u),o.set(u.id,f);continue}const l={id:u.id,kind:"project",repo:null,title:u.title,projects:[u]};r.push(l),o.set(u.id,l)}for(const u of e){const p=(u??"").trim();p&&a(p)}for(const u of n.values())u.projects.sort(Vo),u.title=Mo(u);const i=[...n.values()].filter(u=>u.projects.length>0),m=[...n.values()].filter(u=>u.projects.length===0),c=(u,p)=>u.title.localeCompare(p.title),d=[...[...i,...r].sort(c),...m.sort(c)];return{entries:d,byId:new Map(d.map(u=>[u.id,u])),byRepo:n,byProject:o}}function vt(t,e){for(const o of t.threads??[]){const r=o.virtualMcpId?e.byProject.get(o.virtualMcpId):void 0;if(r)return r}const n=Se(t.repo);return(n?e.byRepo.get(n):void 0)??null}function Oo(t,e){const n=vt(t,e);if(!n)return[];if(n.projects.length<=1)return n.projects;for(const o of t.threads??[]){const r=o.virtualMcpId?n.projects.find(a=>a.id===o.virtualMcpId):void 0;if(r)return[r]}return n.projects}function Ir(t,e){const n=Oo(t,e);return n.length===1?n[0]??null:null}function Pt(t,e){return e.byId.get(t)??e.byRepo.get(Se(t))??e.byProject.get(t)}function kn(t,e,n){if(e===null)return!0;if(e===at)return vt(t,n)===null;const o=Pt(e,n);return o?o.repo&&Se(t.repo)===Se(o.repo)?!0:vt(t,n)===o:e.includes("/")?Se(t.repo)===Se(e):!0}function lt(t,e){return t===null?!1:t===at?!0:!!Pt(t,e)||t.includes("/")}function Pr(t,e,n){return e===null?null:kn(t,e,n)?e:null}function Er(t){return t.entries.filter(e=>e.repo!==null&&(e.projects.length===0||e.projects.some(n=>Rs(n).status!=="detached")))}const Ct="__unassigned__",Re="__any__",Nn={assignee:null,priority:null,due:null,tags:[],project:null,search:""};function Lo(t,e){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||lt(t.project,e)||t.search.trim()!==""}function Ro(t,e){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(lt(t.project,e)?1:0)+(t.search.trim()!==""?1:0)}const $o=864e5;function Ko(t,e){const n=new Date(t),o=new Date(e);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()&&n.getDate()===o.getDate()}function _n(t,e){const n=t.trim();return n===""?!1:e!=null&&ao(n)===e}function zo(t,e){return t.assigneeId===e?!0:t.assigneeId===yt&&t.assignedBy===e}function Vr(t,e,n){const o=e.search.trim().toLowerCase();if(o!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(o)&&!_n(o,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===Ct){if(t.assigneeId!==null)return!1}else if(!zo(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const r=new Date(t.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&r>=a||e.due==="today"&&!Ko(r,a)||e.due==="week"&&(r<a||r>a+7*$o))return!1}if(e.tags.length>0){const r=t.tags.map(a=>a.id);if(!e.tags.some(a=>r.includes(a)))return!1}return!!kn(t,e.project,n)}const Gt={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function we(t,e=!1){return re("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Uo(t){const e=Y.c(107),{value:n,members:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Rt,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let u=d,p;e[1]!==i?(p=i("taskBoard.taskFilters.assigneeLabel"),e[1]=i,e[2]=p):p=e[2];let l=p;if(n===Ct){let O;e[3]!==i?(O=i("taskBoard.taskFilters.assigneeUnassigned"),e[3]=i,e[4]=O):O=e[4],l=O}else if(n===yt){let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(zt,{size:14}),e[5]=O):O=e[5],u=O;let L;e[6]!==i?(L=i("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=i,e[7]=L):L=e[7],l=L}else if(n){let O,L,oe,z;if(e[8]!==o||e[9]!==n){let De;e[14]!==n?(De=Te=>Te.userId===n,e[14]=n,e[15]=De):De=e[15],L=o.find(De),O=Lt,oe=L?.user?.image??void 0,z=$t(L?.user?.name),e[8]=o,e[9]=n,e[10]=O,e[11]=L,e[12]=oe,e[13]=z}else O=e[10],L=e[11],oe=e[12],z=e[13];let ve;e[16]!==O||e[17]!==oe||e[18]!==z?(ve=s.jsx(O,{url:oe,fallback:z,shape:"circle",size:"2xs"}),e[16]=O,e[17]=oe,e[18]=z,e[19]=ve):ve=e[19],u=ve;let de;e[20]!==L?.user?.name||e[21]!==i?(de=L?.user?.name??i("taskBoard.taskFilters.assigneeMember"),e[20]=L?.user?.name,e[21]=i,e[22]=de):de=e[22],l=de}let f;e[23]!==r?(f=O=>{r(O),c(!1)},e[23]=r,e[24]=f):f=e[24];const j=f,g=n!==null;let x;e[25]!==a||e[26]!==g?(x=we(g,a),e[25]=a,e[26]=g,e[27]=x):x=e[27];const y=x,S=a&&"ml-auto";let b;e[28]!==S?(b=re("shrink-0 opacity-60",S),e[28]=S,e[29]=b):b=e[29];const k=b;let v;e[30]!==l?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[30]=l,e[31]=v):v=e[31];let C;e[32]!==k?(C=s.jsx(ze,{size:12,className:k}),e[32]=k,e[33]=C):C=e[33];let D;e[34]!==u||e[35]!==v||e[36]!==C||e[37]!==y?(D=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:y,children:[u,v,C]})}),e[34]=u,e[35]=v,e[36]=C,e[37]=y,e[38]=D):D=e[38];let h;e[39]!==i?(h=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=i,e[40]=h):h=e[40];let _;e[41]!==i?(_=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=i,e[42]=_):_=e[42];let w;e[43]!==h||e[44]!==_?(w=s.jsx(Dt,{placeholder:h,"aria-label":_,className:"h-9"}),e[43]=h,e[44]=_,e[45]=w):w=e[45];let P;e[46]!==i?(P=i("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=i,e[47]=P):P=e[47];let V;e[48]!==P?(V=s.jsx(Tt,{children:P}),e[48]=P,e[49]=V):V=e[49];let N;e[50]!==i?(N=i("taskBoard.taskFilters.assigneeAnyone"),e[50]=i,e[51]=N):N=e[51];let T;e[52]!==j?(T=()=>j(null),e[52]=j,e[53]=T):T=e[53];let F;e[54]!==i?(F=i("taskBoard.taskFilters.assigneeAnyone"),e[54]=i,e[55]=F):F=e[55];let $;e[56]!==N||e[57]!==T||e[58]!==F?($=s.jsx(Ce,{value:N,onSelect:T,children:F}),e[56]=N,e[57]=T,e[58]=F,e[59]=$):$=e[59];let I;e[60]!==i?(I=i("taskBoard.taskFilters.assigneeUnassigned"),e[60]=i,e[61]=I):I=e[61];let B;e[62]!==j?(B=()=>j(Ct),e[62]=j,e[63]=B):B=e[63];let R;e[64]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Rt,{size:16,className:"text-muted-foreground"}),e[64]=R):R=e[64];let G;e[65]!==i?(G=i("taskBoard.taskFilters.assigneeUnassigned"),e[65]=i,e[66]=G):G=e[66];let E;e[67]!==I||e[68]!==B||e[69]!==G?(E=s.jsxs(Ce,{value:I,onSelect:B,className:"gap-2",children:[R,G]}),e[67]=I,e[68]=B,e[69]=G,e[70]=E):E=e[70];let U;e[71]!==i?(U=i("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=i,e[72]=U):U=e[72];let M;e[73]!==j?(M=()=>j(yt),e[73]=j,e[74]=M):M=e[74];let Q;e[75]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(zt,{size:16}),e[75]=Q):Q=e[75];let Z;e[76]!==i?(Z=i("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=i,e[77]=Z):Z=e[77];let ee;e[78]!==U||e[79]!==M||e[80]!==Z?(ee=s.jsxs(Ce,{value:U,onSelect:M,className:"gap-2",children:[Q,Z]}),e[78]=U,e[79]=M,e[80]=Z,e[81]=ee):ee=e[81];let K;e[82]!==$||e[83]!==E||e[84]!==ee?(K=s.jsxs(Le,{children:[$,E,ee]}),e[82]=$,e[83]=E,e[84]=ee,e[85]=K):K=e[85];let ne;e[86]!==i?(ne=i("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=i,e[87]=ne):ne=e[87];let W;if(e[88]!==o||e[89]!==j){let O;e[91]!==j?(O=L=>s.jsxs(Ce,{value:L.user?.name??L.userId,onSelect:()=>j(L.userId),className:"gap-2",children:[s.jsx(Lt,{url:L.user?.image??void 0,fallback:$t(L.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:L.user?.name??L.userId})]},L.userId),e[91]=j,e[92]=O):O=e[92],W=o.map(O),e[88]=o,e[89]=j,e[90]=W}else W=e[90];let X;e[93]!==ne||e[94]!==W?(X=s.jsx(Le,{heading:ne,children:W}),e[93]=ne,e[94]=W,e[95]=X):X=e[95];let J;e[96]!==V||e[97]!==K||e[98]!==X?(J=s.jsxs(Ft,{children:[V,K,X]}),e[96]=V,e[97]=K,e[98]=X,e[99]=J):J=e[99];let te;e[100]!==w||e[101]!==J?(te=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[w,J]})}),e[100]=w,e[101]=J,e[102]=te):te=e[102];let se;return e[103]!==m||e[104]!==D||e[105]!==te?(se=s.jsxs(wt,{open:m,onOpenChange:c,children:[D,te]}),e[103]=m,e[104]=D,e[105]=te,e[106]=se):se=e[106],se}function Qo(t){const e=Y.c(33),{value:n,onChange:o,block:r}=t,a=ae(),i=n!==null;let m;e[0]!==r||e[1]!==i?(m=we(i,r),e[0]=r,e[1]=i,e[2]=m):m=e[2];const c=m,d=r&&"ml-auto";let u;e[3]!==d?(u=re("shrink-0 opacity-60",d),e[3]=d,e[4]=u):u=e[4];const p=u;let l;e[5]!==n?(l=n?s.jsx("span",{className:re("size-2 shrink-0 rounded-full",We[n].dotClassName)}):s.jsx(Es,{size:14,className:"shrink-0"}),e[5]=n,e[6]=l):l=e[6];let f;e[7]!==a||e[8]!==n?(f=a(n?We[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=a,e[8]=n,e[9]=f):f=e[9];let j;e[10]!==p?(j=s.jsx(ze,{size:12,className:p}),e[10]=p,e[11]=j):j=e[11];let g;e[12]!==l||e[13]!==f||e[14]!==j||e[15]!==c?(g=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[l,f,j]})}),e[12]=l,e[13]=f,e[14]=j,e[15]=c,e[16]=g):g=e[16];const x=n??Re;let y;e[17]!==o?(y=D=>o(D===Re?null:D),e[17]=o,e[18]=y):y=e[18];let S;e[19]!==a?(S=a("taskBoard.taskFilters.priorityAnyPriority"),e[19]=a,e[20]=S):S=e[20];let b;e[21]!==S?(b=s.jsx(ot,{value:Re,children:S}),e[21]=S,e[22]=b):b=e[22];let k;e[23]!==a?(k=Bo.map(D=>s.jsxs(ot,{value:D,className:"gap-2",children:[s.jsx("span",{className:re("size-2 rounded-full",We[D].dotClassName)}),a(We[D].labelKey)]},D)),e[23]=a,e[24]=k):k=e[24];let v;e[25]!==y||e[26]!==b||e[27]!==k||e[28]!==x?(v=s.jsx(un,{align:"start",className:"w-40",children:s.jsxs(fn,{value:x,onValueChange:y,children:[b,k]})}),e[25]=y,e[26]=b,e[27]=k,e[28]=x,e[29]=v):v=e[29];let C;return e[30]!==v||e[31]!==g?(C=s.jsxs(mn,{children:[g,v]}),e[30]=v,e[31]=g,e[32]=C):C=e[32],C}function qo(t){const e=Y.c(35),{value:n,onChange:o,block:r}=t,a=ae();let i;e[0]!==a||e[1]!==n?(i=n?a(Gt[n]):void 0,e[0]=a,e[1]=n,e[2]=i):i=e[2];const m=i,c=n!==null;let d;e[3]!==r||e[4]!==c?(d=we(c,r),e[3]=r,e[4]=c,e[5]=d):d=e[5];const u=d,p=r&&"ml-auto";let l;e[6]!==p?(l=re("shrink-0 opacity-60",p),e[6]=p,e[7]=l):l=e[7];const f=l;let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(xt,{size:14,className:"shrink-0"}),e[8]=j):j=e[8];let g;e[9]!==m||e[10]!==a?(g=m??a("taskBoard.taskFilters.dueDateLabel"),e[9]=m,e[10]=a,e[11]=g):g=e[11];let x;e[12]!==f?(x=s.jsx(ze,{size:12,className:f}),e[12]=f,e[13]=x):x=e[13];let y;e[14]!==g||e[15]!==x||e[16]!==u?(y=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:u,children:[j,g,x]})}),e[14]=g,e[15]=x,e[16]=u,e[17]=y):y=e[17];const S=n??Re;let b;e[18]!==o?(b=w=>o(w===Re?null:w),e[18]=o,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(xt,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==a?(v=a("taskBoard.taskFilters.dueDateAnyTime"),e[21]=a,e[22]=v):v=e[22];let C;e[23]!==v?(C=s.jsxs(ot,{value:Re,className:"gap-2",children:[k,v]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]!==a?(D=Object.entries(Gt).map(w=>{const[P,V]=w,N=P==="overdue";return s.jsxs(ot,{value:P,className:re("gap-2",N&&"text-destructive"),children:[s.jsx(xt,{size:16,className:re("shrink-0",N?"text-destructive":"text-muted-foreground")}),a(V)]},P)}),e[25]=a,e[26]=D):D=e[26];let h;e[27]!==S||e[28]!==b||e[29]!==C||e[30]!==D?(h=s.jsx(un,{align:"start",className:"w-44",children:s.jsxs(fn,{value:S,onValueChange:b,children:[C,D]})}),e[27]=S,e[28]=b,e[29]=C,e[30]=D,e[31]=h):h=e[31];let _;return e[32]!==h||e[33]!==y?(_=s.jsxs(mn,{children:[y,h]}),e[32]=h,e[33]=y,e[34]=_):_=e[34],_}function Go(t){const e=Y.c(56),{value:n,tags:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]!==r||e[1]!==n?(d=I=>r(n.includes(I)?n.filter(B=>B!==I):[...n,I]),e[0]=r,e[1]=n,e[2]=d):d=e[2];const u=d;let p;e[3]!==i||e[4]!==o||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?i("taskBoard.taskFilters.tagsLabel"):n.length===1?o.find(I=>I.id===n[0])?.name??i("taskBoard.taskFilters.tagsLabel"):i("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=i,e[4]=o,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const l=p,f=n.length>0;let j;e[8]!==a||e[9]!==f?(j=we(f,a),e[8]=a,e[9]=f,e[10]=j):j=e[10];const g=j,x=a&&"ml-auto";let y;e[11]!==x?(y=re("shrink-0 opacity-60",x),e[11]=x,e[12]=y):y=e[12];const S=y;let b;e[13]!==o||e[14]!==n[0]||e[15]!==n.length?(b=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(o.find(I=>I.id===n[0])?.color)}}):s.jsx(cs,{size:14,className:"shrink-0"}),e[13]=o,e[14]=n[0],e[15]=n.length,e[16]=b):b=e[16];let k;e[17]!==l?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[17]=l,e[18]=k):k=e[18];let v;e[19]!==S?(v=s.jsx(ze,{size:12,className:S}),e[19]=S,e[20]=v):v=e[20];let C;e[21]!==b||e[22]!==k||e[23]!==v||e[24]!==g?(C=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[b,k,v]})}),e[21]=b,e[22]=k,e[23]=v,e[24]=g,e[25]=C):C=e[25];let D;e[26]!==i?(D=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=i,e[27]=D):D=e[27];let h;e[28]!==i?(h=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=i,e[29]=h):h=e[29];let _;e[30]!==D||e[31]!==h?(_=s.jsx(Dt,{placeholder:D,"aria-label":h,className:"h-9"}),e[30]=D,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==i?(w=i("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=i,e[34]=w):w=e[34];let P;e[35]!==w?(P=s.jsx(Tt,{children:w}),e[35]=w,e[36]=P):P=e[36];let V;if(e[37]!==o||e[38]!==u||e[39]!==n){let I;e[41]!==u||e[42]!==n?(I=B=>s.jsxs(Ce,{value:B.name,onSelect:()=>u(B.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(B.color)}}),s.jsx("span",{className:"flex-1 truncate",children:B.name}),n.includes(B.id)&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"})]},B.id),e[41]=u,e[42]=n,e[43]=I):I=e[43],V=o.map(I),e[37]=o,e[38]=u,e[39]=n,e[40]=V}else V=e[40];let N;e[44]!==V?(N=s.jsx(Le,{children:V}),e[44]=V,e[45]=N):N=e[45];let T;e[46]!==P||e[47]!==N?(T=s.jsxs(Ft,{children:[P,N]}),e[46]=P,e[47]=N,e[48]=T):T=e[48];let F;e[49]!==_||e[50]!==T?(F=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[_,T]})}),e[49]=_,e[50]=T,e[51]=F):F=e[51];let $;return e[52]!==m||e[53]!==C||e[54]!==F?($=s.jsxs(wt,{open:m,onOpenChange:c,children:[C,F]}),e[52]=m,e[53]=C,e[54]=F,e[55]=$):$=e[55],$}function Ht(t){const e=Y.c(11),{entry:n,selected:o,onSelect:r}=t,a=n.id,i=n.title;let m;e[0]!==n.projects?(m=n.projects.map(Ho).join(" "),e[0]=n.projects,e[1]=m):m=e[1];const c=`${a} ${i} ${n.repo??""} ${m}`;let d;e[2]!==n?(d=s.jsx(Eo,{entry:n}),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"}),e[4]=o,e[5]=u):u=e[5];let p;return e[6]!==r||e[7]!==c||e[8]!==d||e[9]!==u?(p=s.jsxs(Ce,{value:c,onSelect:r,className:"gap-2",children:[d,u]}),e[6]=r,e[7]=c,e[8]=d,e[9]=u,e[10]=p):p=e[10],p}function Ho(t){return t.title}function Yo(t,e,n,o){return t===null||!n?o("taskBoard.taskFilters.projectLabel"):t===at?o("taskBoard.taskFilters.projectNone"):e?.title??t}function Wo(t){const e=Y.c(90),{value:n,index:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d,u,p,l,f,j,g,x,y,S,b,k,v,C;if(e[0]!==a||e[1]!==o||e[2]!==r||e[3]!==m||e[4]!==i||e[5]!==n){const P=n===null?void 0:Pt(n,o),V=lt(n,o),N=Yo(n,P,V,i);let T;e[20]!==r?(T=z=>{r(z),c(!1)},e[20]=r,e[21]=T):T=e[21];const F=T,$=o.entries.filter(Jo),I=o.entries.filter(Xo),B=we(V,a),R=a&&"ml-auto";let G;e[22]!==R?(G=re("shrink-0 opacity-60",R),e[22]=R,e[23]=G):G=e[23];const E=G;l=wt,v=m,C=c;const U=V?P:void 0;let M;e[24]!==U?(M=s.jsx(Cn,{entry:U}),e[24]=U,e[25]=M):M=e[25];let Q;e[26]!==N?(Q=s.jsx("span",{className:"max-w-[12rem] truncate",children:N}),e[26]=N,e[27]=Q):Q=e[27];let Z;e[28]!==E?(Z=s.jsx(ze,{size:12,className:E}),e[28]=E,e[29]=Z):Z=e[29],e[30]!==M||e[31]!==Q||e[32]!==Z||e[33]!==B?(j=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:B,children:[M,Q,Z]})}),e[30]=M,e[31]=Q,e[32]=Z,e[33]=B,e[34]=j):j=e[34],p=St,b="start",k="w-72 p-0",u=At;let ee;e[35]!==i?(ee=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[35]=i,e[36]=ee):ee=e[36];let K;e[37]!==i?(K=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[37]=i,e[38]=K):K=e[38],e[39]!==ee||e[40]!==K?(S=s.jsx(Dt,{placeholder:ee,"aria-label":K,className:"h-9"}),e[39]=ee,e[40]=K,e[41]=S):S=e[41],d=Ft;let ne;e[42]!==i?(ne=i("taskBoard.taskFilters.projectNoneFound"),e[42]=i,e[43]=ne):ne=e[43],e[44]!==ne?(f=s.jsx(Tt,{children:ne}),e[44]=ne,e[45]=f):f=e[45];let W;e[46]!==i?(W=i("taskBoard.taskFilters.projectAny"),e[46]=i,e[47]=W):W=e[47];let X;e[48]!==F?(X=()=>F(null),e[48]=F,e[49]=X):X=e[49];let J;e[50]!==i?(J=i("taskBoard.taskFilters.projectAny"),e[50]=i,e[51]=J):J=e[51];let te;e[52]!==W||e[53]!==X||e[54]!==J?(te=s.jsx(Ce,{value:W,onSelect:X,children:J}),e[52]=W,e[53]=X,e[54]=J,e[55]=te):te=e[55];let se;e[56]!==i?(se=i("taskBoard.taskFilters.projectNone"),e[56]=i,e[57]=se):se=e[57];let O;e[58]!==F?(O=()=>F(at),e[58]=F,e[59]=O):O=e[59];let L;e[60]!==i?(L=i("taskBoard.taskFilters.projectNone"),e[60]=i,e[61]=L):L=e[61];let oe;e[62]!==se||e[63]!==O||e[64]!==L?(oe=s.jsx(Ce,{value:se,onSelect:O,children:L}),e[62]=se,e[63]=O,e[64]=L,e[65]=oe):oe=e[65],e[66]!==te||e[67]!==oe?(g=s.jsxs(Le,{children:[te,oe]}),e[66]=te,e[67]=oe,e[68]=g):g=e[68],x=$.length>0&&s.jsx(Le,{heading:i("taskBoard.taskFilters.projectGroupProjects"),children:$.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),y=I.length>0&&s.jsx(Le,{heading:i("taskBoard.taskFilters.projectGroupRepos"),children:I.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),e[0]=a,e[1]=o,e[2]=r,e[3]=m,e[4]=i,e[5]=n,e[6]=d,e[7]=u,e[8]=p,e[9]=l,e[10]=f,e[11]=j,e[12]=g,e[13]=x,e[14]=y,e[15]=S,e[16]=b,e[17]=k,e[18]=v,e[19]=C}else d=e[6],u=e[7],p=e[8],l=e[9],f=e[10],j=e[11],g=e[12],x=e[13],y=e[14],S=e[15],b=e[16],k=e[17],v=e[18],C=e[19];let D;e[69]!==d||e[70]!==f||e[71]!==g||e[72]!==x||e[73]!==y?(D=s.jsxs(d,{children:[f,g,x,y]}),e[69]=d,e[70]=f,e[71]=g,e[72]=x,e[73]=y,e[74]=D):D=e[74];let h;e[75]!==u||e[76]!==D||e[77]!==S?(h=s.jsxs(u,{children:[S,D]}),e[75]=u,e[76]=D,e[77]=S,e[78]=h):h=e[78];let _;e[79]!==p||e[80]!==h||e[81]!==b||e[82]!==k?(_=s.jsx(p,{align:b,className:k,children:h}),e[79]=p,e[80]=h,e[81]=b,e[82]=k,e[83]=_):_=e[83];let w;return e[84]!==l||e[85]!==j||e[86]!==_||e[87]!==v||e[88]!==C?(w=s.jsxs(l,{open:v,onOpenChange:C,children:[j,_]}),e[84]=l,e[85]=j,e[86]=_,e[87]=v,e[88]=C,e[89]=w):w=e[89],w}function Xo(t){return t.projects.length===0}function Jo(t){return t.projects.length>0}function Zo(t){const e=Y.c(25),{value:n,onChange:o,block:r}=t,a=ae(),[i,m]=H.useState(n!==""),[c,d]=H.useState(!1),[u,p]=H.useState(n);n!==u&&(p(n),n===""&&!c&&m(!1));const l=i||r,f=l?"w-32 sm:w-44":"w-8 px-0 justify-center",j=r&&"h-10 w-full px-3 text-sm sm:w-full";let g;e[0]!==f||e[1]!==j?(g=re("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",f,j),e[0]=f,e[1]=j,e[2]=g):g=e[2];let x;e[3]!==a?(x=a("taskBoard.taskFilters.searchLabel"),e[3]=a,e[4]=x):x=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>m(!0),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ds,{size:14}),e[6]=S):S=e[6];let b;e[7]!==x?(b=s.jsx("button",{type:"button","aria-label":x,onClick:y,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=b):b=e[8];let k;e[9]!==r||e[10]!==l||e[11]!==o||e[12]!==a||e[13]!==n?(k=l&&s.jsx("input",{autoFocus:!r,value:n,onChange:D=>o(D.target.value),onFocus:()=>d(!0),onBlur:()=>{d(!1),n===""&&m(!1)},placeholder:a("taskBoard.taskFilters.searchPlaceholder"),"aria-label":a("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=r,e[10]=l,e[11]=o,e[12]=a,e[13]=n,e[14]=k):k=e[14];let v;e[15]!==r||e[16]!==o||e[17]!==a||e[18]!==n?(v=n!==""&&s.jsx("button",{type:"button","aria-label":a("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ei,onClick:()=>{o(""),r||m(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx(Mn,{size:14})}),e[15]=r,e[16]=o,e[17]=a,e[18]=n,e[19]=v):v=e[19];let C;return e[20]!==g||e[21]!==b||e[22]!==k||e[23]!==v?(C=s.jsxs("div",{className:g,children:[b,k,v]}),e[20]=g,e[21]=b,e[22]=k,e[23]=v,e[24]=C):C=e[24],C}function ei(t){return t.preventDefault()}function ti(t){const e=Y.c(20),{block:n,onClick:o}=t,r=ae();let a;e[0]!==r?(a=r("taskBoard.taskFilters.boardSettingsLabel"),e[0]=r,e[1]=a):a=e[1];const i=a;let m;e[2]!==n?(m=re(we(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Vs,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let d;e[5]!==n||e[6]!==i?(d=n&&s.jsx("span",{children:i}),e[5]=n,e[6]=i,e[7]=d):d=e[7];let u;e[8]!==i||e[9]!==o||e[10]!==m||e[11]!==d?(u=s.jsxs("button",{type:"button",onClick:o,"aria-label":i,className:m,children:[c,d]}),e[8]=i,e[9]=o,e[10]=m,e[11]=d,e[12]=u):u=e[12];const p=u;if(n)return p;let l;e[13]!==p?(l=s.jsx(Ze,{asChild:!0,children:p}),e[13]=p,e[14]=l):l=e[14];let f;e[15]!==i?(f=s.jsx(et,{side:"top",children:i}),e[15]=i,e[16]=f):f=e[16];let j;return e[17]!==l||e[18]!==f?(j=s.jsxs(Je,{children:[l,f]}),e[17]=l,e[18]=f,e[19]=j):j=e[19],j}function Sn(t){const e=Y.c(53),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m,block:c}=t;let d;e[0]!==n||e[1]!==i?(d=C=>i({...n,search:C}),e[0]=n,e[1]=i,e[2]=d):d=e[2];let u;e[3]!==c||e[4]!==n.search||e[5]!==d?(u=s.jsx(Zo,{block:c,value:n.search,onChange:d}),e[3]=c,e[4]=n.search,e[5]=d,e[6]=u):u=e[6];let p;e[7]!==n||e[8]!==i?(p=C=>i({...n,assignee:C}),e[7]=n,e[8]=i,e[9]=p):p=e[9];let l;e[10]!==c||e[11]!==n.assignee||e[12]!==o||e[13]!==p?(l=s.jsx(Uo,{block:c,value:n.assignee,members:o,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=o,e[13]=p,e[14]=l):l=e[14];let f;e[15]!==n||e[16]!==i?(f=C=>i({...n,priority:C}),e[15]=n,e[16]=i,e[17]=f):f=e[17];let j;e[18]!==c||e[19]!==n.priority||e[20]!==f?(j=s.jsx(Qo,{block:c,value:n.priority,onChange:f}),e[18]=c,e[19]=n.priority,e[20]=f,e[21]=j):j=e[21];let g;e[22]!==n||e[23]!==i?(g=C=>i({...n,due:C}),e[22]=n,e[23]=i,e[24]=g):g=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==g?(x=s.jsx(qo,{block:c,value:n.due,onChange:g}),e[25]=c,e[26]=n.due,e[27]=g,e[28]=x):x=e[28];let y;e[29]!==n||e[30]!==i?(y=C=>i({...n,tags:C}),e[29]=n,e[30]=i,e[31]=y):y=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==y||e[35]!==r?(S=s.jsx(Go,{block:c,value:n.tags,tags:r,onChange:y}),e[32]=c,e[33]=n.tags,e[34]=y,e[35]=r,e[36]=S):S=e[36];let b;e[37]!==c||e[38]!==n||e[39]!==a||e[40]!==i?(b=(a.entries.length>0||lt(n.project,a))&&s.jsx(Wo,{block:c,value:n.project,index:a,onChange:C=>i({...n,project:C})}),e[37]=c,e[38]=n,e[39]=a,e[40]=i,e[41]=b):b=e[41];let k;e[42]!==c||e[43]!==m?(k=s.jsx(ti,{block:c,onClick:m}),e[42]=c,e[43]=m,e[44]=k):k=e[44];let v;return e[45]!==S||e[46]!==b||e[47]!==k||e[48]!==u||e[49]!==l||e[50]!==j||e[51]!==x?(v=s.jsxs(s.Fragment,{children:[u,l,j,x,S,b,k]}),e[45]=S,e[46]=b,e[47]=k,e[48]=u,e[49]=l,e[50]=j,e[51]=x,e[52]=v):v=e[52],v}function Mr(t){const e=Y.c(16),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(cn,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=d):d=e[0];let u;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==i||e[5]!==m||e[6]!==r?(u=s.jsx(Sn,{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}),e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=m,e[6]=r,e[7]=u):u=e[7];let p;e[8]!==n||e[9]!==a||e[10]!==i||e[11]!==c?(p=Lo(n,a)&&s.jsx("button",{type:"button",onClick:()=>i(Nn),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=a,e[10]=i,e[11]=c,e[12]=p):p=e[12];let l;return e[13]!==u||e[14]!==p?(l=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p]}),e[13]=u,e[14]=p,e[15]=l):l=e[15],l}function Or(t){const e=Y.c(41),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae(),[d,u]=H.useState(!1),p=Ro(n,a),l=p>0;let f;e[0]!==l?(f=we(l),e[0]=l,e[1]=f):f=e[1];const j=f;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(cn,{size:14,className:"shrink-0"}),e[2]=g):g=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let y;e[5]!==p?(y=p>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:p}),e[5]=p,e[6]=y):y=e[6];let S;e[7]!==x||e[8]!==y||e[9]!==j?(S=s.jsx(Hn,{asChild:!0,children:s.jsxs("button",{type:"button",className:j,children:[g,x,y]})}),e[7]=x,e[8]=y,e[9]=j,e[10]=S):S=e[10];let b;e[11]!==c?(b=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=b):b=e[12];let k;e[13]!==b?(k=s.jsx(on,{className:"px-4 pt-4 text-base font-medium text-foreground",children:b}),e[13]=b,e[14]=k):k=e[14];let v;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==i||e[19]!==m||e[20]!==r?(v=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Sn,{block:!0,filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m})}),e[15]=n,e[16]=a,e[17]=o,e[18]=i,e[19]=m,e[20]=r,e[21]=v):v=e[21];let C;e[22]!==p||e[23]!==i||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>i(Nn),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=i,e[24]=c,e[25]=C):C=e[25];let D;e[26]!==c?(D=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=D):D=e[27];let h;e[28]!==D?(h=s.jsx(rn,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:D})}),e[28]=D,e[29]=h):h=e[29];let _;e[30]!==C||e[31]!==h?(_=s.jsxs(an,{className:"flex-row gap-2",children:[C,h]}),e[30]=C,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==_||e[34]!==k||e[35]!==v?(w=s.jsxs(sn,{className:"p-0",children:[k,v,_]}),e[33]=_,e[34]=k,e[35]=v,e[36]=w):w=e[36];let P;return e[37]!==d||e[38]!==w||e[39]!==S?(P=s.jsxs(nn,{open:d,onOpenChange:u,direction:"bottom",children:[S,w]}),e[37]=d,e[38]=w,e[39]=S,e[40]=P):P=e[40],P}function Lr(t,e){return io(t,e.keySeq)??e.id}function Rr(t,e){const n=e?.trim();if(n)return t.find(o=>_n(n,o.keySeq))??t.find(o=>o.id===n)}export{gr as $,Ji as A,lr as B,hn as C,Bt as D,No as E,vt as F,Ir as G,_r as H,We as I,Pt as J,hr as K,Bo as L,Sr as M,qt as N,Er as O,co as P,vr as Q,bn as R,zt as S,wr as T,Dr as U,Cn as V,Eo as W,xr as X,jr as Y,wo as Z,yn as _,fr as a,Rr as a0,Or as a1,Mr as a2,Nr as a3,Tr as a4,Nn as a5,Cr as a6,br as a7,Qt as a8,kr as a9,Fr as aa,Vr as ab,Do as ac,Pr as ad,Ar as ae,vo as af,pr as b,Br as c,Oo as d,gn as e,Lr as f,yr as g,ko as h,jn as i,er as j,nr as k,rr as l,po as m,mr as n,ir as o,mo as p,ar as q,tr as r,sr as s,io as t,Zi as u,or as v,ho as w,ur as x,cr as y,dr as z};
1
+ import{b_ as wn,b as ae,G as je,a as Yt,F as Dn,J as Tn,aq as Fn,ar as An,j as s,B as be,t as ce,c as Y,r as H,I as Bn,M as In,K as ue,l as re,h as Xe,o as ie,a4 as Je,a1 as Ze,a2 as et,n as it,d as Pn,a7 as kt,m as rt,bz as En,e as Oe,bp as Vn,ap as Mn}from"./index-DUT6nJ0k.js";import{C as On}from"./collection-search-UTZXFt4Q.js";import{g as Ln,b as Rn,a as $n,e as Kn}from"./extract-connection-data-BoLP7osc.js";import{u as Wt,a as Xt,g as zn,C as pt}from"./connection-card-CQBoI4NK.js";import{D as Jt,b as Zt,c as en,d as tn,h as Un,e as Qn}from"./dialog-BcLMOByU.js";import{D as nn,a as sn,c as qn,b as on,e as Gn,f as rn,g as an,d as Hn}from"./drawer-B1NW8E3x.js";import{d as me,a as pe,e as ge,b as he,c as xe,F as Et}from"./form-emd0pLrx.js";import{I as _e}from"./input-nTzU91Mx.js";import{S as Yn,b as Wn,a as Xn,d as Jn,c as $e}from"./select--YmYaxmK.js";import{T as Zn}from"./textarea-C1aSGNC3.js";import{b as ln}from"./use-connection-DX58UuSA.js";import{n as tt,a as gt,i as cn}from"./Tool02-BCmYiB10.js";import{j as ht,aN as es,aO as ts,aP as Vt,aQ as ns,t as ss,aR as os,aa as is,aS as rs,p as as,aT as ls,a8 as xt,a7 as cs,ae as ds}from"./agent-icon-DhDR9pbB.js";import{b as us,d as fs}from"./UserSquare-BHfOZp8B.js";import{s as ms}from"./XClose-Bd0dvJr4.js";import{c as ps,i as Ge,a as Mt,E as gs,p as hs,b as xs,d as js}from"./connection-form-helpers-D3I6R7D7.js";import{a as jt}from"./authenticate-and-persist-oauth-Dll5rtLu.js";import{g as ys}from"./connection-slug-CITJ0kGN.js";import{C as bs}from"./collection-tabs-CwN0B_Pf.js";import{u as Ot}from"./use-infinite-scroll-ClP3OMZ-.js";import{B as He}from"./badge-f_n8y1ac.js";import{u as vs}from"./useSuspenseInfiniteQuery-FkRnzD7Y.js";import{S as Cs,u as ks,f as Ns}from"./use-mcp-client--YVzCD1z.js";import{i as nt}from"./Check-DcBf9sZc.js";import{s as _s}from"./Plus-BEvurd-g.js";import{g as st}from"./metadata-dUsYcpuu.js";import{u as Ss}from"./use-ai-providers-BtpFLOIn.js";import{a as ws}from"./use-file-configs-zbdT3ThS.js";import{d as Ds}from"./use-organization-settings-C5neW7QU.js";import{r as Ts}from"./site-slug-uya6Wp4-.js";import{T as Fs,C as Nt,c as As,d as Bs,S as yt}from"./task-board-lWmcu4Co.js";import{a as Is}from"./decopilot-sse-pool-D7tJXNHa.js";import{u as Ps}from"./use-decopilot-events-Q4t3F4hO.js";import{A as Lt}from"./avatar-BB14yoAu.js";import{h as ot,D as dn,b as un,g as fn,c as mn}from"./dropdown-menu-D7i0SxXV.js";import{a as _t,b as St,P as wt}from"./popover-C6l187hN.js";import{e as Le,a as Dt,c as Tt,d as Ce,b as Ft,C as At}from"./command-B98c7WqP.js";import{t as ze}from"./ChevronUp-Dl6d_B-P.js";import{s as Es}from"./TrendUp01-Creeu049.js";import{a as Vs}from"./Settings02-BxCFXuSh.js";import{s as Rt}from"./User01-rBlUmrBY.js";import{G as Ms}from"./github-icon-Ddl_iahE.js";import{P as Os}from"./project-icon-BlPTx8oi.js";import{g as $t}from"./get-initials-D-f_fDFw.js";import{p as Ls,a as Rs}from"./github-repo-CTPv5ZM2.js";import{i as $s}from"./AlertCircle-E3JxJl5F.js";import{i as Ks}from"./CheckCircle-Bt9gqhgc.js";import{a as pn}from"./DotsVertical-D_-s7KYn.js";import{s as zs}from"./Eye-sU9sO8WN.js";import{i as Us}from"./Shield01-C8u-Jn2o.js";const Qs=wn("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function qs({open:t,onOpenChange:e,onCreated:n}){const o=ae(),{org:r}=je(),{data:a}=Yt.useSession(),{stdioEnabled:i}=Dn(),m=Tn(),c=ln(),d=Wt(),p=Xt(d,"").items,l=Fn({resolver:An(ps),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=l.watch("ui_type"),j=l.watch("connection_url"),g=l.watch("npx_package"),x=Ge({uiType:f,connectionUrl:j??"",npxPackage:g??""})??Mt({uiType:f,connectionUrl:j??"",registryItems:p}),y=h=>{const _=h.trim();if(!_)return;const w=!!l.formState.dirtyFields.title,P=!!l.formState.dirtyFields.description,V=!!l.formState.dirtyFields.env_vars,N=F=>{if(F&&(!w&&!l.getValues("title").trim()&&F.title&&l.setValue("title",F.title,{shouldDirty:!1}),!P&&!(l.getValues("description")??"").trim()&&F.description&&l.setValue("description",F.description,{shouldDirty:!1}),!V&&F.envVarKeys?.length)){const $=l.getValues("env_vars")??[],I=new Set($.map(R=>R.key)),B=F.envVarKeys.filter(R=>!I.has(R));B.length>0&&l.setValue("env_vars",[...$,...B.map(R=>({key:R,value:""}))],{shouldDirty:!0})}},T=hs(_);if(T&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",T.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),N(Ge({uiType:"NPX",npxPackage:T.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";l.setValue("ui_type",F,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),N(Ge({uiType:F,connectionUrl:_})??Mt({uiType:F,connectionUrl:_,registryItems:p}));return}f==="NPX"&&N(Ge({uiType:"NPX",npxPackage:_}))},S=h=>{h||l.reset(),e(h)},b=async h=>{let _,w=null,P=null,V=null;h.ui_type==="NPX"?(_="STDIO",w="",V=xs(h.npx_package||"",h.env_vars||[])):h.ui_type==="STDIO"?(_="STDIO",w="",V=js(h.stdio_command||"",h.stdio_args||"",h.stdio_cwd,h.env_vars||[])):(_=h.ui_type,w=h.connection_url||"",P=h.connection_token||null);const N=Ln("conn");try{await c.create.mutateAsync({id:N,title:h.title,description:h.description||null,connection_type:_,connection_url:w,connection_token:P,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:r.id,icon:h.icon??null,app_name:null,app_id:null,connection_headers:V,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),n?.(N)}catch{ce.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},k=o("connections.createConnectionDialog.title"),v=o("connections.createConnectionDialog.description"),C=l.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),D=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(me,{control:l.control,name:"ui_type",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.typeLabel")}),s.jsxs(Yn,{value:h.value,onValueChange:h.onChange,children:[s.jsx(he,{children:s.jsx(Wn,{children:s.jsx(Xn,{})})}),s.jsxs(Jn,{children:[s.jsx($e,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),s.jsx($e,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),s.jsx($e,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),i&&s.jsxs(s.Fragment,{children:[s.jsx($e,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(tt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),s.jsx($e,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(us,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(xe,{})]})}),f==="NPX"&&s.jsx(me,{control:l.control,name:"npx_package",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("npx_package",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),f==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(me,{control:l.control,name:"stdio_command",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.commandLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"stdio_args",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.argumentsLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"stdio_cwd",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...h,value:h.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(xe,{})]})})]}),(f==="NPX"||f==="STDIO")&&s.jsx(me,{control:l.control,name:"env_vars",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(he,{children:s.jsx(gs,{value:h.value??[],onChange:h.onChange})}),s.jsx(xe,{})]})}),f!=="NPX"&&f!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(me,{control:l.control,name:"connection_url",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.urlLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("connection_url",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"connection_token",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:x?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(he,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...h,value:h.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"title",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.nameLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...h})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"description",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.descriptionLabel")}),s.jsx(he,{children:s.jsx(Zn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...h,value:h.value??""})}),s.jsx(xe,{})]})})]});return m?s.jsx(nn,{open:t,onOpenChange:S,children:s.jsxs(sn,{className:"max-h-[90vh]",children:[s.jsx(qn,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(on,{children:k}),s.jsx(Gn,{className:"mt-1",children:v})]}),s.jsx(rn,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(ms,{size:16})})})]})}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:D}),s.jsx(an,{children:s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(Jt,{open:t,onOpenChange:S,children:s.jsxs(Zt,{className:"sm:max-w-[525px]",children:[s.jsxs(en,{children:[s.jsx(tn,{children:k}),s.jsx(Un,{children:v})]}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"py-4",children:D}),s.jsxs(Qn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:o("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function Gs(t){const e=Y.c(72),{mode:n,agentId:o,addedConnectionIds:r,onAdd:a,onCloneAndAdd:i,onConnectAndAdd:m,connectingItemId:c,search:d,onCreateConnection:u,onBrowseNavigate:p,defaultTab:l}=t,f=n===void 0?"add":n,j=l===void 0?"connected":l,g=ae(),{org:x}=je(),y=H.useDeferredValue(d),S=d!==y;let b;e[0]!==y?(b=y.trim().toLowerCase(),e[0]=y,e[1]=b):b=e[1];const k=b;let v;e[2]!==j?(v=A=>A??j,e[2]=j,e[3]=v):v=e[3];const[C,D]=Bn(In.connectionsTab(x.slug)+(j==="all"?":home-modal":":agent-modal"),v);let h;e[4]!==C||e[5]!==D?(h=A=>{A!==C&&ie("connections_dialog_tab_changed",{to_tab:A}),D(A)},e[4]=C,e[5]=D,e[6]=h):h=e[6];const _=h;let w;e[7]!==x.id||e[8]!==x.slug?(w={connectionId:Cs,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=w):w=e[9];const P=ks(w),V=y?.trim().split(/\s+/).filter(Boolean)??[],N=V.length>0?{operator:"or",conditions:V.flatMap(to)}:void 0,T={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},F=JSON.stringify(T),{data:$,fetchNextPage:I,hasNextPage:B,isFetchingNextPage:R}=vs({queryKey:ue.collectionListInfinite(P,x.id,"","CONNECTIONS",F),queryFn:async A=>{const{pageParam:q}=A,ye=q===void 0?0:q;return(await P.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:ye}})).structuredContent},initialPageParam:0,getNextPageParam:Zs,staleTime:3e4}),G=$?.pages.flatMap(Js)??[],E=zn(G),U=new Set(G.filter(Xs).map(Ws)),M=Wt(),Q=Xt(M,y),Z=Ot(Q.loadMore,Q.hasMore,Q.isLoadingMore),ee=Ot(I,B??!1,R),K=C==="all"||!!k,ne=K?Q.items.filter(A=>{const q=Rn(A);if(q&&U.has(q))return!1;if(!k)return!0;const ye=st(A._meta),ke=[A.title,A.description,A.name,A.server?.title,A.server?.description,A.server?.name,ye?.friendly_name,ye?.friendlyName].filter(Boolean).join(" ").toLowerCase();return V.some(fe=>ke.includes(fe.toLowerCase()))}):[],W=ne.filter(Ys),X=ne.filter(Hs);let J;e[10]!==r?(J=A=>A.some(q=>r.has(q.id)),e[10]=r,e[11]=J):J=e[11];const te=J;let se;e[12]!==r||e[13]!==o||e[14]!==c||e[15]!==te||e[16]!==f||e[17]!==a||e[18]!==p||e[19]!==i||e[20]!==g?(se=(A,q,ye,ke,fe)=>{const qe=te(fe),Me=fe.find(Ne=>!r.has(Ne.id)),le=fe[0];if(f==="browse"){const Ne=ys(le);return s.jsx(pt,{connection:{title:q,icon:ye,description:fe.length>1?`${fe.length} instances`:ke??void 0},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{ie("connection_browse_clicked",{app_name:le.app_name??null,connection_id:le.id,instances_count:fe.length}),p?.(Ne)}},A)}return s.jsx(pt,{connection:{title:q,icon:ye,description:ke},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[qe&&s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(ie("connection_add_clicked",{action:"use_existing",app_name:le.app_name??null,connection_id:Me.id}),o&&ie("agent_connection_attached",{agent_id:o,connection_id:Me.id,app_name:le.app_name??null,mode:"existing"}),a(Me.id)):(ie("connection_add_clicked",{action:"clone",app_name:le.app_name??null,base_connection_id:le.id}),i(le))},children:g("virtualMcp.connectionDialogContent.add")})]})},A)},e[12]=r,e[13]=o,e[14]=c,e[15]=te,e[16]=f,e[17]=a,e[18]=p,e[19]=i,e[20]=g,e[21]=se):se=e[21];const O=se;let L;e[22]!==c||e[23]!==f||e[24]!==m||e[25]!==g?(L=A=>{const q=st(A._meta),ye=q?.friendlyName||q?.friendly_name||A.server?.title||A.title||A.server?.name||A.name||A.id||"",ke=A.server?.description||A.description||null,fe=A.server?.icons?.[0]?.src||$n(A.server?.repository)||null,qe=q?.official===!0,Me=q?.verified===!0,le=q?.owner==="deco";return s.jsx(pt,{connection:{title:ye,description:ke,icon:fe},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[le&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:g("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByDeco")})]}),!le&&qe&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!le&&!qe&&Me&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),ie("connection_add_clicked",{action:"connect_new",registry_item_id:A.id,app_name:q?.friendlyName||A.server?.name||A.name||null}),m(A)},children:c===A.id?s.jsx(Xe,{className:"size-3.5"}):g(f==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${A.id}`)},e[22]=c,e[23]=f,e[24]=m,e[25]=g,e[26]=L):L=e[26];const oe=L;let z;e[27]!==C||e[28]!==_||e[29]!==u||e[30]!==k||e[31]!==g?(z=!k&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(bs,{tabs:[{id:"all",label:g("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:g("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:A=>_(A)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{ie("connections_dialog_custom_clicked"),u()},children:[s.jsx(_s,{size:12}),g("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=u,e[30]=k,e[31]=g,e[32]=z):z=e[32];const ve=S&&"opacity-50 pointer-events-none";let de;e[33]!==ve?(de=re("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=de):de=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Te;e[35]!==O?(Te=A=>{if(A.type==="group")return O(A.key,A.title,A.icon,null,A.connections);const q=A.connection;return O(q.id,q.title,q.icon,q.description??null,[q])},e[35]=O,e[36]=Te):Te=e[36];const ct=E.map(Te);let Fe;e[37]!==ee?(Fe=s.jsx("div",{ref:ee,className:"col-span-full h-1"}),e[37]=ee,e[38]=Fe):Fe=e[38];let Ae;e[39]!==R?(Ae=R&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[39]=R,e[40]=Ae):Ae=e[40];const dt=K&&W.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(gt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ut=K&&W.map(oe),ft=K&&X.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),mt=K&&X.map(oe);let Be;e[41]!==Z||e[42]!==M||e[43]!==K?(Be=K&&M.length>0&&s.jsx("div",{ref:Z,className:"col-span-full h-1"}),e[41]=Z,e[42]=M,e[43]=K,e[44]=Be):Be=e[44];let Ie;e[45]!==Q.isLoadingMore||e[46]!==K?(Ie=K&&Q.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[45]=Q.isLoadingMore,e[46]=K,e[47]=Ie):Ie=e[47];let Pe;e[48]!==ct||e[49]!==Fe||e[50]!==Ae||e[51]!==dt||e[52]!==ut||e[53]!==ft||e[54]!==mt||e[55]!==Be||e[56]!==Ie?(Pe=s.jsxs("div",{className:De,children:[ct,Fe,Ae,dt,ut,ft,mt,Be,Ie]}),e[48]=ct,e[49]=Fe,e[50]=Ae,e[51]=dt,e[52]=ut,e[53]=ft,e[54]=mt,e[55]=Be,e[56]=Ie,e[57]=Pe):Pe=e[57];let Ee;e[58]!==C||e[59]!==E.length||e[60]!==X||e[61]!==d||e[62]!==g||e[63]!==W?(Ee=E.length===0&&W.length===0&&X.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?g("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):g(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=E.length,e[60]=X,e[61]=d,e[62]=g,e[63]=W,e[64]=Ee):Ee=e[64];let Ve;e[65]!==de||e[66]!==Pe||e[67]!==Ee?(Ve=s.jsxs("div",{className:de,children:[Pe,Ee]}),e[65]=de,e[66]=Pe,e[67]=Ee,e[68]=Ve):Ve=e[68];let Qe;return e[69]!==z||e[70]!==Ve?(Qe=s.jsxs(s.Fragment,{children:[z,Ve]}),e[69]=z,e[70]=Ve,e[71]=Qe):Qe=e[71],Qe}function Hs(t){return!t.verified&&!st(t._meta)?.verified&&!t.meta?.verified}function Ys(t){return t.verified||st(t._meta)?.verified||t.meta?.verified}function Ws(t){return t.app_name}function Xs(t){return t.app_name}function Js(t){return t?.items??[]}function Zs(t,e){if(t?.hasMore)return e.reduce(eo,0)}function eo(t,e){return t+(e?.items?.length??0)}function to(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function Ji({open:t,onOpenChange:e,defaultTab:n,initialSearch:o="",...r}){const a=ae(),i=r.mode??"add",m="agentId"in r?r.agentId:void 0,c="addedConnectionIds"in r?r.addedConnectionIds??new Set:new Set,d="onAdd"in r&&r.onAdd?r.onAdd:N=>{},u=(N,T,F)=>{m&&ie("agent_connection_attached",{agent_id:m,connection_id:N,app_name:T,mode:F})},[p,l]=H.useState(null),[f,j]=H.useState(o),[g,x]=H.useState(!1),[y,S]=H.useState(t);t!==y&&(S(t),t&&j(o));const{org:b}=je(),{data:k}=Yt.useSession(),v=ln(),C=it(),D=Pn(),h=N=>{e(!1),D({to:"/$org/settings/connections/$appSlug",params:{org:b.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const T=N.queryKey;return T[1]===b.id&&T[3]==="collection"&&T[4]==="CONNECTIONS"}})},w=async(N,T)=>{ie("connection_oauth_succeeded",{connection_id:N,flow:T});const F=new URL(`/api/${b.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ue.isMCPAuthenticated(F.href,null)}),_()},P=async N=>{l(N.app_name??N.id);try{const F=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await v.create.mutateAsync({title:F,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,B=await jt({connectionId:I,orgId:b.id,orgSlug:b.slug,persistFallback:R=>v.update.mutateAsync({id:I,data:{connection_token:R}}).then(()=>{})});if(B.ran&&!B.ok){ie("connection_oauth_failed",{connection_id:I,flow:"clone",error:B.error??"no_token"}),ce.error(a("virtualMcp.addConnectionDialog.authenticationFailedError",{error:B.error??"no token received"})),await v.delete.mutateAsync(I);return}B.ran&&await w(I,"clone"),u(I,N.app_name??null,"clone"),d(I)}catch(T){console.error("Failed to add connection:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},V=async N=>{if(!(!b||!k?.user?.id)){l(N.id);try{const T=Kn(N,b.id,k.user.id,{remoteIndex:0}),F=T.connection_type==="STDIO",$=!!T.connection_url,I=F&&T.connection_headers&&typeof T.connection_headers=="object"&&"command"in T.connection_headers;if(!$&&!I){ce.error(a("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:B}=await v.create.mutateAsync(T),R=await jt({connectionId:B,orgId:b.id,orgSlug:b.slug,persistFallback:G=>v.update.mutateAsync({id:B,data:{connection_token:G}}).then(()=>{})});if(R.ran&&!R.ok){ie("connection_oauth_failed",{connection_id:B,flow:"connect_new",error:R.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:R.error??"no token received"})}),u(B,T.app_name??null,"new"),d(B);return}R.ran?(await w(B,"connect_new"),ce.success(a("virtualMcp.addConnectionDialog.connectedAuthenticated"))):ce.success(a("virtualMcp.addConnectionDialog.connected")),u(B,T.app_name??null,"new"),d(B)}catch(T){console.error("Failed to connect:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return s.jsxs(Jt,{open:t,onOpenChange:e,children:[s.jsxs(Zt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(en,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(tn,{className:"text-base font-semibold",children:a(i==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(On,{value:f,onChange:j,placeholder:a("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(H.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),children:s.jsx(Gs,{mode:i,agentId:m,addedConnectionIds:c,onAdd:d,onCloneAndAdd:P,onConnectAndAdd:V,connectingItemId:p,search:f,onCreateConnection:()=>x(!0),onBrowseNavigate:h,defaultTab:n})})]}),s.jsx(qs,{open:g,onOpenChange:x,onCreated:async N=>{x(!1);const T=await jt({connectionId:N,orgId:b.id,orgSlug:b.slug,persistFallback:F=>v.update.mutateAsync({id:N,data:{connection_token:F}}).then(()=>{})});if(T.ran&&!T.ok){ie("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:T.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:T.error??"no token received"})}),u(N,null,"custom"),d(N),e(!1);return}T.ran&&await w(N,"custom_create"),u(N,null,"custom"),d(N),e(!1)}})]})}const Kt=new Map;function Zi(){const{org:t}=je(),e=kt(),n=Ss(),o=n.find(x=>x.providerId==="deco"),{data:r,isLoading:a,refetch:i,isFetching:m}=rt({queryKey:ue.aiProviderCredits(t.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=r?.balanceCents??null,d=c!=null?c/100:null,u=H.useRef(new Map);if(c!=null){const x=Kt.get(t.id);u.current.get(t.id)&&x!=null&&c>x&&ie("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Kt.set(t.id,c),u.current.set(t.id,!0)}const p=!!o,l=c!=null&&c>0,f=c!=null&&c===0,j=c!=null&&c===200,g=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:d,hasCredits:l,isZeroBalance:f,isInitialFreeCredit:j,hasOnlyDecoProvider:g,isLoading:a,isFetching:m,refetch:i}}const no=4,so="TASK";function oo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,no)||so}function io(t,e){return e==null?null:`${oo(t)}-${String(e).padStart(2,"0")}`}const ro=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function ao(t){const e=ro.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function zt(t){const e=Y.c(8),{size:n,className:o}=t,r=n===void 0?16:n;let a;e[0]!==r?(a={width:r,height:r},e[0]=r,e[1]=a):a=e[1];let i;e[2]!==o?(i=re("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=i):i=e[3];let m;return e[4]!==r||e[5]!==a||e[6]!==i?(m=s.jsx("img",{src:Ns,alt:"Super Agent",width:r,height:r,style:a,className:i}),e[4]=r,e[5]=a,e[6]=i,e[7]=m):m=e[7],m}const Ue=["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations"],lo=["overview","reports","board","site-editor"],Bt=1,co=["assets","hosting","e2e","analytics","cdn"];function er(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const o=e?.id===t?e:n?.id===t?n:null;return{project:o,resolvedScopeId:o?t:null}}function tr(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function gn(t,e){const n=new Set(t??[]);if(e!==Bt)for(const o of lo)n.add(o);return Ue.filter(o=>n.has(o))}function uo(t){return Ue.some(e=>e===t)}function fo(t){return co.some(e=>e===t)}function mo(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,automations:!0}}function nr(t,e,n){const o=mo(e,n);return t?o:{...o,overview:!0,reports:!0,board:!0}}function sr(t,e,n){const o=new Set(gn(t,n));return Ue.filter(r=>e[r]&&o.has(r))}function or(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ir(t){return Ue.filter(e=>t[e])}function po(t,e,n){return!uo(t)||e[t]?!1:fo(t)?!(t==="assets"?n.assets:n.siteAccess):!0}function rr(t,e,n,o,r){return po(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!o.includes("content")||t==="code"&&r&&!o.includes("code")}function ar(t,e,n,o){const r=new Set(gn(t,o));return n?r.add(e):r.delete(e),Ue.filter(a=>r.has(a))}function Ke(t,e){return ue.optimisticProjectSidebarViews(t,e)}function Ye(t){return typeof t=="object"&&t!==null}function hn(t,e){return t[1]===e&&t[3]==="collection"&&t[4]==="VIRTUAL_MCP"}function go(t,e){if(!Ye(t))return t;if("item"in t&&Ye(t.item)&&t.item.id===e.id)return{...t,item:e};if(!("structuredContent"in t)||!Ye(t.structuredContent))return t;const n=t.structuredContent.items;if(!Array.isArray(n))return t;let o=!1;const r=n.map(a=>!Ye(a)||a.id!==e.id?a:(o=!0,e));return o?{...t,structuredContent:{...t.structuredContent,items:r}}:t}function lr(t,e,n){t.setQueriesData({predicate:o=>hn(o.queryKey,e)},o=>go(o,n))}function cr(t,e,n){const o=t.getQueriesData({predicate:r=>hn(r.queryKey,e)&&r.queryKey[5]===n});for(const[,r]of o)if(r?.item?.id===n)return r.item;return null}function It(t,e,n){return t.getQueryData(Ke(e,n))??null}function ho(t,e){if(e)return{sidebarViews:[...e.views],sidebarViewsVersion:Bt};const n=t?.sidebarViews;return{sidebarViews:n===null?null:n?[...n]:void 0,sidebarViewsVersion:t?.sidebarViewsVersion}}function dr(t,e,n){return e?{sidebarViews:[...e.views],sidebarViewsVersion:Bt}:n===void 0?{sidebarViews:t.sidebarViews===null?null:t.sidebarViews?[...t.sidebarViews]:void 0,sidebarViewsVersion:t.sidebarViewsVersion}:ho(n,null)}function xo(t,e,n,o,r){const a=It(t,e,n),i={revision:(a?.revision??0)+1,views:[...o],rollbackViews:a?[...a.rollbackViews]:[...r]};return t.setQueryData(Ke(e,n),i),{revision:i.revision,views:[...i.views],persistedViews:[...i.rollbackViews]}}function jo(t,e,n){const o=It(t,e,n);return o?{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}:null}function xn(t,e){const n=new Set(t),o=new Set(e);return n.size===o.size&&[...n].every(r=>o.has(r))}function ur(t){return t?!xn(t.views,t.persistedViews):!1}function yo(t,e,n,{snapshot:o,saved:r,authoritativeViews:a}){if(!o)return{settledLatest:!1,reconciledViews:null};const i=It(t,e,n);if(!i||o.revision>i.revision)return{settledLatest:!1,reconciledViews:null};const m=a!==void 0?[...a]:r?[...o.views]:null,c={...i,rollbackViews:m??i.rollbackViews};return c.rollbackViews!==i.rollbackViews&&t.setQueryData(Ke(e,n),c),o.revision!==i.revision?{settledLatest:!1,reconciledViews:null}:(t.setQueryData(Ke(e,n),null),{settledLatest:!0,reconciledViews:r?m&&!xn(m,o.views)?m:null:[...c.rollbackViews]})}function fr(t){const e=Y.c(5),{org:n}=je(),o=t??"";let r;e[0]!==n.id||e[1]!==o?(r=Ke(n.id,o),e[0]=n.id,e[1]=o,e[2]=r):r=e[2];let a;e[3]!==r?(a={queryKey:r,queryFn:bo,enabled:!1,staleTime:Number.POSITIVE_INFINITY},e[3]=r,e[4]=a):a=e[4];const{data:i}=rt(a);return i?.views}async function bo(){return null}function mr(t){const e=Y.c(4),{org:n}=je(),o=it();let r;return e[0]!==n||e[1]!==o||e[2]!==t?(r={stage:(a,i)=>xo(o,n.id,t,a,i),snapshot:()=>jo(o,n.id,t),settle:a=>yo(o,n.id,t,a)},e[0]=n,e[1]=o,e[2]=t,e[3]=r):r=e[3],r}function vo(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(o=>{const r=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===n||r===n||r===`deco-assets-${n}`})??null}function pr(t){const e=Y.c(10),{org:n}=je(),o=En(),r=Ds(),a=ws(),i=Ts(t),m=o.hostingEnabled===!0,c=o.monitorEnabled===!0||o.auth.localMode===!0,d=(m||c)&&!!i,u=rt({queryKey:ue.hostingAccess(n.slug,i??""),queryFn:async()=>{const v=await fetch(`/api/${n.slug}/hosting/${encodeURIComponent(i??"")}/access`);return v.ok?await v.json():{owned:!1,canWrite:!1}},enabled:d,staleTime:6e4}),p=u.data?.owned===!0,l=!!vo(a.data?.configs??[],i),f=m&&p&&r.hosting,j=m&&p&&r.e2e,g=m&&p&&r.analytics,x=c&&p&&r.monitor;let y;e[0]!==l||e[1]!==f||e[2]!==j||e[3]!==g||e[4]!==x?(y={assets:l,hosting:f,e2e:j,analytics:g,cdn:x},e[0]=l,e[1]=f,e[2]=j,e[3]=g,e[4]=x,e[5]=y):y=e[5];const S=!!i&&a.isPending,b=d&&u.isPending;let k;return e[6]!==y||e[7]!==S||e[8]!==b?(k={presence:y,assetsPending:S,siteAccessPending:b},e[6]=y,e[7]=S,e[8]=b,e[9]=k):k=e[9],k}const Ut=()=>0;function Co(t){const{orgSlug:e,enabled:n=!0,onUpdate:o,onDelete:r,onResync:a}=t,i=H.useRef(o);i.current=o;const m=H.useRef(r);m.current=r;const c=H.useRef(a);c.current=a;const d=H.useRef(null),u=H.useRef(n),p=H.useRef(e);(!d.current||u.current!==n||p.current!==e)&&(u.current=n,p.current=e,d.current=f=>{if(!n||!e)return()=>{};const j=g=>{let x;try{x=JSON.parse(g.data)}catch{return}x.data&&(g.type===Fs?m.current?.(x.data.id):i.current(x.data)),f()};return Is.subscribe(e,j,()=>c.current?.())}),H.useSyncExternalStore(d.current,Ut,Ut)}function ko(t,e){return{queryKey:ue.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function No(){const t=Y.c(21),{org:e,locator:n}=je(),o=it();let r;t[0]!==n?(r=ue.taskBoardItems(n),t[0]=n,t[1]=r):r=t[1];const a=r;let i;t[2]!==n||t[3]!==o||t[4]!==a?(i=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.some(j=>j.id===l.id)?f.items.map(j=>j.id===l.id?l:j):[l,...f.items]}),o.invalidateQueries({queryKey:ue.taskBoardActivity(n,l.id)})},t[2]=n,t[3]=o,t[4]=a,t[5]=i):i=t[5];let m,c;t[6]!==o||t[7]!==a?(m=()=>{o.invalidateQueries({queryKey:a})},c=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.filter(j=>j.id!==l)})},t[6]=o,t[7]=a,t[8]=m,t[9]=c):(m=t[8],c=t[9]);let d;t[10]!==e.slug||t[11]!==i||t[12]!==m||t[13]!==c?(d={orgSlug:e.slug,onUpdate:i,onResync:m,onDelete:c},t[10]=e.slug,t[11]=i,t[12]=m,t[13]=c,t[14]=d):d=t[14],Co(d);let u;t[15]!==o||t[16]!==a?(u=l=>{const f=l.subject,j=l.data.status;o.cancelQueries({queryKey:a}),o.setQueryData(a,g=>g&&{...g,items:g.items.map(x=>x.threads.some(y=>y.threadId===f)?{...x,threads:x.threads.map(y=>y.threadId===f?{...y,status:j}:y)}:x)})},t[15]=o,t[16]=a,t[17]=u):u=t[17];let p;t[18]!==e.slug||t[19]!==u?(p={orgSlug:e.slug,onTaskStatus:u},t[18]=e.slug,t[19]=u,t[20]=p):p=t[20],Ps(p)}function gr(){const t=Y.c(9),{locator:e}=je(),n=kt();let o;t[0]!==e||t[1]!==n?(o=ko(e,n),t[0]=e,t[1]=n,t[2]=o):o=t[2];const r=rt(o);No();let a;t[3]!==r.data?.items?(a=r.data?.items??[],t[3]=r.data?.items,t[4]=a):a=t[4];let i;return t[5]!==r.error||t[6]!==r.isLoading||t[7]!==a?(i={items:a,isLoading:r.isLoading,error:r.error},t[5]=r.error,t[6]=r.isLoading,t[7]=a,t[8]=i):i=t[8],i}function hr(){const t=Y.c(70),{org:e,locator:n}=je(),o=kt(),r=it(),a=ae();let i;t[0]!==n?(i=ue.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const m=i;let c;t[2]!==r||t[3]!==m?(c=()=>r.invalidateQueries({queryKey:m}),t[2]=r,t[3]=m,t[4]=c):c=t[4];const d=c;let u;t[5]!==o?(u=E=>o.call("TASK_BOARD_ITEM_CREATE",E),t[5]=o,t[6]=u):u=t[6];let p;t[7]!==d||t[8]!==u?(p={mutationFn:u,onSuccess:d},t[7]=d,t[8]=u,t[9]=p):p=t[9];const l=Oe(p);let f;t[10]!==o?(f=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[10]=o,t[11]=f):f=t[11];let j;t[12]!==r||t[13]!==m?(j=async E=>{await r.cancelQueries({queryKey:m});const U=r.getQueryData(m);return r.setQueryData(m,M=>M&&{...M,items:M.items.map(Q=>Q.id===E.id?{...Q,...E}:Q)}),{previous:U}},t[12]=r,t[13]=m,t[14]=j):j=t[14];let g;t[15]!==e?(g=(E,U)=>{U.status==="done"&&ie("task_marked_done",{organization_id:e.id,task_board_item_id:U.id})},t[15]=e,t[16]=g):g=t[16];let x;t[17]!==r||t[18]!==m?(x=(E,U,M)=>{M?.previous&&r.setQueryData(m,M.previous)},t[17]=r,t[18]=m,t[19]=x):x=t[19];let y;t[20]!==d||t[21]!==n||t[22]!==r?(y=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[20]=d,t[21]=n,t[22]=r,t[23]=y):y=t[23];let S;t[24]!==f||t[25]!==j||t[26]!==g||t[27]!==x||t[28]!==y?(S={mutationFn:f,onMutate:j,onSuccess:g,onError:x,onSettled:y},t[24]=f,t[25]=j,t[26]=g,t[27]=x,t[28]=y,t[29]=S):S=t[29];const b=Oe(S);let k;t[30]!==o?(k=E=>o.call("TASK_BOARD_ITEM_DELETE",{id:E}),t[30]=o,t[31]=k):k=t[31];let v;t[32]!==d||t[33]!==a?(v=E=>{ce.error(E instanceof Error&&E.message?E.message:a("taskBoard.taskBoard.deleteError")),d()},t[32]=d,t[33]=a,t[34]=v):v=t[34];let C;t[35]!==d||t[36]!==k||t[37]!==v?(C={mutationFn:k,onSuccess:d,onError:v},t[35]=d,t[36]=k,t[37]=v,t[38]=C):C=t[38];const D=Oe(C);let h;t[39]!==o?(h=async E=>{const U=await Promise.allSettled(E.map(M=>o.call("TASK_BOARD_ITEM_DELETE",{id:M})));return{total:E.length,failed:U.filter(_o).length}},t[39]=o,t[40]=h):h=t[40];let _,w;t[41]!==a?(_=E=>{const{total:U,failed:M}=E;M!==0&&ce.error(a("taskBoard.taskBoard.deleteBulkError",{failed:String(M),total:String(U)}))},w=()=>ce.error(a("taskBoard.taskBoard.deleteError")),t[41]=a,t[42]=_,t[43]=w):(_=t[42],w=t[43]);let P;t[44]!==d||t[45]!==h||t[46]!==_||t[47]!==w?(P={mutationFn:h,onSuccess:_,onError:w,onSettled:d},t[44]=d,t[45]=h,t[46]=_,t[47]=w,t[48]=P):P=t[48];const V=Oe(P);let N;t[49]!==o?(N=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[49]=o,t[50]=N):N=t[50];let T;t[51]!==d||t[52]!==N?(T={mutationFn:N,onSuccess:d},t[51]=d,t[52]=N,t[53]=T):T=t[53];const F=Oe(T);let $;t[54]!==o?($=E=>o.call("TASK_BOARD_ITEM_RERUN",E),t[54]=o,t[55]=$):$=t[55];let I;t[56]!==d||t[57]!==n||t[58]!==r?(I=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[56]=d,t[57]=n,t[58]=r,t[59]=I):I=t[59];let B;t[60]!==$||t[61]!==I?(B={mutationFn:$,onSettled:I},t[60]=$,t[61]=I,t[62]=B):B=t[62];const R=Oe(B);let G;return t[63]!==l||t[64]!==F||t[65]!==D||t[66]!==V||t[67]!==R||t[68]!==b?(G={create:l,update:b,remove:D,removeMany:V,link:F,rerun:R},t[63]=l,t[64]=F,t[65]=D,t[66]=V,t[67]=R,t[68]=b,t[69]=G):G=t[69],G}function _o(t){return t.status==="rejected"}const So=["ended_after_delivery","superseded"];function wo(t){return!!t&&So.includes(t)}function xr(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function jr(t){return t.failureKind!=="superseded"}function jn(t){return t.threads.some(e=>e.status==="requires_action")}function yr(t){return t.status==="in_review"&&!t.assigneeId}function br(t){return jn(t)}function vr(t){return t.status==="in_progress"&&jn(t)?"text-warning animate-pulse":bn(t.status).iconClassName}function Cr(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!wo(n.failureKind))?"failed":null}function kr(t,e,n){const o=t.findIndex(u=>u.id===n),r=e===n?t[o+1]?.id??null:e,a=t.filter(u=>u.id!==n),i=r?a.findIndex(u=>u.id===r):-1,m=i===-1?a.length:i,c=a[m-1],d=a[m];return c&&d?(c.sortOrder+d.sortOrder)/2:c?c.sortOrder+1:d?d.sortOrder-1:0}function Nr(t,e){return Array.from({length:e},(n,o)=>t-(e-1-o)*1e-4)}const Do=["archived"],yn={triage:{labelKey:"taskBoard.config.statusBacklog",icon:$s,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:pn,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:is,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:zs,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:os,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:fs,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:ss,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Ks,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Vn,iconClassName:"text-muted-foreground"}},To={icon:pn,iconClassName:"text-muted-foreground"},Fo=yn;function bn(t){return Fo[t]??To}function _r(t,e){const n=yn[t];return{label:n?e(n.labelKey):t,visual:bn(t)}}const Sr=["bug","feature","chore","spike","security"],wr={bug:{labelKey:"taskBoard.config.typeBug",icon:Qs,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:ls,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:as,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:rs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Us,iconClassName:"text-purple-500"}};function bt(t){return Bs.includes(t)}function Dr(t){return Nt.filter(e=>t||!bt(e))}function Tr({deliveryEnabled:t,shownLanes:e,occupied:n}){const o=Nt.filter(i=>t||!bt(i)||n.includes(i)),r=o.filter(i=>Do.includes(i)||!t&&bt(i)),a=r.filter(i=>!e.includes(i));return{lanes:o.filter(i=>!a.includes(i)),hidden:a,hideable:r}}const Qt="lane:";function Ao(t){return Nt.includes(t)}function Fr({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),o=n.startsWith(Qt)?n.slice(Qt.length):e(n);return o!==void 0&&Ao(o)?o:null}const Bo=["none","low","medium","high","urgent"],We={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Vt,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ns,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Vt,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:ts,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:es,iconClassName:"text-destructive"}};function Ar(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Io*864e5?"soon":null}const Io=3;function qt(t){return`color-mix(in oklab, ${t??As} var(--user-color-strength), transparent)`}function vn(t){return t?.projects.length===1?t.projects[0]:void 0}function Po(t){return vn(t)?t.repo:t.projects.length>1?t.projects.map(e=>e.title).join(", "):null}function Cn(t){const e=Y.c(6),{entry:n}=t;let o;e[0]!==n?(o=vn(n),e[0]=n,e[1]=o):o=e[1];const r=o;if(r){let i;return e[2]!==r.icon||e[3]!==r.title?(i=s.jsx(Os,{icon:r.icon,name:r.title}),e[2]=r.icon,e[3]=r.title,e[4]=i):i=e[4],i}let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:s.jsx(Ms,{className:"size-3"})}),e[5]=a):a=e[5],a}function Eo(t){const e=Y.c(14),{entry:n}=t;let o;e[0]!==n?(o=Po(n),e[0]=n,e[1]=o):o=e[1];const r=o;let a;e[2]!==n?(a=s.jsx(Cn,{entry:n}),e[2]=n,e[3]=a):a=e[3];let i;e[4]!==n.title?(i=s.jsx("span",{className:"truncate",children:n.title}),e[4]=n.title,e[5]=i):i=e[5];let m;e[6]!==r?(m=r&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[6]=r,e[7]=m):m=e[7];let c;e[8]!==i||e[9]!==m?(c=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[i,m]}),e[8]=i,e[9]=m,e[10]=c):c=e[10];let d;return e[11]!==a||e[12]!==c?(d=s.jsxs(s.Fragment,{children:[a,c]}),e[11]=a,e[12]=c,e[13]=d):d=e[13],d}const at="__no_repo__";function Se(t){return(t??"").trim().toLowerCase()}function Vo(t,e){const n=(t.created_at??"").localeCompare(e.created_at??"");return n!==0?n:t.id.localeCompare(e.id)}function Mo(t){return t.projects.length===1?t.projects[0]?.title??t.repo??t.id:t.repo??t.id}function Br(t,e=[]){const n=new Map,o=new Map,r=[],a=u=>{const p=Se(u),l=n.get(p);if(l)return l;const f={id:p,kind:"repo",repo:u.trim(),title:u.trim(),projects:[]};return n.set(p,f),f};for(const u of t){const p=Ls(u);if(p){const f=a(p);f.projects.push(u),o.set(u.id,f);continue}const l={id:u.id,kind:"project",repo:null,title:u.title,projects:[u]};r.push(l),o.set(u.id,l)}for(const u of e){const p=(u??"").trim();p&&a(p)}for(const u of n.values())u.projects.sort(Vo),u.title=Mo(u);const i=[...n.values()].filter(u=>u.projects.length>0),m=[...n.values()].filter(u=>u.projects.length===0),c=(u,p)=>u.title.localeCompare(p.title),d=[...[...i,...r].sort(c),...m.sort(c)];return{entries:d,byId:new Map(d.map(u=>[u.id,u])),byRepo:n,byProject:o}}function vt(t,e){for(const o of t.threads??[]){const r=o.virtualMcpId?e.byProject.get(o.virtualMcpId):void 0;if(r)return r}const n=Se(t.repo);return(n?e.byRepo.get(n):void 0)??null}function Oo(t,e){const n=vt(t,e);if(!n)return[];if(n.projects.length<=1)return n.projects;for(const o of t.threads??[]){const r=o.virtualMcpId?n.projects.find(a=>a.id===o.virtualMcpId):void 0;if(r)return[r]}return n.projects}function Ir(t,e){const n=Oo(t,e);return n.length===1?n[0]??null:null}function Pt(t,e){return e.byId.get(t)??e.byRepo.get(Se(t))??e.byProject.get(t)}function kn(t,e,n){if(e===null)return!0;if(e===at)return vt(t,n)===null;const o=Pt(e,n);return o?o.repo&&Se(t.repo)===Se(o.repo)?!0:vt(t,n)===o:e.includes("/")?Se(t.repo)===Se(e):!0}function lt(t,e){return t===null?!1:t===at?!0:!!Pt(t,e)||t.includes("/")}function Pr(t,e,n){return e===null?null:kn(t,e,n)?e:null}function Er(t){return t.entries.filter(e=>e.repo!==null&&(e.projects.length===0||e.projects.some(n=>Rs(n).status!=="detached")))}const Ct="__unassigned__",Re="__any__",Nn={assignee:null,priority:null,due:null,tags:[],project:null,search:""};function Lo(t,e){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||lt(t.project,e)||t.search.trim()!==""}function Ro(t,e){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(lt(t.project,e)?1:0)+(t.search.trim()!==""?1:0)}const $o=864e5;function Ko(t,e){const n=new Date(t),o=new Date(e);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()&&n.getDate()===o.getDate()}function _n(t,e){const n=t.trim();return n===""?!1:e!=null&&ao(n)===e}function zo(t,e){return t.assigneeId===e?!0:t.assigneeId===yt&&t.assignedBy===e}function Vr(t,e,n){const o=e.search.trim().toLowerCase();if(o!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(o)&&!_n(o,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===Ct){if(t.assigneeId!==null)return!1}else if(!zo(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const r=new Date(t.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&r>=a||e.due==="today"&&!Ko(r,a)||e.due==="week"&&(r<a||r>a+7*$o))return!1}if(e.tags.length>0){const r=t.tags.map(a=>a.id);if(!e.tags.some(a=>r.includes(a)))return!1}return!!kn(t,e.project,n)}const Gt={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function we(t,e=!1){return re("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Uo(t){const e=Y.c(107),{value:n,members:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Rt,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let u=d,p;e[1]!==i?(p=i("taskBoard.taskFilters.assigneeLabel"),e[1]=i,e[2]=p):p=e[2];let l=p;if(n===Ct){let O;e[3]!==i?(O=i("taskBoard.taskFilters.assigneeUnassigned"),e[3]=i,e[4]=O):O=e[4],l=O}else if(n===yt){let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(zt,{size:14}),e[5]=O):O=e[5],u=O;let L;e[6]!==i?(L=i("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=i,e[7]=L):L=e[7],l=L}else if(n){let O,L,oe,z;if(e[8]!==o||e[9]!==n){let De;e[14]!==n?(De=Te=>Te.userId===n,e[14]=n,e[15]=De):De=e[15],L=o.find(De),O=Lt,oe=L?.user?.image??void 0,z=$t(L?.user?.name),e[8]=o,e[9]=n,e[10]=O,e[11]=L,e[12]=oe,e[13]=z}else O=e[10],L=e[11],oe=e[12],z=e[13];let ve;e[16]!==O||e[17]!==oe||e[18]!==z?(ve=s.jsx(O,{url:oe,fallback:z,shape:"circle",size:"2xs"}),e[16]=O,e[17]=oe,e[18]=z,e[19]=ve):ve=e[19],u=ve;let de;e[20]!==L?.user?.name||e[21]!==i?(de=L?.user?.name??i("taskBoard.taskFilters.assigneeMember"),e[20]=L?.user?.name,e[21]=i,e[22]=de):de=e[22],l=de}let f;e[23]!==r?(f=O=>{r(O),c(!1)},e[23]=r,e[24]=f):f=e[24];const j=f,g=n!==null;let x;e[25]!==a||e[26]!==g?(x=we(g,a),e[25]=a,e[26]=g,e[27]=x):x=e[27];const y=x,S=a&&"ml-auto";let b;e[28]!==S?(b=re("shrink-0 opacity-60",S),e[28]=S,e[29]=b):b=e[29];const k=b;let v;e[30]!==l?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[30]=l,e[31]=v):v=e[31];let C;e[32]!==k?(C=s.jsx(ze,{size:12,className:k}),e[32]=k,e[33]=C):C=e[33];let D;e[34]!==u||e[35]!==v||e[36]!==C||e[37]!==y?(D=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:y,children:[u,v,C]})}),e[34]=u,e[35]=v,e[36]=C,e[37]=y,e[38]=D):D=e[38];let h;e[39]!==i?(h=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=i,e[40]=h):h=e[40];let _;e[41]!==i?(_=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=i,e[42]=_):_=e[42];let w;e[43]!==h||e[44]!==_?(w=s.jsx(Dt,{placeholder:h,"aria-label":_,className:"h-9"}),e[43]=h,e[44]=_,e[45]=w):w=e[45];let P;e[46]!==i?(P=i("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=i,e[47]=P):P=e[47];let V;e[48]!==P?(V=s.jsx(Tt,{children:P}),e[48]=P,e[49]=V):V=e[49];let N;e[50]!==i?(N=i("taskBoard.taskFilters.assigneeAnyone"),e[50]=i,e[51]=N):N=e[51];let T;e[52]!==j?(T=()=>j(null),e[52]=j,e[53]=T):T=e[53];let F;e[54]!==i?(F=i("taskBoard.taskFilters.assigneeAnyone"),e[54]=i,e[55]=F):F=e[55];let $;e[56]!==N||e[57]!==T||e[58]!==F?($=s.jsx(Ce,{value:N,onSelect:T,children:F}),e[56]=N,e[57]=T,e[58]=F,e[59]=$):$=e[59];let I;e[60]!==i?(I=i("taskBoard.taskFilters.assigneeUnassigned"),e[60]=i,e[61]=I):I=e[61];let B;e[62]!==j?(B=()=>j(Ct),e[62]=j,e[63]=B):B=e[63];let R;e[64]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Rt,{size:16,className:"text-muted-foreground"}),e[64]=R):R=e[64];let G;e[65]!==i?(G=i("taskBoard.taskFilters.assigneeUnassigned"),e[65]=i,e[66]=G):G=e[66];let E;e[67]!==I||e[68]!==B||e[69]!==G?(E=s.jsxs(Ce,{value:I,onSelect:B,className:"gap-2",children:[R,G]}),e[67]=I,e[68]=B,e[69]=G,e[70]=E):E=e[70];let U;e[71]!==i?(U=i("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=i,e[72]=U):U=e[72];let M;e[73]!==j?(M=()=>j(yt),e[73]=j,e[74]=M):M=e[74];let Q;e[75]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(zt,{size:16}),e[75]=Q):Q=e[75];let Z;e[76]!==i?(Z=i("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=i,e[77]=Z):Z=e[77];let ee;e[78]!==U||e[79]!==M||e[80]!==Z?(ee=s.jsxs(Ce,{value:U,onSelect:M,className:"gap-2",children:[Q,Z]}),e[78]=U,e[79]=M,e[80]=Z,e[81]=ee):ee=e[81];let K;e[82]!==$||e[83]!==E||e[84]!==ee?(K=s.jsxs(Le,{children:[$,E,ee]}),e[82]=$,e[83]=E,e[84]=ee,e[85]=K):K=e[85];let ne;e[86]!==i?(ne=i("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=i,e[87]=ne):ne=e[87];let W;if(e[88]!==o||e[89]!==j){let O;e[91]!==j?(O=L=>s.jsxs(Ce,{value:L.user?.name??L.userId,onSelect:()=>j(L.userId),className:"gap-2",children:[s.jsx(Lt,{url:L.user?.image??void 0,fallback:$t(L.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:L.user?.name??L.userId})]},L.userId),e[91]=j,e[92]=O):O=e[92],W=o.map(O),e[88]=o,e[89]=j,e[90]=W}else W=e[90];let X;e[93]!==ne||e[94]!==W?(X=s.jsx(Le,{heading:ne,children:W}),e[93]=ne,e[94]=W,e[95]=X):X=e[95];let J;e[96]!==V||e[97]!==K||e[98]!==X?(J=s.jsxs(Ft,{children:[V,K,X]}),e[96]=V,e[97]=K,e[98]=X,e[99]=J):J=e[99];let te;e[100]!==w||e[101]!==J?(te=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[w,J]})}),e[100]=w,e[101]=J,e[102]=te):te=e[102];let se;return e[103]!==m||e[104]!==D||e[105]!==te?(se=s.jsxs(wt,{open:m,onOpenChange:c,children:[D,te]}),e[103]=m,e[104]=D,e[105]=te,e[106]=se):se=e[106],se}function Qo(t){const e=Y.c(33),{value:n,onChange:o,block:r}=t,a=ae(),i=n!==null;let m;e[0]!==r||e[1]!==i?(m=we(i,r),e[0]=r,e[1]=i,e[2]=m):m=e[2];const c=m,d=r&&"ml-auto";let u;e[3]!==d?(u=re("shrink-0 opacity-60",d),e[3]=d,e[4]=u):u=e[4];const p=u;let l;e[5]!==n?(l=n?s.jsx("span",{className:re("size-2 shrink-0 rounded-full",We[n].dotClassName)}):s.jsx(Es,{size:14,className:"shrink-0"}),e[5]=n,e[6]=l):l=e[6];let f;e[7]!==a||e[8]!==n?(f=a(n?We[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=a,e[8]=n,e[9]=f):f=e[9];let j;e[10]!==p?(j=s.jsx(ze,{size:12,className:p}),e[10]=p,e[11]=j):j=e[11];let g;e[12]!==l||e[13]!==f||e[14]!==j||e[15]!==c?(g=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[l,f,j]})}),e[12]=l,e[13]=f,e[14]=j,e[15]=c,e[16]=g):g=e[16];const x=n??Re;let y;e[17]!==o?(y=D=>o(D===Re?null:D),e[17]=o,e[18]=y):y=e[18];let S;e[19]!==a?(S=a("taskBoard.taskFilters.priorityAnyPriority"),e[19]=a,e[20]=S):S=e[20];let b;e[21]!==S?(b=s.jsx(ot,{value:Re,children:S}),e[21]=S,e[22]=b):b=e[22];let k;e[23]!==a?(k=Bo.map(D=>s.jsxs(ot,{value:D,className:"gap-2",children:[s.jsx("span",{className:re("size-2 rounded-full",We[D].dotClassName)}),a(We[D].labelKey)]},D)),e[23]=a,e[24]=k):k=e[24];let v;e[25]!==y||e[26]!==b||e[27]!==k||e[28]!==x?(v=s.jsx(un,{align:"start",className:"w-40",children:s.jsxs(fn,{value:x,onValueChange:y,children:[b,k]})}),e[25]=y,e[26]=b,e[27]=k,e[28]=x,e[29]=v):v=e[29];let C;return e[30]!==v||e[31]!==g?(C=s.jsxs(mn,{children:[g,v]}),e[30]=v,e[31]=g,e[32]=C):C=e[32],C}function qo(t){const e=Y.c(35),{value:n,onChange:o,block:r}=t,a=ae();let i;e[0]!==a||e[1]!==n?(i=n?a(Gt[n]):void 0,e[0]=a,e[1]=n,e[2]=i):i=e[2];const m=i,c=n!==null;let d;e[3]!==r||e[4]!==c?(d=we(c,r),e[3]=r,e[4]=c,e[5]=d):d=e[5];const u=d,p=r&&"ml-auto";let l;e[6]!==p?(l=re("shrink-0 opacity-60",p),e[6]=p,e[7]=l):l=e[7];const f=l;let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(xt,{size:14,className:"shrink-0"}),e[8]=j):j=e[8];let g;e[9]!==m||e[10]!==a?(g=m??a("taskBoard.taskFilters.dueDateLabel"),e[9]=m,e[10]=a,e[11]=g):g=e[11];let x;e[12]!==f?(x=s.jsx(ze,{size:12,className:f}),e[12]=f,e[13]=x):x=e[13];let y;e[14]!==g||e[15]!==x||e[16]!==u?(y=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:u,children:[j,g,x]})}),e[14]=g,e[15]=x,e[16]=u,e[17]=y):y=e[17];const S=n??Re;let b;e[18]!==o?(b=w=>o(w===Re?null:w),e[18]=o,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(xt,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==a?(v=a("taskBoard.taskFilters.dueDateAnyTime"),e[21]=a,e[22]=v):v=e[22];let C;e[23]!==v?(C=s.jsxs(ot,{value:Re,className:"gap-2",children:[k,v]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]!==a?(D=Object.entries(Gt).map(w=>{const[P,V]=w,N=P==="overdue";return s.jsxs(ot,{value:P,className:re("gap-2",N&&"text-destructive"),children:[s.jsx(xt,{size:16,className:re("shrink-0",N?"text-destructive":"text-muted-foreground")}),a(V)]},P)}),e[25]=a,e[26]=D):D=e[26];let h;e[27]!==S||e[28]!==b||e[29]!==C||e[30]!==D?(h=s.jsx(un,{align:"start",className:"w-44",children:s.jsxs(fn,{value:S,onValueChange:b,children:[C,D]})}),e[27]=S,e[28]=b,e[29]=C,e[30]=D,e[31]=h):h=e[31];let _;return e[32]!==h||e[33]!==y?(_=s.jsxs(mn,{children:[y,h]}),e[32]=h,e[33]=y,e[34]=_):_=e[34],_}function Go(t){const e=Y.c(56),{value:n,tags:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]!==r||e[1]!==n?(d=I=>r(n.includes(I)?n.filter(B=>B!==I):[...n,I]),e[0]=r,e[1]=n,e[2]=d):d=e[2];const u=d;let p;e[3]!==i||e[4]!==o||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?i("taskBoard.taskFilters.tagsLabel"):n.length===1?o.find(I=>I.id===n[0])?.name??i("taskBoard.taskFilters.tagsLabel"):i("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=i,e[4]=o,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const l=p,f=n.length>0;let j;e[8]!==a||e[9]!==f?(j=we(f,a),e[8]=a,e[9]=f,e[10]=j):j=e[10];const g=j,x=a&&"ml-auto";let y;e[11]!==x?(y=re("shrink-0 opacity-60",x),e[11]=x,e[12]=y):y=e[12];const S=y;let b;e[13]!==o||e[14]!==n[0]||e[15]!==n.length?(b=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(o.find(I=>I.id===n[0])?.color)}}):s.jsx(cs,{size:14,className:"shrink-0"}),e[13]=o,e[14]=n[0],e[15]=n.length,e[16]=b):b=e[16];let k;e[17]!==l?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[17]=l,e[18]=k):k=e[18];let v;e[19]!==S?(v=s.jsx(ze,{size:12,className:S}),e[19]=S,e[20]=v):v=e[20];let C;e[21]!==b||e[22]!==k||e[23]!==v||e[24]!==g?(C=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[b,k,v]})}),e[21]=b,e[22]=k,e[23]=v,e[24]=g,e[25]=C):C=e[25];let D;e[26]!==i?(D=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=i,e[27]=D):D=e[27];let h;e[28]!==i?(h=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=i,e[29]=h):h=e[29];let _;e[30]!==D||e[31]!==h?(_=s.jsx(Dt,{placeholder:D,"aria-label":h,className:"h-9"}),e[30]=D,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==i?(w=i("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=i,e[34]=w):w=e[34];let P;e[35]!==w?(P=s.jsx(Tt,{children:w}),e[35]=w,e[36]=P):P=e[36];let V;if(e[37]!==o||e[38]!==u||e[39]!==n){let I;e[41]!==u||e[42]!==n?(I=B=>s.jsxs(Ce,{value:B.name,onSelect:()=>u(B.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(B.color)}}),s.jsx("span",{className:"flex-1 truncate",children:B.name}),n.includes(B.id)&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"})]},B.id),e[41]=u,e[42]=n,e[43]=I):I=e[43],V=o.map(I),e[37]=o,e[38]=u,e[39]=n,e[40]=V}else V=e[40];let N;e[44]!==V?(N=s.jsx(Le,{children:V}),e[44]=V,e[45]=N):N=e[45];let T;e[46]!==P||e[47]!==N?(T=s.jsxs(Ft,{children:[P,N]}),e[46]=P,e[47]=N,e[48]=T):T=e[48];let F;e[49]!==_||e[50]!==T?(F=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[_,T]})}),e[49]=_,e[50]=T,e[51]=F):F=e[51];let $;return e[52]!==m||e[53]!==C||e[54]!==F?($=s.jsxs(wt,{open:m,onOpenChange:c,children:[C,F]}),e[52]=m,e[53]=C,e[54]=F,e[55]=$):$=e[55],$}function Ht(t){const e=Y.c(11),{entry:n,selected:o,onSelect:r}=t,a=n.id,i=n.title;let m;e[0]!==n.projects?(m=n.projects.map(Ho).join(" "),e[0]=n.projects,e[1]=m):m=e[1];const c=`${a} ${i} ${n.repo??""} ${m}`;let d;e[2]!==n?(d=s.jsx(Eo,{entry:n}),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"}),e[4]=o,e[5]=u):u=e[5];let p;return e[6]!==r||e[7]!==c||e[8]!==d||e[9]!==u?(p=s.jsxs(Ce,{value:c,onSelect:r,className:"gap-2",children:[d,u]}),e[6]=r,e[7]=c,e[8]=d,e[9]=u,e[10]=p):p=e[10],p}function Ho(t){return t.title}function Yo(t,e,n,o){return t===null||!n?o("taskBoard.taskFilters.projectLabel"):t===at?o("taskBoard.taskFilters.projectNone"):e?.title??t}function Wo(t){const e=Y.c(90),{value:n,index:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d,u,p,l,f,j,g,x,y,S,b,k,v,C;if(e[0]!==a||e[1]!==o||e[2]!==r||e[3]!==m||e[4]!==i||e[5]!==n){const P=n===null?void 0:Pt(n,o),V=lt(n,o),N=Yo(n,P,V,i);let T;e[20]!==r?(T=z=>{r(z),c(!1)},e[20]=r,e[21]=T):T=e[21];const F=T,$=o.entries.filter(Jo),I=o.entries.filter(Xo),B=we(V,a),R=a&&"ml-auto";let G;e[22]!==R?(G=re("shrink-0 opacity-60",R),e[22]=R,e[23]=G):G=e[23];const E=G;l=wt,v=m,C=c;const U=V?P:void 0;let M;e[24]!==U?(M=s.jsx(Cn,{entry:U}),e[24]=U,e[25]=M):M=e[25];let Q;e[26]!==N?(Q=s.jsx("span",{className:"max-w-[12rem] truncate",children:N}),e[26]=N,e[27]=Q):Q=e[27];let Z;e[28]!==E?(Z=s.jsx(ze,{size:12,className:E}),e[28]=E,e[29]=Z):Z=e[29],e[30]!==M||e[31]!==Q||e[32]!==Z||e[33]!==B?(j=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:B,children:[M,Q,Z]})}),e[30]=M,e[31]=Q,e[32]=Z,e[33]=B,e[34]=j):j=e[34],p=St,b="start",k="w-72 p-0",u=At;let ee;e[35]!==i?(ee=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[35]=i,e[36]=ee):ee=e[36];let K;e[37]!==i?(K=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[37]=i,e[38]=K):K=e[38],e[39]!==ee||e[40]!==K?(S=s.jsx(Dt,{placeholder:ee,"aria-label":K,className:"h-9"}),e[39]=ee,e[40]=K,e[41]=S):S=e[41],d=Ft;let ne;e[42]!==i?(ne=i("taskBoard.taskFilters.projectNoneFound"),e[42]=i,e[43]=ne):ne=e[43],e[44]!==ne?(f=s.jsx(Tt,{children:ne}),e[44]=ne,e[45]=f):f=e[45];let W;e[46]!==i?(W=i("taskBoard.taskFilters.projectAny"),e[46]=i,e[47]=W):W=e[47];let X;e[48]!==F?(X=()=>F(null),e[48]=F,e[49]=X):X=e[49];let J;e[50]!==i?(J=i("taskBoard.taskFilters.projectAny"),e[50]=i,e[51]=J):J=e[51];let te;e[52]!==W||e[53]!==X||e[54]!==J?(te=s.jsx(Ce,{value:W,onSelect:X,children:J}),e[52]=W,e[53]=X,e[54]=J,e[55]=te):te=e[55];let se;e[56]!==i?(se=i("taskBoard.taskFilters.projectNone"),e[56]=i,e[57]=se):se=e[57];let O;e[58]!==F?(O=()=>F(at),e[58]=F,e[59]=O):O=e[59];let L;e[60]!==i?(L=i("taskBoard.taskFilters.projectNone"),e[60]=i,e[61]=L):L=e[61];let oe;e[62]!==se||e[63]!==O||e[64]!==L?(oe=s.jsx(Ce,{value:se,onSelect:O,children:L}),e[62]=se,e[63]=O,e[64]=L,e[65]=oe):oe=e[65],e[66]!==te||e[67]!==oe?(g=s.jsxs(Le,{children:[te,oe]}),e[66]=te,e[67]=oe,e[68]=g):g=e[68],x=$.length>0&&s.jsx(Le,{heading:i("taskBoard.taskFilters.projectGroupProjects"),children:$.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),y=I.length>0&&s.jsx(Le,{heading:i("taskBoard.taskFilters.projectGroupRepos"),children:I.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),e[0]=a,e[1]=o,e[2]=r,e[3]=m,e[4]=i,e[5]=n,e[6]=d,e[7]=u,e[8]=p,e[9]=l,e[10]=f,e[11]=j,e[12]=g,e[13]=x,e[14]=y,e[15]=S,e[16]=b,e[17]=k,e[18]=v,e[19]=C}else d=e[6],u=e[7],p=e[8],l=e[9],f=e[10],j=e[11],g=e[12],x=e[13],y=e[14],S=e[15],b=e[16],k=e[17],v=e[18],C=e[19];let D;e[69]!==d||e[70]!==f||e[71]!==g||e[72]!==x||e[73]!==y?(D=s.jsxs(d,{children:[f,g,x,y]}),e[69]=d,e[70]=f,e[71]=g,e[72]=x,e[73]=y,e[74]=D):D=e[74];let h;e[75]!==u||e[76]!==D||e[77]!==S?(h=s.jsxs(u,{children:[S,D]}),e[75]=u,e[76]=D,e[77]=S,e[78]=h):h=e[78];let _;e[79]!==p||e[80]!==h||e[81]!==b||e[82]!==k?(_=s.jsx(p,{align:b,className:k,children:h}),e[79]=p,e[80]=h,e[81]=b,e[82]=k,e[83]=_):_=e[83];let w;return e[84]!==l||e[85]!==j||e[86]!==_||e[87]!==v||e[88]!==C?(w=s.jsxs(l,{open:v,onOpenChange:C,children:[j,_]}),e[84]=l,e[85]=j,e[86]=_,e[87]=v,e[88]=C,e[89]=w):w=e[89],w}function Xo(t){return t.projects.length===0}function Jo(t){return t.projects.length>0}function Zo(t){const e=Y.c(25),{value:n,onChange:o,block:r}=t,a=ae(),[i,m]=H.useState(n!==""),[c,d]=H.useState(!1),[u,p]=H.useState(n);n!==u&&(p(n),n===""&&!c&&m(!1));const l=i||r,f=l?"w-32 sm:w-44":"w-8 px-0 justify-center",j=r&&"h-10 w-full px-3 text-sm sm:w-full";let g;e[0]!==f||e[1]!==j?(g=re("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",f,j),e[0]=f,e[1]=j,e[2]=g):g=e[2];let x;e[3]!==a?(x=a("taskBoard.taskFilters.searchLabel"),e[3]=a,e[4]=x):x=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>m(!0),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ds,{size:14}),e[6]=S):S=e[6];let b;e[7]!==x?(b=s.jsx("button",{type:"button","aria-label":x,onClick:y,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=b):b=e[8];let k;e[9]!==r||e[10]!==l||e[11]!==o||e[12]!==a||e[13]!==n?(k=l&&s.jsx("input",{autoFocus:!r,value:n,onChange:D=>o(D.target.value),onFocus:()=>d(!0),onBlur:()=>{d(!1),n===""&&m(!1)},placeholder:a("taskBoard.taskFilters.searchPlaceholder"),"aria-label":a("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=r,e[10]=l,e[11]=o,e[12]=a,e[13]=n,e[14]=k):k=e[14];let v;e[15]!==r||e[16]!==o||e[17]!==a||e[18]!==n?(v=n!==""&&s.jsx("button",{type:"button","aria-label":a("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ei,onClick:()=>{o(""),r||m(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx(Mn,{size:14})}),e[15]=r,e[16]=o,e[17]=a,e[18]=n,e[19]=v):v=e[19];let C;return e[20]!==g||e[21]!==b||e[22]!==k||e[23]!==v?(C=s.jsxs("div",{className:g,children:[b,k,v]}),e[20]=g,e[21]=b,e[22]=k,e[23]=v,e[24]=C):C=e[24],C}function ei(t){return t.preventDefault()}function ti(t){const e=Y.c(20),{block:n,onClick:o}=t,r=ae();let a;e[0]!==r?(a=r("taskBoard.taskFilters.boardSettingsLabel"),e[0]=r,e[1]=a):a=e[1];const i=a;let m;e[2]!==n?(m=re(we(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Vs,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let d;e[5]!==n||e[6]!==i?(d=n&&s.jsx("span",{children:i}),e[5]=n,e[6]=i,e[7]=d):d=e[7];let u;e[8]!==i||e[9]!==o||e[10]!==m||e[11]!==d?(u=s.jsxs("button",{type:"button",onClick:o,"aria-label":i,className:m,children:[c,d]}),e[8]=i,e[9]=o,e[10]=m,e[11]=d,e[12]=u):u=e[12];const p=u;if(n)return p;let l;e[13]!==p?(l=s.jsx(Ze,{asChild:!0,children:p}),e[13]=p,e[14]=l):l=e[14];let f;e[15]!==i?(f=s.jsx(et,{side:"top",children:i}),e[15]=i,e[16]=f):f=e[16];let j;return e[17]!==l||e[18]!==f?(j=s.jsxs(Je,{children:[l,f]}),e[17]=l,e[18]=f,e[19]=j):j=e[19],j}function Sn(t){const e=Y.c(53),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m,block:c}=t;let d;e[0]!==n||e[1]!==i?(d=C=>i({...n,search:C}),e[0]=n,e[1]=i,e[2]=d):d=e[2];let u;e[3]!==c||e[4]!==n.search||e[5]!==d?(u=s.jsx(Zo,{block:c,value:n.search,onChange:d}),e[3]=c,e[4]=n.search,e[5]=d,e[6]=u):u=e[6];let p;e[7]!==n||e[8]!==i?(p=C=>i({...n,assignee:C}),e[7]=n,e[8]=i,e[9]=p):p=e[9];let l;e[10]!==c||e[11]!==n.assignee||e[12]!==o||e[13]!==p?(l=s.jsx(Uo,{block:c,value:n.assignee,members:o,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=o,e[13]=p,e[14]=l):l=e[14];let f;e[15]!==n||e[16]!==i?(f=C=>i({...n,priority:C}),e[15]=n,e[16]=i,e[17]=f):f=e[17];let j;e[18]!==c||e[19]!==n.priority||e[20]!==f?(j=s.jsx(Qo,{block:c,value:n.priority,onChange:f}),e[18]=c,e[19]=n.priority,e[20]=f,e[21]=j):j=e[21];let g;e[22]!==n||e[23]!==i?(g=C=>i({...n,due:C}),e[22]=n,e[23]=i,e[24]=g):g=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==g?(x=s.jsx(qo,{block:c,value:n.due,onChange:g}),e[25]=c,e[26]=n.due,e[27]=g,e[28]=x):x=e[28];let y;e[29]!==n||e[30]!==i?(y=C=>i({...n,tags:C}),e[29]=n,e[30]=i,e[31]=y):y=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==y||e[35]!==r?(S=s.jsx(Go,{block:c,value:n.tags,tags:r,onChange:y}),e[32]=c,e[33]=n.tags,e[34]=y,e[35]=r,e[36]=S):S=e[36];let b;e[37]!==c||e[38]!==n||e[39]!==a||e[40]!==i?(b=(a.entries.length>0||lt(n.project,a))&&s.jsx(Wo,{block:c,value:n.project,index:a,onChange:C=>i({...n,project:C})}),e[37]=c,e[38]=n,e[39]=a,e[40]=i,e[41]=b):b=e[41];let k;e[42]!==c||e[43]!==m?(k=s.jsx(ti,{block:c,onClick:m}),e[42]=c,e[43]=m,e[44]=k):k=e[44];let v;return e[45]!==S||e[46]!==b||e[47]!==k||e[48]!==u||e[49]!==l||e[50]!==j||e[51]!==x?(v=s.jsxs(s.Fragment,{children:[u,l,j,x,S,b,k]}),e[45]=S,e[46]=b,e[47]=k,e[48]=u,e[49]=l,e[50]=j,e[51]=x,e[52]=v):v=e[52],v}function Mr(t){const e=Y.c(16),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(cn,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=d):d=e[0];let u;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==i||e[5]!==m||e[6]!==r?(u=s.jsx(Sn,{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}),e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=m,e[6]=r,e[7]=u):u=e[7];let p;e[8]!==n||e[9]!==a||e[10]!==i||e[11]!==c?(p=Lo(n,a)&&s.jsx("button",{type:"button",onClick:()=>i(Nn),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=a,e[10]=i,e[11]=c,e[12]=p):p=e[12];let l;return e[13]!==u||e[14]!==p?(l=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p]}),e[13]=u,e[14]=p,e[15]=l):l=e[15],l}function Or(t){const e=Y.c(41),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae(),[d,u]=H.useState(!1),p=Ro(n,a),l=p>0;let f;e[0]!==l?(f=we(l),e[0]=l,e[1]=f):f=e[1];const j=f;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(cn,{size:14,className:"shrink-0"}),e[2]=g):g=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let y;e[5]!==p?(y=p>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:p}),e[5]=p,e[6]=y):y=e[6];let S;e[7]!==x||e[8]!==y||e[9]!==j?(S=s.jsx(Hn,{asChild:!0,children:s.jsxs("button",{type:"button",className:j,children:[g,x,y]})}),e[7]=x,e[8]=y,e[9]=j,e[10]=S):S=e[10];let b;e[11]!==c?(b=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=b):b=e[12];let k;e[13]!==b?(k=s.jsx(on,{className:"px-4 pt-4 text-base font-medium text-foreground",children:b}),e[13]=b,e[14]=k):k=e[14];let v;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==i||e[19]!==m||e[20]!==r?(v=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Sn,{block:!0,filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m})}),e[15]=n,e[16]=a,e[17]=o,e[18]=i,e[19]=m,e[20]=r,e[21]=v):v=e[21];let C;e[22]!==p||e[23]!==i||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>i(Nn),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=i,e[24]=c,e[25]=C):C=e[25];let D;e[26]!==c?(D=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=D):D=e[27];let h;e[28]!==D?(h=s.jsx(rn,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:D})}),e[28]=D,e[29]=h):h=e[29];let _;e[30]!==C||e[31]!==h?(_=s.jsxs(an,{className:"flex-row gap-2",children:[C,h]}),e[30]=C,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==_||e[34]!==k||e[35]!==v?(w=s.jsxs(sn,{className:"p-0",children:[k,v,_]}),e[33]=_,e[34]=k,e[35]=v,e[36]=w):w=e[36];let P;return e[37]!==d||e[38]!==w||e[39]!==S?(P=s.jsxs(nn,{open:d,onOpenChange:u,direction:"bottom",children:[S,w]}),e[37]=d,e[38]=w,e[39]=S,e[40]=P):P=e[40],P}function Lr(t,e){return io(t,e.keySeq)??e.id}function Rr(t,e){const n=e?.trim();if(n)return t.find(o=>_n(n,o.keySeq))??t.find(o=>o.id===n)}export{gr as $,Ji as A,lr as B,hn as C,Bt as D,No as E,vt as F,Ir as G,_r as H,We as I,Pt as J,hr as K,Bo as L,Sr as M,qt as N,Er as O,co as P,vr as Q,bn as R,zt as S,wr as T,Dr as U,Cn as V,Eo as W,xr as X,jr as Y,wo as Z,yn as _,fr as a,Rr as a0,Or as a1,Mr as a2,Nr as a3,Tr as a4,Nn as a5,Cr as a6,br as a7,Qt as a8,kr as a9,Fr as aa,Vr as ab,Do as ac,Pr as ad,Ar as ae,vo as af,pr as b,Br as c,Oo as d,gn as e,Lr as f,yr as g,ko as h,jn as i,er as j,nr as k,rr as l,po as m,mr as n,ir as o,mo as p,ar as q,tr as r,sr as s,io as t,Zi as u,or as v,ho as w,ur as x,cr as y,dr as z};
@@ -1 +1 @@
1
- import{c as N,r as J,j as a,l as V,B as G,G as z,a7 as U,K as H,m as X,n as se,e as Z,b as M,b8 as ie,t as q,b0 as te,a$ as Q,b1 as oe,P as ee,b5 as ue,p as ce,L as ge}from"./index-Ceg1_k49.js";import{I as Y}from"./input-DrL2uw5z.js";import{i as de}from"./Check-DtJz5CyC.js";import{i as me}from"./ChevronSelectorVertical-C4DufZYV.js";import{i as pe}from"./Play-CZ8aVG1p.js";import{s as xe}from"./Plus-C5q9r8Yq.js";import{s as je}from"./Trash01-Cov4gega.js";import{a as he,c as be,d as ye,e as Se,b as ve,C as Ne}from"./command-CRPbocXF.js";import{a as _e,P as we,b as Pe}from"./popover-DOf_4xx6.js";import{S as Te}from"./switch-DWS_n8np.js";import{T as le}from"./textarea-Bp0YSowj.js";import{c as Ce,d as Ae,b as Re,f as ke,g as Ie,e as Ee,a as $e,A as Oe}from"./alert-dialog-Cx3V33Ia.js";import{R as De,A as Ke}from"./review-settings-B6yWeIK2.js";import{g as Le}from"./task-board-DmcFtfUx.js";import{R as Fe}from"./require-capability-fhOtzzgy.js";import"./index-DI4VoLrH.js";import"./dialog-CfgV-qVB.js";import"./SearchMd-uXEQKukA.js";import"./UserSquare-BScHWlu5.js";import"./GitBranch01-BQiQ4mM-.js";import"./SearchLg-DU49HkCE.js";import"./use-organization-settings-hhHskEVV.js";import"./use-mcp-client-BcROUps9.js";import"./auth-DEscJ-p8.js";import"./schema-CiLixz9_.js";import"./use-connection-C5dXNJfY.js";import"./access-gate-C3u_edpI.js";import"./capability-load-error-DK1Gssfp.js";function Be(t){const e=N.c(41),{options:l,value:s,onChange:i,placeholder:n,triggerClassName:r,contentClassName:o,width:f,renderTrigger:m,renderItem:u,emptyMessage:c,searchPlaceholder:d,filter:g}=t,p=n===void 0?"Select...":n,b=f===void 0?"w-[200px]":f,j=c===void 0?"No results found.":c,x=d===void 0?"Search...":d;let h;e[0]!==s?(h=T=>T.value===s,e[0]=s,e[1]=h):h=e[1];const y=l.find(h),[v,S]=J.useState(!1),_=we,w=_e,C=!0,P=m?a.jsx("div",{className:V("cursor-pointer",r),children:m(y)}):a.jsxs(G,{variant:"outline",role:"combobox",className:V("justify-between",b,r),children:[y?y.label:p,a.jsx(me,{className:"opacity-50"})]});let R;e[2]!==w||e[3]!==P?(R=a.jsx(w,{asChild:C,children:P}),e[2]=w,e[3]=P,e[4]=R):R=e[4];let A;e[5]!==o?(A=V("p-0",o),e[5]=o,e[6]=A):A=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O={width:"var(--radix-popover-trigger-width)"},e[7]=O):O=e[7];let D;e[8]!==x?(D=a.jsx(he,{placeholder:x,className:"h-9"}),e[8]=x,e[9]=D):D=e[9];let k;e[10]!==j?(k=a.jsx(be,{children:j}),e[10]=j,e[11]=k):k=e[11];let K;if(e[12]!==i||e[13]!==l||e[14]!==u||e[15]!==S||e[16]!==s){let T;e[18]!==i||e[19]!==u||e[20]!==S||e[21]!==s?(T=B=>{const ae=s===B.value;return a.jsx(ye,{value:B.label,onSelect:()=>{i(B.value===s?"":B.value),S(!1)},children:u?u(B,ae):a.jsxs(a.Fragment,{children:[B.label,a.jsx(de,{className:V("ml-auto",ae?"opacity-100":"opacity-0")})]})},B.value)},e[18]=i,e[19]=u,e[20]=S,e[21]=s,e[22]=T):T=e[22],K=l.map(T),e[12]=i,e[13]=l,e[14]=u,e[15]=S,e[16]=s,e[17]=K}else K=e[17];let I;e[23]!==K?(I=a.jsx(Se,{children:K}),e[23]=K,e[24]=I):I=e[24];let F;e[25]!==k||e[26]!==I?(F=a.jsxs(ve,{children:[k,I]}),e[25]=k,e[26]=I,e[27]=F):F=e[27];let E;e[28]!==g||e[29]!==D||e[30]!==F?(E=a.jsxs(Ne,{filter:g,children:[D,F]}),e[28]=g,e[29]=D,e[30]=F,e[31]=E):E=e[31];let $;e[32]!==E||e[33]!==A?($=a.jsx(Pe,{className:A,style:O,children:E}),e[32]=E,e[33]=A,e[34]=$):$=e[34];let L;return e[35]!==_||e[36]!==v||e[37]!==S||e[38]!==$||e[39]!==R?(L=a.jsxs(_,{open:v,onOpenChange:S,children:[R,$]}),e[35]=_,e[36]=v,e[37]=S,e[38]=$,e[39]=R,e[40]=L):L=e[40],L}function qe(t){const e=N.c(4),{size:l,className:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=i):i=e[0];let n;return e[1]!==s||e[2]!==l?(n=a.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:i}),e[1]=s,e[2]=l,e[3]=n):n=e[3],n}function fe(t){const e=t.projectName?.replace(/\s+/g," ").trim(),l=t.name.trim();return e?{primary:e,secondary:[l,t.projectKey].filter(Boolean).join(" · ")}:{primary:l,secondary:t.projectKey??""}}function Me(t){const{primary:e,secondary:l}=fe(t);return[e,l,`#${t.id}`].filter(Boolean).join(" ")}function re(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Je(t,e){const l=re(e).trim();if(!l)return 1;const s=re(t);return l.split(/\s+/).every(i=>s.includes(i))?1:0}function ze(){const t=N.c(7),{org:e}=z(),l=U();let s;t[0]!==e.id?(s=H.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==l?(i=async()=>(await l.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=l,t[3]=i):i=t[3];let n;return t[4]!==s||t[5]!==i?(n={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=n):n=t[6],X(n)}function ne(){const t=N.c(8),{org:e}=z(),l=U(),s=se();let i;t[0]!==l?(i=async o=>(await l.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=l,t[1]=i):i=t[1];let n;t[2]!==e||t[3]!==s?(n=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=n):n=t[4];let r;return t[5]!==i||t[6]!==n?(r={mutationFn:i,onSettled:n},t[5]=i,t[6]=n,t[7]=r):r=t[7],Z(r)}function Ue(){const t=N.c(8),{org:e}=z(),l=U(),s=se();let i;t[0]!==l?(i=()=>l.call("JIRA_INTEGRATION_DELETE",{}),t[0]=l,t[1]=i):i=t[1];let n;t[2]!==e||t[3]!==s?(n=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=n):n=t[4];let r;return t[5]!==i||t[6]!==n?(r={mutationFn:i,onSettled:n},t[5]=i,t[6]=n,t[7]=r):r=t[7],Z(r)}function Ge(t){const e=N.c(8),{org:l}=z(),s=U();let i;e[0]!==l.id?(i=H.jiraBoards(l.id),e[0]=l.id,e[1]=i):i=e[1];let n;e[2]!==s?(n=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=n):n=e[3];let r;return e[4]!==t||e[5]!==i||e[6]!==n?(r={queryKey:i,enabled:t,staleTime:6e4,queryFn:n},e[4]=t,e[5]=i,e[6]=n,e[7]=r):r=e[7],X(r)}function He(t){const e=N.c(10),{org:l}=z(),s=U();let i;e[0]!==t||e[1]!==l.id?(i=H.jiraBoardColumns(l.id,t),e[0]=t,e[1]=l.id,e[2]=i):i=e[2];const n=t!==null;let r;e[3]!==t||e[4]!==s?(r=async()=>(await s.call("JIRA_BOARD_COLUMNS_LIST",{boardId:t??""})).columns,e[3]=t,e[4]=s,e[5]=r):r=e[5];let o;return e[6]!==i||e[7]!==n||e[8]!==r?(o={queryKey:i,enabled:n,staleTime:6e4,queryFn:r},e[6]=i,e[7]=n,e[8]=r,e[9]=o):o=e[9],X(o)}function Qe(){const t=N.c(7),{org:e}=z(),l=U();let s;t[0]!==e.id?(s=H.jiraAutomations(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==l?(i=async()=>(await l.call("JIRA_AUTOMATION_LIST",{})).automations,t[2]=l,t[3]=i):i=t[3];let n;return t[4]!==s||t[5]!==i?(n={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=n):n=t[6],X(n)}function We(){const t=N.c(8),{org:e}=z(),l=U(),s=se();let i;t[0]!==l?(i=async o=>{if(o.prompt===null){await l.call("JIRA_AUTOMATION_DELETE",{jiraStatus:o.jiraStatus});return}await l.call("JIRA_AUTOMATION_UPSERT",{jiraStatus:o.jiraStatus,prompt:o.prompt.trim()===""?void 0:o.prompt})},t[0]=l,t[1]=i):i=t[1];let n;t[2]!==e||t[3]!==s?(n=()=>s.invalidateQueries({queryKey:H.jiraAutomations(e.id)}),t[2]=e,t[3]=s,t[4]=n):n=t[4];let r;return t[5]!==i||t[6]!==n?(r={mutationFn:i,onSettled:n},t[5]=i,t[6]=n,t[7]=r):r=t[7],Z(r)}function Ve(){const t=N.c(2),e=U();let l;return t[0]!==e?(l={mutationFn:s=>e.call("JIRA_RUN_START",s)},t[0]=e,t[1]=l):l=t[1],Z(l)}function Ye(){const t=N.c(12),{org:e}=z(),l=U();let s;t[0]!==e.id?(s=H.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==l?(i=async()=>(await l.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=l,t[3]=i):i=t[3];let n;t[4]!==s||t[5]!==i?(n={queryKey:s,staleTime:6e4,queryFn:i},t[4]=s,t[5]=i,t[6]=n):n=t[6];const r=X(n);let o;t[7]!==r.data?(o=r.data?.find(Xe)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let f;return t[9]!==r.isPending||t[10]!==o?(f={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=f):f=t[11],f}function Xe(t){return t.columnKey===null}function Ze(){const t=N.c(8),{org:e}=z(),l=U(),s=se();let i;t[0]!==l?(i=async o=>{const f=o.trim();if(!f){await l.call("TASK_BOARD_PROMPT_DELETE",{});return}await l.call("TASK_BOARD_PROMPT_UPSERT",{prompt:f})},t[0]=l,t[1]=i):i=t[1];let n;t[2]!==e||t[3]!==s?(n=()=>s.invalidateQueries({queryKey:H.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=n):n=t[4];let r;return t[5]!==i||t[6]!==n?(r={mutationFn:i,onSettled:n},t[5]=i,t[6]=n,t[7]=r):r=t[7],Z(r)}function et(){const t=N.c(16),e=M(),{prompt:l,isPending:s}=Ye(),i=Ze(),[n,r]=J.useState(l),[o,f]=J.useState(l);o!==l&&(f(l),r(l));let m;t[0]!==e?(m=e("settings.taskPrompt.title"),t[0]=e,t[1]=m):m=t[1];let u;t[2]!==e?(u=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=u):u=t[3];let c;t[4]!==n||t[5]!==s||t[6]!==l||t[7]!==i||t[8]!==e?(c=s?a.jsx(ie,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(le,{value:n,rows:10,maxLength:Le,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(G,{size:"sm",disabled:n===l||i.isPending,onClick:()=>i.mutate(n,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=n,t[5]=s,t[6]=l,t[7]=i,t[8]=e,t[9]=c):c=t[9];let d;t[10]!==u||t[11]!==c?(d=a.jsx(te,{children:a.jsx(Q,{title:u,children:c})}),t[10]=u,t[11]=c,t[12]=d):d=t[12];let g;return t[13]!==m||t[14]!==d?(g=a.jsx(oe,{title:m,children:d}),t[13]=m,t[14]=d,t[15]=g):g=t[15],g}function W(t,e){return t instanceof Error?t.message:e}const tt="https://id.atlassian.com/manage-profile/security/api-tokens";function st(t){const e=N.c(7),{stepKeys:l}=t,s=M();let i;if(e[0]!==l||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],i=l.map(r),e[0]=l,e[1]=s,e[2]=i}else i=e[2];let n;return e[5]!==i?(n=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:i}),e[5]=i,e[6]=n):n=e[6],n}function it(){const t=N.c(69),e=M(),l=ne(),[s,i]=J.useState(""),[n,r]=J.useState(""),[o,f]=J.useState("");let m;t[0]!==o||t[1]!==n||t[2]!==s?(m=s.trim()!==""&&n.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=n,t[2]=s,t[3]=m):m=t[3];const u=m;let c;t[4]!==e?(c=e("settings.jira.siteLabel"),t[4]=e,t[5]=c):c=t[5];let d;t[6]!==c?(d=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:c}),t[6]=c,t[7]=d):d=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=B=>i(B.target.value),t[8]=g):g=t[8];let p;t[9]!==e?(p=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=p):p=t[10];let b;t[11]!==s||t[12]!==p?(b=a.jsx(Y,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let j;t[14]!==d||t[15]!==b?(j=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,b]}),t[14]=d,t[15]=b,t[16]=j):j=t[16];let x;t[17]!==e?(x=e("settings.jira.emailLabel"),t[17]=e,t[18]=x):x=t[18];let h;t[19]!==x?(h=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:x}),t[19]=x,t[20]=h):h=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=B=>r(B.target.value),t[21]=y):y=t[21];let v;t[22]!==e?(v=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=v):v=t[23];let S;t[24]!==n||t[25]!==v?(S=a.jsx(Y,{value:n,onChange:y,placeholder:v,autoComplete:"off"}),t[24]=n,t[25]=v,t[26]=S):S=t[26];let _;t[27]!==S||t[28]!==h?(_=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,S]}),t[27]=S,t[28]=h,t[29]=_):_=t[29];let w;t[30]!==e?(w=e("settings.jira.tokenLabel"),t[30]=e,t[31]=w):w=t[31];let C;t[32]!==w?(C=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:w}),t[32]=w,t[33]=C):C=t[33];let P;t[34]!==e?(P=e("settings.jira.createTokenLink"),t[34]=e,t[35]=P):P=t[35];let R;t[36]===Symbol.for("react.memo_cache_sentinel")?(R=a.jsx(ce,{size:12}),t[36]=R):R=t[36];let A;t[37]!==P?(A=a.jsxs("a",{href:tt,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[P,R]}),t[37]=P,t[38]=A):A=t[38];let O;t[39]!==C||t[40]!==A?(O=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C,A]}),t[39]=C,t[40]=A,t[41]=O):O=t[41];let D;t[42]===Symbol.for("react.memo_cache_sentinel")?(D=B=>f(B.target.value),t[42]=D):D=t[42];let k;t[43]!==e?(k=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=k):k=t[44];let K;t[45]!==o||t[46]!==k?(K=a.jsx(Y,{type:"password",value:o,onChange:D,placeholder:k,autoComplete:"off"}),t[45]=o,t[46]=k,t[47]=K):K=t[47];let I;t[48]!==O||t[49]!==K?(I=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,K]}),t[48]=O,t[49]=K,t[50]=I):I=t[50];const F=!u||l.isPending;let E;t[51]!==o||t[52]!==n||t[53]!==s||t[54]!==e||t[55]!==l?(E=()=>l.mutate({siteUrl:s.trim(),email:n.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:B=>q.error(W(B,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=n,t[53]=s,t[54]=e,t[55]=l,t[56]=E):E=t[56];let $;t[57]!==e||t[58]!==l.isPending?($=l.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=l.isPending,t[59]=$):$=t[59];let L;t[60]!==F||t[61]!==E||t[62]!==$?(L=a.jsx(G,{size:"sm",className:"w-fit",disabled:F,onClick:E,children:$}),t[60]=F,t[61]=E,t[62]=$,t[63]=L):L=t[63];let T;return t[64]!==_||t[65]!==I||t[66]!==L||t[67]!==j?(T=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[j,_,I,L]}),t[64]=_,t[65]=I,t[66]=L,t[67]=j,t[68]=T):T=t[68],T}function lt(t){const e=N.c(44),{integration:l}=t,s=M(),i=Ue(),[n,r]=J.useState(!1),o=l.siteUrl,f=l.email;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>r(!0),e[0]=m):m=e[0];let u;e[1]!==s?(u=s("settings.jira.disconnect"),e[1]=s,e[2]=u):u=e[2];let c;e[3]!==u?(c=a.jsx(G,{variant:"outline",size:"sm",onClick:m,children:u}),e[3]=u,e[4]=c):c=e[4];let d;e[5]!==l.email||e[6]!==l.siteUrl||e[7]!==c?(d=a.jsx(Q,{title:o,description:f,action:c}),e[5]=l.email,e[6]=l.siteUrl,e[7]=c,e[8]=d):d=e[8];let g;e[9]!==s?(g=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=g):g=e[10];let p;e[11]!==g?(p=a.jsx(Ce,{children:g}),e[11]=g,e[12]=p):p=e[12];let b;e[13]!==s?(b=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=b):b=e[14];let j;e[15]!==b?(j=a.jsx(Ae,{children:b}),e[15]=b,e[16]=j):j=e[16];let x;e[17]!==j||e[18]!==p?(x=a.jsxs(Re,{children:[p,j]}),e[17]=j,e[18]=p,e[19]=x):x=e[19];let h;e[20]!==s?(h=s("settings.jira.cancel"),e[20]=s,e[21]=h):h=e[21];let y;e[22]!==h?(y=a.jsx(ke,{children:h}),e[22]=h,e[23]=y):y=e[23];let v;e[24]!==i||e[25]!==s?(v=()=>i.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:A=>q.error(W(A,s("settings.jira.saveFailed")))}),e[24]=i,e[25]=s,e[26]=v):v=e[26];let S;e[27]!==s?(S=s("settings.jira.disconnect"),e[27]=s,e[28]=S):S=e[28];let _;e[29]!==v||e[30]!==S?(_=a.jsx(Ie,{onClick:v,children:S}),e[29]=v,e[30]=S,e[31]=_):_=e[31];let w;e[32]!==y||e[33]!==_?(w=a.jsxs(Ee,{children:[y,_]}),e[32]=y,e[33]=_,e[34]=w):w=e[34];let C;e[35]!==x||e[36]!==w?(C=a.jsxs($e,{children:[x,w]}),e[35]=x,e[36]=w,e[37]=C):C=e[37];let P;e[38]!==n||e[39]!==C?(P=a.jsx(Oe,{open:n,onOpenChange:r,children:C}),e[38]=n,e[39]=C,e[40]=P):P=e[40];let R;return e[41]!==P||e[42]!==d?(R=a.jsxs(a.Fragment,{children:[d,P]}),e[41]=P,e[42]=d,e[43]=R):R=e[43],R}function nt(t){const e=N.c(36),{integration:l}=t,s=M(),i=ne(),n=Ge(!0);let r,o;e[0]!==n.data||e[1]!==l.boardId||e[2]!==l.boardName?(r=(n.data??[]).map(rt),o=l.boardId?r.find(y=>y.value===l.boardId)?.primary??l.boardName??l.boardId:null,e[0]=n.data,e[1]=l.boardId,e[2]=l.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const f=o;let m;e[5]!==s?(m=s("settings.jira.boardLabel"),e[5]=s,e[6]=m):m=e[6];let u;e[7]!==s?(u=s("settings.jira.boardDescription"),e[7]=s,e[8]=u):u=e[8];const c=l.boardId??"";let d;e[9]!==s?(d=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=d):d=e[10];let g;e[11]!==s?(g=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=g):g=e[12];let p;e[13]!==n.isPending||e[14]!==s?(p=n.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=n.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==f||e[17]!==s?(b=()=>a.jsxs(G,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:f??s("settings.jira.boardPlaceholder")}),a.jsx(me,{className:"opacity-50 shrink-0"})]}),e[16]=f,e[17]=s,e[18]=b):b=e[18];let j;e[19]!==r||e[20]!==l.boardId||e[21]!==s||e[22]!==i?(j=y=>{!y||y===l.boardId||i.mutate({boardId:y,boardName:r.find(v=>v.value===y)?.primary??null},{onError:v=>q.error(W(v,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=l.boardId,e[21]=s,e[22]=i,e[23]=j):j=e[23];let x;e[24]!==r||e[25]!==c||e[26]!==d||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==j?(x=a.jsx(Be,{options:r,value:c,width:"w-72",triggerClassName:"shrink-0",placeholder:d,searchPlaceholder:g,filter:Je,emptyMessage:p,renderTrigger:b,renderItem:at,onChange:j}),e[24]=r,e[25]=c,e[26]=d,e[27]=g,e[28]=p,e[29]=b,e[30]=j,e[31]=x):x=e[31];let h;return e[32]!==x||e[33]!==m||e[34]!==u?(h=a.jsx(Q,{title:m,description:u,action:x}),e[32]=x,e[33]=m,e[34]=u,e[35]=h):h=e[35],h}function at(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(de,{className:V("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function rt(t){const{primary:e,secondary:l}=fe(t);return{value:String(t.id),label:Me(t),primary:e,secondary:l}}function ot(t){const e=N.c(30),{boardId:l}=t,s=M(),i=He(l),n=Qe();let r;if(i.isPending||n.isPending){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(ie,{className:"h-40 w-full"}),e[0]=c):c=e[0],r=c}else if(i.isError){let c;e[1]!==s?(c=s("settings.jira.columnsFailed"),e[1]=s,e[2]=c):c=e[2];let d;e[3]!==c?(d=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[3]=c,e[4]=d):d=e[4],r=d}else if((i.data??[]).length===0){let c;e[5]!==s?(c=s("settings.jira.noColumnsYet"),e[5]=s,e[6]=c):c=e[6];let d;e[7]!==c?(d=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=d):d=e[8],r=d}else{let c;e[9]!==n.data?(c=new Map((n.data??[]).map(ct)),e[9]=n.data,e[10]=c):c=e[10];const d=c;let g;e[11]!==i.data?(g=i.data??[],e[11]=i.data,e[12]=g):g=e[12];let p;if(e[13]!==d||e[14]!==g){let j;e[16]!==d?(j=x=>x.statuses.map(h=>a.jsx(dt,{columnName:x.name,status:h,showStatus:h!==x.name||x.statuses.length>1,hasAutomation:d.has(h),prompt:d.get(h)??null},`${x.name}:${h}`)),e[16]=d,e[17]=j):j=e[17],p=g.flatMap(j),e[13]=d,e[14]=g,e[15]=p}else p=e[15];let b;e[18]!==p?(b=a.jsx("div",{className:"flex w-full flex-col gap-3",children:p}),e[18]=p,e[19]=b):b=e[19],r=b}let o;e[20]!==s?(o=s("settings.jira.automationsLabel"),e[20]=s,e[21]=o):o=e[21];let f;e[22]!==s?(f=s("settings.jira.automationsDescription"),e[22]=s,e[23]=f):f=e[23];let m;e[24]!==r?(m=a.jsx("div",{className:"mt-3",children:r}),e[24]=r,e[25]=m):m=e[25];let u;return e[26]!==o||e[27]!==f||e[28]!==m?(u=a.jsx(Q,{title:o,description:f,children:m}),e[26]=o,e[27]=f,e[28]=m,e[29]=u):u=e[29],u}function ct(t){return[t.jiraStatus,t.prompt]}function dt(t){const e=N.c(22),{columnName:l,status:s,showStatus:i,hasAutomation:n,prompt:r}=t,o=M(),f=We(),[m,u]=J.useState(r??""),[c,d]=J.useState(r);c!==r&&(d(r),u(r??""));let g;e[0]!==f||e[1]!==s||e[2]!==o?(g=v=>f.mutate({jiraStatus:s,prompt:v},{onError:S=>q.error(W(S,o("settings.jira.saveFailed")))}),e[0]=f,e[1]=s,e[2]=o,e[3]=g):g=e[3];const p=g;let b;e[4]!==l?(b=a.jsx("span",{className:"truncate text-sm font-medium",children:l}),e[4]=l,e[5]=b):b=e[5];let j;e[6]!==i||e[7]!==s?(j=i&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s}),e[6]=i,e[7]=s,e[8]=j):j=e[8];let x;e[9]!==b||e[10]!==j?(x=a.jsxs("div",{className:"flex flex-col min-w-0",children:[b,j]}),e[9]=b,e[10]=j,e[11]=x):x=e[11];let h;e[12]!==m||e[13]!==n||e[14]!==r||e[15]!==p||e[16]!==s||e[17]!==o?(h=n?a.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted/40 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-medium",children:o("settings.jira.automationOn")}),a.jsx(G,{variant:"ghost",size:"sm","aria-label":o("settings.jira.removeAriaLabel",{status:s}),onClick:()=>p(null),children:a.jsx(je,{size:14})})]}),a.jsx(le,{value:m,rows:2,placeholder:o("settings.jira.promptPlaceholder"),onChange:v=>u(v.target.value),onBlur:()=>{m!==(r??"")&&p(m)},"data-jira-automation-prompt":s}),a.jsx("p",{className:"text-xs text-muted-foreground",children:o("settings.jira.promptHelp")})]}):a.jsxs(G,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>p(""),children:[a.jsx(xe,{size:14}),o("settings.jira.addAutomation")]}),e[12]=m,e[13]=n,e[14]=r,e[15]=p,e[16]=s,e[17]=o,e[18]=h):h=e[18];let y;return e[19]!==x||e[20]!==h?(y=a.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border p-3",children:[x,h]}),e[19]=x,e[20]=h,e[21]=y):y=e[21],y}function mt(){const t=N.c(67),e=M(),{org:l}=z(),s=Ve(),[i,n]=J.useState(""),[r,o]=J.useState("");let f;t[0]!==i||t[1]!==s.isPending?(f=i.trim()!==""&&!s.isPending,t[0]=i,t[1]=s.isPending,t[2]=f):f=t[2];const m=f;let u;t[3]!==m||t[4]!==i||t[5]!==r||t[6]!==s||t[7]!==e?(u=()=>{m&&s.mutate({issueKey:i.trim(),prompt:r.trim()===""?null:r.trim()},{onSuccess:T=>q.success(T.supersededThreadIds.length>0?e("settings.jira.testRunTookOver",{issueKey:T.issueKey}):e("settings.jira.testRunStarted",{issueKey:T.issueKey})),onError:T=>q.error(W(T,e("settings.jira.testRunFailed")))})},t[3]=m,t[4]=i,t[5]=r,t[6]=s,t[7]=e,t[8]=u):u=t[8];const c=u;let d;t[9]!==e?(d=e("settings.jira.testRunLabel"),t[9]=e,t[10]=d):d=t[10];let g;t[11]!==e?(g=e("settings.jira.testRunDescription"),t[11]=e,t[12]=g):g=t[12];let p;t[13]===Symbol.for("react.memo_cache_sentinel")?(p=T=>n(T.target.value),t[13]=p):p=t[13];let b;t[14]!==c?(b=T=>{T.key==="Enter"&&c()},t[14]=c,t[15]=b):b=t[15];let j;t[16]!==e?(j=e("settings.jira.testRunIssuePlaceholder"),t[16]=e,t[17]=j):j=t[17];let x;t[18]!==e?(x=e("settings.jira.testRunIssueAriaLabel"),t[18]=e,t[19]=x):x=t[19];let h;t[20]!==i||t[21]!==b||t[22]!==j||t[23]!==x?(h=a.jsx(Y,{value:i,onChange:p,onKeyDown:b,placeholder:j,"aria-label":x,className:"max-w-56 font-mono text-xs",autoComplete:"off"}),t[20]=i,t[21]=b,t[22]=j,t[23]=x,t[24]=h):h=t[24];const y=!m;let v;t[25]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(pe,{size:14}),t[25]=v):v=t[25];let S;t[26]!==s.isPending||t[27]!==e?(S=s.isPending?e("settings.jira.testRunRunning"):e("settings.jira.testRun"),t[26]=s.isPending,t[27]=e,t[28]=S):S=t[28];let _;t[29]!==c||t[30]!==S||t[31]!==y?(_=a.jsxs(G,{size:"sm",className:"shrink-0",disabled:y,onClick:c,children:[v,S]}),t[29]=c,t[30]=S,t[31]=y,t[32]=_):_=t[32];let w;t[33]!==_||t[34]!==h?(w=a.jsxs("div",{className:"flex items-start gap-2",children:[h,_]}),t[33]=_,t[34]=h,t[35]=w):w=t[35];let C;t[36]!==e?(C=e("settings.jira.promptPlaceholder"),t[36]=e,t[37]=C):C=t[37];let P;t[38]!==e?(P=e("settings.jira.testRunPromptAriaLabel"),t[38]=e,t[39]=P):P=t[39];let R;t[40]===Symbol.for("react.memo_cache_sentinel")?(R=T=>o(T.target.value),t[40]=R):R=t[40];let A;t[41]!==r||t[42]!==C||t[43]!==P?(A=a.jsx(le,{value:r,rows:2,placeholder:C,"aria-label":P,onChange:R}),t[41]=r,t[42]=C,t[43]=P,t[44]=A):A=t[44];let O;t[45]!==e?(O=e("settings.jira.testRunHelp"),t[45]=e,t[46]=O):O=t[46];let D;t[47]!==O?(D=a.jsx("p",{className:"text-xs text-muted-foreground",children:O}),t[47]=O,t[48]=D):D=t[48];let k;t[49]!==l.slug?(k={org:l.slug},t[49]=l.slug,t[50]=k):k=t[50];let K;t[51]===Symbol.for("react.memo_cache_sentinel")?(K={tab:"threads"},t[51]=K):K=t[51];let I;t[52]!==e?(I=e("settings.jira.testRunWatch"),t[52]=e,t[53]=I):I=t[53];let F;t[54]===Symbol.for("react.memo_cache_sentinel")?(F=a.jsx(ce,{size:12}),t[54]=F):F=t[54];let E;t[55]!==k||t[56]!==I?(E=a.jsxs(ge,{to:"/$org/settings/monitor",params:k,search:K,className:"flex w-fit items-center gap-1 text-xs text-muted-foreground underline hover:text-foreground",children:[I,F]}),t[55]=k,t[56]=I,t[57]=E):E=t[57];let $;t[58]!==w||t[59]!==A||t[60]!==D||t[61]!==E?($=a.jsxs("div",{className:"mt-3 flex w-full flex-col gap-3",children:[w,A,D,E]}),t[58]=w,t[59]=A,t[60]=D,t[61]=E,t[62]=$):$=t[62];let L;return t[63]!==d||t[64]!==$||t[65]!==g?(L=a.jsx(Q,{title:d,description:g,children:$}),t[63]=d,t[64]=$,t[65]=g,t[66]=L):L=t[66],L}function ft(t){const e=N.c(16),{integration:l}=t,s=M(),i=ne();let n;e[0]!==s?(n=s("settings.jira.enabledLabel"),e[0]=s,e[1]=n):n=e[1];let r;e[2]!==s?(r=s("settings.jira.enabledDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==l.boardId||e[5]!==s||e[6]!==i?(o=u=>{if(u&&!l.boardId){q.error(s("settings.jira.enableRequirements"));return}i.mutate({enabled:u},{onError:c=>q.error(W(c,s("settings.jira.saveFailed")))})},e[4]=l.boardId,e[5]=s,e[6]=i,e[7]=o):o=e[7];let f;e[8]!==l.enabled||e[9]!==o||e[10]!==i.isPending?(f=a.jsx(Te,{checked:l.enabled,disabled:i.isPending,onCheckedChange:o}),e[8]=l.enabled,e[9]=o,e[10]=i.isPending,e[11]=f):f=e[11];let m;return e[12]!==n||e[13]!==r||e[14]!==f?(m=a.jsx(Q,{title:n,description:r,action:f}),e[12]=n,e[13]=r,e[14]=f,e[15]=m):m=e[15],m}function ut(t){const e=N.c(24),{integration:l}=t,s=M(),i=`${window.location.origin}/api/_jira/webhook/${l.webhookSecret}`;let n;e[0]!==s?(n=s("settings.jira.webhookTitle"),e[0]=s,e[1]=n):n=e[1];let r;e[2]!==s?(r=s("settings.jira.webhookDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==i?(o=a.jsx(Y,{readOnly:!0,value:i,className:"font-mono text-xs"}),e[4]=i,e[5]=o):o=e[5];let f;e[6]!==s||e[7]!==i?(f=()=>{navigator.clipboard.writeText(i),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==s?(m=s("settings.jira.webhookCopy"),e[9]=s,e[10]=m):m=e[10];let u;e[11]!==f||e[12]!==m?(u=a.jsx(G,{variant:"outline",size:"sm",className:"shrink-0",onClick:f,children:m}),e[11]=f,e[12]=m,e[13]=u):u=e[13];let c;e[14]!==o||e[15]!==u?(c=a.jsxs("div",{className:"flex items-center gap-2",children:[o,u]}),e[14]=o,e[15]=u,e[16]=c):c=e[16];let d;e[17]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(st,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=d):d=e[17];let g;e[18]!==c?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[c,d]}),e[18]=c,e[19]=g):g=e[19];let p;return e[20]!==n||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:n,description:r,children:g}),e[20]=n,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function gt(){const t=N.c(24),e=M(),l=ze();if(l.isPending){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(te,{children:a.jsx("div",{className:"p-4",children:a.jsx(ie,{className:"h-40 w-full"})})}),t[0]=c):c=t[0],c}if(!l.data){let c;t[1]!==e?(c=e("settings.jira.connectTitle"),t[1]=e,t[2]=c):c=t[2];let d;t[3]!==e?(d=e("settings.jira.connectDescription"),t[3]=e,t[4]=d):d=t[4];let g;t[5]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(it,{}),t[5]=g):g=t[5];let p;return t[6]!==c||t[7]!==d?(p=a.jsx(te,{children:a.jsx(Q,{title:c,description:d,children:g})}),t[6]=c,t[7]=d,t[8]=p):p=t[8],p}const s=l.data;let i,n;t[9]!==s?(i=a.jsx(lt,{integration:s}),n=a.jsx(nt,{integration:s}),t[9]=s,t[10]=i,t[11]=n):(i=t[10],n=t[11]);let r;t[12]!==s.boardId?(r=s.boardId&&a.jsx(ot,{boardId:s.boardId}),t[12]=s.boardId,t[13]=r):r=t[13];let o;t[14]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(mt,{}),t[14]=o):o=t[14];let f,m;t[15]!==s?(f=a.jsx(ft,{integration:s}),m=a.jsx(ut,{integration:s}),t[15]=s,t[16]=f,t[17]=m):(f=t[16],m=t[17]);let u;return t[18]!==i||t[19]!==n||t[20]!==r||t[21]!==f||t[22]!==m?(u=a.jsxs(te,{children:[i,n,r,o,f,m]}),t[18]=i,t[19]=n,t[20]=r,t[21]=f,t[22]=m,t[23]=u):u=t[23],u}function pt(){const t=N.c(18),e=M();let l;t[0]!==e?(l=e("settings.nav.tasks"),t[0]=e,t[1]=l):l=t[1];let s;t[2]!==l?(s=a.jsx(ee.Title,{children:l}),t[2]=l,t[3]=s):s=t[3];let i,n,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(De,{}),n=a.jsx(et,{}),r=a.jsx(Ke,{}),t[4]=i,t[5]=n,t[6]=r):(i=t[4],n=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(qe,{size:18}),t[7]=o):o=t[7];let f;t[8]!==e?(f=e("settings.jira.sectionTitle"),t[8]=e,t[9]=f):f=t[9];let m;t[10]!==f?(m=a.jsxs("span",{className:"flex items-center gap-2",children:[o,f]}),t[10]=f,t[11]=m):m=t[11];let u;t[12]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(gt,{}),t[12]=u):u=t[12];let c;t[13]!==m?(c=a.jsx(oe,{title:m,children:u}),t[13]=m,t[14]=c):c=t[14];let d;return t[15]!==s||t[16]!==c?(d=a.jsx(ee,{children:a.jsx(ee.Content,{children:a.jsx(ee.Body,{children:a.jsxs(ue,{children:[s,i,n,r,c]})})})}),t[15]=s,t[16]=c,t[17]=d):d=t[17],d}function zt(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Fe,{capability:"org:manage",area:"settings",children:a.jsx(pt,{})}),t[0]=e):e=t[0],e}export{zt as default};
1
+ import{c as N,r as J,j as a,l as V,B as G,G as z,a7 as U,K as H,m as X,n as se,e as Z,b as M,b8 as ie,t as q,b0 as te,a$ as Q,b1 as oe,P as ee,b5 as ue,p as ce,L as ge}from"./index-DUT6nJ0k.js";import{I as Y}from"./input-nTzU91Mx.js";import{i as de}from"./Check-DcBf9sZc.js";import{i as me}from"./ChevronSelectorVertical-C5pa1SPJ.js";import{i as pe}from"./Play--oBkDBBT.js";import{s as xe}from"./Plus-BEvurd-g.js";import{s as je}from"./Trash01-Bb6p09ja.js";import{a as he,c as be,d as ye,e as Se,b as ve,C as Ne}from"./command-B98c7WqP.js";import{a as _e,P as we,b as Pe}from"./popover-C6l187hN.js";import{S as Te}from"./switch-BYIj8PI7.js";import{T as le}from"./textarea-C1aSGNC3.js";import{c as Ce,d as Ae,b as Re,f as ke,g as Ie,e as Ee,a as $e,A as Oe}from"./alert-dialog-CAZzUepb.js";import{R as De,A as Ke}from"./review-settings-D95bvWPh.js";import{g as Le}from"./task-board-lWmcu4Co.js";import{R as Fe}from"./require-capability-BdKwutyX.js";import"./index-B155LPbb.js";import"./dialog-BcLMOByU.js";import"./SearchMd-BUdPa-6c.js";import"./UserSquare-BHfOZp8B.js";import"./GitBranch01-Z1QMJ6tG.js";import"./SearchLg-CQpx8RWT.js";import"./use-organization-settings-C5neW7QU.js";import"./use-mcp-client--YVzCD1z.js";import"./auth-B1dQXzXf.js";import"./schema-CFEiOtLA.js";import"./use-connection-DX58UuSA.js";import"./access-gate-BXhfCkGa.js";import"./capability-load-error-RPlDTdHX.js";function Be(t){const e=N.c(41),{options:l,value:s,onChange:i,placeholder:n,triggerClassName:r,contentClassName:o,width:f,renderTrigger:m,renderItem:u,emptyMessage:c,searchPlaceholder:d,filter:g}=t,p=n===void 0?"Select...":n,b=f===void 0?"w-[200px]":f,j=c===void 0?"No results found.":c,x=d===void 0?"Search...":d;let h;e[0]!==s?(h=T=>T.value===s,e[0]=s,e[1]=h):h=e[1];const y=l.find(h),[v,S]=J.useState(!1),_=we,w=_e,C=!0,P=m?a.jsx("div",{className:V("cursor-pointer",r),children:m(y)}):a.jsxs(G,{variant:"outline",role:"combobox",className:V("justify-between",b,r),children:[y?y.label:p,a.jsx(me,{className:"opacity-50"})]});let R;e[2]!==w||e[3]!==P?(R=a.jsx(w,{asChild:C,children:P}),e[2]=w,e[3]=P,e[4]=R):R=e[4];let A;e[5]!==o?(A=V("p-0",o),e[5]=o,e[6]=A):A=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O={width:"var(--radix-popover-trigger-width)"},e[7]=O):O=e[7];let D;e[8]!==x?(D=a.jsx(he,{placeholder:x,className:"h-9"}),e[8]=x,e[9]=D):D=e[9];let k;e[10]!==j?(k=a.jsx(be,{children:j}),e[10]=j,e[11]=k):k=e[11];let K;if(e[12]!==i||e[13]!==l||e[14]!==u||e[15]!==S||e[16]!==s){let T;e[18]!==i||e[19]!==u||e[20]!==S||e[21]!==s?(T=B=>{const ae=s===B.value;return a.jsx(ye,{value:B.label,onSelect:()=>{i(B.value===s?"":B.value),S(!1)},children:u?u(B,ae):a.jsxs(a.Fragment,{children:[B.label,a.jsx(de,{className:V("ml-auto",ae?"opacity-100":"opacity-0")})]})},B.value)},e[18]=i,e[19]=u,e[20]=S,e[21]=s,e[22]=T):T=e[22],K=l.map(T),e[12]=i,e[13]=l,e[14]=u,e[15]=S,e[16]=s,e[17]=K}else K=e[17];let I;e[23]!==K?(I=a.jsx(Se,{children:K}),e[23]=K,e[24]=I):I=e[24];let F;e[25]!==k||e[26]!==I?(F=a.jsxs(ve,{children:[k,I]}),e[25]=k,e[26]=I,e[27]=F):F=e[27];let E;e[28]!==g||e[29]!==D||e[30]!==F?(E=a.jsxs(Ne,{filter:g,children:[D,F]}),e[28]=g,e[29]=D,e[30]=F,e[31]=E):E=e[31];let $;e[32]!==E||e[33]!==A?($=a.jsx(Pe,{className:A,style:O,children:E}),e[32]=E,e[33]=A,e[34]=$):$=e[34];let L;return e[35]!==_||e[36]!==v||e[37]!==S||e[38]!==$||e[39]!==R?(L=a.jsxs(_,{open:v,onOpenChange:S,children:[R,$]}),e[35]=_,e[36]=v,e[37]=S,e[38]=$,e[39]=R,e[40]=L):L=e[40],L}function qe(t){const e=N.c(4),{size:l,className:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=i):i=e[0];let n;return e[1]!==s||e[2]!==l?(n=a.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:i}),e[1]=s,e[2]=l,e[3]=n):n=e[3],n}function fe(t){const e=t.projectName?.replace(/\s+/g," ").trim(),l=t.name.trim();return e?{primary:e,secondary:[l,t.projectKey].filter(Boolean).join(" · ")}:{primary:l,secondary:t.projectKey??""}}function Me(t){const{primary:e,secondary:l}=fe(t);return[e,l,`#${t.id}`].filter(Boolean).join(" ")}function re(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Je(t,e){const l=re(e).trim();if(!l)return 1;const s=re(t);return l.split(/\s+/).every(i=>s.includes(i))?1:0}function ze(){const t=N.c(7),{org:e}=z(),l=U();let s;t[0]!==e.id?(s=H.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==l?(i=async()=>(await l.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=l,t[3]=i):i=t[3];let n;return t[4]!==s||t[5]!==i?(n={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=n):n=t[6],X(n)}function ne(){const t=N.c(8),{org:e}=z(),l=U(),s=se();let i;t[0]!==l?(i=async o=>(await l.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=l,t[1]=i):i=t[1];let n;t[2]!==e||t[3]!==s?(n=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=n):n=t[4];let r;return t[5]!==i||t[6]!==n?(r={mutationFn:i,onSettled:n},t[5]=i,t[6]=n,t[7]=r):r=t[7],Z(r)}function Ue(){const t=N.c(8),{org:e}=z(),l=U(),s=se();let i;t[0]!==l?(i=()=>l.call("JIRA_INTEGRATION_DELETE",{}),t[0]=l,t[1]=i):i=t[1];let n;t[2]!==e||t[3]!==s?(n=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=n):n=t[4];let r;return t[5]!==i||t[6]!==n?(r={mutationFn:i,onSettled:n},t[5]=i,t[6]=n,t[7]=r):r=t[7],Z(r)}function Ge(t){const e=N.c(8),{org:l}=z(),s=U();let i;e[0]!==l.id?(i=H.jiraBoards(l.id),e[0]=l.id,e[1]=i):i=e[1];let n;e[2]!==s?(n=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=n):n=e[3];let r;return e[4]!==t||e[5]!==i||e[6]!==n?(r={queryKey:i,enabled:t,staleTime:6e4,queryFn:n},e[4]=t,e[5]=i,e[6]=n,e[7]=r):r=e[7],X(r)}function He(t){const e=N.c(10),{org:l}=z(),s=U();let i;e[0]!==t||e[1]!==l.id?(i=H.jiraBoardColumns(l.id,t),e[0]=t,e[1]=l.id,e[2]=i):i=e[2];const n=t!==null;let r;e[3]!==t||e[4]!==s?(r=async()=>(await s.call("JIRA_BOARD_COLUMNS_LIST",{boardId:t??""})).columns,e[3]=t,e[4]=s,e[5]=r):r=e[5];let o;return e[6]!==i||e[7]!==n||e[8]!==r?(o={queryKey:i,enabled:n,staleTime:6e4,queryFn:r},e[6]=i,e[7]=n,e[8]=r,e[9]=o):o=e[9],X(o)}function Qe(){const t=N.c(7),{org:e}=z(),l=U();let s;t[0]!==e.id?(s=H.jiraAutomations(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==l?(i=async()=>(await l.call("JIRA_AUTOMATION_LIST",{})).automations,t[2]=l,t[3]=i):i=t[3];let n;return t[4]!==s||t[5]!==i?(n={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=n):n=t[6],X(n)}function We(){const t=N.c(8),{org:e}=z(),l=U(),s=se();let i;t[0]!==l?(i=async o=>{if(o.prompt===null){await l.call("JIRA_AUTOMATION_DELETE",{jiraStatus:o.jiraStatus});return}await l.call("JIRA_AUTOMATION_UPSERT",{jiraStatus:o.jiraStatus,prompt:o.prompt.trim()===""?void 0:o.prompt})},t[0]=l,t[1]=i):i=t[1];let n;t[2]!==e||t[3]!==s?(n=()=>s.invalidateQueries({queryKey:H.jiraAutomations(e.id)}),t[2]=e,t[3]=s,t[4]=n):n=t[4];let r;return t[5]!==i||t[6]!==n?(r={mutationFn:i,onSettled:n},t[5]=i,t[6]=n,t[7]=r):r=t[7],Z(r)}function Ve(){const t=N.c(2),e=U();let l;return t[0]!==e?(l={mutationFn:s=>e.call("JIRA_RUN_START",s)},t[0]=e,t[1]=l):l=t[1],Z(l)}function Ye(){const t=N.c(12),{org:e}=z(),l=U();let s;t[0]!==e.id?(s=H.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==l?(i=async()=>(await l.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=l,t[3]=i):i=t[3];let n;t[4]!==s||t[5]!==i?(n={queryKey:s,staleTime:6e4,queryFn:i},t[4]=s,t[5]=i,t[6]=n):n=t[6];const r=X(n);let o;t[7]!==r.data?(o=r.data?.find(Xe)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let f;return t[9]!==r.isPending||t[10]!==o?(f={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=f):f=t[11],f}function Xe(t){return t.columnKey===null}function Ze(){const t=N.c(8),{org:e}=z(),l=U(),s=se();let i;t[0]!==l?(i=async o=>{const f=o.trim();if(!f){await l.call("TASK_BOARD_PROMPT_DELETE",{});return}await l.call("TASK_BOARD_PROMPT_UPSERT",{prompt:f})},t[0]=l,t[1]=i):i=t[1];let n;t[2]!==e||t[3]!==s?(n=()=>s.invalidateQueries({queryKey:H.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=n):n=t[4];let r;return t[5]!==i||t[6]!==n?(r={mutationFn:i,onSettled:n},t[5]=i,t[6]=n,t[7]=r):r=t[7],Z(r)}function et(){const t=N.c(16),e=M(),{prompt:l,isPending:s}=Ye(),i=Ze(),[n,r]=J.useState(l),[o,f]=J.useState(l);o!==l&&(f(l),r(l));let m;t[0]!==e?(m=e("settings.taskPrompt.title"),t[0]=e,t[1]=m):m=t[1];let u;t[2]!==e?(u=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=u):u=t[3];let c;t[4]!==n||t[5]!==s||t[6]!==l||t[7]!==i||t[8]!==e?(c=s?a.jsx(ie,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(le,{value:n,rows:10,maxLength:Le,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(G,{size:"sm",disabled:n===l||i.isPending,onClick:()=>i.mutate(n,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=n,t[5]=s,t[6]=l,t[7]=i,t[8]=e,t[9]=c):c=t[9];let d;t[10]!==u||t[11]!==c?(d=a.jsx(te,{children:a.jsx(Q,{title:u,children:c})}),t[10]=u,t[11]=c,t[12]=d):d=t[12];let g;return t[13]!==m||t[14]!==d?(g=a.jsx(oe,{title:m,children:d}),t[13]=m,t[14]=d,t[15]=g):g=t[15],g}function W(t,e){return t instanceof Error?t.message:e}const tt="https://id.atlassian.com/manage-profile/security/api-tokens";function st(t){const e=N.c(7),{stepKeys:l}=t,s=M();let i;if(e[0]!==l||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],i=l.map(r),e[0]=l,e[1]=s,e[2]=i}else i=e[2];let n;return e[5]!==i?(n=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:i}),e[5]=i,e[6]=n):n=e[6],n}function it(){const t=N.c(69),e=M(),l=ne(),[s,i]=J.useState(""),[n,r]=J.useState(""),[o,f]=J.useState("");let m;t[0]!==o||t[1]!==n||t[2]!==s?(m=s.trim()!==""&&n.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=n,t[2]=s,t[3]=m):m=t[3];const u=m;let c;t[4]!==e?(c=e("settings.jira.siteLabel"),t[4]=e,t[5]=c):c=t[5];let d;t[6]!==c?(d=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:c}),t[6]=c,t[7]=d):d=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=B=>i(B.target.value),t[8]=g):g=t[8];let p;t[9]!==e?(p=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=p):p=t[10];let b;t[11]!==s||t[12]!==p?(b=a.jsx(Y,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let j;t[14]!==d||t[15]!==b?(j=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,b]}),t[14]=d,t[15]=b,t[16]=j):j=t[16];let x;t[17]!==e?(x=e("settings.jira.emailLabel"),t[17]=e,t[18]=x):x=t[18];let h;t[19]!==x?(h=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:x}),t[19]=x,t[20]=h):h=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=B=>r(B.target.value),t[21]=y):y=t[21];let v;t[22]!==e?(v=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=v):v=t[23];let S;t[24]!==n||t[25]!==v?(S=a.jsx(Y,{value:n,onChange:y,placeholder:v,autoComplete:"off"}),t[24]=n,t[25]=v,t[26]=S):S=t[26];let _;t[27]!==S||t[28]!==h?(_=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,S]}),t[27]=S,t[28]=h,t[29]=_):_=t[29];let w;t[30]!==e?(w=e("settings.jira.tokenLabel"),t[30]=e,t[31]=w):w=t[31];let C;t[32]!==w?(C=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:w}),t[32]=w,t[33]=C):C=t[33];let P;t[34]!==e?(P=e("settings.jira.createTokenLink"),t[34]=e,t[35]=P):P=t[35];let R;t[36]===Symbol.for("react.memo_cache_sentinel")?(R=a.jsx(ce,{size:12}),t[36]=R):R=t[36];let A;t[37]!==P?(A=a.jsxs("a",{href:tt,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[P,R]}),t[37]=P,t[38]=A):A=t[38];let O;t[39]!==C||t[40]!==A?(O=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C,A]}),t[39]=C,t[40]=A,t[41]=O):O=t[41];let D;t[42]===Symbol.for("react.memo_cache_sentinel")?(D=B=>f(B.target.value),t[42]=D):D=t[42];let k;t[43]!==e?(k=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=k):k=t[44];let K;t[45]!==o||t[46]!==k?(K=a.jsx(Y,{type:"password",value:o,onChange:D,placeholder:k,autoComplete:"off"}),t[45]=o,t[46]=k,t[47]=K):K=t[47];let I;t[48]!==O||t[49]!==K?(I=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,K]}),t[48]=O,t[49]=K,t[50]=I):I=t[50];const F=!u||l.isPending;let E;t[51]!==o||t[52]!==n||t[53]!==s||t[54]!==e||t[55]!==l?(E=()=>l.mutate({siteUrl:s.trim(),email:n.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:B=>q.error(W(B,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=n,t[53]=s,t[54]=e,t[55]=l,t[56]=E):E=t[56];let $;t[57]!==e||t[58]!==l.isPending?($=l.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=l.isPending,t[59]=$):$=t[59];let L;t[60]!==F||t[61]!==E||t[62]!==$?(L=a.jsx(G,{size:"sm",className:"w-fit",disabled:F,onClick:E,children:$}),t[60]=F,t[61]=E,t[62]=$,t[63]=L):L=t[63];let T;return t[64]!==_||t[65]!==I||t[66]!==L||t[67]!==j?(T=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[j,_,I,L]}),t[64]=_,t[65]=I,t[66]=L,t[67]=j,t[68]=T):T=t[68],T}function lt(t){const e=N.c(44),{integration:l}=t,s=M(),i=Ue(),[n,r]=J.useState(!1),o=l.siteUrl,f=l.email;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>r(!0),e[0]=m):m=e[0];let u;e[1]!==s?(u=s("settings.jira.disconnect"),e[1]=s,e[2]=u):u=e[2];let c;e[3]!==u?(c=a.jsx(G,{variant:"outline",size:"sm",onClick:m,children:u}),e[3]=u,e[4]=c):c=e[4];let d;e[5]!==l.email||e[6]!==l.siteUrl||e[7]!==c?(d=a.jsx(Q,{title:o,description:f,action:c}),e[5]=l.email,e[6]=l.siteUrl,e[7]=c,e[8]=d):d=e[8];let g;e[9]!==s?(g=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=g):g=e[10];let p;e[11]!==g?(p=a.jsx(Ce,{children:g}),e[11]=g,e[12]=p):p=e[12];let b;e[13]!==s?(b=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=b):b=e[14];let j;e[15]!==b?(j=a.jsx(Ae,{children:b}),e[15]=b,e[16]=j):j=e[16];let x;e[17]!==j||e[18]!==p?(x=a.jsxs(Re,{children:[p,j]}),e[17]=j,e[18]=p,e[19]=x):x=e[19];let h;e[20]!==s?(h=s("settings.jira.cancel"),e[20]=s,e[21]=h):h=e[21];let y;e[22]!==h?(y=a.jsx(ke,{children:h}),e[22]=h,e[23]=y):y=e[23];let v;e[24]!==i||e[25]!==s?(v=()=>i.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:A=>q.error(W(A,s("settings.jira.saveFailed")))}),e[24]=i,e[25]=s,e[26]=v):v=e[26];let S;e[27]!==s?(S=s("settings.jira.disconnect"),e[27]=s,e[28]=S):S=e[28];let _;e[29]!==v||e[30]!==S?(_=a.jsx(Ie,{onClick:v,children:S}),e[29]=v,e[30]=S,e[31]=_):_=e[31];let w;e[32]!==y||e[33]!==_?(w=a.jsxs(Ee,{children:[y,_]}),e[32]=y,e[33]=_,e[34]=w):w=e[34];let C;e[35]!==x||e[36]!==w?(C=a.jsxs($e,{children:[x,w]}),e[35]=x,e[36]=w,e[37]=C):C=e[37];let P;e[38]!==n||e[39]!==C?(P=a.jsx(Oe,{open:n,onOpenChange:r,children:C}),e[38]=n,e[39]=C,e[40]=P):P=e[40];let R;return e[41]!==P||e[42]!==d?(R=a.jsxs(a.Fragment,{children:[d,P]}),e[41]=P,e[42]=d,e[43]=R):R=e[43],R}function nt(t){const e=N.c(36),{integration:l}=t,s=M(),i=ne(),n=Ge(!0);let r,o;e[0]!==n.data||e[1]!==l.boardId||e[2]!==l.boardName?(r=(n.data??[]).map(rt),o=l.boardId?r.find(y=>y.value===l.boardId)?.primary??l.boardName??l.boardId:null,e[0]=n.data,e[1]=l.boardId,e[2]=l.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const f=o;let m;e[5]!==s?(m=s("settings.jira.boardLabel"),e[5]=s,e[6]=m):m=e[6];let u;e[7]!==s?(u=s("settings.jira.boardDescription"),e[7]=s,e[8]=u):u=e[8];const c=l.boardId??"";let d;e[9]!==s?(d=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=d):d=e[10];let g;e[11]!==s?(g=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=g):g=e[12];let p;e[13]!==n.isPending||e[14]!==s?(p=n.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=n.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==f||e[17]!==s?(b=()=>a.jsxs(G,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:f??s("settings.jira.boardPlaceholder")}),a.jsx(me,{className:"opacity-50 shrink-0"})]}),e[16]=f,e[17]=s,e[18]=b):b=e[18];let j;e[19]!==r||e[20]!==l.boardId||e[21]!==s||e[22]!==i?(j=y=>{!y||y===l.boardId||i.mutate({boardId:y,boardName:r.find(v=>v.value===y)?.primary??null},{onError:v=>q.error(W(v,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=l.boardId,e[21]=s,e[22]=i,e[23]=j):j=e[23];let x;e[24]!==r||e[25]!==c||e[26]!==d||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==j?(x=a.jsx(Be,{options:r,value:c,width:"w-72",triggerClassName:"shrink-0",placeholder:d,searchPlaceholder:g,filter:Je,emptyMessage:p,renderTrigger:b,renderItem:at,onChange:j}),e[24]=r,e[25]=c,e[26]=d,e[27]=g,e[28]=p,e[29]=b,e[30]=j,e[31]=x):x=e[31];let h;return e[32]!==x||e[33]!==m||e[34]!==u?(h=a.jsx(Q,{title:m,description:u,action:x}),e[32]=x,e[33]=m,e[34]=u,e[35]=h):h=e[35],h}function at(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(de,{className:V("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function rt(t){const{primary:e,secondary:l}=fe(t);return{value:String(t.id),label:Me(t),primary:e,secondary:l}}function ot(t){const e=N.c(30),{boardId:l}=t,s=M(),i=He(l),n=Qe();let r;if(i.isPending||n.isPending){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(ie,{className:"h-40 w-full"}),e[0]=c):c=e[0],r=c}else if(i.isError){let c;e[1]!==s?(c=s("settings.jira.columnsFailed"),e[1]=s,e[2]=c):c=e[2];let d;e[3]!==c?(d=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[3]=c,e[4]=d):d=e[4],r=d}else if((i.data??[]).length===0){let c;e[5]!==s?(c=s("settings.jira.noColumnsYet"),e[5]=s,e[6]=c):c=e[6];let d;e[7]!==c?(d=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=d):d=e[8],r=d}else{let c;e[9]!==n.data?(c=new Map((n.data??[]).map(ct)),e[9]=n.data,e[10]=c):c=e[10];const d=c;let g;e[11]!==i.data?(g=i.data??[],e[11]=i.data,e[12]=g):g=e[12];let p;if(e[13]!==d||e[14]!==g){let j;e[16]!==d?(j=x=>x.statuses.map(h=>a.jsx(dt,{columnName:x.name,status:h,showStatus:h!==x.name||x.statuses.length>1,hasAutomation:d.has(h),prompt:d.get(h)??null},`${x.name}:${h}`)),e[16]=d,e[17]=j):j=e[17],p=g.flatMap(j),e[13]=d,e[14]=g,e[15]=p}else p=e[15];let b;e[18]!==p?(b=a.jsx("div",{className:"flex w-full flex-col gap-3",children:p}),e[18]=p,e[19]=b):b=e[19],r=b}let o;e[20]!==s?(o=s("settings.jira.automationsLabel"),e[20]=s,e[21]=o):o=e[21];let f;e[22]!==s?(f=s("settings.jira.automationsDescription"),e[22]=s,e[23]=f):f=e[23];let m;e[24]!==r?(m=a.jsx("div",{className:"mt-3",children:r}),e[24]=r,e[25]=m):m=e[25];let u;return e[26]!==o||e[27]!==f||e[28]!==m?(u=a.jsx(Q,{title:o,description:f,children:m}),e[26]=o,e[27]=f,e[28]=m,e[29]=u):u=e[29],u}function ct(t){return[t.jiraStatus,t.prompt]}function dt(t){const e=N.c(22),{columnName:l,status:s,showStatus:i,hasAutomation:n,prompt:r}=t,o=M(),f=We(),[m,u]=J.useState(r??""),[c,d]=J.useState(r);c!==r&&(d(r),u(r??""));let g;e[0]!==f||e[1]!==s||e[2]!==o?(g=v=>f.mutate({jiraStatus:s,prompt:v},{onError:S=>q.error(W(S,o("settings.jira.saveFailed")))}),e[0]=f,e[1]=s,e[2]=o,e[3]=g):g=e[3];const p=g;let b;e[4]!==l?(b=a.jsx("span",{className:"truncate text-sm font-medium",children:l}),e[4]=l,e[5]=b):b=e[5];let j;e[6]!==i||e[7]!==s?(j=i&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s}),e[6]=i,e[7]=s,e[8]=j):j=e[8];let x;e[9]!==b||e[10]!==j?(x=a.jsxs("div",{className:"flex flex-col min-w-0",children:[b,j]}),e[9]=b,e[10]=j,e[11]=x):x=e[11];let h;e[12]!==m||e[13]!==n||e[14]!==r||e[15]!==p||e[16]!==s||e[17]!==o?(h=n?a.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted/40 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-medium",children:o("settings.jira.automationOn")}),a.jsx(G,{variant:"ghost",size:"sm","aria-label":o("settings.jira.removeAriaLabel",{status:s}),onClick:()=>p(null),children:a.jsx(je,{size:14})})]}),a.jsx(le,{value:m,rows:2,placeholder:o("settings.jira.promptPlaceholder"),onChange:v=>u(v.target.value),onBlur:()=>{m!==(r??"")&&p(m)},"data-jira-automation-prompt":s}),a.jsx("p",{className:"text-xs text-muted-foreground",children:o("settings.jira.promptHelp")})]}):a.jsxs(G,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>p(""),children:[a.jsx(xe,{size:14}),o("settings.jira.addAutomation")]}),e[12]=m,e[13]=n,e[14]=r,e[15]=p,e[16]=s,e[17]=o,e[18]=h):h=e[18];let y;return e[19]!==x||e[20]!==h?(y=a.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border p-3",children:[x,h]}),e[19]=x,e[20]=h,e[21]=y):y=e[21],y}function mt(){const t=N.c(67),e=M(),{org:l}=z(),s=Ve(),[i,n]=J.useState(""),[r,o]=J.useState("");let f;t[0]!==i||t[1]!==s.isPending?(f=i.trim()!==""&&!s.isPending,t[0]=i,t[1]=s.isPending,t[2]=f):f=t[2];const m=f;let u;t[3]!==m||t[4]!==i||t[5]!==r||t[6]!==s||t[7]!==e?(u=()=>{m&&s.mutate({issueKey:i.trim(),prompt:r.trim()===""?null:r.trim()},{onSuccess:T=>q.success(T.supersededThreadIds.length>0?e("settings.jira.testRunTookOver",{issueKey:T.issueKey}):e("settings.jira.testRunStarted",{issueKey:T.issueKey})),onError:T=>q.error(W(T,e("settings.jira.testRunFailed")))})},t[3]=m,t[4]=i,t[5]=r,t[6]=s,t[7]=e,t[8]=u):u=t[8];const c=u;let d;t[9]!==e?(d=e("settings.jira.testRunLabel"),t[9]=e,t[10]=d):d=t[10];let g;t[11]!==e?(g=e("settings.jira.testRunDescription"),t[11]=e,t[12]=g):g=t[12];let p;t[13]===Symbol.for("react.memo_cache_sentinel")?(p=T=>n(T.target.value),t[13]=p):p=t[13];let b;t[14]!==c?(b=T=>{T.key==="Enter"&&c()},t[14]=c,t[15]=b):b=t[15];let j;t[16]!==e?(j=e("settings.jira.testRunIssuePlaceholder"),t[16]=e,t[17]=j):j=t[17];let x;t[18]!==e?(x=e("settings.jira.testRunIssueAriaLabel"),t[18]=e,t[19]=x):x=t[19];let h;t[20]!==i||t[21]!==b||t[22]!==j||t[23]!==x?(h=a.jsx(Y,{value:i,onChange:p,onKeyDown:b,placeholder:j,"aria-label":x,className:"max-w-56 font-mono text-xs",autoComplete:"off"}),t[20]=i,t[21]=b,t[22]=j,t[23]=x,t[24]=h):h=t[24];const y=!m;let v;t[25]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(pe,{size:14}),t[25]=v):v=t[25];let S;t[26]!==s.isPending||t[27]!==e?(S=s.isPending?e("settings.jira.testRunRunning"):e("settings.jira.testRun"),t[26]=s.isPending,t[27]=e,t[28]=S):S=t[28];let _;t[29]!==c||t[30]!==S||t[31]!==y?(_=a.jsxs(G,{size:"sm",className:"shrink-0",disabled:y,onClick:c,children:[v,S]}),t[29]=c,t[30]=S,t[31]=y,t[32]=_):_=t[32];let w;t[33]!==_||t[34]!==h?(w=a.jsxs("div",{className:"flex items-start gap-2",children:[h,_]}),t[33]=_,t[34]=h,t[35]=w):w=t[35];let C;t[36]!==e?(C=e("settings.jira.promptPlaceholder"),t[36]=e,t[37]=C):C=t[37];let P;t[38]!==e?(P=e("settings.jira.testRunPromptAriaLabel"),t[38]=e,t[39]=P):P=t[39];let R;t[40]===Symbol.for("react.memo_cache_sentinel")?(R=T=>o(T.target.value),t[40]=R):R=t[40];let A;t[41]!==r||t[42]!==C||t[43]!==P?(A=a.jsx(le,{value:r,rows:2,placeholder:C,"aria-label":P,onChange:R}),t[41]=r,t[42]=C,t[43]=P,t[44]=A):A=t[44];let O;t[45]!==e?(O=e("settings.jira.testRunHelp"),t[45]=e,t[46]=O):O=t[46];let D;t[47]!==O?(D=a.jsx("p",{className:"text-xs text-muted-foreground",children:O}),t[47]=O,t[48]=D):D=t[48];let k;t[49]!==l.slug?(k={org:l.slug},t[49]=l.slug,t[50]=k):k=t[50];let K;t[51]===Symbol.for("react.memo_cache_sentinel")?(K={tab:"threads"},t[51]=K):K=t[51];let I;t[52]!==e?(I=e("settings.jira.testRunWatch"),t[52]=e,t[53]=I):I=t[53];let F;t[54]===Symbol.for("react.memo_cache_sentinel")?(F=a.jsx(ce,{size:12}),t[54]=F):F=t[54];let E;t[55]!==k||t[56]!==I?(E=a.jsxs(ge,{to:"/$org/settings/monitor",params:k,search:K,className:"flex w-fit items-center gap-1 text-xs text-muted-foreground underline hover:text-foreground",children:[I,F]}),t[55]=k,t[56]=I,t[57]=E):E=t[57];let $;t[58]!==w||t[59]!==A||t[60]!==D||t[61]!==E?($=a.jsxs("div",{className:"mt-3 flex w-full flex-col gap-3",children:[w,A,D,E]}),t[58]=w,t[59]=A,t[60]=D,t[61]=E,t[62]=$):$=t[62];let L;return t[63]!==d||t[64]!==$||t[65]!==g?(L=a.jsx(Q,{title:d,description:g,children:$}),t[63]=d,t[64]=$,t[65]=g,t[66]=L):L=t[66],L}function ft(t){const e=N.c(16),{integration:l}=t,s=M(),i=ne();let n;e[0]!==s?(n=s("settings.jira.enabledLabel"),e[0]=s,e[1]=n):n=e[1];let r;e[2]!==s?(r=s("settings.jira.enabledDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==l.boardId||e[5]!==s||e[6]!==i?(o=u=>{if(u&&!l.boardId){q.error(s("settings.jira.enableRequirements"));return}i.mutate({enabled:u},{onError:c=>q.error(W(c,s("settings.jira.saveFailed")))})},e[4]=l.boardId,e[5]=s,e[6]=i,e[7]=o):o=e[7];let f;e[8]!==l.enabled||e[9]!==o||e[10]!==i.isPending?(f=a.jsx(Te,{checked:l.enabled,disabled:i.isPending,onCheckedChange:o}),e[8]=l.enabled,e[9]=o,e[10]=i.isPending,e[11]=f):f=e[11];let m;return e[12]!==n||e[13]!==r||e[14]!==f?(m=a.jsx(Q,{title:n,description:r,action:f}),e[12]=n,e[13]=r,e[14]=f,e[15]=m):m=e[15],m}function ut(t){const e=N.c(24),{integration:l}=t,s=M(),i=`${window.location.origin}/api/_jira/webhook/${l.webhookSecret}`;let n;e[0]!==s?(n=s("settings.jira.webhookTitle"),e[0]=s,e[1]=n):n=e[1];let r;e[2]!==s?(r=s("settings.jira.webhookDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==i?(o=a.jsx(Y,{readOnly:!0,value:i,className:"font-mono text-xs"}),e[4]=i,e[5]=o):o=e[5];let f;e[6]!==s||e[7]!==i?(f=()=>{navigator.clipboard.writeText(i),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==s?(m=s("settings.jira.webhookCopy"),e[9]=s,e[10]=m):m=e[10];let u;e[11]!==f||e[12]!==m?(u=a.jsx(G,{variant:"outline",size:"sm",className:"shrink-0",onClick:f,children:m}),e[11]=f,e[12]=m,e[13]=u):u=e[13];let c;e[14]!==o||e[15]!==u?(c=a.jsxs("div",{className:"flex items-center gap-2",children:[o,u]}),e[14]=o,e[15]=u,e[16]=c):c=e[16];let d;e[17]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(st,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=d):d=e[17];let g;e[18]!==c?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[c,d]}),e[18]=c,e[19]=g):g=e[19];let p;return e[20]!==n||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:n,description:r,children:g}),e[20]=n,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function gt(){const t=N.c(24),e=M(),l=ze();if(l.isPending){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(te,{children:a.jsx("div",{className:"p-4",children:a.jsx(ie,{className:"h-40 w-full"})})}),t[0]=c):c=t[0],c}if(!l.data){let c;t[1]!==e?(c=e("settings.jira.connectTitle"),t[1]=e,t[2]=c):c=t[2];let d;t[3]!==e?(d=e("settings.jira.connectDescription"),t[3]=e,t[4]=d):d=t[4];let g;t[5]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(it,{}),t[5]=g):g=t[5];let p;return t[6]!==c||t[7]!==d?(p=a.jsx(te,{children:a.jsx(Q,{title:c,description:d,children:g})}),t[6]=c,t[7]=d,t[8]=p):p=t[8],p}const s=l.data;let i,n;t[9]!==s?(i=a.jsx(lt,{integration:s}),n=a.jsx(nt,{integration:s}),t[9]=s,t[10]=i,t[11]=n):(i=t[10],n=t[11]);let r;t[12]!==s.boardId?(r=s.boardId&&a.jsx(ot,{boardId:s.boardId}),t[12]=s.boardId,t[13]=r):r=t[13];let o;t[14]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(mt,{}),t[14]=o):o=t[14];let f,m;t[15]!==s?(f=a.jsx(ft,{integration:s}),m=a.jsx(ut,{integration:s}),t[15]=s,t[16]=f,t[17]=m):(f=t[16],m=t[17]);let u;return t[18]!==i||t[19]!==n||t[20]!==r||t[21]!==f||t[22]!==m?(u=a.jsxs(te,{children:[i,n,r,o,f,m]}),t[18]=i,t[19]=n,t[20]=r,t[21]=f,t[22]=m,t[23]=u):u=t[23],u}function pt(){const t=N.c(18),e=M();let l;t[0]!==e?(l=e("settings.nav.tasks"),t[0]=e,t[1]=l):l=t[1];let s;t[2]!==l?(s=a.jsx(ee.Title,{children:l}),t[2]=l,t[3]=s):s=t[3];let i,n,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(De,{}),n=a.jsx(et,{}),r=a.jsx(Ke,{}),t[4]=i,t[5]=n,t[6]=r):(i=t[4],n=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(qe,{size:18}),t[7]=o):o=t[7];let f;t[8]!==e?(f=e("settings.jira.sectionTitle"),t[8]=e,t[9]=f):f=t[9];let m;t[10]!==f?(m=a.jsxs("span",{className:"flex items-center gap-2",children:[o,f]}),t[10]=f,t[11]=m):m=t[11];let u;t[12]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(gt,{}),t[12]=u):u=t[12];let c;t[13]!==m?(c=a.jsx(oe,{title:m,children:u}),t[13]=m,t[14]=c):c=t[14];let d;return t[15]!==s||t[16]!==c?(d=a.jsx(ee,{children:a.jsx(ee.Content,{children:a.jsx(ee.Body,{children:a.jsxs(ue,{children:[s,i,n,r,c]})})})}),t[15]=s,t[16]=c,t[17]=d):d=t[17],d}function zt(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Fe,{capability:"org:manage",area:"settings",children:a.jsx(pt,{})}),t[0]=e):e=t[0],e}export{zt as default};
@@ -1 +1 @@
1
- import{c as o,l,j as n}from"./index-Ceg1_k49.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
1
+ import{c as o,l,j as n}from"./index-DUT6nJ0k.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
@@ -1 +1 @@
1
- import{s as h}from"./slugify-CEUa2lfQ.js";import{M as m}from"./index-Ceg1_k49.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};
1
+ import{s as h}from"./slugify-CEUa2lfQ.js";import{M as m}from"./index-DUT6nJ0k.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};