decocms 4.358.9 → 4.358.11

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 (261) hide show
  1. package/dist/client/assets/{AlertCircle-DM1wOTV-.js → AlertCircle-sMJfUDOj.js} +1 -1
  2. package/dist/client/assets/{AreaChart-C5Hnj1Lj.js → AreaChart-DLHhIZr_.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-9dpHwu9-.js → ArrowLeft-BXpO8jp8.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-B-LgiGJk.js → ArrowRight-CGaFTEhY.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-OudgxKkt.js → ArrowUp-DAsSMPB5.js} +1 -1
  6. package/dist/client/assets/{Check-B_YxhG30.js → Check-B4ByPWon.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-dm6kQxSf.js → CheckCircle-BGc4x48H.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CHv3VYgp.js → ChevronRight-BJjivsOj.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-DE7kv4Kd.js → ChevronSelectorVertical-DRl4uq1v.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-t8t4fwnR.js → ChevronUp-Y_cRkAu1.js} +1 -1
  11. package/dist/client/assets/{Copy01-Cka2uFEv.js → Copy01-BEIlJ3Fy.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-BRxvnKr_.js → CreditCard01-DTUK0Fh8.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-BrftgIDe.js → DotsVertical-BdS-tfvn.js} +1 -1
  14. package/dist/client/assets/{Download01-ytOYmKSZ.js → Download01-C-wPfdEs.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-xi0yNR5E.js → ErrorBarContext-DTz2fDvu.js} +1 -1
  16. package/dist/client/assets/{Eye-Cze9SkdO.js → Eye-BRPz3z02.js} +1 -1
  17. package/dist/client/assets/{GitBranch01-Dv92hLUV.js → GitBranch01-B3Ncor1x.js} +1 -1
  18. package/dist/client/assets/{Globe01-CFZdQViA.js → Globe01-DMWPhraU.js} +1 -1
  19. package/dist/client/assets/{HardDrive-B6O4Lzvt.js → HardDrive-7cT_kZNx.js} +1 -1
  20. package/dist/client/assets/{Image01-DPhR8WEz.js → Image01-F-FHbPOq.js} +1 -1
  21. package/dist/client/assets/{Key01-CnMMlNjM.js → Key01-4i1Gjc6S.js} +1 -1
  22. package/dist/client/assets/{Link01-BT9hUC6n.js → Link01-CflhCoBY.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-Dd9_oVMY.js → LinkExternal01-CQSXJSFr.js} +1 -1
  24. package/dist/client/assets/{Monitor01-lCN_Uznr.js → Monitor01-C1gh539b.js} +1 -1
  25. package/dist/client/assets/{Package-Pjoambo8.js → Package-CYTXeCRF.js} +1 -1
  26. package/dist/client/assets/{Palette-CPWVOo_O.js → Palette-rdWUWvkS.js} +1 -1
  27. package/dist/client/assets/{Play-DUteIsFY.js → Play-D8b6_uMe.js} +1 -1
  28. package/dist/client/assets/{Plus-DsoHS1s-.js → Plus-BcZyep8S.js} +1 -1
  29. package/dist/client/assets/{SearchLg-DVGtsQMZ.js → SearchLg-BLE7LAUf.js} +1 -1
  30. package/dist/client/assets/{SearchMd-DBtIEQFG.js → SearchMd-Bv3H9AtB.js} +1 -1
  31. package/dist/client/assets/{Sector-B56duS3-.js → Sector-DAbT1AHV.js} +1 -1
  32. package/dist/client/assets/{Settings02-nB2LBjem.js → Settings02-BhOb-Osa.js} +1 -1
  33. package/dist/client/assets/{Share07-DxFaah4G.js → Share07-CBS1tR5Z.js} +1 -1
  34. package/dist/client/assets/{Shield01-YkTEmRCE.js → Shield01-Cdz5fe40.js} +1 -1
  35. package/dist/client/assets/{Stars01-XqGB97Zv.js → Stars01-BRJbkUay.js} +1 -1
  36. package/dist/client/assets/{Sun-Cf4BP4WB.js → Sun-D0JwLbN1.js} +1 -1
  37. package/dist/client/assets/{Tool01-BfzgVlWE.js → Tool01-CEhf8lFd.js} +1 -1
  38. package/dist/client/assets/{Tool02-DJ6ebzoK.js → Tool02-CNUyQ43x.js} +1 -1
  39. package/dist/client/assets/{Trash01-CdmAHj_X.js → Trash01-r3HSm3ii.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-CbspxXI2.js → TrendUp01-BeVI9Ti3.js} +1 -1
  41. package/dist/client/assets/{Upload01-Bhk_UoPj.js → Upload01-D75FQMRM.js} +1 -1
  42. package/dist/client/assets/{User01-BkT796JC.js → User01-DgalGs_E.js} +1 -1
  43. package/dist/client/assets/{UserSquare-BSLxGup_.js → UserSquare-DG-IsvUK.js} +1 -1
  44. package/dist/client/assets/{Users01-Dyo9ZzPj.js → Users01-Db22J7Ma.js} +1 -1
  45. package/dist/client/assets/{Users03-BX6ICswR.js → Users03-CGlbwn0I.js} +1 -1
  46. package/dist/client/assets/{XCircle-CJuCeBSM.js → XCircle-DSl9oiph.js} +1 -1
  47. package/dist/client/assets/{XClose-C3LO4RAn.js → XClose-DTmF36Gp.js} +1 -1
  48. package/dist/client/assets/{Zap-DNjSZhAl.js → Zap-DpMY6Bkw.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-vW_y2VPH.js → ZoomOut-BvYhouFP.js} +1 -1
  50. package/dist/client/assets/{access-gate-CsjPwmbX.js → access-gate-jRlbcBuH.js} +1 -1
  51. package/dist/client/assets/{agent-icon-7Ul-3CFr.js → agent-icon-DrDgtGp9.js} +1 -1
  52. package/dist/client/assets/{agents-list-C3jwjn4u.js → agents-list-DvG8JIC1.js} +1 -1
  53. package/dist/client/assets/{ai-providers-C8FU-ETD.js → ai-providers-CCrGh6U8.js} +1 -1
  54. package/dist/client/assets/{alert-1SFaWtG7.js → alert-Dw0jXqbl.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-KXEmr_A6.js → alert-dialog-DPDNkomQ.js} +1 -1
  56. package/dist/client/assets/{analytics-tab-B2s4PZqh.js → analytics-tab-BbmOtkJJ.js} +1 -1
  57. package/dist/client/assets/{api-keys-BtqlUWaN.js → api-keys-B-oHbhFe.js} +1 -1
  58. package/dist/client/assets/api-keys-BCOBRhJj.js +1 -0
  59. package/dist/client/assets/{app-editor-DfKghIRC.js → app-editor-MypbAVTS.js} +1 -1
  60. package/dist/client/assets/{auth-jEXOVJdJ.js → auth-B5Ukdogo.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-DE1giVB4.js → auth-catchall-zrUtaw8h.js} +1 -1
  62. package/dist/client/assets/{auth-entry-lo3TAtpl.js → auth-entry-DOXWq-FU.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-BgmqQbTN.js → auth-split-layout-D3RpW_Qq.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-C9jOdAvp.js → authenticate-and-persist-oauth-gDg04aON.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-DvZQrXCp.js → automation-list-row-B6sgV8g6.js} +1 -1
  66. package/dist/client/assets/{automation-runs-aPXD_uTZ.js → automation-runs-BzerarUD.js} +1 -1
  67. package/dist/client/assets/{automations-CskLVFMr.js → automations-7fj-R7AY.js} +1 -1
  68. package/dist/client/assets/{autosend-mKs95JqV.js → autosend-d-_fNxN0.js} +1 -1
  69. package/dist/client/assets/{avatar-BPVI4atE.js → avatar-BuayRM7K.js} +1 -1
  70. package/dist/client/assets/{badge-CLI8BJXF.js → badge-SbDG1KPm.js} +1 -1
  71. package/dist/client/assets/{block-document-rK9gmLgc.js → block-document-znZeq77h.js} +1 -1
  72. package/dist/client/assets/{breadcrumb-DzQvHKGE.js → breadcrumb-CcqYKnwb.js} +1 -1
  73. package/dist/client/assets/{buckets-bSO6V5oa.js → buckets-CFOg-hP-.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-DlgEKp--.js → bulk-category-panel--gjuqpP8.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-Ewp013Fw.js → capability-load-error-dpQnYWls.js} +1 -1
  76. package/dist/client/assets/{cards-CTM_z6JU.js → cards-Br51Ue8p.js} +1 -1
  77. package/dist/client/assets/{category-editor-55W8BV7D.js → category-editor-CMsLp2T0.js} +1 -1
  78. package/dist/client/assets/{cdn-tab-DtO_62LW.js → cdn-tab-Cb_PpQmd.js} +1 -1
  79. package/dist/client/assets/{chart-CfRLS9xT.js → chart-D6SDwbfl.js} +1 -1
  80. package/dist/client/assets/{chat-context-Cnf8ag8e.js → chat-context-Bkxa6Ivv.js} +1 -1
  81. package/dist/client/assets/{checkbox-DT8c2BIN.js → checkbox-DcxXfUdE.js} +1 -1
  82. package/dist/client/assets/{choose-editor-CwFAKCCH.js → choose-editor-B2CqgEYn.js} +1 -1
  83. package/dist/client/assets/{cli-auth-success-CQci1-No.js → cli-auth-success-D50tR8WG.js} +1 -1
  84. package/dist/client/assets/{client-icons-DcCbGBcw.js → client-icons-Dil6Sjof.js} +1 -1
  85. package/dist/client/assets/{collection-detail-DfaKMGP2.js → collection-detail-G317Lk10.js} +1 -1
  86. package/dist/client/assets/{collection-display-button-ESAZgPL0.js → collection-display-button-Dv8T6xuF.js} +1 -1
  87. package/dist/client/assets/{collection-search-B2UtpzT2.js → collection-search-Cc0aBpWG.js} +1 -1
  88. package/dist/client/assets/{collection-table-wrapper-BASvvH9a.js → collection-table-wrapper-D45S2x_1.js} +1 -1
  89. package/dist/client/assets/{collection-tabs-b6io6wfY.js → collection-tabs-JlAc3rYE.js} +1 -1
  90. package/dist/client/assets/{command-CALmXOXE.js → command-PIkZMCX7.js} +1 -1
  91. package/dist/client/assets/{commerce-onboarding-JQkLXz3m.js → commerce-onboarding-vxITCucC.js} +1 -1
  92. package/dist/client/assets/{connect-BZsIEi1o.js → connect-DnmMTk1h.js} +1 -1
  93. package/dist/client/assets/{connect-layout-ByjvsYEz.js → connect-layout-DBHNLB0g.js} +1 -1
  94. package/dist/client/assets/{connection-B7GAvn4a.js → connection-Dvoitr_G.js} +1 -1
  95. package/dist/client/assets/{connection-card-BIzeMrZG.js → connection-card-CYKnwV8g.js} +1 -1
  96. package/dist/client/assets/{connection-detail-RTSEdP1X.js → connection-detail-CWl_mz2-.js} +1 -1
  97. package/dist/client/assets/{connection-form-helpers-DDJ72RqH.js → connection-form-helpers-CFXV1UTe.js} +1 -1
  98. package/dist/client/assets/{connections-DKevs0dE.js → connections-DCki7WZd.js} +1 -1
  99. package/dist/client/assets/{create-organization-dialog-YKR8Vlp2.js → create-organization-dialog-4H9pF7Md.js} +1 -1
  100. package/dist/client/assets/{decopilot-sse-pool-CciVCe4h.js → decopilot-sse-pool-DrT9aVW6.js} +1 -1
  101. package/dist/client/assets/{dialog-DBF7H4cU.js → dialog-BHOSFmXf.js} +1 -1
  102. package/dist/client/assets/{domain-settings-BWFxKHvI.js → domain-settings-DX7I0sGK.js} +1 -1
  103. package/dist/client/assets/{drawer-49fZ3NcG.js → drawer-Qg29q0PP.js} +1 -1
  104. package/dist/client/assets/{dropdown-menu-C2_-PA0d.js → dropdown-menu-nrBYVcW8.js} +1 -1
  105. package/dist/client/assets/{e2e-tab-BGkU9tzm.js → e2e-tab-BQlizBTj.js} +1 -1
  106. package/dist/client/assets/{editor-huY6kt2_.js → editor-DF39hNzV.js} +1 -1
  107. package/dist/client/assets/{empty-state-D1sYtfoS.js → empty-state-CFu4W-SH.js} +1 -1
  108. package/dist/client/assets/{empty-state-Cm5_JlLy.js → empty-state-DLiK3fg3.js} +1 -1
  109. package/dist/client/assets/{extract-connection-data-Bc1gK_oh.js → extract-connection-data-BkJXLGgJ.js} +1 -1
  110. package/dist/client/assets/{file-explorer-DLXlCaB9.js → file-explorer-w8jHXBI1.js} +1 -1
  111. package/dist/client/assets/{file-type-icon-CGvcwfte.js → file-type-icon-t-S3eRjm.js} +1 -1
  112. package/dist/client/assets/{folder-icon-D_jwJiQ0.js → folder-icon-CG_hGsNr.js} +1 -1
  113. package/dist/client/assets/{form-D5aJ2R1e.js → form-CLkuH-9m.js} +1 -1
  114. package/dist/client/assets/{general-BXYUpmQg.js → general-CSMPv4Xp.js} +1 -1
  115. package/dist/client/assets/{github-icon-CqsUvwtZ.js → github-icon-Dfx3hzYG.js} +1 -1
  116. package/dist/client/assets/{hooks-DpCU1UBz.js → hooks-BTOMqNxG.js} +1 -1
  117. package/dist/client/assets/{index-DClNZMTN.js → index-BHYk6Jjw.js} +6 -6
  118. package/dist/client/assets/{index-DTHoNV5y.js → index-BqdkQDle.js} +1 -1
  119. package/dist/client/assets/index-C5t1xuXb.js +1 -0
  120. package/dist/client/assets/{index-BbDu2xq3.js → index-CJCRZpMB.js} +2 -2
  121. package/dist/client/assets/{index-F19mJ8_N.js → index-CMGTTLrB.js} +1 -1
  122. package/dist/client/assets/{index-Bl9g0J7w.js → index-CTtf0qku.js} +1 -1
  123. package/dist/client/assets/{index-E9nvagxo.js → index-D0pjz4gr.js} +1 -1
  124. package/dist/client/assets/{index-BB4x_gPK.js → index-Dj2zLr6K.js} +1 -1
  125. package/dist/client/assets/{index-Dp8VyMSk.js → index-DwNPqxsN.js} +1 -1
  126. package/dist/client/assets/{index-DFIU7OfS.js → index-T0ut0Fvl.js} +1 -1
  127. package/dist/client/assets/{index-DLPAbVTv.js → index-YwT86mnE.js} +1 -1
  128. package/dist/client/assets/{index-DYCMd9af.js → index-fdGBr2me.js} +1 -1
  129. package/dist/client/assets/{index-redirect-41OhTjna.js → index-redirect-Cq_41ERQ.js} +1 -1
  130. package/dist/client/assets/{infiniteQueryObserver-BQw5N_tk.js → infiniteQueryObserver-D9VzQaEP.js} +1 -1
  131. package/dist/client/assets/{infra-billing-BRWmwXxq.js → infra-billing-BAusPNo2.js} +1 -1
  132. package/dist/client/assets/{input-2a-tqySq.js → input-m33ZpN6u.js} +1 -1
  133. package/dist/client/assets/{integration-icon-BY9o6bXu.js → integration-icon-CD0aQopR.js} +1 -1
  134. package/dist/client/assets/{invite-member-dialog-BjBLqi6k.js → invite-member-dialog-CJcvGndP.js} +1 -1
  135. package/dist/client/assets/{label-Bw3LAQ_7.js → label-BMxzM3Ve.js} +1 -1
  136. package/dist/client/assets/{layout-UTo5bLEd.js → layout-C-LIiFSl.js} +1 -1
  137. package/dist/client/assets/{login-BMF-G7K6.js → login-CWDqOjTD.js} +1 -1
  138. package/dist/client/assets/{markdown-DUDS1ORg.js → markdown-Bxw1tJsj.js} +1 -1
  139. package/dist/client/assets/{mcp-app-renderer-D7KTrdiy.js → mcp-app-renderer-DNC6Ot_G.js} +1 -1
  140. package/dist/client/assets/{mcp-oauth-DjBAF6Mn.js → mcp-oauth-rdIee4FM.js} +1 -1
  141. package/dist/client/assets/{members-EfhqjbXN.js → members-C_Du_jou.js} +1 -1
  142. package/dist/client/assets/{monaco-editor-CQBFoghF.js → monaco-editor-B6OxpiM1.js} +1 -1
  143. package/dist/client/assets/{monitoring-stats-row-ddTONEb4.js → monitoring-stats-row-Be_Axg9K.js} +1 -1
  144. package/dist/client/assets/{multi-select-Ctpcz_8m.js → multi-select-DGuEenYm.js} +1 -1
  145. package/dist/client/assets/{oauth-callback-K9qYFmrD.js → oauth-callback-CP54PDjl.js} +1 -1
  146. package/dist/client/assets/{oauth-callback-ai-provider-CtAl4uAr.js → oauth-callback-ai-provider-_R4YGy-9.js} +1 -1
  147. package/dist/client/assets/{onboarding-xfLGSHPu.js → onboarding-COxgGfgC.js} +1 -1
  148. package/dist/client/assets/{org-layout-XNRDbDzA.js → org-layout-4OZhdTRK.js} +1 -1
  149. package/dist/client/assets/{organization-choice-Crsdzh3H.js → organization-choice-C__KzKuS.js} +1 -1
  150. package/dist/client/assets/{orgs-xS8UVNgJ.js → orgs-7lTkZ7eB.js} +1 -1
  151. package/dist/client/assets/{page-seo-form-zl8f_p5D.js → page-seo-form-DD4YErbb.js} +1 -1
  152. package/dist/client/assets/{popover-VJSdSyV6.js → popover-B0AR8-uG.js} +1 -1
  153. package/dist/client/assets/{post-calendar-BhIz7N7-.js → post-calendar-DHFvfqPB.js} +1 -1
  154. package/dist/client/assets/{post-editor-DbAORW9R.js → post-editor-Bz-PyKud.js} +1 -1
  155. package/dist/client/assets/{primitives-CYgZUNfX.js → primitives-BuNKd77o.js} +1 -1
  156. package/dist/client/assets/{profile-eYQPOj60.js → profile-yI0tLcIL.js} +1 -1
  157. package/dist/client/assets/{project-app-view-voAX5XmM.js → project-app-view-Bi7pElfo.js} +1 -1
  158. package/dist/client/assets/{project-icon-CmWzfvVM.js → project-icon-0DSyaJ6_.js} +1 -1
  159. package/dist/client/assets/{prompts-BpFmw-L7.js → prompts-CoURvJ3r.js} +1 -1
  160. package/dist/client/assets/record-editor-BQODi_F_.js +1 -0
  161. package/dist/client/assets/redirect-editor-DaSQLXzj.js +1 -0
  162. package/dist/client/assets/registry-CjIw4k3z.js +2 -0
  163. package/dist/client/assets/{registry-layout-CdVDyJvL.js → registry-layout-DeLdDI6B.js} +1 -1
  164. package/dist/client/assets/{reports-BslOEc6P.js → reports-B7Cm7YBa.js} +1 -1
  165. package/dist/client/assets/{repositories-tRDlN6-J.js → repositories-CmU9vgEk.js} +1 -1
  166. package/dist/client/assets/{repository-import-picker-CSbM9sb0.js → repository-import-picker-CkvnBKvL.js} +1 -1
  167. package/dist/client/assets/{repository-picker-BNZ7b3Oi.js → repository-picker-C4l5s82P.js} +1 -1
  168. package/dist/client/assets/{require-capability-CmB8qaJ4.js → require-capability-C9_nKDiq.js} +1 -1
  169. package/dist/client/assets/{required-auth-layout-BhMyFWdP.js → required-auth-layout-CniEJoN8.js} +1 -1
  170. package/dist/client/assets/{reset-password-D0uP8U49.js → reset-password-BabrnMYt.js} +1 -1
  171. package/dist/client/assets/{review-settings-CnMZFUWw.js → review-settings-CgtHK-3_.js} +1 -1
  172. package/dist/client/assets/{roles-CC20KgEl.js → roles-jZjOgwp9.js} +1 -1
  173. package/dist/client/assets/{schema-BCMlOSyV.js → schema-Bg1G2bV3.js} +1 -1
  174. package/dist/client/assets/{scroll-area-C4BXuFg6.js → scroll-area-BirNho31.js} +1 -1
  175. package/dist/client/assets/{search-input-Dg-G_3ZW.js → search-input-CB5muLj6.js} +1 -1
  176. package/dist/client/assets/{secrets-Tw7wlLs8.js → secrets-DlRfnQHA.js} +1 -1
  177. package/dist/client/assets/{sections-editor-DN1UJdxb.js → sections-editor-BZoSfcnZ.js} +1 -1
  178. package/dist/client/assets/{select-FSMMPzsI.js → select-DF_uGAC8.js} +1 -1
  179. package/dist/client/assets/{select-model-BnRpD5qa.js → select-model-BwRegvUe.js} +1 -1
  180. package/dist/client/assets/{self-tool-result-D79dnlsl.js → self-tool-result-7tEnoo_9.js} +1 -1
  181. package/dist/client/assets/{seo-editor-DgD5pi5-.js → seo-editor-rXypA9Mm.js} +1 -1
  182. package/dist/client/assets/settings-layout-LHP4mggM.js +1 -0
  183. package/dist/client/assets/{settings-sidebar-VshDUdHD.js → settings-sidebar-WDeA2RQh.js} +1 -1
  184. package/dist/client/assets/{shell-controls-CeFoLZda.js → shell-controls-DBUJ-VSs.js} +1 -1
  185. package/dist/client/assets/{shell-layout-CjwLOLgP.js → shell-layout-Dzdx12hk.js} +1 -1
  186. package/dist/client/assets/{skill-preview-BV5FFdjf.js → skill-preview-4JZAlXRs.js} +1 -1
  187. package/dist/client/assets/{skills-_3m8uTz-.js → skills-D9s1VxHx.js} +1 -1
  188. package/dist/client/assets/{sso--7F-_CVe.js → sso-CZaCaXK-.js} +1 -1
  189. package/dist/client/assets/{store-R-M6rYbT.js → store-MxQrb_eg.js} +1 -1
  190. package/dist/client/assets/store-registry-DjMQgPH3.js +2 -0
  191. package/dist/client/assets/{switch-skcieNrk.js → switch-DbybdixF.js} +1 -1
  192. package/dist/client/assets/{synced-repos-C_Jq3kxm.js → synced-repos-BhDoG6oV.js} +1 -1
  193. package/dist/client/assets/{table-B5Vs3GY1.js → table-CtuD0nsv.js} +1 -1
  194. package/dist/client/assets/{tabs-BES7zN53.js → tabs-b1DPuK7R.js} +1 -1
  195. package/dist/client/assets/{task-board-ztfxGGkb.js → task-board-CbMumJ1c.js} +1 -1
  196. package/dist/client/assets/{task-route-BnxI9DH0.js → task-route-Da8Jlnbv.js} +1 -1
  197. package/dist/client/assets/{tasks-D47DMyGg.js → tasks-BwJDZ6ZT.js} +1 -1
  198. package/dist/client/assets/{textarea-CLacFrbn.js → textarea-DkzJLOUG.js} +1 -1
  199. package/dist/client/assets/{thread-intent-CMg782e5.js → thread-intent-DoT8-yIq.js} +1 -1
  200. package/dist/client/assets/thread-route-DjXx2uUl.js +1 -0
  201. package/dist/client/assets/{toggle-group-D-1pHmtF.js → toggle-group-Bugmvi93.js} +1 -1
  202. package/dist/client/assets/{toolbar-CQH-_Amz.js → toolbar-DotnzmJQ.js} +1 -1
  203. package/dist/client/assets/{toolbar-icon-button-DstnJ2VV.js → toolbar-icon-button-B6CqKA1V.js} +1 -1
  204. package/dist/client/assets/{track-DSESTI7a.js → track-DKwa5cLY.js} +1 -1
  205. package/dist/client/assets/{types-DejsVxb8.js → types-CRixreXo.js} +1 -1
  206. package/dist/client/assets/{use-ai-providers-B7KRAXK1.js → use-ai-providers-CNN3tNpL.js} +1 -1
  207. package/dist/client/assets/{use-automations-BdYWhhm1.js → use-automations-BdQrB4SN.js} +1 -1
  208. package/dist/client/assets/{use-autosave-CL8XjGub.js → use-autosave-DWyHkkOR.js} +1 -1
  209. package/dist/client/assets/{use-connection-C2nO_AVv.js → use-connection-Dn3l_9bZ.js} +1 -1
  210. package/dist/client/assets/{use-copy-BBc3d83z.js → use-copy-BOFFf6hr.js} +1 -1
  211. package/dist/client/assets/{use-create-virtual-mcp-C6aRNtOe.js → use-create-virtual-mcp-C9JgjoDh.js} +1 -1
  212. package/dist/client/assets/{use-date-fns-locale-wkJRogd2.js → use-date-fns-locale-DqwMqwAg.js} +1 -1
  213. package/dist/client/assets/{use-debounced-autosave-Li8rNiA_.js → use-debounced-autosave-Ddgg0MGT.js} +1 -1
  214. package/dist/client/assets/{use-debounced-value-DSll33a0.js → use-debounced-value-CKp59TG5.js} +1 -1
  215. package/dist/client/assets/{use-decopilot-events-BRjyeJJo.js → use-decopilot-events-Db_XzwuP.js} +1 -1
  216. package/dist/client/assets/{use-delete-connection-GnyECS3l.js → use-delete-connection-OTpWRsYq.js} +1 -1
  217. package/dist/client/assets/{use-deployment-admin-D2Td-HJz.js → use-deployment-admin-BEhm0VsD.js} +1 -1
  218. package/dist/client/assets/{use-destination-route-UJWTmz4J.js → use-destination-route-BJZBIggA.js} +1 -1
  219. package/dist/client/assets/{use-file-configs-Cw4K3Ikl.js → use-file-configs-C35joQID.js} +1 -1
  220. package/dist/client/assets/{use-infinite-scroll-ClPXgDIl.js → use-infinite-scroll-mNivro7b.js} +1 -1
  221. package/dist/client/assets/{use-join-requests-CHTNpd-L.js → use-join-requests-D944bVgE.js} +1 -1
  222. package/dist/client/assets/{use-mcp-auth-status-CW1JSYmQ.js → use-mcp-auth-status-nBXoBkq3.js} +1 -1
  223. package/dist/client/assets/{use-mcp-client-BPlXnENu.js → use-mcp-client-Dhce-bqo.js} +1 -1
  224. package/dist/client/assets/{use-mcp-prompts-D5jv-rPf.js → use-mcp-prompts-2-konp0T.js} +1 -1
  225. package/dist/client/assets/{use-mcp-tools-Dfar9HaU.js → use-mcp-tools-C63zOFbz.js} +1 -1
  226. package/dist/client/assets/{use-members-BeBhwrLZ.js → use-members-B-XVLEn5.js} +1 -1
  227. package/dist/client/assets/{use-navigate-to-agent-874sGcUI.js → use-navigate-to-agent-CY9iZjf9.js} +1 -1
  228. package/dist/client/assets/{use-org-auth-client-CbGygSUB.js → use-org-auth-client-BfY2A0mp.js} +1 -1
  229. package/dist/client/assets/{use-org-notice-Dw__a7L-.js → use-org-notice-FYixRM-y.js} +1 -1
  230. package/dist/client/assets/{use-org-sso-BHwfvM7l.js → use-org-sso-_Ac6hUJ-.js} +1 -1
  231. package/dist/client/assets/{use-organization-roles-wkqRpeS-.js → use-organization-roles-C6W8q1Ge.js} +1 -1
  232. package/dist/client/assets/{use-organization-settings-B59Uxf99.js → use-organization-settings-DcUlxNd8.js} +1 -1
  233. package/dist/client/assets/{use-panel-navigate-BSB806-r.js → use-panel-navigate-C-JIn5il.js} +1 -1
  234. package/dist/client/assets/{use-registry-connections-C3vf-j5B.js → use-registry-connections-B4TuENt4.js} +1 -1
  235. package/dist/client/assets/{use-secrets-DFq1lqOb.js → use-secrets-KWnisDzK.js} +1 -1
  236. package/dist/client/assets/{use-section-preview-base-BIWaaxNi.js → use-section-preview-base-Dj13kzwc.js} +1 -1
  237. package/dist/client/assets/{use-status-sounds-cvKo7fIi.js → use-status-sounds-B_q0n_nV.js} +1 -1
  238. package/dist/client/assets/{use-tags-WgYTilH4.js → use-tags-CyfX3BPu.js} +1 -1
  239. package/dist/client/assets/{use-view-mode-CcItG9tS.js → use-view-mode-NmIt24Wm.js} +1 -1
  240. package/dist/client/assets/{use-virtual-mcp-DaOGpnoF.js → use-virtual-mcp-CKm0tgbU.js} +1 -1
  241. package/dist/client/assets/useInfiniteQuery-BuchNYIo.js +1 -0
  242. package/dist/client/assets/useSuspenseInfiniteQuery--xMCyFYl.js +1 -0
  243. package/dist/client/assets/{users-0Elt2Qa1.js → users-DpR9oGyY.js} +1 -1
  244. package/dist/client/assets/{variant-calendar-CAmxdOVL.js → variant-calendar-C7KUGztt.js} +1 -1
  245. package/dist/client/assets/{view-mode-toggle-fkLwhK4U.js → view-mode-toggle-BpooQDpR.js} +1 -1
  246. package/dist/client/index.html +1 -1
  247. package/dist/server/cli.js +364 -364
  248. package/dist/server/migrate-dbos.js +1 -1
  249. package/dist/server/migrate.js +1 -1
  250. package/dist/server/server.js +246 -246
  251. package/package.json +1 -1
  252. package/dist/client/assets/api-keys-DMaVxeam.js +0 -1
  253. package/dist/client/assets/index-CmmEYCmQ.js +0 -1
  254. package/dist/client/assets/record-editor-zneDMAxr.js +0 -1
  255. package/dist/client/assets/redirect-editor-C7D2vad7.js +0 -1
  256. package/dist/client/assets/registry-BWLPQoOd.js +0 -2
  257. package/dist/client/assets/settings-layout-BM_T9cjW.js +0 -1
  258. package/dist/client/assets/store-registry-CikLmiwt.js +0 -2
  259. package/dist/client/assets/thread-route-YcEgAyO3.js +0 -1
  260. package/dist/client/assets/useInfiniteQuery-DHse_DiU.js +0 -1
  261. package/dist/client/assets/useSuspenseInfiniteQuery-DnuTSRTu.js +0 -1
