decocms 4.308.0 → 4.309.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/client/assets/{AlertCircle-BTlJp8pf.js → AlertCircle-6kr4ikYf.js} +1 -1
  2. package/dist/client/assets/{AreaChart-dJjxY072.js → AreaChart-DDKg3X50.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BwagOJkb.js → ArrowLeft-BYTdr7TC.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CVoISkQ4.js → ArrowUp-CKtNsAj6.js} +1 -1
  5. package/dist/client/assets/{Check-D5PKBQ5I.js → Check-BDN8Muvk.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-teyxVGFp.js → CheckCircle-DOsHeqoz.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Csfjhwpm.js → ChevronDown-BKzrpWz6.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DUmHQrD7.js → ChevronRight-CZUjBWvx.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CuAhXy3x.js → ChevronSelectorVertical-B9yl_jmL.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-Dlj_U0qV.js → ChevronUp-Cx4YaKpI.js} +1 -1
  11. package/dist/client/assets/{Copy01-CsNpp9jr.js → Copy01-B4QULclv.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-YCHpZ00A.js → CreditCard01-wmoTErQt.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-CpVcGDJ_.js → DotsVertical-BS1CnjKI.js} +1 -1
  14. package/dist/client/assets/{Download01-BN9BT9cL.js → Download01-Bp0cW6L4.js} +1 -1
  15. package/dist/client/assets/{Eye-DgiSa7UT.js → Eye-B_dguG6W.js} +1 -1
  16. package/dist/client/assets/{FilterLines-Db8-uWfr.js → FilterLines-ukqPgKKN.js} +1 -1
  17. package/dist/client/assets/GitBranch01-CseJth04.js +1 -0
  18. package/dist/client/assets/{Globe01-CV-16mwB.js → Globe01-xHaFaFqY.js} +1 -1
  19. package/dist/client/assets/{Globe04-D3O2XfOT.js → Globe04-SMW2xMPb.js} +1 -1
  20. package/dist/client/assets/{HardDrive-CWvDYc59.js → HardDrive-CGH6uKsY.js} +1 -1
  21. package/dist/client/assets/Image01-DI4UfHrT.js +1 -0
  22. package/dist/client/assets/{Key01-D4srNqPO.js → Key01-C2TuLSvm.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-CIL2SNWf.js → LinkExternal01-CWY5Wglm.js} +1 -1
  24. package/dist/client/assets/{LockUnlocked01-BpeKJGM4.js → LockUnlocked01-lprGTBDa.js} +1 -1
  25. package/dist/client/assets/{LogOut01-qWWgaWbQ.js → LogOut01-Dlhf6xnU.js} +1 -1
  26. package/dist/client/assets/{Monitor01-uq-dlf-u.js → Monitor01-RWlkxwpq.js} +1 -1
  27. package/dist/client/assets/Package-CbKjNbRP.js +1 -0
  28. package/dist/client/assets/{Palette-Cv68Zggp.js → Palette-DHncO8u1.js} +1 -1
  29. package/dist/client/assets/{Play-C9xK8clC.js → Play-C2DKi7Gj.js} +1 -1
  30. package/dist/client/assets/{Plus-CPkR-QLd.js → Plus-CThYB9e6.js} +1 -1
  31. package/dist/client/assets/{SearchLg-8daQliv2.js → SearchLg-BCpOjc95.js} +1 -1
  32. package/dist/client/assets/{SearchMd-ClTH3fiN.js → SearchMd-C0j7yoGj.js} +1 -1
  33. package/dist/client/assets/{Settings02-BMcJFHpd.js → Settings02-zD1WG3KJ.js} +1 -1
  34. package/dist/client/assets/{Share07-CPDrxQV8.js → Share07-DjrlWb0X.js} +1 -1
  35. package/dist/client/assets/{Shield01-C9M_jcOJ.js → Shield01-D6Z8uTMm.js} +1 -1
  36. package/dist/client/assets/{Stars01-BzEDQnsl.js → Stars01-DD4L9WZm.js} +1 -1
  37. package/dist/client/assets/{Stars02-DZNA1z2-.js → Stars02-DtPQwd-A.js} +1 -1
  38. package/dist/client/assets/{Sun-BBWjOwQE.js → Sun-DhJaKNHe.js} +1 -1
  39. package/dist/client/assets/{SwitchHorizontal01-CSyGO1HX.js → SwitchHorizontal01-_tALQVAI.js} +1 -1
  40. package/dist/client/assets/Tool01-DdJ9Op9D.js +1 -0
  41. package/dist/client/assets/{Tool02-jKKU1_dM.js → Tool02-Cci1ljWo.js} +1 -1
  42. package/dist/client/assets/{Trash01-Dp-QTpAR.js → Trash01-BDD06UjB.js} +1 -1
  43. package/dist/client/assets/{TrendUp01-DikSDrNg.js → TrendUp01-DjAqcXI6.js} +1 -1
  44. package/dist/client/assets/{Upload01-DxCHPffq.js → Upload01-Cp4C9dq6.js} +1 -1
  45. package/dist/client/assets/{User01-DJ_BO2EX.js → User01-Cteu9d2D.js} +1 -1
  46. package/dist/client/assets/UserSquare-DTquYbih.js +1 -0
  47. package/dist/client/assets/{Users01-B2wc_Wgl.js → Users01-BsM313st.js} +1 -1
  48. package/dist/client/assets/{Users03-BUoBV4mB.js → Users03--HC72Dnu.js} +1 -1
  49. package/dist/client/assets/{XCircle-CVbKXkpd.js → XCircle-Bt06fa-N.js} +1 -1
  50. package/dist/client/assets/{XClose-CTv0nnSb.js → XClose-DM3y4DhR.js} +1 -1
  51. package/dist/client/assets/{YAxis-DxhC7uB4.js → YAxis-DNvsuYs9.js} +1 -1
  52. package/dist/client/assets/{Zap-MbQ2aiA8.js → Zap-BIV9pRJO.js} +1 -1
  53. package/dist/client/assets/{ZapSquare-BZzRAQpm.js → ZapSquare-QIZwOk1q.js} +1 -1
  54. package/dist/client/assets/ZoomOut-CRoOiJyQ.js +1 -0
  55. package/dist/client/assets/{access-gate-BZ6Xc62y.js → access-gate-bBcsLTqZ.js} +1 -1
  56. package/dist/client/assets/agent-icon-BP-KwHaL.js +1 -0
  57. package/dist/client/assets/agents-list-CdYhPZzF.js +1 -0
  58. package/dist/client/assets/{ai-providers-PPaiM-vM.js → ai-providers-kyRwHzOP.js} +2 -2
  59. package/dist/client/assets/{alert-CIFaGTb_.js → alert-DbJERvKT.js} +1 -1
  60. package/dist/client/assets/{alert-dialog-Dh9zsaCy.js → alert-dialog-DBIqwB_a.js} +1 -1
  61. package/dist/client/assets/{api-keys-B5Q1NcTU.js → api-keys-sddYcqX2.js} +1 -1
  62. package/dist/client/assets/app-editor-BjcnCeTV.js +1 -0
  63. package/dist/client/assets/{auth-D8IdOmGw.js → auth-BOUgLxto.js} +1 -1
  64. package/dist/client/assets/{auth-catchall-PSQzhhPS.js → auth-catchall-sgn0jKBF.js} +1 -1
  65. package/dist/client/assets/{auth-entry-DZQ7ulSa.js → auth-entry-RdTo0a7D.js} +1 -1
  66. package/dist/client/assets/{auth-split-layout-D4SJJOXB.js → auth-split-layout-7ElArbEj.js} +1 -1
  67. package/dist/client/assets/{authenticate-and-persist-oauth-DY_hbkIG.js → authenticate-and-persist-oauth-CSyB4Ikq.js} +1 -1
  68. package/dist/client/assets/{automation-list-row-CLAw5ACh.js → automation-list-row-cIw0RidY.js} +1 -1
  69. package/dist/client/assets/automation-runs-CPjPp0l_.js +187 -0
  70. package/dist/client/assets/automations-1SGWSi41.js +1 -0
  71. package/dist/client/assets/{avatar-D-QkiqIH.js → avatar-D7Ryfmkc.js} +1 -1
  72. package/dist/client/assets/{badge-DX3_GQsO.js → badge-CsGum4AP.js} +1 -1
  73. package/dist/client/assets/{block-document-D0mVcltx.js → block-document-ByjA0CRJ.js} +2 -2
  74. package/dist/client/assets/{breadcrumb-Clut3vXk.js → breadcrumb-CiqxRnKX.js} +1 -1
  75. package/dist/client/assets/{buckets-CNyoBCui.js → buckets-BYW61MYG.js} +1 -1
  76. package/dist/client/assets/bulk-category-panel-zfJmlmNV.js +1 -0
  77. package/dist/client/assets/{capability-load-error-BtIV807c.js → capability-load-error-D11cq4uG.js} +1 -1
  78. package/dist/client/assets/cards-BRKQMkit.js +8 -0
  79. package/dist/client/assets/category-editor-B5ipi4cT.js +1 -0
  80. package/dist/client/assets/{chart-BS94Bf-2.js → chart-mM3m3BmD.js} +3 -3
  81. package/dist/client/assets/chat-context-CsfU9qgh.js +35 -0
  82. package/dist/client/assets/{checkbox-Gg7TSWGl.js → checkbox-BBeIXKls.js} +1 -1
  83. package/dist/client/assets/choose-editor--PLjxsb1.js +1 -0
  84. package/dist/client/assets/{cli-auth-success-DMKVkxdU.js → cli-auth-success-jaDX-5Q6.js} +1 -1
  85. package/dist/client/assets/collection-detail-D-bE8fG2.js +1 -0
  86. package/dist/client/assets/{collection-display-button-jLXxSVGC.js → collection-display-button-DESH5EcG.js} +1 -1
  87. package/dist/client/assets/{collection-search-0N-i_PHL.js → collection-search-C8enHCKD.js} +1 -1
  88. package/dist/client/assets/{collection-table-wrapper-CMhDJ32A.js → collection-table-wrapper-pBDEa-p-.js} +1 -1
  89. package/dist/client/assets/{collection-tabs-PM6yowhG.js → collection-tabs-B3J2pC6N.js} +1 -1
  90. package/dist/client/assets/{command-JNsPUZwg.js → command-B7KZEeN_.js} +1 -1
  91. package/dist/client/assets/commerce-onboarding-CLKupNAF.js +1 -0
  92. package/dist/client/assets/{config-DFqhM__G.js → config-p1-EuejC.js} +1 -1
  93. package/dist/client/assets/{connect-CpvsClHG.js → connect-B8Ihml23.js} +1 -1
  94. package/dist/client/assets/{connection-CUtGFjSN.js → connection-B-9-J5nZ.js} +1 -1
  95. package/dist/client/assets/{connection-card-B1T5pd1c.js → connection-card-B8ZnCkrb.js} +1 -1
  96. package/dist/client/assets/connection-detail-d9M-DaxH.js +1 -0
  97. package/dist/client/assets/{connection-form-helpers-CYKg-GvJ.js → connection-form-helpers-LNr8FSPc.js} +1 -1
  98. package/dist/client/assets/connections-BUwlIKp2.js +1 -0
  99. package/dist/client/assets/{decopilot-sse-pool-BN-M5EUb.js → decopilot-sse-pool-DK-jWfRH.js} +1 -1
  100. package/dist/client/assets/{dialog-BI8UUwqv.js → dialog-Buvp0_k_.js} +1 -1
  101. package/dist/client/assets/{domain-settings-D4HjDgqu.js → domain-settings-BOmIEOBd.js} +1 -1
  102. package/dist/client/assets/{drawer-BR22I8_f.js → drawer-C-JEODnZ.js} +1 -1
  103. package/dist/client/assets/{dropdown-menu-wKA_-hY5.js → dropdown-menu-BVX76X1t.js} +1 -1
  104. package/dist/client/assets/editor-B9guvPGh.js +11 -0
  105. package/dist/client/assets/{empty-state-DAYLBxJ6.js → empty-state-BwGFcgil.js} +1 -1
  106. package/dist/client/assets/{extract-connection-data-6cVSTGuY.js → extract-connection-data-CFLT8Lmm.js} +1 -1
  107. package/dist/client/assets/file-explorer-CUB_T3Nt.js +2 -0
  108. package/dist/client/assets/{file-type-icon-QfVGs4d0.js → file-type-icon-CitxkbxC.js} +1 -1
  109. package/dist/client/assets/folder-icon-Bt1LxK-5.js +2 -0
  110. package/dist/client/assets/{form-DauSI86Q.js → form-BCSheD7J.js} +1 -1
  111. package/dist/client/assets/general-BLl23-1V.js +1 -0
  112. package/dist/client/assets/{github-repo-picker-sKX6qrmQ.js → github-repo-picker-CHA0-bBL.js} +1 -1
  113. package/dist/client/assets/{hooks-DQmp7LHz.js → hooks-DYDXfqwA.js} +6 -6
  114. package/dist/client/assets/{index-BYBf2qjQ.js → index-0Rjd7KPf.js} +1 -1
  115. package/dist/client/assets/{index-DKFNY2Yv.js → index-B1BNe5XL.js} +1 -1
  116. package/dist/client/assets/index-BFgc8ZC7.css +1 -0
  117. package/dist/client/assets/{index-B9iOsEIc.js → index-BuFIAUTC.js} +1 -1
  118. package/dist/client/assets/{index-Ci8azyOE.js → index-CLjikYNQ.js} +47 -47
  119. package/dist/client/assets/index-CWji8tuH.js +1 -0
  120. package/dist/client/assets/{index-BdFaTbMe.js → index-ClSDUMs2.js} +67 -70
  121. package/dist/client/assets/{index-De-kCEdQ.js → index-D14IhaK9.js} +1 -1
  122. package/dist/client/assets/{index-BMBPxk-z.js → index-DKEb9xSD.js} +2 -2
  123. package/dist/client/assets/{index-q2Rm7O_h.js → index-lT44vadh.js} +1 -1
  124. package/dist/client/assets/{index-redirect-DVfxG1gJ.js → index-redirect-eJAVqoLf.js} +1 -1
  125. package/dist/client/assets/{infra-billing-BEtRM-w8.js → infra-billing-DApRGD-J.js} +1 -1
  126. package/dist/client/assets/{input-Bwz-dTwg.js → input-CXueSbIK.js} +1 -1
  127. package/dist/client/assets/{integration-icon-CGnrGZxM.js → integration-icon-DkfgnaHN.js} +1 -1
  128. package/dist/client/assets/{invite-member-dialog-D8XHQ0du.js → invite-member-dialog-CuuzMf-g.js} +1 -1
  129. package/dist/client/assets/{label-C1OhLpvf.js → label-C9eYac1w.js} +1 -1
  130. package/dist/client/assets/{layout-DdQ7AbmJ.js → layout-cji8Pllb.js} +1 -1
  131. package/dist/client/assets/location-oTTXFrSF.js +1 -0
  132. package/dist/client/assets/{login-CaBX2Zyr.js → login-RNqT3oif.js} +1 -1
  133. package/dist/client/assets/markdown-DG_ePPJc.js +94 -0
  134. package/dist/client/assets/{mcp-oauth-GWhqBwu1.js → mcp-oauth-CUGdQwnE.js} +1 -1
  135. package/dist/client/assets/{members-CoSugncV.js → members-Ba_EjXOC.js} +1 -1
  136. package/dist/client/assets/monaco-editor-XKAgBzqM.js +9 -0
  137. package/dist/client/assets/{monitoring-stats-row-BKiTJqu0.js → monitoring-stats-row-pykjqEQ2.js} +1 -1
  138. package/dist/client/assets/{multi-select-CIx6xi2O.js → multi-select-C9OJwO9c.js} +1 -1
  139. package/dist/client/assets/{oauth-callback-D_4qsGLU.js → oauth-callback-DhH8Sg8S.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ai-provider-N2nxuW4H.js → oauth-callback-ai-provider-DxppKg9k.js} +1 -1
  141. package/dist/client/assets/{onboarding-c1-zuWRK.js → onboarding-C9-BVl7g.js} +1 -1
  142. package/dist/client/assets/{org-layout-D7r6nyax.js → org-layout-B4RTdykw.js} +1 -1
  143. package/dist/client/assets/{organization-choice-DZuaojdz.js → organization-choice-CRwp5frt.js} +1 -1
  144. package/dist/client/assets/{orgs-_zNVp-L6.js → orgs-JCxGyVBQ.js} +1 -1
  145. package/dist/client/assets/page-seo-form-DOQWcpe7.js +1 -0
  146. package/dist/client/assets/{popover-ClwD_xra.js → popover-D4C_xunP.js} +1 -1
  147. package/dist/client/assets/post-calendar-DDf4Ceb2.js +1 -0
  148. package/dist/client/assets/post-editor-MCeUKvjM.js +1 -0
  149. package/dist/client/assets/{primitives-BKjHT0m_.js → primitives-CYxDzduK.js} +1 -1
  150. package/dist/client/assets/{profile-fPJ06K0g.js → profile-ESYoh_Pt.js} +1 -1
  151. package/dist/client/assets/project-app-view-UB06HfoK.js +1 -0
  152. package/dist/client/assets/{prompts-BiA_3uUl.js → prompts-DEmFxhe4.js} +1 -1
  153. package/dist/client/assets/record-editor-mQCoWyZ1.js +1 -0
  154. package/dist/client/assets/redirect-editor-B9JlbMNp.js +1 -0
  155. package/dist/client/assets/registry-UjixfO8V.js +2 -0
  156. package/dist/client/assets/{registry-layout-C3aeIwiX.js → registry-layout-4Bi7LgQ7.js} +1 -1
  157. package/dist/client/assets/{reports-ZfNOoqaN.js → reports-DQJz2Cmv.js} +2 -2
  158. package/dist/client/assets/{require-capability-cxyKBT59.js → require-capability-Dm1c7mRJ.js} +1 -1
  159. package/dist/client/assets/{required-auth-layout-CUQaC9Hr.js → required-auth-layout-DCDe2_xo.js} +1 -1
  160. package/dist/client/assets/{reset-password-ipLYYDOf.js → reset-password-B2nhNnea.js} +1 -1
  161. package/dist/client/assets/review-settings-tNoU0ubl.js +1 -0
  162. package/dist/client/assets/roles-C-0laFT-.js +1 -0
  163. package/dist/client/assets/{scroll-area-RteS0-Yk.js → scroll-area-iNmkNxQd.js} +1 -1
  164. package/dist/client/assets/{search-input-CevwWux3.js → search-input-C_hPwWlY.js} +1 -1
  165. package/dist/client/assets/{secrets-ojCsqN5b.js → secrets-DMBg4CtB.js} +1 -1
  166. package/dist/client/assets/sections-editor-DmGy1kfY.js +2 -0
  167. package/dist/client/assets/{select-C7Q2VGxk.js → select-CXWGcLoH.js} +1 -1
  168. package/dist/client/assets/{select-model-C03zAz7l.js → select-model-LFUkuM-R.js} +2 -2
  169. package/dist/client/assets/{self-tool-result-BSLlHbcp.js → self-tool-result-BQSdlPPl.js} +1 -1
  170. package/dist/client/assets/seo-editor-zsyKoChQ.js +1 -0
  171. package/dist/client/assets/settings-layout-0Mx4abSG.js +1 -0
  172. package/dist/client/assets/{shell-controls-BMTxwot2.js → shell-controls-CAqHiAbw.js} +1 -1
  173. package/dist/client/assets/shell-layout-CCJOKrlB.js +1 -0
  174. package/dist/client/assets/skill-preview-Bpjo0e0e.js +4 -0
  175. package/dist/client/assets/skills-D66l5Pe4.js +1 -0
  176. package/dist/client/assets/{spinner-B9x-ViPH.js → spinner-Kj9-kHS5.js} +1 -1
  177. package/dist/client/assets/{sso-9kD1uEp6.js → sso-BbnjdAVr.js} +1 -1
  178. package/dist/client/assets/{store-DVSsps0V.js → store-CDW3xgvS.js} +1 -1
  179. package/dist/client/assets/store-registry-Bw5brwRA.js +2 -0
  180. package/dist/client/assets/super-agent-icon-Cv5HTwbP.js +1 -0
  181. package/dist/client/assets/{switch-BuJnEOUw.js → switch-DKegBAiv.js} +1 -1
  182. package/dist/client/assets/synced-repos-BOkpnLeH.js +1 -0
  183. package/dist/client/assets/{table-oIbRw7Yk.js → table-Dvpenn5X.js} +1 -1
  184. package/dist/client/assets/{tabs-CFhQLpsD.js → tabs-0Nbaxawf.js} +1 -1
  185. package/dist/client/assets/{task-board-Cz-fiaKF.js → task-board-D-kil0OD.js} +1 -1
  186. package/dist/client/assets/tasks-D-Fe8Ppq.js +1 -0
  187. package/dist/client/assets/{textarea-CMpN0SgX.js → textarea-BJ4TussH.js} +1 -1
  188. package/dist/client/assets/thread-route-Cmmo50Fe.js +1 -0
  189. package/dist/client/assets/{toggle-group-ClOqwWDq.js → toggle-group-C0VATZeX.js} +1 -1
  190. package/dist/client/assets/{toolbar-KH-9Bre4.js → toolbar-Bmv5cu6y.js} +1 -1
  191. package/dist/client/assets/{track-DXtvDI_s.js → track-BsrCovp4.js} +1 -1
  192. package/dist/client/assets/{types-BGVeElFe.js → types-Bkfd8ghD.js} +1 -1
  193. package/dist/client/assets/{use-ai-providers-DlWIkMD-.js → use-ai-providers-CG6Y0TAQ.js} +1 -1
  194. package/dist/client/assets/{use-api-keys-D0NAsvsx.js → use-api-keys-oFV-6tmf.js} +1 -1
  195. package/dist/client/assets/{use-automations-CWqvHqj2.js → use-automations-BXcJPDIk.js} +1 -1
  196. package/dist/client/assets/{use-autosave-D1zPEM1D.js → use-autosave-DvxG9h7A.js} +1 -1
  197. package/dist/client/assets/{use-connection-gqhqm1hO.js → use-connection--DbsGpk_.js} +1 -1
  198. package/dist/client/assets/{use-copy-BY1mlr6R.js → use-copy-t26hWaR6.js} +1 -1
  199. package/dist/client/assets/{use-create-virtual-mcp-Dzmlrw8C.js → use-create-virtual-mcp-DfyGVwvi.js} +1 -1
  200. package/dist/client/assets/{use-debounced-autosave-j0VBccs2.js → use-debounced-autosave-DCqMSIfY.js} +1 -1
  201. package/dist/client/assets/{use-debounced-value-BENALn-i.js → use-debounced-value-0mjAJnh9.js} +1 -1
  202. package/dist/client/assets/{use-decopilot-events-CqU7DunK.js → use-decopilot-events-DXEJ77Cw.js} +1 -1
  203. package/dist/client/assets/{use-delete-connection-BwHeDNps.js → use-delete-connection-P1--1uTD.js} +1 -1
  204. package/dist/client/assets/{use-deployment-admin-CQiRFTsL.js → use-deployment-admin-PyTOxvE6.js} +1 -1
  205. package/dist/client/assets/{use-destination-route-d8wgPDBu.js → use-destination-route-LJ6L5J-Z.js} +1 -1
  206. package/dist/client/assets/{use-file-configs-BAUKJMmN.js → use-file-configs-CZ6Q9RHz.js} +1 -1
  207. package/dist/client/assets/{use-infinite-scroll-Cw7R-QWe.js → use-infinite-scroll-D-RuGEMN.js} +1 -1
  208. package/dist/client/assets/{use-join-requests-CBEK68HB.js → use-join-requests-u4NwwBfY.js} +1 -1
  209. package/dist/client/assets/{use-mcp-auth-status-7KFU7IPU.js → use-mcp-auth-status-CpemSejR.js} +1 -1
  210. package/dist/client/assets/{use-mcp-client-DP2onozC.js → use-mcp-client-CBP30lcT.js} +2 -2
  211. package/dist/client/assets/{use-mcp-tools-B7yHzu9T.js → use-mcp-tools-CZZL007X.js} +1 -1
  212. package/dist/client/assets/{use-members-IwrDPxqz.js → use-members-DLt1FY-q.js} +1 -1
  213. package/dist/client/assets/{use-navigate-to-agent-mrg2_DxJ.js → use-navigate-to-agent-DAh2yiE0.js} +1 -1
  214. package/dist/client/assets/{use-org-auth-client-HXTuHVWD.js → use-org-auth-client-Eaq6KsK_.js} +1 -1
  215. package/dist/client/assets/{use-org-repo-syncs-rlkQHsUF.js → use-org-repo-syncs-s-v1_DV-.js} +1 -1
  216. package/dist/client/assets/{use-org-sso-C-uWWD5m.js → use-org-sso-5zd-6Usk.js} +1 -1
  217. package/dist/client/assets/{use-organization-roles-CQ2UVvkm.js → use-organization-roles-D7AZGrVn.js} +1 -1
  218. package/dist/client/assets/{use-organization-settings-BAFLKQ3y.js → use-organization-settings-C3jHLzD-.js} +1 -1
  219. package/dist/client/assets/use-panel-navigate-DHlMMTZi.js +1 -0
  220. package/dist/client/assets/{use-registry-connections-DghvIzKh.js → use-registry-connections-DHIJ1ozU.js} +1 -1
  221. package/dist/client/assets/{use-secrets-CvibJ_Hx.js → use-secrets-DTjUUpxa.js} +1 -1
  222. package/dist/client/assets/{use-section-preview-base-DTnA68XU.js → use-section-preview-base-3f3eeApB.js} +1 -1
  223. package/dist/client/assets/{use-status-sounds-kx6TUHpf.js → use-status-sounds-C940bfEw.js} +1 -1
  224. package/dist/client/assets/{use-tags-CGJ43yMs.js → use-tags-XQU8F1xp.js} +1 -1
  225. package/dist/client/assets/{use-view-mode-Bn3--gRi.js → use-view-mode-B-FpXA1j.js} +1 -1
  226. package/dist/client/assets/{use-virtual-mcp-Dj0wXB98.js → use-virtual-mcp-Jrf_I5O6.js} +1 -1
  227. package/dist/client/assets/useInfiniteQuery-C3i2ddec.js +1 -0
  228. package/dist/client/assets/useSuspenseInfiniteQuery-CsRImOmD.js +1 -0
  229. package/dist/client/assets/{users-B_7Qs-RF.js → users-BI5lRiyl.js} +1 -1
  230. package/dist/client/assets/variant-calendar-90WnwndK.js +1 -0
  231. package/dist/client/assets/{view-mode-toggle-CcmqoSVC.js → view-mode-toggle-DdfOH72I.js} +1 -1
  232. package/dist/client/index.html +2 -2
  233. package/dist/server/cli.js +1 -1
  234. package/dist/server/server.js +1 -1
  235. package/package.json +1 -1
  236. package/dist/client/assets/Tool01-va49aYq9.js +0 -1
  237. package/dist/client/assets/UserSquare-CwU4sG2o.js +0 -1
  238. package/dist/client/assets/agent-icon-DCM1Bdl8.js +0 -1
  239. package/dist/client/assets/agents-list-BblEB_Yy.js +0 -1
  240. package/dist/client/assets/app-editor-I_aUhOen.js +0 -1
  241. package/dist/client/assets/automation-runs-GCI7uxIE.js +0 -280
  242. package/dist/client/assets/automations-BQ1HpMVH.js +0 -1
  243. package/dist/client/assets/bulk-category-panel-CsF_6FI0.js +0 -1
  244. package/dist/client/assets/cards-4fPEe6ST.js +0 -9
  245. package/dist/client/assets/category-editor-D5nV2a1F.js +0 -1
  246. package/dist/client/assets/chat-context-CmwZXAhQ.js +0 -35
  247. package/dist/client/assets/choose-editor-2zkSgPsA.js +0 -1
  248. package/dist/client/assets/collection-detail-DHWV_lB6.js +0 -1
  249. package/dist/client/assets/commerce-onboarding-BAlSxXoB.js +0 -1
  250. package/dist/client/assets/connection-detail-DZEeMz2b.js +0 -1
  251. package/dist/client/assets/connections-Cd3u8u7a.js +0 -1
  252. package/dist/client/assets/file-explorer-hutSgELN.js +0 -2
  253. package/dist/client/assets/general-BmUVO2yQ.js +0 -1
  254. package/dist/client/assets/index-D3IpXIE1.js +0 -1
  255. package/dist/client/assets/index-DJSuP9VA.css +0 -1
  256. package/dist/client/assets/monaco-editor-CQbDSum8.js +0 -19
  257. package/dist/client/assets/page-seo-form-kQ_gqmTd.js +0 -1
  258. package/dist/client/assets/post-calendar-DJZelBC2.js +0 -1
  259. package/dist/client/assets/post-editor-C5Ee-UkR.js +0 -1
  260. package/dist/client/assets/project-app-view-DZuDq3zQ.js +0 -1
  261. package/dist/client/assets/record-editor-DGXTnpF6.js +0 -1
  262. package/dist/client/assets/redirect-editor-V6SQ4gS6.js +0 -1
  263. package/dist/client/assets/registry-BYqWHQgR.js +0 -2
  264. package/dist/client/assets/review-settings-kV6Wbxhl.js +0 -1
  265. package/dist/client/assets/roles-Dcj4t-Mv.js +0 -1
  266. package/dist/client/assets/sections-editor-VI00Nblu.js +0 -2
  267. package/dist/client/assets/seo-editor-CObQJqAB.js +0 -1
  268. package/dist/client/assets/settings-layout-Bbbz4btQ.js +0 -1
  269. package/dist/client/assets/shell-layout-i3nUAnDL.js +0 -1
  270. package/dist/client/assets/store-registry-BiGqjfDg.js +0 -2
  271. package/dist/client/assets/super-agent-icon-DbGhAnlL.js +0 -1
  272. package/dist/client/assets/synced-repos-XSy5K1eb.js +0 -1
  273. package/dist/client/assets/tasks-D-zkYbxa.js +0 -1
  274. package/dist/client/assets/use-panel-navigate-BsVeEWlx.js +0 -1
  275. package/dist/client/assets/useInfiniteQuery-DjjzlWAZ.js +0 -1
  276. package/dist/client/assets/useSuspenseInfiniteQuery-Ci5SesMe.js +0 -1
  277. package/dist/client/assets/variant-calendar-BdYlnVxu.js +0 -1
