decocms 4.342.1 → 4.342.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/dist/client/assets/{AlertCircle-D2D51Xj2.js → AlertCircle-Mq4uYP3s.js} +1 -1
  2. package/dist/client/assets/{AreaChart-QkLGWvN8.js → AreaChart-DSXyRMmm.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DzPPKu6O.js → ArrowLeft-CVITrxtP.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CAKLD40b.js → ArrowUp-CNHLUPN5.js} +1 -1
  5. package/dist/client/assets/{Check-BTRkTQJX.js → Check-BhhNRMNU.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-B78PLzU_.js → CheckCircle-BCoRYCAM.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-ambRheJD.js → ChevronRight-q_JbYpOo.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-DVtkdLaj.js → ChevronSelectorVertical-BU-CJzRy.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-C06mVmvV.js → ChevronUp-b-PzeywI.js} +1 -1
  10. package/dist/client/assets/{Copy01-DVCq_O3T.js → Copy01-DUhBpg4r.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CES6U0TA.js → CreditCard01-1Ok0QwWF.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-uF4drraF.js → DotsVertical-BQLviQoN.js} +1 -1
  13. package/dist/client/assets/{Download01-PVoxfKZo.js → Download01-C1bDQDgI.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-DHefj_Bu.js → ErrorBarContext-0Eioes4E.js} +1 -1
  15. package/dist/client/assets/{Eye-C6uXiXzi.js → Eye-ibUTdcXo.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-YPeQcTAV.js → GitBranch01-bh0uxNpJ.js} +1 -1
  17. package/dist/client/assets/{Globe01-V6lehu4e.js → Globe01-CiS7RUms.js} +1 -1
  18. package/dist/client/assets/{HardDrive-DKdozTpB.js → HardDrive-DYvVbF_2.js} +1 -1
  19. package/dist/client/assets/{Image01-JsWosAfi.js → Image01-DAHgvtp4.js} +1 -1
  20. package/dist/client/assets/{Key01-Cw_kEwMY.js → Key01-Cio39wXN.js} +1 -1
  21. package/dist/client/assets/{Link01-Z2g3bDmm.js → Link01-DnReHnVr.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-5uXO9mvN.js → LinkExternal01-BSsHZ7aL.js} +1 -1
  23. package/dist/client/assets/{Monitor01-qBNRPc9z.js → Monitor01-vaUnb86V.js} +1 -1
  24. package/dist/client/assets/{Package-DNwbFhHp.js → Package-XApGlufb.js} +1 -1
  25. package/dist/client/assets/{Palette-Bm9PktVe.js → Palette-dkAr2npF.js} +1 -1
  26. package/dist/client/assets/{Play-36GJ7S8s.js → Play-gyn4nC-U.js} +1 -1
  27. package/dist/client/assets/{Plus-olH6X81H.js → Plus-DpxQQegv.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CGBqTx98.js → SearchMd-CbFIUniO.js} +1 -1
  29. package/dist/client/assets/{Sector-ChhC--LA.js → Sector-CrWFGDk9.js} +1 -1
  30. package/dist/client/assets/{Settings02-gFbaDyQo.js → Settings02-Bpo9X8gv.js} +1 -1
  31. package/dist/client/assets/{Share07-DcU-zxAl.js → Share07-h7a5KYcB.js} +1 -1
  32. package/dist/client/assets/{Shield01-DyfquAcF.js → Shield01-BX_Me7cI.js} +1 -1
  33. package/dist/client/assets/{Stars01-CijLjMFV.js → Stars01-12uBgCmr.js} +1 -1
  34. package/dist/client/assets/{Sun-B19fT9gQ.js → Sun-DOVdnR1v.js} +1 -1
  35. package/dist/client/assets/{Tool01-DoCGAF0P.js → Tool01-Buhr9Y7R.js} +1 -1
  36. package/dist/client/assets/{Tool02-DIK4BIPI.js → Tool02-DIw0mhv0.js} +1 -1
  37. package/dist/client/assets/{Trash01-BQv1GGxn.js → Trash01-CDIP8mWC.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-B_O79VuK.js → TrendUp01-Bm64aKBA.js} +1 -1
  39. package/dist/client/assets/{Upload01-xJ_d7WPc.js → Upload01-D5lIPLBr.js} +1 -1
  40. package/dist/client/assets/{User01-CwFs9pyw.js → User01-BnCb_8UJ.js} +1 -1
  41. package/dist/client/assets/{UserSquare-CCKOKhgs.js → UserSquare-CI7iMhe-.js} +1 -1
  42. package/dist/client/assets/{Users01-BPXtgrBC.js → Users01-byFntVxQ.js} +1 -1
  43. package/dist/client/assets/{Users03-D8v2VuQ9.js → Users03-SRCwiQcD.js} +1 -1
  44. package/dist/client/assets/{XCircle-BVm_7tfF.js → XCircle-CgX4D_Wl.js} +1 -1
  45. package/dist/client/assets/{XClose-D4VcMT4v.js → XClose-CnwWALwv.js} +1 -1
  46. package/dist/client/assets/{Zap-BOal3pPC.js → Zap-C8JmWe0J.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-D2uupZS7.js → ZoomOut-D6sLWwOc.js} +1 -1
  48. package/dist/client/assets/{access-gate-Cr-4LceV.js → access-gate-CBB1Qus8.js} +1 -1
  49. package/dist/client/assets/{agent-icon-BX_m4kFr.js → agent-icon-BK--UuNY.js} +1 -1
  50. package/dist/client/assets/agents-list-62To51q8.js +1 -0
  51. package/dist/client/assets/{ai-providers-Dn43P9zk.js → ai-providers-DH-JHBvi.js} +1 -1
  52. package/dist/client/assets/{alert-BTpNoW-j.js → alert-DETMmQuX.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-DZRE4L1N.js → alert-dialog-Cw7BmY2P.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-ClKsUMUz.js → analytics-tab-WPqi1-Mb.js} +1 -1
  55. package/dist/client/assets/{api-keys-Dbr4bZEh.js → api-keys-BW3D8Cl3.js} +1 -1
  56. package/dist/client/assets/api-keys-CVTTKe7W.js +1 -0
  57. package/dist/client/assets/app-editor-CbxwfKbi.js +1 -0
  58. package/dist/client/assets/{auth-CgRqH8B5.js → auth-CWprQaxo.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-oyqrgzRp.js → auth-catchall-DgZdBG23.js} +1 -1
  60. package/dist/client/assets/{auth-entry-CB22oLVX.js → auth-entry-BuMtn5hB.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-CzikqxGB.js → auth-split-layout-BW3jd9F4.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-sgjL9l6q.js → authenticate-and-persist-oauth-RvEdCg0n.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-WfWAYirk.js → automation-list-row-BFBCjs_3.js} +1 -1
  64. package/dist/client/assets/{automation-runs-DOuxh_I5.js → automation-runs-Cb6Gp4pY.js} +1 -1
  65. package/dist/client/assets/{automations-CGX9hzw1.js → automations-B5IHQrQY.js} +1 -1
  66. package/dist/client/assets/{autosend-DcK-oL9g.js → autosend-CcA_LUz8.js} +1 -1
  67. package/dist/client/assets/{avatar-DdjivLvx.js → avatar-BBxhmrGb.js} +1 -1
  68. package/dist/client/assets/{badge-9zrzkd9r.js → badge-o_twyLc_.js} +1 -1
  69. package/dist/client/assets/{block-document-CbDLTjNj.js → block-document-C7S8RrsG.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-CChNkrRW.js → breadcrumb-Bv7iafdd.js} +1 -1
  71. package/dist/client/assets/{buckets-D-ROt__Q.js → buckets-B2SnW3nz.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-DQy3Mp7e.js → bulk-category-panel-DxAIiAnN.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-Cerh3ArX.js → capability-load-error-CKO9v57M.js} +1 -1
  74. package/dist/client/assets/{cards-C-pPxel1.js → cards-Dp7Db5mb.js} +1 -1
  75. package/dist/client/assets/{category-editor-BWdrhKpp.js → category-editor-BPMZZuhm.js} +1 -1
  76. package/dist/client/assets/{cdn-tab-xx_k0lss.js → cdn-tab-D16BCati.js} +1 -1
  77. package/dist/client/assets/{chart-FRhyIhE5.js → chart-CXoJFyt-.js} +1 -1
  78. package/dist/client/assets/{chat-context-CDDCU0bI.js → chat-context-BOubSdoC.js} +1 -1
  79. package/dist/client/assets/{checkbox-cysNC-i2.js → checkbox-DC1-C0yj.js} +1 -1
  80. package/dist/client/assets/{choose-editor-CSAS8gL0.js → choose-editor-Bc-cDZws.js} +1 -1
  81. package/dist/client/assets/{cli-auth-success-BtS2EHN-.js → cli-auth-success-Z3jk5smt.js} +1 -1
  82. package/dist/client/assets/{client-icons-DsP67cBx.js → client-icons-D9UKaR21.js} +1 -1
  83. package/dist/client/assets/{collection-detail-Dd0VLHHX.js → collection-detail--XY3-4VM.js} +1 -1
  84. package/dist/client/assets/{collection-display-button-BNW7lUO5.js → collection-display-button-CS2gatVL.js} +1 -1
  85. package/dist/client/assets/{collection-search-CoHiMicq.js → collection-search-DDhFultb.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-CwZpFm21.js → collection-table-wrapper-DnxhYnfx.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-CTCDvNXa.js → collection-tabs-BTawwpGQ.js} +1 -1
  88. package/dist/client/assets/{command-DglBu4ry.js → command-HI0UCA4y.js} +1 -1
  89. package/dist/client/assets/{commerce-onboarding-DRurpy9t.js → commerce-onboarding-CQ6xNmqG.js} +1 -1
  90. package/dist/client/assets/{connect-DbEIrKRw.js → connect-DwKNthrs.js} +1 -1
  91. package/dist/client/assets/{connect-layout-ByuOOzfV.js → connect-layout-BbPV_CYv.js} +1 -1
  92. package/dist/client/assets/{connection-card-9SvUjL-W.js → connection-card--AbKRYOT.js} +1 -1
  93. package/dist/client/assets/{connection-detail-Qap_nxuH.js → connection-detail-BnTzL13p.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-B1Lia0YT.js → connection-form-helpers-DvzqbiWX.js} +1 -1
  95. package/dist/client/assets/{connection-EhEiPNb8.js → connection-pA4f7OGU.js} +1 -1
  96. package/dist/client/assets/{connections-JYuhwtWd.js → connections-Bcbqo-1r.js} +1 -1
  97. package/dist/client/assets/{create-organization-dialog-DMW1uU6w.js → create-organization-dialog-BDM0SiIn.js} +1 -1
  98. package/dist/client/assets/{decopilot-sse-pool-BHgTAtlC.js → decopilot-sse-pool-B5lWFZt-.js} +1 -1
  99. package/dist/client/assets/{dialog-Miapt8_D.js → dialog-XLNsYC5N.js} +1 -1
  100. package/dist/client/assets/{domain-settings-C_ap9fMW.js → domain-settings-D8l3vAYa.js} +1 -1
  101. package/dist/client/assets/{drawer-k95Tpmd9.js → drawer-B9HENLxP.js} +1 -1
  102. package/dist/client/assets/{dropdown-menu-BhcUPwf0.js → dropdown-menu-Bv4xz-Hs.js} +1 -1
  103. package/dist/client/assets/{e2e-tab-BbkOJOXS.js → e2e-tab-CvVeB4CK.js} +1 -1
  104. package/dist/client/assets/{editor-BLEEF39g.js → editor-C9lwPPsr.js} +1 -1
  105. package/dist/client/assets/{empty-state-CPvD-fl3.js → empty-state-DBeBQToo.js} +1 -1
  106. package/dist/client/assets/{empty-state-CxT3M9ru.js → empty-state-DbGmoVR9.js} +1 -1
  107. package/dist/client/assets/{extract-connection-data-CIZs101U.js → extract-connection-data-CnBnjNlB.js} +1 -1
  108. package/dist/client/assets/{file-explorer-BkNJGTvG.js → file-explorer-CzlG2Igr.js} +1 -1
  109. package/dist/client/assets/{file-type-icon-BB8M6dQu.js → file-type-icon-BEvKB0u0.js} +1 -1
  110. package/dist/client/assets/{folder-icon-CDgJkJCP.js → folder-icon-KNBEt_sQ.js} +1 -1
  111. package/dist/client/assets/{form-REOkh5vJ.js → form-C5ACRAcC.js} +1 -1
  112. package/dist/client/assets/{general-ahSorILa.js → general-D7XFFecn.js} +1 -1
  113. package/dist/client/assets/{github-icon-DHa3OO-P.js → github-icon-CM4v-wXP.js} +1 -1
  114. package/dist/client/assets/{hooks-BnkZor95.js → hooks-Cn77eRzF.js} +1 -1
  115. package/dist/client/assets/{hosting-tab-DR6lhFd-.js → hosting-tab-CfrA3kwE.js} +1 -1
  116. package/dist/client/assets/{index-Lpfu_OqS.js → index-B8T2qimk.js} +1 -1
  117. package/dist/client/assets/{index-0SB2ffdj.js → index-BWXU2njW.js} +1 -1
  118. package/dist/client/assets/{index-C-JlzDFJ.js → index-C6E8zBzO.js} +1 -1
  119. package/dist/client/assets/{index-C_TYJCRQ.js → index-CAxyGGMQ.js} +1 -1
  120. package/dist/client/assets/{index-ikreYdr7.js → index-CS-1h95w.js} +1 -1
  121. package/dist/client/assets/{index-BfR7HGpM.js → index-CXkrxM8i.js} +29 -29
  122. package/dist/client/assets/{index-BTWessD-.js → index-CmFHzaVd.js} +2 -2
  123. package/dist/client/assets/{index-BCStGLTT.js → index-D68yFqMR.js} +1 -1
  124. package/dist/client/assets/{index-gS0jjjqR.js → index-Db3hRosd.js} +1 -1
  125. package/dist/client/assets/{index-B2-y5FHD.js → index-JbbZQ3Xs.js} +1 -1
  126. package/dist/client/assets/{index-redirect-zxFWdUcl.js → index-redirect-CZO5gh5Z.js} +1 -1
  127. package/dist/client/assets/{infiniteQueryObserver-Cd6dzDw6.js → infiniteQueryObserver-C1YqOU9I.js} +1 -1
  128. package/dist/client/assets/{infra-billing-C4aR4fG7.js → infra-billing-BYA-V5U4.js} +1 -1
  129. package/dist/client/assets/{input-iu36jhQK.js → input-BrGTSicR.js} +1 -1
  130. package/dist/client/assets/{integration-icon-BZcJvfZm.js → integration-icon-Dzu38eaZ.js} +1 -1
  131. package/dist/client/assets/{invite-member-dialog-DchFL9bm.js → invite-member-dialog-B2h9AYTV.js} +1 -1
  132. package/dist/client/assets/{label-DqlJqxKH.js → label-MXwspLYA.js} +1 -1
  133. package/dist/client/assets/{layout-BcO10nod.js → layout-CEh12qgq.js} +1 -1
  134. package/dist/client/assets/{login-zfLEUWDx.js → login-Bia0cwSF.js} +1 -1
  135. package/dist/client/assets/{markdown-_LkJmAqc.js → markdown-B2HeF9Qf.js} +1 -1
  136. package/dist/client/assets/{mcp-app-renderer-CFfyP9XL.js → mcp-app-renderer-BSbDxloq.js} +1 -1
  137. package/dist/client/assets/{mcp-oauth-BQowuvpk.js → mcp-oauth-DnRZAi4a.js} +1 -1
  138. package/dist/client/assets/{members-CZMk3VTy.js → members-B5yE10gT.js} +1 -1
  139. package/dist/client/assets/{monaco-editor-DMM5kvOI.js → monaco-editor-V_EQb8R1.js} +1 -1
  140. package/dist/client/assets/{monitoring-stats-row-DeE8QmFv.js → monitoring-stats-row-BOnyGIW4.js} +1 -1
  141. package/dist/client/assets/{multi-select-CRr0-stj.js → multi-select-SJUONz5_.js} +1 -1
  142. package/dist/client/assets/{oauth-callback-cd4IS8gu.js → oauth-callback-BEVZ58Xt.js} +1 -1
  143. package/dist/client/assets/{oauth-callback-ai-provider-hYmQ5yP2.js → oauth-callback-ai-provider-DCxPOz99.js} +1 -1
  144. package/dist/client/assets/{onboarding-XjJ9gq8K.js → onboarding-BAPEOo9w.js} +1 -1
  145. package/dist/client/assets/{org-layout-BVbkK-5M.js → org-layout-DmLXu8Vs.js} +1 -1
  146. package/dist/client/assets/{organization-choice-zXaIBGnY.js → organization-choice-570eURm6.js} +1 -1
  147. package/dist/client/assets/{orgs-MLkZceB6.js → orgs-8DPbTGjs.js} +1 -1
  148. package/dist/client/assets/{page-seo-form-C8myAa0n.js → page-seo-form-BWhBnhLr.js} +1 -1
  149. package/dist/client/assets/{popover-CgXpd9l1.js → popover-DU2O05yH.js} +1 -1
  150. package/dist/client/assets/{post-calendar-BvUxLP6o.js → post-calendar-Dz5hH17f.js} +1 -1
  151. package/dist/client/assets/{post-editor-B6lQhrYY.js → post-editor-C4TYwrwv.js} +1 -1
  152. package/dist/client/assets/{primitives-DYT4sP6s.js → primitives-DIU4mvzq.js} +1 -1
  153. package/dist/client/assets/{profile-DT0Xf9Ra.js → profile-BUf3Niqv.js} +1 -1
  154. package/dist/client/assets/{project-app-view-_FGaMZX2.js → project-app-view-Cq8xtL5V.js} +1 -1
  155. package/dist/client/assets/{project-icon-Db3g3nDh.js → project-icon-C0iKv_zT.js} +1 -1
  156. package/dist/client/assets/{prompts-DdN-A0M6.js → prompts-CpDXA_L9.js} +1 -1
  157. package/dist/client/assets/record-editor-CKPNfjH-.js +1 -0
  158. package/dist/client/assets/redirect-editor-G9UZsAZ1.js +1 -0
  159. package/dist/client/assets/registry-7Yy-bDB0.js +2 -0
  160. package/dist/client/assets/{registry-layout-VitSh2mX.js → registry-layout-C1SnPIpK.js} +1 -1
  161. package/dist/client/assets/{reports-65Mag0VV.js → reports-B_6mbgI0.js} +1 -1
  162. package/dist/client/assets/repositories-Pg9k3lzh.js +1 -0
  163. package/dist/client/assets/{repository-import-picker-DWW-IA5n.js → repository-import-picker-9iV061w7.js} +1 -1
  164. package/dist/client/assets/repository-picker-CPgsg-CB.js +1 -0
  165. package/dist/client/assets/{require-capability-C8LAF2Xi.js → require-capability-B7n_oYja.js} +1 -1
  166. package/dist/client/assets/{required-auth-layout-DobYzBOQ.js → required-auth-layout-DFE8-DIF.js} +1 -1
  167. package/dist/client/assets/{reset-password-Ds8YwozL.js → reset-password-DYP5qNRo.js} +1 -1
  168. package/dist/client/assets/{review-settings-DSVzMMQx.js → review-settings-C3pgFOt_.js} +1 -1
  169. package/dist/client/assets/{roles-37iirlSR.js → roles-CWpFyXFP.js} +1 -1
  170. package/dist/client/assets/{schema-Xwy4m_ge.js → schema-B-h-kqfi.js} +1 -1
  171. package/dist/client/assets/{scroll-area-CeS_704_.js → scroll-area-CXXmHFR1.js} +1 -1
  172. package/dist/client/assets/{search-input-By7Y_FrK.js → search-input-B2m2yzjY.js} +1 -1
  173. package/dist/client/assets/{secrets-LpOqkz3k.js → secrets-BlI3WcxN.js} +1 -1
  174. package/dist/client/assets/{sections-editor-BsAQwCnw.js → sections-editor-CkoECQTI.js} +1 -1
  175. package/dist/client/assets/{select-7M6VAk9b.js → select-ZYFyXoho.js} +1 -1
  176. package/dist/client/assets/{select-model-8WviIeLM.js → select-model-BfZBoOlP.js} +1 -1
  177. package/dist/client/assets/{self-tool-result-BuuXFFuw.js → self-tool-result-CHA0E5s4.js} +1 -1
  178. package/dist/client/assets/{seo-editor-CoX9Wtr1.js → seo-editor-Dt2IIbuV.js} +1 -1
  179. package/dist/client/assets/settings-layout-CHlUhcVk.js +1 -0
  180. package/dist/client/assets/{settings-sidebar-DfvRN6Cn.js → settings-sidebar-Dtey7gUO.js} +1 -1
  181. package/dist/client/assets/{shell-controls-DCGeNcHy.js → shell-controls-EGpvEmQz.js} +1 -1
  182. package/dist/client/assets/{shell-layout-C1O8KOgR.js → shell-layout-Bs8ZFS1F.js} +1 -1
  183. package/dist/client/assets/{skill-preview-DbWtWWCT.js → skill-preview-DxUM8-Wl.js} +1 -1
  184. package/dist/client/assets/{skills-BadZVvhk.js → skills-DeRrWb3d.js} +1 -1
  185. package/dist/client/assets/{sso-B3YrGAbB.js → sso-Bkh62gtX.js} +1 -1
  186. package/dist/client/assets/{store-AF_xDuRv.js → store-B2dUsd-4.js} +1 -1
  187. package/dist/client/assets/store-registry-DC8x-TIM.js +2 -0
  188. package/dist/client/assets/{switch-DDadtPed.js → switch-B1fBRtrL.js} +1 -1
  189. package/dist/client/assets/synced-repos-D7wJ-Fk5.js +1 -0
  190. package/dist/client/assets/{table-DM7hs7uh.js → table-ckrTQfL3.js} +1 -1
  191. package/dist/client/assets/{tabs-BKT17IGY.js → tabs-5w6Xddnd.js} +1 -1
  192. package/dist/client/assets/{task-board-Dlzu9-yr.js → task-board-vKM8wLvG.js} +1 -1
  193. package/dist/client/assets/{task-route-Dr0QltYS.js → task-route-DLJTLmRN.js} +1 -1
  194. package/dist/client/assets/{tasks-B1dVd6u8.js → tasks-DuH_kQ-7.js} +1 -1
  195. package/dist/client/assets/{textarea-CHDKa5kY.js → textarea-CouUXzG_.js} +1 -1
  196. package/dist/client/assets/{thread-intent-CJv_4zTn.js → thread-intent-BNbhxvmT.js} +1 -1
  197. package/dist/client/assets/{thread-route-Db3sJ7iQ.js → thread-route-CQhA6zjL.js} +1 -1
  198. package/dist/client/assets/{toggle-group-B72XzO7T.js → toggle-group-DqQ6ooDT.js} +1 -1
  199. package/dist/client/assets/{toolbar-BFDyJZKI.js → toolbar-BOTKelmV.js} +1 -1
  200. package/dist/client/assets/{toolbar-icon-button-D9OmpcPo.js → toolbar-icon-button-CTlBJlkO.js} +1 -1
  201. package/dist/client/assets/{track-qdq6WQw_.js → track-BkY2J4jR.js} +1 -1
  202. package/dist/client/assets/{types-fRb87P8D.js → types-CSe4KPYP.js} +1 -1
  203. package/dist/client/assets/{use-ai-providers-dtug9GPq.js → use-ai-providers-ClLSQInI.js} +1 -1
  204. package/dist/client/assets/{use-automations-CKVQaqlp.js → use-automations-DVhA0-8T.js} +1 -1
  205. package/dist/client/assets/{use-autosave-VA742J3M.js → use-autosave-EviKRjdT.js} +1 -1
  206. package/dist/client/assets/{use-connection-BNQVThkW.js → use-connection-CRp-xUbr.js} +1 -1
  207. package/dist/client/assets/{use-copy-CAfkUI-p.js → use-copy-D_zXi3Mu.js} +1 -1
  208. package/dist/client/assets/{use-create-virtual-mcp-BNICQ9t1.js → use-create-virtual-mcp-Dd4NmTKS.js} +1 -1
  209. package/dist/client/assets/{use-date-fns-locale-D7s9G2fa.js → use-date-fns-locale-VWfZkKej.js} +1 -1
  210. package/dist/client/assets/{use-debounced-autosave-vhMtNEVD.js → use-debounced-autosave-C-4rYsVs.js} +1 -1
  211. package/dist/client/assets/{use-debounced-value-D4cg0jGY.js → use-debounced-value-PAzAs47R.js} +1 -1
  212. package/dist/client/assets/{use-decopilot-events-BCKk69Hc.js → use-decopilot-events-xc9iStGT.js} +1 -1
  213. package/dist/client/assets/{use-delete-connection-CZ2Y5zx8.js → use-delete-connection-Bp7wAg9U.js} +1 -1
  214. package/dist/client/assets/{use-deployment-admin-j0hEmL-z.js → use-deployment-admin-my47TH5A.js} +1 -1
  215. package/dist/client/assets/{use-destination-route-1hiHQagC.js → use-destination-route-O64KTzYr.js} +1 -1
  216. package/dist/client/assets/{use-file-configs-C0U0_a2P.js → use-file-configs-hpRk_Pkk.js} +1 -1
  217. package/dist/client/assets/{use-infinite-scroll-B0RWsVj8.js → use-infinite-scroll-DiOtQ6ws.js} +1 -1
  218. package/dist/client/assets/{use-join-requests-Bl3iHwQx.js → use-join-requests-DcxsWKc9.js} +1 -1
  219. package/dist/client/assets/{use-mcp-auth-status-DiPfVWMh.js → use-mcp-auth-status-eJREGu70.js} +1 -1
  220. package/dist/client/assets/{use-mcp-client-BfCVdUs4.js → use-mcp-client-6z11vQVY.js} +1 -1
  221. package/dist/client/assets/{use-mcp-prompts-DKbPs1z0.js → use-mcp-prompts-CFzerION.js} +1 -1
  222. package/dist/client/assets/{use-mcp-tools-tw7juvM7.js → use-mcp-tools-g_4kAYMR.js} +1 -1
  223. package/dist/client/assets/{use-members-Bn_aYBYz.js → use-members-CizxuHnf.js} +1 -1
  224. package/dist/client/assets/{use-navigate-to-agent-CNRIRTRX.js → use-navigate-to-agent-Du2ZgrOE.js} +1 -1
  225. package/dist/client/assets/{use-org-auth-client-DhqQbuO8.js → use-org-auth-client-DPfwumdn.js} +1 -1
  226. package/dist/client/assets/{use-org-notice-DWhzqvok.js → use-org-notice-Div2O_Tj.js} +1 -1
  227. package/dist/client/assets/{use-org-sso-B-WZChUK.js → use-org-sso-BJyGdmQw.js} +1 -1
  228. package/dist/client/assets/{use-organization-roles-C5ovOped.js → use-organization-roles-BBUluABL.js} +1 -1
  229. package/dist/client/assets/{use-organization-settings-BXEoU6hb.js → use-organization-settings-BttgddZb.js} +1 -1
  230. package/dist/client/assets/{use-panel-navigate-BCT_mBIb.js → use-panel-navigate-BTjS0spz.js} +1 -1
  231. package/dist/client/assets/{use-registry-connections-BRldwl4Z.js → use-registry-connections-DX4Hl1Wd.js} +1 -1
  232. package/dist/client/assets/{use-secrets-DQFfv5Fo.js → use-secrets-BMVYPd8K.js} +1 -1
  233. package/dist/client/assets/{use-section-preview-base-C3JS5ixQ.js → use-section-preview-base-DnizdacS.js} +1 -1
  234. package/dist/client/assets/{use-status-sounds-BhNc04cL.js → use-status-sounds-Dn9APq4o.js} +1 -1
  235. package/dist/client/assets/{use-tags-vwAFwQ1b.js → use-tags-Cx7pBMvk.js} +1 -1
  236. package/dist/client/assets/{use-view-mode-C9-o_a9o.js → use-view-mode-DaCGaTX0.js} +1 -1
  237. package/dist/client/assets/{use-virtual-mcp-B5FuWVqP.js → use-virtual-mcp-5Mtd7u99.js} +1 -1
  238. package/dist/client/assets/useInfiniteQuery-bVpGuzqH.js +1 -0
  239. package/dist/client/assets/useSuspenseInfiniteQuery-vrEavbI2.js +1 -0
  240. package/dist/client/assets/{users-CVcVZ7yy.js → users-B5KV-t7N.js} +1 -1
  241. package/dist/client/assets/{variant-calendar-khXYaz2z.js → variant-calendar-DPKimTvg.js} +1 -1
  242. package/dist/client/assets/{view-mode-toggle-xZGJXvHE.js → view-mode-toggle-BUmaoNl3.js} +1 -1
  243. package/dist/client/index.html +1 -1
  244. package/dist/server/cli.js +564 -564
  245. package/dist/server/server.js +381 -381
  246. package/package.json +1 -1
  247. package/dist/client/assets/agents-list-B52riDP0.js +0 -1
  248. package/dist/client/assets/api-keys-BqB4blQn.js +0 -1
  249. package/dist/client/assets/app-editor-B29kO-5-.js +0 -1
  250. package/dist/client/assets/record-editor-D6jtUAHw.js +0 -1
  251. package/dist/client/assets/redirect-editor-zRV0qjxi.js +0 -1
  252. package/dist/client/assets/registry-D-RX4q_z.js +0 -2
  253. package/dist/client/assets/repositories-CKzYfB5u.js +0 -1
  254. package/dist/client/assets/repository-picker-Clq4r_Xa.js +0 -1
  255. package/dist/client/assets/settings-layout-BhHi4xqH.js +0 -1
  256. package/dist/client/assets/store-registry-CxMVUFBr.js +0 -2
  257. package/dist/client/assets/synced-repos-BcvgS6tA.js +0 -1
  258. package/dist/client/assets/useInfiniteQuery-Cg8KzmTK.js +0 -1
  259. package/dist/client/assets/useSuspenseInfiniteQuery--3DsSNuT.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as A,j as s,dt as be,b as W,r as ie,t as Z,b4 as ge,B as V,dp as he}from"./index-CmFHzaVd.js";import{a as ve,b as ye,R as Ne,c as ke,d as De,e as ne,u as Ae,G as Re}from"./repository-picker-CPgsg-CB.js";import{i as we}from"./GitBranch01-bh0uxNpJ.js";import{n as Ce}from"./LinkExternal01-BSsHZ7aL.js";import{s as oe}from"./Plus-DpxQQegv.js";import{c as le,d as ce,b as ae,f as de,g as fe,e as ue,a as pe,A as me}from"./alert-dialog-Cw7BmY2P.js";import{A as Pe}from"./avatar-BBxhmrGb.js";import{B as re}from"./badge-o_twyLc_.js";import{G as Se}from"./github-icon-CM4v-wXP.js";import{R as _e}from"./require-capability-B7n_oYja.js";import"./ChevronRight-q_JbYpOo.js";import"./dialog-XLNsYC5N.js";import"./input-BrGTSicR.js";import"./label-MXwspLYA.js";import"./useInfiniteQuery-bVpGuzqH.js";import"./infiniteQueryObserver-C1YqOU9I.js";import"./ArrowLeft-CVITrxtP.js";import"./collection-search-DDhFultb.js";import"./SearchMd-CbFIUniO.js";import"./use-debounced-value-PAzAs47R.js";import"./User01-BnCb_8UJ.js";import"./access-gate-CBB1Qus8.js";import"./capability-load-error-CKO9v57M.js";function je(t){const e=A.c(3),{provider:i,size:l}=t,n=l===void 0?16:l;let r;return e[0]!==i||e[1]!==n?(r=i==="gitlab"?s.jsx(Re,{size:n,className:"text-muted-foreground"}):s.jsx(Se,{size:n,className:"text-muted-foreground"}),e[0]=i,e[1]=n,e[2]=r):r=e[2],r}function xe(t,e){return t instanceof Error&&t.message?t.message:e}function ze(t,e){return t.authKind==="github_app"?e("settings.repositories.authKindGithubApp"):t.authKind==="oauth"?e("settings.repositories.authKindOauth"):e("settings.repositories.authKindToken")}function Ee(t,e){return t==="public"?e("settings.repositories.visibilityPublic"):t==="private"?e("settings.repositories.visibilityPrivate"):t==="internal"?e("settings.repositories.visibilityInternal"):null}function Ue(t){const e=A.c(39),{account:i,onDisconnect:l}=t,n=W(),r=i.status==="revoked"||!i.servable;let m;e[0]!==i.avatarUrl?(m=i.avatarUrl?.trim()||void 0,e[0]=i.avatarUrl,e[1]=m):m=e[1];let u;e[2]!==i.type?(u=s.jsx(je,{provider:i.type}),e[2]=i.type,e[3]=u):u=e[3];let c;e[4]!==m||e[5]!==u?(c=s.jsx(Pe,{url:m,fallback:u,shape:"circle",size:"sm",className:"size-9",muted:!0}),e[4]=m,e[5]=u,e[6]=c):c=e[6];let d;e[7]!==i.login?(d=s.jsx("span",{className:"font-medium text-sm truncate",children:i.login}),e[7]=i.login,e[8]=d):d=e[8];let o;e[9]!==r||e[10]!==n?(o=r&&s.jsx(re,{variant:"outline",className:"shrink-0",children:n("settings.repositories.needsReconnect")}),e[9]=r,e[10]=n,e[11]=o):o=e[11];let a;e[12]!==d||e[13]!==o?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[d,o]}),e[12]=d,e[13]=o,e[14]=a):a=e[14];const x=i.host;let f;e[15]!==i||e[16]!==n?(f=ze(i,n),e[15]=i,e[16]=n,e[17]=f):f=e[17];let p;e[18]!==i.host||e[19]!==f?(p=s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[x," · ",f]}),e[18]=i.host,e[19]=f,e[20]=p):p=e[20];let g;e[21]!==r||e[22]!==n?(g=r&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n("settings.repositories.needsReconnectHint")}),e[21]=r,e[22]=n,e[23]=g):g=e[23];let b;e[24]!==g||e[25]!==a||e[26]!==p?(b=s.jsxs("div",{className:"min-w-0",children:[a,p,g]}),e[24]=g,e[25]=a,e[26]=p,e[27]=b):b=e[27];let h;e[28]!==b||e[29]!==c?(h=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,b]}),e[28]=b,e[29]=c,e[30]=h):h=e[30];let j;e[31]!==n?(j=n("settings.repositories.disconnect"),e[31]=n,e[32]=j):j=e[32];let v;e[33]!==l||e[34]!==j?(v=s.jsx(V,{variant:"outline",size:"sm",onClick:l,children:j}),e[33]=l,e[34]=j,e[35]=v):v=e[35];let y;return e[36]!==h||e[37]!==v?(y=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[h,v]}),e[36]=h,e[37]=v,e[38]=y):y=e[38],y}function Te(t){const e=A.c(45),{repository:i,onUnlink:l}=t,n=W();let r;e[0]!==i.visibility||e[1]!==n?(r=Ee(i.visibility,n),e[0]=i.visibility,e[1]=n,e[2]=r):r=e[2];const m=r;let u;e[3]!==i.provider?(u=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(je,{provider:i.provider})}),e[3]=i.provider,e[4]=u):u=e[4];let c;e[5]!==i.path?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:i.path}),e[5]=i.path,e[6]=c):c=e[6];let d;e[7]!==m?(d=m&&s.jsx(re,{variant:"secondary",className:"shrink-0",children:m}),e[7]=m,e[8]=d):d=e[8];let o;e[9]!==i.accountId||e[10]!==n?(o=!i.accountId&&s.jsx(re,{variant:"outline",className:"shrink-0",children:n("settings.repositories.anonymousClone")}),e[9]=i.accountId,e[10]=n,e[11]=o):o=e[11];let a;e[12]!==c||e[13]!==d||e[14]!==o?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,d,o]}),e[12]=c,e[13]=d,e[14]=o,e[15]=a):a=e[15];let x;e[16]!==i.defaultBranch||e[17]!==n?(x=i.defaultBranch?` · ${n("settings.repositories.defaultBranch",{branch:i.defaultBranch})}`:"",e[16]=i.defaultBranch,e[17]=n,e[18]=x):x=e[18];let f;e[19]!==i.host||e[20]!==x?(f=s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[i.host,x]}),e[19]=i.host,e[20]=x,e[21]=f):f=e[21];let p;e[22]!==a||e[23]!==f?(p=s.jsxs("div",{className:"min-w-0",children:[a,f]}),e[22]=a,e[23]=f,e[24]=p):p=e[24];let g;e[25]!==u||e[26]!==p?(g=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[u,p]}),e[25]=u,e[26]=p,e[27]=g):g=e[27];const b=i.webUrl;let h;e[28]!==n?(h=n("settings.repositories.openInProvider"),e[28]=n,e[29]=h):h=e[29];let j;e[30]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ce,{size:14}),e[30]=j):j=e[30];let v;e[31]!==i.webUrl||e[32]!==h?(v=s.jsx(V,{variant:"ghost",size:"sm",asChild:!0,children:s.jsx("a",{href:b,target:"_blank",rel:"noreferrer","aria-label":h,children:j})}),e[31]=i.webUrl,e[32]=h,e[33]=v):v=e[33];let y;e[34]!==n?(y=n("settings.repositories.unlink"),e[34]=n,e[35]=y):y=e[35];let D;e[36]!==l||e[37]!==y?(D=s.jsx(V,{variant:"outline",size:"sm",onClick:l,children:y}),e[36]=l,e[37]=y,e[38]=D):D=e[38];let N;e[39]!==v||e[40]!==D?(N=s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[v,D]}),e[39]=v,e[40]=D,e[41]=N):N=e[41];let k;return e[42]!==g||e[43]!==N?(k=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[g,N]}),e[42]=g,e[43]=N,e[44]=k):k=e[44],k}function Ge(t){const e=A.c(19),{onDisconnect:i}=t,l=W(),n=ke(),r=De(),m=n.data?.github.configured===!0,u=(n.data?.gitlab.oauthHosts.length??0)>0,c=m||u;if(r.isError)throw r.error;let d;e[0]!==r.data?(d=r.data??[],e[0]=r.data,e[1]=d):d=e[1];const o=d;let a;e[2]!==l?(a=l("settings.repositories.accountsTitle"),e[2]=l,e[3]=a):a=e[3];let x;e[4]!==l?(x=l("settings.repositories.accountsDescription"),e[4]=l,e[5]=x):x=e[5];let f;e[6]!==o.length?(f=o.length>0?s.jsx(ne,{}):null,e[6]=o.length,e[7]=f):f=e[7];let p;e[8]!==r.isPending||e[9]!==c||e[10]!==i||e[11]!==o||e[12]!==l?(p=r.isPending?s.jsx(ge,{className:"h-24 w-full"}):!c&&o.length===0?s.jsxs("div",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsx("p",{className:"font-medium text-sm",children:l("settings.repositories.noProvidersTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground max-w-sm",children:l("settings.repositories.noProvidersDescription")}),s.jsx(ne,{})]}):o.length===0?s.jsxs("div",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(we,{size:20,className:"text-muted-foreground"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:l("settings.repositories.accountsEmptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l("settings.repositories.accountsEmptyDescription")})]}),s.jsx(ne,{})]}):s.jsx("section",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:o.map(b=>s.jsx(Ue,{account:b,onDisconnect:()=>i(b)},b.id))}),e[8]=r.isPending,e[9]=c,e[10]=i,e[11]=o,e[12]=l,e[13]=p):p=e[13];let g;return e[14]!==a||e[15]!==x||e[16]!==f||e[17]!==p?(g=s.jsx(he,{title:a,description:x,actions:f,children:p}),e[14]=a,e[15]=x,e[16]=f,e[17]=p,e[18]=g):g=e[18],g}function Be(t){const e=A.c(21),{onAdd:i,onUnlink:l}=t,n=W(),r=Ae();if(r.isError)throw r.error;let m;e[0]!==r.data?(m=r.data??[],e[0]=r.data,e[1]=m):m=e[1];const u=m;let c;e[2]!==n?(c=n("settings.repositories.reposTitle"),e[2]=n,e[3]=c):c=e[3];let d;e[4]!==n?(d=n("settings.repositories.reposDescription"),e[4]=n,e[5]=d):d=e[5];let o;e[6]!==i||e[7]!==u.length||e[8]!==n?(o=u.length>0?s.jsxs(V,{size:"sm",onClick:i,children:[s.jsx(oe,{size:14}),n("settings.repositories.addRepository")]}):null,e[6]=i,e[7]=u.length,e[8]=n,e[9]=o):o=e[9];let a;e[10]!==i||e[11]!==l||e[12]!==r.isPending||e[13]!==u||e[14]!==n?(a=r.isPending?s.jsx(ge,{className:"h-24 w-full"}):u.length===0?s.jsxs("div",{"data-testid":"repositories-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:n("settings.repositories.reposEmptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:n("settings.repositories.reposEmptyDescription")})]}),s.jsxs(V,{size:"sm",onClick:i,children:[s.jsx(oe,{size:14}),n("settings.repositories.addRepository")]})]}):s.jsx("section",{"data-testid":"repositories-list",className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:u.map(f=>s.jsx(Te,{repository:f,onUnlink:()=>l(f)},f.id))}),e[10]=i,e[11]=l,e[12]=r.isPending,e[13]=u,e[14]=n,e[15]=a):a=e[15];let x;return e[16]!==c||e[17]!==d||e[18]!==o||e[19]!==a?(x=s.jsx(he,{title:c,description:d,actions:o,children:a}),e[16]=c,e[17]=d,e[18]=o,e[19]=a,e[20]=x):x=e[20],x}function $e(){const t=A.c(84),e=W(),i=ve(),l=ye(),[n,r]=ie.useState(!1),[m,u]=ie.useState(null),[c,d]=ie.useState(null);let o;t[0]!==i||t[1]!==m||t[2]!==e?(o=function(){m&&i.mutate(m.id,{onSuccess:()=>Z.success(e("settings.repositories.disconnected")),onError:se=>Z.error(xe(se,e("settings.repositories.failed"))),onSettled:()=>u(null)})},t[0]=i,t[1]=m,t[2]=e,t[3]=o):o=t[3];const a=o;let x;t[4]!==l||t[5]!==c||t[6]!==e?(x=function(){c&&l.mutate(c.id,{onSuccess:()=>Z.success(e("settings.repositories.unlinked")),onError:se=>Z.error(xe(se,e("settings.repositories.failed"))),onSettled:()=>d(null)})},t[4]=l,t[5]=c,t[6]=e,t[7]=x):x=t[7];const f=x;let p;t[8]!==e?(p=e("settings.repositories.pageDescription"),t[8]=e,t[9]=p):p=t[9];let g;t[10]!==p?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:p}),t[10]=p,t[11]=g):g=t[11];let b;t[12]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ge,{onDisconnect:u}),t[12]=b):b=t[12];let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Be,{onAdd:()=>r(!0),onUnlink:d}),t[13]=h):h=t[13];let j;t[14]!==n||t[15]!==e?(j=n&&s.jsx(Ne,{open:!0,onOpenChange:r,title:e("settings.repositories.addDialogTitle"),onPicked:()=>r(!1)}),t[14]=n,t[15]=e,t[16]=j):j=t[16];const v=m!==null;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=Q=>{Q||u(null)},t[17]=y):y=t[17];const D=m?.login??"";let N;t[18]!==e||t[19]!==D?(N=e("settings.repositories.disconnectTitle",{login:D}),t[18]=e,t[19]=D,t[20]=N):N=t[20];let k;t[21]!==N?(k=s.jsx(le,{children:N}),t[21]=N,t[22]=k):k=t[22];let R;t[23]!==e?(R=e("settings.repositories.disconnectDescription"),t[23]=e,t[24]=R):R=t[24];let w;t[25]!==R?(w=s.jsx(ce,{children:R}),t[25]=R,t[26]=w):w=t[26];let C;t[27]!==k||t[28]!==w?(C=s.jsxs(ae,{children:[k,w]}),t[27]=k,t[28]=w,t[29]=C):C=t[29];let P;t[30]!==e?(P=e("settings.repositories.cancel"),t[30]=e,t[31]=P):P=t[31];let S;t[32]!==P?(S=s.jsx(de,{children:P}),t[32]=P,t[33]=S):S=t[33];let _;t[34]!==e?(_=e("settings.repositories.disconnect"),t[34]=e,t[35]=_):_=t[35];let z;t[36]!==a||t[37]!==_?(z=s.jsx(fe,{onClick:a,children:_}),t[36]=a,t[37]=_,t[38]=z):z=t[38];let E;t[39]!==S||t[40]!==z?(E=s.jsxs(ue,{children:[S,z]}),t[39]=S,t[40]=z,t[41]=E):E=t[41];let U;t[42]!==C||t[43]!==E?(U=s.jsxs(pe,{children:[C,E]}),t[42]=C,t[43]=E,t[44]=U):U=t[44];let T;t[45]!==U||t[46]!==v?(T=s.jsx(me,{open:v,onOpenChange:y,children:U}),t[45]=U,t[46]=v,t[47]=T):T=t[47];const ee=c!==null;let X;t[48]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>{Q||d(null)},t[48]=X):X=t[48];const te=c?.path??"";let G;t[49]!==e||t[50]!==te?(G=e("settings.repositories.unlinkTitle",{path:te}),t[49]=e,t[50]=te,t[51]=G):G=t[51];let B;t[52]!==G?(B=s.jsx(le,{children:G}),t[52]=G,t[53]=B):B=t[53];let $;t[54]!==e?($=e("settings.repositories.unlinkDescription"),t[54]=e,t[55]=$):$=t[55];let I;t[56]!==$?(I=s.jsx(ce,{children:$}),t[56]=$,t[57]=I):I=t[57];let O;t[58]!==B||t[59]!==I?(O=s.jsxs(ae,{children:[B,I]}),t[58]=B,t[59]=I,t[60]=O):O=t[60];let K;t[61]!==e?(K=e("settings.repositories.cancel"),t[61]=e,t[62]=K):K=t[62];let H;t[63]!==K?(H=s.jsx(de,{children:K}),t[63]=K,t[64]=H):H=t[64];let L;t[65]!==e?(L=e("settings.repositories.unlink"),t[65]=e,t[66]=L):L=t[66];let F;t[67]!==f||t[68]!==L?(F=s.jsx(fe,{onClick:f,children:L}),t[67]=f,t[68]=L,t[69]=F):F=t[69];let q;t[70]!==H||t[71]!==F?(q=s.jsxs(ue,{children:[H,F]}),t[70]=H,t[71]=F,t[72]=q):q=t[72];let M;t[73]!==O||t[74]!==q?(M=s.jsxs(pe,{children:[O,q]}),t[73]=O,t[74]=q,t[75]=M):M=t[75];let J;t[76]!==ee||t[77]!==M?(J=s.jsx(me,{open:ee,onOpenChange:X,children:M}),t[76]=ee,t[77]=M,t[78]=J):J=t[78];let Y;return t[79]!==T||t[80]!==g||t[81]!==J||t[82]!==j?(Y=s.jsxs(s.Fragment,{children:[g,b,h,j,T,J]}),t[79]=T,t[80]=g,t[81]=J,t[82]=j,t[83]=Y):Y=t[83],Y}function Ie(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(be,{group:"repositories",children:s.jsx($e,{})}),t[0]=e):e=t[0],e}function at(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(_e,{capability:"file-configs:manage",area:"files",children:s.jsx(Ie,{})}),t[0]=e):e=t[0],e}export{at as default};
@@ -1 +1 @@
1
- import{c as M,b as T,G as _,n as x,aR as j,t as b,j as L}from"./index-BTWessD-.js";import{u as O}from"./use-mcp-client-BfCVdUs4.js";import{S}from"./constants-Daqiz8AS.js";import{u as V}from"./use-navigate-to-agent-CNRIRTRX.js";import{R as D}from"./repository-picker-Clq4r_Xa.js";function F(n){const e=n.path.split("/"),r=e[e.length-1]??n.path;return{owner:e.slice(0,-1).join("/"),name:r,url:n.webUrl}}function G(n,e,r){return{title:e.name,description:r.description,pinned:!1,icon:null,metadata:{githubRepo:{owner:e.owner,name:e.name,url:e.url,repositoryId:n.id},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[]}}function B(n){const e=M.c(26),{open:r,onOpenChange:s,title:P,onImportComplete:m,mode:v}=n,a=v===void 0?"agent":v,t=T(),{org:o}=_(),h=x(),C=V();let p;e[0]!==o.id||e[1]!==o.slug?(p={connectionId:S,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=p):p=e[2];const k=O(p);let d;e[3]!==a||e[4]!==t||e[5]!==P?(d=P??t(a==="link"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[3]=a,e[4]=t,e[5]=P,e[6]=d):d=e[6];const y=d;let g;e[7]!==k||e[8]!==t?(g=async function(i,u){const l=await k.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:G(i,u,{description:t("common.repositoryPicker.agentDescription",{path:i.path})})}}),E=(l.structuredContent??l).item?.id;if(!E)throw new Error(t("common.repositoryPicker.createAgentFailed"));return E},e[7]=k,e[8]=t,e[9]=g):g=e[9];const I=g;let f;e[10]!==I||e[11]!==a||e[12]!==C||e[13]!==m||e[14]!==s||e[15]!==o.id||e[16]!==h||e[17]!==t?(f=async function(i){const u=F(i),l=a==="agent"?await I(i,u):null;j(h,o.id),s(!1),m?m({virtualMcpId:l,repository:i}):l?(b.success(t("common.githubRepoPicker.importedRepo",{name:u.name})),C(l)):b.success(t("common.githubRepoPicker.addedRepo",{name:u.name}))},e[10]=I,e[11]=a,e[12]=C,e[13]=m,e[14]=s,e[15]=o.id,e[16]=h,e[17]=t,e[18]=f):f=e[18];const w=f;let c;e[19]!==w?(c=A=>{const{repository:i}=A;return w(i)},e[19]=w,e[20]=c):c=e[20];let R;return e[21]!==s||e[22]!==r||e[23]!==y||e[24]!==c?(R=L.jsx(D,{open:r,onOpenChange:s,title:y,onPicked:c,onError:N}),e[21]=s,e[22]=r,e[23]=y,e[24]=c,e[25]=R):R=e[25],R}function N(n){return b.error(n)}export{B as R};
1
+ import{c as M,b as T,G as _,n as x,aR as j,t as b,j as L}from"./index-CmFHzaVd.js";import{u as O}from"./use-mcp-client-6z11vQVY.js";import{S}from"./constants-Daqiz8AS.js";import{u as V}from"./use-navigate-to-agent-Du2ZgrOE.js";import{R as D}from"./repository-picker-CPgsg-CB.js";function F(n){const e=n.path.split("/"),r=e[e.length-1]??n.path;return{owner:e.slice(0,-1).join("/"),name:r,url:n.webUrl}}function G(n,e,r){return{title:e.name,description:r.description,pinned:!1,icon:null,metadata:{githubRepo:{owner:e.owner,name:e.name,url:e.url,repositoryId:n.id},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[]}}function B(n){const e=M.c(26),{open:r,onOpenChange:s,title:P,onImportComplete:m,mode:v}=n,a=v===void 0?"agent":v,t=T(),{org:o}=_(),h=x(),C=V();let p;e[0]!==o.id||e[1]!==o.slug?(p={connectionId:S,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=p):p=e[2];const k=O(p);let d;e[3]!==a||e[4]!==t||e[5]!==P?(d=P??t(a==="link"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[3]=a,e[4]=t,e[5]=P,e[6]=d):d=e[6];const y=d;let g;e[7]!==k||e[8]!==t?(g=async function(i,u){const l=await k.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:G(i,u,{description:t("common.repositoryPicker.agentDescription",{path:i.path})})}}),E=(l.structuredContent??l).item?.id;if(!E)throw new Error(t("common.repositoryPicker.createAgentFailed"));return E},e[7]=k,e[8]=t,e[9]=g):g=e[9];const I=g;let f;e[10]!==I||e[11]!==a||e[12]!==C||e[13]!==m||e[14]!==s||e[15]!==o.id||e[16]!==h||e[17]!==t?(f=async function(i){const u=F(i),l=a==="agent"?await I(i,u):null;j(h,o.id),s(!1),m?m({virtualMcpId:l,repository:i}):l?(b.success(t("common.githubRepoPicker.importedRepo",{name:u.name})),C(l)):b.success(t("common.githubRepoPicker.addedRepo",{name:u.name}))},e[10]=I,e[11]=a,e[12]=C,e[13]=m,e[14]=s,e[15]=o.id,e[16]=h,e[17]=t,e[18]=f):f=e[18];const w=f;let c;e[19]!==w?(c=A=>{const{repository:i}=A;return w(i)},e[19]=w,e[20]=c):c=e[20];let R;return e[21]!==s||e[22]!==r||e[23]!==y||e[24]!==c?(R=L.jsx(D,{open:r,onOpenChange:s,title:y,onPicked:c,onError:N}),e[21]=s,e[22]=r,e[23]=y,e[24]=c,e[25]=R):R=e[25],R}function N(n){return b.error(n)}export{B as R};
@@ -0,0 +1 @@
1
+ import{c as P,j as l,G as D,a7 as F,K as R,m as se,n as J,e as W,r as L,b as M,l as X,b4 as ie,t as oe,B as U,a4 as ye,a1 as je,a2 as ve,h as ce}from"./index-CmFHzaVd.js";import{i as ne}from"./ChevronRight-q_JbYpOo.js";import{d as de,h as ue,c as fe,e as Ne,b as me,D as pe}from"./dialog-XLNsYC5N.js";import{I as re}from"./input-BrGTSicR.js";import{L as ae}from"./label-MXwspLYA.js";import{G as ee}from"./github-icon-CM4v-wXP.js";import{u as ke}from"./useInfiniteQuery-bVpGuzqH.js";import{i as Pe}from"./ArrowLeft-CVITrxtP.js";import{i as Ce}from"./GitBranch01-bh0uxNpJ.js";import{A as he}from"./avatar-BBxhmrGb.js";import{C as xe}from"./collection-search-DDhFultb.js";import{u as Se}from"./use-debounced-value-PAzAs47R.js";function te(t){const e=P.c(4),{size:n,className:o}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("path",{d:"M23.6004 9.5927l-.0337-.0862L20.3.9814a.851.851 0 00-.3362-.405.8748.8748 0 00-.9997.0539.8748.8748 0 00-.29.4399l-2.2055 6.748H7.5375L5.3318 1.0702a.8573.8573 0 00-.29-.4412.8748.8748 0 00-.9997-.0537.8585.8585 0 00-.3361.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 002.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 001.2197 0l1.4995-1.1321 2.462-1.8633 5.0062-3.7489.0125-.01a6.0682 6.0682 0 002.0094-7.003z"}),e[0]=s):s=e[0];let i;return e[1]!==o||e[2]!==n?(i=l.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:o,children:s}),e[1]=o,e[2]=n,e[3]=i):i=e[3],i}const Te=5*6e4;function we(){const t=P.c(7),{org:e}=D(),n=F();let o;t[0]!==e.id?(o=R.gitProviderCapabilities(e.id),t[0]=e.id,t[1]=o):o=t[1];let s;t[2]!==n?(s=()=>n.call("GIT_PROVIDER_CAPABILITIES",{}),t[2]=n,t[3]=s):s=t[3];let i;return t[4]!==o||t[5]!==s?(i={queryKey:o,staleTime:Te,queryFn:s},t[4]=o,t[5]=s,t[6]=i):i=t[6],se(i)}function ge(){const t=P.c(7),{org:e}=D(),n=F();let o;t[0]!==e.id?(o=R.gitAccounts(e.id),t[0]=e.id,t[1]=o):o=t[1];let s;t[2]!==n?(s=async()=>(await n.call("GIT_ACCOUNT_LIST",{})).accounts,t[2]=n,t[3]=s):s=t[3];let i;return t[4]!==o||t[5]!==s?(i={queryKey:o,staleTime:6e4,queryFn:s},t[4]=o,t[5]=s,t[6]=i):i=t[6],se(i)}function Ee(t){const e=P.c(9),{org:n}=D(),o=F();let s;e[0]!==t||e[1]!==n.id?(s=R.repositories(n.id,t),e[0]=t,e[1]=n.id,e[2]=s):s=e[2];let i;e[3]!==t||e[4]!==o?(i=async()=>(await o.call("REPOSITORY_LIST",{})).repositories,e[3]=t,e[4]=o,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,staleTime:6e4,queryFn:i},e[6]=s,e[7]=i,e[8]=r):r=e[8],se(r)}function _e(t,e){const n=P.c(12),{org:o}=D(),s=F();let i;n[0]!==t||n[1]!==o.id||n[2]!==e?(i=R.providerRepoSearch(o.id,t??"",e),n[0]=t,n[1]=o.id,n[2]=e,n[3]=i):i=n[3];const r=t!==null;let f;n[4]!==t||n[5]!==e||n[6]!==s?(f=async h=>{const{pageParam:d}=h;return t===null?{repositories:[],hasMore:!1}:await s.call("REPOSITORY_SEARCH",{accountId:t,page:d,perPage:100,...e?{query:e}:{}})},n[4]=t,n[5]=e,n[6]=s,n[7]=f):f=n[7];let c;return n[8]!==i||n[9]!==r||n[10]!==f?(c={queryKey:i,enabled:r,initialPageParam:1,getNextPageParam:Ae,staleTime:3e4,retry:!1,queryFn:f},n[8]=i,n[9]=r,n[10]=f,n[11]=c):c=n[11],ke(c)}function Ae(t,e){return t.hasMore?e.length+1:void 0}function $e(){const t=P.c(8),{org:e}=D(),n=F(),o=J();let s;t[0]!==n?(s=async f=>(await n.call("GIT_ACCOUNT_CONNECT_TOKEN",f)).account,t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.gitAccounts(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],W(r)}function st(){const t=P.c(8),{org:e}=D(),n=F(),o=J();let s;t[0]!==n?(s=f=>n.call("GIT_ACCOUNT_DELETE",{id:f}),t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>{o.invalidateQueries({queryKey:R.gitAccounts(e.id)}),o.invalidateQueries({queryKey:R.repositories(e.id)})},t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],W(r)}function ze(){const t=P.c(8),{org:e}=D(),n=F(),o=J();let s;t[0]!==n?(s=async f=>(await n.call("REPOSITORY_LINK",f)).repository,t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],W(r)}function it(){const t=P.c(8),{org:e}=D(),n=F(),o=J();let s;t[0]!==n?(s=f=>n.call("REPOSITORY_DELETE",{id:f}),t[0]=n,t[1]=s):s=t[1];let i;t[2]!==e||t[3]!==o?(i=()=>o.invalidateQueries({queryKey:R.repositories(e.id)}),t[2]=e,t[3]=o,t[4]=i):i=t[4];let r;return t[5]!==s||t[6]!==i?(r={mutationFn:s,onSettled:i},t[5]=s,t[6]=i,t[7]=r):r=t[7],W(r)}function Le(t,e){return t instanceof Error?t.message:e}function Re(t){const e=P.c(14),{layout:n,disabled:o}=t,s=n===void 0?"buttons":n,i=o===void 0?!1:o,[r,f]=L.useState(!1),c=ge();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>f(!0),e[0]=h):h=e[0];let d;e[1]!==c.data?(d=c.data??[],e[1]=c.data,e[2]=d):d=e[2];let a;e[3]!==d?(a=d.some(De),e[3]=d,e[4]=a):a=e[4];let m;e[5]!==i||e[6]!==s||e[7]!==a?(m=l.jsx(Ge,{layout:s,disabled:i,onTokenDialog:h,hasGithubAccount:a}),e[5]=i,e[6]=s,e[7]=a,e[8]=m):m=e[8];let u;e[9]!==r?(u=r&&l.jsx(Fe,{open:!0,onOpenChange:f}),e[9]=r,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=l.jsxs(l.Fragment,{children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function De(t){return t.type==="github"}function Fe(t){const e=P.c(76),{open:n,onOpenChange:o}=t,s=M(),i=$e(),[r,f]=L.useState("gitlab.com"),[c,h]=L.useState("");let d;e[0]!==i||e[1]!==r||e[2]!==o||e[3]!==s||e[4]!==c?(d=function(){!r.trim()||!c.trim()||i.mutate({type:"gitlab",host:r.trim(),token:c.trim()},{onSuccess:Z=>{oe.success(s("settings.repositories.connected",{login:Z.login})),h(""),o(!1)},onError:Z=>oe.error(Le(Z,s("settings.repositories.failed")))})},e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=c,e[5]=d):d=e[5];const a=d;let m;e[6]!==s?(m=s("settings.repositories.tokenDialogTitle"),e[6]=s,e[7]=m):m=e[7];let u;e[8]!==m?(u=l.jsx(de,{children:m}),e[8]=m,e[9]=u):u=e[9];let p;e[10]!==s?(p=s("settings.repositories.tokenDialogDescription"),e[10]=s,e[11]=p):p=e[11];let x;e[12]!==p?(x=l.jsx(ue,{children:p}),e[12]=p,e[13]=x):x=e[13];let b;e[14]!==u||e[15]!==x?(b=l.jsxs(fe,{children:[u,x]}),e[14]=u,e[15]=x,e[16]=b):b=e[16];let y;e[17]!==s?(y=s("settings.repositories.tokenHostLabel"),e[17]=s,e[18]=y):y=e[18];let g;e[19]!==y?(g=l.jsx(ae,{htmlFor:"gitlab-host",children:y}),e[19]=y,e[20]=g):g=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=Y=>f(Y.target.value),e[21]=j):j=e[21];let v;e[22]!==s?(v=s("settings.repositories.tokenHostPlaceholder"),e[22]=s,e[23]=v):v=e[23];let C;e[24]!==r||e[25]!==v?(C=l.jsx(re,{id:"gitlab-host",value:r,onChange:j,placeholder:v}),e[24]=r,e[25]=v,e[26]=C):C=e[26];let S;e[27]!==C||e[28]!==g?(S=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,C]}),e[27]=C,e[28]=g,e[29]=S):S=e[29];let N;e[30]!==s?(N=s("settings.repositories.tokenLabel"),e[30]=s,e[31]=N):N=e[31];let T;e[32]!==N?(T=l.jsx(ae,{htmlFor:"gitlab-token",children:N}),e[32]=N,e[33]=T):T=e[33];let $;e[34]===Symbol.for("react.memo_cache_sentinel")?($=Y=>h(Y.target.value),e[34]=$):$=e[34];let w;e[35]!==s?(w=s("settings.repositories.tokenPlaceholder"),e[35]=s,e[36]=w):w=e[36];let E;e[37]!==w||e[38]!==c?(E=l.jsx(re,{id:"gitlab-token",type:"password",value:c,onChange:$,placeholder:w,autoComplete:"off"}),e[37]=w,e[38]=c,e[39]=E):E=e[39];let _;e[40]!==T||e[41]!==E?(_=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[T,E]}),e[40]=T,e[41]=E,e[42]=_):_=e[42];let z;e[43]!==S||e[44]!==_?(z=l.jsxs("div",{className:"flex flex-col gap-3",children:[S,_]}),e[43]=S,e[44]=_,e[45]=z):z=e[45];let A;e[46]!==o?(A=()=>o(!1),e[46]=o,e[47]=A):A=e[47];const G=i.isPending;let k;e[48]!==s?(k=s("settings.repositories.cancel"),e[48]=s,e[49]=k):k=e[49];let O;e[50]!==i.isPending||e[51]!==A||e[52]!==k?(O=l.jsx(U,{variant:"outline",onClick:A,disabled:G,children:k}),e[50]=i.isPending,e[51]=A,e[52]=k,e[53]=O):O=e[53];let I;e[54]!==i.isPending||e[55]!==r||e[56]!==c?(I=!r.trim()||!c.trim()||i.isPending,e[54]=i.isPending,e[55]=r,e[56]=c,e[57]=I):I=e[57];let q;e[58]!==i.isPending||e[59]!==s?(q=i.isPending?s("settings.repositories.connecting"):s("settings.repositories.connect"),e[58]=i.isPending,e[59]=s,e[60]=q):q=e[60];let K;e[61]!==a||e[62]!==I||e[63]!==q?(K=l.jsx(U,{onClick:a,disabled:I,children:q}),e[61]=a,e[62]=I,e[63]=q,e[64]=K):K=e[64];let Q;e[65]!==O||e[66]!==K?(Q=l.jsxs(Ne,{children:[O,K]}),e[65]=O,e[66]=K,e[67]=Q):Q=e[67];let H;e[68]!==z||e[69]!==Q||e[70]!==b?(H=l.jsxs(me,{className:"sm:max-w-md",children:[b,z,Q]}),e[68]=z,e[69]=Q,e[70]=b,e[71]=H):H=e[71];let B;return e[72]!==o||e[73]!==n||e[74]!==H?(B=l.jsx(pe,{open:n,onOpenChange:o,children:H}),e[72]=o,e[73]=n,e[74]=H,e[75]=B):B=e[75],B}function V(t){const e=P.c(25),{layout:n,label:o,description:s,icon:i,href:r,onClick:f,disabled:c}=t;let h;e[0]!==s||e[1]!==c||e[2]!==i||e[3]!==o||e[4]!==n?(h=n==="picker"?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:i}),l.jsxs("span",{className:"flex-1 min-w-0 text-left",children:[l.jsx("span",{className:"block text-sm font-medium",children:o}),l.jsx("span",{className:"block text-xs font-normal text-muted-foreground whitespace-normal",children:s})]}),!c&&l.jsx("span",{className:"shrink-0 text-muted-foreground",children:l.jsx(ne,{size:16})})]}):l.jsxs(l.Fragment,{children:[i,o]}),e[0]=s,e[1]=c,e[2]=i,e[3]=o,e[4]=n,e[5]=h):h=e[5];const d=h,a=n==="picker"?"ghost":"outline",m=n==="picker"&&"w-full h-auto justify-start gap-3 rounded-none px-4 py-3 hover:bg-accent";let u;e[6]!==m?(u=X(m),e[6]=m,e[7]=u):u=e[7];const p=!!r&&!c;let x;e[8]!==d||e[9]!==c||e[10]!==r?(x=r&&!c?l.jsx("a",{href:r,children:d}):d,e[8]=d,e[9]=c,e[10]=r,e[11]=x):x=e[11];let b;e[12]!==c||e[13]!==o||e[14]!==f||e[15]!==a||e[16]!==u||e[17]!==p||e[18]!==x?(b=l.jsx(U,{size:"sm",variant:a,className:u,"aria-label":o,disabled:c,asChild:p,onClick:f,children:x}),e[12]=c,e[13]=o,e[14]=f,e[15]=a,e[16]=u,e[17]=p,e[18]=x,e[19]=b):b=e[19];const y=b;let g;return e[20]!==y||e[21]!==s||e[22]!==c||e[23]!==n?(g=n==="buttons"&&c?l.jsxs(ye,{children:[l.jsx(je,{asChild:!0,children:l.jsx("span",{tabIndex:0,children:y})}),l.jsx(ve,{children:s})]}):y,e[20]=y,e[21]=s,e[22]=c,e[23]=n,e[24]=g):g=e[24],g}function Ge(t){const e=P.c(51),{layout:n,disabled:o,onTokenDialog:s,hasGithubAccount:i}=t,r=M(),f=we(),{org:c}=D(),h=`/${c.slug}/settings/repositories`;let d;e[0]!==h?(d=k=>`${k}?returnTo=${encodeURIComponent(h)}`,e[0]=h,e[1]=d):d=e[1];const a=d;if(f.isError){let k;return e[2]!==f.error.message?(k=l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:f.error.message}),e[2]=f.error.message,e[3]=k):k=e[3],k}const m=f.data?.github,u=f.data?.gitlab,p=m?.configured===!0,x=(u?.oauthHosts.length??0)>0;if(f.isPending){let k;return e[4]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(ie,{className:"h-9 w-40"}),e[4]=k):k=e[4],k}const b=n==="picker"?"flex-col":"flex-wrap items-center gap-2";let y;e[5]!==b?(y=X("flex",b),e[5]=b,e[6]=y):y=e[6];let g;e[7]!==r?(g=r("settings.repositories.connectGithub"),e[7]=r,e[8]=g):g=e[8];const j=p?"settings.repositories.browseAccount":"settings.repositories.githubUnavailable";let v;e[9]!==r||e[10]!==j?(v=r(j),e[9]=r,e[10]=j,e[11]=v):v=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx(ee,{size:16}),e[12]=C):C=e[12];const S=m?.connectPath?a(m.connectPath):void 0,N=o||!p||!m?.connectPath;let T;e[13]!==n||e[14]!==g||e[15]!==v||e[16]!==S||e[17]!==N?(T=l.jsx(V,{layout:n,label:g,description:v,icon:C,href:S,disabled:N}),e[13]=n,e[14]=g,e[15]=v,e[16]=S,e[17]=N,e[18]=T):T=e[18];let $;e[19]!==a||e[20]!==o||e[21]!==m||e[22]!==p||e[23]!==i||e[24]!==n||e[25]!==r?($=p&&i&&m?.installPath&&l.jsx(V,{layout:n,label:r("settings.repositories.installGithub"),description:r("settings.repositories.browseAccount"),icon:l.jsx(ee,{size:16}),href:a(m.installPath),disabled:o}),e[19]=a,e[20]=o,e[21]=m,e[22]=p,e[23]=i,e[24]=n,e[25]=r,e[26]=$):$=e[26];let w;e[27]!==a||e[28]!==o||e[29]!==u||e[30]!==x||e[31]!==n||e[32]!==r?(w=x&&u?.connectPath&&l.jsx(V,{layout:n,label:r("settings.repositories.connectGitlab"),description:r("settings.repositories.browseAccount"),icon:l.jsx(te,{size:16}),href:a(u.connectPath),disabled:o}),e[27]=a,e[28]=o,e[29]=u,e[30]=x,e[31]=n,e[32]=r,e[33]=w):w=e[33];let E;e[34]!==r?(E=r("settings.repositories.connectGitlabToken"),e[34]=r,e[35]=E):E=e[35];let _;e[36]!==r?(_=r("settings.repositories.gitlabTokenHint"),e[36]=r,e[37]=_):_=e[37];let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=l.jsx(te,{size:16}),e[38]=z):z=e[38];let A;e[39]!==o||e[40]!==n||e[41]!==s||e[42]!==E||e[43]!==_?(A=l.jsx(V,{layout:n,label:E,description:_,icon:z,onClick:s,disabled:o}),e[39]=o,e[40]=n,e[41]=s,e[42]=E,e[43]=_,e[44]=A):A=e[44];let G;return e[45]!==T||e[46]!==$||e[47]!==w||e[48]!==A||e[49]!==y?(G=l.jsxs("div",{className:y,children:[T,$,w,A]}),e[45]=T,e[46]=$,e[47]=w,e[48]=A,e[49]=y,e[50]=G):G=e[50],G}function le(t){const e=P.c(3),{provider:n,className:o}=t;let s;return e[0]!==o||e[1]!==n?(s=n==="gitlab"?l.jsx(te,{size:16,className:o}):l.jsx(ee,{size:16,className:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s}function Oe(t){return(t??[]).filter(e=>e.status==="active"&&e.servable)}function be(t){const e=P.c(20),{provider:n,path:o,host:s,hint:i,disabled:r,busy:f,onSelect:c}=t,h=r&&"opacity-60 cursor-not-allowed";let d;e[0]!==h?(d=X("w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent",h),e[0]=h,e[1]=d):d=e[1];let a;e[2]!==n?(a=l.jsx("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:l.jsx(le,{provider:n,className:"text-muted-foreground"})}),e[2]=n,e[3]=a):a=e[3];let m;e[4]!==o?(m=l.jsx("span",{className:"block text-sm font-medium truncate",children:o}),e[4]=o,e[5]=m):m=e[5];const u=i?`${s} · ${i}`:s;let p;e[6]!==u?(p=l.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:u}),e[6]=u,e[7]=p):p=e[7];let x;e[8]!==m||e[9]!==p?(x=l.jsxs("span",{className:"flex-1 min-w-0",children:[m,p]}),e[8]=m,e[9]=p,e[10]=x):x=e[10];let b;e[11]!==f?(b=f?l.jsx(ce,{className:"size-4 text-muted-foreground"}):l.jsx(ne,{size:16,className:"shrink-0 text-muted-foreground"}),e[11]=f,e[12]=b):b=e[12];let y;return e[13]!==r||e[14]!==c||e[15]!==d||e[16]!==a||e[17]!==x||e[18]!==b?(y=l.jsxs("button",{type:"button",disabled:r,onClick:c,className:d,children:[a,x,b]}),e[13]=r,e[14]=c,e[15]=d,e[16]=a,e[17]=x,e[18]=b,e[19]=y):y=e[19],y}function Ie(t){const e=P.c(25),{onPick:n,pendingPath:o}=t,s=M(),i=Ee(),[r,f]=L.useState("");if(i.isPending){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(ie,{className:"h-24 w-full"}),e[0]=d):d=e[0],d}if(i.isError){let d;return e[1]!==i.error.message?(d=l.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:i.error.message}),e[1]=i.error.message,e[2]=d):d=e[2],d}let c,h;if(e[3]!==n||e[4]!==o||e[5]!==r||e[6]!==i.data||e[7]!==s){h=Symbol.for("react.early_return_sentinel");e:{const d=i.data??[];if(d.length===0){h=null;break e}let a;e[10]!==r?(a=j=>j.path.toLowerCase().includes(r.trim().toLowerCase()),e[10]=r,e[11]=a):a=e[11];const m=d.filter(a);let u;e[12]!==s?(u=s("common.repositoryPicker.searchPlaceholder"),e[12]=s,e[13]=u):u=e[13];const p=o!==null;let x;e[14]!==r||e[15]!==u||e[16]!==p?(x=l.jsx(xe,{value:r,onChange:f,placeholder:u,disabled:p}),e[14]=r,e[15]=u,e[16]=p,e[17]=x):x=e[17];let b;e[18]!==s?(b=s("common.repositoryPicker.linkedSection"),e[18]=s,e[19]=b):b=e[19];let y;e[20]!==b?(y=l.jsx("p",{className:"px-4 pt-4 pb-2 text-xs font-medium text-muted-foreground",children:b}),e[20]=b,e[21]=y):y=e[21];let g;e[22]!==n||e[23]!==o?(g=j=>l.jsx(be,{provider:j.provider,path:j.path,host:j.host,hint:j.defaultBranch,disabled:o!==null,busy:o===j.id,onSelect:()=>n(j)},j.id),e[22]=n,e[23]=o,e[24]=g):g=e[24],c=l.jsxs("div",{className:"pb-2",children:[x,y,m.length===0&&l.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:s("common.repositoryPicker.searchEmpty")}),m.map(g)]})}e[3]=n,e[4]=o,e[5]=r,e[6]=i.data,e[7]=s,e[8]=c,e[9]=h}else c=e[8],h=e[9];return h!==Symbol.for("react.early_return_sentinel")?h:c}function qe(t){const e=P.c(35),{account:n,onLink:o,pendingPath:s}=t,i=M(),[r,f]=L.useState(""),c=Se(r,300),h=L.useDeferredValue(c),d=r!==h,a=_e(n.id,h);let m,u,p,x;if(e[0]!==d||e[1]!==o||e[2]!==s||e[3]!==r||e[4]!==a.data?.pages||e[5]!==a.error||e[6]!==a.hasNextPage||e[7]!==a.isError||e[8]!==a.isFetching||e[9]!==a.isPending||e[10]!==i){const j=a.data?.pages.flatMap(Ke)??[];p="h-80 min-h-0 flex flex-col overflow-hidden";let v;e[15]!==i?(v=i("common.repositoryPicker.searchPlaceholder"),e[15]=i,e[16]=v):v=e[16];const C=d||a.isFetching;e[17]!==r||e[18]!==v||e[19]!==C?(x=l.jsx(xe,{placeholder:v,value:r,onChange:f,isSearching:C}),e[17]=r,e[18]=v,e[19]=C,e[20]=x):x=e[20];const S=d?"opacity-40":"opacity-100";e[21]!==S?(m=X("flex-1 overflow-y-auto transition-opacity duration-150",S),e[21]=S,e[22]=m):m=e[22],u=a.isPending?l.jsx("div",{className:"flex-1 flex items-center justify-center py-10",children:l.jsx(ce,{className:"size-4.5 text-muted-foreground"})}):a.isError?l.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:a.error instanceof Error?a.error.message:i("common.repositoryPicker.searchFailed")}):j.length===0?l.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:i(a.hasNextPage?"common.repositoryPicker.searchMore":"common.repositoryPicker.searchEmpty")}):j.map(N=>l.jsx(be,{provider:N.ref.provider,path:N.ref.path,host:N.ref.host,hint:N.visibility,disabled:s!==null,busy:s===N.ref.path,onSelect:()=>o(N.webUrl,N.ref.path)},`${N.ref.host}/${N.ref.path}`)),e[0]=d,e[1]=o,e[2]=s,e[3]=r,e[4]=a.data?.pages,e[5]=a.error,e[6]=a.hasNextPage,e[7]=a.isError,e[8]=a.isFetching,e[9]=a.isPending,e[10]=i,e[11]=m,e[12]=u,e[13]=p,e[14]=x}else m=e[11],u=e[12],p=e[13],x=e[14];let b;e[23]!==s||e[24]!==a||e[25]!==i?(b=a.hasNextPage&&l.jsx(U,{variant:"ghost",className:"w-full",disabled:a.isFetchingNextPage||s!==null,onClick:()=>{a.fetchNextPage()},children:i("common.repositoryPicker.loadMore")}),e[23]=s,e[24]=a,e[25]=i,e[26]=b):b=e[26];let y;e[27]!==m||e[28]!==u||e[29]!==b?(y=l.jsxs("div",{className:m,children:[u,b]}),e[27]=m,e[28]=u,e[29]=b,e[30]=y):y=e[30];let g;return e[31]!==p||e[32]!==x||e[33]!==y?(g=l.jsxs("div",{className:p,children:[x,y]}),e[31]=p,e[32]=x,e[33]=y,e[34]=g):g=e[34],g}function Ke(t){return t.repositories}function Qe(t){const e=P.c(14),{accounts:n,onSelect:o,disabled:s}=t,i=M();let r;e[0]!==i?(r=i("common.repositoryPicker.browseSection"),e[0]=i,e[1]=r):r=e[1];let f;e[2]!==r?(f=l.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:r}),e[2]=r,e[3]=f):f=e[3];let c;if(e[4]!==n||e[5]!==s||e[6]!==o){let d;e[8]!==s||e[9]!==o?(d=a=>l.jsxs("button",{type:"button",onClick:()=>o(a),disabled:s,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:opacity-50",children:[l.jsx(he,{url:a.avatarUrl?.trim()||void 0,fallback:l.jsx(le,{provider:a.type,className:"text-muted-foreground"}),shape:"circle",size:"sm",className:"size-8",muted:!0}),l.jsxs("span",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"block text-sm font-medium truncate",children:a.login}),l.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:a.host})]}),l.jsx(ne,{size:16,className:"text-muted-foreground"})]},a.id),e[8]=s,e[9]=o,e[10]=d):d=e[10],c=n.map(d),e[4]=n,e[5]=s,e[6]=o,e[7]=c}else c=e[7];let h;return e[11]!==f||e[12]!==c?(h=l.jsxs("div",{className:"py-2",children:[f,c]}),e[11]=f,e[12]=c,e[13]=h):h=e[13],h}function nt({open:t,onOpenChange:e,title:n,onPicked:o,onError:s}){const i=M(),r=ge(),f=ze(),[c,h]=L.useState(null),[d,a]=L.useState(null),[m,u]=L.useState(null),p=Oe(r.data);function x(g){const j=g instanceof Error?g.message:i("common.repositoryPicker.linkFailed");u(j),s?.(j)}async function b(g){a(g.id),u(null);try{await o({repository:g})}catch(j){x(j)}finally{a(null)}}async function y(g,j){if(c){a(j),u(null);try{const v=await f.mutateAsync({url:g,accountId:c.id});await o({repository:v})}catch(v){x(v)}finally{a(null)}}}return l.jsx(pe,{open:t,onOpenChange:g=>{d===null&&(g||(h(null),u(null)),e(g))},children:l.jsxs(me,{className:"sm:max-w-lg max-h-[85svh] p-0 gap-0 overflow-hidden flex flex-col",children:[l.jsxs(fe,{className:"sr-only",children:[l.jsx(de,{children:n}),l.jsx(ue,{children:i("common.repositoryPicker.description")})]}),l.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 pr-12 gap-3 shrink-0",children:[c?l.jsx(U,{size:"icon",variant:"ghost",className:"size-6 -ml-1",disabled:d!==null,onClick:()=>h(null),"aria-label":i("common.repositoryPicker.back"),children:l.jsx(Pe,{size:16})}):l.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),c&&l.jsx(he,{url:c.avatarUrl?.trim()||void 0,fallback:l.jsx(le,{provider:c.type,className:"text-muted-foreground"}),shape:"circle",size:"sm",className:"size-6",muted:!0}),l.jsx("span",{className:"text-sm font-medium truncate",children:c?c.login:n})]}),r.isPending?l.jsx("div",{className:"p-4",children:l.jsx(ie,{className:"h-24 w-full"})}):r.isError?l.jsx("p",{role:"alert",className:"p-4 text-sm text-destructive",children:r.error.message}):c?l.jsx(qe,{account:c,onLink:(g,j)=>{y(g,j)},pendingPath:d},c.id):l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l.jsx(Ie,{onPick:b,pendingPath:d}),p.length>0&&l.jsx(Qe,{accounts:p,onSelect:h,disabled:d!==null}),l.jsxs("div",{className:"border-t border-border py-2",children:[l.jsx("p",{className:"px-4 py-2 text-xs text-muted-foreground leading-relaxed",children:i("common.repositoryPicker.description")}),l.jsx(Re,{layout:"picker",disabled:d!==null})]})]}),m&&l.jsx("p",{role:"alert",className:"px-4 pb-3 text-sm text-destructive",children:m})]})})}export{te as G,nt as R,st as a,it as b,we as c,ge as d,Re as e,Ee as u};
@@ -1 +1 @@
1
- import{c as p,b8 as l,j as m}from"./index-BTWessD-.js";import{A as u}from"./access-gate-Cr-4LceV.js";function f(c){const t=p.c(6),{capability:n,area:r,children:a}=c,{granted:i,loading:s,error:o}=l(n);let e;return t[0]!==r||t[1]!==a||t[2]!==o||t[3]!==i||t[4]!==s?(e=m.jsx(u,{granted:i,loading:s,error:o,area:r,children:a}),t[0]=r,t[1]=a,t[2]=o,t[3]=i,t[4]=s,t[5]=e):e=t[5],e}export{f as R};
1
+ import{c as p,b8 as l,j as m}from"./index-CmFHzaVd.js";import{A as u}from"./access-gate-CBB1Qus8.js";function f(c){const t=p.c(6),{capability:n,area:r,children:a}=c,{granted:i,loading:s,error:o}=l(n);let e;return t[0]!==r||t[1]!==a||t[2]!==o||t[3]!==i||t[4]!==s?(e=m.jsx(u,{granted:i,loading:s,error:o,area:r,children:a}),t[0]=r,t[1]=a,t[2]=o,t[3]=i,t[4]=s,t[5]=e):e=t[5],e}export{f as R};
@@ -1 +1 @@
1
- import{c as a,b as u,a as f,j as s,h as d,N as h}from"./index-BTWessD-.js";function x(){const i=a.c(1),e=window.location.pathname+window.location.search;let n;if(i[0]===Symbol.for("react.memo_cache_sentinel")){const c=e==="/login"||e.startsWith("/login?")?{}:{next:e};n=s.jsx(h,{to:"/login",search:c,replace:!0}),i[0]=n}else n=i[0];return n}function j(i){const e=a.c(7),{children:n}=i,o=u(),{data:c,isPending:m}=f.useSession();if(c){let t;return e[0]!==n?(t=s.jsx(s.Fragment,{children:n}),e[0]=n,e[1]=t):t=e[1],t}if(m){let t;e[2]!==o?(t=o("common.loading"),e[2]=o,e[3]=t):t=e[3];let l;return e[4]!==t?(l=s.jsx("div",{className:"flex min-h-dvh w-full items-center justify-center",children:s.jsx(d,{className:"size-5 text-muted-foreground",label:t})}),e[4]=t,e[5]=l):l=e[5],l}let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(x,{}),e[6]=r):r=e[6],r}export{j as R};
1
+ import{c as a,b as u,a as f,j as s,h as d,N as h}from"./index-CmFHzaVd.js";function x(){const i=a.c(1),e=window.location.pathname+window.location.search;let n;if(i[0]===Symbol.for("react.memo_cache_sentinel")){const c=e==="/login"||e.startsWith("/login?")?{}:{next:e};n=s.jsx(h,{to:"/login",search:c,replace:!0}),i[0]=n}else n=i[0];return n}function j(i){const e=a.c(7),{children:n}=i,o=u(),{data:c,isPending:m}=f.useSession();if(c){let t;return e[0]!==n?(t=s.jsx(s.Fragment,{children:n}),e[0]=n,e[1]=t):t=e[1],t}if(m){let t;e[2]!==o?(t=o("common.loading"),e[2]=o,e[3]=t):t=e[3];let l;return e[4]!==t?(l=s.jsx("div",{className:"flex min-h-dvh w-full items-center justify-center",children:s.jsx(d,{className:"size-5 text-muted-foreground",label:t})}),e[4]=t,e[5]=l):l=e[5],l}let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(x,{}),e[6]=r):r=e[6],r}export{j as R};
@@ -1 +1 @@
1
- import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-BTWessD-.js";import{I as D}from"./input-iu36jhQK.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
1
+ import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-CmFHzaVd.js";import{I as D}from"./input-BrGTSicR.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
@@ -1 +1 @@
1
- import{c as x,b as j,j as n,dq as w,dp as h,t as S,dr as K}from"./index-BTWessD-.js";import{S as C}from"./switch-DDadtPed.js";import{e as R,a as A,i as $,d as z,f as D,c as M,b as k}from"./UserSquare-CCKOKhgs.js";import{i as E}from"./GitBranch01-YPeQcTAV.js";import{i as F,u as O,j as P}from"./use-organization-settings-BXEoU6hb.js";function H(){const e=x.c(13),t=j();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=t("settings.review.description"),e[2]=t,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(g,{flag:"reviewer_enabled",icon:n.jsx(R,{size:16}),titleKey:"settings.review.reviewerTitle",descriptionKey:"settings.review.reviewerDescription"}),e[4]=o):o=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(g,{flag:"cheap_reviewer_model",icon:n.jsx(A,{size:16}),titleKey:"settings.review.cheapReviewerModelTitle",descriptionKey:"settings.review.cheapReviewerModelDescription"}),e[5]=r):r=e[5];let d,l;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(g,{flag:"auto_merge",icon:n.jsx($,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),l=n.jsx(L,{}),e[6]=d,e[7]=l):(d=e[6],l=e[7]);let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(g,{flag:"delivery_lanes_enabled",icon:n.jsx(z,{size:16}),titleKey:"settings.review.deliveryLanesTitle",descriptionKey:"settings.review.deliveryLanesDescription"}),e[8]=f):f=e[8];let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs(w,{children:[o,r,d,l,f,n.jsx(g,{flag:"auto_assign_report_tasks_to_super_agent",icon:n.jsx(D,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[9]=a):a=e[9];let c;return e[10]!==s||e[11]!==i?(c=n.jsx(h,{title:s,description:i,children:a}),e[10]=s,e[11]=i,e[12]=c):c=e[12],c}function J(){const e=x.c(8),t=j();let s;e[0]!==t?(s=t("settings.agentTools.title"),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=t("settings.agentTools.description"),e[2]=t,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(w,{children:n.jsx(g,{flag:"coding_agent_org_mcps",icon:n.jsx(M,{size:16}),titleKey:"settings.agentTools.orgMcpsTitle",descriptionKey:"settings.agentTools.orgMcpsDescription"})}),e[4]=o):o=e[4];let r;return e[5]!==s||e[6]!==i?(r=n.jsx(h,{title:s,description:i,children:o}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function N(){const e=x.c(5),t=j();let s;e[0]!==t?(s=t("sidebar.agentsSection.codeAgents"),e[0]=t,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(w,{children:n.jsx(g,{flag:"coding_agents_claude_code",icon:n.jsx(k,{size:16}),titleKey:"settings.agentTools.codingAgentsClaudeCodeTitle",descriptionKey:"settings.agentTools.codingAgentsClaudeCodeDescription"})}),e[2]=i):i=e[2];let o;return e[3]!==s?(o=n.jsx(h,{title:s,children:i}),e[3]=s,e[4]=o):o=e[4],o}function L(){const e=x.c(3),t=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(E,{size:16}),e[0]=s):s=e[0];let i;return e[1]!==t?(i=n.jsx(g,{flag:"auto_resolve_conflicts",icon:s,titleKey:"settings.review.autoResolveConflictsTitle",descriptionKey:"settings.review.autoResolveConflictsDescription",enabled:t}),e[1]=t,e[2]=i):i=e[2],i}function g(e){const t=x.c(23),{flag:s,icon:i,titleKey:o,descriptionKey:r,enabled:d}=e,l=j(),f=O(s),a=d??f,c=P();let p;t[0]!==l||t[1]!==o?(p=l(o),t[0]=l,t[1]=o,t[2]=p):p=t[2];let m;t[3]!==r||t[4]!==l?(m=l(r),t[3]=r,t[4]=l,t[5]=m):m=t[5];const T=c.isPending;let _;t[6]!==l||t[7]!==o?(_=l(o),t[6]=l,t[7]=o,t[8]=_):_=t[8];let u;t[9]!==s||t[10]!==c||t[11]!==l?(u=b=>c.mutate(s,b,{onError:()=>S.error(l("settings.review.updateError"))}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12];let v;t[13]!==a||t[14]!==c.isPending||t[15]!==_||t[16]!==u?(v=n.jsx(C,{checked:a,disabled:T,"aria-label":_,onCheckedChange:u}),t[13]=a,t[14]=c.isPending,t[15]=_,t[16]=u,t[17]=v):v=t[17];let y;return t[18]!==i||t[19]!==p||t[20]!==m||t[21]!==v?(y=n.jsx(K,{icon:i,title:p,description:m,action:v}),t[18]=i,t[19]=p,t[20]=m,t[21]=v,t[22]=y):y=t[22],y}export{J as A,N as C,H as R};
1
+ import{c as x,b as j,j as n,dq as w,dp as h,t as S,dr as K}from"./index-CmFHzaVd.js";import{S as C}from"./switch-B1fBRtrL.js";import{e as R,a as A,i as $,d as z,f as D,c as M,b as k}from"./UserSquare-CI7iMhe-.js";import{i as E}from"./GitBranch01-bh0uxNpJ.js";import{i as F,u as O,j as P}from"./use-organization-settings-BttgddZb.js";function H(){const e=x.c(13),t=j();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=t("settings.review.description"),e[2]=t,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(g,{flag:"reviewer_enabled",icon:n.jsx(R,{size:16}),titleKey:"settings.review.reviewerTitle",descriptionKey:"settings.review.reviewerDescription"}),e[4]=o):o=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(g,{flag:"cheap_reviewer_model",icon:n.jsx(A,{size:16}),titleKey:"settings.review.cheapReviewerModelTitle",descriptionKey:"settings.review.cheapReviewerModelDescription"}),e[5]=r):r=e[5];let d,l;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(g,{flag:"auto_merge",icon:n.jsx($,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),l=n.jsx(L,{}),e[6]=d,e[7]=l):(d=e[6],l=e[7]);let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(g,{flag:"delivery_lanes_enabled",icon:n.jsx(z,{size:16}),titleKey:"settings.review.deliveryLanesTitle",descriptionKey:"settings.review.deliveryLanesDescription"}),e[8]=f):f=e[8];let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs(w,{children:[o,r,d,l,f,n.jsx(g,{flag:"auto_assign_report_tasks_to_super_agent",icon:n.jsx(D,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[9]=a):a=e[9];let c;return e[10]!==s||e[11]!==i?(c=n.jsx(h,{title:s,description:i,children:a}),e[10]=s,e[11]=i,e[12]=c):c=e[12],c}function J(){const e=x.c(8),t=j();let s;e[0]!==t?(s=t("settings.agentTools.title"),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=t("settings.agentTools.description"),e[2]=t,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(w,{children:n.jsx(g,{flag:"coding_agent_org_mcps",icon:n.jsx(M,{size:16}),titleKey:"settings.agentTools.orgMcpsTitle",descriptionKey:"settings.agentTools.orgMcpsDescription"})}),e[4]=o):o=e[4];let r;return e[5]!==s||e[6]!==i?(r=n.jsx(h,{title:s,description:i,children:o}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function N(){const e=x.c(5),t=j();let s;e[0]!==t?(s=t("sidebar.agentsSection.codeAgents"),e[0]=t,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(w,{children:n.jsx(g,{flag:"coding_agents_claude_code",icon:n.jsx(k,{size:16}),titleKey:"settings.agentTools.codingAgentsClaudeCodeTitle",descriptionKey:"settings.agentTools.codingAgentsClaudeCodeDescription"})}),e[2]=i):i=e[2];let o;return e[3]!==s?(o=n.jsx(h,{title:s,children:i}),e[3]=s,e[4]=o):o=e[4],o}function L(){const e=x.c(3),t=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(E,{size:16}),e[0]=s):s=e[0];let i;return e[1]!==t?(i=n.jsx(g,{flag:"auto_resolve_conflicts",icon:s,titleKey:"settings.review.autoResolveConflictsTitle",descriptionKey:"settings.review.autoResolveConflictsDescription",enabled:t}),e[1]=t,e[2]=i):i=e[2],i}function g(e){const t=x.c(23),{flag:s,icon:i,titleKey:o,descriptionKey:r,enabled:d}=e,l=j(),f=O(s),a=d??f,c=P();let p;t[0]!==l||t[1]!==o?(p=l(o),t[0]=l,t[1]=o,t[2]=p):p=t[2];let m;t[3]!==r||t[4]!==l?(m=l(r),t[3]=r,t[4]=l,t[5]=m):m=t[5];const T=c.isPending;let _;t[6]!==l||t[7]!==o?(_=l(o),t[6]=l,t[7]=o,t[8]=_):_=t[8];let u;t[9]!==s||t[10]!==c||t[11]!==l?(u=b=>c.mutate(s,b,{onError:()=>S.error(l("settings.review.updateError"))}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12];let v;t[13]!==a||t[14]!==c.isPending||t[15]!==_||t[16]!==u?(v=n.jsx(C,{checked:a,disabled:T,"aria-label":_,onCheckedChange:u}),t[13]=a,t[14]=c.isPending,t[15]=_,t[16]=u,t[17]=v):v=t[17];let y;return t[18]!==i||t[19]!==p||t[20]!==m||t[21]!==v?(y=n.jsx(K,{icon:i,title:p,description:m,action:v}),t[18]=i,t[19]=p,t[20]=m,t[21]=v,t[22]=y):y=t[22],y}export{J as A,N as C,H as R};
@@ -1 +1 @@
1
- import{b as ie,r as Q,G as Ge,K as de,m as Ve,j as s,l as Z,h as Oe,B as ae,c as X,ae as qe,af as we,ag as re,ak as Ze,ah as Je,n as ot,aq as Ct,ar as bt,e as nt,t as Ce,o as Ye,P as Ne,z as it,dp as We,dq as Xe,dr as et,C as jt,a3 as Me,a4 as De,a1 as Pe,a2 as ve,ap as tt,bZ as Mt,u as rt,dt as at,fg as Dt,E as Pt,d as vt}from"./index-BTWessD-.js";import{u as Lt}from"./use-organization-roles-C5ovOped.js";import{u as Ke}from"./use-org-auth-client-DhqQbuO8.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as be}from"./badge-9zrzkd9r.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as Tt,g as _t,e as ht}from"./alert-dialog-DZRE4L1N.js";import{c as wt,D as Gt,b as Ut,a as kt}from"./dropdown-menu-BhcUPwf0.js";import{i as Bt}from"./DotsVertical-uF4drraF.js";import{s as Be}from"./Plus-olH6X81H.js";import{s as Vt}from"./Trash01-BQv1GGxn.js";import{C as Yt}from"./collection-table-wrapper-CwZpFm21.js";import{E as st}from"./empty-state-CxT3M9ru.js";import{S as ze}from"./search-input-By7Y_FrK.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Fe}from"./integration-icon-BZcJvfZm.js";import{u as Kt}from"./use-infinite-scroll-B0RWsVj8.js";import{C as Qe}from"./checkbox-cysNC-i2.js";import{i as zt}from"./ArrowLeft-DzPPKu6O.js";import{u as Ft}from"./useSuspenseInfiniteQuery--3DsSNuT.js";import{u as Qt}from"./use-mcp-client-BfCVdUs4.js";import{S as $t}from"./constants-Daqiz8AS.js";import{C as Ht}from"./collection-search-CoHiMicq.js";import{p as qt}from"./connection-EhEiPNb8.js";import{a as xt}from"./use-members-Bn_aYBYz.js";import{g as pt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-BNQVThkW.js";import{u as Jt,g as Wt}from"./use-ai-providers-dtug9GPq.js";import{A as Rt}from"./avatar-DdjivLvx.js";import{S as je}from"./switch-DDadtPed.js";import{t as Xt}from"./ChevronUp-C06mVmvV.js";import{i as es}from"./ChevronRight-ambRheJD.js";import{A as ts}from"./access-gate-Cr-4LceV.js";import"./Check-BTRkTQJX.js";import"./table-DM7hs7uh.js";import"./ArrowUp-CAKLD40b.js";import"./SearchMd-CGBqTx98.js";import"./Tool02-DIK4BIPI.js";import"./agent-icon-BX_m4kFr.js";import"./AlertCircle-D2D51Xj2.js";import"./Tool01-DoCGAF0P.js";import"./XCircle-BVm_7tfF.js";import"./TrendUp01-B_O79VuK.js";import"./ZoomOut-D2uupZS7.js";import"./Users03-D8v2VuQ9.js";import"./CheckCircle-B78PLzU_.js";import"./ChevronSelectorVertical-DVtkdLaj.js";import"./UserSquare-CCKOKhgs.js";import"./Copy01-DVCq_O3T.js";import"./CreditCard01-CES6U0TA.js";import"./Download01-PVoxfKZo.js";import"./Settings02-gFbaDyQo.js";import"./Eye-C6uXiXzi.js";import"./Share07-DcU-zxAl.js";import"./GitBranch01-YPeQcTAV.js";import"./Globe01-V6lehu4e.js";import"./XClose-D4VcMT4v.js";import"./HardDrive-DKdozTpB.js";import"./Image01-JsWosAfi.js";import"./Key01-Cw_kEwMY.js";import"./Link01-Z2g3bDmm.js";import"./LinkExternal01-5uXO9mvN.js";import"./Monitor01-qBNRPc9z.js";import"./Sun-B19fT9gQ.js";import"./Package-DNwbFhHp.js";import"./Palette-Bm9PktVe.js";import"./Play-36GJ7S8s.js";import"./Shield01-DyfquAcF.js";import"./Stars01-CijLjMFV.js";import"./Upload01-xJ_d7WPc.js";import"./User01-CwFs9pyw.js";import"./Users01-BPXtgrBC.js";import"./Zap-BOal3pPC.js";import"./infiniteQueryObserver-Cd6dzDw6.js";import"./auth-CgRqH8B5.js";import"./capability-load-error-Cerh3ArX.js";const $e="basic-usage",He=[{id:$e,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...He.find(t=>t.id===$e)?.tools??[]];const ss=["agents:manage","connections:manage"];new Set(He.filter(t=>ss.includes(t.id)).flatMap(t=>t.tools));function ls(){const t=new Map;for(const e of He){if(e.id===$e)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function os(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ns(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}function is(t){const e=X.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:c,onSelect:u,onToggle:f}=t,d=r?"bg-accent/50":"hover:bg-muted/50";let T;e[0]!==d?(T=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=T):T=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Fe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let g;e[5]!==l.title?(g=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=g):g=e[6];let _;e[7]!==u||e[8]!==a||e[9]!==g?(_=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:u,children:[a,g]}),e[7]=u,e[8]=a,e[9]=g,e[10]=_):_=e[10];let m;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==f||e[15]!==c?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(Qe,{checked:n,onCheckedChange:f,onClick:rs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=f,e[15]=c,e[16]=m):m=e[16];let h;return e[17]!==T||e[18]!==_||e[19]!==m?(h=s.jsxs("div",{className:T,children:[_,m]}),e[17]=T,e[18]=_,e[19]=m,e[20]=h):h=e[20],h}function rs(t){return t.stopPropagation()}function as(t){const e=X.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,c=`tool-${l}-${r.name}`,u=n?"text-foreground":"text-muted-foreground";let f;e[0]!==u?(f=Z("text-sm font-medium",u),e[0]=u,e[1]=f):f=e[1];let d;e[2]!==f||e[3]!==r.name?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:f,children:r.name})}),e[2]=f,e[3]=r.name,e[4]=d):d=e[4];let T;e[5]!==r.description?(T=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=T):T=e[6];let a;e[7]!==d||e[8]!==T?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,T]}),e[7]=d,e[8]=T,e[9]=a):a=e[9];const g=`tool-${l}-${r.name}`;let _;e[10]!==n||e[11]!==o||e[12]!==g?(_=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Qe,{id:g,checked:n,onCheckedChange:o,onClick:cs})}),e[10]=n,e[11]=o,e[12]=g,e[13]=_):_=e[13];let m;return e[14]!==c||e[15]!==a||e[16]!==_?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,_]}),e[14]=c,e[15]=a,e[16]=_,e[17]=m):m=e[17],m}function cs(t){return t.stopPropagation()}function ds({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,c]=Q.useState(""),u=r!==void 0?r:o,f=Q.useDeferredValue(u),[d,T]=Q.useState("all"),[a,g]=Q.useState(!1),_=Q.useRef(new Set(Object.keys(t))),{org:m}=Ge(),h=Qt({connectionId:$t,orgId:m.id,orgSlug:m.slug}),O=100,R=f.trim(),p=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,C=!!l,A={...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:0,...C&&{include_virtual:!0}},M=JSON.stringify(A),{data:S,fetchNextPage:b,hasNextPage:D,isFetchingNextPage:I}=Ft({queryKey:de.collectionListInfinite(h,m.id,"","CONNECTIONS",M),queryFn:async({pageParam:E=0})=>(await h.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:E,...C&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(E,w)=>{if(E?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),N=S?.pages.flatMap(E=>E?.items??[])??[],P=Kt(b,D??!1,I),i=l?N.filter(E=>E.connection_type!=="VIRTUAL"?!0:qt(E.connection_url)!==l):N,x=_.current,U=[...x.values()].map(E=>i.find(w=>w.id===E)).filter(E=>E!==void 0),G=i.filter(E=>!x.has(E.id)),Y=[...U,...G],v=E=>{const w=t[E];return w!==void 0&&w.length>0},K=Y.filter(E=>{if(d==="all")return!0;const w=v(E.id);return d==="selected"?w:d==="unselected"?!w:!0}),[L,z]=Q.useState(Y[0]?.id??null),V=L?Y.find(E=>E.id===L)??null:null,{data:k,isFetching:B}=Ve({queryKey:de.collectionItem(h,m.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await h.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=k?.tools??[],J=(E,w)=>t[E]?.includes(w)??!1,te=(E,w)=>{const H=t[E]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[E]:se[E]=le}else se[E]=[...H,w];e(se)},oe=E=>{const w=E===L?$:[];if(!w.length)return;const H=t[E]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[E]:(le[E]=q,z(E)),e(le)},F=E=>{z(E),g(!0)},W=()=>{g(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[r===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>T("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>T("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>T("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:K.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(u?"common.toolSetSelector.noConnectionsFound":d==="selected"?"common.toolSetSelector.noServersSelected":d==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(E=>{const w=L===E.id,H=w?$.length:0,q=t[E.id]?.length??0;return s.jsx(is,{connection:{...E,tools:w?$:E.tools},isSelected:w,hasToolsEnabled:v(E.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>F(E.id),onToggle:()=>oe(E.id)},E.id)}),s.jsx("div",{ref:P,className:"h-4"}),I&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(zt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Fe,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:$.map(E=>s.jsx(as,{connectionId:V.id,tool:E,isSelected:J(V.id,E.name),onToggle:()=>te(V.id,E.name)},E.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const ms=qe({role:qe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Je(),staticPermissions:we(re()),toolSet:Ze(re(),we(re())),allowAllModels:Je(),modelSet:Ze(re(),we(re())),memberIds:we(re())});function lt(t,e,l,r){const n=s.jsx(je,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(ve,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function us(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie();let T;e[0]!==u?(T=u.trim().toLowerCase(),e[0]=u,e[1]=T):T=e[1];const a=Q.useDeferredValue(T);let g;if(e[2]!==l||e[3]!==a||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==d){const _=ls(),m=(I,N)=>{if(!f){if(l&&N){const P=_.flatMap(Ts).flatMap(gs);n(!1),o(P.filter(i=>!I.tools.includes(i)));return}l||o(ns(I,r,!N))}};let h;e[11]!==a?(h=I=>{const{section:N,capabilities:P}=I;return{section:N,capabilities:P.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=h):h=e[12];const O=_.map(h).filter(fs);let R;e[13]!==d?(R=d("settings.orgRoleDetail.general"),e[13]=d,e[14]=R):R=e[14];let p;e[15]!==d?(p=d("settings.orgRoleDetail.allOrgPermissions"),e[15]=d,e[16]=p):p=e[16];let C;e[17]!==d?(C=d("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=d,e[18]=C):C=e[18];let A;e[19]!==l||e[20]!==n||e[21]!==o?(A=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=A):A=e[22];let M;e[23]!==l||e[24]!==f||e[25]!==d||e[26]!==A?(M=lt(d,l,f,A),e[23]=l,e[24]=f,e[25]=d,e[26]=A,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==f?(S=f?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=f,e[32]=S):S=e[32];let b;e[33]!==S||e[34]!==p||e[35]!==C||e[36]!==M?(b=s.jsx(Xe,{children:s.jsx(et,{title:p,description:C,action:M,onClick:S})}),e[33]=S,e[34]=p,e[35]=C,e[36]=M,e[37]=b):b=e[37];let D;e[38]!==b||e[39]!==R?(D=s.jsx(We,{title:R,children:b}),e[38]=b,e[39]=R,e[40]=D):D=e[40],g=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,O.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:d("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:u})}):O.map(I=>{const{section:N,capabilities:P}=I;return s.jsx(We,{title:N,children:s.jsx(Xe,{children:P.map(i=>{const x=os(i,r,l);return s.jsx(et,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:lt(d,x,f,()=>m(i,x)),onClick:f?void 0:()=>m(i,x)},i.id)})})},N)})]})}),e[2]=l,e[3]=a,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=r,e[9]=d,e[10]=g}else g=e[10];return g}function fs(t){return t.capabilities.length>0}function gs(t){return t.tools}function Ts(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},_s={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function hs(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function Es(t){return _s[t]??St[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const At=30;function xs(t){const e=X.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:c,allConnectionModelIds:u,selectedModels:f,allowAllModels:d,allConnectionModelsSelected:T,onToggleModel:a,onExitAllowAll:g,readOnly:_,defaultExpanded:m}=t,h=ie(),[O,R]=Q.useState(m),p=m||O,C=R,[A,M]=Q.useState(At);let S;e[0]!==T||e[1]!==d||e[2]!==f?(S=I=>d||T||f.includes("*")||f.includes(I),e[0]=T,e[1]=d,e[2]=f,e[3]=S):S=e[3];const b=S;let D;if(e[4]!==u||e[5]!==d||e[6]!==l||e[7]!==p||e[8]!==o||e[9]!==b||e[10]!==c||e[11]!==g||e[12]!==a||e[13]!==_||e[14]!==r||e[15]!==n||e[16]!==h||e[17]!==A){let I;e[19]!==b?(I=B=>b(B.id),e[19]=b,e[20]=I):I=e[20];const N=c.filter(I).length,P=c.slice(0,A),i=c.length>A;let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>C(As),e[21]=x):x=e[21];const U=o??Et[r]??It;let G;e[22]!==n||e[23]!==U?(G=s.jsx(Fe,{icon:U,name:n,size:"sm"}),e[22]=n,e[23]=U,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let v;e[27]!==G||e[28]!==Y?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=v):v=e[29];const K=h("settings.orgRoleDetail.enabledCount",{enabledCount:N,total:c.length});let L;e[30]!==K?(L=s.jsx(be,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let z;e[32]!==p?(z=p?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=p,e[33]=z):z=e[33];let V;e[34]!==L||e[35]!==z?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,z]}),e[34]=L,e[35]=z,e[36]=V):V=e[36];let k;e[37]!==V||e[38]!==v?(k=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:x,children:[v,V]}),e[37]=V,e[38]=v,e[39]=k):k=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[k,p&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[P.map(B=>{const $=b(B.id),J=()=>{if(!_){if(d){g(l,u,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!_&&"hover:bg-muted/50 cursor-pointer"),onClick:J,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ss,children:_?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:$,disabled:!0,onCheckedChange:Rs})})}),s.jsx(ve,{children:s.jsx("p",{children:h("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:$,onCheckedChange:J})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(ps),children:h("settings.orgRoleDetail.showMore",{remaining:c.length-A})})]})]}),e[4]=u,e[5]=d,e[6]=l,e[7]=p,e[8]=o,e[9]=b,e[10]=c,e[11]=g,e[12]=a,e[13]=_,e[14]=r,e[15]=n,e[16]=h,e[17]=A,e[18]=D}else D=e[18];return D}function ps(t){return t+At}function Rs(){}function Ss(t){return t.stopPropagation()}function As(t){return!t}function Ns(t){const e=X.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:u,searchQuery:f,readOnly:d}=t,T=Wt(l.id);let a,g,_,m,h;if(e[0]!==u||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==T||e[8]!==d||e[9]!==f||e[10]!==r){h=Symbol.for("react.early_return_sentinel");e:{let p;e[16]!==l.label?(p=x=>({...x,id:x.modelId,provider:l.label}),e[16]=l.label,e[17]=p):p=e[17];const C=T.filter(js).map(p),A=f.trim().toLowerCase(),M=A?C.filter(x=>x.title.toLowerCase().includes(A)||x.id.toLowerCase().includes(A)||x.provider?.toLowerCase().includes(A)):C;if(M.length===0){h=null;break e}const S=new Map;for(const x of M){const U=hs(x.id,l.providerId),G=S.get(U)??{models:[],logo:null};G.models.push({id:x.id,title:Is(x.title),logo:x.logo}),!G.logo&&x.logo&&(G.logo=x.logo),S.set(U,G)}const b=Array.from(S.entries()).map(bs).sort(Cs),D=b.length===1||A.length>0;_="flex flex-col gap-3";const I=Et[l.providerId]??It;let N;e[18]!==l.providerId||e[19]!==I?(N=s.jsx("img",{src:I,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=I,e[20]=N):N=e[20];const P=St[l.providerId]??l.providerId;let i;e[21]!==P?(i=s.jsx("h4",{className:"text-sm font-medium",children:P}),e[21]=P,e[22]=i):i=e[22],e[23]!==i||e[24]!==N?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[N,i]}),e[23]=i,e[24]=N,e[25]=m):m=e[25],a="flex flex-col gap-3",g=b.map(x=>s.jsx(xs,{connectionId:l.id,subProviderId:x.id,subProviderName:x.name,groupLogo:x.logo,models:x.models,allConnectionModelIds:C.map(Os),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:u,onToggleModel:o,onExitAllowAll:c,readOnly:d,defaultExpanded:D},x.id))}e[0]=u,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=T,e[8]=d,e[9]=f,e[10]=r,e[11]=a,e[12]=g,e[13]=_,e[14]=m,e[15]=h}else a=e[11],g=e[12],_=e[13],m=e[14],h=e[15];if(h!==Symbol.for("react.early_return_sentinel"))return h;let O;e[26]!==a||e[27]!==g?(O=s.jsx("div",{className:a,children:g}),e[26]=a,e[27]=g,e[28]=O):O=e[28];let R;return e[29]!==_||e[30]!==m||e[31]!==O?(R=s.jsxs("div",{className:_,children:[m,O]}),e[29]=_,e[30]=m,e[31]=O,e[32]=R):R=e[32],R}function Os(t){return t.id}function Cs(t,e){return t.name.localeCompare(e.name)}function bs(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function js(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie(),T=Q.useDeferredValue(u),a=Jt();let g;e[0]!==r||e[1]!==o?(g=(I,N)=>{const P=r[I]??[],i={...r};if(P.includes(N)){const x=P.filter(U=>U!==N);x.length===0?delete i[I]:i[I]=x}else i[I]=[...P,N];o(i)},e[0]=r,e[1]=o,e[2]=g):g=e[2];const _=g;let m;e[3]!==r||e[4]!==n||e[5]!==o?(m=(I,N,P)=>{n(!1),o({...r,[I]:N.filter(i=>i!==P)})},e[3]=r,e[4]=n,e[5]=o,e[6]=m):m=e[6];const h=m,O=!f&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==O?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",O),e[7]=O,e[8]=R):R=e[8];let p;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==f?(p=()=>{if(f)return;const I=!l;n(I),I&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=f,e[13]=p):p=e[13];let C;e[14]!==d?(C=d("settings.orgRoleDetail.allModels"),e[14]=d,e[15]=C):C=e[15];let A;e[16]!==C?(A=s.jsx("span",{className:"text-sm font-medium",children:C}),e[16]=C,e[17]=A):A=e[17];let M;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==f||e[22]!==d?(M=s.jsx("div",{onClick:Ps,children:f?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(ve,{children:s.jsx("p",{children:d("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:l,onCheckedChange:I=>{n(I),I&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=f,e[22]=d,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==p||e[26]!==A||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:p,children:[A,M]}),e[24]=R,e[25]=p,e[26]=A,e[27]=M,e[28]=S):S=e[28];let b;e[29]!==a||e[30]!==l||e[31]!==T||e[32]!==h||e[33]!==r||e[34]!==f||e[35]!==d||e[36]!==_?(b=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(I=>s.jsx(Q.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"size-4"}),d("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ns,{connection:I,selectedModels:r[I.id]??[],allowAllModels:l,onToggleModel:_,onExitAllowAll:h,allConnectionModelsSelected:(r[I.id]??[]).includes("*"),searchQuery:T,readOnly:f})},I.id)),e[29]=a,e[30]=l,e[31]=T,e[32]=h,e[33]=r,e[34]=f,e[35]=d,e[36]=_,e[37]=b):b=e[37];let D;return e[38]!==S||e[39]!==b?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,b]}),e[38]=S,e[39]=b,e[40]=D):D=e[40],D}function Ds(){}function Ps(t){return t.stopPropagation()}function vs(t){const e=X.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,c=ie(),[u,f]=Q.useState(""),d=Q.useDeferredValue(u);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[0]=T):T=e[0];const[a,g]=Q.useState(T),{data:_}=xt();let m,h,O,R,p,C,A,M,S,b,D;if(e[1]!==_?.data?.members||e[2]!==d||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==u||e[8]!==n||e[9]!==c){const L=_?.data?.members??[];let z;e[21]!==d?(z=F=>{const W=d.toLowerCase();return F.user?.name?.toLowerCase().includes(W)||F.user?.email?.toLowerCase().includes(W)},e[21]=d,e[22]=z):z=e[22];const V=L.filter(z);let k;e[23]!==o||e[24]!==r||e[25]!==a?(k=()=>{o(a),g([]),r(!1)},e[23]=o,e[24]=r,e[25]=a,e[26]=k):k=e[26],O=k,h=dt,b=l,D=r,m=mt,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(ut,{children:B}),e[29]=B,e[30]=$):$=e[30];let J;e[31]!==c?(J=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=J):J=e[32];let te;e[33]!==J?(te=s.jsx(ft,{children:J}),e[33]=J,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=S):S=e[37],C="flex flex-col h-80";let oe;e[38]!==c?(oe=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=oe):oe=e[39],e[40]!==u||e[41]!==oe?(A=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ze,{value:u,onChange:f,placeholder:oe,className:"w-full"})}),e[40]=u,e[41]=oe,e[42]=A):A=e[42],R="flex-1 overflow-auto",p=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(u?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const W=F.role!=="owner",E=n.includes(F.id),w=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!W||E?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Qe,{checked:w||E,onCheckedChange:()=>{!W||E||g(H=>H.includes(F.id)?H.filter(q=>q!==F.id):[...H,F.id])},disabled:!W||E}),s.jsx(Rt,{url:F.user?.image??void 0,fallback:pt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!W&&s.jsx(be,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),E&&W&&s.jsx(be,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=_?.data?.members,e[2]=d,e[3]=o,e[4]=r,e[5]=l,e[6]=a,e[7]=u,e[8]=n,e[9]=c,e[10]=m,e[11]=h,e[12]=O,e[13]=R,e[14]=p,e[15]=C,e[16]=A,e[17]=M,e[18]=S,e[19]=b,e[20]=D}else m=e[10],h=e[11],O=e[12],R=e[13],p=e[14],C=e[15],A=e[16],M=e[17],S=e[18],b=e[19],D=e[20];let I;e[43]!==R||e[44]!==p?(I=s.jsx("div",{className:R,children:p}),e[43]=R,e[44]=p,e[45]=I):I=e[45];let N;e[46]!==I||e[47]!==C||e[48]!==A?(N=s.jsxs("div",{className:C,children:[A,I]}),e[46]=I,e[47]=C,e[48]=A,e[49]=N):N=e[49];let P;e[50]!==c?(P=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=P):P=e[51];let i;e[52]!==P?(i=s.jsx(Tt,{children:P}),e[52]=P,e[53]=i):i=e[53];const x=a.length===0;let U;e[54]!==a.length||e[55]!==c?(U=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=U):U=e[56];let G;e[57]!==O||e[58]!==x||e[59]!==U?(G=s.jsx(_t,{onClick:O,disabled:x,children:U}),e[57]=O,e[58]=x,e[59]=U,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(ht,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==m||e[65]!==N||e[66]!==Y||e[67]!==M||e[68]!==S?(v=s.jsxs(m,{className:M,children:[S,N,Y]}),e[64]=m,e[65]=N,e[66]=Y,e[67]=M,e[68]=S,e[69]=v):v=e[69];let K;return e[70]!==h||e[71]!==v||e[72]!==b||e[73]!==D?(K=s.jsx(h,{open:b,onOpenChange:D,children:v}),e[70]=h,e[71]=v,e[72]=b,e[73]=D,e[74]=K):K=e[74],K}function Ls(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=n===void 0?!1:n,T=o===void 0?void 0:o,a=ie(),g=Q.useDeferredValue(c),{data:_}=xt();let m,h,O;if(e[0]!==_?.data?.members||e[1]!==g||e[2]!==l||e[3]!==r||e[4]!==d||e[5]!==T||e[6]!==c||e[7]!==a){const M=_?.data?.members??[];let S;e[11]!==l?(S=i=>l.includes(i.id),e[11]=l,e[12]=S):S=e[12];const b=M.filter(S);let D;e[13]!==g?(D=i=>{const x=g.toLowerCase();return i.user?.name?.toLowerCase().includes(x)||i.user?.email?.toLowerCase().includes(x)},e[13]=g,e[14]=D):D=e[14];const I=b.filter(D);let N;e[15]!==T||e[16]!==a?(N=T??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=T,e[16]=a,e[17]=N):N=e[17];const P=N;O="flex flex-col h-full",m="flex-1 overflow-auto",h=b.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):I.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:I.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:pt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),d?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(tt,{size:16})})})}),s.jsx(ve,{children:s.jsx("p",{children:P})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(x=>x!==i.id)),children:s.jsx(tt,{size:16})})]},i.id))}),e[0]=_?.data?.members,e[1]=g,e[2]=l,e[3]=r,e[4]=d,e[5]=T,e[6]=c,e[7]=a,e[8]=m,e[9]=h,e[10]=O}else m=e[8],h=e[9],O=e[10];let R;e[18]!==m||e[19]!==h?(R=s.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=R):R=e[20];let p;e[21]!==l||e[22]!==r?(p=M=>r([...l,...M]),e[21]=l,e[22]=r,e[23]=p):p=e[23];let C;e[24]!==u||e[25]!==l||e[26]!==f||e[27]!==p?(C=s.jsx(vs,{open:u,onOpenChange:f,selectedMemberIds:l,onAddMembers:p}),e[24]=u,e[25]=l,e[26]=f,e[27]=p,e[28]=C):C=e[28];let A;return e[29]!==O||e[30]!==R||e[31]!==C?(A=s.jsxs("div",{className:O,children:[R,C]}),e[29]=O,e[30]=R,e[31]=C,e[32]=A):A=e[32],A}function ys(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Q.Suspense,{fallback:l,children:s.jsx(Ls,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const ws={owner:[],admin:[],user:[]};function Gs(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:ws[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),c=o?[]:n.filter(a=>a!=="*"),u={};for(const[a,g]of Object.entries(r))if(!(a==="self"||a==="models"))if(a==="*")for(const _ of l)u[_.id]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g;else{const _=l.find(m=>m.id===a);_&&(u[a]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g)}const f=r.models||[],d=f.length===0||f.includes("*:*"),T={};if(!d)for(const a of f){const g=a.indexOf(":");if(g===-1)continue;const _=a.slice(0,g),m=a.slice(g+1);T[_]||(T[_]=[]),T[_].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:u,allowAllModels:d,modelSet:T,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function ks(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const c=e.find(u=>u.id===r)?.tools?.map(u=>u.name)??[];l[r]=c.length>0&&c.every(u=>n.includes(u))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const c of o)r.push(`${n}:${c}`);r.length>0&&(l.models=r)}return l}function Bs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Vs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,c=ie();let u;e[0]!==o||e[1]!==c?(u=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=u):u=e[2];const f=u;if(l){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Be,{size:16}),e[3]=g):g=e[3];let _;e[4]!==c?(_=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=_):_=e[5];let m;e[6]!==_?(m=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[g,_]})})}),e[6]=_,e[7]=m):m=e[7];let h;e[8]!==f?(h=s.jsx(ve,{children:s.jsx("p",{children:f})}),e[8]=f,e[9]=h):h=e[9];let O;return e[10]!==m||e[11]!==h?(O=s.jsx(Me,{children:s.jsxs(De,{children:[m,h]})}),e[10]=m,e[11]=h,e[12]=O):O=e[12],O}let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:16}),e[13]=d):d=e[13];let T;e[14]!==c?(T=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=T):T=e[15];let a;return e[16]!==n||e[17]!==T?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[d,T]}),e[16]=n,e[17]=T,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Ge(),r=Ke(),n=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==r?(c=()=>r.organization.listMembers(),e[2]=r,e[3]=c):c=e[3];let u;e[4]!==o||e[5]!==c?(u={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=u):u=e[6];const{data:f,isPending:d}=Ve(u);if(d||!n){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=_):_=e[7],_}let T;e[8]!==f?.data?.members?(T=f?.data?.members??[],e[8]=f?.data?.members,e[9]=T):T=e[9];const a=T;let g;return e[10]!==n||e[11]!==a||e[12]!==t?(g=s.jsx(Ks,{...t,members:a,connections:n}),e[10]=n,e[11]=a,e[12]=t,e[13]=g):g=e[13],g}function Ks({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:c}=Ge(),u=Ke(),f=ot(),d=t.kind==="builtin",T=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[g,_]=Q.useState(d?"org":"mcp"),m=Ct({resolver:bt(ms),defaultValues:Bs(t,r,n)}),h=m.formState.isValid,O=m.formState.isDirty,R=nt({mutationFn:async i=>{const x=ks(i,n),U=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(v,K)=>{const L=r.filter(k=>k.role===(K??v)).map(k=>k.id),z=i.memberIds.filter(k=>!L.includes(k)),V=L.filter(k=>!i.memberIds.includes(k));for(const k of z){const B=await u.organization.updateMemberRole({memberId:k,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const k of V){const B=await u.organization.updateMemberRole({memberId:k,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const v=i.role.label.toLowerCase().replace(/\s+/g,"-"),K=i.role.slug,L=v!==K,z=await u.organization.updateRole({roleId:i.role.id,data:{permission:x,...L?{roleName:v}:{}}});if(z?.error)throw new Error(z.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(L?v:K,L?K:void 0),L?{...i,role:{...i.role,slug:v}}:i}else{const v=await u.organization.createRole({role:U,permission:x});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await u.organization.updateMemberRole({memberId:K,role:[U]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:U}}}},onSuccess:(i,x)=>{f.invalidateQueries({queryKey:de.members(c)}),f.invalidateQueries({queryKey:de.organizationRoles(c)});const U=!x.role.id&&!x.role.slug,G=x.role.slug==="owner"&&!x.role.id;Ye(G?"role_members_updated":U?"role_created":"role_updated",{role_slug:x.role.slug??null}),Ce.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":U?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),m.reset(i),l(i.role.id)},onError:i=>{Ce.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),p=m.handleSubmit(i=>{if(!i.role.label.trim()){Ce.error(o("settings.orgRoleDetail.roleNameIsRequired")),m.setFocus("role.label");return}R.mutate(i)}),C=!T,A=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...T?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,b]=Q.useState(""),[D,I]=Q.useState(!1),N=i=>{_(i),b("")},P={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ne,{children:s.jsxs(Ne.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ne.Title,{actions:C&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:p,disabled:R.isPending||!h||!O,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(m.watch("role.label")))}),T&&s.jsx(it,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...m.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:A})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(i=>s.jsx("button",{type:"button",onClick:()=>N(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ze,{value:S,onChange:b,placeholder:P[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(Vs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>I(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!T&&s.jsx(ds,{toolSet:m.watch("toolSet"),onToolSetChange:i=>m.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:S}),g==="org"&&s.jsx(us,{allowAllStaticPermissions:m.watch("allowAllStaticPermissions"),staticPermissions:m.watch("staticPermissions"),onAllowAllChange:i=>m.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>m.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="models"&&s.jsx(Ms,{allowAllModels:m.watch("allowAllModels"),modelSet:m.watch("modelSet"),onAllowAllChange:i=>m.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>m.setValue("modelSet",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="members"&&s.jsx(ys,{memberIds:m.watch("memberIds"),onMemberIdsChange:i=>m.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:I})]})})]})})}function zs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Fs(t){const e=X.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:c}=Mt();let u;return e[0]!==l||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o?(u=s.jsx(ts,{granted:n,loading:o,error:c,area:l,children:r}),e[0]=l,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function $s(){const t=X.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),c=vt();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=rt(u),{locator:d}=Ge(),T=Ke(),a=ot(),{customRoles:g,refetch:_}=Lt();let m;t[1]!==c?(m=j=>c({to:".",search:y=>({...y,role:j})}),t[1]=c,t[2]=m):m=t[2];const h=m;let O;e:{if(!f){O=null;break e}if(f==="new"){O={kind:"new"};break e}if(f.startsWith("builtin-")){O={kind:"builtin",role:f.slice(8)};break e}let j;t[3]!==f?(j=ee=>ee.id===f,t[3]=f,t[4]=j):j=t[4];const y=g.find(j);O=y?{kind:"custom",role:y}:null}const R=O;let p;t[5]!==d?(p=de.members(d),t[5]=d,t[6]=p):p=t[6];let C;t[7]!==T?(C=()=>T.organization.listMembers(),t[7]=T,t[8]=C):C=t[8];let A;t[9]!==p||t[10]!==C?(A={queryKey:p,queryFn:C},t[9]=p,t[10]=C,t[11]=A):A=t[11];const{data:M}=Ve(A);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const b=S;let D;t[14]!==b?(D=j=>b.filter(y=>y.role===j).length,t[14]=b,t[15]=D):D=t[15];const I=D;let N;if(t[16]!==g||t[17]!==I||t[18]!==l||t[19]!==e){let j;t[21]!==I||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:I(ce.role),label:e(ce.labelKey)}}),t[21]=I,t[22]=e,t[23]=j):j=t[23];const y=Qs.map(j);let ee;t[24]!==I?(ee=ce=>({kind:"custom",role:{...ce,memberCount:I(ce.role)}}),t[24]=I,t[25]=ee):ee=t[25];const Nt=g.map(ee);if(N=[...y,...Nt],l){const ce=l.toLowerCase();N=N.filter(Ot=>Ot.role.label.toLowerCase().includes(ce))}t[16]=g,t[17]=I,t[18]=l,t[19]=e,t[20]=N}else N=t[20];let P;t[26]!==T?(P=async j=>{const y=await T.organization.deleteRole({roleId:j});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=T,t[27]=P):P=t[27];const i=nt({mutationFn:P,onSuccess:(j,y)=>{Ye("role_deleted",{role_id:y}),a.invalidateQueries({queryKey:de.members(d)}),a.invalidateQueries({queryKey:de.organizationRoles(d)}),Ce.success(e("settings.roles.deletedSuccessfully")),_(),R?.kind==="custom"&&R.role.id===y&&h(void 0)},onError:Ws});let x;t[28]!==e?(x=e("settings.roles.columnRole"),t[28]=e,t[29]=x):x=t[29];let U;t[30]!==x?(U={id:"role",header:x,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=x,t[31]=U):U=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(be,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(be,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let v;t[36]!==G||t[37]!==Y?(v={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=v):v=t[38];let K;t[39]!==e?(K=e("settings.roles.columnPermissions"),t[39]=e,t[40]=K):K=t[40];let L;t[41]!==e?(L=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=j.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=L):L=t[42];let z;t[43]!==K||t[44]!==L?(z={id:"permissions",header:K,render:L,cellClassName:"flex-1 min-w-0"},t[43]=K,t[44]=L,t[45]=z):z=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let k;t[48]!==V?(k={id:"members",header:V,render:Zs,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=k):k=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:Hs,children:s.jsxs(kt,{variant:"destructive",onClick:()=>{const y=j.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==U||t[53]!==v||t[54]!==z||t[55]!==k||t[56]!==B?($=[U,v,z,k,B],t[52]=U,t[53]=v,t[54]=z,t[55]=k,t[56]=B,t[57]=$):$=t[57];const J=$;let te;t[58]!==h?(te=j=>{if(j.kind==="builtin")h(`builtin-${j.role.role}`);else{const y=j.role;h(y.id)}},t[58]=h,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==h?(j=()=>h(void 0),t[60]=h,t[61]=j):j=t[61];let y;return t[62]!==_||t[63]!==h?(y=()=>{_(),h(void 0)},t[62]=_,t[63]=h,t[64]=y):y=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:y},zs(R))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let W;t[67]===Symbol.for("react.memo_cache_sentinel")?(W=j=>{j.key==="Escape"&&(r(""),j.target.blur())},t[67]=W):W=t[67];let E;t[68]!==l||t[69]!==F?(E=s.jsx(ze,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:W}),t[68]=l,t[69]=F,t[70]=E):E=t[70];let w;t[71]!==h?(w=()=>h("new"),t[71]=h,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Be,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==E||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,se]}),t[79]=E,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(st,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(st,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let me;t[85]!==N||t[86]!==J||t[87]!==oe||t[88]!==ne?(me=s.jsx(Yt,{columns:J,data:N,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=N,t[86]=J,t[87]=oe,t[88]=ne,t[89]=me):me=t[89];const Ue=n!==null;let Le;t[90]===Symbol.for("react.memo_cache_sentinel")?(Le=j=>!j&&o(null),t[90]=Le):Le=t[90];let ue;t[91]!==e?(ue=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=ue):ue=t[92];let fe;t[93]!==ue?(fe=s.jsx(ut,{children:ue}),t[93]=ue,t[94]=fe):fe=t[94];const ke=n?.label??"";let ge;t[95]!==e||t[96]!==ke?(ge=e("settings.roles.deleteRoleConfirm",{role:ke}),t[95]=e,t[96]=ke,t[97]=ge):ge=t[97];let Te;t[98]!==ge?(Te=s.jsx(ft,{children:ge}),t[98]=ge,t[99]=Te):Te=t[99];let _e;t[100]!==fe||t[101]!==Te?(_e=s.jsxs(gt,{children:[fe,Te]}),t[100]=fe,t[101]=Te,t[102]=_e):_e=t[102];let he;t[103]!==e?(he=e("settings.roles.cancel"),t[103]=e,t[104]=he):he=t[104];let Ee;t[105]!==he?(Ee=s.jsx(Tt,{children:he}),t[105]=he,t[106]=Ee):Ee=t[106];let Ie;t[107]!==i||t[108]!==n?(Ie=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ie):Ie=t[109];let xe;t[110]!==e?(xe=e("settings.roles.delete"),t[110]=e,t[111]=xe):xe=t[111];let pe;t[112]!==Ie||t[113]!==xe?(pe=s.jsx(_t,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:xe}),t[112]=Ie,t[113]=xe,t[114]=pe):pe=t[114];let Re;t[115]!==Ee||t[116]!==pe?(Re=s.jsxs(ht,{children:[Ee,pe]}),t[115]=Ee,t[116]=pe,t[117]=Re):Re=t[117];let Se;t[118]!==_e||t[119]!==Re?(Se=s.jsxs(mt,{children:[_e,Re]}),t[118]=_e,t[119]=Re,t[120]=Se):Se=t[120];let Ae;t[121]!==Ue||t[122]!==Se?(Ae=s.jsx(dt,{open:Ue,onOpenChange:Le,children:Se}),t[121]=Ue,t[122]=Se,t[123]=Ae):Ae=t[123];let ye;return t[124]!==le||t[125]!==me||t[126]!==Ae?(ye=s.jsxs(at,{group:"members",className:"gap-6",children:[le,me,Ae]}),t[124]=le,t[125]=me,t[126]=Ae,t[127]=ye):ye=t[127],ye}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Zs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",ct(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(it,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ws(t,e){Ye("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Ce.error(t instanceof Error?t.message:"Failed to delete role")}function Xs(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=rt(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let c;t[5]!==r?(c=r?s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(at,{group:"members",className:"gap-6",children:s.jsx(Dt,{})}),t[5]=r,t[6]=c):c=t[6];let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($s,{}),t[7]=u):u=t[7];let f;t[8]!==c?(f=s.jsx(Q.Suspense,{fallback:c,children:u}),t[8]=c,t[9]=f):f=t[9];let d;return t[10]!==o||t[11]!==f?(d=s.jsx(Pt,{fallback:o,children:f}),t[10]=o,t[11]=f,t[12]=d):d=t[12],d}function Ro(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{area:"roles",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{Ro as default};
1
+ import{b as ie,r as Q,G as Ge,K as de,m as Ve,j as s,l as Z,h as Oe,B as ae,c as X,ae as qe,af as we,ag as re,ak as Ze,ah as Je,n as ot,aq as Ct,ar as bt,e as nt,t as Ce,o as Ye,P as Ne,z as it,dp as We,dq as Xe,dr as et,C as jt,a3 as Me,a4 as De,a1 as Pe,a2 as ve,ap as tt,bZ as Mt,u as rt,dt as at,fg as Dt,E as Pt,d as vt}from"./index-CmFHzaVd.js";import{u as Lt}from"./use-organization-roles-BBUluABL.js";import{u as Ke}from"./use-org-auth-client-DPfwumdn.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as be}from"./badge-o_twyLc_.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as Tt,g as _t,e as ht}from"./alert-dialog-Cw7BmY2P.js";import{c as wt,D as Gt,b as Ut,a as kt}from"./dropdown-menu-Bv4xz-Hs.js";import{i as Bt}from"./DotsVertical-BQLviQoN.js";import{s as Be}from"./Plus-DpxQQegv.js";import{s as Vt}from"./Trash01-CDIP8mWC.js";import{C as Yt}from"./collection-table-wrapper-DnxhYnfx.js";import{E as st}from"./empty-state-DbGmoVR9.js";import{S as ze}from"./search-input-B2m2yzjY.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Fe}from"./integration-icon-Dzu38eaZ.js";import{u as Kt}from"./use-infinite-scroll-DiOtQ6ws.js";import{C as Qe}from"./checkbox-DC1-C0yj.js";import{i as zt}from"./ArrowLeft-CVITrxtP.js";import{u as Ft}from"./useSuspenseInfiniteQuery-vrEavbI2.js";import{u as Qt}from"./use-mcp-client-6z11vQVY.js";import{S as $t}from"./constants-Daqiz8AS.js";import{C as Ht}from"./collection-search-DDhFultb.js";import{p as qt}from"./connection-pA4f7OGU.js";import{a as xt}from"./use-members-CizxuHnf.js";import{g as pt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-CRp-xUbr.js";import{u as Jt,g as Wt}from"./use-ai-providers-ClLSQInI.js";import{A as Rt}from"./avatar-BBxhmrGb.js";import{S as je}from"./switch-B1fBRtrL.js";import{t as Xt}from"./ChevronUp-b-PzeywI.js";import{i as es}from"./ChevronRight-q_JbYpOo.js";import{A as ts}from"./access-gate-CBB1Qus8.js";import"./Check-BhhNRMNU.js";import"./table-ckrTQfL3.js";import"./ArrowUp-CNHLUPN5.js";import"./SearchMd-CbFIUniO.js";import"./Tool02-DIw0mhv0.js";import"./agent-icon-BK--UuNY.js";import"./AlertCircle-Mq4uYP3s.js";import"./Tool01-Buhr9Y7R.js";import"./XCircle-CgX4D_Wl.js";import"./TrendUp01-Bm64aKBA.js";import"./ZoomOut-D6sLWwOc.js";import"./Users03-SRCwiQcD.js";import"./CheckCircle-BCoRYCAM.js";import"./ChevronSelectorVertical-BU-CJzRy.js";import"./UserSquare-CI7iMhe-.js";import"./Copy01-DUhBpg4r.js";import"./CreditCard01-1Ok0QwWF.js";import"./Download01-C1bDQDgI.js";import"./Settings02-Bpo9X8gv.js";import"./Eye-ibUTdcXo.js";import"./Share07-h7a5KYcB.js";import"./GitBranch01-bh0uxNpJ.js";import"./Globe01-CiS7RUms.js";import"./XClose-CnwWALwv.js";import"./HardDrive-DYvVbF_2.js";import"./Image01-DAHgvtp4.js";import"./Key01-Cio39wXN.js";import"./Link01-DnReHnVr.js";import"./LinkExternal01-BSsHZ7aL.js";import"./Monitor01-vaUnb86V.js";import"./Sun-DOVdnR1v.js";import"./Package-XApGlufb.js";import"./Palette-dkAr2npF.js";import"./Play-gyn4nC-U.js";import"./Shield01-BX_Me7cI.js";import"./Stars01-12uBgCmr.js";import"./Upload01-D5lIPLBr.js";import"./User01-BnCb_8UJ.js";import"./Users01-byFntVxQ.js";import"./Zap-C8JmWe0J.js";import"./infiniteQueryObserver-C1YqOU9I.js";import"./auth-CWprQaxo.js";import"./capability-load-error-CKO9v57M.js";const $e="basic-usage",He=[{id:$e,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...He.find(t=>t.id===$e)?.tools??[]];const ss=["agents:manage","connections:manage"];new Set(He.filter(t=>ss.includes(t.id)).flatMap(t=>t.tools));function ls(){const t=new Map;for(const e of He){if(e.id===$e)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function os(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ns(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}function is(t){const e=X.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:c,onSelect:u,onToggle:f}=t,d=r?"bg-accent/50":"hover:bg-muted/50";let T;e[0]!==d?(T=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=T):T=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Fe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let g;e[5]!==l.title?(g=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=g):g=e[6];let _;e[7]!==u||e[8]!==a||e[9]!==g?(_=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:u,children:[a,g]}),e[7]=u,e[8]=a,e[9]=g,e[10]=_):_=e[10];let m;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==f||e[15]!==c?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(Qe,{checked:n,onCheckedChange:f,onClick:rs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=f,e[15]=c,e[16]=m):m=e[16];let h;return e[17]!==T||e[18]!==_||e[19]!==m?(h=s.jsxs("div",{className:T,children:[_,m]}),e[17]=T,e[18]=_,e[19]=m,e[20]=h):h=e[20],h}function rs(t){return t.stopPropagation()}function as(t){const e=X.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,c=`tool-${l}-${r.name}`,u=n?"text-foreground":"text-muted-foreground";let f;e[0]!==u?(f=Z("text-sm font-medium",u),e[0]=u,e[1]=f):f=e[1];let d;e[2]!==f||e[3]!==r.name?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:f,children:r.name})}),e[2]=f,e[3]=r.name,e[4]=d):d=e[4];let T;e[5]!==r.description?(T=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=T):T=e[6];let a;e[7]!==d||e[8]!==T?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,T]}),e[7]=d,e[8]=T,e[9]=a):a=e[9];const g=`tool-${l}-${r.name}`;let _;e[10]!==n||e[11]!==o||e[12]!==g?(_=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Qe,{id:g,checked:n,onCheckedChange:o,onClick:cs})}),e[10]=n,e[11]=o,e[12]=g,e[13]=_):_=e[13];let m;return e[14]!==c||e[15]!==a||e[16]!==_?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,_]}),e[14]=c,e[15]=a,e[16]=_,e[17]=m):m=e[17],m}function cs(t){return t.stopPropagation()}function ds({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,c]=Q.useState(""),u=r!==void 0?r:o,f=Q.useDeferredValue(u),[d,T]=Q.useState("all"),[a,g]=Q.useState(!1),_=Q.useRef(new Set(Object.keys(t))),{org:m}=Ge(),h=Qt({connectionId:$t,orgId:m.id,orgSlug:m.slug}),O=100,R=f.trim(),p=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,C=!!l,A={...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:0,...C&&{include_virtual:!0}},M=JSON.stringify(A),{data:S,fetchNextPage:b,hasNextPage:D,isFetchingNextPage:I}=Ft({queryKey:de.collectionListInfinite(h,m.id,"","CONNECTIONS",M),queryFn:async({pageParam:E=0})=>(await h.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:E,...C&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(E,w)=>{if(E?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),N=S?.pages.flatMap(E=>E?.items??[])??[],P=Kt(b,D??!1,I),i=l?N.filter(E=>E.connection_type!=="VIRTUAL"?!0:qt(E.connection_url)!==l):N,x=_.current,U=[...x.values()].map(E=>i.find(w=>w.id===E)).filter(E=>E!==void 0),G=i.filter(E=>!x.has(E.id)),Y=[...U,...G],v=E=>{const w=t[E];return w!==void 0&&w.length>0},K=Y.filter(E=>{if(d==="all")return!0;const w=v(E.id);return d==="selected"?w:d==="unselected"?!w:!0}),[L,z]=Q.useState(Y[0]?.id??null),V=L?Y.find(E=>E.id===L)??null:null,{data:k,isFetching:B}=Ve({queryKey:de.collectionItem(h,m.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await h.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=k?.tools??[],J=(E,w)=>t[E]?.includes(w)??!1,te=(E,w)=>{const H=t[E]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[E]:se[E]=le}else se[E]=[...H,w];e(se)},oe=E=>{const w=E===L?$:[];if(!w.length)return;const H=t[E]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[E]:(le[E]=q,z(E)),e(le)},F=E=>{z(E),g(!0)},W=()=>{g(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[r===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>T("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>T("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>T("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:K.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(u?"common.toolSetSelector.noConnectionsFound":d==="selected"?"common.toolSetSelector.noServersSelected":d==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(E=>{const w=L===E.id,H=w?$.length:0,q=t[E.id]?.length??0;return s.jsx(is,{connection:{...E,tools:w?$:E.tools},isSelected:w,hasToolsEnabled:v(E.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>F(E.id),onToggle:()=>oe(E.id)},E.id)}),s.jsx("div",{ref:P,className:"h-4"}),I&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(zt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Fe,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:$.map(E=>s.jsx(as,{connectionId:V.id,tool:E,isSelected:J(V.id,E.name),onToggle:()=>te(V.id,E.name)},E.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const ms=qe({role:qe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Je(),staticPermissions:we(re()),toolSet:Ze(re(),we(re())),allowAllModels:Je(),modelSet:Ze(re(),we(re())),memberIds:we(re())});function lt(t,e,l,r){const n=s.jsx(je,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(ve,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function us(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie();let T;e[0]!==u?(T=u.trim().toLowerCase(),e[0]=u,e[1]=T):T=e[1];const a=Q.useDeferredValue(T);let g;if(e[2]!==l||e[3]!==a||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==d){const _=ls(),m=(I,N)=>{if(!f){if(l&&N){const P=_.flatMap(Ts).flatMap(gs);n(!1),o(P.filter(i=>!I.tools.includes(i)));return}l||o(ns(I,r,!N))}};let h;e[11]!==a?(h=I=>{const{section:N,capabilities:P}=I;return{section:N,capabilities:P.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=h):h=e[12];const O=_.map(h).filter(fs);let R;e[13]!==d?(R=d("settings.orgRoleDetail.general"),e[13]=d,e[14]=R):R=e[14];let p;e[15]!==d?(p=d("settings.orgRoleDetail.allOrgPermissions"),e[15]=d,e[16]=p):p=e[16];let C;e[17]!==d?(C=d("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=d,e[18]=C):C=e[18];let A;e[19]!==l||e[20]!==n||e[21]!==o?(A=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=A):A=e[22];let M;e[23]!==l||e[24]!==f||e[25]!==d||e[26]!==A?(M=lt(d,l,f,A),e[23]=l,e[24]=f,e[25]=d,e[26]=A,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==f?(S=f?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=f,e[32]=S):S=e[32];let b;e[33]!==S||e[34]!==p||e[35]!==C||e[36]!==M?(b=s.jsx(Xe,{children:s.jsx(et,{title:p,description:C,action:M,onClick:S})}),e[33]=S,e[34]=p,e[35]=C,e[36]=M,e[37]=b):b=e[37];let D;e[38]!==b||e[39]!==R?(D=s.jsx(We,{title:R,children:b}),e[38]=b,e[39]=R,e[40]=D):D=e[40],g=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,O.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:d("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:u})}):O.map(I=>{const{section:N,capabilities:P}=I;return s.jsx(We,{title:N,children:s.jsx(Xe,{children:P.map(i=>{const x=os(i,r,l);return s.jsx(et,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:lt(d,x,f,()=>m(i,x)),onClick:f?void 0:()=>m(i,x)},i.id)})})},N)})]})}),e[2]=l,e[3]=a,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=r,e[9]=d,e[10]=g}else g=e[10];return g}function fs(t){return t.capabilities.length>0}function gs(t){return t.tools}function Ts(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},_s={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function hs(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function Es(t){return _s[t]??St[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const At=30;function xs(t){const e=X.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:c,allConnectionModelIds:u,selectedModels:f,allowAllModels:d,allConnectionModelsSelected:T,onToggleModel:a,onExitAllowAll:g,readOnly:_,defaultExpanded:m}=t,h=ie(),[O,R]=Q.useState(m),p=m||O,C=R,[A,M]=Q.useState(At);let S;e[0]!==T||e[1]!==d||e[2]!==f?(S=I=>d||T||f.includes("*")||f.includes(I),e[0]=T,e[1]=d,e[2]=f,e[3]=S):S=e[3];const b=S;let D;if(e[4]!==u||e[5]!==d||e[6]!==l||e[7]!==p||e[8]!==o||e[9]!==b||e[10]!==c||e[11]!==g||e[12]!==a||e[13]!==_||e[14]!==r||e[15]!==n||e[16]!==h||e[17]!==A){let I;e[19]!==b?(I=B=>b(B.id),e[19]=b,e[20]=I):I=e[20];const N=c.filter(I).length,P=c.slice(0,A),i=c.length>A;let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>C(As),e[21]=x):x=e[21];const U=o??Et[r]??It;let G;e[22]!==n||e[23]!==U?(G=s.jsx(Fe,{icon:U,name:n,size:"sm"}),e[22]=n,e[23]=U,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let v;e[27]!==G||e[28]!==Y?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=v):v=e[29];const K=h("settings.orgRoleDetail.enabledCount",{enabledCount:N,total:c.length});let L;e[30]!==K?(L=s.jsx(be,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let z;e[32]!==p?(z=p?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=p,e[33]=z):z=e[33];let V;e[34]!==L||e[35]!==z?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,z]}),e[34]=L,e[35]=z,e[36]=V):V=e[36];let k;e[37]!==V||e[38]!==v?(k=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:x,children:[v,V]}),e[37]=V,e[38]=v,e[39]=k):k=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[k,p&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[P.map(B=>{const $=b(B.id),J=()=>{if(!_){if(d){g(l,u,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!_&&"hover:bg-muted/50 cursor-pointer"),onClick:J,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ss,children:_?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:$,disabled:!0,onCheckedChange:Rs})})}),s.jsx(ve,{children:s.jsx("p",{children:h("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:$,onCheckedChange:J})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(ps),children:h("settings.orgRoleDetail.showMore",{remaining:c.length-A})})]})]}),e[4]=u,e[5]=d,e[6]=l,e[7]=p,e[8]=o,e[9]=b,e[10]=c,e[11]=g,e[12]=a,e[13]=_,e[14]=r,e[15]=n,e[16]=h,e[17]=A,e[18]=D}else D=e[18];return D}function ps(t){return t+At}function Rs(){}function Ss(t){return t.stopPropagation()}function As(t){return!t}function Ns(t){const e=X.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:u,searchQuery:f,readOnly:d}=t,T=Wt(l.id);let a,g,_,m,h;if(e[0]!==u||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==T||e[8]!==d||e[9]!==f||e[10]!==r){h=Symbol.for("react.early_return_sentinel");e:{let p;e[16]!==l.label?(p=x=>({...x,id:x.modelId,provider:l.label}),e[16]=l.label,e[17]=p):p=e[17];const C=T.filter(js).map(p),A=f.trim().toLowerCase(),M=A?C.filter(x=>x.title.toLowerCase().includes(A)||x.id.toLowerCase().includes(A)||x.provider?.toLowerCase().includes(A)):C;if(M.length===0){h=null;break e}const S=new Map;for(const x of M){const U=hs(x.id,l.providerId),G=S.get(U)??{models:[],logo:null};G.models.push({id:x.id,title:Is(x.title),logo:x.logo}),!G.logo&&x.logo&&(G.logo=x.logo),S.set(U,G)}const b=Array.from(S.entries()).map(bs).sort(Cs),D=b.length===1||A.length>0;_="flex flex-col gap-3";const I=Et[l.providerId]??It;let N;e[18]!==l.providerId||e[19]!==I?(N=s.jsx("img",{src:I,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=I,e[20]=N):N=e[20];const P=St[l.providerId]??l.providerId;let i;e[21]!==P?(i=s.jsx("h4",{className:"text-sm font-medium",children:P}),e[21]=P,e[22]=i):i=e[22],e[23]!==i||e[24]!==N?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[N,i]}),e[23]=i,e[24]=N,e[25]=m):m=e[25],a="flex flex-col gap-3",g=b.map(x=>s.jsx(xs,{connectionId:l.id,subProviderId:x.id,subProviderName:x.name,groupLogo:x.logo,models:x.models,allConnectionModelIds:C.map(Os),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:u,onToggleModel:o,onExitAllowAll:c,readOnly:d,defaultExpanded:D},x.id))}e[0]=u,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=T,e[8]=d,e[9]=f,e[10]=r,e[11]=a,e[12]=g,e[13]=_,e[14]=m,e[15]=h}else a=e[11],g=e[12],_=e[13],m=e[14],h=e[15];if(h!==Symbol.for("react.early_return_sentinel"))return h;let O;e[26]!==a||e[27]!==g?(O=s.jsx("div",{className:a,children:g}),e[26]=a,e[27]=g,e[28]=O):O=e[28];let R;return e[29]!==_||e[30]!==m||e[31]!==O?(R=s.jsxs("div",{className:_,children:[m,O]}),e[29]=_,e[30]=m,e[31]=O,e[32]=R):R=e[32],R}function Os(t){return t.id}function Cs(t,e){return t.name.localeCompare(e.name)}function bs(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function js(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie(),T=Q.useDeferredValue(u),a=Jt();let g;e[0]!==r||e[1]!==o?(g=(I,N)=>{const P=r[I]??[],i={...r};if(P.includes(N)){const x=P.filter(U=>U!==N);x.length===0?delete i[I]:i[I]=x}else i[I]=[...P,N];o(i)},e[0]=r,e[1]=o,e[2]=g):g=e[2];const _=g;let m;e[3]!==r||e[4]!==n||e[5]!==o?(m=(I,N,P)=>{n(!1),o({...r,[I]:N.filter(i=>i!==P)})},e[3]=r,e[4]=n,e[5]=o,e[6]=m):m=e[6];const h=m,O=!f&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==O?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",O),e[7]=O,e[8]=R):R=e[8];let p;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==f?(p=()=>{if(f)return;const I=!l;n(I),I&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=f,e[13]=p):p=e[13];let C;e[14]!==d?(C=d("settings.orgRoleDetail.allModels"),e[14]=d,e[15]=C):C=e[15];let A;e[16]!==C?(A=s.jsx("span",{className:"text-sm font-medium",children:C}),e[16]=C,e[17]=A):A=e[17];let M;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==f||e[22]!==d?(M=s.jsx("div",{onClick:Ps,children:f?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(ve,{children:s.jsx("p",{children:d("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:l,onCheckedChange:I=>{n(I),I&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=f,e[22]=d,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==p||e[26]!==A||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:p,children:[A,M]}),e[24]=R,e[25]=p,e[26]=A,e[27]=M,e[28]=S):S=e[28];let b;e[29]!==a||e[30]!==l||e[31]!==T||e[32]!==h||e[33]!==r||e[34]!==f||e[35]!==d||e[36]!==_?(b=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(I=>s.jsx(Q.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"size-4"}),d("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ns,{connection:I,selectedModels:r[I.id]??[],allowAllModels:l,onToggleModel:_,onExitAllowAll:h,allConnectionModelsSelected:(r[I.id]??[]).includes("*"),searchQuery:T,readOnly:f})},I.id)),e[29]=a,e[30]=l,e[31]=T,e[32]=h,e[33]=r,e[34]=f,e[35]=d,e[36]=_,e[37]=b):b=e[37];let D;return e[38]!==S||e[39]!==b?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,b]}),e[38]=S,e[39]=b,e[40]=D):D=e[40],D}function Ds(){}function Ps(t){return t.stopPropagation()}function vs(t){const e=X.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,c=ie(),[u,f]=Q.useState(""),d=Q.useDeferredValue(u);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[0]=T):T=e[0];const[a,g]=Q.useState(T),{data:_}=xt();let m,h,O,R,p,C,A,M,S,b,D;if(e[1]!==_?.data?.members||e[2]!==d||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==u||e[8]!==n||e[9]!==c){const L=_?.data?.members??[];let z;e[21]!==d?(z=F=>{const W=d.toLowerCase();return F.user?.name?.toLowerCase().includes(W)||F.user?.email?.toLowerCase().includes(W)},e[21]=d,e[22]=z):z=e[22];const V=L.filter(z);let k;e[23]!==o||e[24]!==r||e[25]!==a?(k=()=>{o(a),g([]),r(!1)},e[23]=o,e[24]=r,e[25]=a,e[26]=k):k=e[26],O=k,h=dt,b=l,D=r,m=mt,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(ut,{children:B}),e[29]=B,e[30]=$):$=e[30];let J;e[31]!==c?(J=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=J):J=e[32];let te;e[33]!==J?(te=s.jsx(ft,{children:J}),e[33]=J,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=S):S=e[37],C="flex flex-col h-80";let oe;e[38]!==c?(oe=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=oe):oe=e[39],e[40]!==u||e[41]!==oe?(A=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ze,{value:u,onChange:f,placeholder:oe,className:"w-full"})}),e[40]=u,e[41]=oe,e[42]=A):A=e[42],R="flex-1 overflow-auto",p=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(u?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const W=F.role!=="owner",E=n.includes(F.id),w=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!W||E?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Qe,{checked:w||E,onCheckedChange:()=>{!W||E||g(H=>H.includes(F.id)?H.filter(q=>q!==F.id):[...H,F.id])},disabled:!W||E}),s.jsx(Rt,{url:F.user?.image??void 0,fallback:pt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!W&&s.jsx(be,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),E&&W&&s.jsx(be,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=_?.data?.members,e[2]=d,e[3]=o,e[4]=r,e[5]=l,e[6]=a,e[7]=u,e[8]=n,e[9]=c,e[10]=m,e[11]=h,e[12]=O,e[13]=R,e[14]=p,e[15]=C,e[16]=A,e[17]=M,e[18]=S,e[19]=b,e[20]=D}else m=e[10],h=e[11],O=e[12],R=e[13],p=e[14],C=e[15],A=e[16],M=e[17],S=e[18],b=e[19],D=e[20];let I;e[43]!==R||e[44]!==p?(I=s.jsx("div",{className:R,children:p}),e[43]=R,e[44]=p,e[45]=I):I=e[45];let N;e[46]!==I||e[47]!==C||e[48]!==A?(N=s.jsxs("div",{className:C,children:[A,I]}),e[46]=I,e[47]=C,e[48]=A,e[49]=N):N=e[49];let P;e[50]!==c?(P=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=P):P=e[51];let i;e[52]!==P?(i=s.jsx(Tt,{children:P}),e[52]=P,e[53]=i):i=e[53];const x=a.length===0;let U;e[54]!==a.length||e[55]!==c?(U=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=U):U=e[56];let G;e[57]!==O||e[58]!==x||e[59]!==U?(G=s.jsx(_t,{onClick:O,disabled:x,children:U}),e[57]=O,e[58]=x,e[59]=U,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(ht,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==m||e[65]!==N||e[66]!==Y||e[67]!==M||e[68]!==S?(v=s.jsxs(m,{className:M,children:[S,N,Y]}),e[64]=m,e[65]=N,e[66]=Y,e[67]=M,e[68]=S,e[69]=v):v=e[69];let K;return e[70]!==h||e[71]!==v||e[72]!==b||e[73]!==D?(K=s.jsx(h,{open:b,onOpenChange:D,children:v}),e[70]=h,e[71]=v,e[72]=b,e[73]=D,e[74]=K):K=e[74],K}function Ls(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=n===void 0?!1:n,T=o===void 0?void 0:o,a=ie(),g=Q.useDeferredValue(c),{data:_}=xt();let m,h,O;if(e[0]!==_?.data?.members||e[1]!==g||e[2]!==l||e[3]!==r||e[4]!==d||e[5]!==T||e[6]!==c||e[7]!==a){const M=_?.data?.members??[];let S;e[11]!==l?(S=i=>l.includes(i.id),e[11]=l,e[12]=S):S=e[12];const b=M.filter(S);let D;e[13]!==g?(D=i=>{const x=g.toLowerCase();return i.user?.name?.toLowerCase().includes(x)||i.user?.email?.toLowerCase().includes(x)},e[13]=g,e[14]=D):D=e[14];const I=b.filter(D);let N;e[15]!==T||e[16]!==a?(N=T??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=T,e[16]=a,e[17]=N):N=e[17];const P=N;O="flex flex-col h-full",m="flex-1 overflow-auto",h=b.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):I.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:I.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:pt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),d?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(tt,{size:16})})})}),s.jsx(ve,{children:s.jsx("p",{children:P})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(x=>x!==i.id)),children:s.jsx(tt,{size:16})})]},i.id))}),e[0]=_?.data?.members,e[1]=g,e[2]=l,e[3]=r,e[4]=d,e[5]=T,e[6]=c,e[7]=a,e[8]=m,e[9]=h,e[10]=O}else m=e[8],h=e[9],O=e[10];let R;e[18]!==m||e[19]!==h?(R=s.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=R):R=e[20];let p;e[21]!==l||e[22]!==r?(p=M=>r([...l,...M]),e[21]=l,e[22]=r,e[23]=p):p=e[23];let C;e[24]!==u||e[25]!==l||e[26]!==f||e[27]!==p?(C=s.jsx(vs,{open:u,onOpenChange:f,selectedMemberIds:l,onAddMembers:p}),e[24]=u,e[25]=l,e[26]=f,e[27]=p,e[28]=C):C=e[28];let A;return e[29]!==O||e[30]!==R||e[31]!==C?(A=s.jsxs("div",{className:O,children:[R,C]}),e[29]=O,e[30]=R,e[31]=C,e[32]=A):A=e[32],A}function ys(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Q.Suspense,{fallback:l,children:s.jsx(Ls,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const ws={owner:[],admin:[],user:[]};function Gs(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:ws[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),c=o?[]:n.filter(a=>a!=="*"),u={};for(const[a,g]of Object.entries(r))if(!(a==="self"||a==="models"))if(a==="*")for(const _ of l)u[_.id]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g;else{const _=l.find(m=>m.id===a);_&&(u[a]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g)}const f=r.models||[],d=f.length===0||f.includes("*:*"),T={};if(!d)for(const a of f){const g=a.indexOf(":");if(g===-1)continue;const _=a.slice(0,g),m=a.slice(g+1);T[_]||(T[_]=[]),T[_].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:u,allowAllModels:d,modelSet:T,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function ks(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const c=e.find(u=>u.id===r)?.tools?.map(u=>u.name)??[];l[r]=c.length>0&&c.every(u=>n.includes(u))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const c of o)r.push(`${n}:${c}`);r.length>0&&(l.models=r)}return l}function Bs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Vs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,c=ie();let u;e[0]!==o||e[1]!==c?(u=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=u):u=e[2];const f=u;if(l){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Be,{size:16}),e[3]=g):g=e[3];let _;e[4]!==c?(_=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=_):_=e[5];let m;e[6]!==_?(m=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[g,_]})})}),e[6]=_,e[7]=m):m=e[7];let h;e[8]!==f?(h=s.jsx(ve,{children:s.jsx("p",{children:f})}),e[8]=f,e[9]=h):h=e[9];let O;return e[10]!==m||e[11]!==h?(O=s.jsx(Me,{children:s.jsxs(De,{children:[m,h]})}),e[10]=m,e[11]=h,e[12]=O):O=e[12],O}let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:16}),e[13]=d):d=e[13];let T;e[14]!==c?(T=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=T):T=e[15];let a;return e[16]!==n||e[17]!==T?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[d,T]}),e[16]=n,e[17]=T,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Ge(),r=Ke(),n=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==r?(c=()=>r.organization.listMembers(),e[2]=r,e[3]=c):c=e[3];let u;e[4]!==o||e[5]!==c?(u={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=u):u=e[6];const{data:f,isPending:d}=Ve(u);if(d||!n){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=_):_=e[7],_}let T;e[8]!==f?.data?.members?(T=f?.data?.members??[],e[8]=f?.data?.members,e[9]=T):T=e[9];const a=T;let g;return e[10]!==n||e[11]!==a||e[12]!==t?(g=s.jsx(Ks,{...t,members:a,connections:n}),e[10]=n,e[11]=a,e[12]=t,e[13]=g):g=e[13],g}function Ks({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:c}=Ge(),u=Ke(),f=ot(),d=t.kind==="builtin",T=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[g,_]=Q.useState(d?"org":"mcp"),m=Ct({resolver:bt(ms),defaultValues:Bs(t,r,n)}),h=m.formState.isValid,O=m.formState.isDirty,R=nt({mutationFn:async i=>{const x=ks(i,n),U=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(v,K)=>{const L=r.filter(k=>k.role===(K??v)).map(k=>k.id),z=i.memberIds.filter(k=>!L.includes(k)),V=L.filter(k=>!i.memberIds.includes(k));for(const k of z){const B=await u.organization.updateMemberRole({memberId:k,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const k of V){const B=await u.organization.updateMemberRole({memberId:k,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const v=i.role.label.toLowerCase().replace(/\s+/g,"-"),K=i.role.slug,L=v!==K,z=await u.organization.updateRole({roleId:i.role.id,data:{permission:x,...L?{roleName:v}:{}}});if(z?.error)throw new Error(z.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(L?v:K,L?K:void 0),L?{...i,role:{...i.role,slug:v}}:i}else{const v=await u.organization.createRole({role:U,permission:x});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await u.organization.updateMemberRole({memberId:K,role:[U]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:U}}}},onSuccess:(i,x)=>{f.invalidateQueries({queryKey:de.members(c)}),f.invalidateQueries({queryKey:de.organizationRoles(c)});const U=!x.role.id&&!x.role.slug,G=x.role.slug==="owner"&&!x.role.id;Ye(G?"role_members_updated":U?"role_created":"role_updated",{role_slug:x.role.slug??null}),Ce.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":U?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),m.reset(i),l(i.role.id)},onError:i=>{Ce.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),p=m.handleSubmit(i=>{if(!i.role.label.trim()){Ce.error(o("settings.orgRoleDetail.roleNameIsRequired")),m.setFocus("role.label");return}R.mutate(i)}),C=!T,A=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...T?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,b]=Q.useState(""),[D,I]=Q.useState(!1),N=i=>{_(i),b("")},P={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ne,{children:s.jsxs(Ne.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ne.Title,{actions:C&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:p,disabled:R.isPending||!h||!O,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(m.watch("role.label")))}),T&&s.jsx(it,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...m.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:A})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(i=>s.jsx("button",{type:"button",onClick:()=>N(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ze,{value:S,onChange:b,placeholder:P[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(Vs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>I(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!T&&s.jsx(ds,{toolSet:m.watch("toolSet"),onToolSetChange:i=>m.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:S}),g==="org"&&s.jsx(us,{allowAllStaticPermissions:m.watch("allowAllStaticPermissions"),staticPermissions:m.watch("staticPermissions"),onAllowAllChange:i=>m.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>m.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="models"&&s.jsx(Ms,{allowAllModels:m.watch("allowAllModels"),modelSet:m.watch("modelSet"),onAllowAllChange:i=>m.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>m.setValue("modelSet",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="members"&&s.jsx(ys,{memberIds:m.watch("memberIds"),onMemberIdsChange:i=>m.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:I})]})})]})})}function zs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Fs(t){const e=X.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:c}=Mt();let u;return e[0]!==l||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o?(u=s.jsx(ts,{granted:n,loading:o,error:c,area:l,children:r}),e[0]=l,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function $s(){const t=X.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),c=vt();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=rt(u),{locator:d}=Ge(),T=Ke(),a=ot(),{customRoles:g,refetch:_}=Lt();let m;t[1]!==c?(m=j=>c({to:".",search:y=>({...y,role:j})}),t[1]=c,t[2]=m):m=t[2];const h=m;let O;e:{if(!f){O=null;break e}if(f==="new"){O={kind:"new"};break e}if(f.startsWith("builtin-")){O={kind:"builtin",role:f.slice(8)};break e}let j;t[3]!==f?(j=ee=>ee.id===f,t[3]=f,t[4]=j):j=t[4];const y=g.find(j);O=y?{kind:"custom",role:y}:null}const R=O;let p;t[5]!==d?(p=de.members(d),t[5]=d,t[6]=p):p=t[6];let C;t[7]!==T?(C=()=>T.organization.listMembers(),t[7]=T,t[8]=C):C=t[8];let A;t[9]!==p||t[10]!==C?(A={queryKey:p,queryFn:C},t[9]=p,t[10]=C,t[11]=A):A=t[11];const{data:M}=Ve(A);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const b=S;let D;t[14]!==b?(D=j=>b.filter(y=>y.role===j).length,t[14]=b,t[15]=D):D=t[15];const I=D;let N;if(t[16]!==g||t[17]!==I||t[18]!==l||t[19]!==e){let j;t[21]!==I||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:I(ce.role),label:e(ce.labelKey)}}),t[21]=I,t[22]=e,t[23]=j):j=t[23];const y=Qs.map(j);let ee;t[24]!==I?(ee=ce=>({kind:"custom",role:{...ce,memberCount:I(ce.role)}}),t[24]=I,t[25]=ee):ee=t[25];const Nt=g.map(ee);if(N=[...y,...Nt],l){const ce=l.toLowerCase();N=N.filter(Ot=>Ot.role.label.toLowerCase().includes(ce))}t[16]=g,t[17]=I,t[18]=l,t[19]=e,t[20]=N}else N=t[20];let P;t[26]!==T?(P=async j=>{const y=await T.organization.deleteRole({roleId:j});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=T,t[27]=P):P=t[27];const i=nt({mutationFn:P,onSuccess:(j,y)=>{Ye("role_deleted",{role_id:y}),a.invalidateQueries({queryKey:de.members(d)}),a.invalidateQueries({queryKey:de.organizationRoles(d)}),Ce.success(e("settings.roles.deletedSuccessfully")),_(),R?.kind==="custom"&&R.role.id===y&&h(void 0)},onError:Ws});let x;t[28]!==e?(x=e("settings.roles.columnRole"),t[28]=e,t[29]=x):x=t[29];let U;t[30]!==x?(U={id:"role",header:x,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=x,t[31]=U):U=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(be,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(be,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let v;t[36]!==G||t[37]!==Y?(v={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=v):v=t[38];let K;t[39]!==e?(K=e("settings.roles.columnPermissions"),t[39]=e,t[40]=K):K=t[40];let L;t[41]!==e?(L=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=j.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=L):L=t[42];let z;t[43]!==K||t[44]!==L?(z={id:"permissions",header:K,render:L,cellClassName:"flex-1 min-w-0"},t[43]=K,t[44]=L,t[45]=z):z=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let k;t[48]!==V?(k={id:"members",header:V,render:Zs,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=k):k=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:Hs,children:s.jsxs(kt,{variant:"destructive",onClick:()=>{const y=j.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==U||t[53]!==v||t[54]!==z||t[55]!==k||t[56]!==B?($=[U,v,z,k,B],t[52]=U,t[53]=v,t[54]=z,t[55]=k,t[56]=B,t[57]=$):$=t[57];const J=$;let te;t[58]!==h?(te=j=>{if(j.kind==="builtin")h(`builtin-${j.role.role}`);else{const y=j.role;h(y.id)}},t[58]=h,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==h?(j=()=>h(void 0),t[60]=h,t[61]=j):j=t[61];let y;return t[62]!==_||t[63]!==h?(y=()=>{_(),h(void 0)},t[62]=_,t[63]=h,t[64]=y):y=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:y},zs(R))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let W;t[67]===Symbol.for("react.memo_cache_sentinel")?(W=j=>{j.key==="Escape"&&(r(""),j.target.blur())},t[67]=W):W=t[67];let E;t[68]!==l||t[69]!==F?(E=s.jsx(ze,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:W}),t[68]=l,t[69]=F,t[70]=E):E=t[70];let w;t[71]!==h?(w=()=>h("new"),t[71]=h,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Be,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==E||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,se]}),t[79]=E,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(st,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(st,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let me;t[85]!==N||t[86]!==J||t[87]!==oe||t[88]!==ne?(me=s.jsx(Yt,{columns:J,data:N,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=N,t[86]=J,t[87]=oe,t[88]=ne,t[89]=me):me=t[89];const Ue=n!==null;let Le;t[90]===Symbol.for("react.memo_cache_sentinel")?(Le=j=>!j&&o(null),t[90]=Le):Le=t[90];let ue;t[91]!==e?(ue=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=ue):ue=t[92];let fe;t[93]!==ue?(fe=s.jsx(ut,{children:ue}),t[93]=ue,t[94]=fe):fe=t[94];const ke=n?.label??"";let ge;t[95]!==e||t[96]!==ke?(ge=e("settings.roles.deleteRoleConfirm",{role:ke}),t[95]=e,t[96]=ke,t[97]=ge):ge=t[97];let Te;t[98]!==ge?(Te=s.jsx(ft,{children:ge}),t[98]=ge,t[99]=Te):Te=t[99];let _e;t[100]!==fe||t[101]!==Te?(_e=s.jsxs(gt,{children:[fe,Te]}),t[100]=fe,t[101]=Te,t[102]=_e):_e=t[102];let he;t[103]!==e?(he=e("settings.roles.cancel"),t[103]=e,t[104]=he):he=t[104];let Ee;t[105]!==he?(Ee=s.jsx(Tt,{children:he}),t[105]=he,t[106]=Ee):Ee=t[106];let Ie;t[107]!==i||t[108]!==n?(Ie=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ie):Ie=t[109];let xe;t[110]!==e?(xe=e("settings.roles.delete"),t[110]=e,t[111]=xe):xe=t[111];let pe;t[112]!==Ie||t[113]!==xe?(pe=s.jsx(_t,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:xe}),t[112]=Ie,t[113]=xe,t[114]=pe):pe=t[114];let Re;t[115]!==Ee||t[116]!==pe?(Re=s.jsxs(ht,{children:[Ee,pe]}),t[115]=Ee,t[116]=pe,t[117]=Re):Re=t[117];let Se;t[118]!==_e||t[119]!==Re?(Se=s.jsxs(mt,{children:[_e,Re]}),t[118]=_e,t[119]=Re,t[120]=Se):Se=t[120];let Ae;t[121]!==Ue||t[122]!==Se?(Ae=s.jsx(dt,{open:Ue,onOpenChange:Le,children:Se}),t[121]=Ue,t[122]=Se,t[123]=Ae):Ae=t[123];let ye;return t[124]!==le||t[125]!==me||t[126]!==Ae?(ye=s.jsxs(at,{group:"members",className:"gap-6",children:[le,me,Ae]}),t[124]=le,t[125]=me,t[126]=Ae,t[127]=ye):ye=t[127],ye}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Zs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",ct(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(it,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ws(t,e){Ye("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Ce.error(t instanceof Error?t.message:"Failed to delete role")}function Xs(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=rt(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let c;t[5]!==r?(c=r?s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(at,{group:"members",className:"gap-6",children:s.jsx(Dt,{})}),t[5]=r,t[6]=c):c=t[6];let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($s,{}),t[7]=u):u=t[7];let f;t[8]!==c?(f=s.jsx(Q.Suspense,{fallback:c,children:u}),t[8]=c,t[9]=f):f=t[9];let d;return t[10]!==o||t[11]!==f?(d=s.jsx(Pt,{fallback:o,children:f}),t[10]=o,t[11]=f,t[12]=d):d=t[12],d}function Ro(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{area:"roles",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{Ro as default};
@@ -1 +1 @@
1
- import{ae as a,ah as t,ag as e,af as c,ak as d,ai as p,ao as m}from"./index-BTWessD-.js";const s=500;a({title:e().max(s),url:e().max(s),icon:e().max(s)});a({registries:d(e().max(s),a({enabled:t()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:c(e().max(s)).describe("List of MCP app_name or app_id values to hide from the store.")});const i=a({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const _=a({tiers:a({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});a({tiers:a({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});a({ids:c(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const y=a({demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),cms_auto_fresh_branch:t().optional().describe("When a user opens the CMS on a branch whose last commit is older than the staleness window (2 days), move the session to a freshly minted branch cut from the default branch. The stale branch is left intact on GitHub. Off by default.")}),b=new Set(["reviewer_enabled","cheap_reviewer_model"]);function v(n,r){const h=n?.[r];return b.has(r)?h!==!1:h===!0}function w(n){const r=n?.auto_resolve_conflicts;return typeof r=="boolean"?r:n?.auto_merge===!0}const l=256*1024,u=50,o=500,f=5e3;a({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(f).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:a({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:a({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:c(d(e(),m())).max(u).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),m()).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{b as D,y as O,_ as S,w as a,v as o};
1
+ import{ae as a,ah as t,ag as e,af as c,ak as d,ai as p,ao as m}from"./index-CmFHzaVd.js";const s=500;a({title:e().max(s),url:e().max(s),icon:e().max(s)});a({registries:d(e().max(s),a({enabled:t()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:c(e().max(s)).describe("List of MCP app_name or app_id values to hide from the store.")});const i=a({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const _=a({tiers:a({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});a({tiers:a({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});a({ids:c(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const y=a({demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),cms_auto_fresh_branch:t().optional().describe("When a user opens the CMS on a branch whose last commit is older than the staleness window (2 days), move the session to a freshly minted branch cut from the default branch. The stale branch is left intact on GitHub. Off by default.")}),b=new Set(["reviewer_enabled","cheap_reviewer_model"]);function v(n,r){const h=n?.[r];return b.has(r)?h!==!1:h===!0}function w(n){const r=n?.auto_resolve_conflicts;return typeof r=="boolean"?r:n?.auto_merge===!0}const l=256*1024,u=50,o=500,f=5e3;a({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(f).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:a({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:a({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:c(d(e(),m())).max(u).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),m()).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{b as D,y as O,_ as S,w as a,v as o};