@@ -1 +1 @@
1
- import{b as ie,r as Q,G as Ge,K as de,m as Ke,j as s,l as q,h as Oe,B as ae,c as J,ae as Je,af as Me,ag as re,ah as Ve,ak as We,n as it,aq as jt,ar as Dt,e as rt,t as ve,o as ze,P as Ce,z as at,b1 as Xe,b0 as et,a$ as tt,C as Pt,a3 as be,a4 as je,a1 as De,a2 as Pe,ap as st,c2 as Mt,u as ct,ds as dt,fh as vt,E as Lt,d as yt}from"./index-BbDu2xq3.js";import{u as wt}from"./use-organization-roles-wkqRpeS-.js";import{u as Fe}from"./use-org-auth-client-CbGygSUB.js";import{g as mt,a as Gt}from"./role-color-Dn2tXDDF.js";import{B as Le}from"./badge-CLI8BJXF.js";import{A as ut,a as ft,c as gt,d as ht,b as Tt,f as xt,g as _t,e as pt}from"./alert-dialog-KXEmr_A6.js";import{c as kt,D as Ut,b as Bt,a as Vt}from"./dropdown-menu-C2_-PA0d.js";import{i as Yt}from"./DotsVertical-BrftgIDe.js";import{s as Ye}from"./Plus-DsoHS1s-.js";import{s as Kt}from"./Trash01-CdmAHj_X.js";import{C as zt}from"./collection-table-wrapper-BASvvH9a.js";import{E as lt}from"./empty-state-Cm5_JlLy.js";import{S as Qe}from"./search-input-Dg-G_3ZW.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as $e}from"./integration-icon-BY9o6bXu.js";import{u as Ft}from"./use-infinite-scroll-ClPXgDIl.js";import{C as ke}from"./checkbox-DT8c2BIN.js";import{i as Qt}from"./ArrowLeft-9dpHwu9-.js";import{u as $t}from"./useSuspenseInfiniteQuery-DnuTSRTu.js";import{u as Ht,S as qt}from"./use-mcp-client-BPlXnENu.js";import{C as Zt}from"./collection-search-B2UtpzT2.js";import{p as Jt}from"./connection-B7GAvn4a.js";import{a as Rt}from"./use-members-BeBhwrLZ.js";import{g as St}from"./get-initials-D-f_fDFw.js";import{u as Wt}from"./use-connection-C2nO_AVv.js";import{d as Xt}from"./use-virtual-mcp-DaOGpnoF.js";import{u as es,g as ts}from"./use-ai-providers-B7KRAXK1.js";import{A as At}from"./avatar-BPVI4atE.js";import{S as me}from"./switch-skcieNrk.js";import{s as ss,P as ls}from"./project-icon-CmWzfvVM.js";import{t as os}from"./ChevronUp-t8t4fwnR.js";import{i as ns}from"./ChevronRight-CHv3VYgp.js";import{A as is}from"./access-gate-CsjPwmbX.js";import"./Check-B_YxhG30.js";import"./table-B5Vs3GY1.js";import"./ArrowUp-OudgxKkt.js";import"./SearchMd-DBtIEQFG.js";import"./Tool02-DJ6ebzoK.js";import"./agent-icon-7Ul-3CFr.js";import"./AlertCircle-DM1wOTV-.js";import"./Tool01-BfzgVlWE.js";import"./ArrowRight-B-LgiGJk.js";import"./TrendUp01-CbspxXI2.js";import"./ZoomOut-vW_y2VPH.js";import"./Users03-BX6ICswR.js";import"./CheckCircle-dm6kQxSf.js";import"./ChevronSelectorVertical-DE7kv4Kd.js";import"./UserSquare-BSLxGup_.js";import"./Copy01-Cka2uFEv.js";import"./CreditCard01-BRxvnKr_.js";import"./Download01-ytOYmKSZ.js";import"./Settings02-nB2LBjem.js";import"./Eye-Cze9SkdO.js";import"./Share07-DxFaah4G.js";import"./GitBranch01-Dv92hLUV.js";import"./Globe01-CFZdQViA.js";import"./XClose-C3LO4RAn.js";import"./HardDrive-B6O4Lzvt.js";import"./Image01-DPhR8WEz.js";import"./Key01-CnMMlNjM.js";import"./Link01-BT9hUC6n.js";import"./LinkExternal01-Dd9_oVMY.js";import"./Monitor01-lCN_Uznr.js";import"./Sun-Cf4BP4WB.js";import"./Package-Pjoambo8.js";import"./Palette-CPWVOo_O.js";import"./Play-DUteIsFY.js";import"./SearchLg-DVGtsQMZ.js";import"./Shield01-YkTEmRCE.js";import"./Stars01-XqGB97Zv.js";import"./Upload01-Bhk_UoPj.js";import"./User01-BkT796JC.js";import"./Users01-Dyo9ZzPj.js";import"./XCircle-CJuCeBSM.js";import"./Zap-DNjSZhAl.js";import"./infiniteQueryObserver-BQw5N_tk.js";import"./auth-jEXOVJdJ.js";import"./github-repo-CTPv5ZM2.js";import"./capability-load-error-Ewp013Fw.js";const He="basic-usage",qe=[{id:He,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","ORGANIZATION_HAS_SITE","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","JIRA_RUN_START"]},{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}];[...qe.find(t=>t.id===He)?.tools??[]];const rs=["agents:manage","connections:manage"];new Set(qe.filter(t=>rs.includes(t.id)).flatMap(t=>t.tools));function as(){const t=new Map;for(const e of qe){if(e.id===He)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 cs(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ds(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)}const Ze="projects",ot="*";function ms(t){if(!t)return null;const e=t[Ze];return Array.isArray(e)?e:null}function us(t){const e=J.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:d,onSelect:f,onToggle:m}=t,c=r?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==c?(g=q("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),e[0]=c,e[1]=g):g=e[1];let u;e[2]!==l.icon||e[3]!==l.title?(u=s.jsx($e,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=u):u=e[4];let h;e[5]!==l.title?(h=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]=h):h=e[6];let x;e[7]!==f||e[8]!==u||e[9]!==h?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:f,children:[u,h]}),e[7]=f,e[8]=u,e[9]=h,e[10]=x):x=e[10];let a;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==m||e[15]!==d?(a=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",d]}),s.jsx(ke,{checked:n,onCheckedChange:m,onClick:fs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=m,e[15]=d,e[16]=a):a=e[16];let T;return e[17]!==g||e[18]!==x||e[19]!==a?(T=s.jsxs("div",{className:g,children:[x,a]}),e[17]=g,e[18]=x,e[19]=a,e[20]=T):T=e[20],T}function fs(t){return t.stopPropagation()}function gs(t){const e=J.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,d=`tool-${l}-${r.name}`,f=n?"text-foreground":"text-muted-foreground";let m;e[0]!==f?(m=q("text-sm font-medium",f),e[0]=f,e[1]=m):m=e[1];let c;e[2]!==m||e[3]!==r.name?(c=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:r.name})}),e[2]=m,e[3]=r.name,e[4]=c):c=e[4];let g;e[5]!==r.description?(g=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=g):g=e[6];let u;e[7]!==c||e[8]!==g?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,g]}),e[7]=c,e[8]=g,e[9]=u):u=e[9];const h=`tool-${l}-${r.name}`;let x;e[10]!==n||e[11]!==o||e[12]!==h?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ke,{id:h,checked:n,onCheckedChange:o,onClick:hs})}),e[10]=n,e[11]=o,e[12]=h,e[13]=x):x=e[13];let a;return e[14]!==d||e[15]!==u||e[16]!==x?(a=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[u,x]}),e[14]=d,e[15]=u,e[16]=x,e[17]=a):a=e[17],a}function hs(t){return t.stopPropagation()}function Ts({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,d]=Q.useState(""),f=r!==void 0?r:o,m=Q.useDeferredValue(f),[c,g]=Q.useState("all"),[u,h]=Q.useState(!1),x=Q.useRef(new Set(Object.keys(t))),{org:a}=Ge(),T=Ht({connectionId:qt,orgId:a.id,orgSlug:a.slug}),S=100,E=m.trim(),I=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,b=!!l,N={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...b&&{include_virtual:!0}},D=JSON.stringify(N),{data:A,fetchNextPage:j,hasNextPage:P,isFetchingNextPage:_}=$t({queryKey:de.collectionListInfinite(T,a.id,"","CONNECTIONS",D),queryFn:async({pageParam:p=0})=>(await T.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:p,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(p,w)=>{if(p?.hasMore)return w.reduce((H,Z)=>H+(Z?.items?.length??0),0)},staleTime:3e4}),O=A?.pages.flatMap(p=>p?.items??[])??[],C=Ft(j,P??!1,_),i=l?O.filter(p=>p.connection_type!=="VIRTUAL"?!0:Jt(p.connection_url)!==l):O,R=x.current,k=[...R.values()].map(p=>i.find(w=>w.id===p)).filter(p=>p!==void 0),G=i.filter(p=>!R.has(p.id)),Y=[...k,...G],v=p=>{const w=t[p];return w!==void 0&&w.length>0},K=Y.filter(p=>{if(c==="all")return!0;const w=v(p.id);return c==="selected"?w:c==="unselected"?!w:!0}),[L,z]=Q.useState(Y[0]?.id??null),V=L?Y.find(p=>p.id===L)??null:null,{data:U,isFetching:B}=Ke({queryKey:de.collectionItem(T,a.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await T.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=U?.tools??[],W=(p,w)=>t[p]?.includes(w)??!1,te=(p,w)=>{const H=t[p]??[],Z=H.includes(w),se={...t};if(Z){const le=H.filter(ne=>ne!==w);le.length===0?delete se[p]:se[p]=le}else se[p]=[...H,w];e(se)},oe=p=>{const w=p===L?$:[];if(!w.length)return;const H=t[p]??[],Z=w.map(ne=>ne.name),se=H.length>0&&Z.every(ne=>H.includes(ne)),le={...t};se?delete le[p]:(le[p]=Z,z(p)),e(le)},F=p=>{z(p),h(!0)},X=()=>{h(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:q("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[r===void 0&&s.jsx(Zt,{value:o,onChange:d,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>g("all"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>g("selected"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>g("unselected"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="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(f?"common.toolSetSelector.noConnectionsFound":c==="selected"?"common.toolSetSelector.noServersSelected":c==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(p=>{const w=L===p.id,H=w?$.length:0,Z=t[p.id]?.length??0;return s.jsx(us,{connection:{...p,tools:w?$:p.tools},isSelected:w,hasToolsEnabled:v(p.id),activeToolsCount:Z,totalToolsCount:H,onSelect:()=>F(p.id),onToggle:()=>oe(p.id)},p.id)}),s.jsx("div",{ref:C,className:"h-4"}),_&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:q("flex-1 flex-col",u?"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:X,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Qt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx($e,{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(p=>s.jsx(gs,{connectionId:V.id,tool:p,isSelected:W(V.id,p.name),onToggle:()=>te(V.id,p.name)},p.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 xs=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Ve(),staticPermissions:Me(re()),toolSet:We(re(),Me(re())),allowAllModels:Ve(),modelSet:We(re(),Me(re())),allowAllProjects:Ve(),projectSet:Me(re()),memberIds:Me(re())});function nt(t,e,l,r){const n=s.jsx(me,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(Pe,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function _s(t){const e=J.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie();let g;e[0]!==f?(g=f.trim().toLowerCase(),e[0]=f,e[1]=g):g=e[1];const u=Q.useDeferredValue(g);let h;if(e[2]!==l||e[3]!==u||e[4]!==n||e[5]!==o||e[6]!==m||e[7]!==f||e[8]!==r||e[9]!==c){const x=as(),a=(_,O)=>{if(!m){if(l&&O){const C=x.flatMap(Is).flatMap(Es);n(!1),o(C.filter(i=>!_.tools.includes(i)));return}l||o(ds(_,r,!O))}};let T;e[11]!==u?(T=_=>{const{section:O,capabilities:C}=_;return{section:O,capabilities:C.filter(i=>!u||i.label.toLowerCase().includes(u)||i.description.toLowerCase().includes(u))}},e[11]=u,e[12]=T):T=e[12];const S=x.map(T).filter(ps);let E;e[13]!==c?(E=c("settings.orgRoleDetail.general"),e[13]=c,e[14]=E):E=e[14];let I;e[15]!==c?(I=c("settings.orgRoleDetail.allOrgPermissions"),e[15]=c,e[16]=I):I=e[16];let b;e[17]!==c?(b=c("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=c,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==n||e[21]!==o?(N=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=N):N=e[22];let D;e[23]!==l||e[24]!==m||e[25]!==c||e[26]!==N?(D=nt(c,l,m,N),e[23]=l,e[24]=m,e[25]=c,e[26]=N,e[27]=D):D=e[27];let A;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m?(A=m?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=A):A=e[32];let j;e[33]!==A||e[34]!==I||e[35]!==b||e[36]!==D?(j=s.jsx(et,{children:s.jsx(tt,{title:I,description:b,action:D,onClick:A})}),e[33]=A,e[34]=I,e[35]=b,e[36]=D,e[37]=j):j=e[37];let P;e[38]!==j||e[39]!==E?(P=s.jsx(Xe,{title:E,children:j}),e[38]=j,e[39]=E,e[40]=P):P=e[40],h=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[P,S.length===0&&u?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:c("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:f})}):S.map(_=>{const{section:O,capabilities:C}=_;return s.jsx(Xe,{title:O,children:s.jsx(et,{children:C.map(i=>{const R=cs(i,r,l);return s.jsx(tt,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(Pt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:nt(c,R,m,()=>a(i,R)),onClick:m?void 0:()=>a(i,R)},i.id)})})},O)})]})}),e[2]=l,e[3]=u,e[4]=n,e[5]=o,e[6]=m,e[7]=f,e[8]=r,e[9]=c,e[10]=h}else h=e[10];return h}function ps(t){return t.capabilities.length>0}function Es(t){return t.tools}function Is(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},Rs={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 Ss(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function As(t){return Rs[t]??Nt[t]??t}function Ns(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function Cs(t){const e=J.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:d,allConnectionModelIds:f,selectedModels:m,allowAllModels:c,allConnectionModelsSelected:g,onToggleModel:u,onExitAllowAll:h,readOnly:x,defaultExpanded:a}=t,T=ie(),[S,E]=Q.useState(a),I=a||S,b=E,[N,D]=Q.useState(Ct);let A;e[0]!==g||e[1]!==c||e[2]!==m?(A=_=>c||g||m.includes("*")||m.includes(_),e[0]=g,e[1]=c,e[2]=m,e[3]=A):A=e[3];const j=A;let P;if(e[4]!==f||e[5]!==c||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==j||e[10]!==d||e[11]!==h||e[12]!==u||e[13]!==x||e[14]!==r||e[15]!==n||e[16]!==T||e[17]!==N){let _;e[19]!==j?(_=B=>j(B.id),e[19]=j,e[20]=_):_=e[20];const O=d.filter(_).length,C=d.slice(0,N),i=d.length>N;let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=()=>b(Ds),e[21]=R):R=e[21];const k=o??Et[r]??It;let G;e[22]!==n||e[23]!==k?(G=s.jsx($e,{icon:k,name:n,size:"sm"}),e[22]=n,e[23]=k,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=T("settings.orgRoleDetail.enabledCount",{enabledCount:O,total:d.length});let L;e[30]!==K?(L=s.jsx(Le,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let z;e[32]!==I?(z=I?s.jsx(os,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(ns,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,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 U;e[37]!==V||e[38]!==v?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:R,children:[v,V]}),e[37]=V,e[38]=v,e[39]=U):U=e[39],P=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[C.map(B=>{const $=j(B.id),W=()=>{if(!x){if(c){h(l,f,B.id);return}u(l,B.id)}};return s.jsxs("div",{className:q("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:W,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:js,children:x?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:$,disabled:!0,onCheckedChange:bs})})}),s.jsx(Pe,{children:s.jsx("p",{children:T("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:$,onCheckedChange:W})})]},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:()=>D(Os),children:T("settings.orgRoleDetail.showMore",{remaining:d.length-N})})]})]}),e[4]=f,e[5]=c,e[6]=l,e[7]=I,e[8]=o,e[9]=j,e[10]=d,e[11]=h,e[12]=u,e[13]=x,e[14]=r,e[15]=n,e[16]=T,e[17]=N,e[18]=P}else P=e[18];return P}function Os(t){return t+Ct}function bs(){}function js(t){return t.stopPropagation()}function Ds(t){return!t}function Ps(t){const e=J.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:d,allConnectionModelsSelected:f,searchQuery:m,readOnly:c}=t,g=ts(l.id);let u,h,x,a,T;if(e[0]!==f||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==o||e[7]!==g||e[8]!==c||e[9]!==m||e[10]!==r){T=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=R=>({...R,id:R.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const b=g.filter(ys).map(I),N=m.trim().toLowerCase(),D=N?b.filter(R=>R.title.toLowerCase().includes(N)||R.id.toLowerCase().includes(N)||R.provider?.toLowerCase().includes(N)):b;if(D.length===0){T=null;break e}const A=new Map;for(const R of D){const k=Ss(R.id,l.providerId),G=A.get(k)??{models:[],logo:null};G.models.push({id:R.id,title:Ns(R.title),logo:R.logo}),!G.logo&&R.logo&&(G.logo=R.logo),A.set(k,G)}const j=Array.from(A.entries()).map(Ls).sort(vs),P=j.length===1||N.length>0;x="flex flex-col gap-3";const _=Et[l.providerId]??It;let O;e[18]!==l.providerId||e[19]!==_?(O=s.jsx("img",{src:_,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]=_,e[20]=O):O=e[20];const C=Nt[l.providerId]??l.providerId;let i;e[21]!==C?(i=s.jsx("h4",{className:"text-sm font-medium",children:C}),e[21]=C,e[22]=i):i=e[22],e[23]!==i||e[24]!==O?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[O,i]}),e[23]=i,e[24]=O,e[25]=a):a=e[25],u="flex flex-col gap-3",h=j.map(R=>s.jsx(Cs,{connectionId:l.id,subProviderId:R.id,subProviderName:R.name,groupLogo:R.logo,models:R.models,allConnectionModelIds:b.map(Ms),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:f,onToggleModel:o,onExitAllowAll:d,readOnly:c,defaultExpanded:P},R.id))}e[0]=f,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=o,e[7]=g,e[8]=c,e[9]=m,e[10]=r,e[11]=u,e[12]=h,e[13]=x,e[14]=a,e[15]=T}else u=e[11],h=e[12],x=e[13],a=e[14],T=e[15];if(T!==Symbol.for("react.early_return_sentinel"))return T;let S;e[26]!==u||e[27]!==h?(S=s.jsx("div",{className:u,children:h}),e[26]=u,e[27]=h,e[28]=S):S=e[28];let E;return e[29]!==x||e[30]!==a||e[31]!==S?(E=s.jsxs("div",{className:x,children:[a,S]}),e[29]=x,e[30]=a,e[31]=S,e[32]=E):E=e[32],E}function Ms(t){return t.id}function vs(t,e){return t.name.localeCompare(e.name)}function Ls(t){const[e,l]=t;return{id:e,name:As(e),logo:l.logo,models:l.models}}function ys(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function ws(t){const e=J.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie(),g=Q.useDeferredValue(f),u=es();let h;e[0]!==r||e[1]!==o?(h=(_,O)=>{const C=r[_]??[],i={...r};if(C.includes(O)){const R=C.filter(k=>k!==O);R.length===0?delete i[_]:i[_]=R}else i[_]=[...C,O];o(i)},e[0]=r,e[1]=o,e[2]=h):h=e[2];const x=h;let a;e[3]!==r||e[4]!==n||e[5]!==o?(a=(_,O,C)=>{n(!1),o({...r,[_]:O.filter(i=>i!==C)})},e[3]=r,e[4]=n,e[5]=o,e[6]=a):a=e[6];const T=a,S=!m&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==S?(E=q("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=E):E=e[8];let I;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==m?(I=()=>{if(m)return;const _=!l;n(_),_&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=m,e[13]=I):I=e[13];let b;e[14]!==c?(b=c("settings.orgRoleDetail.allModels"),e[14]=c,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let D;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==m||e[22]!==c?(D=s.jsx("div",{onClick:ks,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:l,disabled:!0,onCheckedChange:Gs})})}),s.jsx(Pe,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:l,onCheckedChange:_=>{n(_),_&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=m,e[22]=c,e[23]=D):D=e[23];let A;e[24]!==E||e[25]!==I||e[26]!==N||e[27]!==D?(A=s.jsxs("div",{className:E,onClick:I,children:[N,D]}),e[24]=E,e[25]=I,e[26]=N,e[27]=D,e[28]=A):A=e[28];let j;e[29]!==u||e[30]!==l||e[31]!==g||e[32]!==T||e[33]!==r||e[34]!==m||e[35]!==c||e[36]!==x?(j=u.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noLlmConnectionsConfigured")}):u.map(_=>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"}),c("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ps,{connection:_,selectedModels:r[_.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:T,allConnectionModelsSelected:(r[_.id]??[]).includes("*"),searchQuery:g,readOnly:m})},_.id)),e[29]=u,e[30]=l,e[31]=g,e[32]=T,e[33]=r,e[34]=m,e[35]=c,e[36]=x,e[37]=j):j=e[37];let P;return e[38]!==A||e[39]!==j?(P=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[A,j]}),e[38]=A,e[39]=j,e[40]=P):P=e[40],P}function Gs(){}function ks(t){return t.stopPropagation()}function Us(t){const e=J.c(39),{allowAllProjects:l,projectSet:r,onAllowAllChange:n,onProjectSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie(),g=Q.useDeferredValue(f),u=Xt();let h;if(e[0]!==l||e[1]!==g||e[2]!==n||e[3]!==o||e[4]!==r||e[5]!==m||e[6]!==f||e[7]!==c||e[8]!==u){const x=ss(u),a=g.trim().toLowerCase(),T=a?x.filter(C=>C.title.toLowerCase().includes(a)):x,S=C=>{if(l){n(!1),o(x.map(Ys).filter(i=>i!==C));return}r.includes(C)?o(r.filter(i=>i!==C)):o([...r,C])},E=!m&&"hover:bg-muted/50 cursor-pointer";let I;e[10]!==E?(I=q("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",E),e[10]=E,e[11]=I):I=e[11];let b;e[12]!==l||e[13]!==n||e[14]!==o||e[15]!==m?(b=()=>{if(m)return;const C=!l;n(C),C&&o([])},e[12]=l,e[13]=n,e[14]=o,e[15]=m,e[16]=b):b=e[16];let N;e[17]!==c?(N=c("settings.orgRoleDetail.allProjects"),e[17]=c,e[18]=N):N=e[18];let D;e[19]!==N?(D=s.jsx("span",{className:"text-sm font-medium",children:N}),e[19]=N,e[20]=D):D=e[20];let A;e[21]!==c?(A=c("settings.orgRoleDetail.allProjectsDescription"),e[21]=c,e[22]=A):A=e[22];let j;e[23]!==A?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:A}),e[23]=A,e[24]=j):j=e[24];let P;e[25]!==D||e[26]!==j?(P=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,j]}),e[25]=D,e[26]=j,e[27]=P):P=e[27];let _;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m||e[32]!==c?(_=s.jsx("div",{onClick:Vs,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:l,disabled:!0,onCheckedChange:Bs})})}),s.jsx(Pe,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:l,onCheckedChange:C=>{n(C),C&&o([])}})}),e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=c,e[33]=_):_=e[33];let O;e[34]!==P||e[35]!==_||e[36]!==I||e[37]!==b?(O=s.jsxs("div",{className:I,onClick:b,children:[P,_]}),e[34]=P,e[35]=_,e[36]=I,e[37]=b,e[38]=O):O=e[38],h=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 p-4",children:[O,x.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsAvailable")}):T.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsMatch",{searchQuery:f})}):s.jsx("div",{className:"flex flex-col gap-1",children:T.map(C=>{const i=l||r.includes(C.id);return s.jsxs("label",{className:q("flex items-center gap-3 px-3 py-2 rounded-lg border border-transparent",m?"cursor-default":"hover:bg-muted/50 cursor-pointer"),children:[s.jsx(ke,{checked:i,disabled:m,onCheckedChange:()=>{m||S(C.id)}}),s.jsx(ls,{icon:C.icon,name:C.title}),s.jsx("span",{className:"text-sm truncate",children:C.title})]},C.id)})})]}),e[0]=l,e[1]=g,e[2]=n,e[3]=o,e[4]=r,e[5]=m,e[6]=f,e[7]=c,e[8]=u,e[9]=h}else h=e[9];return h}function Bs(){}function Vs(t){return t.stopPropagation()}function Ys(t){return t.id}function Ks(t){const e=J.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,d=ie(),[f,m]=Q.useState(""),c=Q.useDeferredValue(f);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[u,h]=Q.useState(g),{data:x}=Rt();let a,T,S,E,I,b,N,D,A,j,P;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==f||e[8]!==n||e[9]!==d){const L=x?.data?.members??[];let z;e[21]!==c?(z=F=>{const X=c.toLowerCase();return F.user?.name?.toLowerCase().includes(X)||F.user?.email?.toLowerCase().includes(X)},e[21]=c,e[22]=z):z=e[22];const V=L.filter(z);let U;e[23]!==o||e[24]!==r||e[25]!==u?(U=()=>{o(u),h([]),r(!1)},e[23]=o,e[24]=r,e[25]=u,e[26]=U):U=e[26],S=U,T=ut,j=l,P=r,a=ft,D="sm:max-w-md p-0";let B;e[27]!==d?(B=d("settings.orgRoleDetail.addMembersToRole"),e[27]=d,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(gt,{children:B}),e[29]=B,e[30]=$):$=e[30];let W;e[31]!==d?(W=d("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=d,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(ht,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(A=s.jsxs(Tt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=A):A=e[37],b="flex flex-col h-80";let oe;e[38]!==d?(oe=d("settings.orgRoleDetail.searchMembers"),e[38]=d,e[39]=oe):oe=e[39],e[40]!==f||e[41]!==oe?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:f,onChange:m,placeholder:oe,className:"w-full"})}),e[40]=f,e[41]=oe,e[42]=N):N=e[42],E="flex-1 overflow-auto",I=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:d(f?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const X=F.role!=="owner",p=n.includes(F.id),w=u.includes(F.id);return s.jsxs("label",{className:q("flex items-center gap-3 p-2 rounded-lg",!X||p?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ke,{checked:w||p,onCheckedChange:()=>{!X||p||h(H=>H.includes(F.id)?H.filter(Z=>Z!==F.id):[...H,F.id])},disabled:!X||p}),s.jsx(At,{url:F.user?.image??void 0,fallback:St(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||d("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!X&&s.jsx(Le,{variant:"secondary",className:"shrink-0",children:d("settings.orgRoleDetail.owner")}),p&&X&&s.jsx(Le,{variant:"outline",className:"shrink-0",children:d("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=o,e[4]=r,e[5]=l,e[6]=u,e[7]=f,e[8]=n,e[9]=d,e[10]=a,e[11]=T,e[12]=S,e[13]=E,e[14]=I,e[15]=b,e[16]=N,e[17]=D,e[18]=A,e[19]=j,e[20]=P}else a=e[10],T=e[11],S=e[12],E=e[13],I=e[14],b=e[15],N=e[16],D=e[17],A=e[18],j=e[19],P=e[20];let _;e[43]!==E||e[44]!==I?(_=s.jsx("div",{className:E,children:I}),e[43]=E,e[44]=I,e[45]=_):_=e[45];let O;e[46]!==_||e[47]!==b||e[48]!==N?(O=s.jsxs("div",{className:b,children:[N,_]}),e[46]=_,e[47]=b,e[48]=N,e[49]=O):O=e[49];let C;e[50]!==d?(C=d("settings.orgRoleDetail.cancel"),e[50]=d,e[51]=C):C=e[51];let i;e[52]!==C?(i=s.jsx(xt,{children:C}),e[52]=C,e[53]=i):i=e[53];const R=u.length===0;let k;e[54]!==u.length||e[55]!==d?(k=d("settings.orgRoleDetail.addWithCount",{count:u.length}),e[54]=u.length,e[55]=d,e[56]=k):k=e[56];let G;e[57]!==S||e[58]!==R||e[59]!==k?(G=s.jsx(_t,{onClick:S,disabled:R,children:k}),e[57]=S,e[58]=R,e[59]=k,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(pt,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==a||e[65]!==O||e[66]!==Y||e[67]!==D||e[68]!==A?(v=s.jsxs(a,{className:D,children:[A,O,Y]}),e[64]=a,e[65]=O,e[66]=Y,e[67]=D,e[68]=A,e[69]=v):v=e[69];let K;return e[70]!==T||e[71]!==v||e[72]!==j||e[73]!==P?(K=s.jsx(T,{open:j,onOpenChange:P,children:v}),e[70]=T,e[71]=v,e[72]=j,e[73]=P,e[74]=K):K=e[74],K}function zs(t){const e=J.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:d,addMemberDialogOpen:f,onAddMemberDialogOpenChange:m}=t,c=n===void 0?!1:n,g=o===void 0?void 0:o,u=ie(),h=Q.useDeferredValue(d),{data:x}=Rt();let a,T,S;if(e[0]!==x?.data?.members||e[1]!==h||e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==g||e[6]!==d||e[7]!==u){const D=x?.data?.members??[];let A;e[11]!==l?(A=i=>l.includes(i.id),e[11]=l,e[12]=A):A=e[12];const j=D.filter(A);let P;e[13]!==h?(P=i=>{const R=h.toLowerCase();return i.user?.name?.toLowerCase().includes(R)||i.user?.email?.toLowerCase().includes(R)},e[13]=h,e[14]=P):P=e[14];const _=j.filter(P);let O;e[15]!==g||e[16]!==u?(O=g??u("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=u,e[17]=O):O=e[17];const C=O;S="flex flex-col h-full",a="flex-1 overflow-auto",T=j.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:u("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):_.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.noMembersMatch",{searchQuery:d})})}):s.jsx("div",{className:"p-4 space-y-2",children:_.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(At,{url:i.user?.image??void 0,fallback:St(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||u("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),c?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),children:s.jsx(st,{size:16})})})}),s.jsx(Pe,{children:s.jsx("p",{children:C})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(R=>R!==i.id)),children:s.jsx(st,{size:16})})]},i.id))}),e[0]=x?.data?.members,e[1]=h,e[2]=l,e[3]=r,e[4]=c,e[5]=g,e[6]=d,e[7]=u,e[8]=a,e[9]=T,e[10]=S}else a=e[8],T=e[9],S=e[10];let E;e[18]!==a||e[19]!==T?(E=s.jsx("div",{className:a,children:T}),e[18]=a,e[19]=T,e[20]=E):E=e[20];let I;e[21]!==l||e[22]!==r?(I=D=>r([...l,...D]),e[21]=l,e[22]=r,e[23]=I):I=e[23];let b;e[24]!==f||e[25]!==l||e[26]!==m||e[27]!==I?(b=s.jsx(Ks,{open:f,onOpenChange:m,selectedMemberIds:l,onAddMembers:I}),e[24]=f,e[25]=l,e[26]=m,e[27]=I,e[28]=b):b=e[28];let N;return e[29]!==S||e[30]!==E||e[31]!==b?(N=s.jsxs("div",{className:S,children:[E,b]}),e[29]=S,e[30]=E,e[31]=b,e[32]=N):N=e[32],N}function Fs(t){const e=J.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(zs,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const Qs={owner:[],admin:[],user:[]};function $s(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:Qs[t],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Hs(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),d=o?[]:n.filter(a=>a!=="*"),f={};for(const[a,T]of Object.entries(r))if(!(a==="self"||a==="models"||a===Ze))if(a==="*")for(const S of l)f[S.id]=T.includes("*")?S.tools?.map(E=>E.name)??[]:T;else{const S=l.find(E=>E.id===a);S&&(f[a]=T.includes("*")?S.tools?.map(E=>E.name)??[]:T)}const m=r.models||[],c=m.length===0||m.includes("*:*"),g={};if(!c)for(const a of m){const T=a.indexOf(":");if(T===-1)continue;const S=a.slice(0,T),E=a.slice(T+1);g[S]||(g[S]=[]),g[S].push(E)}const u=ms(r),h=u===null||u.includes(ot),x=h?[]:u.filter(a=>a!==ot);return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:d,toolSet:f,allowAllModels:c,modelSet:g,allowAllProjects:h,projectSet:x,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function qs(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 d=e.find(f=>f.id===r)?.tools?.map(f=>f.name)??[];l[r]=d.length>0&&d.every(f=>n.includes(f))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const d of o)r.push(`${n}:${d}`);r.length>0&&(l.models=r)}return t.allowAllProjects||(l[Ze]=t.projectSet),l}function Zs(t,e,l){return t.kind==="builtin"?$s(t.role,e,void 0):t.kind==="custom"?Hs(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:[]}}function Js(t){const e=J.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,d=ie();let f;e[0]!==o||e[1]!==d?(f=o??d("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=d,e[2]=f):f=e[2];const m=f;if(l){let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ye,{size:16}),e[3]=h):h=e[3];let x;e[4]!==d?(x=d("settings.orgRoleDetail.addMember"),e[4]=d,e[5]=x):x=e[5];let a;e[6]!==x?(a=s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[h,x]})})}),e[6]=x,e[7]=a):a=e[7];let T;e[8]!==m?(T=s.jsx(Pe,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=T):T=e[9];let S;return e[10]!==a||e[11]!==T?(S=s.jsx(be,{children:s.jsxs(je,{children:[a,T]})}),e[10]=a,e[11]=T,e[12]=S):S=e[12],S}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ye,{size:16}),e[13]=c):c=e[13];let g;e[14]!==d?(g=d("settings.orgRoleDetail.addMember"),e[14]=d,e[15]=g):g=e[15];let u;return e[16]!==n||e[17]!==g?(u=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[c,g]}),e[16]=n,e[17]=g,e[18]=u):u=e[18],u}function Ws(t){const e=J.c(14),{locator:l}=Ge(),r=Fe(),n=Wt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==r?(d=()=>r.organization.listMembers(),e[2]=r,e[3]=d):d=e[3];let f;e[4]!==o||e[5]!==d?(f={queryKey:o,queryFn:d},e[4]=o,e[5]=d,e[6]=f):f=e[6];const{data:m,isPending:c}=Ke(f);if(c||!n){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=x):x=e[7],x}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const u=g;let h;return e[10]!==n||e[11]!==u||e[12]!==t?(h=s.jsx(Xs,{...t,members:u,connections:n}),e[10]=n,e[11]=u,e[12]=t,e[13]=h):h=e[13],h}function Xs({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:d}=Ge(),f=Fe(),m=it(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",u=t.kind==="new",[h,x]=Q.useState(c?"org":"mcp"),a=jt({resolver:Dt(xs),defaultValues:Zs(t,r,n)}),T=a.formState.isValid,S=a.formState.isDirty,E=rt({mutationFn:async i=>{const R=qs(i,n),k=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(U=>U.role===(K??v)).map(U=>U.id),z=i.memberIds.filter(U=>!L.includes(U)),V=L.filter(U=>!i.memberIds.includes(U));for(const U of z){const B=await f.organization.updateMemberRole({memberId:U,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await f.organization.updateMemberRole({memberId:U,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 f.organization.updateRole({roleId:i.role.id,data:{permission:R,...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 f.organization.createRole({role:k,permission:R});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await f.organization.updateMemberRole({memberId:K,role:[k]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:k}}}},onSuccess:(i,R)=>{m.invalidateQueries({queryKey:de.members(d)}),m.invalidateQueries({queryKey:de.organizationRoles(d)});const k=!R.role.id&&!R.role.slug,G=R.role.slug==="owner"&&!R.role.id;ze(G?"role_members_updated":k?"role_created":"role_updated",{role_slug:R.role.slug??null}),ve.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),a.reset(i),l(i.role.id)},onError:i=>{ve.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=a.handleSubmit(i=>{if(!i.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),a.setFocus("role.label");return}E.mutate(i)}),b=!g,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",D=[...g?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"projects",label:o("settings.orgRoleDetail.projects")},{id:"members",label:o("settings.orgRoleDetail.members")}],[A,j]=Q.useState(""),[P,_]=Q.useState(!1),O=i=>{x(i),j("")},C={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),projects:o("settings.orgRoleDetail.searchProjects"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ce,{children:s.jsxs(Ce.Content,{className:q("flex flex-col",h!=="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(Ce.Title,{actions:b&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:I,disabled:E.isPending||!T||!S,children:E.isPending?o("settings.orgRoleDetail.saving"):o(u?"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:q("size-2.5 rounded-full shrink-0",t.kind==="builtin"?mt(t.role,!0):Gt(a.watch("role.label")))}),g&&s.jsx(at,{size:16,className:"text-muted-foreground shrink-0"}),u||t.kind==="custom"?s.jsx("input",{...a.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:u}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:D.map(i=>s.jsx("button",{type:"button",onClick:()=>O(i.id),className:q("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",h===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(Qe,{value:A,onChange:j,placeholder:C[h]??"Search...",className:"w-full md:w-[375px]"}),h==="members"&&s.jsx(Js,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>_(!0)})]})]})}),s.jsx("div",{className:q("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",h!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:q(h!=="org"&&"h-full overflow-hidden",h!=="models"&&h!=="projects"&&h!=="org"&&"border border-border rounded-xl bg-card"),children:[h==="mcp"&&!g&&s.jsx(Ts,{toolSet:a.watch("toolSet"),onToolSetChange:i=>a.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:A}),h==="org"&&s.jsx(_s,{allowAllStaticPermissions:a.watch("allowAllStaticPermissions"),staticPermissions:a.watch("staticPermissions"),onAllowAllChange:i=>a.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>a.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="models"&&s.jsx(ws,{allowAllModels:a.watch("allowAllModels"),modelSet:a.watch("modelSet"),onAllowAllChange:i=>a.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>a.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="projects"&&s.jsx(Us,{allowAllProjects:a.watch("allowAllProjects"),projectSet:a.watch("projectSet"),onAllowAllChange:i=>a.setValue("allowAllProjects",i,{shouldDirty:!0}),onProjectSetChange:i=>a.setValue("projectSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="members"&&s.jsx(Fs,{memberIds:a.watch("memberIds"),onMemberIdsChange:i=>a.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:A,addMemberDialogOpen:P,onAddMemberDialogOpenChange:_})]})})]})})}function el(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function tl(t){const e=J.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:d}=Mt();let f;return e[0]!==l||e[1]!==r||e[2]!==d||e[3]!==n||e[4]!==o?(f=s.jsx(is,{granted:n,loading:o,error:d,area:l,children:r}),e[0]=l,e[1]=r,e[2]=d,e[3]=n,e[4]=o,e[5]=f):f=e[5],f}const sl=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function ll(){const t=J.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),d=yt();let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={strict:!1},t[0]=f):f=t[0];const{role:m}=ct(f),{locator:c}=Ge(),g=Fe(),u=it(),{customRoles:h,refetch:x}=wt();let a;t[1]!==d?(a=M=>d({to:".",search:y=>({...y,role:M})}),t[1]=d,t[2]=a):a=t[2];const T=a;let S;e:{if(!m){S=null;break e}if(m==="new"){S={kind:"new"};break e}if(m.startsWith("builtin-")){S={kind:"builtin",role:m.slice(8)};break e}let M;t[3]!==m?(M=ee=>ee.id===m,t[3]=m,t[4]=M):M=t[4];const y=h.find(M);S=y?{kind:"custom",role:y}:null}const E=S;let I;t[5]!==c?(I=de.members(c),t[5]=c,t[6]=I):I=t[6];let b;t[7]!==g?(b=()=>g.organization.listMembers(),t[7]=g,t[8]=b):b=t[8];let N;t[9]!==I||t[10]!==b?(N={queryKey:I,queryFn:b},t[9]=I,t[10]=b,t[11]=N):N=t[11];const{data:D}=Ke(N);let A;t[12]!==D?.data?.members?(A=D?.data?.members??[],t[12]=D?.data?.members,t[13]=A):A=t[13];const j=A;let P;t[14]!==j?(P=M=>j.filter(y=>y.role===M).length,t[14]=j,t[15]=P):P=t[15];const _=P;let O;if(t[16]!==h||t[17]!==_||t[18]!==l||t[19]!==e){let M;t[21]!==_||t[22]!==e?(M=ce=>({kind:"builtin",role:{...ce,memberCount:_(ce.role),label:e(ce.labelKey)}}),t[21]=_,t[22]=e,t[23]=M):M=t[23];const y=sl.map(M);let ee;t[24]!==_?(ee=ce=>({kind:"custom",role:{...ce,memberCount:_(ce.role)}}),t[24]=_,t[25]=ee):ee=t[25];const Ot=h.map(ee);if(O=[...y,...Ot],l){const ce=l.toLowerCase();O=O.filter(bt=>bt.role.label.toLowerCase().includes(ce))}t[16]=h,t[17]=_,t[18]=l,t[19]=e,t[20]=O}else O=t[20];let C;t[26]!==g?(C=async M=>{const y=await g.organization.deleteRole({roleId:M});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=g,t[27]=C):C=t[27];const i=rt({mutationFn:C,onSuccess:(M,y)=>{ze("role_deleted",{role_id:y}),u.invalidateQueries({queryKey:de.members(c)}),u.invalidateQueries({queryKey:de.organizationRoles(c)}),ve.success(e("settings.roles.deletedSuccessfully")),x(),E?.kind==="custom"&&E.role.id===y&&T(void 0)},onError:al});let R;t[28]!==e?(R=e("settings.roles.columnRole"),t[28]=e,t[29]=R):R=t[29];let k;t[30]!==R?(k={id:"role",header:R,render:rl,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=R,t[31]=k):k=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=M=>M.kind==="builtin"?s.jsx(Le,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Le,{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=M=>{if(M.kind==="builtin")return M.role.role==="owner"||M.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=M.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 U;t[48]!==V?(U={id:"members",header:V,render:il,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:M=>M.kind==="builtin"?null:s.jsxs(kt,{children:[s.jsx(Ut,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:nl,children:s.jsx(Yt,{size:16})})}),s.jsx(Bt,{align:"end",onClick:ol,children:s.jsxs(Vt,{variant:"destructive",onClick:()=>{const y=M.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Kt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==k||t[53]!==v||t[54]!==z||t[55]!==U||t[56]!==B?($=[k,v,z,U,B],t[52]=k,t[53]=v,t[54]=z,t[55]=U,t[56]=B,t[57]=$):$=t[57];const W=$;let te;t[58]!==T?(te=M=>{if(M.kind==="builtin")T(`builtin-${M.role.role}`);else{const y=M.role;T(y.id)}},t[58]=T,t[59]=te):te=t[59];const oe=te;if(E){let M;t[60]!==T?(M=()=>T(void 0),t[60]=T,t[61]=M):M=t[61];let y;return t[62]!==x||t[63]!==T?(y=()=>{x(),T(void 0)},t[62]=x,t[63]=T,t[64]=y):y=t[64],s.jsx(Ws,{target:E,onBack:M,onSaved:y},el(E))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let X;t[67]===Symbol.for("react.memo_cache_sentinel")?(X=M=>{M.key==="Escape"&&(r(""),M.target.blur())},t[67]=X):X=t[67];let p;t[68]!==l||t[69]!==F?(p=s.jsx(Qe,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:X}),t[68]=l,t[69]=F,t[70]=p):p=t[70];let w;t[71]!==T?(w=()=>T("new"),t[71]=T,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ye,{size:16}),t[73]=H):H=t[73];let Z;t[74]!==e?(Z=e("settings.roles.createRole"),t[74]=e,t[75]=Z):Z=t[75];let se;t[76]!==w||t[77]!==Z?(se=s.jsxs(ae,{onClick:w,children:[H,Z]}),t[76]=w,t[77]=Z,t[78]=se):se=t[78];let le;t[79]!==p||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p,se]}),t[79]=p,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(lt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(lt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let ue;t[85]!==O||t[86]!==W||t[87]!==oe||t[88]!==ne?(ue=s.jsx(zt,{columns:W,data:O,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=O,t[86]=W,t[87]=oe,t[88]=ne,t[89]=ue):ue=t[89];const Ue=n!==null;let ye;t[90]===Symbol.for("react.memo_cache_sentinel")?(ye=M=>!M&&o(null),t[90]=ye):ye=t[90];let fe;t[91]!==e?(fe=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=fe):fe=t[92];let ge;t[93]!==fe?(ge=s.jsx(gt,{children:fe}),t[93]=fe,t[94]=ge):ge=t[94];const Be=n?.label??"";let he;t[95]!==e||t[96]!==Be?(he=e("settings.roles.deleteRoleConfirm",{role:Be}),t[95]=e,t[96]=Be,t[97]=he):he=t[97];let Te;t[98]!==he?(Te=s.jsx(ht,{children:he}),t[98]=he,t[99]=Te):Te=t[99];let xe;t[100]!==ge||t[101]!==Te?(xe=s.jsxs(Tt,{children:[ge,Te]}),t[100]=ge,t[101]=Te,t[102]=xe):xe=t[102];let _e;t[103]!==e?(_e=e("settings.roles.cancel"),t[103]=e,t[104]=_e):_e=t[104];let pe;t[105]!==_e?(pe=s.jsx(xt,{children:_e}),t[105]=_e,t[106]=pe):pe=t[106];let Ee;t[107]!==i||t[108]!==n?(Ee=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ee):Ee=t[109];let Ie;t[110]!==e?(Ie=e("settings.roles.delete"),t[110]=e,t[111]=Ie):Ie=t[111];let Re;t[112]!==Ee||t[113]!==Ie?(Re=s.jsx(_t,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ie}),t[112]=Ee,t[113]=Ie,t[114]=Re):Re=t[114];let Se;t[115]!==pe||t[116]!==Re?(Se=s.jsxs(pt,{children:[pe,Re]}),t[115]=pe,t[116]=Re,t[117]=Se):Se=t[117];let Ae;t[118]!==xe||t[119]!==Se?(Ae=s.jsxs(ft,{children:[xe,Se]}),t[118]=xe,t[119]=Se,t[120]=Ae):Ae=t[120];let Ne;t[121]!==Ue||t[122]!==Ae?(Ne=s.jsx(ut,{open:Ue,onOpenChange:ye,children:Ae}),t[121]=Ue,t[122]=Ae,t[123]=Ne):Ne=t[123];let we;return t[124]!==le||t[125]!==ue||t[126]!==Ne?(we=s.jsxs(dt,{group:"members",className:"gap-6",children:[le,ue,Ne]}),t[124]=le,t[125]=ue,t[126]=Ne,t[127]=we):we=t[127],we}function ol(t){return t.stopPropagation()}function nl(t){return t.stopPropagation()}function il(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function rl(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:q("size-2.5 rounded-full shrink-0",mt(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(at,{size:12,className:"text-muted-foreground shrink-0"})]})}function al(t,e){ze("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ve.error(t instanceof Error?t.message:"Failed to delete role")}function cl(){const t=J.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}=ct(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(Ce,{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 d;t[5]!==r?(d=r?s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(dt,{group:"members",className:"gap-6",children:s.jsx(vt,{})}),t[5]=r,t[6]=d):d=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ll,{}),t[7]=f):f=t[7];let m;t[8]!==d?(m=s.jsx(Q.Suspense,{fallback:d,children:f}),t[8]=d,t[9]=m):m=t[9];let c;return t[10]!==o||t[11]!==m?(c=s.jsx(Lt,{fallback:o,children:m}),t[10]=o,t[11]=m,t[12]=c):c=t[12],c}function wo(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(tl,{area:"roles",children:s.jsx(cl,{})}),t[0]=e):e=t[0],e}export{wo as default};
1
+ import{b as ie,r as Q,G as Ge,K as de,m as Ke,j as s,l as q,h as Oe,B as ae,c as J,ae as Je,af as Me,ag as re,ah as Ve,ak as We,n as it,aq as jt,ar as Dt,e as rt,t as ve,o as ze,P as Ce,z as at,b1 as Xe,b0 as et,a$ as tt,C as Pt,a3 as be,a4 as je,a1 as De,a2 as Pe,ap as st,c2 as Mt,u as ct,ds as dt,fh as vt,E as Lt,d as yt}from"./index-CJCRZpMB.js";import{u as wt}from"./use-organization-roles-C6W8q1Ge.js";import{u as Fe}from"./use-org-auth-client-BfY2A0mp.js";import{g as mt,a as Gt}from"./role-color-Dn2tXDDF.js";import{B as Le}from"./badge-SbDG1KPm.js";import{A as ut,a as ft,c as gt,d as ht,b as Tt,f as xt,g as _t,e as pt}from"./alert-dialog-DPDNkomQ.js";import{c as kt,D as Ut,b as Bt,a as Vt}from"./dropdown-menu-nrBYVcW8.js";import{i as Yt}from"./DotsVertical-BdS-tfvn.js";import{s as Ye}from"./Plus-BcZyep8S.js";import{s as Kt}from"./Trash01-r3HSm3ii.js";import{C as zt}from"./collection-table-wrapper-D45S2x_1.js";import{E as lt}from"./empty-state-DLiK3fg3.js";import{S as Qe}from"./search-input-CB5muLj6.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as $e}from"./integration-icon-CD0aQopR.js";import{u as Ft}from"./use-infinite-scroll-mNivro7b.js";import{C as ke}from"./checkbox-DcxXfUdE.js";import{i as Qt}from"./ArrowLeft-BXpO8jp8.js";import{u as $t}from"./useSuspenseInfiniteQuery--xMCyFYl.js";import{u as Ht,S as qt}from"./use-mcp-client-Dhce-bqo.js";import{C as Zt}from"./collection-search-Cc0aBpWG.js";import{p as Jt}from"./connection-Dvoitr_G.js";import{a as Rt}from"./use-members-B-XVLEn5.js";import{g as St}from"./get-initials-D-f_fDFw.js";import{u as Wt}from"./use-connection-Dn3l_9bZ.js";import{d as Xt}from"./use-virtual-mcp-CKm0tgbU.js";import{u as es,g as ts}from"./use-ai-providers-CNN3tNpL.js";import{A as At}from"./avatar-BuayRM7K.js";import{S as me}from"./switch-DbybdixF.js";import{s as ss,P as ls}from"./project-icon-0DSyaJ6_.js";import{t as os}from"./ChevronUp-Y_cRkAu1.js";import{i as ns}from"./ChevronRight-BJjivsOj.js";import{A as is}from"./access-gate-jRlbcBuH.js";import"./Check-B4ByPWon.js";import"./table-CtuD0nsv.js";import"./ArrowUp-DAsSMPB5.js";import"./SearchMd-Bv3H9AtB.js";import"./Tool02-CNUyQ43x.js";import"./agent-icon-DrDgtGp9.js";import"./AlertCircle-sMJfUDOj.js";import"./Tool01-CEhf8lFd.js";import"./ArrowRight-CGaFTEhY.js";import"./TrendUp01-BeVI9Ti3.js";import"./ZoomOut-BvYhouFP.js";import"./Users03-CGlbwn0I.js";import"./CheckCircle-BGc4x48H.js";import"./ChevronSelectorVertical-DRl4uq1v.js";import"./UserSquare-DG-IsvUK.js";import"./Copy01-BEIlJ3Fy.js";import"./CreditCard01-DTUK0Fh8.js";import"./Download01-C-wPfdEs.js";import"./Settings02-BhOb-Osa.js";import"./Eye-BRPz3z02.js";import"./Share07-CBS1tR5Z.js";import"./GitBranch01-B3Ncor1x.js";import"./Globe01-DMWPhraU.js";import"./XClose-DTmF36Gp.js";import"./HardDrive-7cT_kZNx.js";import"./Image01-F-FHbPOq.js";import"./Key01-4i1Gjc6S.js";import"./Link01-CflhCoBY.js";import"./LinkExternal01-CQSXJSFr.js";import"./Monitor01-C1gh539b.js";import"./Sun-D0JwLbN1.js";import"./Package-CYTXeCRF.js";import"./Palette-rdWUWvkS.js";import"./Play-D8b6_uMe.js";import"./SearchLg-BLE7LAUf.js";import"./Shield01-Cdz5fe40.js";import"./Stars01-BRJbkUay.js";import"./Upload01-D75FQMRM.js";import"./User01-DgalGs_E.js";import"./Users01-Db22J7Ma.js";import"./XCircle-DSl9oiph.js";import"./Zap-DpMY6Bkw.js";import"./infiniteQueryObserver-D9VzQaEP.js";import"./auth-B5Ukdogo.js";import"./github-repo-CTPv5ZM2.js";import"./capability-load-error-dpQnYWls.js";const He="basic-usage",qe=[{id:He,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","ORGANIZATION_HAS_SITE","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","JIRA_RUN_START"]},{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}];[...qe.find(t=>t.id===He)?.tools??[]];const rs=["agents:manage","connections:manage"];new Set(qe.filter(t=>rs.includes(t.id)).flatMap(t=>t.tools));function as(){const t=new Map;for(const e of qe){if(e.id===He)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 cs(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ds(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)}const Ze="projects",ot="*";function ms(t){if(!t)return null;const e=t[Ze];return Array.isArray(e)?e:null}function us(t){const e=J.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:d,onSelect:f,onToggle:m}=t,c=r?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==c?(g=q("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),e[0]=c,e[1]=g):g=e[1];let u;e[2]!==l.icon||e[3]!==l.title?(u=s.jsx($e,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=u):u=e[4];let h;e[5]!==l.title?(h=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]=h):h=e[6];let x;e[7]!==f||e[8]!==u||e[9]!==h?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:f,children:[u,h]}),e[7]=f,e[8]=u,e[9]=h,e[10]=x):x=e[10];let a;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==m||e[15]!==d?(a=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",d]}),s.jsx(ke,{checked:n,onCheckedChange:m,onClick:fs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=m,e[15]=d,e[16]=a):a=e[16];let T;return e[17]!==g||e[18]!==x||e[19]!==a?(T=s.jsxs("div",{className:g,children:[x,a]}),e[17]=g,e[18]=x,e[19]=a,e[20]=T):T=e[20],T}function fs(t){return t.stopPropagation()}function gs(t){const e=J.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,d=`tool-${l}-${r.name}`,f=n?"text-foreground":"text-muted-foreground";let m;e[0]!==f?(m=q("text-sm font-medium",f),e[0]=f,e[1]=m):m=e[1];let c;e[2]!==m||e[3]!==r.name?(c=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:r.name})}),e[2]=m,e[3]=r.name,e[4]=c):c=e[4];let g;e[5]!==r.description?(g=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=g):g=e[6];let u;e[7]!==c||e[8]!==g?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,g]}),e[7]=c,e[8]=g,e[9]=u):u=e[9];const h=`tool-${l}-${r.name}`;let x;e[10]!==n||e[11]!==o||e[12]!==h?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ke,{id:h,checked:n,onCheckedChange:o,onClick:hs})}),e[10]=n,e[11]=o,e[12]=h,e[13]=x):x=e[13];let a;return e[14]!==d||e[15]!==u||e[16]!==x?(a=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[u,x]}),e[14]=d,e[15]=u,e[16]=x,e[17]=a):a=e[17],a}function hs(t){return t.stopPropagation()}function Ts({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,d]=Q.useState(""),f=r!==void 0?r:o,m=Q.useDeferredValue(f),[c,g]=Q.useState("all"),[u,h]=Q.useState(!1),x=Q.useRef(new Set(Object.keys(t))),{org:a}=Ge(),T=Ht({connectionId:qt,orgId:a.id,orgSlug:a.slug}),S=100,E=m.trim(),I=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,b=!!l,N={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...b&&{include_virtual:!0}},D=JSON.stringify(N),{data:A,fetchNextPage:j,hasNextPage:P,isFetchingNextPage:_}=$t({queryKey:de.collectionListInfinite(T,a.id,"","CONNECTIONS",D),queryFn:async({pageParam:p=0})=>(await T.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:p,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(p,w)=>{if(p?.hasMore)return w.reduce((H,Z)=>H+(Z?.items?.length??0),0)},staleTime:3e4}),O=A?.pages.flatMap(p=>p?.items??[])??[],C=Ft(j,P??!1,_),i=l?O.filter(p=>p.connection_type!=="VIRTUAL"?!0:Jt(p.connection_url)!==l):O,R=x.current,k=[...R.values()].map(p=>i.find(w=>w.id===p)).filter(p=>p!==void 0),G=i.filter(p=>!R.has(p.id)),Y=[...k,...G],v=p=>{const w=t[p];return w!==void 0&&w.length>0},K=Y.filter(p=>{if(c==="all")return!0;const w=v(p.id);return c==="selected"?w:c==="unselected"?!w:!0}),[L,z]=Q.useState(Y[0]?.id??null),V=L?Y.find(p=>p.id===L)??null:null,{data:U,isFetching:B}=Ke({queryKey:de.collectionItem(T,a.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await T.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=U?.tools??[],W=(p,w)=>t[p]?.includes(w)??!1,te=(p,w)=>{const H=t[p]??[],Z=H.includes(w),se={...t};if(Z){const le=H.filter(ne=>ne!==w);le.length===0?delete se[p]:se[p]=le}else se[p]=[...H,w];e(se)},oe=p=>{const w=p===L?$:[];if(!w.length)return;const H=t[p]??[],Z=w.map(ne=>ne.name),se=H.length>0&&Z.every(ne=>H.includes(ne)),le={...t};se?delete le[p]:(le[p]=Z,z(p)),e(le)},F=p=>{z(p),h(!0)},X=()=>{h(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:q("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[r===void 0&&s.jsx(Zt,{value:o,onChange:d,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>g("all"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>g("selected"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>g("unselected"),className:q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="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(f?"common.toolSetSelector.noConnectionsFound":c==="selected"?"common.toolSetSelector.noServersSelected":c==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(p=>{const w=L===p.id,H=w?$.length:0,Z=t[p.id]?.length??0;return s.jsx(us,{connection:{...p,tools:w?$:p.tools},isSelected:w,hasToolsEnabled:v(p.id),activeToolsCount:Z,totalToolsCount:H,onSelect:()=>F(p.id),onToggle:()=>oe(p.id)},p.id)}),s.jsx("div",{ref:C,className:"h-4"}),_&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:q("flex-1 flex-col",u?"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:X,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Qt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx($e,{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(p=>s.jsx(gs,{connectionId:V.id,tool:p,isSelected:W(V.id,p.name),onToggle:()=>te(V.id,p.name)},p.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 xs=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Ve(),staticPermissions:Me(re()),toolSet:We(re(),Me(re())),allowAllModels:Ve(),modelSet:We(re(),Me(re())),allowAllProjects:Ve(),projectSet:Me(re()),memberIds:Me(re())});function nt(t,e,l,r){const n=s.jsx(me,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(Pe,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function _s(t){const e=J.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie();let g;e[0]!==f?(g=f.trim().toLowerCase(),e[0]=f,e[1]=g):g=e[1];const u=Q.useDeferredValue(g);let h;if(e[2]!==l||e[3]!==u||e[4]!==n||e[5]!==o||e[6]!==m||e[7]!==f||e[8]!==r||e[9]!==c){const x=as(),a=(_,O)=>{if(!m){if(l&&O){const C=x.flatMap(Is).flatMap(Es);n(!1),o(C.filter(i=>!_.tools.includes(i)));return}l||o(ds(_,r,!O))}};let T;e[11]!==u?(T=_=>{const{section:O,capabilities:C}=_;return{section:O,capabilities:C.filter(i=>!u||i.label.toLowerCase().includes(u)||i.description.toLowerCase().includes(u))}},e[11]=u,e[12]=T):T=e[12];const S=x.map(T).filter(ps);let E;e[13]!==c?(E=c("settings.orgRoleDetail.general"),e[13]=c,e[14]=E):E=e[14];let I;e[15]!==c?(I=c("settings.orgRoleDetail.allOrgPermissions"),e[15]=c,e[16]=I):I=e[16];let b;e[17]!==c?(b=c("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=c,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==n||e[21]!==o?(N=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=N):N=e[22];let D;e[23]!==l||e[24]!==m||e[25]!==c||e[26]!==N?(D=nt(c,l,m,N),e[23]=l,e[24]=m,e[25]=c,e[26]=N,e[27]=D):D=e[27];let A;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m?(A=m?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=A):A=e[32];let j;e[33]!==A||e[34]!==I||e[35]!==b||e[36]!==D?(j=s.jsx(et,{children:s.jsx(tt,{title:I,description:b,action:D,onClick:A})}),e[33]=A,e[34]=I,e[35]=b,e[36]=D,e[37]=j):j=e[37];let P;e[38]!==j||e[39]!==E?(P=s.jsx(Xe,{title:E,children:j}),e[38]=j,e[39]=E,e[40]=P):P=e[40],h=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[P,S.length===0&&u?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:c("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:f})}):S.map(_=>{const{section:O,capabilities:C}=_;return s.jsx(Xe,{title:O,children:s.jsx(et,{children:C.map(i=>{const R=cs(i,r,l);return s.jsx(tt,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(Pt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:nt(c,R,m,()=>a(i,R)),onClick:m?void 0:()=>a(i,R)},i.id)})})},O)})]})}),e[2]=l,e[3]=u,e[4]=n,e[5]=o,e[6]=m,e[7]=f,e[8]=r,e[9]=c,e[10]=h}else h=e[10];return h}function ps(t){return t.capabilities.length>0}function Es(t){return t.tools}function Is(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},Rs={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 Ss(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function As(t){return Rs[t]??Nt[t]??t}function Ns(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function Cs(t){const e=J.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:d,allConnectionModelIds:f,selectedModels:m,allowAllModels:c,allConnectionModelsSelected:g,onToggleModel:u,onExitAllowAll:h,readOnly:x,defaultExpanded:a}=t,T=ie(),[S,E]=Q.useState(a),I=a||S,b=E,[N,D]=Q.useState(Ct);let A;e[0]!==g||e[1]!==c||e[2]!==m?(A=_=>c||g||m.includes("*")||m.includes(_),e[0]=g,e[1]=c,e[2]=m,e[3]=A):A=e[3];const j=A;let P;if(e[4]!==f||e[5]!==c||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==j||e[10]!==d||e[11]!==h||e[12]!==u||e[13]!==x||e[14]!==r||e[15]!==n||e[16]!==T||e[17]!==N){let _;e[19]!==j?(_=B=>j(B.id),e[19]=j,e[20]=_):_=e[20];const O=d.filter(_).length,C=d.slice(0,N),i=d.length>N;let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=()=>b(Ds),e[21]=R):R=e[21];const k=o??Et[r]??It;let G;e[22]!==n||e[23]!==k?(G=s.jsx($e,{icon:k,name:n,size:"sm"}),e[22]=n,e[23]=k,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=T("settings.orgRoleDetail.enabledCount",{enabledCount:O,total:d.length});let L;e[30]!==K?(L=s.jsx(Le,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let z;e[32]!==I?(z=I?s.jsx(os,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(ns,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,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 U;e[37]!==V||e[38]!==v?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:R,children:[v,V]}),e[37]=V,e[38]=v,e[39]=U):U=e[39],P=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[C.map(B=>{const $=j(B.id),W=()=>{if(!x){if(c){h(l,f,B.id);return}u(l,B.id)}};return s.jsxs("div",{className:q("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:W,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:js,children:x?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:$,disabled:!0,onCheckedChange:bs})})}),s.jsx(Pe,{children:s.jsx("p",{children:T("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:$,onCheckedChange:W})})]},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:()=>D(Os),children:T("settings.orgRoleDetail.showMore",{remaining:d.length-N})})]})]}),e[4]=f,e[5]=c,e[6]=l,e[7]=I,e[8]=o,e[9]=j,e[10]=d,e[11]=h,e[12]=u,e[13]=x,e[14]=r,e[15]=n,e[16]=T,e[17]=N,e[18]=P}else P=e[18];return P}function Os(t){return t+Ct}function bs(){}function js(t){return t.stopPropagation()}function Ds(t){return!t}function Ps(t){const e=J.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:d,allConnectionModelsSelected:f,searchQuery:m,readOnly:c}=t,g=ts(l.id);let u,h,x,a,T;if(e[0]!==f||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==o||e[7]!==g||e[8]!==c||e[9]!==m||e[10]!==r){T=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=R=>({...R,id:R.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const b=g.filter(ys).map(I),N=m.trim().toLowerCase(),D=N?b.filter(R=>R.title.toLowerCase().includes(N)||R.id.toLowerCase().includes(N)||R.provider?.toLowerCase().includes(N)):b;if(D.length===0){T=null;break e}const A=new Map;for(const R of D){const k=Ss(R.id,l.providerId),G=A.get(k)??{models:[],logo:null};G.models.push({id:R.id,title:Ns(R.title),logo:R.logo}),!G.logo&&R.logo&&(G.logo=R.logo),A.set(k,G)}const j=Array.from(A.entries()).map(Ls).sort(vs),P=j.length===1||N.length>0;x="flex flex-col gap-3";const _=Et[l.providerId]??It;let O;e[18]!==l.providerId||e[19]!==_?(O=s.jsx("img",{src:_,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]=_,e[20]=O):O=e[20];const C=Nt[l.providerId]??l.providerId;let i;e[21]!==C?(i=s.jsx("h4",{className:"text-sm font-medium",children:C}),e[21]=C,e[22]=i):i=e[22],e[23]!==i||e[24]!==O?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[O,i]}),e[23]=i,e[24]=O,e[25]=a):a=e[25],u="flex flex-col gap-3",h=j.map(R=>s.jsx(Cs,{connectionId:l.id,subProviderId:R.id,subProviderName:R.name,groupLogo:R.logo,models:R.models,allConnectionModelIds:b.map(Ms),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:f,onToggleModel:o,onExitAllowAll:d,readOnly:c,defaultExpanded:P},R.id))}e[0]=f,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=o,e[7]=g,e[8]=c,e[9]=m,e[10]=r,e[11]=u,e[12]=h,e[13]=x,e[14]=a,e[15]=T}else u=e[11],h=e[12],x=e[13],a=e[14],T=e[15];if(T!==Symbol.for("react.early_return_sentinel"))return T;let S;e[26]!==u||e[27]!==h?(S=s.jsx("div",{className:u,children:h}),e[26]=u,e[27]=h,e[28]=S):S=e[28];let E;return e[29]!==x||e[30]!==a||e[31]!==S?(E=s.jsxs("div",{className:x,children:[a,S]}),e[29]=x,e[30]=a,e[31]=S,e[32]=E):E=e[32],E}function Ms(t){return t.id}function vs(t,e){return t.name.localeCompare(e.name)}function Ls(t){const[e,l]=t;return{id:e,name:As(e),logo:l.logo,models:l.models}}function ys(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function ws(t){const e=J.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie(),g=Q.useDeferredValue(f),u=es();let h;e[0]!==r||e[1]!==o?(h=(_,O)=>{const C=r[_]??[],i={...r};if(C.includes(O)){const R=C.filter(k=>k!==O);R.length===0?delete i[_]:i[_]=R}else i[_]=[...C,O];o(i)},e[0]=r,e[1]=o,e[2]=h):h=e[2];const x=h;let a;e[3]!==r||e[4]!==n||e[5]!==o?(a=(_,O,C)=>{n(!1),o({...r,[_]:O.filter(i=>i!==C)})},e[3]=r,e[4]=n,e[5]=o,e[6]=a):a=e[6];const T=a,S=!m&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==S?(E=q("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=E):E=e[8];let I;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==m?(I=()=>{if(m)return;const _=!l;n(_),_&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=m,e[13]=I):I=e[13];let b;e[14]!==c?(b=c("settings.orgRoleDetail.allModels"),e[14]=c,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let D;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==m||e[22]!==c?(D=s.jsx("div",{onClick:ks,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:l,disabled:!0,onCheckedChange:Gs})})}),s.jsx(Pe,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:l,onCheckedChange:_=>{n(_),_&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=m,e[22]=c,e[23]=D):D=e[23];let A;e[24]!==E||e[25]!==I||e[26]!==N||e[27]!==D?(A=s.jsxs("div",{className:E,onClick:I,children:[N,D]}),e[24]=E,e[25]=I,e[26]=N,e[27]=D,e[28]=A):A=e[28];let j;e[29]!==u||e[30]!==l||e[31]!==g||e[32]!==T||e[33]!==r||e[34]!==m||e[35]!==c||e[36]!==x?(j=u.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noLlmConnectionsConfigured")}):u.map(_=>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"}),c("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ps,{connection:_,selectedModels:r[_.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:T,allConnectionModelsSelected:(r[_.id]??[]).includes("*"),searchQuery:g,readOnly:m})},_.id)),e[29]=u,e[30]=l,e[31]=g,e[32]=T,e[33]=r,e[34]=m,e[35]=c,e[36]=x,e[37]=j):j=e[37];let P;return e[38]!==A||e[39]!==j?(P=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[A,j]}),e[38]=A,e[39]=j,e[40]=P):P=e[40],P}function Gs(){}function ks(t){return t.stopPropagation()}function Us(t){const e=J.c(39),{allowAllProjects:l,projectSet:r,onAllowAllChange:n,onProjectSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie(),g=Q.useDeferredValue(f),u=Xt();let h;if(e[0]!==l||e[1]!==g||e[2]!==n||e[3]!==o||e[4]!==r||e[5]!==m||e[6]!==f||e[7]!==c||e[8]!==u){const x=ss(u),a=g.trim().toLowerCase(),T=a?x.filter(C=>C.title.toLowerCase().includes(a)):x,S=C=>{if(l){n(!1),o(x.map(Ys).filter(i=>i!==C));return}r.includes(C)?o(r.filter(i=>i!==C)):o([...r,C])},E=!m&&"hover:bg-muted/50 cursor-pointer";let I;e[10]!==E?(I=q("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",E),e[10]=E,e[11]=I):I=e[11];let b;e[12]!==l||e[13]!==n||e[14]!==o||e[15]!==m?(b=()=>{if(m)return;const C=!l;n(C),C&&o([])},e[12]=l,e[13]=n,e[14]=o,e[15]=m,e[16]=b):b=e[16];let N;e[17]!==c?(N=c("settings.orgRoleDetail.allProjects"),e[17]=c,e[18]=N):N=e[18];let D;e[19]!==N?(D=s.jsx("span",{className:"text-sm font-medium",children:N}),e[19]=N,e[20]=D):D=e[20];let A;e[21]!==c?(A=c("settings.orgRoleDetail.allProjectsDescription"),e[21]=c,e[22]=A):A=e[22];let j;e[23]!==A?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:A}),e[23]=A,e[24]=j):j=e[24];let P;e[25]!==D||e[26]!==j?(P=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,j]}),e[25]=D,e[26]=j,e[27]=P):P=e[27];let _;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m||e[32]!==c?(_=s.jsx("div",{onClick:Vs,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:l,disabled:!0,onCheckedChange:Bs})})}),s.jsx(Pe,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:l,onCheckedChange:C=>{n(C),C&&o([])}})}),e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=c,e[33]=_):_=e[33];let O;e[34]!==P||e[35]!==_||e[36]!==I||e[37]!==b?(O=s.jsxs("div",{className:I,onClick:b,children:[P,_]}),e[34]=P,e[35]=_,e[36]=I,e[37]=b,e[38]=O):O=e[38],h=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 p-4",children:[O,x.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsAvailable")}):T.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsMatch",{searchQuery:f})}):s.jsx("div",{className:"flex flex-col gap-1",children:T.map(C=>{const i=l||r.includes(C.id);return s.jsxs("label",{className:q("flex items-center gap-3 px-3 py-2 rounded-lg border border-transparent",m?"cursor-default":"hover:bg-muted/50 cursor-pointer"),children:[s.jsx(ke,{checked:i,disabled:m,onCheckedChange:()=>{m||S(C.id)}}),s.jsx(ls,{icon:C.icon,name:C.title}),s.jsx("span",{className:"text-sm truncate",children:C.title})]},C.id)})})]}),e[0]=l,e[1]=g,e[2]=n,e[3]=o,e[4]=r,e[5]=m,e[6]=f,e[7]=c,e[8]=u,e[9]=h}else h=e[9];return h}function Bs(){}function Vs(t){return t.stopPropagation()}function Ys(t){return t.id}function Ks(t){const e=J.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,d=ie(),[f,m]=Q.useState(""),c=Q.useDeferredValue(f);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[u,h]=Q.useState(g),{data:x}=Rt();let a,T,S,E,I,b,N,D,A,j,P;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==f||e[8]!==n||e[9]!==d){const L=x?.data?.members??[];let z;e[21]!==c?(z=F=>{const X=c.toLowerCase();return F.user?.name?.toLowerCase().includes(X)||F.user?.email?.toLowerCase().includes(X)},e[21]=c,e[22]=z):z=e[22];const V=L.filter(z);let U;e[23]!==o||e[24]!==r||e[25]!==u?(U=()=>{o(u),h([]),r(!1)},e[23]=o,e[24]=r,e[25]=u,e[26]=U):U=e[26],S=U,T=ut,j=l,P=r,a=ft,D="sm:max-w-md p-0";let B;e[27]!==d?(B=d("settings.orgRoleDetail.addMembersToRole"),e[27]=d,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(gt,{children:B}),e[29]=B,e[30]=$):$=e[30];let W;e[31]!==d?(W=d("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=d,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(ht,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(A=s.jsxs(Tt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=A):A=e[37],b="flex flex-col h-80";let oe;e[38]!==d?(oe=d("settings.orgRoleDetail.searchMembers"),e[38]=d,e[39]=oe):oe=e[39],e[40]!==f||e[41]!==oe?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:f,onChange:m,placeholder:oe,className:"w-full"})}),e[40]=f,e[41]=oe,e[42]=N):N=e[42],E="flex-1 overflow-auto",I=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:d(f?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const X=F.role!=="owner",p=n.includes(F.id),w=u.includes(F.id);return s.jsxs("label",{className:q("flex items-center gap-3 p-2 rounded-lg",!X||p?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ke,{checked:w||p,onCheckedChange:()=>{!X||p||h(H=>H.includes(F.id)?H.filter(Z=>Z!==F.id):[...H,F.id])},disabled:!X||p}),s.jsx(At,{url:F.user?.image??void 0,fallback:St(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||d("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!X&&s.jsx(Le,{variant:"secondary",className:"shrink-0",children:d("settings.orgRoleDetail.owner")}),p&&X&&s.jsx(Le,{variant:"outline",className:"shrink-0",children:d("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=o,e[4]=r,e[5]=l,e[6]=u,e[7]=f,e[8]=n,e[9]=d,e[10]=a,e[11]=T,e[12]=S,e[13]=E,e[14]=I,e[15]=b,e[16]=N,e[17]=D,e[18]=A,e[19]=j,e[20]=P}else a=e[10],T=e[11],S=e[12],E=e[13],I=e[14],b=e[15],N=e[16],D=e[17],A=e[18],j=e[19],P=e[20];let _;e[43]!==E||e[44]!==I?(_=s.jsx("div",{className:E,children:I}),e[43]=E,e[44]=I,e[45]=_):_=e[45];let O;e[46]!==_||e[47]!==b||e[48]!==N?(O=s.jsxs("div",{className:b,children:[N,_]}),e[46]=_,e[47]=b,e[48]=N,e[49]=O):O=e[49];let C;e[50]!==d?(C=d("settings.orgRoleDetail.cancel"),e[50]=d,e[51]=C):C=e[51];let i;e[52]!==C?(i=s.jsx(xt,{children:C}),e[52]=C,e[53]=i):i=e[53];const R=u.length===0;let k;e[54]!==u.length||e[55]!==d?(k=d("settings.orgRoleDetail.addWithCount",{count:u.length}),e[54]=u.length,e[55]=d,e[56]=k):k=e[56];let G;e[57]!==S||e[58]!==R||e[59]!==k?(G=s.jsx(_t,{onClick:S,disabled:R,children:k}),e[57]=S,e[58]=R,e[59]=k,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(pt,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==a||e[65]!==O||e[66]!==Y||e[67]!==D||e[68]!==A?(v=s.jsxs(a,{className:D,children:[A,O,Y]}),e[64]=a,e[65]=O,e[66]=Y,e[67]=D,e[68]=A,e[69]=v):v=e[69];let K;return e[70]!==T||e[71]!==v||e[72]!==j||e[73]!==P?(K=s.jsx(T,{open:j,onOpenChange:P,children:v}),e[70]=T,e[71]=v,e[72]=j,e[73]=P,e[74]=K):K=e[74],K}function zs(t){const e=J.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:d,addMemberDialogOpen:f,onAddMemberDialogOpenChange:m}=t,c=n===void 0?!1:n,g=o===void 0?void 0:o,u=ie(),h=Q.useDeferredValue(d),{data:x}=Rt();let a,T,S;if(e[0]!==x?.data?.members||e[1]!==h||e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==g||e[6]!==d||e[7]!==u){const D=x?.data?.members??[];let A;e[11]!==l?(A=i=>l.includes(i.id),e[11]=l,e[12]=A):A=e[12];const j=D.filter(A);let P;e[13]!==h?(P=i=>{const R=h.toLowerCase();return i.user?.name?.toLowerCase().includes(R)||i.user?.email?.toLowerCase().includes(R)},e[13]=h,e[14]=P):P=e[14];const _=j.filter(P);let O;e[15]!==g||e[16]!==u?(O=g??u("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=u,e[17]=O):O=e[17];const C=O;S="flex flex-col h-full",a="flex-1 overflow-auto",T=j.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:u("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):_.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.noMembersMatch",{searchQuery:d})})}):s.jsx("div",{className:"p-4 space-y-2",children:_.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(At,{url:i.user?.image??void 0,fallback:St(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||u("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),c?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),children:s.jsx(st,{size:16})})})}),s.jsx(Pe,{children:s.jsx("p",{children:C})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(R=>R!==i.id)),children:s.jsx(st,{size:16})})]},i.id))}),e[0]=x?.data?.members,e[1]=h,e[2]=l,e[3]=r,e[4]=c,e[5]=g,e[6]=d,e[7]=u,e[8]=a,e[9]=T,e[10]=S}else a=e[8],T=e[9],S=e[10];let E;e[18]!==a||e[19]!==T?(E=s.jsx("div",{className:a,children:T}),e[18]=a,e[19]=T,e[20]=E):E=e[20];let I;e[21]!==l||e[22]!==r?(I=D=>r([...l,...D]),e[21]=l,e[22]=r,e[23]=I):I=e[23];let b;e[24]!==f||e[25]!==l||e[26]!==m||e[27]!==I?(b=s.jsx(Ks,{open:f,onOpenChange:m,selectedMemberIds:l,onAddMembers:I}),e[24]=f,e[25]=l,e[26]=m,e[27]=I,e[28]=b):b=e[28];let N;return e[29]!==S||e[30]!==E||e[31]!==b?(N=s.jsxs("div",{className:S,children:[E,b]}),e[29]=S,e[30]=E,e[31]=b,e[32]=N):N=e[32],N}function Fs(t){const e=J.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(zs,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const Qs={owner:[],admin:[],user:[]};function $s(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:Qs[t],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Hs(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),d=o?[]:n.filter(a=>a!=="*"),f={};for(const[a,T]of Object.entries(r))if(!(a==="self"||a==="models"||a===Ze))if(a==="*")for(const S of l)f[S.id]=T.includes("*")?S.tools?.map(E=>E.name)??[]:T;else{const S=l.find(E=>E.id===a);S&&(f[a]=T.includes("*")?S.tools?.map(E=>E.name)??[]:T)}const m=r.models||[],c=m.length===0||m.includes("*:*"),g={};if(!c)for(const a of m){const T=a.indexOf(":");if(T===-1)continue;const S=a.slice(0,T),E=a.slice(T+1);g[S]||(g[S]=[]),g[S].push(E)}const u=ms(r),h=u===null||u.includes(ot),x=h?[]:u.filter(a=>a!==ot);return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:d,toolSet:f,allowAllModels:c,modelSet:g,allowAllProjects:h,projectSet:x,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function qs(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 d=e.find(f=>f.id===r)?.tools?.map(f=>f.name)??[];l[r]=d.length>0&&d.every(f=>n.includes(f))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const d of o)r.push(`${n}:${d}`);r.length>0&&(l.models=r)}return t.allowAllProjects||(l[Ze]=t.projectSet),l}function Zs(t,e,l){return t.kind==="builtin"?$s(t.role,e,void 0):t.kind==="custom"?Hs(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:[]}}function Js(t){const e=J.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,d=ie();let f;e[0]!==o||e[1]!==d?(f=o??d("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=d,e[2]=f):f=e[2];const m=f;if(l){let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ye,{size:16}),e[3]=h):h=e[3];let x;e[4]!==d?(x=d("settings.orgRoleDetail.addMember"),e[4]=d,e[5]=x):x=e[5];let a;e[6]!==x?(a=s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[h,x]})})}),e[6]=x,e[7]=a):a=e[7];let T;e[8]!==m?(T=s.jsx(Pe,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=T):T=e[9];let S;return e[10]!==a||e[11]!==T?(S=s.jsx(be,{children:s.jsxs(je,{children:[a,T]})}),e[10]=a,e[11]=T,e[12]=S):S=e[12],S}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ye,{size:16}),e[13]=c):c=e[13];let g;e[14]!==d?(g=d("settings.orgRoleDetail.addMember"),e[14]=d,e[15]=g):g=e[15];let u;return e[16]!==n||e[17]!==g?(u=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[c,g]}),e[16]=n,e[17]=g,e[18]=u):u=e[18],u}function Ws(t){const e=J.c(14),{locator:l}=Ge(),r=Fe(),n=Wt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==r?(d=()=>r.organization.listMembers(),e[2]=r,e[3]=d):d=e[3];let f;e[4]!==o||e[5]!==d?(f={queryKey:o,queryFn:d},e[4]=o,e[5]=d,e[6]=f):f=e[6];const{data:m,isPending:c}=Ke(f);if(c||!n){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=x):x=e[7],x}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const u=g;let h;return e[10]!==n||e[11]!==u||e[12]!==t?(h=s.jsx(Xs,{...t,members:u,connections:n}),e[10]=n,e[11]=u,e[12]=t,e[13]=h):h=e[13],h}function Xs({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:d}=Ge(),f=Fe(),m=it(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",u=t.kind==="new",[h,x]=Q.useState(c?"org":"mcp"),a=jt({resolver:Dt(xs),defaultValues:Zs(t,r,n)}),T=a.formState.isValid,S=a.formState.isDirty,E=rt({mutationFn:async i=>{const R=qs(i,n),k=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(U=>U.role===(K??v)).map(U=>U.id),z=i.memberIds.filter(U=>!L.includes(U)),V=L.filter(U=>!i.memberIds.includes(U));for(const U of z){const B=await f.organization.updateMemberRole({memberId:U,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await f.organization.updateMemberRole({memberId:U,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 f.organization.updateRole({roleId:i.role.id,data:{permission:R,...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 f.organization.createRole({role:k,permission:R});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await f.organization.updateMemberRole({memberId:K,role:[k]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:k}}}},onSuccess:(i,R)=>{m.invalidateQueries({queryKey:de.members(d)}),m.invalidateQueries({queryKey:de.organizationRoles(d)});const k=!R.role.id&&!R.role.slug,G=R.role.slug==="owner"&&!R.role.id;ze(G?"role_members_updated":k?"role_created":"role_updated",{role_slug:R.role.slug??null}),ve.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),a.reset(i),l(i.role.id)},onError:i=>{ve.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=a.handleSubmit(i=>{if(!i.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),a.setFocus("role.label");return}E.mutate(i)}),b=!g,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",D=[...g?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"projects",label:o("settings.orgRoleDetail.projects")},{id:"members",label:o("settings.orgRoleDetail.members")}],[A,j]=Q.useState(""),[P,_]=Q.useState(!1),O=i=>{x(i),j("")},C={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),projects:o("settings.orgRoleDetail.searchProjects"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ce,{children:s.jsxs(Ce.Content,{className:q("flex flex-col",h!=="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(Ce.Title,{actions:b&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:I,disabled:E.isPending||!T||!S,children:E.isPending?o("settings.orgRoleDetail.saving"):o(u?"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:q("size-2.5 rounded-full shrink-0",t.kind==="builtin"?mt(t.role,!0):Gt(a.watch("role.label")))}),g&&s.jsx(at,{size:16,className:"text-muted-foreground shrink-0"}),u||t.kind==="custom"?s.jsx("input",{...a.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:u}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:D.map(i=>s.jsx("button",{type:"button",onClick:()=>O(i.id),className:q("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",h===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(Qe,{value:A,onChange:j,placeholder:C[h]??"Search...",className:"w-full md:w-[375px]"}),h==="members"&&s.jsx(Js,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>_(!0)})]})]})}),s.jsx("div",{className:q("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",h!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:q(h!=="org"&&"h-full overflow-hidden",h!=="models"&&h!=="projects"&&h!=="org"&&"border border-border rounded-xl bg-card"),children:[h==="mcp"&&!g&&s.jsx(Ts,{toolSet:a.watch("toolSet"),onToolSetChange:i=>a.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:A}),h==="org"&&s.jsx(_s,{allowAllStaticPermissions:a.watch("allowAllStaticPermissions"),staticPermissions:a.watch("staticPermissions"),onAllowAllChange:i=>a.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>a.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="models"&&s.jsx(ws,{allowAllModels:a.watch("allowAllModels"),modelSet:a.watch("modelSet"),onAllowAllChange:i=>a.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>a.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="projects"&&s.jsx(Us,{allowAllProjects:a.watch("allowAllProjects"),projectSet:a.watch("projectSet"),onAllowAllChange:i=>a.setValue("allowAllProjects",i,{shouldDirty:!0}),onProjectSetChange:i=>a.setValue("projectSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="members"&&s.jsx(Fs,{memberIds:a.watch("memberIds"),onMemberIdsChange:i=>a.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:A,addMemberDialogOpen:P,onAddMemberDialogOpenChange:_})]})})]})})}function el(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function tl(t){const e=J.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:d}=Mt();let f;return e[0]!==l||e[1]!==r||e[2]!==d||e[3]!==n||e[4]!==o?(f=s.jsx(is,{granted:n,loading:o,error:d,area:l,children:r}),e[0]=l,e[1]=r,e[2]=d,e[3]=n,e[4]=o,e[5]=f):f=e[5],f}const sl=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function ll(){const t=J.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),d=yt();let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={strict:!1},t[0]=f):f=t[0];const{role:m}=ct(f),{locator:c}=Ge(),g=Fe(),u=it(),{customRoles:h,refetch:x}=wt();let a;t[1]!==d?(a=M=>d({to:".",search:y=>({...y,role:M})}),t[1]=d,t[2]=a):a=t[2];const T=a;let S;e:{if(!m){S=null;break e}if(m==="new"){S={kind:"new"};break e}if(m.startsWith("builtin-")){S={kind:"builtin",role:m.slice(8)};break e}let M;t[3]!==m?(M=ee=>ee.id===m,t[3]=m,t[4]=M):M=t[4];const y=h.find(M);S=y?{kind:"custom",role:y}:null}const E=S;let I;t[5]!==c?(I=de.members(c),t[5]=c,t[6]=I):I=t[6];let b;t[7]!==g?(b=()=>g.organization.listMembers(),t[7]=g,t[8]=b):b=t[8];let N;t[9]!==I||t[10]!==b?(N={queryKey:I,queryFn:b},t[9]=I,t[10]=b,t[11]=N):N=t[11];const{data:D}=Ke(N);let A;t[12]!==D?.data?.members?(A=D?.data?.members??[],t[12]=D?.data?.members,t[13]=A):A=t[13];const j=A;let P;t[14]!==j?(P=M=>j.filter(y=>y.role===M).length,t[14]=j,t[15]=P):P=t[15];const _=P;let O;if(t[16]!==h||t[17]!==_||t[18]!==l||t[19]!==e){let M;t[21]!==_||t[22]!==e?(M=ce=>({kind:"builtin",role:{...ce,memberCount:_(ce.role),label:e(ce.labelKey)}}),t[21]=_,t[22]=e,t[23]=M):M=t[23];const y=sl.map(M);let ee;t[24]!==_?(ee=ce=>({kind:"custom",role:{...ce,memberCount:_(ce.role)}}),t[24]=_,t[25]=ee):ee=t[25];const Ot=h.map(ee);if(O=[...y,...Ot],l){const ce=l.toLowerCase();O=O.filter(bt=>bt.role.label.toLowerCase().includes(ce))}t[16]=h,t[17]=_,t[18]=l,t[19]=e,t[20]=O}else O=t[20];let C;t[26]!==g?(C=async M=>{const y=await g.organization.deleteRole({roleId:M});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=g,t[27]=C):C=t[27];const i=rt({mutationFn:C,onSuccess:(M,y)=>{ze("role_deleted",{role_id:y}),u.invalidateQueries({queryKey:de.members(c)}),u.invalidateQueries({queryKey:de.organizationRoles(c)}),ve.success(e("settings.roles.deletedSuccessfully")),x(),E?.kind==="custom"&&E.role.id===y&&T(void 0)},onError:al});let R;t[28]!==e?(R=e("settings.roles.columnRole"),t[28]=e,t[29]=R):R=t[29];let k;t[30]!==R?(k={id:"role",header:R,render:rl,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=R,t[31]=k):k=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=M=>M.kind==="builtin"?s.jsx(Le,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Le,{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=M=>{if(M.kind==="builtin")return M.role.role==="owner"||M.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=M.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 U;t[48]!==V?(U={id:"members",header:V,render:il,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:M=>M.kind==="builtin"?null:s.jsxs(kt,{children:[s.jsx(Ut,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:nl,children:s.jsx(Yt,{size:16})})}),s.jsx(Bt,{align:"end",onClick:ol,children:s.jsxs(Vt,{variant:"destructive",onClick:()=>{const y=M.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Kt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==k||t[53]!==v||t[54]!==z||t[55]!==U||t[56]!==B?($=[k,v,z,U,B],t[52]=k,t[53]=v,t[54]=z,t[55]=U,t[56]=B,t[57]=$):$=t[57];const W=$;let te;t[58]!==T?(te=M=>{if(M.kind==="builtin")T(`builtin-${M.role.role}`);else{const y=M.role;T(y.id)}},t[58]=T,t[59]=te):te=t[59];const oe=te;if(E){let M;t[60]!==T?(M=()=>T(void 0),t[60]=T,t[61]=M):M=t[61];let y;return t[62]!==x||t[63]!==T?(y=()=>{x(),T(void 0)},t[62]=x,t[63]=T,t[64]=y):y=t[64],s.jsx(Ws,{target:E,onBack:M,onSaved:y},el(E))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let X;t[67]===Symbol.for("react.memo_cache_sentinel")?(X=M=>{M.key==="Escape"&&(r(""),M.target.blur())},t[67]=X):X=t[67];let p;t[68]!==l||t[69]!==F?(p=s.jsx(Qe,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:X}),t[68]=l,t[69]=F,t[70]=p):p=t[70];let w;t[71]!==T?(w=()=>T("new"),t[71]=T,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ye,{size:16}),t[73]=H):H=t[73];let Z;t[74]!==e?(Z=e("settings.roles.createRole"),t[74]=e,t[75]=Z):Z=t[75];let se;t[76]!==w||t[77]!==Z?(se=s.jsxs(ae,{onClick:w,children:[H,Z]}),t[76]=w,t[77]=Z,t[78]=se):se=t[78];let le;t[79]!==p||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p,se]}),t[79]=p,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(lt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(lt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let ue;t[85]!==O||t[86]!==W||t[87]!==oe||t[88]!==ne?(ue=s.jsx(zt,{columns:W,data:O,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=O,t[86]=W,t[87]=oe,t[88]=ne,t[89]=ue):ue=t[89];const Ue=n!==null;let ye;t[90]===Symbol.for("react.memo_cache_sentinel")?(ye=M=>!M&&o(null),t[90]=ye):ye=t[90];let fe;t[91]!==e?(fe=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=fe):fe=t[92];let ge;t[93]!==fe?(ge=s.jsx(gt,{children:fe}),t[93]=fe,t[94]=ge):ge=t[94];const Be=n?.label??"";let he;t[95]!==e||t[96]!==Be?(he=e("settings.roles.deleteRoleConfirm",{role:Be}),t[95]=e,t[96]=Be,t[97]=he):he=t[97];let Te;t[98]!==he?(Te=s.jsx(ht,{children:he}),t[98]=he,t[99]=Te):Te=t[99];let xe;t[100]!==ge||t[101]!==Te?(xe=s.jsxs(Tt,{children:[ge,Te]}),t[100]=ge,t[101]=Te,t[102]=xe):xe=t[102];let _e;t[103]!==e?(_e=e("settings.roles.cancel"),t[103]=e,t[104]=_e):_e=t[104];let pe;t[105]!==_e?(pe=s.jsx(xt,{children:_e}),t[105]=_e,t[106]=pe):pe=t[106];let Ee;t[107]!==i||t[108]!==n?(Ee=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ee):Ee=t[109];let Ie;t[110]!==e?(Ie=e("settings.roles.delete"),t[110]=e,t[111]=Ie):Ie=t[111];let Re;t[112]!==Ee||t[113]!==Ie?(Re=s.jsx(_t,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ie}),t[112]=Ee,t[113]=Ie,t[114]=Re):Re=t[114];let Se;t[115]!==pe||t[116]!==Re?(Se=s.jsxs(pt,{children:[pe,Re]}),t[115]=pe,t[116]=Re,t[117]=Se):Se=t[117];let Ae;t[118]!==xe||t[119]!==Se?(Ae=s.jsxs(ft,{children:[xe,Se]}),t[118]=xe,t[119]=Se,t[120]=Ae):Ae=t[120];let Ne;t[121]!==Ue||t[122]!==Ae?(Ne=s.jsx(ut,{open:Ue,onOpenChange:ye,children:Ae}),t[121]=Ue,t[122]=Ae,t[123]=Ne):Ne=t[123];let we;return t[124]!==le||t[125]!==ue||t[126]!==Ne?(we=s.jsxs(dt,{group:"members",className:"gap-6",children:[le,ue,Ne]}),t[124]=le,t[125]=ue,t[126]=Ne,t[127]=we):we=t[127],we}function ol(t){return t.stopPropagation()}function nl(t){return t.stopPropagation()}function il(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function rl(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:q("size-2.5 rounded-full shrink-0",mt(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(at,{size:12,className:"text-muted-foreground shrink-0"})]})}function al(t,e){ze("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ve.error(t instanceof Error?t.message:"Failed to delete role")}function cl(){const t=J.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}=ct(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(Ce,{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 d;t[5]!==r?(d=r?s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(dt,{group:"members",className:"gap-6",children:s.jsx(vt,{})}),t[5]=r,t[6]=d):d=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ll,{}),t[7]=f):f=t[7];let m;t[8]!==d?(m=s.jsx(Q.Suspense,{fallback:d,children:f}),t[8]=d,t[9]=m):m=t[9];let c;return t[10]!==o||t[11]!==m?(c=s.jsx(Lt,{fallback:o,children:m}),t[10]=o,t[11]=m,t[12]=c):c=t[12],c}function wo(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(tl,{area:"roles",children:s.jsx(cl,{})}),t[0]=e):e=t[0],e}export{wo 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-BbDu2xq3.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({home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),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-CJCRZpMB.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({home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),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 +1 @@
1
- import{r as d,bv as T,bw as ce,j as b,br as _,bt as ae,cJ as O,bx as C,cO as P,cK as ie,c as F,l as $}from"./index-BbDu2xq3.js";import{e as de}from"./select-FSMMPzsI.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),J=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});J.displayName=U;var K="ScrollAreaViewport",G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(K,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});G.displayName=K;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=J,Ce=G,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
1
+ import{r as d,bv as T,bw as ce,j as b,br as _,bt as ae,cJ as O,bx as C,cO as P,cK as ie,c as F,l as $}from"./index-CJCRZpMB.js";import{e as de}from"./select-DF_uGAC8.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),J=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});J.displayName=U;var K="ScrollAreaViewport",G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(K,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});G.displayName=K;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=J,Ce=G,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
@@ -1 +1 @@
1
- import{c as b,l as w,j as a,h as j}from"./index-BbDu2xq3.js";import{i as N}from"./SearchMd-DBtIEQFG.js";function v(m){const e=b.c(17),{value:l,onChange:c,placeholder:h,onKeyDown:d,className:u,isSearching:p,disabled:r}=m,x=h===void 0?"Search...":h,g=r&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==g?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",g,u),e[0]=u,e[1]=g,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=f=>c(f.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==d||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=d,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{v as S};
1
+ import{c as b,l as w,j as a,h as j}from"./index-CJCRZpMB.js";import{i as N}from"./SearchMd-Bv3H9AtB.js";function v(m){const e=b.c(17),{value:l,onChange:c,placeholder:h,onKeyDown:d,className:u,isSearching:p,disabled:r}=m,x=h===void 0?"Search...":h,g=r&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==g?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",g,u),e[0]=u,e[1]=g,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=f=>c(f.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==d||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=d,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{v as S};
@@ -1 +1 @@
1
- import{c as j,b as y,j as s,P as N,b5 as $,E as F,r as v,b8 as B,z as k,B as _,t as w}from"./index-BbDu2xq3.js";import{i as L}from"./AlertCircle-DM1wOTV-.js";import{s as E}from"./Plus-DsoHS1s-.js";import{s as O}from"./User01-BkT796JC.js";import{t as R}from"./Users01-Dyo9ZzPj.js";import{D as A,b as I,c as q,d as V,h as H,e as G}from"./dialog-DBF7H4cU.js";import{I as z}from"./input-2a-tqySq.js";import{L as C}from"./label-Bw3LAQ_7.js";import{S as J,b as K,a as M,d as Q,c as D}from"./select-FSMMPzsI.js";import{T as U}from"./textarea-CLacFrbn.js";import{u as W,a as X}from"./use-secrets-DFq1lqOb.js";import{R as Y}from"./require-capability-CmB8qaJ4.js";import"./Check-B_YxhG30.js";import"./ChevronUp-t8t4fwnR.js";import"./access-gate-CsjPwmbX.js";import"./capability-load-error-Ewp013Fw.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(L,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?O:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let o;return e[5]!==l||e[6]!==a?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[a,l]}),e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=a):a=e[9];let o;e[10]!==l||e[11]!==a?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=o):o=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let m;e[15]!==u?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=m):m=e[16];let d;return e[17]!==o||e[18]!==m?(d=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=d):d=e[19],d}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let a;e[5]!==i?(a=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=a):a=e[6];let o;e[7]!==a?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=o):o=e[8];let u;e[9]!==l||e[10]!==o?(u=s.jsxs("div",{children:[l,o]}),e[9]=l,e[10]=o,e[11]=u):u=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(E,{size:14}),e[12]=m):m=e[12];let d;e[13]!==i?(d=i("settings.secrets.newSecret"),e[13]=i,e[14]=d):d=e[14];let p;e[15]!==r||e[16]!==d?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[m,d]}),e[15]=r,e[16]=d,e[17]=p):p=e[17];let f;return e[18]!==u||e[19]!==p?(f=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=f):f=e[20],f}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[a,o]=v.useState(""),[u,m]=v.useState(""),d=X();function p(){c("organization"),l(""),o(""),m("")}function f(){p(),e(!1)}async function g(x){if(x.preventDefault(),!(!n.trim()||!a))try{await d.mutateAsync({scope:i,name:n.trim(),value:a,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),f()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(A,{open:t,onOpenChange:x=>{x?e(x):f()},children:s.jsxs(I,{className:"sm:max-w-lg",children:[s.jsxs(q,{children:[s.jsx(V,{children:r("settings.secrets.newSecretTitle")}),s.jsx(H,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(J,{value:i,onValueChange:x=>c(x),children:[s.jsx(K,{id:"secret-scope",children:s.jsx(M,{})}),s.jsxs(Q,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:x=>l(x.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:a,onChange:x=>o(x.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(U,{id:"secret-description",value:u,onChange:x=>m(x.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(G,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:f,disabled:d.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:d.isPending||!n.trim()||!a,children:d.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=m):m=t[0];let d;return t[1]!==i?(d=s.jsxs(s.Fragment,{children:[m,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=d):d=t[2],d}let n,l,a;if(t[3]!==r||t[4]!==e){const m=r.filter(ce),d=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let f;t[8]!==r.length||t[9]!==e||t[10]!==p?(f=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=f):f=t[11];let g;t[12]!==f?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:f}),t[12]=f,t[13]=g):g=t[13];let x;t[14]===Symbol.for("react.memo_cache_sentinel")?(x=()=>c(!0),t[14]=x):x=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:x,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:m.map(ne)})]}):null,a=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:d.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=a}else n=t[5],l=t[6],a=t[7];let o;t[23]!==i?(o=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=o):o=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==a||t[28]!==o?(u=s.jsxs(s.Fragment,{children:[n,l,a,o]}),t[25]=n,t[26]=l,t[27]=a,t[28]=o,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(N.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:ae,children:s.jsx(v.Suspense,{fallback:s.jsx(B,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(N,{children:s.jsx(N.Content,{children:s.jsx(N.Body,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function ae(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function _e(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{_e as default};
1
+ import{c as j,b as y,j as s,P as N,b5 as $,E as F,r as v,b8 as B,z as k,B as _,t as w}from"./index-CJCRZpMB.js";import{i as L}from"./AlertCircle-sMJfUDOj.js";import{s as E}from"./Plus-BcZyep8S.js";import{s as O}from"./User01-DgalGs_E.js";import{t as R}from"./Users01-Db22J7Ma.js";import{D as A,b as I,c as q,d as V,h as H,e as G}from"./dialog-BHOSFmXf.js";import{I as z}from"./input-m33ZpN6u.js";import{L as C}from"./label-BMxzM3Ve.js";import{S as J,b as K,a as M,d as Q,c as D}from"./select-DF_uGAC8.js";import{T as U}from"./textarea-DkzJLOUG.js";import{u as W,a as X}from"./use-secrets-KWnisDzK.js";import{R as Y}from"./require-capability-C9_nKDiq.js";import"./Check-B4ByPWon.js";import"./ChevronUp-Y_cRkAu1.js";import"./access-gate-jRlbcBuH.js";import"./capability-load-error-dpQnYWls.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(L,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?O:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let o;return e[5]!==l||e[6]!==a?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[a,l]}),e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=a):a=e[9];let o;e[10]!==l||e[11]!==a?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=o):o=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let m;e[15]!==u?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=m):m=e[16];let d;return e[17]!==o||e[18]!==m?(d=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=d):d=e[19],d}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let a;e[5]!==i?(a=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=a):a=e[6];let o;e[7]!==a?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=o):o=e[8];let u;e[9]!==l||e[10]!==o?(u=s.jsxs("div",{children:[l,o]}),e[9]=l,e[10]=o,e[11]=u):u=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(E,{size:14}),e[12]=m):m=e[12];let d;e[13]!==i?(d=i("settings.secrets.newSecret"),e[13]=i,e[14]=d):d=e[14];let p;e[15]!==r||e[16]!==d?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[m,d]}),e[15]=r,e[16]=d,e[17]=p):p=e[17];let f;return e[18]!==u||e[19]!==p?(f=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=f):f=e[20],f}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[a,o]=v.useState(""),[u,m]=v.useState(""),d=X();function p(){c("organization"),l(""),o(""),m("")}function f(){p(),e(!1)}async function g(x){if(x.preventDefault(),!(!n.trim()||!a))try{await d.mutateAsync({scope:i,name:n.trim(),value:a,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),f()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(A,{open:t,onOpenChange:x=>{x?e(x):f()},children:s.jsxs(I,{className:"sm:max-w-lg",children:[s.jsxs(q,{children:[s.jsx(V,{children:r("settings.secrets.newSecretTitle")}),s.jsx(H,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(J,{value:i,onValueChange:x=>c(x),children:[s.jsx(K,{id:"secret-scope",children:s.jsx(M,{})}),s.jsxs(Q,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:x=>l(x.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:a,onChange:x=>o(x.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(U,{id:"secret-description",value:u,onChange:x=>m(x.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(G,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:f,disabled:d.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:d.isPending||!n.trim()||!a,children:d.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=m):m=t[0];let d;return t[1]!==i?(d=s.jsxs(s.Fragment,{children:[m,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=d):d=t[2],d}let n,l,a;if(t[3]!==r||t[4]!==e){const m=r.filter(ce),d=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let f;t[8]!==r.length||t[9]!==e||t[10]!==p?(f=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=f):f=t[11];let g;t[12]!==f?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:f}),t[12]=f,t[13]=g):g=t[13];let x;t[14]===Symbol.for("react.memo_cache_sentinel")?(x=()=>c(!0),t[14]=x):x=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:x,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:m.map(ne)})]}):null,a=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:d.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=a}else n=t[5],l=t[6],a=t[7];let o;t[23]!==i?(o=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=o):o=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==a||t[28]!==o?(u=s.jsxs(s.Fragment,{children:[n,l,a,o]}),t[25]=n,t[26]=l,t[27]=a,t[28]=o,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(N.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:ae,children:s.jsx(v.Suspense,{fallback:s.jsx(B,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(N,{children:s.jsx(N.Content,{children:s.jsx(N.Body,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function ae(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function _e(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{_e as default};