@@ -0,0 +1,35 @@
1
+ import{I as re,c as O,a4 as He,u as Oe,b3 as rt,p as Ne,H as Y,K as oe,t as ae,R as de,d as Ge,c_ as at,dF as ot,r as k,o as it,ac as ct,e as lt,aY as ut,j as X,b as we,a as dt,x as pt,cN as ft,aB as ht,q as mt}from"./index-CLjikYNQ.js";import{a as Xe,u as gt}from"./use-panel-navigate-DHlMMTZi.js";import{b as yt,e as St,A as Ye,f as vt,g as Tt,w as It}from"./thread-route-Cmmo50Fe.js";import{p as bt}from"./session-runtime-C-KTDVeQ.js";import{S as kt,c as Mt,f as xt,a as Ct}from"./hooks-DYDXfqwA.js";import{u as wt}from"./use-is-desktop-app-BNujXJc_.js";import{u as At}from"./use-mcp-client-CBP30lcT.js";import{S as Et}from"./constants-dLUUoWH7.js";import{a as $t}from"./use-virtual-mcp-Jrf_I5O6.js";import{u as Je,p as _t,b as ve,i as Pt,c as Rt}from"./use-ai-providers-CG6Y0TAQ.js";import{o as Dt,b as Ot}from"./location-oTTXFrSF.js";import{u as Nt}from"./use-decopilot-events-DXEJ77Cw.js";import{D as qt}from"./use-destination-route-LJ6L5J-Z.js";import{b as Ft}from"./use-organization-settings-C3jHLzD-.js";function qe(t,e){return re.chatThreadIntent(t,e)}function Ue(t,e,s,n){if(!(!n.runtime&&!n.branch))try{t.setItem(qe(e,s),JSON.stringify(n))}catch{}}function Qe(t,e,s){try{t.removeItem(qe(e,s))}catch{}}function Hs(t,e,s){const n=qe(e,s);let r=null;try{r=t.getItem(n),t.removeItem(n)}catch{return{}}if(!r)return{};let a;try{a=JSON.parse(r)}catch{return{}}if(!a||typeof a!="object")return{};const o=a,i=bt(o.runtime),u=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...i?{runtime:i}:{},...u?{branch:u}:{}}}function Lt(t,e=[]){return t==="stop"?"completed":t==="tool-calls"?e.some(n=>n.type==="tool-user_ask"&&n.state==="input-available"||n.state==="approval-requested")?"requires_action":"completed":"failed"}const Be={"claude-code-desktop":"claude-code","codex-desktop":"codex","opencode-desktop":"opencode"};function jt(t){return t==="claude-code"?"claude-code-desktop":t==="codex"?"codex-desktop":t==="opencode"?"opencode-desktop":null}function Ut({pendingOption:t,lockedHarness:e}){return e?jt(e):t}function Qt(t){return t.thread?.harness_id!=null?{}:{branch:t.globals.branch??null}}const Bt=new Set(["decopilot","claude-code"]);function Wt({isDesktopApp:t,harnessId:e}){return e!=null&&!Bt.has(e)}function Vt(t){const e=O.c(19);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=s):s=e[0];const n=He(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[1]=r):r=e[1];const a=Oe(r),o=Xe();let i;e[2]!==o||e[3]!==a?(i=rt(o)?.path??a.preview??a.skill??a.brand??null,e[2]=o,e[3]=a,e[4]=i):i=e[4];const u=i;let f;if(e[5]!==n?.params.appSlug||e[6]!==n?.params.collectionName||e[7]!==n?.params.itemId||e[8]!==u||e[9]!==t){if(f=[],t&&f.push(`### Selected Agent
2
+ - ID: ${t}`),u){let M;e[11]!==u?(M=Dt(u),e[11]=u,e[12]=M):M=e[12];const w=M;let d;e[13]!==u?(d=Ot(u),e[13]=u,e[14]=d):d=e[14],f.push(`### Currently Open File
3
+ The user has this file open in the Library and is most likely referring to it:
4
+ - Name: ${d}
5
+ - Library path: ${u}${w?`
6
+ - Read/edit it with your file tools at: \`${w}\``:""}
7
+
8
+ When a request is ambiguous about which file or resource it targets (e.g. "change the h1", "fix this", "what's in this file", "update the title"), assume it means this file unless the user clearly indicates otherwise.`)}let h;e[15]!==n?.params.appSlug||e[16]!==n?.params.collectionName||e[17]!==n?.params.itemId?(h=[],n?.params.appSlug&&h.push(`- Connection ID: ${n?.params.appSlug}`),n?.params.collectionName&&h.push(`- Collection: ${n?.params.collectionName}`),n?.params.itemId&&h.push(`- Item ID: ${n?.params.itemId}`),e[15]=n?.params.appSlug,e[16]=n?.params.collectionName,e[17]=n?.params.itemId,e[18]=h):h=e[18],h.length>0&&f.push(`### Current Resource
9
+ The user is viewing the following resource:
10
+ ${h.join(`
11
+ `)}
12
+
13
+ Help the user understand and work with this resource.`),e[5]=n?.params.appSlug,e[6]=n?.params.collectionName,e[7]=n?.params.itemId,e[8]=u,e[9]=t,e[10]=f}else f=e[10];return f.join(`
14
+
15
+ `)}function Kt(){const t=O.c(5),e=Ne(),{org:s}=Y();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=n):n=t[0];const r=He(n);let a;return t[1]!==r?.params||t[2]!==s||t[3]!==e?(a=o=>{const u=o.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!u||!u[1])return;const f=u[1],h=r?.params.appSlug;if(!h)return;e.invalidateQueries({queryKey:oe.collection(s.slug,h,f)});const M=f.toLowerCase().replace(/_/g," ");ae.success(`${M} updated`)},t[1]=r?.params,t[2]=s,t[3]=e,t[4]=a):a=t[4],a}function Ht(){const t=O.c(4),{org:e,project:s}=Y(),n=`${e.id}/${s.id}`;let r;t[0]!==n?(r=re.taskLastViewed(n),t[0]=n,t[1]=r):r=t[1];const[,a]=de(r,Gt);let o;return t[2]!==a?(o={markTaskRead:u=>{a(f=>({...f,[u]:new Date().toISOString()}))}},t[2]=a,t[3]=o):o=t[3],o}function Gt(t){return t??{}}function ze(){const t=O.c(11),e=Ge(),{org:s}=Y(),n=yt(),r=St(),a=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const i=Oe(o);let u;t[1]!==a||t[2]!==e||t[3]!==s||t[4]!==i||t[5]!==r?(u=(M,w)=>{const d=a&&!at(a)?a:void 0,x=d?ot(d):null;e({to:qt.agents,params:{org:s.slug,project:w?.virtualMcpId??r,panel:x?.panel},search:{thread:M,...x?.payload??{},...typeof i.sidepanel=="boolean"?{sidepanel:i.sidepanel}:{},...w?.autosend?{autosend:Ye}:{}}})},t[1]=a,t[2]=e,t[3]=s,t[4]=i,t[5]=r,t[6]=u):u=t[6];const f=u;let h;return t[7]!==f||t[8]!==n||t[9]!==r?(h={virtualMcpId:r,taskId:n,navigateToTask:f},t[7]=f,t[8]=n,t[9]=r,t[10]=h):h=t[10],h}function Xt(t,e){const{mimeType:s,data:n}=t;if(s.startsWith("text/"))try{const r=new TextDecoder().decode(Uint8Array.from(atob(n),a=>a.charCodeAt(0)));return[{type:"text",text:`${e}
16
+ ${r}`}]}catch(r){console.error("Failed to decode text file:",r)}return[{type:"file",url:`data:${s};base64,${n}`,filename:e,mediaType:s}]}function We(t,e){const s=[];for(const n of t)!n||typeof n!="object"||("text"in n&&n.text?s.push({type:"text",text:`[${e}]
17
+ ${n.text}`}):"blob"in n&&n.blob&&n.mimeType&&s.push({type:"file",url:`data:${n.mimeType};base64,${n.blob}`,filename:String(n.uri),mediaType:String(n.mimeType)}));return s}function Yt(t,e){const s=(t.files??[]).filter(o=>o.content?.trim()),n=t.omittedPaths??[];if(s.length===0&&n.length===0)return[];const r=s.map(o=>`<skill-file path="${o.relPath}">
18
+ ${o.content.trim()}
19
+ </skill-file>`).join(`
20
+
21
+ `),a=n.length>0?`
22
+
23
+ Other files in \`${t.sandboxPath}/\`: ${n.join(", ")}`:"";return[{type:"text",text:`[${e}]
24
+ ${r}${a}`}]}function Jt(t,e){const s=[];for(const n of t){if(n.role!=="user"||!n.content)continue;const r=Array.isArray(n.content)?n.content:[n.content];for(const a of r)switch(a.type){case"text":{const o=a.text?.trim();if(!o)continue;s.push({type:"text",text:`[${e}]
25
+ ${o}`});break}case"image":case"audio":{if(!a.data||!a.mimeType)continue;s.push({type:"file",url:`data:${a.mimeType};base64,${a.data}`,mediaType:a.mimeType});break}case"resource":{const o=a.resource;if(!o||!o.mimeType)continue;o&&("text"in o&&o.text?s.push({type:"text",text:`[${e}]
26
+ ${o.text}`}):"blob"in o&&o.blob&&o.mimeType&&s.push({type:"file",url:`data:${o.mimeType};base64,${o.blob}`,filename:String(o.uri),mediaType:String(o.mimeType)}));break}}}return s}function Ze(t){if(!t)return[];const e=[];let s="";const n=r=>{if(r){if(r.type==="text"&&"text"in r&&typeof r.text=="string")s+=r.text;else if(r.type==="mention"&&r.attrs){const a=r.attrs.char??"/",o=`${a}${r.attrs.name}`;if(r.attrs.kind==="task"){const i=r.attrs.metadata,u=i?.title??r.attrs.name??"",f=i?.context?.trim()||[u,i?.description?.trim()].filter(Boolean).join(`
27
+
28
+ `);f&&e.push({type:"text",text:f});return}if(s+=o,a==="@"){const i=r.attrs.metadata;i&&typeof i=="object"&&!Array.isArray(i)&&"agentId"in i?e.push({type:"text",text:`[DELEGATE TO AGENT: ${i.title??r.attrs.name} (agent_id: ${i.agentId})]
29
+ Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(i)&&e.push(...We(i,o))}else if(r.attrs.kind==="skill"){const i=r.attrs.metadata;i&&!Array.isArray(i)&&Array.isArray(i.files)&&e.push(...Yt(i,o))}else{const i=r.attrs.metadata||r.attrs.prompts||[];Array.isArray(i)&&i.length>0&&typeof i[0]=="object"&&i[0]!==null&&"role"in i[0]?e.push(...Jt(i,o)):Array.isArray(i)&&e.push(...We(i,o))}}else if(r.type==="file"&&r.attrs){const a=r.attrs,o=`[file:://${encodeURIComponent(a.name)}]`;s+=o,e.push(...Xt(a,o))}if("content"in r&&Array.isArray(r.content))for(const a of r.content)n(a)}};return n(t),s.trim()&&e.unshift({type:"text",text:s.trim()}),e}function Gs(t){const e=Ze(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function Xs(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function zt(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function Ys(t){return t.filter(e=>e.status==="queued").sort((e,s)=>e.enqueuedAt-s.enqueuedAt)}function Zt(t,e){return t.some(s=>s.messageId===e.messageId)?t:[...t,e]}function es(t,e){return t.filter(s=>s.messageId!==e)}const te=new Map,ts=200;function ss(t){if(te.size<ts||te.has(t))return;const e=te.keys().next().value;if(e!==void 0){te.delete(e),Ae.delete(e);for(const s of pe.keys())s.startsWith(`${e}:`)&&pe.delete(s)}}const Ae=new Set;function ns(t){Ae.add(t)}function rs(t){return Ae.has(t)}function as(t){Ae.delete(t)}function Ie(t){const e=te.get(t);if(e)return te.delete(t),te.set(t,e),e;ss(t);const s=new kt([]);return te.set(t,s),s}function et(t,e){Ie(t).update(s=>Zt(s,e))}function De(t,e){Ie(t).update(s=>es(s,e))}function os(t,e){Ie(t).set(e)}const pe=new Map;function is(t,e){pe.set(`${t}:${e.id}`,e)}function cs(t,e){const s=`${t}:${e}`,n=pe.get(s);return pe.delete(s),n}function Ve(t,e){pe.delete(`${t}:${e}`)}async function ee(t,e){try{const s=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!s.ok)return;const n=await s.json();os(e,n.items??[])}catch{}}function Js(t){const e=O.c(2);let s;e[0]!==t?(s=Ie(t),e[0]=t,e[1]=s):s=e[1];const n=s;return k.useSyncExternalStore(n.subscribe,n.get,n.get)}function ls(){const{org:t}=Y();return{enqueue:et,refresh:e=>ee(t.slug,e),cancel:async(e,s)=>{const n=`thread-run:${e}:${s}`;De(e,s);try{const r=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(n)}`,{method:"POST",credentials:"include"});if(!r.ok&&r.status!==404)throw new Error(`Cancel failed: ${r.status}`);return!0}catch(r){return ae.error(r instanceof Error?r.message:"Failed to cancel"),!1}finally{await ee(t.slug,e)}}}}function Ce(t,e){return t.find(s=>s!=null&&e.has(s.keyId))??null}function us(t,e,s){const n=r=>Ce([r],s);return{tiers:{fast:Ce([e.tiers.fast,t.tiers.fast],s),smart:Ce([e.tiers.smart,t.tiers.smart],s),thinking:Ce([e.tiers.thinking,t.tiers.thinking],s),image:n(t.tiers.image),web_search:n(t.tiers.web_search),deep_research:n(t.tiers.deep_research)}}}const Te={tiers:{}};function ds(){const t=O.c(7),{org:e}=Y();let s;t[0]!==e.id?(s=oe.userModelPreferences(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==e.slug?(n=async()=>{const a=await ut(e.slug,"USER_MODEL_PREFERENCES_GET",{});return a?.tiers?a:Te},t[2]=e.slug,t[3]=n):n=t[3];let r;return t[4]!==s||t[5]!==n?(r={queryKey:s,queryFn:n,staleTime:6e4},t[4]=s,t[5]=n,t[6]=r):r=t[6],it(r)}function ps(){return ds().data??Te}function zs(){const t=O.c(19),{org:e}=Y(),s=ct(),n=Ne();let r;t[0]!==e.id?(r=oe.userModelPreferences(e.id),t[0]=e.id,t[1]=r):r=t[1];const a=r;let o;t[2]!==a||t[3]!==n||t[4]!==s?(o=async w=>{const d=n.getQueryData(a)??Te;return await s.call("USER_MODEL_PREFERENCES_UPDATE",d)??d},t[2]=a,t[3]=n,t[4]=s,t[5]=o):o=t[5];let i,u,f,h;t[6]!==a||t[7]!==n?(i=w=>{const{tier:d,slot:x}=w,N=n.getQueryData(a),q=N??Te;return n.setQueryData(a,{tiers:{...q.tiers,[d]:x}}),{prev:N}},u=(w,d,x)=>{n.setQueryData(a,x?.prev??Te)},f=w=>{n.setQueryData(a,w)},h=()=>{n.isMutating({mutationKey:a})===1&&n.invalidateQueries({queryKey:a})},t[6]=a,t[7]=n,t[8]=i,t[9]=u,t[10]=f,t[11]=h):(i=t[8],u=t[9],f=t[10],h=t[11]);let M;return t[12]!==a||t[13]!==o||t[14]!==i||t[15]!==u||t[16]!==f||t[17]!==h?(M={mutationKey:a,mutationFn:o,onMutate:i,onError:u,onSuccess:f,onSettled:h},t[12]=a,t[13]=o,t[14]=i,t[15]=u,t[16]=f,t[17]=h,t[18]=M):M=t[18],lt(M)}function fs(){const t=O.c(4),e=Ft(),s=ps(),n=Je();let r;return t[0]!==n||t[1]!==e||t[2]!==s?(r=us(e,s,new Set(n.map(hs))),t[0]=n,t[1]=e,t[2]=s,t[3]=r):r=t[3],r}function hs(t){return t.id}function ne(t,e,s,n){if(!t)return null;const r=e.find(o=>o.id===t.keyId);if(!r)return null;const a=s.find(o=>o.modelId===t.modelId);return a?{...a,keyId:t.keyId}:{modelId:t.modelId,title:n??t.modelId,keyId:t.keyId,providerId:r.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function ms(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function gs(t,e,s,n){if(!s||n.length===0)return null;const r=e.find(u=>u.id===s);if(!r)return null;const a=_t([r],{[s]:n}),o=t==="fast"?a.chat.fast:t==="thinking"?a.chat.thinking:a.chat.smart;if(!o)return null;const i=n.find(u=>u.modelId===o.modelId);return i?{...i,keyId:s}:null}const Ke=new Set,Z=new Set;function ue(t){return k.useSyncExternalStore(t.subscribe,t.get,t.get)}function ys(t){return t.kind==="loading"?"ready":t.kind}function tt(t){return t&&typeof t=="object"&&"type"in t?{tiptapDoc:t}:t}const Ss=1e4,vs=10,be=k.createContext(null),Ee=k.createContext(null),Fe=k.createContext(null),st=k.createContext(null);function Ts(t){const e=O.c(3),{value:s,children:n}=t;let r;return e[0]!==n||e[1]!==s?(r=X.jsx(be.Provider,{value:s,children:n}),e[0]=n,e[1]=s,e[2]=r):r=e[2],r}function Zs(t){const e=O.c(2),{children:s}=t;let n;return e[0]!==s?(n=X.jsx(be.Provider,{value:null,children:X.jsx(Ee.Provider,{value:null,children:s})}),e[0]=s,e[1]=n):n=e[1],n}function Is({children:t}){const{locator:e}=Y(),{virtualMcpId:s}=ze(),[n,r]=de(re.chatSelectedImageModel(e),null),[a,o]=de(re.chatSelectedWebSearchModel(e),null),[i,u]=de(re.chatSelectedDeepResearchModel(e),null),[f,h]=k.useState(null),[M,w]=k.useState("default"),d=fs(),[x,N]=de(re.chatSimpleModeTier(e),null),q=ms(x),I=Je(),C=d.tiers[q],j=I.some(c=>c.id===C?.keyId)?C?.keyId:void 0,U=f&&I.some(c=>c.id===f)?f:j??I[0]?.id??null,{models:P,isLoading:A}=ve(U??void 0),{models:$}=ve(j),J=I.some(c=>c.id===d.tiers.image?.keyId)?d.tiers.image?.keyId:void 0,{models:se}=ve(J),R=I.some(c=>c.id===d.tiers.web_search?.keyId)?d.tiers.web_search?.keyId:void 0,{models:Q}=ve(R),F=I.some(c=>c.id===d.tiers.deep_research?.keyId)?d.tiers.deep_research?.keyId:void 0,{models:V}=ve(F),K=ne(C,I,$,C?.title)??gs(q,I,U,P),H=A,G=P.filter(c=>c.capabilities?.includes("image")),B=ne(n,I,G),m=ne(d.tiers.image,I,se,d.tiers.image?.title)??B??G[0]??null,S=P.filter(Pt),b=ne(a,I,S),L=S.find(c=>c.modelId==="perplexity/sonar")??S[0]??null,z=ne(d.tiers.web_search,I,Q,d.tiers.web_search?.title)??b??L,ie=P.filter(Rt),$e=ne(i,I,ie),D=ie.find(c=>c.modelId==="perplexity/deep-research")??ie.find(c=>c.asyncResearch===!0)??ie[0]??null,fe=ne(d.tiers.deep_research,I,V,d.tiers.deep_research?.title)??$e??D,ke=$t(s)??{id:s,title:"",description:null,icon:null},[_e,he]=k.useState({}),Me=(c,E)=>{const y=[];for(const g of E.content??[])g.type==="text"&&g.text?.trim()&&y.push(g.text.trim());const T=y.join(`
30
+ `);if(!T){me(c);return}new TextEncoder().encode(T).length>Ss||he(g=>Object.keys(g).length>=vs&&!(c in g)?g:{...g,[c]:T})},me=c=>{he(E=>{const{[c]:y,...T}=E;return T})},[ge,Pe]=de(re.chatLastAgentOption(e),c=>c&&c in Be?c:null),xe=Ps(),ye=Ut({pendingOption:ge,lockedHarness:xe?.isThreadLocked?xe.lockedHarness:null}),je=ye?Be[ye]:null,[ce,Re]=k.useState(void 0),l=k.useRef(ce);l.current=ce;const p={selectedModel:K,setModel:()=>{},credentialId:U,setCredentialId:h,allModelsConnections:I,isModelsLoading:H,selectedVirtualMcp:ke,imageModel:m,setImageModel:c=>{r(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},webSearchModel:z,setWebSearchModel:c=>{o(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},deepResearchModel:fe,setDeepResearchModel:c=>{u(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},chatMode:M,setChatMode:w,appContexts:_e,setAppContext:Me,clearAppContext:me,tiptapDoc:ce,setTiptapDoc:Re,tiptapDocRef:l,resetInteraction:()=>{},simpleModeTier:q,setSimpleModeTier:c=>N(c),pendingAgentOption:ye,setPendingAgentOption:Pe,pendingHarnessId:je};return X.jsx(Fe.Provider,{value:p,children:t})}function en(t){const e=O.c(41),{virtualMcpId:s,task:n,children:r}=t,{locator:a}=Y(),{data:o}=dt.useSession(),i=o?.user??null,{taskId:u,virtualMcpId:f,navigateToTask:h}=ze(),[M]=pt(),{markTaskRead:w}=Ht(),d=Ct(),x=u,N=f,q=Vt(N);let I;e[0]!==w||e[1]!==h?(I=(S,b)=>{w(S),h(S,{virtualMcpId:b?.virtualMcpId,autosend:b?.autosend})},e[0]=w,e[1]=h,e[2]=I):I=e[2];const C=I,j=x!==null&&n?.id===x?n:null,U=j?.harness_id??null,P=j?.branch??null,A=U!=null,$=P;let J;e[3]!==$||e[4]!==a||e[5]!==C||e[6]!==d||e[7]!==s?(J=S=>{const b=crypto.randomUUID(),L=S?.branch??$;return Ue(sessionStorage,a,b,{...S?.runtime?{runtime:S.runtime}:{},...L?{branch:L}:{}}),d.create({id:b,virtual_mcp_id:s,...L?{branch:L}:{},...S?.runtime?{runtime:S.runtime}:{}}).then(()=>{Qe(sessionStorage,a,b),C(b)}).catch(()=>{C(b)}),b},e[3]=$,e[4]=a,e[5]=C,e[6]=d,e[7]=s,e[8]=J):J=e[8];const se=J;let R;e[9]!==$||e[10]!==a||e[11]!==C||e[12]!==d||e[13]!==s?(R=S=>{const b=crypto.randomUUID(),L=S.virtualMcpId??s,z=L===s?$:null;It(sessionStorage,a,b,S.message),z&&Ue(sessionStorage,a,b,{branch:z}),d.create({id:b,virtual_mcp_id:L,...z?{branch:z}:{}}).then(()=>{Qe(sessionStorage,a,b),C(b,{virtualMcpId:S.virtualMcpId,autosend:!0})}).catch(()=>{C(b,{virtualMcpId:S.virtualMcpId,autosend:!0})})},e[9]=$,e[10]=a,e[11]=C,e[12]=d,e[13]=s,e[14]=R):R=e[14];const Q=R;let F;e[15]!==x||e[16]!==d?(F=S=>{x&&d.setBranch(x,S)},e[15]=x,e[16]=d,e[17]=F):F=e[17];let V;e[18]!==j||e[19]!==se||e[20]!==Q||e[21]!==$||e[22]!==x||e[23]!==N||e[24]!==A||e[25]!==P||e[26]!==U||e[27]!==C||e[28]!==F?(V={virtualMcpId:N,taskId:x,openTask:C,createTask:se,createTaskWithMessage:Q,activeTask:j,isThreadLocked:A,lockedHarness:U,lockedBranch:P,currentBranch:$,setCurrentTaskBranch:F},e[18]=j,e[19]=se,e[20]=Q,e[21]=$,e[22]=x,e[23]=N,e[24]=A,e[25]=P,e[26]=U,e[27]=C,e[28]=F,e[29]=V):V=e[29];const K=V;let H;e[30]!==q||e[31]!==M||e[32]!==h||e[33]!==i?(H={user:i,contextPrompt:q,preferences:M,rawNavigateToTask:h},e[30]=q,e[31]=M,e[32]=h,e[33]=i,e[34]=H):H=e[34];const G=H;let B;e[35]!==r||e[36]!==G?(B=X.jsx(Is,{children:X.jsx(st.Provider,{value:G,children:r})}),e[35]=r,e[36]=G,e[37]=B):B=e[37];let m;return e[38]!==B||e[39]!==K?(m=X.jsx(Ee.Provider,{value:K,children:B}),e[38]=B,e[39]=K,e[40]=m):m=e[40],m}const bs=[];function tn(t){const e=O.c(5),{children:s}=t,{createTaskWithMessage:n}=nt();let r;e[0]!==n?(r={messages:bs,status:"ready",sendMessage:async i=>{n({message:tt(i)})},editQueuedMessage:$s,stop:Es,submit:As,removeLocalMessage:ws,isSendInFlight:Cs,error:null,clearError:xs,finishReason:null,runStatusStage:null,clearFinishReason:Ms,isStreaming:!1,isChatEmpty:!0,isWaitingForApprovals:!1,isRunInProgress:!1,hasMoreOlder:!1,isFetchingOlder:!1,fetchOlderMessages:ks},e[0]=n,e[1]=r):r=e[1];const a=r;let o;return e[2]!==s||e[3]!==a?(o=X.jsx(Ts,{value:a,children:s}),e[2]=s,e[3]=a,e[4]=o):o=e[4],o}async function ks(){}function Ms(){}function xs(){}function Cs(){return!1}function ws(){}async function As(){}function Es(){}async function $s(){return!1}function sn({taskId:t,children:e}){const s=we(),n=wt(),{virtualMcpId:r,activeTask:a,currentBranch:o}=nt(),i=Wt({isDesktopApp:n,harnessId:a?.harness_id}),u=s("chat.input.codingAgentRequiresDesktop");Ke.has(t)||(Ke.add(t),mt("chat_opened",{thread_id:t}));const{imageModel:f,webSearchModel:h,deepResearchModel:M,chatMode:w,setChatMode:d,appContexts:x,setTiptapDoc:N,simpleModeTier:q}=_s(),I=k.useContext(st);if(!I)throw new Error(s("chat.chatContext.activeTaskProviderMissingContext"));const{user:C,contextPrompt:j,preferences:U,rawNavigateToTask:P}=I,{org:A,locator:$}=Y(),J=ls(),[se,R]=k.useState(null),Q=()=>{R(new Error(u))},F=Kt(),V=Ne(),K=Mt(),H=Ge(),{openPanel:G}=gt(),B=At({connectionId:Et,orgId:A.id,orgSlug:A.slug}),m=xt(A.slug,t,{client:B});k.use(m.ready);const S=ue(m.messages),b=ue(m.status),L=ue(m.finishReason),z=ue(m.runStatusStage),ie=ue(m.hasMoreOlder),$e=ue(m.isFetchingOlder),D=k.useRef({onToolCall:F,queryClient:V,rawNavigateToTask:P,taskId:t,manager:K,navigate:H,openPanel:G,orgId:A.id,orgSlug:A.slug});D.current={onToolCall:F,queryClient:V,rawNavigateToTask:P,taskId:t,manager:K,navigate:H,openPanel:G,orgId:A.id,orgSlug:A.slug},Nt({orgSlug:A.slug,taskId:t,onTaskStatus:l=>{const p=D.current,c=l.data.message_id;if(l.data.status==="in_progress"&&c){De(p.taskId,c);const E=cs(p.taskId,c);E&&m.applyLocalMessage(E),ee(p.orgSlug,p.taskId)}rs(p.taskId)&&(async()=>(await ee(p.orgSlug,p.taskId),await m.reconcileFromServer()&&Ie(p.taskId).get().length===0&&as(p.taskId)))()}}),k.useEffect(()=>{const l={onData:y=>{if(y.type==="data-thread-title"){const T=y.data;if(!T?.title)return;const g=D.current;if(!g.taskId)return;g.manager.patchThread({id:g.taskId,title:T.title,updated_at:new Date().toISOString()});return}if(y.type==="data-deck-updated"){const T=y.data;if(!T?.path)return;const g=T.path,v=D.current;v.queryClient.invalidateQueries({queryKey:oe.orgFsStat(v.orgId,"home",g)}),v.queryClient.invalidateQueries({queryKey:oe.orgFsRecent(v.orgId)}),v.openPanel(ft(g));return}if(y.type==="data-open-preview"){const T=y.data,g=D.current,v=g.taskId;if(v){const le=g.manager.threads.get().find(W=>W.id===v);g.manager.patchThread({id:v,...T?.branch?{branch:T.branch}:{},metadata:{...le?.metadata??{},...T?.githubRepo?{githubRepo:T.githubRepo}:{},...T?.sandboxMap?{sandboxMap:T.sandboxMap}:{}}})}g.openPanel("preview");return}},onFinish:(y,T,g)=>{const v=D.current;v.taskId&&ee(v.orgSlug,v.taskId),v.taskId&&v.manager.patchThread({id:v.taskId,status:Lt(g,y.parts),updated_at:new Date().toISOString()});const le=y.parts?.some(_=>{const Se=_;return(Se.type==="tool-bash"||Se.type==="tool-write")&&Se.state==="output-available"});if(v.taskId&&le){const _=oe.threadOutputs(v.taskId);for(const Se of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{v.queryClient.invalidateQueries({queryKey:_})},Se)}v.queryClient.invalidateQueries({queryKey:oe.homeNextActions(v.orgSlug)});const W=y.metadata?.thread_id;W&&W!==v.taskId&&v.rawNavigateToTask(W)},onError:y=>{R(y),console.error("[chat] Error",y)},onToolCall:y=>D.current.onToolCall(y)};m.observer=l,ee(D.current.orgSlug,D.current.taskId);const p=y=>y==="submitted"||y==="streaming";let c=p(m.status.get().kind);const E=m.status.subscribe(()=>{const y=p(m.status.get().kind);if(y===c)return;c=y;const T=D.current;ee(T.orgSlug,T.taskId)});return()=>{m.observer===l&&(m.observer=null),E()}},[m]);const fe=b.kind==="submitted"||b.kind==="streaming",Le=S.length===0,ke=S.at(-1),_e=!fe&&ke?.role==="assistant"&&ke.parts.some(l=>"state"in l&&l.state==="approval-requested"),he=a,Me=(he?.status==="in_progress"||he?.status==="expired")&&b.kind==="ready"&&S.length>0;async function me(l){const p=t,c=r;if(i)return Q(),Z.delete(p),!1;const E=Object.entries(x),y=E.length>0?E.map(([W,_])=>`### App Context: ${W}
31
+ ${_}`).join(`
32
+
33
+ `):"",T=[j,y].filter(Boolean).join(`
34
+
35
+ `);let g=w;g==="gen-image"&&!f&&(g="default"),g==="web-search"&&!h&&(g="default"),g==="deep-research"&&!M&&(g="default"),(g==="web-search"||g==="deep-research")&&d("default");const v=Qt({thread:a?{harness_id:a.harness_id??null,branch:a.branch??null}:null,globals:{branch:o}});a?.harness_id||K.patchThread({id:p,harness_id:"decopilot",updated_at:new Date().toISOString()});const le={tier:q,mode:g,toolApprovalLevel:U.toolApprovalLevel??ht(),system:T||void 0,agent:{id:c},thread_id:p,...v};try{if(fe||Me){let W=!0;try{is(p,l),await m.enqueue(l,le),et(p,{workflowId:`thread-run:${p}:${l.id}`,messageId:l.id,text:zt(l.parts),hasAttachments:l.parts.some(_=>_.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),ns(p)}catch(_){W=!1,Ve(p,l.id),De(p,l.id),R(_ instanceof Error?_:new Error(String(_))),ae.error(_ instanceof Error?_.message:s("chat.chatContext.failedToQueueMessage"))}return ee(A.slug,p),W}return await m.submit({kind:"message",message:l},le),!0}finally{Z.delete(p)}}async function ge(l){const p=l.parts??Ze(l.tiptapDoc);if(p.length===0||Z.has(t))return;Z.add(t),R(null),N(void 0);const c={tiptapDoc:l.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:C?.image??void 0,name:C?.name??"you"}},E={id:crypto.randomUUID(),role:"user",parts:p,metadata:c};await me(E)}async function Pe(l,p){if(i)return Q(),!1;if(Z.has(t))return ae.info(s("chat.chatContext.stillSendingPreviousMessage")),!1;if(Z.add(t),!await J.cancel(t,l))return Z.delete(t),ae.error(s("chat.chatContext.couldNotRemoveOriginalMessage")),!1;Ve(t,l),m.removeLocalMessage(l);const E={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:p}],metadata:{created_at:new Date().toISOString(),user:{avatar:C?.image??void 0,name:C?.name??"you"}}};try{return await me(E)}catch(y){return ae.error(y instanceof Error?y.message:s("chat.chatContext.failedToSendEditedMessage")),!1}}const xe=async()=>{m.stop();try{const l=await fetch(`/api/${A.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(l.status===404)return;if(!l.ok){const p=await l.json().catch(()=>({}));throw new Error(p.message??s("chat.chatContext.cancelFailedStatus",{status:l.status}))}}catch(l){const p=l instanceof Error?l.message:s("chat.chatContext.failedToCancel");ae.error(p),console.error("[chat] cancelRun",l)}},ye=l=>ge(tt(l)),ce=Oe({strict:!1}).autosend===Ye;k.useEffect(()=>{if(!ce||S.length>0||i)return;const l=vt(sessionStorage,$,t);l&&ge(l.message).then(()=>{Tt(sessionStorage,$,t)})},[ce,S.length,i,$,t,ge]);const Re={messages:S,status:ys(b),sendMessage:ye,editQueuedMessage:Pe,stop:()=>{if(i){Q();return}xe()},submit:async(l,p)=>{if(i){Q();return}await m.submit(l,p)},removeLocalMessage:l=>m.removeLocalMessage(l),isSendInFlight:()=>Z.has(t),error:se,clearError:()=>R(null),finishReason:L,runStatusStage:z,clearFinishReason:()=>m.finishReason.set(null),isStreaming:fe,isChatEmpty:Le,isWaitingForApprovals:_e??!1,isRunInProgress:Me,hasMoreOlder:ie,isFetchingOlder:$e,fetchOlderMessages:m.fetchOlderMessages.bind(m)};return X.jsx(be.Provider,{value:Re,children:e})}function nn(){const t=we(),e=k.useContext(be);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function rn(){return k.useContext(be)}function nt(){const t=we(),e=k.useContext(Ee);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function _s(){const t=we(),e=k.useContext(Fe);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function an(){return k.useContext(Fe)}function Ps(){return k.useContext(Ee)}export{sn as A,Is as C,Zs as D,tn as T,nn as a,Ps as b,nt as c,Js as d,ls as e,Ve as f,Ce as g,ds as h,zs as i,fs as j,rn as k,Wt as l,en as m,Xs as n,Ze as o,ze as p,Hs as q,an as r,Ys as s,Gs as t,_s as u};
@@ -1 +1 @@
1
- import{c as n,n as d,j as c,cC as l,cD as m}from"./index-Ci8azyOE.js";import{i as b}from"./Check-D5PKBQ5I.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
1
+ import{c as n,n as d,j as c,cC as l,cD as m}from"./index-CLjikYNQ.js";import{i as b}from"./Check-BDN8Muvk.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
@@ -0,0 +1 @@
1
+ import{c as y,j as s,u as w,b as S,d as v,B as N,N as T,o as $,K as C,k as I}from"./index-CLjikYNQ.js";import{D as K}from"./use-destination-route-LJ6L5J-Z.js";import{A as k}from"./agent-icon-BP-KwHaL.js";import{R as A}from"./required-auth-layout-DCDe2_xo.js";import"./AlertCircle-6kr4ikYf.js";import"./UserSquare-DTquYbih.js";import"./Tool01-DdJ9Op9D.js";import"./ArrowUp-CKtNsAj6.js";import"./ArrowLeft-BYTdr7TC.js";import"./Tool02-Cci1ljWo.js";import"./XCircle-Bt06fa-N.js";import"./TrendUp01-DjAqcXI6.js";import"./ZapSquare-QIZwOk1q.js";import"./ZoomOut-CRoOiJyQ.js";import"./Users03--HC72Dnu.js";import"./CheckCircle-DOsHeqoz.js";import"./Check-BDN8Muvk.js";import"./ChevronDown-BKzrpWz6.js";import"./ChevronRight-CZUjBWvx.js";import"./ChevronSelectorVertical-B9yl_jmL.js";import"./ChevronUp-Cx4YaKpI.js";import"./DotsVertical-BS1CnjKI.js";import"./Stars02-DtPQwd-A.js";import"./Copy01-B4QULclv.js";import"./CreditCard01-wmoTErQt.js";import"./Download01-Bp0cW6L4.js";import"./Settings02-zD1WG3KJ.js";import"./Eye-B_dguG6W.js";import"./FilterLines-ukqPgKKN.js";import"./Share07-DjrlWb0X.js";import"./GitBranch01-CseJth04.js";import"./Globe01-xHaFaFqY.js";import"./Globe04-SMW2xMPb.js";import"./SwitchHorizontal01-_tALQVAI.js";import"./HardDrive-CGH6uKsY.js";import"./Image01-DI4UfHrT.js";import"./Key01-C2TuLSvm.js";import"./LinkExternal01-CWY5Wglm.js";import"./LockUnlocked01-lprGTBDa.js";import"./LogOut01-Dlhf6xnU.js";import"./Monitor01-RWlkxwpq.js";import"./Sun-DhJaKNHe.js";import"./Package-CbKjNbRP.js";import"./Palette-DHncO8u1.js";import"./Play-C2DKi7Gj.js";import"./Plus-CThYB9e6.js";import"./SearchLg-BCpOjc95.js";import"./SearchMd-C0j7yoGj.js";import"./Shield01-D6Z8uTMm.js";import"./Stars01-DD4L9WZm.js";import"./Trash01-BDD06UjB.js";import"./Upload01-Cp4C9dq6.js";import"./User01-Cteu9d2D.js";import"./Users01-BsM313st.js";import"./XClose-DM3y4DhR.js";import"./Zap-BIV9pRJO.js";async function F(t){const e=new URLSearchParams({site:t}),l=await fetch(`/api/_editor-resolve?${e.toString()}`,{headers:{Accept:"application/json"}});if(!l.ok){const r=new Error(`editor-resolve HTTP ${l.status}`);throw r.status=l.status,r}return await l.json()}function R(t){const e=t?.status;return typeof e=="number"&&e>=400&&e<500}function _(t){return{...t.pageId?{contentPageId:t.pageId}:{},...t.path?{contentPath:t.path}:{},...t.pathTemplate?{contentPathTemplate:t.pathTemplate}:{}}}function b(t){const e=y.c(2),{children:l}=t;let r;return e[0]!==l?(r=s.jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-background p-6",children:s.jsx("div",{className:"flex w-full max-w-md flex-col items-center gap-6 text-center",children:l})}),e[0]=l,e[1]=r):r=e[1],r}function P(){const t=y.c(5),e=S();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(I,{size:24,className:"animate-spin text-muted-foreground"}),t[0]=l):l=t[0];let r;t[1]!==e?(r=e("chooseEditor.resolving"),t[1]=e,t[2]=r):r=t[2];let i;return t[3]!==r?(i=s.jsxs(b,{children:[l,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),t[3]=r,t[4]=i):i=t[4],i}function E(t){const e=y.c(29),{titleKey:l,descriptionKey:r,onRetry:i}=t,n=S(),p=v();let m;e[0]!==n||e[1]!==l?(m=n(l),e[0]=n,e[1]=l,e[2]=m):m=e[2];let u;e[3]!==m?(u=s.jsx("h1",{className:"text-lg font-medium text-foreground",children:m}),e[3]=m,e[4]=u):u=e[4];let d;e[5]!==r||e[6]!==n?(d=n(r),e[5]=r,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==d?(a=s.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[8]=d,e[9]=a):a=e[9];let c;e[10]!==u||e[11]!==a?(c=s.jsxs("div",{className:"flex flex-col gap-2",children:[u,a]}),e[10]=u,e[11]=a,e[12]=c):c=e[12];let f;e[13]!==i||e[14]!==n?(f=i?s.jsx(N,{variant:"outline",onClick:i,children:n("chooseEditor.retry")}):null,e[13]=i,e[14]=n,e[15]=f):f=e[15];let o;e[16]!==p?(o=()=>p({to:"/"}),e[16]=p,e[17]=o):o=e[17];let g;e[18]!==n?(g=n("chooseEditor.backToStudio"),e[18]=n,e[19]=g):g=e[19];let j;e[20]!==o||e[21]!==g?(j=s.jsx(N,{onClick:o,children:g}),e[20]=o,e[21]=g,e[22]=j):j=e[22];let x;e[23]!==f||e[24]!==j?(x=s.jsxs("div",{className:"flex items-center gap-2",children:[f,j]}),e[23]=f,e[24]=j,e[25]=x):x=e[25];let h;return e[26]!==x||e[27]!==c?(h=s.jsxs(b,{children:[c,x]}),e[26]=x,e[27]=c,e[28]=h):h=e[28],h}function q(t){const e=y.c(6),{orgSlug:l,projectId:r,pageSearch:i}=t;let n;e[0]!==l||e[1]!==r?(n={org:l,project:r,panel:"content"},e[0]=l,e[1]=r,e[2]=n):n=e[2];let p;return e[3]!==i||e[4]!==n?(p=s.jsx(T,{to:K.agents,params:n,search:i,replace:!0}),e[3]=i,e[4]=n,e[5]=p):p=e[5],p}function D(t){const e=y.c(26),{matches:l,pageSearch:r}=t,i=S(),n=v();let p;e[0]!==n||e[1]!==r?(p=x=>{n({to:K.agents,params:{org:x.orgSlug,project:x.project.id,panel:"content"},search:r})},e[0]=n,e[1]=r,e[2]=p):p=e[2];const m=p;let u;e[3]!==i?(u=i("chooseEditor.chooser.title"),e[3]=i,e[4]=u):u=e[4];let d;e[5]!==u?(d=s.jsx("h1",{className:"text-lg font-medium text-foreground",children:u}),e[5]=u,e[6]=d):d=e[6];let a;e[7]!==i?(a=i("chooseEditor.chooser.subtitle"),e[7]=i,e[8]=a):a=e[8];let c;e[9]!==a?(c=s.jsx("p",{className:"text-sm text-muted-foreground",children:a}),e[9]=a,e[10]=c):c=e[10];let f;e[11]!==d||e[12]!==c?(f=s.jsxs("div",{className:"flex flex-col gap-2",children:[d,c]}),e[11]=d,e[12]=c,e[13]=f):f=e[13];let o;if(e[14]!==l||e[15]!==m||e[16]!==i){let x;e[18]!==m||e[19]!==i?(x=h=>s.jsxs("button",{type:"button",onClick:()=>m(h),"aria-label":i("chooseEditor.chooser.openAriaLabel",{title:h.project.title,org:h.orgName}),className:"flex w-full items-center gap-3 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-accent",children:[s.jsx(k,{icon:h.project.icon,name:h.project.title,size:"sm"}),s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:h.project.title}),s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:h.orgName})]})]},`${h.orgSlug}/${h.project.id}`),e[18]=m,e[19]=i,e[20]=x):x=e[20],o=l.map(x),e[14]=l,e[15]=m,e[16]=i,e[17]=o}else o=e[17];let g;e[21]!==o?(g=s.jsx("div",{className:"flex w-full flex-col gap-2",children:o}),e[21]=o,e[22]=g):g=e[22];let j;return e[23]!==f||e[24]!==g?(j=s.jsxs(b,{children:[f,g]}),e[23]=f,e[24]=g,e[25]=j):j=e[25],j}function L(){const t=y.c(24);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/choose-editor"},t[0]=e):e=t[0];const l=w(e);let r,i,n,p;t[1]!==l?(i=l.site?.trim()??"",r=_(l),p=$,n=C.editorResolve(i),t[1]=l,t[2]=r,t[3]=i,t[4]=n,t[5]=p):(r=t[2],i=t[3],n=t[4],p=t[5]);let m;t[6]!==i?(m=()=>F(i),t[6]=i,t[7]=m):m=t[7];const u=i.length>0;let d;t[8]!==n||t[9]!==m||t[10]!==u?(d={queryKey:n,queryFn:m,enabled:u,staleTime:1/0,retry:z},t[8]=n,t[9]=m,t[10]=u,t[11]=d):d=t[11];const a=p(d);if(!i){let o;return t[12]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(E,{titleKey:"chooseEditor.notFound.title",descriptionKey:"chooseEditor.notFound.description"}),t[12]=o):o=t[12],o}if(a.isError){let o;return t[13]!==a?(o=R(a.error)?s.jsx(E,{titleKey:"chooseEditor.notFound.title",descriptionKey:"chooseEditor.notFound.description"}):s.jsx(E,{titleKey:"chooseEditor.error.title",descriptionKey:"chooseEditor.error.description",onRetry:()=>a.refetch()}),t[13]=a,t[14]=o):o=t[14],o}if(!a.data){let o;return t[15]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(P,{}),t[15]=o):o=t[15],o}const{matches:c}=a.data;if(c.length===0){let o;return t[16]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(E,{titleKey:"chooseEditor.notFound.title",descriptionKey:"chooseEditor.notFound.description"}),t[16]=o):o=t[16],o}if(c.length===1&&c[0]){let o;return t[17]!==c[0].orgSlug||t[18]!==c[0].project.id||t[19]!==r?(o=s.jsx(q,{orgSlug:c[0].orgSlug,projectId:c[0].project.id,pageSearch:r}),t[17]=c[0].orgSlug,t[18]=c[0].project.id,t[19]=r,t[20]=o):o=t[20],o}let f;return t[21]!==c||t[22]!==r?(f=s.jsx(D,{matches:c,pageSearch:r}),t[21]=c,t[22]=r,t[23]=f):f=t[23],f}function z(t,e){return!R(e)&&t<2}function Ue(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(A,{children:s.jsx(L,{})}),t[0]=e):e=t[0],e}export{Ue as default};
@@ -1 +1 @@
1
- import{c as a,a as c,r as m,j as o}from"./index-Ci8azyOE.js";import{A as u}from"./auth-split-layout-D4SJJOXB.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
1
+ import{c as a,a as c,r as m,j as o}from"./index-CLjikYNQ.js";import{A as u}from"./auth-split-layout-7ElArbEj.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
@@ -0,0 +1 @@
1
+ import{c as F,j as t,B as K,k as oe,ak as Ge,an as ie,b as W,E as Ee,r as D,H as xe,cb as Xe,cc as Oe,aw as Ze,u as et,L as ee,aa as tt,ab as Se,a8 as ye,a9 as we,t as st,n as Ce,f as fe,cd as Re}from"./index-CLjikYNQ.js";import{E as Fe}from"./empty-state-BwGFcgil.js";import{u as he}from"./use-mcp-client-CBP30lcT.js";import{d as re,F as ot,a as ae,b as ce}from"./form-BCSheD7J.js";import{I as ue}from"./input-CXueSbIK.js";import{T as pe}from"./textarea-BJ4TussH.js";import{a as nt,b as lt,V as ge,O as it,M as rt}from"./index-lT44vadh.js";import{aJ as at,N as ct,aK as dt,ag as mt,ai as ut,aL as pt,o as Ie}from"./agent-icon-BP-KwHaL.js";import{g as xt,M as ft,a as Te}from"./types-Bkfd8ghD.js";import{A as ht,a as gt,b as jt}from"./alert-DbJERvKT.js";import{S as $e,a as Pe,b as ke,c as Ae,d as de}from"./select-CXWGcLoH.js";import{i as bt}from"./AlertCircle-6kr4ikYf.js";import{s as Nt}from"./Stars02-DtPQwd-A.js";import{a as vt}from"./Copy01-B4QULclv.js";import{i as St}from"./Play-C2DKi7Gj.js";import{B as Le,a as Me,b as Y,c as te,d as se,e as ze}from"./breadcrumb-CiqxRnKX.js";import{g as yt}from"./connection-slug-CITJ0kGN.js";import{u as wt,T as Ct}from"./use-mcp-auth-status-CpemSejR.js";import{a as Be,u as Ue}from"./use-connection--DbsGpk_.js";import{a as It}from"./use-mcp-tools-CZZL007X.js";import{M as Tt,c as $t}from"./monaco-editor-XKAgBzqM.js";import{I as De}from"./integration-icon-DkfgnaHN.js";import{k as Pt,r as kt}from"./chat-context-CsfU9qgh.js";import{u as At}from"./shell-layout-CCJOKrlB.js";import{n as Dt}from"./Tool02-Cci1ljWo.js";import"./constants-dLUUoWH7.js";import"./auth-BOUgLxto.js";import"./label-C9eYac1w.js";import"./Key01-C2TuLSvm.js";import"./extract-connection-data-CFLT8Lmm.js";import"./metadata-dUsYcpuu.js";import"./use-registry-connections-DHIJ1ozU.js";import"./use-organization-settings-C3jHLzD-.js";import"./task-board-D-kil0OD.js";import"./Plus-CThYB9e6.js";import"./index-D14IhaK9.js";import"./index-BuFIAUTC.js";import"./index-0Rjd7KPf.js";import"./popover-D4C_xunP.js";import"./use-virtual-mcp-Jrf_I5O6.js";import"./Check-BDN8Muvk.js";import"./SearchMd-C0j7yoGj.js";import"./Users03--HC72Dnu.js";import"./use-create-virtual-mcp-DfyGVwvi.js";import"./use-navigate-to-agent-DAh2yiE0.js";import"./use-destination-route-LJ6L5J-Z.js";import"./hooks-DYDXfqwA.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DK-jWfRH.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./UserSquare-DTquYbih.js";import"./Tool01-DdJ9Op9D.js";import"./ArrowUp-CKtNsAj6.js";import"./ArrowLeft-BYTdr7TC.js";import"./XCircle-Bt06fa-N.js";import"./TrendUp01-DjAqcXI6.js";import"./ZapSquare-QIZwOk1q.js";import"./ZoomOut-CRoOiJyQ.js";import"./CheckCircle-DOsHeqoz.js";import"./ChevronDown-BKzrpWz6.js";import"./ChevronRight-CZUjBWvx.js";import"./ChevronSelectorVertical-B9yl_jmL.js";import"./ChevronUp-Cx4YaKpI.js";import"./DotsVertical-BS1CnjKI.js";import"./CreditCard01-wmoTErQt.js";import"./Download01-Bp0cW6L4.js";import"./Settings02-zD1WG3KJ.js";import"./Eye-B_dguG6W.js";import"./FilterLines-ukqPgKKN.js";import"./Share07-DjrlWb0X.js";import"./GitBranch01-CseJth04.js";import"./Globe01-xHaFaFqY.js";import"./Globe04-SMW2xMPb.js";import"./SwitchHorizontal01-_tALQVAI.js";import"./HardDrive-CGH6uKsY.js";import"./Image01-DI4UfHrT.js";import"./LinkExternal01-CWY5Wglm.js";import"./LockUnlocked01-lprGTBDa.js";import"./LogOut01-Dlhf6xnU.js";import"./Monitor01-RWlkxwpq.js";import"./Sun-DhJaKNHe.js";import"./Package-CbKjNbRP.js";import"./Palette-DHncO8u1.js";import"./SearchLg-BCpOjc95.js";import"./Shield01-D6Z8uTMm.js";import"./Stars01-DD4L9WZm.js";import"./Trash01-BDD06UjB.js";import"./Upload01-Cp4C9dq6.js";import"./User01-Cteu9d2D.js";import"./Users01-BsM313st.js";import"./XClose-DM3y4DhR.js";import"./Zap-BIV9pRJO.js";import"./badge-CsGum4AP.js";import"./mcp-oauth-CUGdQwnE.js";import"./spinner-Kj9-kHS5.js";import"./editor-B9guvPGh.js";import"./use-panel-navigate-DHlMMTZi.js";import"./thread-route-Cmmo50Fe.js";import"./dialog-Buvp0_k_.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CG6Y0TAQ.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DXEJ77Cw.js";import"./avatar-D7Ryfmkc.js";import"./required-auth-layout-DCDe2_xo.js";import"./use-org-sso-5zd-6Usk.js";function Et(s){const e=F.c(15),{onSave:r,onUndo:o,isDirty:n,isSaving:l,saveLabel:a,undoLabel:u}=s,c=a===void 0?"Save":a,i=u===void 0?"Undo":u;if(!n)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(at,{size:14}),e[0]=x):x=e[0];let h;e[1]!==l||e[2]!==o||e[3]!==i?(h=t.jsxs(K,{variant:"outline",size:"sm",onClick:o,disabled:l,"aria-label":i,children:[x,i]}),e[1]=l,e[2]=o,e[3]=i,e[4]=h):h=e[4];let d;e[5]!==l?(d=l?t.jsx(oe,{size:14,className:"animate-spin"}):t.jsx(ct,{size:14}),e[5]=l,e[6]=d):d=e[6];let f;e[7]!==l||e[8]!==r||e[9]!==c||e[10]!==d?(f=t.jsxs(K,{variant:"default",size:"sm",onClick:r,disabled:l,"aria-label":c,children:[d,c]}),e[7]=l,e[8]=r,e[9]=c,e[10]=d,e[11]=f):f=e[11];let p;return e[12]!==h||e[13]!==f?(p=t.jsxs(t.Fragment,{children:[h,f]}),e[12]=h,e[13]=f,e[14]=p):p=e[14],p}Ge({title:ie().min(1),description:ie().nullable(),body:ie()});function me(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Ot(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Rt(s){const e=F.c(43),{form:r}=s,o=W();let n;e[0]!==o?(n=o("details.prompt.details"),e[0]=o,e[1]=n):n=e[1];let l;e[2]!==n?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:n}),e[2]=n,e[3]=l):l=e[3];let a;e[4]!==o?(a=w=>{const{field:N}=w;return t.jsxs(ae,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:o("details.prompt.title")}),t.jsx(ce,{children:t.jsx(ue,{...N,placeholder:o("details.prompt.titlePlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[4]=o,e[5]=a):a=e[5];let u;e[6]!==r.control||e[7]!==a?(u=t.jsx(re,{control:r.control,name:"title",render:a}),e[6]=r.control,e[7]=a,e[8]=u):u=e[8];let c;e[9]!==o?(c=w=>{const{field:N}=w;return t.jsxs(ae,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:o("details.prompt.description")}),t.jsx(ce,{children:t.jsx(ue,{...N,value:N.value??"",placeholder:o("details.prompt.descriptionPlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[9]=o,e[10]=c):c=e[10];let i;e[11]!==r.control||e[12]!==c?(i=t.jsx(re,{control:r.control,name:"description",render:c}),e[11]=r.control,e[12]=c,e[13]=i):i=e[13];let x;e[14]!==u||e[15]!==i?(x=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u,i]}),e[14]=u,e[15]=i,e[16]=x):x=e[16];let h;e[17]!==l||e[18]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-4",children:[l,x]}),e[17]=l,e[18]=x,e[19]=h):h=e[19];let d;e[20]!==o?(d=o("details.prompt.message"),e[20]=o,e[21]=d):d=e[21];let f;e[22]!==d?(f=t.jsx("div",{className:"text-sm font-medium text-foreground",children:d}),e[22]=d,e[23]=f):f=e[23];let p;e[24]!==o?(p=o("details.prompt.messageDescription"),e[24]=o,e[25]=p):p=e[25];let g;e[26]!==p?(g=t.jsx("div",{className:"text-xs text-muted-foreground",children:p}),e[26]=p,e[27]=g):g=e[27];let b;e[28]!==o?(b=w=>{const{field:N}=w;return t.jsx(ae,{children:t.jsx(ce,{children:t.jsx(pe,{...N,value:N.value??"",placeholder:o("details.prompt.bodyPlaceholder"),className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})},e[28]=o,e[29]=b):b=e[29];let S;e[30]!==r.control||e[31]!==b?(S=t.jsx(re,{control:r.control,name:"body",render:b}),e[30]=r.control,e[31]=b,e[32]=S):S=e[32];let $;e[33]!==f||e[34]!==g||e[35]!==S?($=t.jsxs("div",{className:"flex flex-col gap-2",children:[f,g,S]}),e[33]=f,e[34]=g,e[35]=S,e[36]=$):$=e[36];let y;e[37]!==$||e[38]!==h?(y=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[h,$]}),e[37]=$,e[38]=h,e[39]=y):y=e[39];let P;return e[40]!==r||e[41]!==y?(P=t.jsx(ot,{...r,children:y}),e[40]=r,e[41]=y,e[42]=P):P=e[42],P}function Ft(s){const e=F.c(42),{providerId:r,promptId:o}=s,n=W(),{org:l}=xe(),a=r||null;let u;e[0]!==l.id||e[1]!==l.slug||e[2]!==a?(u={connectionId:a,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=a,e[3]=u):u=e[3];const c=he(u),i=Xe(r,"PROMPT",o,c),x=Oe(r,"PROMPT",c),h=x.update.isPending;let d;e[4]!==i?(d=i?{title:i.title,description:i.description??null,body:me(i)}:void 0,e[4]=i,e[5]=d):d=e[5];let f;e[6]!==d?(f={values:d},e[6]=d,e[7]=f):f=e[7];const p=Ze(f);let g;e[8]!==p||e[9]!==i?(g=()=>{i&&p.reset({title:i.title,description:i.description??null,body:me(i)})},e[8]=p,e[9]=i,e[10]=g):g=e[10];const b=g;let S;e[11]!==x.update||e[12]!==p||e[13]!==o?(S=p.handleSubmit(async C=>{const I=await x.update.mutateAsync({id:o,data:{title:C.title,description:C.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:C.body}}]}});p.reset({title:I.title,description:I.description??null,body:me(I)})}),e[11]=x.update,e[12]=p,e[13]=o,e[14]=S):S=e[14];const $=S;if(!i){let C;e[15]!==n?(C=n("details.prompt.notFoundTitle"),e[15]=n,e[16]=C):C=e[16];let I;e[17]!==n?(I=n("details.prompt.notFoundDescription"),e[17]=n,e[18]=I):I=e[18];let O;return e[19]!==C||e[20]!==I?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Fe,{title:C,description:I})}),e[19]=C,e[20]=I,e[21]=O):O=e[21],O}let y;e[22]!==i.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[22]=i.title,e[23]=y):y=e[23];let P;e[24]!==i.description?(P=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[24]=i.description,e[25]=P):P=e[25];let w;e[26]!==y||e[27]!==P?(w=t.jsx(lt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,P]})}),e[26]=y,e[27]=P,e[28]=w):w=e[28];let N;e[29]!==$?(N=()=>{$()},e[29]=$,e[30]=N):N=e[30];let k;e[31]!==p.formState.isDirty||e[32]!==h||e[33]!==b||e[34]!==N?(k=t.jsx(nt,{children:t.jsx(Et,{onSave:N,onUndo:b,isDirty:p.formState.isDirty,isSaving:h})}),e[31]=p.formState.isDirty,e[32]=h,e[33]=b,e[34]=N,e[35]=k):k=e[35];let A;e[36]!==p?(A=t.jsx("div",{className:"h-full",children:t.jsx(Rt,{form:p})}),e[36]=p,e[37]=A):A=e[37];let E;return e[38]!==k||e[39]!==A||e[40]!==w?(E=t.jsxs(ge,{children:[w,k,A]}),e[38]=k,e[39]=A,e[40]=w,e[41]=E):E=e[41],E}function Lt(s){const e=F.c(10),{itemId:r}=s,o=W();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ot(),e[0]=n):n=e[0];const l=n;if(!l){let u;e[1]!==o?(u=o("details.prompt.notFoundTitle"),e[1]=o,e[2]=u):u=e[2];let c;e[3]!==o?(c=o("details.prompt.missingConnectionDescription"),e[3]=o,e[4]=c):c=e[4];let i;return e[5]!==u||e[6]!==c?(i=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Fe,{title:u,description:c})}),e[5]=u,e[6]=c,e[7]=i):i=e[7],i}let a;return e[8]!==r?(a=t.jsx(Ee,{children:t.jsx(D.Suspense,{fallback:null,children:t.jsx(Ft,{providerId:l,promptId:r})})}),e[8]=r,e[9]=a):a=e[9],a}const Mt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function zt(s){const e=F.c(12),{toolName:r,connectionId:o,siblings:n,onSelectInstance:l,onBack:a}=s,u=W();let c;e[0]!==o?(c={connectionId:o},e[0]=o,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let d;return e[2]!==i.supportsOAuth||e[3]!==a||e[4]!==u?(d=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(it,{onAuthenticate:()=>a(),buttonText:u("details.tool.goBackToAuthenticate")}):t.jsx(rt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=u,e[5]=d):d=e[5],d}const x=`${o}:${r}`;let h;return e[6]!==o||e[7]!==l||e[8]!==n||e[9]!==x||e[10]!==r?(h=t.jsx(Bt,{toolName:r,connectionId:o,siblings:n,onSelectInstance:l},x),e[6]=o,e[7]=l,e[8]=n,e[9]=x,e[10]=r,e[11]=h):h=e[11],h}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const n=W(),{replayId:l}=et({strict:!1}),a=(()=>{if(!l)return null;const m=`replay-${l}`,j=sessionStorage.getItem(m);if(!j)return null;sessionStorage.removeItem(m);try{return JSON.parse(j)}catch{return null}})(),u=(()=>{if(!a)return null;const m={};for(const[j,T]of Object.entries(a))T!==null&&typeof T=="object"?m[j]=JSON.stringify(T,null,2):m[j]=T;return m})(),[c,i]=D.useState(u??{}),[x,h]=D.useState(a?JSON.stringify(a,null,2):"{}"),[d,f]=D.useState(null),[p,g]=D.useState(null),[b,S]=D.useState(null),[$,y]=D.useState(null),[P,w]=D.useState(!1),[N,k]=D.useState(null),{org:A}=xe(),E=Be(e),C=Pt(),I=kt(),{openSidePanel:O}=At(),U=`${e}:${s}`,L=he({connectionId:e,orgId:A.id,orgSlug:A.slug}),V=It({client:L}),v=V.data?.tools?.find(m=>m.name===s),R=xt(v?._meta),J=m=>{if(!C)return;const j=$t(m.content);j.content.length>0&&(O(),C.sendMessage({tiptapDoc:j}))},[M,z]=D.useState("json"),[q,Q]=D.useState(!1);R&&!q&&(z("ui"),Q(!0));const _=v?.inputSchema?.properties,je=_?Object.keys(_):[],G=je.length>0,X={};if(G&&v?.inputSchema?.properties)for(const m of je)X[m]=v.inputSchema.required?.includes(m)?"":void 0;const ne=m=>Object.prototype.hasOwnProperty.call(c,m),Ve=async()=>{w(!0),y(null),f(null),g(null),S(null),k(null);const m=performance.now();try{if(!L)throw new Error("MCP client is not available");const j=G?{...X,...c}:(()=>{const B=x.trim();if(!B)return{};const H=JSON.parse(B);if(H&&typeof H=="object")return H;throw new Error("Raw JSON input must be an object.")})();G&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([B,H])=>{if((H.type==="object"||H.type==="array")&&typeof j[B]=="string")try{j[B]=JSON.parse(j[B])}catch{}else if((H.type==="number"||H.type==="integer")&&typeof j[B]=="string"&&j[B]!==""){const ve=Number(j[B]);Number.isNaN(ve)||(j[B]=ve)}});const T=await L.callTool({name:s,arguments:j}),Z=T.structuredContent??T,We=performance.now(),Qe=Math.round(We-m);f(Z),g(T),S(j);const Ye=JSON.stringify(Z),Ne=new TextEncoder().encode(Ye).length;k({duration:`${Qe}ms`,bytes:`${Ne} bytes`,tokens:`~${Math.ceil(Ne/4)} tokens`,cost:"$0.0000"})}catch(j){const T=j instanceof Error?j.message:String(j);y(T||"Unknown error occurred");const Z=performance.now();k({duration:`${Math.round(Z-m)}ms`})}finally{w(!1)}},le=(m,j)=>{i(T=>({...T,[m]:j}))},_e=()=>{f(null),g(null),S(null),y(null),k(null)},Je=v?.name??Mt(s),qe=t.jsx(Le,{children:t.jsxs(Me,{children:[t.jsx(Y,{children:t.jsx(te,{asChild:!0,children:t.jsx(ee,{to:"/$org/settings/connections",params:{org:A.slug},children:n("details.tool.connections")})})}),t.jsx(se,{}),E&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{children:t.jsx(te,{asChild:!0,children:t.jsx(ee,{to:"/$org/settings/connections/$appSlug",params:{org:A.slug,appSlug:yt(E)},search:{tab:"tools"},children:E.title})})}),t.jsx(se,{})]}),t.jsx(Y,{children:t.jsx(ze,{children:Je})})]})}),be=r.length>1&&t.jsxs($e,{value:e,onValueChange:o,children:[t.jsx(Pe,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ke,{})}),t.jsx(Ae,{children:r.map(m=>t.jsx(de,{value:m.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(De,{icon:m.icon,name:m.title,size:"xs",className:"shrink-0"}),m.title]})},m.id))})]}),He=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:n("details.tool.parameters")}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," ",n("details.tool.required")]})]}),t.jsx("div",{className:"space-y-4",children:G&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([m,j])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[m,v.inputSchema?.required?.includes(m)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:j.type})]}),j.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:j.description}),j.type==="object"||j.type==="array"?t.jsx(pe,{className:"font-mono text-xs",value:ne(m)?c[m]??"":X[m]??"",onChange:T=>le(m,T.target.value),placeholder:n("details.tool.enterAsJson",{key:m}),rows:3}):j.type==="boolean"?t.jsxs($e,{value:ne(m)?String(c[m]??""):"",onValueChange:T=>le(m,T==="true"),children:[t.jsx(Pe,{children:t.jsx(ke,{placeholder:n("details.tool.selectTrueOrFalse")})}),t.jsxs(Ae,{children:[t.jsx(de,{value:"true",children:"true"}),t.jsx(de,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ne(m)?c[m]??"":X[m]??"",onChange:T=>le(m,T.target.value),placeholder:n("details.tool.enter",{key:m})})]},m)):v?.inputSchema&&!G?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:n("details.tool.rawJsonInput")}),t.jsx(pe,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:m=>h(m.target.value),placeholder:n("details.tool.rawJsonExample")})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:n("details.tool.noParametersRequired")})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:P?t.jsxs(K,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:_e,children:[t.jsx(dt,{className:"h-3.5 w-3.5"}),n("details.tool.cancel")]}):t.jsxs(K,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ve,children:[t.jsx(St,{className:"h-3.5 w-3.5 fill-current"}),n("details.tool.executeTool")]})})]}),Ke=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:n("details.tool.result")}),t.jsxs("div",{className:"flex items-center gap-3",children:[N&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Nt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.duration})]}),N.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(mt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.tokens})]}),N.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ut,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.bytes})]}),N.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:N.cost})})]}),R&&t.jsx(tt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Se,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(K,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>z("ui"),children:t.jsx(pt,{size:14})})}),t.jsx(we,{children:n("details.tool.interactiveView")})]}),t.jsxs(Se,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(K,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>z("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(we,{children:n("details.tool.jsonView")})]})]})})]})]}),$&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(ht,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(bt,{className:"h-4 w-4"}),t.jsx(gt,{className:"mb-0",children:n("details.tool.executionFailed")})]}),t.jsx(jt,{className:"text-xs text-destructive",children:$})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:R&&M==="ui"&&L?t.jsx(D.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:n("details.tool.loadingApp")})]})}),children:t.jsx(ft,{resourceURI:R,toolInfo:v?{tool:v}:void 0,toolInput:b??void 0,toolResult:p??void 0,displayMode:"fullscreen",minHeight:Te.view.minHeight,maxHeight:Te.view.maxHeight,client:L,onMessage:J,onUpdateModelContext:m=>I?.setAppContext(U,m),onTeardown:()=>I?.clearAppContext(U),className:"h-full"})}):d?t.jsxs(t.Fragment,{children:[t.jsx(Tt,{code:JSON.stringify(d,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(K,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(d,null,2)),st.success(n("details.tool.copiedToClipboard"))},children:t.jsx(vt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(Ie,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:n("details.tool.runToolToSeeResults")})]})})]});return t.jsx(ge,{breadcrumb:qe,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(De,{icon:E?.icon||null,name:E?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[V.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):V.isLoading?t.jsx(oe,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:V.isSuccess?"ready":V.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:v?.annotations,_meta:v?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:be})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:n("details.tool.instance")}),be]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:He}),Ke]})})]})})}function Ut(s){const e=F.c(20),{itemId:r,siblings:o,onBack:n}=s,l=W(),[a,u]=D.useState(o[0]?.id??"");let c;e[0]!==a||e[1]!==o?(c=o.find(f=>f.id===a)?.id??o[0]?.id??"",e[0]=a,e[1]=o,e[2]=c):c=e[2];const i=c;if(!Be(i||void 0)||!i){let f;e[3]!==l?(f=l("details.tool.connectionNotFound"),e[3]=l,e[4]=f):f=e[4];let p;e[5]!==f?(p=t.jsx("h3",{className:"text-lg font-semibold",children:f}),e[5]=f,e[6]=p):p=e[6];let g;e[7]!==l?(g=l("details.tool.connectionNotFoundMessage"),e[7]=l,e[8]=g):g=e[8];let b;e[9]!==g?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[9]=g,e[10]=b):b=e[10];let S;return e[11]!==p||e[12]!==b?(S=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p,b]})}),e[11]=p,e[12]=b,e[13]=S):S=e[13],S}let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[14]=h):h=e[14];let d;return e[15]!==i||e[16]!==n||e[17]!==o||e[18]!==r?(d=t.jsx(D.Suspense,{fallback:h,children:t.jsx(zt,{toolName:r,connectionId:i,siblings:o,onSelectInstance:u,onBack:n})}),e[15]=i,e[16]=n,e[17]=o,e[18]=r,e[19]=d):d=e[19],d}function Vt(s){const e=F.c(21),{icon:r,illustration:o,title:n,description:l,buttonProps:a,buttonComponent:u,className:c,children:i}=s;let x;e[0]!==c?(x=Ce("flex flex-col items-center justify-center py-16 text-center",c),e[0]=c,e[1]=x):x=e[1];let h;e[2]!==r||e[3]!==o?(h=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=h):h=e[4];let d;e[5]!==n?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:n}),e[5]=n,e[6]=d):d=e[6];let f;e[7]!==l?(f=l&&t.jsx("div",{className:"text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=f):f=e[8];let p;e[9]!==d||e[10]!==f?(p=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[d,f]}),e[9]=d,e[10]=f,e[11]=p):p=e[11];let g;e[12]!==u||e[13]!==a?(g=(u??a)&&t.jsx("div",{className:"mt-4",children:u??(a&&t.jsx(K,{size:"sm",className:Ce(a?.className),...a}))}),e[12]=u,e[13]=a,e[14]=g):g=e[14];let b;return e[15]!==i||e[16]!==x||e[17]!==h||e[18]!==p||e[19]!==g?(b=t.jsxs("div",{className:x,children:[h,p,g,i]}),e[15]=i,e[16]=x,e[17]=h,e[18]=p,e[19]=g,e[20]=b):b=e[20],b}const _t={prompt:Lt};function Jt(){const s=F.c(9),e=Re();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=fe(r),n=decodeURIComponent(o.itemId);let l;s[1]!==o.appSlug?(l={slug:o.appSlug},s[1]=o.appSlug,s[2]=l):l=s[2];const a=Ue(l);let u;s[3]!==e.history?(u=()=>{e.history.back()},s[3]=e.history,s[4]=u):u=s[4];const c=u,i=qt;let x;return s[5]!==c||s[6]!==n||s[7]!==a?(x=t.jsx(Ut,{itemId:n,siblings:a,onBack:c,onUpdate:i}),s[5]=c,s[6]=n,s[7]=a,s[8]=x):x=s[8],x}async function qt(s){return Promise.resolve()}function Ht(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=F.c(52),e=Re();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=fe(r),n=W(),l=decodeURIComponent(o.collectionName),a=decodeURIComponent(o.itemId);let u;s[1]!==e.history?(u=()=>{e.history.back()},s[1]=e.history,s[2]=u):u=s[2];const c=u,{org:i}=xe();let x;s[3]!==o.appSlug?(x={slug:o.appSlug},s[3]=o.appSlug,s[4]=x):x=s[4];const d=Ue(x)[0]??null,f=d?.id??"",p=f||"no-connection",g=f??null;let b;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(b={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=b):b=s[8];const S=he(b),$=Oe(p,l,S);let y;s[9]!==$||s[10]!==a?(y=async _=>{a&&await $.update.mutateAsync({id:a,data:_})},s[9]=$,s[10]=a,s[11]=y):y=s[11];const P=y;let w;s[12]!==l?(w=l?.toLowerCase(),s[12]=l,s[13]=w):w=s[13];const N=w,k=N&&_t[N];let A;s[14]!==l?(A=Ht(l),s[14]=l,s[15]=A):A=s[15];const E=A;let C;s[16]!==i.slug?(C=t.jsx(Y,{children:t.jsx(te,{asChild:!0,children:t.jsx(ee,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=C):C=s[17];let I;s[18]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(se,{}),s[18]=I):I=s[18];let O;s[19]!==l||s[20]!==d||s[21]!==i.slug||s[22]!==o.appSlug?(O=d&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{children:t.jsx(te,{asChild:!0,children:t.jsx(ee,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:o.appSlug},search:{tab:l},children:d.title})})}),t.jsx(se,{})]}),s[19]=l,s[20]=d,s[21]=i.slug,s[22]=o.appSlug,s[23]=O):O=s[23];let U;s[24]!==E?(U=t.jsx(Y,{children:t.jsx(ze,{children:E})}),s[24]=E,s[25]=U):U=s[25];let L;s[26]!==O||s[27]!==U||s[28]!==C?(L=t.jsx(Le,{children:t.jsxs(Me,{children:[C,I,O,U]})}),s[26]=O,s[27]=U,s[28]=C,s[29]=L):L=s[29];const V=L;if(k){let _;return s[30]!==k||s[31]!==c||s[32]!==P||s[33]!==a?(_=t.jsx(k,{itemId:a,onBack:c,onUpdate:P}),s[30]=k,s[31]=c,s[32]=P,s[33]=a,s[34]=_):_=s[34],_}let v;s[35]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Dt,{size:36,className:"text-muted-foreground"}),s[35]=v):v=s[35];let R;s[36]!==n?(R=n("orgs.collectionDetail.noComponentDefinedTitle"),s[36]=n,s[37]=R):R=s[37];let J;s[38]!==n?(J=n("orgs.collectionDetail.noComponentDefinedDescription"),s[38]=n,s[39]=J):J=s[39];let M;s[40]!==n?(M=n("orgs.collectionDetail.goBackButton"),s[40]=n,s[41]=M):M=s[41];let z;s[42]!==c||s[43]!==M?(z={onClick:c,children:M},s[42]=c,s[43]=M,s[44]=z):z=s[44];let q;s[45]!==R||s[46]!==J||s[47]!==z?(q=t.jsx(Vt,{icon:v,title:R,description:J,buttonProps:z}),s[45]=R,s[46]=J,s[47]=z,s[48]=q):q=s[48];let Q;return s[49]!==V||s[50]!==q?(Q=t.jsx(ge,{breadcrumb:V,children:q}),s[49]=V,s[50]=q,s[51]=Q):Q=s[51],Q}function Wt(){const s=F.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=fe(e);if(decodeURIComponent(r.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Jt,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Kt,{}),s[2]=l):l=s[2],l}function Yo(){const s=F.c(7),e=W();let r;s[0]!==e?(r=e("orgs.collectionDetail.loadingAriaLabel"),s[0]=e,s[1]=r):r=s[1];let o;s[2]!==r?(o=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground","aria-label":r})}),s[2]=r,s[3]=o):o=s[3];let n;s[4]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Wt,{}),s[4]=n):n=s[4];let l;return s[5]!==o?(l=t.jsx(Ee,{children:t.jsx(D.Suspense,{fallback:o,children:n})}),s[5]=o,s[6]=l):l=s[6],l}export{Yo as default};
@@ -1 +1 @@
1
- import{c as $,b as A,j as s,n as z,a8 as E,B as F,a9 as L,aa as O,ab as R}from"./index-Ci8azyOE.js";import{a as S,D as _,b as I,c as K}from"./dropdown-menu-wKA_-hY5.js";import{i as P,n as W}from"./ArrowUp-CVoISkQ4.js";import{i as V}from"./Check-D5PKBQ5I.js";import{a as q,i as G,c as H}from"./SwitchHorizontal01-CSyGO1HX.js";import{V as J}from"./view-mode-toggle-CcmqoSVC.js";import{B as Q}from"./badge-DX3_GQsO.js";function ie(t){const e=$.c(36),{viewMode:l,onViewModeChange:f,sortKey:M,sortDirection:h,onSort:g,sortOptions:j,filters:b}=t;let v;e[0]!==j?(v=j===void 0?[]:j,e[0]=j,e[1]=v):v=e[1];const N=v;let w;e[2]!==b?(w=b===void 0?[]:b,e[2]=b,e[3]=w):w=e[3];const r=w,i=A();let C;e[4]!==r?(C=r.filter(X),e[4]=r,e[5]=C):C=e[5];const y=C.length;let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(q,{size:16}),e[6]=k):k=e[6];let o;e[7]!==y?(o=y>0&&s.jsx(Q,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:y}),e[7]=y,e[8]=o):o=e[8];let n;e[9]!==o?(n=s.jsx(E,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(F,{variant:"outline",size:"icon",className:"relative",children:[k,o]})})}),e[9]=o,e[10]=n):n=e[10];let a;e[11]!==i?(a=i("collections.collectionDisplayButton.displayAndFilters"),e[11]=i,e[12]=a):a=e[12];let c;e[13]!==a?(c=s.jsx(L,{children:a}),e[13]=a,e[14]=c):c=e[14];let d;e[15]!==c||e[16]!==n?(d=s.jsx(O,{children:s.jsxs(R,{children:[n,c]})}),e[15]=c,e[16]=n,e[17]=d):d=e[17];let x;e[18]!==f||e[19]!==l?(x=f&&l&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(J,{value:l,onValueChange:f,fullWidth:!0,options:[{value:"table",icon:s.jsx(G,{})},{value:"cards",icon:s.jsx(H,{})}]})}),e[18]=f,e[19]=l,e[20]=x):x=e[20];let m;e[21]!==g||e[22]!==h||e[23]!==M||e[24]!==N||e[25]!==i?(m=N.length>0&&g&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:i("collections.collectionDisplayButton.sortBy")}),N.map(B=>{const T=M===B.id;return s.jsx(S,{onClick:()=>g(B.id),className:z("h-8 px-2 py-0 cursor-pointer",T&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[T&&s.jsx(V,{size:16,className:"text-foreground shrink-0"}),!T&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:B.label}),T&&h&&(h==="asc"?s.jsx(P,{size:16,className:"text-foreground shrink-0"}):s.jsx(W,{size:16,className:"text-foreground shrink-0"}))]})},B.id)})]}),e[21]=g,e[22]=h,e[23]=M,e[24]=N,e[25]=i,e[26]=m):m=e[26];let p;e[27]!==r?(p=r.map(U),e[27]=r,e[28]=p):p=e[28];let u;e[29]!==x||e[30]!==m||e[31]!==p?(u=s.jsxs(I,{align:"end",className:"w-[200px] p-0 gap-0",children:[x,m,p]}),e[29]=x,e[30]=m,e[31]=p,e[32]=u):u=e[32];let D;return e[33]!==d||e[34]!==u?(D=s.jsxs(K,{children:[d,u]}),e[33]=d,e[34]=u,e[35]=D):D=e[35],D}function U(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const l=t.value===e.id;return s.jsx(S,{onClick:()=>t.onChange(e.id),className:z("h-8 px-2 py-0 cursor-pointer",l&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[l&&s.jsx(V,{size:16,className:"text-foreground shrink-0"}),!l&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function X(t){return t.value!=="ALL"}export{ie as C};
1
+ import{c as $,b as A,j as s,n as z,a8 as E,B as F,a9 as L,aa as O,ab as R}from"./index-CLjikYNQ.js";import{a as S,D as _,b as I,c as K}from"./dropdown-menu-BVX76X1t.js";import{i as P,n as W}from"./ArrowUp-CKtNsAj6.js";import{i as V}from"./Check-BDN8Muvk.js";import{a as q,i as G,c as H}from"./SwitchHorizontal01-_tALQVAI.js";import{V as J}from"./view-mode-toggle-DdfOH72I.js";import{B as Q}from"./badge-CsGum4AP.js";function ie(t){const e=$.c(36),{viewMode:l,onViewModeChange:f,sortKey:M,sortDirection:h,onSort:g,sortOptions:j,filters:b}=t;let v;e[0]!==j?(v=j===void 0?[]:j,e[0]=j,e[1]=v):v=e[1];const N=v;let w;e[2]!==b?(w=b===void 0?[]:b,e[2]=b,e[3]=w):w=e[3];const r=w,i=A();let C;e[4]!==r?(C=r.filter(X),e[4]=r,e[5]=C):C=e[5];const y=C.length;let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(q,{size:16}),e[6]=k):k=e[6];let o;e[7]!==y?(o=y>0&&s.jsx(Q,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:y}),e[7]=y,e[8]=o):o=e[8];let n;e[9]!==o?(n=s.jsx(E,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(F,{variant:"outline",size:"icon",className:"relative",children:[k,o]})})}),e[9]=o,e[10]=n):n=e[10];let a;e[11]!==i?(a=i("collections.collectionDisplayButton.displayAndFilters"),e[11]=i,e[12]=a):a=e[12];let c;e[13]!==a?(c=s.jsx(L,{children:a}),e[13]=a,e[14]=c):c=e[14];let d;e[15]!==c||e[16]!==n?(d=s.jsx(O,{children:s.jsxs(R,{children:[n,c]})}),e[15]=c,e[16]=n,e[17]=d):d=e[17];let x;e[18]!==f||e[19]!==l?(x=f&&l&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(J,{value:l,onValueChange:f,fullWidth:!0,options:[{value:"table",icon:s.jsx(G,{})},{value:"cards",icon:s.jsx(H,{})}]})}),e[18]=f,e[19]=l,e[20]=x):x=e[20];let m;e[21]!==g||e[22]!==h||e[23]!==M||e[24]!==N||e[25]!==i?(m=N.length>0&&g&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:i("collections.collectionDisplayButton.sortBy")}),N.map(B=>{const T=M===B.id;return s.jsx(S,{onClick:()=>g(B.id),className:z("h-8 px-2 py-0 cursor-pointer",T&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[T&&s.jsx(V,{size:16,className:"text-foreground shrink-0"}),!T&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:B.label}),T&&h&&(h==="asc"?s.jsx(P,{size:16,className:"text-foreground shrink-0"}):s.jsx(W,{size:16,className:"text-foreground shrink-0"}))]})},B.id)})]}),e[21]=g,e[22]=h,e[23]=M,e[24]=N,e[25]=i,e[26]=m):m=e[26];let p;e[27]!==r?(p=r.map(U),e[27]=r,e[28]=p):p=e[28];let u;e[29]!==x||e[30]!==m||e[31]!==p?(u=s.jsxs(I,{align:"end",className:"w-[200px] p-0 gap-0",children:[x,m,p]}),e[29]=x,e[30]=m,e[31]=p,e[32]=u):u=e[32];let D;return e[33]!==d||e[34]!==u?(D=s.jsxs(K,{children:[d,u]}),e[33]=d,e[34]=u,e[35]=D):D=e[35],D}function U(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const l=t.value===e.id;return s.jsx(S,{onClick:()=>t.onChange(e.id),className:z("h-8 px-2 py-0 cursor-pointer",l&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[l&&s.jsx(V,{size:16,className:"text-foreground shrink-0"}),!l&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function X(t){return t.value!=="ALL"}export{ie as C};
@@ -1 +1 @@
1
- import{c as k,n as b,j as a,k as v}from"./index-Ci8azyOE.js";import{i as w}from"./SearchMd-ClTH3fiN.js";function S(j){const e=k.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(v,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(w,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
1
+ import{c as k,n as b,j as a,k as v}from"./index-CLjikYNQ.js";import{i as w}from"./SearchMd-C0j7yoGj.js";function S(j){const e=k.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(v,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(w,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
@@ -1 +1 @@
1
- import{c as k,j as r,n as C,b as S}from"./index-Ci8azyOE.js";import{d as R,e as H,a as T,T as I,b as W,c as z}from"./table-oIbRw7Yk.js";import{i as D,n as E}from"./ArrowUp-CVoISkQ4.js";function K(y){const e=k.c(29),{columns:l,data:f,sortKey:u,sortDirection:x,onSort:c,onRowClick:a,rowClassName:d}=y;let p;e[0]!==x?(p=function(s,h){return r.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?r.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):r.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=function(s,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return s===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=o):o=e[2];const g=o;let t;if(e[3]!==l||e[4]!==c||e[5]!==b||e[6]!==u){let i;e[8]!==l.length||e[9]!==c||e[10]!==b||e[11]!==u?(i=(s,h)=>{const N=u===s.id;return r.jsx(R,{className:C(g(h,l.length),"group transition-colors select-none",s.sortable&&"hover:bg-accent cursor-pointer",s.rowClassName,s.cellClassName),onClick:s.sortable&&c?()=>c(s.id):void 0,children:r.jsxs("span",{className:"flex items-center gap-1",children:[s.header,s.sortable&&b(s.id,N)]})},s.id)},e[8]=l.length,e[9]=c,e[10]=b,e[11]=u,e[12]=i):i=e[12],t=l.map(i),e[3]=l,e[4]=c,e[5]=b,e[6]=u,e[7]=t}else t=e[7];let n;e[13]!==t?(n=r.jsx(H,{className:"border-b-0",children:r.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:t})}),e[13]=t,e[14]=n):n=e[14];let j;if(e[15]!==l||e[16]!==f||e[17]!==a||e[18]!==d){let i;e[20]!==l||e[21]!==a||e[22]!==d?(i=(s,h)=>{const N=d?.(s);return r.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",a?"cursor-pointer":"",N),onClick:a?()=>a(s):void 0,children:l.map(m=>r.jsx(I,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:r.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(s):m.accessor?m.accessor(s):null})},m.id))},h)},e[20]=l,e[21]=a,e[22]=d,e[23]=i):i=e[23],j=f.map(i),e[15]=l,e[16]=f,e[17]=a,e[18]=d,e[19]=j}else j=e[19];let w;e[24]!==j?(w=r.jsx(W,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==n||e[27]!==w?(v=r.jsxs(z,{className:"w-full border-collapse",children:[n,w]}),e[26]=n,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(16),{columns:l,data:f,isLoading:u,sortKey:x,sortDirection:c,onSort:a,onRowClick:d,emptyState:p}=y,b=u===void 0?!1:u,o=S();if(b){let t;e[0]!==o?(t=o("collections.collectionTableWrapper.loading"),e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx("div",{className:"text-muted-foreground",children:t})}),e[2]=t,e[3]=n):n=e[3],n}if(f.length===0){let t;e[4]!==p||e[5]!==o?(t=p||r.jsx("div",{className:"text-center py-12 text-muted-foreground",children:o("collections.collectionTableWrapper.noItemsFound")}),e[4]=p,e[5]=o,e[6]=t):t=e[6];let n;return e[7]!==t?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:t}),e[7]=t,e[8]=n):n=e[8],n}let g;return e[9]!==l||e[10]!==f||e[11]!==d||e[12]!==a||e[13]!==c||e[14]!==x?(g=r.jsx("div",{className:"flex-1",children:r.jsx(K,{columns:l,data:f,sortKey:x,sortDirection:c,onSort:a,onRowClick:d})}),e[9]=l,e[10]=f,e[11]=d,e[12]=a,e[13]=c,e[14]=x,e[15]=g):g=e[15],g}export{B as C};
1
+ import{c as k,j as r,n as C,b as S}from"./index-CLjikYNQ.js";import{d as R,e as H,a as T,T as I,b as W,c as z}from"./table-Dvpenn5X.js";import{i as D,n as E}from"./ArrowUp-CKtNsAj6.js";function K(y){const e=k.c(29),{columns:l,data:f,sortKey:u,sortDirection:x,onSort:c,onRowClick:a,rowClassName:d}=y;let p;e[0]!==x?(p=function(s,h){return r.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?r.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):r.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=function(s,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return s===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=o):o=e[2];const g=o;let t;if(e[3]!==l||e[4]!==c||e[5]!==b||e[6]!==u){let i;e[8]!==l.length||e[9]!==c||e[10]!==b||e[11]!==u?(i=(s,h)=>{const N=u===s.id;return r.jsx(R,{className:C(g(h,l.length),"group transition-colors select-none",s.sortable&&"hover:bg-accent cursor-pointer",s.rowClassName,s.cellClassName),onClick:s.sortable&&c?()=>c(s.id):void 0,children:r.jsxs("span",{className:"flex items-center gap-1",children:[s.header,s.sortable&&b(s.id,N)]})},s.id)},e[8]=l.length,e[9]=c,e[10]=b,e[11]=u,e[12]=i):i=e[12],t=l.map(i),e[3]=l,e[4]=c,e[5]=b,e[6]=u,e[7]=t}else t=e[7];let n;e[13]!==t?(n=r.jsx(H,{className:"border-b-0",children:r.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:t})}),e[13]=t,e[14]=n):n=e[14];let j;if(e[15]!==l||e[16]!==f||e[17]!==a||e[18]!==d){let i;e[20]!==l||e[21]!==a||e[22]!==d?(i=(s,h)=>{const N=d?.(s);return r.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",a?"cursor-pointer":"",N),onClick:a?()=>a(s):void 0,children:l.map(m=>r.jsx(I,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:r.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(s):m.accessor?m.accessor(s):null})},m.id))},h)},e[20]=l,e[21]=a,e[22]=d,e[23]=i):i=e[23],j=f.map(i),e[15]=l,e[16]=f,e[17]=a,e[18]=d,e[19]=j}else j=e[19];let w;e[24]!==j?(w=r.jsx(W,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==n||e[27]!==w?(v=r.jsxs(z,{className:"w-full border-collapse",children:[n,w]}),e[26]=n,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(16),{columns:l,data:f,isLoading:u,sortKey:x,sortDirection:c,onSort:a,onRowClick:d,emptyState:p}=y,b=u===void 0?!1:u,o=S();if(b){let t;e[0]!==o?(t=o("collections.collectionTableWrapper.loading"),e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx("div",{className:"text-muted-foreground",children:t})}),e[2]=t,e[3]=n):n=e[3],n}if(f.length===0){let t;e[4]!==p||e[5]!==o?(t=p||r.jsx("div",{className:"text-center py-12 text-muted-foreground",children:o("collections.collectionTableWrapper.noItemsFound")}),e[4]=p,e[5]=o,e[6]=t):t=e[6];let n;return e[7]!==t?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:t}),e[7]=t,e[8]=n):n=e[8],n}let g;return e[9]!==l||e[10]!==f||e[11]!==d||e[12]!==a||e[13]!==c||e[14]!==x?(g=r.jsx("div",{className:"flex-1",children:r.jsx(K,{columns:l,data:f,sortKey:x,sortDirection:c,onSort:a,onRowClick:d})}),e[9]=l,e[10]=f,e[11]=d,e[12]=a,e[13]=c,e[14]=x,e[15]=g):g=e[15],g}export{B as C};
@@ -1 +1 @@
1
- import{c as f,n as u,j as m}from"./index-Ci8azyOE.js";import{B as g}from"./badge-DX3_GQsO.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{c as f,n as u,j as m}from"./index-CLjikYNQ.js";import{B as g}from"./badge-CsGum4AP.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{c as d,n as i,j as n}from"./index-Ci8azyOE.js";import{_ as m}from"./index-BYBf2qjQ.js";import{e as N,b as j,h as b,a as w,d as y}from"./dialog-BI8UUwqv.js";import{i as C}from"./SearchMd-ClTH3fiN.js";function $(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function z(a){const e=d.c(26);let t,s,o,l,r,h;e[0]!==a?({title:r,description:h,children:t,className:s,filter:o,...l}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r,e[6]=h):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5],h=e[6]);const v=r===void 0?"Command Palette":r,k=h===void 0?"Search for a command to run...":h;let c;e[7]!==v?(c=n.jsx(j,{children:v}),e[7]=v,e[8]=c):c=e[8];let p;e[9]!==k?(p=n.jsx(b,{children:k}),e[9]=k,e[10]=p):p=e[10];let u;e[11]!==c||e[12]!==p?(u=n.jsxs(w,{className:"sr-only",children:[c,p]}),e[11]=c,e[12]=p,e[13]=u):u=e[13];let f;e[14]!==s?(f=i("overflow-hidden p-0",s),e[14]=s,e[15]=f):f=e[15];let x;e[16]!==t||e[17]!==o?(x=n.jsx($,{filter:o,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[16]=t,e[17]=o,e[18]=x):x=e[18];let g;e[19]!==f||e[20]!==x?(g=n.jsx(y,{className:f,closeButtonClassName:"hidden",children:x}),e[19]=f,e[20]=x,e[21]=g):g=e[21];let _;return e[22]!==l||e[23]!==u||e[24]!==g?(_=n.jsxs(N,{...l,children:[u,g]}),e[22]=l,e[23]=u,e[24]=g,e[25]=_):_=e[25],_}function G(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(C,{className:"size-4 shrink-0 text-muted-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function L(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function R(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"text-muted-foreground px-4 py-4 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function P(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{G as C,R as a,P as b,B as c,L as d,$ as e,z as f,H as g};
1
+ import{c as d,n as i,j as n}from"./index-CLjikYNQ.js";import{_ as m}from"./index-0Rjd7KPf.js";import{e as N,b as j,h as b,a as w,d as y}from"./dialog-Buvp0_k_.js";import{i as C}from"./SearchMd-C0j7yoGj.js";function $(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function z(a){const e=d.c(26);let t,s,o,l,r,h;e[0]!==a?({title:r,description:h,children:t,className:s,filter:o,...l}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r,e[6]=h):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5],h=e[6]);const v=r===void 0?"Command Palette":r,k=h===void 0?"Search for a command to run...":h;let c;e[7]!==v?(c=n.jsx(j,{children:v}),e[7]=v,e[8]=c):c=e[8];let p;e[9]!==k?(p=n.jsx(b,{children:k}),e[9]=k,e[10]=p):p=e[10];let u;e[11]!==c||e[12]!==p?(u=n.jsxs(w,{className:"sr-only",children:[c,p]}),e[11]=c,e[12]=p,e[13]=u):u=e[13];let f;e[14]!==s?(f=i("overflow-hidden p-0",s),e[14]=s,e[15]=f):f=e[15];let x;e[16]!==t||e[17]!==o?(x=n.jsx($,{filter:o,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[16]=t,e[17]=o,e[18]=x):x=e[18];let g;e[19]!==f||e[20]!==x?(g=n.jsx(y,{className:f,closeButtonClassName:"hidden",children:x}),e[19]=f,e[20]=x,e[21]=g):g=e[21];let _;return e[22]!==l||e[23]!==u||e[24]!==g?(_=n.jsxs(N,{...l,children:[u,g]}),e[22]=l,e[23]=u,e[24]=g,e[25]=_):_=e[25],_}function G(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(C,{className:"size-4 shrink-0 text-muted-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function L(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function R(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"text-muted-foreground px-4 py-4 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function P(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{G as C,R as a,P as b,B as c,L as d,$ as e,z as f,H as g};
@@ -0,0 +1 @@
1
+ import{c as N,b as Q,j as r,n as Me,q as ue,s as st,B as Ne,u as Xe,r as Y,a as Ae,v as nt,d as lt,w as at,e as Ze,x as Ee,y as Se,Q as ct,E as mt,K as Be,z as He,N as dt}from"./index-CLjikYNQ.js";import{L as ut,s as Te,S as We,C as qe,i as gt,n as Re,a as et,p as Le}from"./self-tool-result-BQSdlPPl.js";import{A as ft}from"./auth-entry-RdTo0a7D.js";import{A as pt}from"./auth-split-layout-7ElArbEj.js";import{O as Ve}from"./organization-choice-CRwp5frt.js";import{r as ht}from"./track-BsrCovp4.js";import{I as bt}from"./input-CXueSbIK.js";import{D as xt,a as Ke,b as yt,c as Ct}from"./dropdown-menu-BVX76X1t.js";import{u as jt}from"./use-mcp-client-CBP30lcT.js";import{S as Ot,W as vt,g as St,a as _t}from"./constants-dLUUoWH7.js";import{i as wt}from"./XCircle-Bt06fa-N.js";import{t as Qe}from"./site-error--i37Vnuw.js";import"./alert-dialog-DBIqwB_a.js";import"./form-BCSheD7J.js";import"./label-C9eYac1w.js";import"./spinner-Kj9-kHS5.js";import"./integration-icon-DkfgnaHN.js";import"./Tool02-Cci1ljWo.js";import"./agent-icon-BP-KwHaL.js";import"./AlertCircle-6kr4ikYf.js";import"./UserSquare-DTquYbih.js";import"./Tool01-DdJ9Op9D.js";import"./ArrowUp-CKtNsAj6.js";import"./ArrowLeft-BYTdr7TC.js";import"./TrendUp01-DjAqcXI6.js";import"./ZapSquare-QIZwOk1q.js";import"./ZoomOut-CRoOiJyQ.js";import"./Users03--HC72Dnu.js";import"./CheckCircle-DOsHeqoz.js";import"./Check-BDN8Muvk.js";import"./ChevronDown-BKzrpWz6.js";import"./ChevronRight-CZUjBWvx.js";import"./ChevronSelectorVertical-B9yl_jmL.js";import"./ChevronUp-Cx4YaKpI.js";import"./DotsVertical-BS1CnjKI.js";import"./Stars02-DtPQwd-A.js";import"./Copy01-B4QULclv.js";import"./CreditCard01-wmoTErQt.js";import"./Download01-Bp0cW6L4.js";import"./Settings02-zD1WG3KJ.js";import"./Eye-B_dguG6W.js";import"./FilterLines-ukqPgKKN.js";import"./Share07-DjrlWb0X.js";import"./GitBranch01-CseJth04.js";import"./Globe01-xHaFaFqY.js";import"./Globe04-SMW2xMPb.js";import"./SwitchHorizontal01-_tALQVAI.js";import"./HardDrive-CGH6uKsY.js";import"./Image01-DI4UfHrT.js";import"./Key01-C2TuLSvm.js";import"./LinkExternal01-CWY5Wglm.js";import"./LockUnlocked01-lprGTBDa.js";import"./LogOut01-Dlhf6xnU.js";import"./Monitor01-RWlkxwpq.js";import"./Sun-DhJaKNHe.js";import"./Package-CbKjNbRP.js";import"./Palette-DHncO8u1.js";import"./Play-C2DKi7Gj.js";import"./Plus-CThYB9e6.js";import"./SearchLg-BCpOjc95.js";import"./SearchMd-C0j7yoGj.js";import"./Shield01-D6Z8uTMm.js";import"./Stars01-DD4L9WZm.js";import"./Trash01-BDD06UjB.js";import"./Upload01-Cp4C9dq6.js";import"./User01-Cteu9d2D.js";import"./Users01-BsM313st.js";import"./XClose-DM3y4DhR.js";import"./Zap-BIV9pRJO.js";import"./dialog-Buvp0_k_.js";import"./extract-connection-data-CFLT8Lmm.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-0mjAJnh9.js";import"./authenticate-and-persist-oauth-CSyB4Ikq.js";import"./mcp-oauth-CUGdQwnE.js";import"./auth-BOUgLxto.js";import"./use-is-desktop-app-BNujXJc_.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-D7Ryfmkc.js";const Ge={"pt-BR":"https://decocms.com/agendar",en:"https://www.decocms.com/en/schedule"},Ye=["https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200","https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png","https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png"],Nt="var(--brand-green-dark)";function De({siteUrl:t,email:e,locale:s}){const i=(s&&Ge[s])??Ge["pt-BR"]??"https://decocms.com/agendar",o=new URL(i);return t&&o.searchParams.set("siteUrl",t),e&&o.searchParams.set("email",e),o.toString()}function Et(t){const e=N.c(15),{href:s,size:i,className:o,orgId:l}=t,a=i===void 0?"lg":i,n=Q();let c;e[0]!==o?(c=Me("w-full",o),e[0]=o,e[1]=c):c=e[1];let m;e[2]!==l?(m=()=>ue("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:l}),e[2]=l,e[3]=m):m=e[3];let d;e[4]!==n?(d=n("routes.commerceOnboarding.scheduleMeeting.scheduleButton"),e[4]=n,e[5]=d):d=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx(st,{size:16}),e[6]=u):u=e[6];let f;e[7]!==s||e[8]!==m||e[9]!==d?(f=r.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",onClick:m,children:[d,u]}),e[7]=s,e[8]=m,e[9]=d,e[10]=f):f=e[10];let p;return e[11]!==a||e[12]!==c||e[13]!==f?(p=r.jsx(Ne,{asChild:!0,variant:"outline",size:a,className:c,children:f}),e[11]=a,e[12]=c,e[13]=f,e[14]=p):p=e[14],p}function Ut(t){const e=N.c(13),{size:s}=t,i=s===void 0?72:s,o=Q();let l;e[0]!==o?(l=o("routes.commerceOnboarding.scheduleMeeting.expertAlt"),e[0]=o,e[1]=l):l=e[1];const a=l;let n;e[2]!==i?(n=Math.round(i*.3),e[2]=i,e[3]=n):n=e[3];const c=n;let m;e[4]!==i?(m={height:i},e[4]=i,e[5]=m):m=e[5];let d;e[6]!==a||e[7]!==c||e[8]!==i?(d=Ye.map((f,p)=>r.jsxs("div",{className:"relative shrink-0",style:{width:i,height:i,marginLeft:p===0?0:-c,zIndex:Ye.length-p},children:[r.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:r.jsx("img",{src:f,alt:a,className:"h-full w-full object-cover",loading:"lazy"})}),p===0&&r.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[r.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),r.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},f)),e[6]=a,e[7]=c,e[8]=i,e[9]=d):d=e[9];let u;return e[10]!==m||e[11]!==d?(u=r.jsx("div",{className:"flex items-end",style:m,children:d}),e[10]=m,e[11]=d,e[12]=u):u=e[12],u}function Fe(t){const e=N.c(19),{href:s,orgId:i}=t,o=Q();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("div",{className:"h-20",style:{backgroundColor:Nt}}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"-mt-9 mb-4",children:r.jsx(Ut,{})}),e[1]=a):a=e[1];let n;e[2]!==o?(n=o("routes.commerceOnboarding.scheduleMeeting.headline"),e[2]=o,e[3]=n):n=e[3];let c;e[4]!==n?(c=r.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:n}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==o?(m=o("routes.commerceOnboarding.scheduleMeeting.body"),e[6]=o,e[7]=m):m=e[7];let d;e[8]!==m?(d=r.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:m}),e[8]=m,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=r.jsxs("div",{className:"grid gap-1.5",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let f;e[13]!==s||e[14]!==i?(f=r.jsx(Et,{href:s,size:"lg",className:"mt-6",orgId:i}),e[13]=s,e[14]=i,e[15]=f):f=e[15];let p;return e[16]!==u||e[17]!==f?(p=r.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:r.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[l,r.jsxs("div",{className:"px-8 pb-8",children:[a,u,f]})]})}),e[16]=u,e[17]=f,e[18]=p):p=e[18],p}function tt(t){const e=N.c(10),{host:s}=t,i=`https://www.google.com/s2/favicons?domain=${s}&sz=128`;let o,l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),l=r.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),a=r.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=l,e[2]=a):(o=e[0],l=e[1],a=e[2]);let n;e[3]!==i?(n=r.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:r.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=n):n=e[4];let c;e[5]!==s?(c=r.jsx("span",{className:"text-lg font-medium text-foreground",children:s}),e[5]=s,e[6]=c):c=e[6];let m;return e[7]!==n||e[8]!==c?(m=r.jsxs("div",{className:"flex items-center gap-3",children:[o,l,a,n,c]}),e[7]=n,e[8]=c,e[9]=m):m=e[9],m}function $e(t){const e=N.c(5),{variant:s}=t,i=Q();let o;e[0]!==i||e[1]!==s?(o=i(s==="workspace"?"routes.commerceOnboarding.loading.preparingWorkspace":"routes.commerceOnboarding.loading.preparing"),e[0]=i,e[1]=s,e[2]=o):o=e[2];const l=o;let a;return e[3]!==l?(a=r.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:r.jsx(ut,{label:l,className:"text-muted-foreground"})}),e[3]=l,e[4]=a):a=e[4],a}function br(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(Lt,{}),t[0]=e):e=t[0],e}const ot=Y.createContext(null),rt=()=>Y.useContext(ot);function It(){const t=N.c(22),[e,s]=Ee(),i=e.language==="pt-BR"?"PT-BR":"EN";let o;t[0]!==i?(o=r.jsx(xt,{asChild:!0,children:r.jsx("button",{className:"text-sm font-medium text-foreground/70 hover:text-foreground transition-colors",type:"button",children:i})}),t[0]=i,t[1]=o):o=t[1];let l;t[2]!==s?(l=()=>{s(zt)},t[2]=s,t[3]=l):l=t[3];const a=e.language==="en"&&"bg-accent";let n;t[4]!==a?(n=Me(a),t[4]=a,t[5]=n):n=t[5];let c;t[6]!==l||t[7]!==n?(c=r.jsx(Ke,{onClick:l,className:n,children:"English"}),t[6]=l,t[7]=n,t[8]=c):c=t[8];let m;t[9]!==s?(m=()=>{s(Pt)},t[9]=s,t[10]=m):m=t[10];const d=e.language==="pt-BR"&&"bg-accent";let u;t[11]!==d?(u=Me(d),t[11]=d,t[12]=u):u=t[12];let f;t[13]!==m||t[14]!==u?(f=r.jsx(Ke,{onClick:m,className:u,children:"Português (Brasil)"}),t[13]=m,t[14]=u,t[15]=f):f=t[15];let p;t[16]!==c||t[17]!==f?(p=r.jsxs(yt,{align:"end",children:[c,f]}),t[16]=c,t[17]=f,t[18]=p):p=t[18];let O;return t[19]!==o||t[20]!==p?(O=r.jsxs(Ct,{children:[o,p]}),t[19]=o,t[20]=p,t[21]=O):O=t[21],O}function Pt(t){return{...t,language:"pt-BR"}}function zt(t){return{...t,language:"en"}}function H(t){const e=N.c(17);let s,i,o;e[0]!==t?({visual:o,children:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/commerce-onboarding"},e[4]=l):l=e[4];const a=Xe(l),{data:n}=Ae.useSession(),[c]=Ee(),m=n?.user?.email;let d;e[5]!==c.language||e[6]!==a.siteUrl||e[7]!==m?(d=De({siteUrl:a.siteUrl,email:m,locale:c.language}),e[5]=c.language,e[6]=a.siteUrl,e[7]=m,e[8]=d):d=e[8];const u=d;let f;e[9]!==u||e[10]!==o?(f=o??r.jsx(Fe,{href:u}),e[9]=u,e[10]=o,e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsxs("div",{className:"flex justify-between items-start mb-8",children:[r.jsx("div",{}),r.jsx(It,{})]}),e[12]=p):p=e[12];let O;return e[13]!==s||e[14]!==i||e[15]!==f?(O=r.jsxs(pt,{...i,visual:f,children:[p,s]}),e[13]=s,e[14]=i,e[15]=f,e[16]=O):O=e[16],O}function Rt(t){return{signUpFailed:t("routes.commerceOnboarding.authCopy.signUpFailed"),signInFailed:t("routes.commerceOnboarding.authCopy.signInFailed"),authenticationFailed:t("routes.commerceOnboarding.authCopy.authenticationFailed"),resetEmailFailed:t("routes.commerceOnboarding.authCopy.resetEmailFailed"),otpSendFailed:t("routes.commerceOnboarding.authCopy.otpSendFailed"),invalidCode:t("routes.commerceOnboarding.authCopy.invalidCode"),invalidEmail:t("routes.commerceOnboarding.authCopy.invalidEmail"),invalidEmailOrPassword:t("routes.commerceOnboarding.authCopy.invalidEmailOrPassword"),accountExists:t("routes.commerceOnboarding.authCopy.accountExists"),networkError:t("routes.commerceOnboarding.authCopy.networkError"),tooManyAttempts:t("routes.commerceOnboarding.authCopy.tooManyAttempts"),invalidOrExpiredCode:t("routes.commerceOnboarding.authCopy.invalidOrExpiredCode"),genericError:t("routes.commerceOnboarding.authCopy.genericError"),resetPasswordTitle:t("routes.commerceOnboarding.authCopy.resetPasswordTitle"),verificationCodeTitle:t("routes.commerceOnboarding.authCopy.verificationCodeTitle"),welcomeTitle:t("routes.commerceOnboarding.authCopy.welcomeTitle"),resetPasswordSubtitle:t("routes.commerceOnboarding.authCopy.resetPasswordSubtitle"),codeSentTo:e=>t("routes.commerceOnboarding.authCopy.codeSentTo",{email:e}),defaultSubtitle:t("routes.commerceOnboarding.authCopy.defaultSubtitle"),resetEmailSent:t("routes.commerceOnboarding.authCopy.resetEmailSent"),continueWith:e=>t("routes.commerceOnboarding.authCopy.continueWith",{provider:e}),divider:t("routes.commerceOnboarding.authCopy.divider"),emailLabel:t("routes.commerceOnboarding.authCopy.emailLabel"),emailPlaceholder:t("routes.commerceOnboarding.authCopy.emailPlaceholder"),sending:t("routes.commerceOnboarding.authCopy.sending"),sendCode:t("routes.commerceOnboarding.authCopy.sendCode"),verificationCodeLabel:t("routes.commerceOnboarding.authCopy.verificationCodeLabel"),enterCodePlaceholder:t("routes.commerceOnboarding.authCopy.enterCodePlaceholder"),verifying:t("routes.commerceOnboarding.authCopy.verifying"),verify:t("routes.commerceOnboarding.authCopy.verify"),useDifferentEmail:t("routes.commerceOnboarding.authCopy.useDifferentEmail"),sendResetLink:t("routes.commerceOnboarding.authCopy.sendResetLink"),nameLabel:t("routes.commerceOnboarding.authCopy.nameLabel"),namePlaceholder:t("routes.commerceOnboarding.authCopy.namePlaceholder"),passwordLabel:t("routes.commerceOnboarding.authCopy.passwordLabel"),forgotPassword:t("routes.commerceOnboarding.authCopy.forgotPassword"),creatingAccount:t("routes.commerceOnboarding.authCopy.creatingAccount"),signingIn:t("routes.commerceOnboarding.authCopy.signingIn"),continue:t("routes.commerceOnboarding.authCopy.continue"),backToSignIn:t("routes.commerceOnboarding.authCopy.backToSignIn"),signInWithPassword:t("routes.commerceOnboarding.authCopy.signInWithPassword"),alreadyHaveAccount:t("routes.commerceOnboarding.authCopy.alreadyHaveAccount"),dontHaveAccount:t("routes.commerceOnboarding.authCopy.dontHaveAccount"),signIn:t("routes.commerceOnboarding.authCopy.signIn"),signUp:t("routes.commerceOnboarding.authCopy.signUp"),signInWithEmailCode:t("routes.commerceOnboarding.authCopy.signInWithEmailCode")}}let Je=!1;function Lt(){const t=Xe({from:"/commerce-onboarding"}),{org:e,siteUrl:s}=t,i=Te(s);if(!Je&&nt()){Je=!0;const o=ht(window.location.search);ue("commerce_onboarding_viewed",{site_url:s,domain:i??void 0,...o,...i?{$set:{last_scanned_domain:i}}:{}})}return r.jsx(ot.Provider,{value:i,children:r.jsx(kt,{requestedOrgSlug:e,siteUrl:s})})}function kt(t){const e=N.c(14),{requestedOrgSlug:s,siteUrl:i}=t,o=Q(),{data:l,isPending:a}=Ae.useSession(),n=rt();if(a){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(H,{children:r.jsx($e,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!l){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==o?(d=o("routes.commerceOnboarding.unlockDiagnostic"),e[1]=o,e[2]=d):d=e[2];let u;e[3]!==n?(u=n?r.jsx(tt,{host:n}):void 0,e[3]=n,e[4]=u):u=e[4];let f;e[5]!==o?(f=Rt(o),e[5]=o,e[6]=f):f=e[6];let p;return e[7]!==d||e[8]!==u||e[9]!==f?(p=r.jsx(H,{children:r.jsx(ft,{callbackUrl:m,allowAutoLogin:!1,title:d,subtitle:null,brand:u,copy:f})}),e[7]=d,e[8]=u,e[9]=f,e[10]=p):p=e[10],p}let c;return e[11]!==s||e[12]!==i?(c=r.jsx(Mt,{requestedOrgSlug:s,siteUrl:i}),e[11]=s,e[12]=i,e[13]=c):c=e[13],c}function Mt(t){const e=N.c(121),{requestedOrgSlug:s,siteUrl:i}=t,o=Q(),l=lt(),a=at(),[n,c]=Y.useState(null),[m,d]=Y.useState(null),[u,f]=Y.useState(!1),p=a.data?.map(At)??[];let O;e[0]===Symbol.for("react.memo_cache_sentinel")?(O={mutationFn:Tt,retry:!1,onSuccess:g=>{d(g)}},e[0]=O):O=e[0];const v=Ze(O);if(a.isPending){let g;return e[1]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(H,{children:r.jsx($e,{variant:"workspace"})}),e[1]=g):g=e[1],g}if(a.error){let g;e[2]!==o?(g=o("routes.commerceOnboarding.couldNotLoadOrgs"),e[2]=o,e[3]=g):g=e[3];let h;e[4]!==o?(h=o("routes.commerceOnboarding.retryToConfigureCommerce"),e[4]=o,e[5]=h):h=e[5];let x;e[6]!==o?(x=o("routes.commerceOnboarding.retryAgain"),e[6]=o,e[7]=x):x=e[7];let b;e[8]!==a?(b=()=>a.refetch(),e[8]=a,e[9]=b):b=e[9];let _;return e[10]!==g||e[11]!==h||e[12]!==x||e[13]!==b?(_=r.jsx(_e,{title:g,description:h,actionLabel:x,onRetry:b}),e[10]=g,e[11]=h,e[12]=x,e[13]=b,e[14]=_):_=e[14],_}const w=s?p.find(g=>g.slug===s):null;if(w){let g;return e[15]!==w||e[16]!==i?(g=r.jsx(ve,{org:w,initialSiteUrl:i}),e[15]=w,e[16]=i,e[17]=g):g=e[17],g}if(s){let g;e[18]!==o?(g=o("routes.commerceOnboarding.orgNotFound"),e[18]=o,e[19]=g):g=e[19];let h;e[20]!==o?(h=o("routes.commerceOnboarding.couldNotFindOrg"),e[20]=o,e[21]=h):h=e[21];let x;e[22]!==o?(x=o("routes.commerceOnboarding.retryAgain"),e[22]=o,e[23]=x):x=e[23];let b;e[24]!==a?(b=()=>a.refetch(),e[24]=a,e[25]=b):b=e[25];let _;return e[26]!==g||e[27]!==h||e[28]!==x||e[29]!==b?(_=r.jsx(_e,{title:g,description:h,actionLabel:x,onRetry:b}),e[26]=g,e[27]=h,e[28]=x,e[29]=b,e[30]=_):_=e[30],_}if(n){let g;return e[31]!==n||e[32]!==i?(g=r.jsx(ve,{org:n,initialSiteUrl:i}),e[31]=n,e[32]=i,e[33]=g):g=e[33],g}if(p.length===1&&p[0]){let g;return e[34]!==p[0]||e[35]!==i?(g=r.jsx(ve,{org:p[0],initialSiteUrl:i}),e[34]=p[0],e[35]=i,e[36]=g):g=e[36],g}if(p.length>1){let g;e[37]!==o?(g=o("routes.commerceOnboarding.chooseOrg"),e[37]=o,e[38]=g):g=e[38];let h;e[39]!==o?(h=o("routes.commerceOnboarding.selectWhereCommerceContinues"),e[39]=o,e[40]=h):h=e[40];let x;e[41]!==g||e[42]!==h?(x=r.jsx(J,{title:g,description:h}),e[41]=g,e[42]=h,e[43]=x):x=e[43];let b;e[44]!==o?(b=o("routes.commerceOnboarding.authCopy.continue"),e[44]=o,e[45]=b):b=e[45];let _;e[46]!==l||e[47]!==i?(_=j=>l({to:"/commerce-onboarding",search:{org:j.slug,siteUrl:i}}),e[46]=l,e[47]=i,e[48]=_):_=e[48];let M;e[49]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!0),e[49]=M):M=e[49];let R;e[50]!==o?(R=o("routes.commerceOnboarding.createNewOrg"),e[50]=o,e[51]=R):R=e[51];let z;e[52]!==p||e[53]!==b||e[54]!==_||e[55]!==R?(z=r.jsx(We,{className:"-mx-1 -my-1 max-h-[60vh] overflow-y-auto px-1 py-1",children:r.jsx(Ve,{organizations:p,selectLabel:b,onSelected:_,onCreateNew:M,createNewLabel:R})}),e[52]=p,e[53]=b,e[54]=_,e[55]=R,e[56]=z):z=e[56];let U;e[57]!==x||e[58]!==z?(U=r.jsxs("div",{className:"grid gap-10",children:[x,z]}),e[57]=x,e[58]=z,e[59]=U):U=e[59];let T;e[60]!==l||e[61]!==i?(T=j=>{Se(),l({to:"/commerce-onboarding",search:{org:j,siteUrl:i}})},e[60]=l,e[61]=i,e[62]=T):T=e[62];let I;e[63]!==u||e[64]!==T?(I=r.jsx(qe,{open:u,onOpenChange:f,onCreated:T}),e[63]=u,e[64]=T,e[65]=I):I=e[65];let L;return e[66]!==U||e[67]!==I?(L=r.jsxs(H,{children:[U,I]}),e[66]=U,e[67]=I,e[68]=L):L=e[68],L}if(!m){let g;e[69]!==v?(g=()=>{v.reset(),v.mutate()},e[69]=v,e[70]=g):g=e[70];let h;return e[71]!==v||e[72]!==g?(h=r.jsx(Dt,{mutation:v,onRetry:g}),e[71]=v,e[72]=g,e[73]=h):h=e[73],h}const C=m;if(C?.success&&(C.status==="created"||C.status==="joined"||C.status==="already_has_organization")&&C.organization){let g;return e[74]!==C.organization||e[75]!==i?(g=r.jsx(ve,{org:C.organization,initialSiteUrl:i}),e[74]=C.organization,e[75]=i,e[76]=g):g=e[76],g}if(C?.status==="ambiguous"&&C.organizations&&C.organizations.length>0){let g;e[77]!==o?(g=o("routes.commerceOnboarding.chooseOrg"),e[77]=o,e[78]=g):g=e[78];let h;e[79]!==o?(h=o("routes.commerceOnboarding.emailAccessMultipleOrgs"),e[79]=o,e[80]=h):h=e[80];let x;e[81]!==g||e[82]!==h?(x=r.jsx(J,{title:g,description:h}),e[81]=g,e[82]=h,e[83]=x):x=e[83];const b=C.organizations,_=C.domain??void 0;let M;e[84]!==l||e[85]!==i?(M=(X,Z)=>{Se(),c({...X,slug:Z}),l({to:"/commerce-onboarding",search:{org:Z,siteUrl:i}})},e[84]=l,e[85]=i,e[86]=M):M=e[86];let R;e[87]===Symbol.for("react.memo_cache_sentinel")?(R=()=>f(!0),e[87]=R):R=e[87];let z;e[88]!==o?(z=o("routes.commerceOnboarding.createNewOrg"),e[88]=o,e[89]=z):z=e[89];let U;e[90]!==C.organizations||e[91]!==_||e[92]!==M||e[93]!==z?(U=r.jsx(We,{className:"-mx-1 -my-1 max-h-[60vh] overflow-y-auto px-1 py-1",children:r.jsx(Ve,{organizations:b,domain:_,onJoined:M,onCreateNew:R,createNewLabel:z})}),e[90]=C.organizations,e[91]=_,e[92]=M,e[93]=z,e[94]=U):U=e[94];let T;e[95]!==U||e[96]!==x?(T=r.jsxs("div",{className:"grid gap-10",children:[x,U]}),e[95]=U,e[96]=x,e[97]=T):T=e[97];let I;e[98]!==l||e[99]!==i?(I=X=>{Se(),l({to:"/commerce-onboarding",search:{org:X,siteUrl:i}})},e[98]=l,e[99]=i,e[100]=I):I=e[100];let L;e[101]!==u||e[102]!==I?(L=r.jsx(qe,{open:u,onOpenChange:f,onCreated:I}),e[101]=u,e[102]=I,e[103]=L):L=e[103];let j;return e[104]!==T||e[105]!==L?(j=r.jsxs(H,{children:[T,L]}),e[104]=T,e[105]=L,e[106]=j):j=e[106],j}let P;e[107]!==o?(P=o("routes.commerceOnboarding.onboardingNeedsSupport"),e[107]=o,e[108]=P):P=e[108];let E;e[109]!==C?.error||e[110]!==o?(E=C?.error??o("routes.commerceOnboarding.couldNotDetermineOrg"),e[109]=C?.error,e[110]=o,e[111]=E):E=e[111];let A;e[112]!==o?(A=o("routes.commerceOnboarding.retryAgain"),e[112]=o,e[113]=A):A=e[113];let W;e[114]!==v?(W=()=>{d(null),v.reset()},e[114]=v,e[115]=W):W=e[115];let q;return e[116]!==P||e[117]!==E||e[118]!==A||e[119]!==W?(q=r.jsx(_e,{title:P,description:E,actionLabel:A,onRetry:W}),e[116]=P,e[117]=E,e[118]=A,e[119]=W,e[120]=q):q=e[120],q}async function Tt(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Se(),e}function At(t){return{id:t.id,name:t.name,slug:t.slug,logo:t.logo??null}}function Dt(t){const e=N.c(16),{mutation:s,onRetry:i}=t,o=Q(),l=Y.useRef(!1);let a;e[0]!==s?(a=d=>{!d||l.current||(l.current=!0,s.mutate())},e[0]=s,e[1]=a):a=e[1];const n=a;if(s.error){let d;e[2]!==o?(d=o("routes.commerceOnboarding.onboardingUnavailable"),e[2]=o,e[3]=d):d=e[3];let u;e[4]!==o?(u=o("routes.commerceOnboarding.couldNotPrepareOrg"),e[4]=o,e[5]=u):u=e[5];let f;e[6]!==o?(f=o("routes.commerceOnboarding.retryAgain"),e[6]=o,e[7]=f):f=e[7];let p;return e[8]!==i||e[9]!==d||e[10]!==u||e[11]!==f?(p=r.jsx(_e,{title:d,description:u,actionLabel:f,onRetry:i}),e[8]=i,e[9]=d,e[10]=u,e[11]=f,e[12]=p):p=e[12],p}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx($e,{variant:"generic"}),e[13]=c):c=e[13];let m;return e[14]!==n?(m=r.jsx(H,{children:r.jsx("div",{ref:n,children:c})}),e[14]=n,e[15]=m):m=e[15],m}function J(t){const e=N.c(8),{title:s,description:i}=t,o=rt();let l;e[0]!==o?(l=o?r.jsx(tt,{host:o}):r.jsxs("div",{children:[r.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),r.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==i||e[3]!==s?(a=(s||i)&&r.jsxs("div",{className:"space-y-2",children:[s&&r.jsx("h1",{className:"text-2xl font-medium leading-8",children:s}),i&&r.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=s,e[4]=a):a=e[4];let n;return e[5]!==l||e[6]!==a?(n=r.jsxs("div",{className:"grid gap-10",children:[l,a]}),e[5]=l,e[6]=a,e[7]=n):n=e[7],n}function _e(t){const e=N.c(9),{title:s,description:i,actionLabel:o,onRetry:l}=t;let a;e[0]!==i||e[1]!==s?(a=r.jsx(J,{title:s,description:i}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let n;e[3]!==o||e[4]!==l?(n=r.jsx(Ne,{type:"button",size:"xl",className:"w-full",onClick:l,children:o}),e[3]=o,e[4]=l,e[5]=n):n=e[5];let c;return e[6]!==a||e[7]!==n?(c=r.jsx(H,{children:r.jsxs("div",{className:"grid gap-10",children:[a,n]})}),e[6]=a,e[7]=n,e[8]=c):c=e[8],c}function ve(t){const e=N.c(13),{org:s,initialSiteUrl:i}=t,o=Q(),{data:l}=Ae.useSession(),[a]=Ee(),n=l?.user?.email;let c;e[0]!==i||e[1]!==a.language||e[2]!==n?(c=De({siteUrl:i,email:n,locale:a.language}),e[0]=i,e[1]=a.language,e[2]=n,e[3]=c):c=e[3];const m=c;let d;e[4]!==m||e[5]!==s.id?(d=r.jsx(Fe,{href:m,orgId:s.id}),e[4]=m,e[5]=s.id,e[6]=d):d=e[6];const u=d;let f;return e[7]!==i||e[8]!==u||e[9]!==s||e[10]!==l?.user?.email||e[11]!==o?(f=r.jsx(ct,{children:p=>{const{reset:O}=p;return r.jsx(mt,{fallback:v=>{const{error:w,resetError:C}=v;return r.jsx(H,{visual:u,children:r.jsx(Ft,{orgName:s.name,message:w instanceof Error?w.message:o("routes.commerceOnboarding.couldNotVerifyCommerceSetting"),onRetry:()=>{O(),C()}})})},children:r.jsx(Y.Suspense,{fallback:r.jsx(it,{visual:u}),children:r.jsx($t,{org:s,initialSiteUrl:i,sessionEmail:l?.user?.email},`${s.id}:${i??""}`)})})}}),e[7]=i,e[8]=u,e[9]=s,e[10]=l?.user?.email,e[11]=o,e[12]=f):f=e[12],f}function it(t){const e=N.c(3),{visual:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[r.jsx(J,{}),r.jsx(et,{})]}),e[0]=i):i=e[0];let o;return e[1]!==s?(o=r.jsx(H,{align:"fill",visual:s,children:i}),e[1]=s,e[2]=o):o=e[2],o}function Ft(t){const e=N.c(19),{orgName:s,message:i,onRetry:o}=t,l=Q();let a;e[0]!==l?(a=l("routes.commerceOnboarding.commerceDiagnostic"),e[0]=l,e[1]=a):a=e[1];let n;e[2]!==s||e[3]!==l?(n=l("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s}),e[2]=s,e[3]=l,e[4]=n):n=e[4];let c;e[5]!==a||e[6]!==n?(c=r.jsx(J,{title:a,description:n}),e[5]=a,e[6]=n,e[7]=c):c=e[7];let m;e[8]!==i?(m=r.jsx(we,{message:i}),e[8]=i,e[9]=m):m=e[9];let d;e[10]!==l?(d=l("routes.commerceOnboarding.retryAgain"),e[10]=l,e[11]=d):d=e[11];let u;e[12]!==o||e[13]!==d?(u=r.jsx(Ne,{type:"button",size:"xl",className:"w-full",onClick:o,children:d}),e[12]=o,e[13]=d,e[14]=u):u=e[14];let f;return e[15]!==c||e[16]!==m||e[17]!==u?(f=r.jsxs("div",{className:"grid gap-10",children:[c,m,u]}),e[15]=c,e[16]=m,e[17]=u,e[18]=f):f=e[18],f}function $t(t){const e=N.c(135),{org:s,initialSiteUrl:i,sessionEmail:o}=t;let l;e[0]!==s.id||e[1]!==s.slug?(l={connectionId:Ot,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l):l=e[2];const a=jt(l),[n,c]=Y.useState(i??""),[m,d]=Y.useState(null),u=Y.useRef(!1),f=vt.COMMERCE_DISCOVERY(s.id),p=St(s.id),O=Be.commerceDiscoveryConnection(s.id,f);let v;e[3]!==f||e[4]!==a?(v=async()=>{const y=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:f}});return Le(y)},e[3]=f,e[4]=a,e[5]=v):v=e[5];let w;e[6]!==O||e[7]!==v?(w={queryKey:O,queryFn:v,retry:!1},e[6]=O,e[7]=v,e[8]=w):w=e[8];const C=He(w),P=Be.commerceDiscoveryVirtualMcp(s.id,p);let E;e[9]!==a||e[10]!==p?(E=async()=>{const y=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:p}});return Le(y)},e[9]=a,e[10]=p,e[11]=E):E=e[11];let A;e[12]!==P||e[13]!==E?(A={queryKey:P,queryFn:E,retry:!1},e[12]=P,e[13]=E,e[14]=A):A=e[14];const W=He(A);let q;e[15]!==a?(q=async y=>{const S=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}});return Le(S)},e[15]=a,e[16]=q):q=e[16];let g;e[17]!==C||e[18]!==s.id||e[19]!==W?(g=(y,S)=>{ue("commerce_onboarding_setup_succeeded",{domain:Te(S)??void 0,organization_id:s.id}),d(null),C.refetch(),W.refetch()},e[17]=C,e[18]=s.id,e[19]=W,e[20]=g):g=e[20];let h;e[21]!==s.id?(h=(y,S)=>{ue("commerce_onboarding_setup_failed",{domain:Te(S)??void 0,organization_id:s.id,error:y instanceof Error?y.message:String(y)}),d(y instanceof Error?y.message:"__configurationFailed")},e[21]=s.id,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==q||e[25]!==g?(x={mutationFn:q,retry:!1,onSuccess:g,onError:h},e[23]=h,e[24]=q,e[25]=g,e[26]=x):x=e[26];const b=Ze(x),_=!!C.data.item&&!!W.data.item,M=C.data.item,R=typeof M?.metadata?.siteUrl=="string"?M.metadata.siteUrl:void 0,z=i||n||"";let U;e[27]!==R||e[28]!==z?(U=gt(z,R),e[27]=R,e[28]=z,e[29]=U):U=e[29];const I=_&&U,L=i||n||R||"",j=Q(),[X]=Ee();let Z;e[30]!==L||e[31]!==X.language||e[32]!==o?(Z=De({siteUrl:L,email:o,locale:X.language}),e[30]=L,e[31]=X.language,e[32]=o,e[33]=Z):Z=e[33];const Ue=Z;let ge;e[34]!==Ue||e[35]!==s.id?(ge=r.jsx(Fe,{href:Ue,orgId:s.id}),e[34]=Ue,e[35]=s.id,e[36]=ge):ge=e[36];const $=ge;let fe;e[37]!==m||e[38]!==j?(fe=m?Qe(j,m):null,e[37]=m,e[38]=j,e[39]=fe):fe=e[39];const B=fe;let pe;e[40]!==b?(pe=y=>{const S=Re(y);if(!S.ok){d(S.error);return}d(null),b.mutate(S.value)},e[40]=b,e[41]=pe):pe=e[41];const ee=pe;let he;e[42]!==i||e[43]!==ee||e[44]!==I?(he=y=>{!y||u.current||I||!i||(u.current=!0,ee(i))},e[42]=i,e[43]=ee,e[44]=I,e[45]=he):he=e[45];const Ie=he;let be;e[46]!==s.id||e[47]!==ee||e[48]!==n?(be=y=>{y.preventDefault();const S=Re(n);S.ok&&ue("commerce_onboarding_site_url_submitted",{domain:new URL(S.value).hostname,organization_id:s.id}),ee(n)},e[46]=s.id,e[47]=ee,e[48]=n,e[49]=be):be=e[49];const V=be;if(I){const y=s.slug;let S;e[50]===Symbol.for("react.memo_cache_sentinel")?(S=crypto.randomUUID(),e[50]=S):S=e[50];let k;e[51]!==s.slug?(k={org:y,taskId:S},e[51]=s.slug,e[52]=k):k=e[52];let D;e[53]!==s.id?(D=_t(s.id),e[53]=s.id,e[54]=D):D=e[54];const G=L||void 0;let F;e[55]!==D.id||e[56]!==G?(F={virtualmcpid:D.id,connect:"1",siteUrl:G},e[55]=D.id,e[56]=G,e[57]=F):F=e[57];let K;return e[58]!==k||e[59]!==F?(K=r.jsx(dt,{to:"/$org/$taskId",params:k,search:F,replace:!0}),e[58]=k,e[59]=F,e[60]=K):K=e[60],K}if(b.isPending){let y;return e[61]!==$?(y=r.jsx(it,{visual:$}),e[61]=$,e[62]=y):y=e[62],y}if(i){let y,S,k,D,G,F,K,ne;if(e[63]!==$||e[64]!==V||e[65]!==i||e[66]!==s.name||e[67]!==b.isPending||e[68]!==n||e[69]!==j||e[70]!==B||e[71]!==Ie){ne=Symbol.for("react.early_return_sentinel");e:{const Pe=Re(i);if(!Pe.ok){let me;e[80]!==j?(me=j("routes.commerceOnboarding.commerceDiagnostic"),e[80]=j,e[81]=me):me=e[81];let de;e[82]!==s.name||e[83]!==j?(de=j("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s.name}),e[82]=s.name,e[83]=j,e[84]=de):de=e[84];let Ce;e[85]!==me||e[86]!==de?(Ce=r.jsx(J,{title:me,description:de}),e[85]=me,e[86]=de,e[87]=Ce):Ce=e[87];let je;e[88]!==V||e[89]!==b.isPending||e[90]!==n||e[91]!==B?(je=r.jsx(ke,{siteUrl:n,error:B,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V}),e[88]=V,e[89]=b.isPending,e[90]=n,e[91]=B,e[92]=je):je=e[92];const ze=r.jsxs("div",{className:"grid gap-10",children:[Ce,r.jsx(we,{message:Qe(j,Pe.error)}),je]});let Oe;e[93]!==$||e[94]!==ze?(Oe=r.jsx(H,{visual:$,children:ze}),e[93]=$,e[94]=ze,e[95]=Oe):Oe=e[95],ne=Oe;break e}S=H,K=$,G=Ie,F="grid gap-10",y=J,e[96]!==j?(k=j("routes.commerceOnboarding.commerceDiagnostic"),e[96]=j,e[97]=k):k=e[97],D=j("routes.commerceOnboarding.commerceDiscoveryBeingPrepared",{url:Pe.value})}e[63]=$,e[64]=V,e[65]=i,e[66]=s.name,e[67]=b.isPending,e[68]=n,e[69]=j,e[70]=B,e[71]=Ie,e[72]=y,e[73]=S,e[74]=k,e[75]=D,e[76]=G,e[77]=F,e[78]=K,e[79]=ne}else y=e[72],S=e[73],k=e[74],D=e[75],G=e[76],F=e[77],K=e[78],ne=e[79];if(ne!==Symbol.for("react.early_return_sentinel"))return ne;let le;e[98]!==y||e[99]!==k||e[100]!==D?(le=r.jsx(y,{title:k,description:D}),e[98]=y,e[99]=k,e[100]=D,e[101]=le):le=e[101];let ae;e[102]!==V||e[103]!==b.isPending||e[104]!==n||e[105]!==B?(ae=B?r.jsxs(r.Fragment,{children:[r.jsx(we,{message:B}),r.jsx(ke,{siteUrl:n,error:null,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V})]}):r.jsx(et,{}),e[102]=V,e[103]=b.isPending,e[104]=n,e[105]=B,e[106]=ae):ae=e[106];let ce;e[107]!==G||e[108]!==F||e[109]!==le||e[110]!==ae?(ce=r.jsxs("div",{ref:G,className:F,children:[le,ae]}),e[107]=G,e[108]=F,e[109]=le,e[110]=ae,e[111]=ce):ce=e[111];let ye;return e[112]!==S||e[113]!==K||e[114]!==ce?(ye=r.jsx(S,{visual:K,children:ce}),e[112]=S,e[113]=K,e[114]=ce,e[115]=ye):ye=e[115],ye}let te;e[116]!==j?(te=j("routes.commerceOnboarding.commerceDiagnostic"),e[116]=j,e[117]=te):te=e[117];let oe;e[118]!==s.name||e[119]!==j?(oe=j("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s.name}),e[118]=s.name,e[119]=j,e[120]=oe):oe=e[120];let re;e[121]!==te||e[122]!==oe?(re=r.jsx(J,{title:te,description:oe}),e[121]=te,e[122]=oe,e[123]=re):re=e[123];let ie;e[124]!==V||e[125]!==b.isPending||e[126]!==n||e[127]!==B?(ie=r.jsx(ke,{siteUrl:n,error:B,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V}),e[124]=V,e[125]=b.isPending,e[126]=n,e[127]=B,e[128]=ie):ie=e[128];let se;e[129]!==re||e[130]!==ie?(se=r.jsxs("div",{className:"grid gap-10",children:[re,ie]}),e[129]=re,e[130]=ie,e[131]=se):se=e[131];let xe;return e[132]!==$||e[133]!==se?(xe=r.jsx(H,{visual:$,children:se}),e[132]=$,e[133]=se,e[134]=xe):xe=e[134],xe}function ke(t){const e=N.c(30),{siteUrl:s,error:i,isSubmitting:o,onSiteUrlChange:l,onSubmit:a}=t,n=Q();let c;e[0]!==n?(c=n("routes.commerceOnboarding.siteUrlLabel"),e[0]=n,e[1]=c):c=e[1];let m;e[2]!==c?(m=r.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:c}),e[2]=c,e[3]=m):m=e[3];let d;e[4]!==l?(d=A=>l(A.target.value),e[4]=l,e[5]=d):d=e[5];let u;e[6]!==n?(u=n("routes.commerceOnboarding.siteUrlPlaceholder"),e[6]=n,e[7]=u):u=e[7];const f=!!i;let p;e[8]!==o||e[9]!==s||e[10]!==d||e[11]!==u||e[12]!==f?(p=r.jsx(bt,{id:"commerce-site-url",type:"text",inputMode:"url",value:s,onChange:d,placeholder:u,"aria-invalid":f,disabled:o}),e[8]=o,e[9]=s,e[10]=d,e[11]=u,e[12]=f,e[13]=p):p=e[13];let O;e[14]!==i?(O=i?r.jsx(we,{message:i}):null,e[14]=i,e[15]=O):O=e[15];let v;e[16]!==m||e[17]!==p||e[18]!==O?(v=r.jsxs("div",{className:"grid gap-2",children:[m,p,O]}),e[16]=m,e[17]=p,e[18]=O,e[19]=v):v=e[19];let w;e[20]!==n?(w=n("routes.commerceOnboarding.authCopy.continue"),e[20]=n,e[21]=w):w=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx(wt,{size:16}),e[22]=C):C=e[22];let P;e[23]!==o||e[24]!==w?(P=r.jsxs(Ne,{type:"submit",size:"xl",className:"w-full",disabled:o,children:[w,C]}),e[23]=o,e[24]=w,e[25]=P):P=e[25];let E;return e[26]!==a||e[27]!==P||e[28]!==v?(E=r.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[v,P]}),e[26]=a,e[27]=P,e[28]=v,e[29]=E):E=e[29],E}function we(t){const e=N.c(2),{message:s}=t;let i;return e[0]!==s?(i=r.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:s}),e[0]=s,e[1]=i):i=e[1],i}export{br as default};
@@ -1 +1 @@
1
- import{fj as re,r as I,c as $,H as Q,ac as U,p as Z,o as W,K,b as oe,e as O,q as ie,t as Y,bo as le}from"./index-Ci8azyOE.js";import{f as ce,g as ue,h as de}from"./task-board-Cz-fiaKF.js";import{t as fe}from"./decopilot-sse-pool-BN-M5EUb.js";import{u as me}from"./use-decopilot-events-CqU7DunK.js";import{i as ge}from"./AlertCircle-BTlJp8pf.js";import{g as ye,h as pe,j as z,n as ke,t as _e,m as Se,o as Te,b as he,l as Be,a as Ee,s as Ne}from"./UserSquare-CwU4sG2o.js";import{i as be}from"./CheckCircle-teyxVGFp.js";import{a as ee}from"./DotsVertical-CpVcGDJ_.js";import{s as Ae}from"./Eye-DgiSa7UT.js";import{i as De}from"./Shield01-C9M_jcOJ.js";const Ce=re("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"}]]),J=()=>0;function Ie(e){const{orgSlug:r,enabled:n=!0,onUpdate:a,onDelete:t,onResync:i}=e,o=I.useRef(a);o.current=a;const l=I.useRef(t);l.current=t;const d=I.useRef(i);d.current=i;const s=I.useRef(null),c=I.useRef(n),_=I.useRef(r);(!s.current||c.current!==n||_.current!==r)&&(c.current=n,_.current=r,s.current=T=>{if(!n||!r)return()=>{};const p=S=>{let g;try{g=JSON.parse(S.data)}catch{return}g.data&&(S.type===ce?l.current?.(g.data.id):o.current(g.data)),T()};return fe.subscribe(r,p,()=>d.current?.())}),I.useSyncExternalStore(s.current,J,J)}function We(){const e=$.c(9),{locator:r}=Q(),n=U();let a;e[0]!==r?(a=K.taskBoardItems(r),e[0]=r,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>{const{items:d,sprints:s,columns:c}=await n.call("TASK_BOARD_ITEM_LIST",{});return{items:d,sprints:s,columns:c}},e[2]=n,e[3]=t):t=e[3];let i;e[4]!==a||e[5]!==t?(i={queryKey:a,queryFn:t},e[4]=a,e[5]=t,e[6]=i):i=e[6];const{data:o}=W(i);let l;return e[7]!==o?.sprints?(l=new Map((o?.sprints??[]).map(Ke)),e[7]=o?.sprints,e[8]=l):l=e[8],l}function Ke(e){return[e.id,e]}function ze(){const e=$.c(9),{locator:r}=Q(),n=U();let a;e[0]!==r?(a=K.taskBoardItems(r),e[0]=r,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>{const{items:d,sprints:s,columns:c}=await n.call("TASK_BOARD_ITEM_LIST",{});return{items:d,sprints:s,columns:c}},e[2]=n,e[3]=t):t=e[3];let i;e[4]!==a||e[5]!==t?(i={queryKey:a,queryFn:t},e[4]=a,e[5]=t,e[6]=i):i=e[6];const{data:o}=W(i);let l;return e[7]!==o?.columns?(l=o?.columns??[],e[7]=o?.columns,e[8]=l):l=e[8],l}function Je(){const e=$.c(38),{org:r,locator:n}=Q(),a=U(),t=Z();let i;e[0]!==n?(i=K.taskBoardItems(n),e[0]=n,e[1]=i):i=e[1];const o=i;let l;e[2]!==a?(l=async()=>{const{items:m,sprints:f,columns:k}=await a.call("TASK_BOARD_ITEM_LIST",{});return{items:m,sprints:f,columns:k}},e[2]=a,e[3]=l):l=e[3];let d;e[4]!==o||e[5]!==l?(d={queryKey:o,queryFn:l,refetchInterval:6e4},e[4]=o,e[5]=l,e[6]=d):d=e[6];const s=W(d);let c;e[7]!==n||e[8]!==t||e[9]!==o?(c=m=>{t.cancelQueries({queryKey:o}),t.setQueryData(o,f=>f&&{...f,items:f.items.some(k=>k.id===m.id)?f.items.map(k=>k.id===m.id?m:k):[m,...f.items]}),t.invalidateQueries({queryKey:K.taskBoardActivity(n,m.id)})},e[7]=n,e[8]=t,e[9]=o,e[10]=c):c=e[10];let _,E;e[11]!==t||e[12]!==o?(_=()=>{t.invalidateQueries({queryKey:o})},E=m=>{t.cancelQueries({queryKey:o}),t.setQueryData(o,f=>f&&{...f,items:f.items.filter(k=>k.id!==m)})},e[11]=t,e[12]=o,e[13]=_,e[14]=E):(_=e[13],E=e[14]);let T;e[15]!==r.slug||e[16]!==c||e[17]!==_||e[18]!==E?(T={orgSlug:r.slug,onUpdate:c,onResync:_,onDelete:E},e[15]=r.slug,e[16]=c,e[17]=_,e[18]=E,e[19]=T):T=e[19],Ie(T);let p;e[20]!==t||e[21]!==o?(p=m=>{const f=m.subject,k=m.data.status;t.cancelQueries({queryKey:o}),t.setQueryData(o,C=>C&&{...C,items:C.items.map(b=>b.threads.some(B=>B.threadId===f)?{...b,threads:b.threads.map(B=>B.threadId===f?{...B,status:k}:B)}:b)})},e[20]=t,e[21]=o,e[22]=p):p=e[22];let S;e[23]!==r.slug||e[24]!==p?(S={orgSlug:r.slug,onTaskStatus:p},e[23]=r.slug,e[24]=p,e[25]=S):S=e[25],me(S);let g;e[26]!==s.data?.items?(g=s.data?.items??[],e[26]=s.data?.items,e[27]=g):g=e[27];let h;e[28]!==s.data?.sprints?(h=s.data?.sprints??[],e[28]=s.data?.sprints,e[29]=h):h=e[29];let N;e[30]!==s.data?.columns?(N=s.data?.columns??[],e[30]=s.data?.columns,e[31]=N):N=e[31];let D;return e[32]!==s.error||e[33]!==s.isLoading||e[34]!==h||e[35]!==N||e[36]!==g?(D={items:g,sprints:h,columns:N,isLoading:s.isLoading,error:s.error},e[32]=s.error,e[33]=s.isLoading,e[34]=h,e[35]=N,e[36]=g,e[37]=D):D=e[37],D}function Xe(){const e=$.c(70),{org:r,locator:n}=Q(),a=U(),t=Z(),i=oe();let o;e[0]!==n?(o=K.taskBoardItems(n),e[0]=n,e[1]=o):o=e[1];const l=o;let d;e[2]!==t||e[3]!==l?(d=()=>t.invalidateQueries({queryKey:l}),e[2]=t,e[3]=l,e[4]=d):d=e[4];const s=d;let c;e[5]!==a?(c=u=>a.call("TASK_BOARD_ITEM_CREATE",u),e[5]=a,e[6]=c):c=e[6];let _;e[7]!==s||e[8]!==c?(_={mutationFn:c,onSuccess:s},e[7]=s,e[8]=c,e[9]=_):_=e[9];const E=O(_);let T;e[10]!==a?(T=u=>a.call("TASK_BOARD_ITEM_UPDATE",u),e[10]=a,e[11]=T):T=e[11];let p;e[12]!==t||e[13]!==l?(p=async u=>{await t.cancelQueries({queryKey:l});const A=t.getQueryData(l);return t.setQueryData(l,y=>y&&{...y,items:y.items.map(V=>V.id===u.id?{...V,...u}:V)}),{previous:A}},e[12]=t,e[13]=l,e[14]=p):p=e[14];let S;e[15]!==r?(S=(u,A)=>{A.status==="done"&&ie("task_marked_done",{organization_id:r.id,task_board_item_id:A.id})},e[15]=r,e[16]=S):S=e[16];let g;e[17]!==t||e[18]!==l?(g=(u,A,y)=>{y?.previous&&t.setQueryData(l,y.previous)},e[17]=t,e[18]=l,e[19]=g):g=e[19];let h;e[20]!==s||e[21]!==n||e[22]!==t?(h=(u,A,y)=>{s(),t.invalidateQueries({queryKey:K.taskBoardActivity(n,y.id)})},e[20]=s,e[21]=n,e[22]=t,e[23]=h):h=e[23];let N;e[24]!==T||e[25]!==p||e[26]!==S||e[27]!==g||e[28]!==h?(N={mutationFn:T,onMutate:p,onSuccess:S,onError:g,onSettled:h},e[24]=T,e[25]=p,e[26]=S,e[27]=g,e[28]=h,e[29]=N):N=e[29];const D=O(N);let m;e[30]!==a?(m=u=>a.call("TASK_BOARD_ITEM_DELETE",{id:u}),e[30]=a,e[31]=m):m=e[31];let f;e[32]!==s||e[33]!==i?(f=u=>{Y.error(u instanceof Error&&u.message?u.message:i("taskBoard.taskBoard.deleteError")),s()},e[32]=s,e[33]=i,e[34]=f):f=e[34];let k;e[35]!==s||e[36]!==m||e[37]!==f?(k={mutationFn:m,onSuccess:s,onError:f},e[35]=s,e[36]=m,e[37]=f,e[38]=k):k=e[38];const C=O(k);let b;e[39]!==a?(b=async u=>{const A=await Promise.allSettled(u.map(y=>a.call("TASK_BOARD_ITEM_DELETE",{id:y})));return{total:u.length,failed:A.filter(Re).length}},e[39]=a,e[40]=b):b=e[40];let B,R;e[41]!==i?(B=u=>{const{total:A,failed:y}=u;y!==0&&Y.error(i("taskBoard.taskBoard.deleteBulkError",{failed:String(y),total:String(A)}))},R=()=>Y.error(i("taskBoard.taskBoard.deleteError")),e[41]=i,e[42]=B,e[43]=R):(B=e[42],R=e[43]);let L;e[44]!==s||e[45]!==b||e[46]!==B||e[47]!==R?(L={mutationFn:b,onSuccess:B,onError:R,onSettled:s},e[44]=s,e[45]=b,e[46]=B,e[47]=R,e[48]=L):L=e[48];const P=O(L);let x;e[49]!==a?(x=u=>a.call("TASK_BOARD_ITEM_UPDATE",u),e[49]=a,e[50]=x):x=e[50];let M;e[51]!==s||e[52]!==x?(M={mutationFn:x,onSuccess:s},e[51]=s,e[52]=x,e[53]=M):M=e[53];const j=O(M);let v;e[54]!==a?(v=u=>a.call("TASK_BOARD_ITEM_RERUN",u),e[54]=a,e[55]=v):v=e[55];let w;e[56]!==s||e[57]!==n||e[58]!==t?(w=(u,A,y)=>{s(),t.invalidateQueries({queryKey:K.taskBoardActivity(n,y.id)})},e[56]=s,e[57]=n,e[58]=t,e[59]=w):w=e[59];let F;e[60]!==v||e[61]!==w?(F={mutationFn:v,onSettled:w},e[60]=v,e[61]=w,e[62]=F):F=e[62];const H=O(F);let q;return e[63]!==E||e[64]!==j||e[65]!==C||e[66]!==P||e[67]!==H||e[68]!==D?(q={create:E,update:D,remove:C,removeMany:P,link:j,rerun:H},e[63]=E,e[64]=j,e[65]=C,e[66]=P,e[67]=H,e[68]=D,e[69]=q):q=e[69],q}function Re(e){return e.status==="rejected"}const xe=["ended_after_delivery","superseded"];function ve(e){return!!e&&xe.includes(e)}function Ze(e){return!(e.action==="status_changed"&&typeof e.data?.retry=="number")}function et(e){return e.failureKind!=="superseded"}const we=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",timeZone:"UTC"});function tt(e){const r=t=>{if(!t)return null;const i=Date.parse(t);return Number.isNaN(i)?null:we.format(new Date(i))},n=r(e.startsAt),a=r(e.endsAt);return!n&&!a?null:n&&a?`${n} – ${a}`:n??a}function te(e){return e.threads.some(r=>r.status==="requires_action")}function st(e){return e.status==="in_review"&&!e.assigneeId}function at(e){return te(e)}function nt(e){return e.status==="in_progress"&&te(e)?"text-warning animate-pulse":ne(e.status).iconClassName}function rt(e){return e.threads.some(n=>n.status==="in_progress")?"running":e.threads.some(n=>n.status==="failed"&&!ve(n.failureKind))?"failed":null}function ot(e,r,n){const a=e.findIndex(c=>c.id===n),t=r===n?e[a+1]?.id??null:r,i=e.filter(c=>c.id!==n),o=t?i.findIndex(c=>c.id===t):-1,l=o===-1?i.length:o,d=i[l-1],s=i[l];return d&&s?(d.sortOrder+s.sortOrder)/2:d?d.sortOrder+1:s?s.sortOrder-1:0}function it(e,r){return Array.from({length:r},(n,a)=>e-(r-1-a)*1e-4)}const Oe=["archived"],se={triage:{labelKey:"taskBoard.config.statusBacklog",icon:ge,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:ee,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:he,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Ae,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Te,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:Se,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:_e,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:be,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:le,iconClassName:"text-muted-foreground"}},ae={icon:ee,iconClassName:"text-muted-foreground"},Le=se;function ne(e){return Le[e]??ae}function Me(e,r,n){const a=se[e];return a?r(a.labelKey):n}function lt(e,r,n){const a=n.find(t=>t.key===e);return a?{label:Me(e,r,a.title),visual:ne(e),offBoard:!1}:{label:e,visual:ae,offBoard:!0}}const ct=["bug","feature","chore","spike","security"],ut={bug:{labelKey:"taskBoard.config.typeBug",icon:Ce,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Ne,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:Ee,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:Be,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:De,iconClassName:"text-purple-500"}};function G(e){return ue.includes(e)}function dt(e,r){return e.map(n=>n.key).filter(n=>r||!G(n))}function ft({columns:e,deliveryEnabled:r,shownLanes:n,occupied:a}){const t=e.map(s=>s.key).filter(s=>r||!G(s)||a.includes(s)),i=t.filter(s=>Oe.includes(s)||!r&&G(s)),o=i.filter(s=>!n.includes(s)),l=new Set(t),d=[...new Set(a)].filter(s=>!l.has(s)).sort();return{lanes:[...t.filter(s=>!o.includes(s)),...d],hidden:o,hideable:i,unplaced:d}}const X="lane:";function mt({overId:e,columnKeys:r,statusOf:n}){if(e===void 0)return null;const a=String(e),t=a.startsWith(X)?a.slice(X.length):n(a);return t!==void 0&&r.has(t)?t:null}const gt=["none","low","medium","high","urgent"],yt={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:z,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ke,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:z,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:pe,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:ye,iconClassName:"text-destructive"}};function pt(e,r=Date.now()){const n=new Date(e).getTime();return Number.isNaN(n)?null:n<r?"overdue":n-r<=Fe*864e5?"soon":null}const Fe=3;function kt(e){return`color-mix(in oklab, ${e??de} var(--user-color-strength), transparent)`}export{Oe as H,X as L,yt as P,se as S,ut as T,gt as a,We as b,lt as c,ct as d,et as e,tt as f,ve as g,Je as h,Ze as i,Xe as j,ft as k,ne as l,dt as m,te as n,st as o,rt as p,at as q,it as r,nt as s,kt as t,ze as u,ot as v,mt as w,pt as x,G as y};
1
+ import{fj as re,r as I,c as $,H as Q,ac as U,p as Z,o as W,K,b as oe,e as O,q as ie,t as Y,bo as le}from"./index-CLjikYNQ.js";import{f as ce,g as ue,h as de}from"./task-board-D-kil0OD.js";import{t as fe}from"./decopilot-sse-pool-DK-jWfRH.js";import{u as me}from"./use-decopilot-events-DXEJ77Cw.js";import{i as ge}from"./AlertCircle-6kr4ikYf.js";import{f as ye,g as pe,h as z,n as ke,t as _e,l as Se,m as Te,i as he,k as Be,a as Ee,s as Ne}from"./UserSquare-DTquYbih.js";import{i as be}from"./CheckCircle-DOsHeqoz.js";import{a as ee}from"./DotsVertical-BS1CnjKI.js";import{s as Ae}from"./Eye-B_dguG6W.js";import{i as De}from"./Shield01-D6Z8uTMm.js";const Ce=re("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"}]]),J=()=>0;function Ie(e){const{orgSlug:r,enabled:n=!0,onUpdate:a,onDelete:t,onResync:i}=e,o=I.useRef(a);o.current=a;const l=I.useRef(t);l.current=t;const d=I.useRef(i);d.current=i;const s=I.useRef(null),c=I.useRef(n),_=I.useRef(r);(!s.current||c.current!==n||_.current!==r)&&(c.current=n,_.current=r,s.current=T=>{if(!n||!r)return()=>{};const p=S=>{let g;try{g=JSON.parse(S.data)}catch{return}g.data&&(S.type===ce?l.current?.(g.data.id):o.current(g.data)),T()};return fe.subscribe(r,p,()=>d.current?.())}),I.useSyncExternalStore(s.current,J,J)}function We(){const e=$.c(9),{locator:r}=Q(),n=U();let a;e[0]!==r?(a=K.taskBoardItems(r),e[0]=r,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>{const{items:d,sprints:s,columns:c}=await n.call("TASK_BOARD_ITEM_LIST",{});return{items:d,sprints:s,columns:c}},e[2]=n,e[3]=t):t=e[3];let i;e[4]!==a||e[5]!==t?(i={queryKey:a,queryFn:t},e[4]=a,e[5]=t,e[6]=i):i=e[6];const{data:o}=W(i);let l;return e[7]!==o?.sprints?(l=new Map((o?.sprints??[]).map(Ke)),e[7]=o?.sprints,e[8]=l):l=e[8],l}function Ke(e){return[e.id,e]}function ze(){const e=$.c(9),{locator:r}=Q(),n=U();let a;e[0]!==r?(a=K.taskBoardItems(r),e[0]=r,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>{const{items:d,sprints:s,columns:c}=await n.call("TASK_BOARD_ITEM_LIST",{});return{items:d,sprints:s,columns:c}},e[2]=n,e[3]=t):t=e[3];let i;e[4]!==a||e[5]!==t?(i={queryKey:a,queryFn:t},e[4]=a,e[5]=t,e[6]=i):i=e[6];const{data:o}=W(i);let l;return e[7]!==o?.columns?(l=o?.columns??[],e[7]=o?.columns,e[8]=l):l=e[8],l}function Je(){const e=$.c(38),{org:r,locator:n}=Q(),a=U(),t=Z();let i;e[0]!==n?(i=K.taskBoardItems(n),e[0]=n,e[1]=i):i=e[1];const o=i;let l;e[2]!==a?(l=async()=>{const{items:m,sprints:f,columns:k}=await a.call("TASK_BOARD_ITEM_LIST",{});return{items:m,sprints:f,columns:k}},e[2]=a,e[3]=l):l=e[3];let d;e[4]!==o||e[5]!==l?(d={queryKey:o,queryFn:l,refetchInterval:6e4},e[4]=o,e[5]=l,e[6]=d):d=e[6];const s=W(d);let c;e[7]!==n||e[8]!==t||e[9]!==o?(c=m=>{t.cancelQueries({queryKey:o}),t.setQueryData(o,f=>f&&{...f,items:f.items.some(k=>k.id===m.id)?f.items.map(k=>k.id===m.id?m:k):[m,...f.items]}),t.invalidateQueries({queryKey:K.taskBoardActivity(n,m.id)})},e[7]=n,e[8]=t,e[9]=o,e[10]=c):c=e[10];let _,E;e[11]!==t||e[12]!==o?(_=()=>{t.invalidateQueries({queryKey:o})},E=m=>{t.cancelQueries({queryKey:o}),t.setQueryData(o,f=>f&&{...f,items:f.items.filter(k=>k.id!==m)})},e[11]=t,e[12]=o,e[13]=_,e[14]=E):(_=e[13],E=e[14]);let T;e[15]!==r.slug||e[16]!==c||e[17]!==_||e[18]!==E?(T={orgSlug:r.slug,onUpdate:c,onResync:_,onDelete:E},e[15]=r.slug,e[16]=c,e[17]=_,e[18]=E,e[19]=T):T=e[19],Ie(T);let p;e[20]!==t||e[21]!==o?(p=m=>{const f=m.subject,k=m.data.status;t.cancelQueries({queryKey:o}),t.setQueryData(o,C=>C&&{...C,items:C.items.map(b=>b.threads.some(B=>B.threadId===f)?{...b,threads:b.threads.map(B=>B.threadId===f?{...B,status:k}:B)}:b)})},e[20]=t,e[21]=o,e[22]=p):p=e[22];let S;e[23]!==r.slug||e[24]!==p?(S={orgSlug:r.slug,onTaskStatus:p},e[23]=r.slug,e[24]=p,e[25]=S):S=e[25],me(S);let g;e[26]!==s.data?.items?(g=s.data?.items??[],e[26]=s.data?.items,e[27]=g):g=e[27];let h;e[28]!==s.data?.sprints?(h=s.data?.sprints??[],e[28]=s.data?.sprints,e[29]=h):h=e[29];let N;e[30]!==s.data?.columns?(N=s.data?.columns??[],e[30]=s.data?.columns,e[31]=N):N=e[31];let D;return e[32]!==s.error||e[33]!==s.isLoading||e[34]!==h||e[35]!==N||e[36]!==g?(D={items:g,sprints:h,columns:N,isLoading:s.isLoading,error:s.error},e[32]=s.error,e[33]=s.isLoading,e[34]=h,e[35]=N,e[36]=g,e[37]=D):D=e[37],D}function Xe(){const e=$.c(70),{org:r,locator:n}=Q(),a=U(),t=Z(),i=oe();let o;e[0]!==n?(o=K.taskBoardItems(n),e[0]=n,e[1]=o):o=e[1];const l=o;let d;e[2]!==t||e[3]!==l?(d=()=>t.invalidateQueries({queryKey:l}),e[2]=t,e[3]=l,e[4]=d):d=e[4];const s=d;let c;e[5]!==a?(c=u=>a.call("TASK_BOARD_ITEM_CREATE",u),e[5]=a,e[6]=c):c=e[6];let _;e[7]!==s||e[8]!==c?(_={mutationFn:c,onSuccess:s},e[7]=s,e[8]=c,e[9]=_):_=e[9];const E=O(_);let T;e[10]!==a?(T=u=>a.call("TASK_BOARD_ITEM_UPDATE",u),e[10]=a,e[11]=T):T=e[11];let p;e[12]!==t||e[13]!==l?(p=async u=>{await t.cancelQueries({queryKey:l});const A=t.getQueryData(l);return t.setQueryData(l,y=>y&&{...y,items:y.items.map(j=>j.id===u.id?{...j,...u}:j)}),{previous:A}},e[12]=t,e[13]=l,e[14]=p):p=e[14];let S;e[15]!==r?(S=(u,A)=>{A.status==="done"&&ie("task_marked_done",{organization_id:r.id,task_board_item_id:A.id})},e[15]=r,e[16]=S):S=e[16];let g;e[17]!==t||e[18]!==l?(g=(u,A,y)=>{y?.previous&&t.setQueryData(l,y.previous)},e[17]=t,e[18]=l,e[19]=g):g=e[19];let h;e[20]!==s||e[21]!==n||e[22]!==t?(h=(u,A,y)=>{s(),t.invalidateQueries({queryKey:K.taskBoardActivity(n,y.id)})},e[20]=s,e[21]=n,e[22]=t,e[23]=h):h=e[23];let N;e[24]!==T||e[25]!==p||e[26]!==S||e[27]!==g||e[28]!==h?(N={mutationFn:T,onMutate:p,onSuccess:S,onError:g,onSettled:h},e[24]=T,e[25]=p,e[26]=S,e[27]=g,e[28]=h,e[29]=N):N=e[29];const D=O(N);let m;e[30]!==a?(m=u=>a.call("TASK_BOARD_ITEM_DELETE",{id:u}),e[30]=a,e[31]=m):m=e[31];let f;e[32]!==s||e[33]!==i?(f=u=>{Y.error(u instanceof Error&&u.message?u.message:i("taskBoard.taskBoard.deleteError")),s()},e[32]=s,e[33]=i,e[34]=f):f=e[34];let k;e[35]!==s||e[36]!==m||e[37]!==f?(k={mutationFn:m,onSuccess:s,onError:f},e[35]=s,e[36]=m,e[37]=f,e[38]=k):k=e[38];const C=O(k);let b;e[39]!==a?(b=async u=>{const A=await Promise.allSettled(u.map(y=>a.call("TASK_BOARD_ITEM_DELETE",{id:y})));return{total:u.length,failed:A.filter(Re).length}},e[39]=a,e[40]=b):b=e[40];let B,R;e[41]!==i?(B=u=>{const{total:A,failed:y}=u;y!==0&&Y.error(i("taskBoard.taskBoard.deleteBulkError",{failed:String(y),total:String(A)}))},R=()=>Y.error(i("taskBoard.taskBoard.deleteError")),e[41]=i,e[42]=B,e[43]=R):(B=e[42],R=e[43]);let L;e[44]!==s||e[45]!==b||e[46]!==B||e[47]!==R?(L={mutationFn:b,onSuccess:B,onError:R,onSettled:s},e[44]=s,e[45]=b,e[46]=B,e[47]=R,e[48]=L):L=e[48];const P=O(L);let x;e[49]!==a?(x=u=>a.call("TASK_BOARD_ITEM_UPDATE",u),e[49]=a,e[50]=x):x=e[50];let M;e[51]!==s||e[52]!==x?(M={mutationFn:x,onSuccess:s},e[51]=s,e[52]=x,e[53]=M):M=e[53];const H=O(M);let v;e[54]!==a?(v=u=>a.call("TASK_BOARD_ITEM_RERUN",u),e[54]=a,e[55]=v):v=e[55];let w;e[56]!==s||e[57]!==n||e[58]!==t?(w=(u,A,y)=>{s(),t.invalidateQueries({queryKey:K.taskBoardActivity(n,y.id)})},e[56]=s,e[57]=n,e[58]=t,e[59]=w):w=e[59];let F;e[60]!==v||e[61]!==w?(F={mutationFn:v,onSettled:w},e[60]=v,e[61]=w,e[62]=F):F=e[62];const V=O(F);let q;return e[63]!==E||e[64]!==H||e[65]!==C||e[66]!==P||e[67]!==V||e[68]!==D?(q={create:E,update:D,remove:C,removeMany:P,link:H,rerun:V},e[63]=E,e[64]=H,e[65]=C,e[66]=P,e[67]=V,e[68]=D,e[69]=q):q=e[69],q}function Re(e){return e.status==="rejected"}const xe=["ended_after_delivery","superseded"];function ve(e){return!!e&&xe.includes(e)}function Ze(e){return!(e.action==="status_changed"&&typeof e.data?.retry=="number")}function et(e){return e.failureKind!=="superseded"}const we=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",timeZone:"UTC"});function tt(e){const r=t=>{if(!t)return null;const i=Date.parse(t);return Number.isNaN(i)?null:we.format(new Date(i))},n=r(e.startsAt),a=r(e.endsAt);return!n&&!a?null:n&&a?`${n} – ${a}`:n??a}function te(e){return e.threads.some(r=>r.status==="requires_action")}function st(e){return e.status==="in_review"&&!e.assigneeId}function at(e){return te(e)}function nt(e){return e.status==="in_progress"&&te(e)?"text-warning animate-pulse":ne(e.status).iconClassName}function rt(e){return e.threads.some(n=>n.status==="in_progress")?"running":e.threads.some(n=>n.status==="failed"&&!ve(n.failureKind))?"failed":null}function ot(e,r,n){const a=e.findIndex(c=>c.id===n),t=r===n?e[a+1]?.id??null:r,i=e.filter(c=>c.id!==n),o=t?i.findIndex(c=>c.id===t):-1,l=o===-1?i.length:o,d=i[l-1],s=i[l];return d&&s?(d.sortOrder+s.sortOrder)/2:d?d.sortOrder+1:s?s.sortOrder-1:0}function it(e,r){return Array.from({length:r},(n,a)=>e-(r-1-a)*1e-4)}const Oe=["archived"],se={triage:{labelKey:"taskBoard.config.statusBacklog",icon:ge,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:ee,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:he,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Ae,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Te,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:Se,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:_e,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:be,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:le,iconClassName:"text-muted-foreground"}},ae={icon:ee,iconClassName:"text-muted-foreground"},Le=se;function ne(e){return Le[e]??ae}function Me(e,r,n){const a=se[e];return a?r(a.labelKey):n}function lt(e,r,n){const a=n.find(t=>t.key===e);return a?{label:Me(e,r,a.title),visual:ne(e),offBoard:!1}:{label:e,visual:ae,offBoard:!0}}const ct=["bug","feature","chore","spike","security"],ut={bug:{labelKey:"taskBoard.config.typeBug",icon:Ce,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Ne,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:Ee,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:Be,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:De,iconClassName:"text-purple-500"}};function G(e){return ue.includes(e)}function dt(e,r){return e.map(n=>n.key).filter(n=>r||!G(n))}function ft({columns:e,deliveryEnabled:r,shownLanes:n,occupied:a}){const t=e.map(s=>s.key).filter(s=>r||!G(s)||a.includes(s)),i=t.filter(s=>Oe.includes(s)||!r&&G(s)),o=i.filter(s=>!n.includes(s)),l=new Set(t),d=[...new Set(a)].filter(s=>!l.has(s)).sort();return{lanes:[...t.filter(s=>!o.includes(s)),...d],hidden:o,hideable:i,unplaced:d}}const X="lane:";function mt({overId:e,columnKeys:r,statusOf:n}){if(e===void 0)return null;const a=String(e),t=a.startsWith(X)?a.slice(X.length):n(a);return t!==void 0&&r.has(t)?t:null}const gt=["none","low","medium","high","urgent"],yt={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:z,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ke,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:z,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:pe,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:ye,iconClassName:"text-destructive"}};function pt(e,r=Date.now()){const n=new Date(e).getTime();return Number.isNaN(n)?null:n<r?"overdue":n-r<=Fe*864e5?"soon":null}const Fe=3;function kt(e){return`color-mix(in oklab, ${e??de} var(--user-color-strength), transparent)`}export{Oe as H,X as L,yt as P,se as S,ut as T,gt as a,We as b,lt as c,ct as d,et as e,tt as f,ve as g,Je as h,Ze as i,Xe as j,ft as k,ne as l,dt as m,te as n,st as o,rt as p,at as q,it as r,nt as s,kt as t,ze as u,ot as v,mt as w,pt as x,G as y};
@@ -1,4 +1,4 @@
1
- import{c as $,j as s,B,dy as le,b as F,H as re,r as ae,D as oe,t as U,b7 as ce}from"./index-Ci8azyOE.js";import{A as de,b as ue}from"./alert-CIFaGTb_.js";import{c as Q,T as V,b as Y,a as Z}from"./tabs-CFhQLpsD.js";import{u as ee}from"./use-copy-BY1mlr6R.js";import{i as te}from"./Check-D5PKBQ5I.js";import{a as se}from"./Copy01-CsNpp9jr.js";import{i as me}from"./Key01-D4srNqPO.js";import{n as fe}from"./LinkExternal01-CIL2SNWf.js";import{s as xe}from"./Trash01-Dp-QTpAR.js";import{u as pe,a as he,b as ge}from"./use-api-keys-D0NAsvsx.js";import"./use-mcp-client-DP2onozC.js";import"./constants-dLUUoWH7.js";import"./auth-D8IdOmGw.js";function je(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function ye(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function be({client:e,mode:t,url:o,apiKey:u}){const a=u??"<paste-your-api-key>",c=je();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${o}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${o} \\
1
+ import{c as $,j as s,B,dy as le,b as F,H as re,r as ae,D as oe,t as U,b7 as ce}from"./index-CLjikYNQ.js";import{A as de,b as ue}from"./alert-DbJERvKT.js";import{c as Q,T as V,b as Y,a as Z}from"./tabs-0Nbaxawf.js";import{u as ee}from"./use-copy-t26hWaR6.js";import{i as te}from"./Check-BDN8Muvk.js";import{a as se}from"./Copy01-B4QULclv.js";import{i as me}from"./Key01-C2TuLSvm.js";import{n as fe}from"./LinkExternal01-CWY5Wglm.js";import{s as xe}from"./Trash01-BDD06UjB.js";import{u as pe,a as he,b as ge}from"./use-api-keys-oFV-6tmf.js";import"./use-mcp-client-CBP30lcT.js";import"./constants-dLUUoWH7.js";import"./auth-BOUgLxto.js";function je(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function ye(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function be({client:e,mode:t,url:o,apiKey:u}){const a=u??"<paste-your-api-key>",c=je();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${o}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${o} \\
2
2
  --header "Authorization: Bearer ${a}"`};if(e==="cursor"){const l={url:o};return t==="api-key"&&(l.headers={Authorization:`Bearer ${a}`}),{language:"json",pathHint:"~/.cursor/mcp.json",code:JSON.stringify({mcpServers:{[c]:l}},null,2)}}if(e==="codex"){const l=[`[mcp_servers.${c}]`,`url = "${o}"`];return t==="api-key"&&l.push(`http_headers = { "Authorization" = "Bearer ${a}" }`),{language:"toml",pathHint:"~/.codex/config.toml",code:l.join(`
3
3
  `)}}if(e==="claude-desktop"){const l={type:"http",url:o};return t==="api-key"&&(l.headers={Authorization:`Bearer ${a}`}),{language:"json",pathHint:"claude_desktop_config.json",code:JSON.stringify({mcpServers:{[c]:l}},null,2)}}return t==="oauth"?{language:"text",code:`${o}
4
4
 
@@ -1 +1 @@
1
- import{ak as i,ao as r,al as t,an as e,ap as o,au as a,at as d,d9 as l,ci as u}from"./index-Ci8azyOE.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:r(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as i,g as p};
1
+ import{ak as i,ao as r,al as t,an as e,ap as o,au as a,at as d,d9 as l,ci as u}from"./index-CLjikYNQ.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:r(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as i,g as p};
@@ -1 +1 @@
1
- import{c as S,H as K,c7 as Q,K as F,b as q,n as $,j as x,b7 as G}from"./index-Ci8azyOE.js";import{u as U}from"./use-registry-connections-DghvIzKh.js";import{g as V}from"./use-organization-settings-BAFLKQ3y.js";import{S as k}from"./constants-dLUUoWH7.js";import{u as X}from"./useInfiniteQuery-DjjzlWAZ.js";import{c as Y}from"./use-mcp-client-DP2onozC.js";import{i as z,f as B}from"./extract-connection-data-6cVSTGuY.js";import{r as W,R as Z}from"./retry-CErkP7V6.js";import{g as A}from"./connection-slug-CITJ0kGN.js";import{I as J}from"./integration-icon-CGnrGZxM.js";function ye(){const s=S.c(6),e=U(),t=V(),o=K().project.enabledPlugins??[];let n;if(s[0]!==o||s[1]!==t||s[2]!==e){let c;s[4]!==t?(c=r=>t(r.id),s[4]=t,s[5]=c):c=s[5],n=e.filter(c).map(O),o.includes("private-registry")&&t(k)&&n.push({id:k,title:"Private Registry",icon:null}),s[0]=o,s[1]=t,s[2]=e,s[3]=n}else n=s[3];return n}function O(s){return{id:s.id,title:s.title,icon:s.icon}}const ee=24,L=3;function H(s){return s.id.includes("community-registry")}function te(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(o=>t.map(n=>({field:n,operator:"contains",value:o})))}}function D(s,e,t,o,n){const c=s.map(l=>l.id).sort().join(","),r=te(n),{data:p,fetchNextPage:f,hasNextPage:d,isFetchingNextPage:g,isLoading:C}=X({queryKey:F.storeDiscovery(e,`${c}:${n??""}`),queryFn:async({pageParam:l})=>{const a=l??{};return await Promise.all(s.map(async i=>{const y=a[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const b=z(i.id,e);try{return await W(async()=>{let u=null;try{u=await Y({connectionId:i.id,orgId:e,orgSlug:t});const h={limit:ee};y&&(h.cursor=y),r&&(h.where=r);const N=await u.callTool({name:b,arguments:h}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,R=B(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:R,nextCursor:P}}finally{await u?.close().catch(()=>{})}},{maxAttempts:L,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(u){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${L} attempts:`,u instanceof Z?u.cause:u),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:l=>{const a={};let m=!1;for(const i of l)i.registryId&&(i.nextCursor?(a[i.registryId]=i.nextCursor,m=!0):a[i.registryId]="EXHAUSTED");return m?a:void 0},staleTime:3600*1e3,placeholderData:Q,retry:!1,enabled:s.length>0}),I=[];if(p?.pages)for(const l of p.pages)for(const a of l)for(const m of a.items)I.push({...m,_sourceName:m._sourceName??a.registryTitle,_sourceIcon:m._sourceIcon??a.registryIcon,_registryId:m._registryId??a.registryId});return{items:I,hasMore:d??!1,isLoadingMore:g,isInitialLoading:C,fetchNextPage:()=>{d&&!g&&f()}}}function he(s,e){const t=S.c(16),{org:o}=K();let n;t[0]!==s?(n=s.filter(ie),t[0]=s,t[1]=n):n=t[1];const c=n;let r;t[2]!==s?(r=s.filter(se),t[2]=s,t[3]=r):r=t[3];const p=r,f=D(c,o.id,o.slug,!0,e),d=D(p,o.id,o.slug,!0,e);let g;if(t[4]!==d.items||t[5]!==f.items){const y=new Set;g=[];const b=[...f.items,...d.items];for(const u of b){const h=`${u._registryId}:${u.id}`;y.has(h)||(y.add(h),g.push(u))}t[4]=d.items,t[5]=f.items,t[6]=g}else g=t[6];const C=f.isInitialLoading||d.isInitialLoading,I=f.isLoadingMore||d.isLoadingMore,l=f.hasMore||d.hasMore;let a;t[7]!==d||t[8]!==f?(a=()=>{f.hasMore&&f.fetchNextPage(),d.hasMore&&d.fetchNextPage()},t[7]=d,t[8]=f,t[9]=a):a=t[9];const m=a;let i;return t[10]!==l||t[11]!==C||t[12]!==I||t[13]!==g||t[14]!==m?(i={items:g,hasMore:l,isLoadingMore:I,isInitialLoading:C,loadMore:m},t[10]=l,t[11]=C,t[12]=I,t[13]=g,t[14]=m,t[15]=i):i=t[15],i}function se(s){return H(s)}function ie(s){return!H(s)}function xe(s){const e=new Map;for(const n of s){const c=A(n),r=e.get(c);r?r.push(n):e.set(c,[n])}const t=[],o=new Set;for(const n of s){const c=A(n);if(o.has(c))continue;o.add(c);const r=e.get(c),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:c,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function ve(s){const e=S.c(43),{connection:t,onClick:o,headerActions:n,headerActionsAlwaysVisible:c,footer:r,className:p,fallbackIcon:f,selected:d}=s,g=c===void 0?!1:c,C=q(),I=o&&"cursor-pointer hover:bg-muted/50";let l;e[0]!==p||e[1]!==I?(l=$("transition-colors group overflow-hidden flex flex-col h-full",I,p),e[0]=p,e[1]=I,e[2]=l):l=e[2];const a=o?"button":void 0,m=o?0:void 0,i=o&&d!==void 0?d:void 0;let y;e[3]!==o?(y=o?E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),o())}:void 0,e[3]=o,e[4]=y):y=e[4];let b;e[5]!==t.icon||e[6]!==t.title||e[7]!==f?(b=x.jsx(J,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[5]=t.icon,e[6]=t.title,e[7]=f,e[8]=b):b=e[8];let u;e[9]!==n||e[10]!==g?(u=n&&x.jsx("div",{className:$("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:ne,children:n}),e[9]=n,e[10]=g,e[11]=u):u=e[11];let h;e[12]!==u?(h=x.jsx("div",{className:"relative",children:u}),e[12]=u,e[13]=h):h=e[13];let N;e[14]!==h||e[15]!==b?(N=x.jsxs("div",{className:"flex items-start justify-between",children:[b,h]}),e[14]=h,e[15]=b,e[16]=N):N=e[16];let v;e[17]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[17]=t.title,e[18]=v):v=e[18];let P;e[19]!==t.description||e[20]!==C?(P=t.description||C("connections.connectionCard.noDescription"),e[19]=t.description,e[20]=C,e[21]=P):P=e[21];let R;e[22]!==P?(R=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=R):R=e[23];let j;e[24]!==v||e[25]!==R?(j=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,R]}),e[24]=v,e[25]=R,e[26]=j):j=e[26];let M;e[27]!==N||e[28]!==j?(M=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,j]}),e[27]=N,e[28]=j,e[29]=M):M=e[29];let w;e[30]!==r?(w=r&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:oe,children:r})}),e[30]=r,e[31]=w):w=e[31];let T;e[32]!==M||e[33]!==w?(T=x.jsxs("div",{className:"flex flex-col flex-1",children:[M,w]}),e[32]=M,e[33]=w,e[34]=T):T=e[34];let _;return e[35]!==o||e[36]!==T||e[37]!==l||e[38]!==a||e[39]!==m||e[40]!==i||e[41]!==y?(_=x.jsx(G,{className:l,onClick:o,role:a,tabIndex:m,"aria-pressed":i,onKeyDown:y,children:T}),e[35]=o,e[36]=T,e[37]=l,e[38]=a,e[39]=m,e[40]=i,e[41]=y,e[42]=_):_=e[42],_}function oe(s){return s.stopPropagation()}function ne(s){return s.stopPropagation()}export{ve as C,he as a,xe as g,ye as u};
1
+ import{c as S,H as K,c7 as Q,K as F,b as q,n as $,j as x,b7 as G}from"./index-CLjikYNQ.js";import{u as U}from"./use-registry-connections-DHIJ1ozU.js";import{g as V}from"./use-organization-settings-C3jHLzD-.js";import{S as k}from"./constants-dLUUoWH7.js";import{u as X}from"./useInfiniteQuery-C3i2ddec.js";import{c as Y}from"./use-mcp-client-CBP30lcT.js";import{i as z,f as B}from"./extract-connection-data-CFLT8Lmm.js";import{r as W,R as Z}from"./retry-CErkP7V6.js";import{g as A}from"./connection-slug-CITJ0kGN.js";import{I as J}from"./integration-icon-DkfgnaHN.js";function ye(){const s=S.c(6),e=U(),t=V(),o=K().project.enabledPlugins??[];let n;if(s[0]!==o||s[1]!==t||s[2]!==e){let c;s[4]!==t?(c=r=>t(r.id),s[4]=t,s[5]=c):c=s[5],n=e.filter(c).map(O),o.includes("private-registry")&&t(k)&&n.push({id:k,title:"Private Registry",icon:null}),s[0]=o,s[1]=t,s[2]=e,s[3]=n}else n=s[3];return n}function O(s){return{id:s.id,title:s.title,icon:s.icon}}const ee=24,L=3;function H(s){return s.id.includes("community-registry")}function te(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(o=>t.map(n=>({field:n,operator:"contains",value:o})))}}function D(s,e,t,o,n){const c=s.map(l=>l.id).sort().join(","),r=te(n),{data:p,fetchNextPage:f,hasNextPage:d,isFetchingNextPage:g,isLoading:C}=X({queryKey:F.storeDiscovery(e,`${c}:${n??""}`),queryFn:async({pageParam:l})=>{const a=l??{};return await Promise.all(s.map(async i=>{const y=a[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const b=z(i.id,e);try{return await W(async()=>{let u=null;try{u=await Y({connectionId:i.id,orgId:e,orgSlug:t});const h={limit:ee};y&&(h.cursor=y),r&&(h.where=r);const N=await u.callTool({name:b,arguments:h}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,R=B(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:R,nextCursor:P}}finally{await u?.close().catch(()=>{})}},{maxAttempts:L,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(u){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${L} attempts:`,u instanceof Z?u.cause:u),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:l=>{const a={};let m=!1;for(const i of l)i.registryId&&(i.nextCursor?(a[i.registryId]=i.nextCursor,m=!0):a[i.registryId]="EXHAUSTED");return m?a:void 0},staleTime:3600*1e3,placeholderData:Q,retry:!1,enabled:s.length>0}),I=[];if(p?.pages)for(const l of p.pages)for(const a of l)for(const m of a.items)I.push({...m,_sourceName:m._sourceName??a.registryTitle,_sourceIcon:m._sourceIcon??a.registryIcon,_registryId:m._registryId??a.registryId});return{items:I,hasMore:d??!1,isLoadingMore:g,isInitialLoading:C,fetchNextPage:()=>{d&&!g&&f()}}}function he(s,e){const t=S.c(16),{org:o}=K();let n;t[0]!==s?(n=s.filter(ie),t[0]=s,t[1]=n):n=t[1];const c=n;let r;t[2]!==s?(r=s.filter(se),t[2]=s,t[3]=r):r=t[3];const p=r,f=D(c,o.id,o.slug,!0,e),d=D(p,o.id,o.slug,!0,e);let g;if(t[4]!==d.items||t[5]!==f.items){const y=new Set;g=[];const b=[...f.items,...d.items];for(const u of b){const h=`${u._registryId}:${u.id}`;y.has(h)||(y.add(h),g.push(u))}t[4]=d.items,t[5]=f.items,t[6]=g}else g=t[6];const C=f.isInitialLoading||d.isInitialLoading,I=f.isLoadingMore||d.isLoadingMore,l=f.hasMore||d.hasMore;let a;t[7]!==d||t[8]!==f?(a=()=>{f.hasMore&&f.fetchNextPage(),d.hasMore&&d.fetchNextPage()},t[7]=d,t[8]=f,t[9]=a):a=t[9];const m=a;let i;return t[10]!==l||t[11]!==C||t[12]!==I||t[13]!==g||t[14]!==m?(i={items:g,hasMore:l,isLoadingMore:I,isInitialLoading:C,loadMore:m},t[10]=l,t[11]=C,t[12]=I,t[13]=g,t[14]=m,t[15]=i):i=t[15],i}function se(s){return H(s)}function ie(s){return!H(s)}function xe(s){const e=new Map;for(const n of s){const c=A(n),r=e.get(c);r?r.push(n):e.set(c,[n])}const t=[],o=new Set;for(const n of s){const c=A(n);if(o.has(c))continue;o.add(c);const r=e.get(c),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:c,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function ve(s){const e=S.c(43),{connection:t,onClick:o,headerActions:n,headerActionsAlwaysVisible:c,footer:r,className:p,fallbackIcon:f,selected:d}=s,g=c===void 0?!1:c,C=q(),I=o&&"cursor-pointer hover:bg-muted/50";let l;e[0]!==p||e[1]!==I?(l=$("transition-colors group overflow-hidden flex flex-col h-full",I,p),e[0]=p,e[1]=I,e[2]=l):l=e[2];const a=o?"button":void 0,m=o?0:void 0,i=o&&d!==void 0?d:void 0;let y;e[3]!==o?(y=o?E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),o())}:void 0,e[3]=o,e[4]=y):y=e[4];let b;e[5]!==t.icon||e[6]!==t.title||e[7]!==f?(b=x.jsx(J,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[5]=t.icon,e[6]=t.title,e[7]=f,e[8]=b):b=e[8];let u;e[9]!==n||e[10]!==g?(u=n&&x.jsx("div",{className:$("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:ne,children:n}),e[9]=n,e[10]=g,e[11]=u):u=e[11];let h;e[12]!==u?(h=x.jsx("div",{className:"relative",children:u}),e[12]=u,e[13]=h):h=e[13];let N;e[14]!==h||e[15]!==b?(N=x.jsxs("div",{className:"flex items-start justify-between",children:[b,h]}),e[14]=h,e[15]=b,e[16]=N):N=e[16];let v;e[17]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[17]=t.title,e[18]=v):v=e[18];let P;e[19]!==t.description||e[20]!==C?(P=t.description||C("connections.connectionCard.noDescription"),e[19]=t.description,e[20]=C,e[21]=P):P=e[21];let R;e[22]!==P?(R=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=R):R=e[23];let j;e[24]!==v||e[25]!==R?(j=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,R]}),e[24]=v,e[25]=R,e[26]=j):j=e[26];let M;e[27]!==N||e[28]!==j?(M=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,j]}),e[27]=N,e[28]=j,e[29]=M):M=e[29];let w;e[30]!==r?(w=r&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:oe,children:r})}),e[30]=r,e[31]=w):w=e[31];let T;e[32]!==M||e[33]!==w?(T=x.jsxs("div",{className:"flex flex-col flex-1",children:[M,w]}),e[32]=M,e[33]=w,e[34]=T):T=e[34];let _;return e[35]!==o||e[36]!==T||e[37]!==l||e[38]!==a||e[39]!==m||e[40]!==i||e[41]!==y?(_=x.jsx(G,{className:l,onClick:o,role:a,tabIndex:m,"aria-pressed":i,onKeyDown:y,children:T}),e[35]=o,e[36]=T,e[37]=l,e[38]=a,e[39]=m,e[40]=i,e[41]=y,e[42]=_):_=e[42],_}function oe(s){return s.stopPropagation()}function ne(s){return s.stopPropagation()}export{ve as C,he as a,xe as g,ye as u};