decocms 4.91.2 → 4.91.4

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 (231) hide show
  1. package/dist/client/assets/{AlertCircle-BQ1VD_6t.js → AlertCircle-CF1-Ouso.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BiDQX2BI.js → AreaChart-C6eOWyou.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-En3_7MWg.js → ArrowUp-DsZMdHlI.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-NYJdbNYo.js → ArrowUpRight-Bxfx0mGn.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BpjJSby5.js → CheckCircle-wiCB7A1l.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-CDtylotE.js → ChevronDown-DyjAqI3m.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-P8a-QGOV.js → ChevronRight-Df2B68Ds.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-BPw1soSf.js → ChevronUp-DAExiZbv.js} +1 -1
  9. package/dist/client/assets/{Copy01-CPaH9xJH.js → Copy01-yl04KoRE.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-B6jqW59e.js → DotsVertical-bvDG8sRh.js} +1 -1
  11. package/dist/client/assets/{Eye-DsvlBean.js → Eye-BFJNvxsd.js} +1 -1
  12. package/dist/client/assets/{FilterLines-91j1zQfc.js → FilterLines-BqZk99p5.js} +1 -1
  13. package/dist/client/assets/{Globe01-CXEm8Z9S.js → Globe01-CrriuSxO.js} +1 -1
  14. package/dist/client/assets/{Globe04-DiNnXgWD.js → Globe04-DACPo7x7.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BzI64hyX.js → HardDrive-LjQciFQe.js} +1 -1
  16. package/dist/client/assets/{Image01-BoGA75jR.js → Image01-BYSIhLh2.js} +1 -1
  17. package/dist/client/assets/{Key01-Dz-Py105.js → Key01-Lzz0ThQp.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-BFUCyerF.js → LayoutLeft-fGt4B_V6.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-Bray58yW.js → LinkExternal01-BRIrxBM1.js} +1 -1
  20. package/dist/client/assets/{Monitor01-CdhgL-n0.js → Monitor01-B6UVUJyc.js} +1 -1
  21. package/dist/client/assets/{Package-DOELARAw.js → Package-CrYiuzsO.js} +1 -1
  22. package/dist/client/assets/{Palette-D9OTt4zs.js → Palette-C48f3v4Y.js} +1 -1
  23. package/dist/client/assets/{Play-Cz3CzzEB.js → Play-DIYdniDd.js} +1 -1
  24. package/dist/client/assets/{Plus-D9IhgCqF.js → Plus-DT-2W1wT.js} +1 -1
  25. package/dist/client/assets/{SearchLg-LO7tR6pZ.js → SearchLg-DTthHNBJ.js} +1 -1
  26. package/dist/client/assets/{SearchMd-Dc8ZuJP4.js → SearchMd-MXpFHXYg.js} +1 -1
  27. package/dist/client/assets/{Settings02-B5A0qG3A.js → Settings02-C1s-98Ge.js} +1 -1
  28. package/dist/client/assets/{Shield01-ssr8A3fZ.js → Shield01-DWL6KGgf.js} +1 -1
  29. package/dist/client/assets/{Star01-Cx6RvKMa.js → Star01-DwAl9-p_.js} +1 -1
  30. package/dist/client/assets/{Stars01-BgpiABvI.js → Stars01-DNB2jBIt.js} +1 -1
  31. package/dist/client/assets/{Stars02-jtRRa_Hs.js → Stars02-DcCuWVPa.js} +1 -1
  32. package/dist/client/assets/{Sun-D08z54jN.js → Sun-CF2vhsLR.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-C466IZjN.js → SwitchHorizontal01-DNrUeigm.js} +1 -1
  34. package/dist/client/assets/{Tool01-DTEy5Hpq.js → Tool01-CSRypqfM.js} +1 -1
  35. package/dist/client/assets/{Tool02-BBBas_xs.js → Tool02-CSWTlCLd.js} +1 -1
  36. package/dist/client/assets/{Trash01-DLwd5Ue9.js → Trash01-UQjosBE6.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-CYFmhjst.js → TrendUp01-Di8K_0Ub.js} +1 -1
  38. package/dist/client/assets/{Upload01-DmN7Vp-Y.js → Upload01-CnCVZJAv.js} +1 -1
  39. package/dist/client/assets/{User01-DWci-S07.js → User01-CF6pDsdw.js} +1 -1
  40. package/dist/client/assets/{Users01-Crl5FzV9.js → Users01-C_k5OJBp.js} +1 -1
  41. package/dist/client/assets/{Users03-BYlsq04g.js → Users03-DTELiT5U.js} +1 -1
  42. package/dist/client/assets/{X-Co3pcYLo.js → X-BWn3kDs2.js} +1 -1
  43. package/dist/client/assets/{XCircle-CThM4fLJ.js → XCircle-CrP1StfT.js} +1 -1
  44. package/dist/client/assets/{XClose-CgGYPsE9.js → XClose-CjGp1c1G.js} +1 -1
  45. package/dist/client/assets/{Zap-CPBr0IlW.js → Zap-BZCkBdl0.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-BrZtLChB.js → ZapSquare-C6uVpqjQ.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-StDvPD5t.js → ZoomOut-D_KRNWSe.js} +1 -1
  48. package/dist/client/assets/{access-gate-BQaPImNO.js → access-gate-7v8G4_rr.js} +1 -1
  49. package/dist/client/assets/{add-section-modal-B193qJTQ.js → add-section-modal-Cnxg2RBD.js} +1 -1
  50. package/dist/client/assets/{agent-icon-DYYNRWvj.js → agent-icon-DHXwUm9P.js} +1 -1
  51. package/dist/client/assets/{agents-list-CA9B9gNZ.js → agents-list-beV1gPOw.js} +1 -1
  52. package/dist/client/assets/{ai-providers-DUA6OWFE.js → ai-providers-D431dycR.js} +1 -1
  53. package/dist/client/assets/{alert-CyEtA2s3.js → alert-CuzEy4Gd.js} +1 -1
  54. package/dist/client/assets/{alert-dialog-XuN6iYYS.js → alert-dialog-Dp7Qz6rw.js} +1 -1
  55. package/dist/client/assets/{app-editor-B4OCF5qq.js → app-editor-DNZzH5Gm.js} +1 -1
  56. package/dist/client/assets/{auth-BuUfw6hD.js → auth-SBllEMuV.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-By0deM6v.js → auth-catchall-DnleSkVZ.js} +1 -1
  58. package/dist/client/assets/{auth-entry-EvRLe5Kk.js → auth-entry-DW4XCBMV.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-D5P617ug.js → auth-split-layout-CSqKV65d.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-CHUHFg_f.js → authenticate-and-persist-oauth-w-vDVvUb.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-BLkr2RXH.js → automation-list-row-DxqyB35q.js} +1 -1
  62. package/dist/client/assets/{automation-runs-Gm4T7iwn.js → automation-runs-jZQsMT_1.js} +1 -1
  63. package/dist/client/assets/{automations-DBN1_ODE.js → automations-B5tYNyFB.js} +1 -1
  64. package/dist/client/assets/{autosend-Cud0fjzi.js → autosend-QH589PVa.js} +1 -1
  65. package/dist/client/assets/{avatar-BANjNSaY.js → avatar-C6qQgELM.js} +1 -1
  66. package/dist/client/assets/{badge-RGskv_9Z.js → badge-CHPMmYmt.js} +1 -1
  67. package/dist/client/assets/{block-document-BpoOsfkp.js → block-document-CtQxGr4H.js} +1 -1
  68. package/dist/client/assets/{brand-context-DP6DYYtX.js → brand-context-vrotVwiu.js} +1 -1
  69. package/dist/client/assets/{buckets-rmdSOG0l.js → buckets-ClAlu9b3.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-DjA3yqmN.js → bulk-category-panel-DnZCDf5P.js} +1 -1
  71. package/dist/client/assets/{calendar-MSVpC1nD.js → calendar-DCvzWe_7.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DaPJcbc4.js → capability-load-error-BPWNkWfC.js} +1 -1
  73. package/dist/client/assets/{card-KUe_gAVz.js → card-CHkDvr9O.js} +1 -1
  74. package/dist/client/assets/{category-editor-B5Z-LSPu.js → category-editor-BpJ1RcO2.js} +1 -1
  75. package/dist/client/assets/{chat-context-BgT3NzR7.js → chat-context-CI2whHa1.js} +1 -1
  76. package/dist/client/assets/{checkbox-BF18d7s1.js → checkbox-BSEtc01G.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-BqTn8bZ9.js → cli-auth-success-Bb23pwY4.js} +1 -1
  78. package/dist/client/assets/{collection-detail-BJjZJQpM.js → collection-detail-B0Zgy7Ob.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-ClvpmXdL.js → collection-display-button-C6oMLPQY.js} +1 -1
  80. package/dist/client/assets/{collection-search-DnGhnwDb.js → collection-search-DGOwHYSB.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-BSwqQohK.js → collection-table-wrapper-dKvZq1Le.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-CGiCe3i7.js → collection-tabs-jDy30S9h.js} +1 -1
  83. package/dist/client/assets/{command-zlXLdevQ.js → command-BpX9vYDN.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-BtkESQn0.js → commerce-onboarding-DMp9zppd.js} +1 -1
  85. package/dist/client/assets/{companions-core-CIn51eK6.js → companions-core-Clem2qTA.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-Dtd9XpQW.js → connect-desktop-dialog-CJWfZbtR.js} +1 -1
  87. package/dist/client/assets/{connection-card-DEmYcviU.js → connection-card-CB_IRhs2.js} +1 -1
  88. package/dist/client/assets/{connection-detail-CesDQvRI.js → connection-detail-B6Xjo5Ql.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-CQWn_Opu.js → connection-form-helpers-5SZwR200.js} +1 -1
  90. package/dist/client/assets/{connections-CFIhg0jD.js → connections-B91jfg3e.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-j-aXhkLu.js → decopilot-sse-pool-Hh2FYfwA.js} +1 -1
  92. package/dist/client/assets/{dialog-B22XpC_l.js → dialog-TaEY2Kx_.js} +1 -1
  93. package/dist/client/assets/{domain-settings-RXn0CWG8.js → domain-settings-DYzdwum7.js} +1 -1
  94. package/dist/client/assets/{drawer-DXSFN8Vk.js → drawer-67IpHpGQ.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-DbJAUbgE.js → dropdown-menu-LEcMeufE.js} +1 -1
  96. package/dist/client/assets/{empty-state-CwJCMvQo.js → empty-state-BTjg_Aje.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-5QOO38hz.js → extract-connection-data-Q7qhs3WT.js} +1 -1
  98. package/dist/client/assets/{file-explorer-D2uXtUUp.js → file-explorer-BANMUbbn.js} +1 -1
  99. package/dist/client/assets/{file-type-icon-NOYT747a.js → file-type-icon-YUUkD6y6.js} +1 -1
  100. package/dist/client/assets/{files-Czg4lzW9.js → files-CYJC201y.js} +1 -1
  101. package/dist/client/assets/{form-Cmc0LhpP.js → form-1PRNTVHF.js} +1 -1
  102. package/dist/client/assets/{general-CO0CbIKE.js → general-BSy3MbQh.js} +1 -1
  103. package/dist/client/assets/{github-repo-picker-DmGvjwaY.js → github-repo-picker-DljOfDjQ.js} +1 -1
  104. package/dist/client/assets/{hooks-OmhbHVdq.js → hooks-DFqR8Hvs.js} +1 -1
  105. package/dist/client/assets/{index-bmiAHKON.js → index-AmzNJaB8.js} +1 -1
  106. package/dist/client/assets/{index-BO8bDt_t.js → index-B-Mwpftd.js} +1 -1
  107. package/dist/client/assets/{index-zXuWJ6Zb.js → index-BEfXtmlR.js} +1 -1
  108. package/dist/client/assets/{index-cD6cGt5z.js → index-CMc5FLjP.js} +1 -1
  109. package/dist/client/assets/{index-Bo4vj4tn.js → index-CTIkkajs.js} +1 -1
  110. package/dist/client/assets/{index-DJC1qhFK.js → index-Cq8TJSFy.js} +1 -1
  111. package/dist/client/assets/{index-CUvXw43a.js → index-CySe4zj6.js} +28 -28
  112. package/dist/client/assets/{index-CbIVN48S.js → index-D3WGUwBg.js} +1 -1
  113. package/dist/client/assets/{index-xZ8gevSD.js → index-DMy3809p.js} +2 -2
  114. package/dist/client/assets/{index-BZjb14j1.js → index-Dc6-ECoH.js} +1 -1
  115. package/dist/client/assets/{index-B2ovAPvC.js → index-DcBf7T10.js} +1 -1
  116. package/dist/client/assets/{index-BE8lWzdY.js → index-Df64NLin.js} +1 -1
  117. package/dist/client/assets/{index-BjvlXuQT.js → index-DwzbZGxY.js} +1 -1
  118. package/dist/client/assets/{index-ClpcoO6Q.js → index-VazNHrO3.js} +3 -3
  119. package/dist/client/assets/{index-redirect-BkoPn3Mx.js → index-redirect-D-Ph1F5B.js} +1 -1
  120. package/dist/client/assets/{input-Cp47skDA.js → input-BC7Dr3Si.js} +1 -1
  121. package/dist/client/assets/{integration-icon-CBaTyxd8.js → integration-icon-CHnUYdE2.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-IGI7M8XZ.js → invite-member-dialog-BCDss0Ag.js} +1 -1
  123. package/dist/client/assets/{label-Du7ujnBI.js → label-BvlvBg6i.js} +1 -1
  124. package/dist/client/assets/{layout-CE8LjaCK.js → layout-D1a-gG8D.js} +1 -1
  125. package/dist/client/assets/{login-WYQ02_OV.js → login-DKtieVJi.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-BJWUvfku.js → mcp-oauth-DCuASqM5.js} +1 -1
  127. package/dist/client/assets/{members-DWkneY87.js → members-D2hWirsM.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-DQ-IIKPz.js → monaco-editor-CYnhOzfS.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-DB0bwXi3.js → monitoring-stats-row-Dckp61zH.js} +1 -1
  130. package/dist/client/assets/{multi-select-DLHK3OMr.js → multi-select-Dqhtcm0q.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-CxPLtpSN.js → oauth-callback-3dx2KsmZ.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-B7TVVXn3.js → oauth-callback-ai-provider-CwMFtKTo.js} +1 -1
  133. package/dist/client/assets/{onboarding-CNBOV9ZN.js → onboarding-NaHufSFJ.js} +1 -1
  134. package/dist/client/assets/{org-install-BERe_bzC.js → org-install-CWxIOz3N.js} +1 -1
  135. package/dist/client/assets/{org-layout-DRpTPXZm.js → org-layout-DoB6J4nI.js} +1 -1
  136. package/dist/client/assets/{organization-choice-29knMNE7.js → organization-choice-BDeZRMou.js} +1 -1
  137. package/dist/client/assets/{orgs-CSo5tOBf.js → orgs-Dl1t3n-h.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-CvtFT6-H.js → page-seo-form-CvhgO2i7.js} +1 -1
  139. package/dist/client/assets/page-seo-sheet-D91cUBGQ.js +1 -0
  140. package/dist/client/assets/{popover-CRh8FmYc.js → popover-kRVVAZo0.js} +1 -1
  141. package/dist/client/assets/{post-editor-CxvvIc3i.js → post-editor-BgaavV-R.js} +1 -1
  142. package/dist/client/assets/{primitives-BE47TyzW.js → primitives-BjxnNwxz.js} +1 -1
  143. package/dist/client/assets/{profile-Bg8WV0aK.js → profile-CS-vUC_g.js} +1 -1
  144. package/dist/client/assets/project-app-view-CLh8fTNH.js +1 -0
  145. package/dist/client/assets/record-editor-BB2C-EZB.js +1 -0
  146. package/dist/client/assets/redirect-editor-9mgrgA0Z.js +1 -0
  147. package/dist/client/assets/registry-D1ROE5Qm.js +2 -0
  148. package/dist/client/assets/{registry-layout-mQ4jW5i2.js → registry-layout-BTIzKxjo.js} +1 -1
  149. package/dist/client/assets/{reports-Cuahs77D.js → reports-BH6X5RYl.js} +1 -1
  150. package/dist/client/assets/{require-capability-CQCfm9yJ.js → require-capability-BD4RU70c.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-B7rvjF5Z.js → required-auth-layout-D_qObw7l.js} +1 -1
  152. package/dist/client/assets/{reset-password-U5BbbIWU.js → reset-password-D7kfSNx6.js} +1 -1
  153. package/dist/client/assets/{roles-DCWnNqbE.js → roles-BWRXFovz.js} +1 -1
  154. package/dist/client/assets/{search-input-KIvM5sM8.js → search-input-D77R2Qlj.js} +1 -1
  155. package/dist/client/assets/{secrets-CfERzVYg.js → secrets-DRHUCmR6.js} +1 -1
  156. package/dist/client/assets/{sections-editor-CQLgHPe8.js → sections-editor-D4CZD-ha.js} +1 -1
  157. package/dist/client/assets/{select-jpxQ8auT.js → select-BuKjeCrb.js} +1 -1
  158. package/dist/client/assets/{select-model-CLnnqOlc.js → select-model-ByV9smVN.js} +1 -1
  159. package/dist/client/assets/{self-tool-result-Dna8s9Oo.js → self-tool-result-vB7nwgNH.js} +1 -1
  160. package/dist/client/assets/{seo-editor-DRB-XVaQ.js → seo-editor-DfN4TiKO.js} +1 -1
  161. package/dist/client/assets/{settings-layout-DvjzASgI.js → settings-layout-Bkj4VHZ3.js} +1 -1
  162. package/dist/client/assets/{settings-section-D930bDYf.js → settings-section-DN4ehJk4.js} +1 -1
  163. package/dist/client/assets/{shell-controls-B8p6VkFp.js → shell-controls-B2nL6uAe.js} +1 -1
  164. package/dist/client/assets/{shell-layout-lUlu2Gr-.js → shell-layout-Ck7st-mc.js} +1 -1
  165. package/dist/client/assets/{sidebar-CPBjqlbL.js → sidebar-BudM_B2c.js} +1 -1
  166. package/dist/client/assets/{skeleton-6V7643HY.js → skeleton-BmuNVVtD.js} +1 -1
  167. package/dist/client/assets/{sso-DpssIT3e.js → sso-BR_gYJ5g.js} +1 -1
  168. package/dist/client/assets/{store-CEzSpQqh.js → store-R-81SNCO.js} +1 -1
  169. package/dist/client/assets/store-registry-DeNKA--a.js +2 -0
  170. package/dist/client/assets/{studio-tools-B-vV1MI8.js → studio-tools-JQnAx-yt.js} +1 -1
  171. package/dist/client/assets/{switch-rEuswKCN.js → switch-IxJ12UUN.js} +1 -1
  172. package/dist/client/assets/{table-BMXKGMyk.js → table-BRS5-Ghi.js} +1 -1
  173. package/dist/client/assets/{tabs-CN2NJBwY.js → tabs-D-BkrQS_.js} +1 -1
  174. package/dist/client/assets/{textarea-BupGR0lI.js → textarea-DILcuTPp.js} +1 -1
  175. package/dist/client/assets/{toggle-group-BqLL-yXd.js → toggle-group-BJlPDeJt.js} +1 -1
  176. package/dist/client/assets/{toolbar-BUsBhnoL.js → toolbar-DPVCX4kM.js} +1 -1
  177. package/dist/client/assets/{toolbar-icon-button-B_b_NLNp.js → toolbar-icon-button-B_F-FzG4.js} +1 -1
  178. package/dist/client/assets/{tooltip-Jvhix_io.js → tooltip-plNKOrsB.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-Ca54Hv6R.js → use-ai-providers-CZ05oGju.js} +1 -1
  180. package/dist/client/assets/{use-automations-B6yUWVy9.js → use-automations-Br3sumHI.js} +1 -1
  181. package/dist/client/assets/{use-autosave-B6UsL6Wo.js → use-autosave-ALvIsg84.js} +1 -1
  182. package/dist/client/assets/{use-capability-kFJWZ1io.js → use-capability-PzwH7JXT.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-ORXC-PT-.js → use-clock-tick-BrUn8fxq.js} +1 -1
  184. package/dist/client/assets/{use-collections-bUVgy-WV.js → use-collections-Du2dq1-S.js} +1 -1
  185. package/dist/client/assets/{use-connection-sC8jE3hx.js → use-connection-DyhWyxCB.js} +1 -1
  186. package/dist/client/assets/{use-copy-BTlwdQ1G.js → use-copy-Dmy-ICQK.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-DUtdKHAi.js → use-create-virtual-mcp-DXieltJG.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-CvIn_u1j.js → use-debounced-autosave-DafilSTq.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-zAmxs5tO.js → use-debounced-value-Ky3kW6jR.js} +1 -1
  190. package/dist/client/assets/{use-deco-credits-DpOcxRDL.js → use-deco-credits-CwFgwpqm.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-DHCEkynh.js → use-decopilot-events-C0jxY0C-.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-DhX25Zla.js → use-delete-connection-DrwmEYHq.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-hr1CXWWj.js → use-deployment-admin-CqKzySYh.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-C-bcKIh3.js → use-file-configs-BSpSzmcW.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-DJXfSrrz.js → use-infinite-scroll-HqU26K5r.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-Dn-2i_ib.js → use-join-requests-Bkp1mE_c.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-C9ojbO9E.js → use-mcp-auth-status-bqW_b4Be.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-Badto8qZ.js → use-mcp-client-WisUNJdN.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-BWj2c5IO.js → use-mcp-tools-gOgcsP4u.js} +1 -1
  200. package/dist/client/assets/{use-members-AUmNujbH.js → use-members-C6oejWDG.js} +1 -1
  201. package/dist/client/assets/{use-mobile-BsG2oqso.js → use-mobile-D6QzYWiJ.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-BU1V5b8p.js → use-navigate-to-agent-DWfbKHDA.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-qqnf1Qpz.js → use-org-auth-client-tox-aigT.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-B8RAy53C.js → use-org-sso-COXxV9mp.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-BzmxCy5q.js → use-organization-roles-Ev36QIQK.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-DfeVBJuQ.js → use-organization-settings-DN87XZ2w.js} +1 -1
  207. package/dist/client/assets/{use-registry-app-CX-PN9hl.js → use-registry-app-CY_WkCby.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-EL-nDoOQ.js → use-registry-connections-CRXkMAIJ.js} +1 -1
  209. package/dist/client/assets/{use-secrets-YTJssPKP.js → use-secrets-ANIEIjB0.js} +1 -1
  210. package/dist/client/assets/{use-status-sounds-Ff1dRqh0.js → use-status-sounds-CnhlraH9.js} +1 -1
  211. package/dist/client/assets/{use-t-BXvEcdAl.js → use-t-CvXQXPPS.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-7j2UOhN4.js → use-view-mode-DwWWJ97a.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-O2f-Xdwi.js → use-virtual-mcp-Bf2VrYbg.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-B1xeWAsJ.js +1 -0
  215. package/dist/client/assets/{useRouterState-HMsc6NBo.js → useRouterState-Cin9t5kL.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-CoSrihVf.js +1 -0
  217. package/dist/client/assets/{users-LCRz-TtG.js → users-C3TOmS20.js} +1 -1
  218. package/dist/client/assets/{variant-calendar-CagOJF-_.js → variant-calendar-BJlmAPbT.js} +1 -1
  219. package/dist/client/assets/{view-mode-toggle-BoRUJzKz.js → view-mode-toggle-BjgWJl0k.js} +1 -1
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +369 -369
  222. package/dist/server/server.js +262 -262
  223. package/package.json +1 -1
  224. package/dist/client/assets/page-seo-sheet-DUM3ur6-.js +0 -1
  225. package/dist/client/assets/project-app-view-BJcpK7cl.js +0 -1
  226. package/dist/client/assets/record-editor-DY9uctDw.js +0 -1
  227. package/dist/client/assets/redirect-editor-BFjqUWeS.js +0 -1
  228. package/dist/client/assets/registry-dWCQnCtL.js +0 -2
  229. package/dist/client/assets/store-registry-Dq6xssN4.js +0 -2
  230. package/dist/client/assets/useInfiniteQuery-BdfCFibj.js +0 -1
  231. package/dist/client/assets/useSuspenseInfiniteQuery-B-Ypf-Ut.js +0 -1
@@ -1 +1 @@
1
- import{c as p,j as m}from"./index-ClpcoO6Q.js";import{u as l}from"./use-capability-kFJWZ1io.js";import{A as u}from"./access-gate-BQaPImNO.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
1
+ import{c as p,j as m}from"./index-VazNHrO3.js";import{u as l}from"./use-capability-PzwH7JXT.js";import{A as u}from"./access-gate-7v8G4_rr.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
@@ -1 +1 @@
1
- import{c as l,j as s,A as a,S as m,f as h,h as u,N as f}from"./index-ClpcoO6Q.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(f,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function g(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{g as R};
1
+ import{c as l,j as s,A as a,S as m,f as h,h as u,N as f}from"./index-VazNHrO3.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(f,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function g(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{g as R};
@@ -1 +1 @@
1
- import{c as q,u as Y,b as A,r as B,d as G,j as s,B as z,a as K}from"./index-ClpcoO6Q.js";import{I as L}from"./input-Cp47skDA.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let g;e[22]!==a||e[23]!==t?(g=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=g):g=e[24];let f;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(f=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=f):f=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==g||e[42]!==f||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,g,f,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=g,e[42]=f,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
1
+ import{c as q,u as Y,b as A,r as B,d as G,j as s,B as z,a as K}from"./index-VazNHrO3.js";import{I as L}from"./input-BC7Dr3Si.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let g;e[22]!==a||e[23]!==t?(g=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=g):g=e[24];let f;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(f=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=f):f=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==g||e[42]!==f||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,g,f,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=g,e[42]=f,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
@@ -1 +1 @@
1
- import{r as K,C as Be,K as de,b4 as Ot,m as Fe,j as s,l as Z,i as je,B as ae,c as X,H as Je,ad as Ue,I as re,af as Xe,ag as et,n as rt,M as jt,J as vt,d as at,t as ve,p as Ke,w as ct,x as Mt,E as Dt,b as yt,u as wt}from"./index-ClpcoO6Q.js";import{u as Pt}from"./use-organization-roles-BzmxCy5q.js";import{u as $e}from"./use-org-auth-client-qqnf1Qpz.js";import{u as ie}from"./use-t-BXvEcdAl.js";import{g as dt,a as Lt}from"./role-color-Dn2tXDDF.js";import{B as Me}from"./badge-RGskv_9Z.js";import{f as mt,a as ut,c as ft,d as gt,b as ht,A as xt,g as pt,e as Tt}from"./alert-dialog-XuN6iYYS.js";import{D as kt,a as Gt,c as Ut,d as Bt}from"./dropdown-menu-DbJAUbgE.js";import{i as Vt}from"./DotsVertical-B6jqW59e.js";import{s as Ye}from"./Plus-D9IhgCqF.js";import{s as zt}from"./Trash01-DLwd5Ue9.js";import{C as Yt}from"./collection-table-wrapper-BSwqQohK.js";import{P as ne}from"./index-CbIVN48S.js";import{E as tt}from"./empty-state-CwJCMvQo.js";import{S as Qe}from"./search-input-KIvM5sM8.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as He}from"./integration-icon-CBaTyxd8.js";import{u as Ft}from"./use-infinite-scroll-DJXfSrrz.js";import{C as qe}from"./checkbox-BF18d7s1.js";import{b as Kt}from"./Settings02-B5A0qG3A.js";import{u as $t}from"./useSuspenseInfiniteQuery-B-Ypf-Ut.js";import{u as Qt,S as Ht}from"./use-mcp-client-Badto8qZ.js";import{C as qt}from"./collection-search-DnGhnwDb.js";import{u as _t}from"./use-members-AUmNujbH.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-sC8jE3hx.js";import{u as Wt,c as Jt}from"./use-ai-providers-Ca54Hv6R.js";import{A as bt}from"./avatar-BANjNSaY.js";import{S as De}from"./switch-rEuswKCN.js";import{c as ye,b as we,T as Pe,a as Le}from"./tooltip-Jvhix_io.js";import{S as st,a as lt,b as ot}from"./settings-section-D930bDYf.js";import{t as Xt}from"./ChevronDown-CDtylotE.js";import{i as es}from"./ChevronRight-P8a-QGOV.js";import{i as nt}from"./X-Co3pcYLo.js";import{a as ts}from"./use-capability-kFJWZ1io.js";import{A as ss}from"./access-gate-BQaPImNO.js";import"./ChevronUp-BPw1soSf.js";import"./table-BMXKGMyk.js";import"./ArrowUp-En3_7MWg.js";import"./sidebar-CPBjqlbL.js";import"./LayoutLeft-BFUCyerF.js";import"./use-mobile-BsG2oqso.js";import"./SearchMd-Dc8ZuJP4.js";import"./Tool02-BBBas_xs.js";import"./agent-icon-DYYNRWvj.js";import"./AlertCircle-BQ1VD_6t.js";import"./Tool01-DTEy5Hpq.js";import"./XCircle-CThM4fLJ.js";import"./ArrowUpRight-NYJdbNYo.js";import"./TrendUp01-CYFmhjst.js";import"./ZapSquare-BrZtLChB.js";import"./ZoomOut-StDvPD5t.js";import"./Users03-BYlsq04g.js";import"./CheckCircle-BpjJSby5.js";import"./Stars02-jtRRa_Hs.js";import"./Copy01-CPaH9xJH.js";import"./Globe01-CXEm8Z9S.js";import"./Eye-DsvlBean.js";import"./FilterLines-91j1zQfc.js";import"./Star01-Cx6RvKMa.js";import"./Globe04-DiNnXgWD.js";import"./SwitchHorizontal01-C466IZjN.js";import"./HardDrive-BzI64hyX.js";import"./Image01-BoGA75jR.js";import"./Key01-Dz-Py105.js";import"./LinkExternal01-Bray58yW.js";import"./Monitor01-CdhgL-n0.js";import"./Sun-D08z54jN.js";import"./Package-DOELARAw.js";import"./Palette-D9OTt4zs.js";import"./Play-Cz3CzzEB.js";import"./SearchLg-LO7tR6pZ.js";import"./Shield01-ssr8A3fZ.js";import"./Stars01-BgpiABvI.js";import"./Upload01-DmN7Vp-Y.js";import"./User01-DWci-S07.js";import"./Users01-Crl5FzV9.js";import"./XClose-CgGYPsE9.js";import"./Zap-CPBr0IlW.js";import"./auth-BuUfw6hD.js";import"./use-collections-bUVgy-WV.js";import"./studio-tools-B-vV1MI8.js";import"./card-KUe_gAVz.js";import"./capability-load-error-DaPJcbc4.js";const Ze="basic-usage",We=[{id:Ze,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","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{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"]},{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_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_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",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{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"]},{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}];[...We.find(t=>t.id===Ze)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(We.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of We){if(e.id===Ze)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 ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const r=new Set(e);for(const o of t.tools)r.add(o);return Array.from(r)}const n=new Set(e);for(const r of t.tools)n.delete(r);return Array.from(n)}function rs(t){const e=X.c(21),{connection:l,isSelected:n,hasToolsEnabled:r,activeToolsCount:o,totalToolsCount:c,onSelect:x,onToggle:m}=t,f=n?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==f?(g=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",f),e[0]=f,e[1]=g):g=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(He,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=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]=u):u=e[6];let h;e[7]!==x||e[8]!==a||e[9]!==u?(h=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:x,children:[a,u]}),e[7]=x,e[8]=a,e[9]=u,e[10]=h):h=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==r||e[14]!==m||e[15]!==c?(d=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(qe,{checked:r,onCheckedChange:m,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=r,e[14]=m,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==g||e[18]!==h||e[19]!==d?(p=s.jsxs("div",{className:g,children:[h,d]}),e[17]=g,e[18]=h,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=X.c(18),{connectionId:l,tool:n,isSelected:r,onToggle:o}=t,c=`tool-${l}-${n.name}`,x=r?"text-foreground":"text-muted-foreground";let m;e[0]!==x?(m=Z("text-sm font-medium",x),e[0]=x,e[1]=m):m=e[1];let f;e[2]!==m||e[3]!==n.name?(f=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:n.name})}),e[2]=m,e[3]=n.name,e[4]=f):f=e[4];let g;e[5]!==n.description?(g=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=g):g=e[6];let a;e[7]!==f||e[8]!==g?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[7]=f,e[8]=g,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let h;e[10]!==r||e[11]!==o||e[12]!==u?(h=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(qe,{id:u,checked:r,onCheckedChange:o,onClick:ds})}),e[10]=r,e[11]=o,e[12]=u,e[13]=h):h=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==h?(d=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,h]}),e[14]=c,e[15]=a,e[16]=h,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const[r,o]=K.useState(""),c=n!==void 0?n:r,x=K.useDeferredValue(c),[m,f]=K.useState("all"),[g,a]=K.useState(!1),u=K.useRef(new Set(Object.keys(t))),{org:h}=Be(),d=Qt({connectionId:Ht,orgId:h.id,orgSlug:h.slug}),p=100,S=x.trim(),R=S?{operator:"or",conditions:[{field:["title"],operator:"contains",value:S},{field:["description"],operator:"contains",value:S}]}:void 0,_=!!l,A={...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:p,offset:0,..._&&{include_virtual:!0}},N=JSON.stringify(A),{data:D,fetchNextPage:b,hasNextPage:O,isFetchingNextPage:v}=$t({queryKey:de.collectionListInfinite(d,h.id,"","CONNECTIONS",N),queryFn:async({pageParam:T=0})=>(await d.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:p,offset:T,..._&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,M)=>{if(T?.hasMore)return M.reduce((H,Q)=>H+(Q?.items?.length??0),0)},staleTime:3e4}),E=D?.pages.flatMap(T=>T?.items??[])??[],C=Ft(b,O??!1,v),y=l?E.filter(T=>T.connection_type!=="VIRTUAL"?!0:Ot(T.connection_url)!==l):E,i=u.current,I=[...i.values()].map(T=>y.find(M=>M.id===T)).filter(T=>T!==void 0),B=y.filter(T=>!i.has(T.id)),L=[...I,...B],Y=T=>{const M=t[T];return M!==void 0&&M.length>0},w=L.filter(T=>{if(m==="all")return!0;const M=Y(T.id);return m==="selected"?M:m==="unselected"?!M:!0}),[U,z]=K.useState(L[0]?.id??null),k=U?L.find(T=>T.id===U)??null:null,{data:$,isFetching:V}=Fe({queryKey:de.collectionItem(d,h.id,"","CONNECTIONS",U??""),queryFn:async()=>U?(await d.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:U}})).structuredContent?.item??null:null,enabled:!!U,staleTime:3e4}),G=$?.tools??[],q=(T,M)=>t[T]?.includes(M)??!1,W=(T,M)=>{const H=t[T]??[],Q=H.includes(M),J={...t};if(Q){const oe=H.filter(le=>le!==M);oe.length===0?delete J[T]:J[T]=oe}else J[T]=[...H,M];e(J)},te=T=>{const M=T===U?G:[];if(!M.length)return;const H=t[T]??[],Q=M.map(le=>le.name),J=H.length>0&&Q.every(le=>H.includes(le)),oe={...t};J?delete oe[T]:(oe[T]=Q,z(T)),e(oe)},se=T=>{z(T),a(!0)},F=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",g&&"hidden md:flex"),children:[n===void 0&&s.jsx(qt,{value:r,onChange:o,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>f("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>f("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:c?"No connections found":m==="selected"?"No servers selected":m==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[w.map(T=>{const M=U===T.id,H=M?G.length:0,Q=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:M?G:T.tools},isSelected:M,hasToolsEnabled:Y(T.id),activeToolsCount:Q,totalToolsCount:H,onSelect:()=>se(T.id),onToggle:()=>te(T.id)},T.id)}),s.jsx("div",{ref:C,className:"h-4"}),v&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",g?"flex":"hidden md:flex"),children:k?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:F,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Kt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(He,{icon:k.icon,name:k.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:k.title}),k.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:k.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:V?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})}):G.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:G.map(T=>s.jsx(cs,{connectionId:k.id,tool:T,isSelected:q(k.id,T.name),onToggle:()=>W(k.id,T.name)},T.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:"Select a connection to view its tools"})})})]})}const us=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:et(),staticPermissions:Ue(re()),toolSet:Xe(re(),Ue(re())),allowAllModels:et(),modelSet:Xe(re(),Ue(re())),memberIds:Ue(re())});function it(t,e,l){const n=ie(),r=s.jsx(De,{checked:t,disabled:e,onCheckedChange:l});return e?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:r})}),s.jsx(Le,{children:s.jsx("p",{children:n("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):r}function fs(t){const e=X.c(40),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:r,onPermissionsChange:o,readOnly:c,searchQuery:x}=t,m=c===void 0?!1:c,f=ie();let g;e[0]!==x?(g=x.trim().toLowerCase(),e[0]=x,e[1]=g):g=e[1];const a=K.useDeferredValue(g);let u;if(e[2]!==l||e[3]!==a||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==x||e[8]!==n||e[9]!==f){const h=os(),d=(E,C)=>{if(!m){if(l&&C){const y=h.flatMap(xs).flatMap(hs);r(!1),o(y.filter(i=>!E.tools.includes(i)));return}l||o(is(E,n,!C))}};let p;e[11]!==a?(p=E=>{const{section:C,capabilities:y}=E;return{section:C,capabilities:y.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const S=h.map(p).filter(gs);let R;e[13]!==f?(R=f("settings.orgRoleDetail.general"),e[13]=f,e[14]=R):R=e[14];let _;e[15]!==f?(_=f("settings.orgRoleDetail.allOrgPermissions"),e[15]=f,e[16]=_):_=e[16];let A;e[17]!==f?(A=f("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=f,e[18]=A):A=e[18];let N;e[19]!==l||e[20]!==r||e[21]!==o?(N=()=>{r(!l),o([])},e[19]=l,e[20]=r,e[21]=o,e[22]=N):N=e[22];let D;e[23]!==l||e[24]!==m||e[25]!==N?(D=it(l,m,N),e[23]=l,e[24]=m,e[25]=N,e[26]=D):D=e[26];let b;e[27]!==l||e[28]!==r||e[29]!==o||e[30]!==m?(b=m?void 0:()=>{r(!l),o([])},e[27]=l,e[28]=r,e[29]=o,e[30]=m,e[31]=b):b=e[31];let O;e[32]!==b||e[33]!==_||e[34]!==A||e[35]!==D?(O=s.jsx(lt,{children:s.jsx(ot,{title:_,description:A,action:D,onClick:b})}),e[32]=b,e[33]=_,e[34]=A,e[35]=D,e[36]=O):O=e[36];let v;e[37]!==O||e[38]!==R?(v=s.jsx(st,{title:R,children:O}),e[37]=O,e[38]=R,e[39]=v):v=e[39],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[v,S.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:f("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:x})}):S.map(E=>{const{section:C,capabilities:y}=E;return s.jsx(st,{title:C,children:s.jsx(lt,{children:y.map(i=>{const I=ns(i,n,l);return s.jsx(ot,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(Mt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:it(I,m,()=>d(i,I)),onClick:m?void 0:()=>d(i,I)},i.id)})})},C)})]})}),e[2]=l,e[3]=a,e[4]=r,e[5]=o,e[6]=m,e[7]=x,e[8]=n,e[9]=f,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={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 Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Es(t){return ps[t]??Nt[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function _s(t){const e=X.c(40),{connectionId:l,subProviderId:n,subProviderName:r,groupLogo:o,models:c,allConnectionModelIds:x,selectedModels:m,allowAllModels:f,allConnectionModelsSelected:g,onToggleModel:a,onExitAllowAll:u,readOnly:h,defaultExpanded:d}=t,p=ie(),[S,R]=K.useState(d),_=d||S,A=R,[N,D]=K.useState(Ct);let b;e[0]!==g||e[1]!==f||e[2]!==m?(b=E=>f||g||m.includes("*")||m.includes(E),e[0]=g,e[1]=f,e[2]=m,e[3]=b):b=e[3];const O=b;let v;if(e[4]!==x||e[5]!==f||e[6]!==l||e[7]!==_||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==h||e[14]!==n||e[15]!==r||e[16]!==p||e[17]!==N){let E;e[19]!==O?(E=G=>O(G.id),e[19]=O,e[20]=E):E=e[20];const C=c.filter(E).length,y=c.slice(0,N),i=c.length>N;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>A(Cs),e[21]=I):I=e[21];const B=o??Et[n]??It;let L;e[22]!==r||e[23]!==B?(L=s.jsx(He,{icon:B,name:r,size:"sm"}),e[22]=r,e[23]=B,e[24]=L):L=e[24];let Y;e[25]!==r?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:r}),e[25]=r,e[26]=Y):Y=e[26];let w;e[27]!==L||e[28]!==Y?(w=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[L,Y]}),e[27]=L,e[28]=Y,e[29]=w):w=e[29];const U=p("settings.orgRoleDetail.enabledCount",{enabledCount:C,total:c.length});let z;e[30]!==U?(z=s.jsx(Me,{variant:"secondary",className:"text-xs text-muted-foreground",children:U}),e[30]=U,e[31]=z):z=e[31];let k;e[32]!==_?(k=_?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=_,e[33]=k):k=e[33];let $;e[34]!==z||e[35]!==k?($=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[z,k]}),e[34]=z,e[35]=k,e[36]=$):$=e[36];let V;e[37]!==$||e[38]!==w?(V=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:I,children:[w,$]}),e[37]=$,e[38]=w,e[39]=V):V=e[39],v=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[V,_&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[y.map(G=>{const q=O(G.id),W=()=>{if(!h){if(f){u(l,x,G.id);return}a(l,G.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!h&&"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:G.title})}),s.jsx("div",{onClick:Ns,children:h?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:q,disabled:!0,onCheckedChange:bs})})}),s.jsx(Le,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:q,onCheckedChange:W})})]},G.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(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=x,e[5]=f,e[6]=l,e[7]=_,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=h,e[14]=n,e[15]=r,e[16]=p,e[17]=N,e[18]=v}else v=e[18];return v}function Rs(t){return t+Ct}function bs(){}function Ns(t){return t.stopPropagation()}function Cs(t){return!t}function Ss(t){const e=X.c(33),{connection:l,selectedModels:n,allowAllModels:r,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:x,searchQuery:m,readOnly:f}=t,g=Jt(l.id);let a,u,h,d,p;if(e[0]!==x||e[1]!==r||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==g||e[8]!==f||e[9]!==m||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let _;e[16]!==l.label?(_=I=>({...I,id:I.modelId,provider:l.label}),e[16]=l.label,e[17]=_):_=e[17];const A=g.filter(vs).map(_),N=m.trim().toLowerCase(),D=N?A.filter(I=>I.title.toLowerCase().includes(N)||I.id.toLowerCase().includes(N)||I.provider?.toLowerCase().includes(N)):A;if(D.length===0){p=null;break e}const b=new Map;for(const I of D){const B=Ts(I.id,l.providerId),L=b.get(B)??{models:[],logo:null};L.models.push({id:I.id,title:Is(I.title),logo:I.logo}),!L.logo&&I.logo&&(L.logo=I.logo),b.set(B,L)}const O=Array.from(b.entries()).map(js).sort(Os),v=O.length===1||N.length>0;h="flex flex-col gap-3";const E=Et[l.providerId]??It;let C;e[18]!==l.providerId||e[19]!==E?(C=s.jsx("img",{src:E,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,e[20]=C):C=e[20];const y=Nt[l.providerId]??l.providerId;let i;e[21]!==y?(i=s.jsx("h4",{className:"text-sm font-medium",children:y}),e[21]=y,e[22]=i):i=e[22],e[23]!==i||e[24]!==C?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[C,i]}),e[23]=i,e[24]=C,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(I=>s.jsx(_s,{connectionId:l.id,subProviderId:I.id,subProviderName:I.name,groupLogo:I.logo,models:I.models,allConnectionModelIds:A.map(As),selectedModels:n,allowAllModels:r,allConnectionModelsSelected:x,onToggleModel:o,onExitAllowAll:c,readOnly:f,defaultExpanded:v},I.id))}e[0]=x,e[1]=r,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=g,e[8]=f,e[9]=m,e[10]=n,e[11]=a,e[12]=u,e[13]=h,e[14]=d,e[15]=p}else a=e[11],u=e[12],h=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let S;e[26]!==a||e[27]!==u?(S=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=S):S=e[28];let R;return e[29]!==h||e[30]!==d||e[31]!==S?(R=s.jsxs("div",{className:h,children:[d,S]}),e[29]=h,e[30]=d,e[31]=S,e[32]=R):R=e[32],R}function As(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function vs(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:r,onModelSetChange:o,readOnly:c,searchQuery:x}=t,m=c===void 0?!1:c,f=ie(),g=K.useDeferredValue(x),a=Wt();let u;e[0]!==n||e[1]!==o?(u=(E,C)=>{const y=n[E]??[],i={...n};if(y.includes(C)){const I=y.filter(B=>B!==C);I.length===0?delete i[E]:i[E]=I}else i[E]=[...y,C];o(i)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const h=u;let d;e[3]!==n||e[4]!==r||e[5]!==o?(d=(E,C,y)=>{r(!1),o({...n,[E]:C.filter(i=>i!==y)})},e[3]=n,e[4]=r,e[5]=o,e[6]=d):d=e[6];const p=d,S=!m&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==S?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=R):R=e[8];let _;e[9]!==l||e[10]!==r||e[11]!==o||e[12]!==m?(_=()=>{if(m)return;const E=!l;r(E),E&&o({})},e[9]=l,e[10]=r,e[11]=o,e[12]=m,e[13]=_):_=e[13];let A;e[14]!==f?(A=f("settings.orgRoleDetail.allModels"),e[14]=f,e[15]=A):A=e[15];let N;e[16]!==A?(N=s.jsx("span",{className:"text-sm font-medium",children:A}),e[16]=A,e[17]=N):N=e[17];let D;e[18]!==l||e[19]!==r||e[20]!==o||e[21]!==m||e[22]!==f?(D=s.jsx("div",{onClick:ys,children:m?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{children:s.jsx("p",{children:f("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:l,onCheckedChange:E=>{r(E),E&&o({})}})}),e[18]=l,e[19]=r,e[20]=o,e[21]=m,e[22]=f,e[23]=D):D=e[23];let b;e[24]!==R||e[25]!==_||e[26]!==N||e[27]!==D?(b=s.jsxs("div",{className:R,onClick:_,children:[N,D]}),e[24]=R,e[25]=_,e[26]=N,e[27]=D,e[28]=b):b=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==g||e[32]!==p||e[33]!==n||e[34]!==m||e[35]!==f||e[36]!==h?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:f("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(E=>s.jsx(K.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 animate-spin"}),f("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ss,{connection:E,selectedModels:n[E.id]??[],allowAllModels:l,onToggleModel:h,onExitAllowAll:p,allConnectionModelsSelected:(n[E.id]??[]).includes("*"),searchQuery:g,readOnly:m})},E.id)),e[29]=a,e[30]=l,e[31]=g,e[32]=p,e[33]=n,e[34]=m,e[35]=f,e[36]=h,e[37]=O):O=e[37];let v;return e[38]!==b||e[39]!==O?(v=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[b,O]}),e[38]=b,e[39]=O,e[40]=v):v=e[40],v}function Ds(){}function ys(t){return t.stopPropagation()}function ws(t){const e=X.c(75),{open:l,onOpenChange:n,selectedMemberIds:r,onAddMembers:o}=t,c=ie(),[x,m]=K.useState(""),f=K.useDeferredValue(x);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[a,u]=K.useState(g),{data:h}=_t();let d,p,S,R,_,A,N,D,b,O,v;if(e[1]!==h?.data?.members||e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==x||e[8]!==r||e[9]!==c){const z=h?.data?.members??[];let k;e[21]!==f?(k=F=>{const T=f.toLowerCase();return F.user?.name?.toLowerCase().includes(T)||F.user?.email?.toLowerCase().includes(T)},e[21]=f,e[22]=k):k=e[22];const $=z.filter(k);let V;e[23]!==o||e[24]!==n||e[25]!==a?(V=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=V):V=e[26],S=V,p=mt,O=l,v=n,d=ut,D="sm:max-w-md p-0";let G;e[27]!==c?(G=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=G):G=e[28];let q;e[29]!==G?(q=s.jsx(ft,{children:G}),e[29]=G,e[30]=q):q=e[30];let W;e[31]!==c?(W=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(gt,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==q||e[36]!==te?(b=s.jsxs(ht,{className:"px-6 pt-6",children:[q,te]}),e[35]=q,e[36]=te,e[37]=b):b=e[37],A="flex flex-col h-80";let se;e[38]!==c?(se=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=se):se=e[39],e[40]!==x||e[41]!==se?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:x,onChange:m,placeholder:se,className:"w-full"})}),e[40]=x,e[41]=se,e[42]=N):N=e[42],R="flex-1 overflow-auto",_=$.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(x?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:$.map(F=>{const T=F.role!=="owner",M=r.includes(F.id),H=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!T||M?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(qe,{checked:H||M,onCheckedChange:()=>{!T||M||u(Q=>Q.includes(F.id)?Q.filter(J=>J!==F.id):[...Q,F.id])},disabled:!T||M}),s.jsx(bt,{url:F.user?.image??void 0,fallback:Rt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!T&&s.jsx(Me,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),M&&T&&s.jsx(Me,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=h?.data?.members,e[2]=f,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=x,e[8]=r,e[9]=c,e[10]=d,e[11]=p,e[12]=S,e[13]=R,e[14]=_,e[15]=A,e[16]=N,e[17]=D,e[18]=b,e[19]=O,e[20]=v}else d=e[10],p=e[11],S=e[12],R=e[13],_=e[14],A=e[15],N=e[16],D=e[17],b=e[18],O=e[19],v=e[20];let E;e[43]!==R||e[44]!==_?(E=s.jsx("div",{className:R,children:_}),e[43]=R,e[44]=_,e[45]=E):E=e[45];let C;e[46]!==E||e[47]!==A||e[48]!==N?(C=s.jsxs("div",{className:A,children:[N,E]}),e[46]=E,e[47]=A,e[48]=N,e[49]=C):C=e[49];let y;e[50]!==c?(y=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=y):y=e[51];let i;e[52]!==y?(i=s.jsx(xt,{children:y}),e[52]=y,e[53]=i):i=e[53];const I=a.length===0;let B;e[54]!==a.length||e[55]!==c?(B=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=B):B=e[56];let L;e[57]!==S||e[58]!==I||e[59]!==B?(L=s.jsx(pt,{onClick:S,disabled:I,children:B}),e[57]=S,e[58]=I,e[59]=B,e[60]=L):L=e[60];let Y;e[61]!==i||e[62]!==L?(Y=s.jsxs(Tt,{className:"px-6 pb-6",children:[i,L]}),e[61]=i,e[62]=L,e[63]=Y):Y=e[63];let w;e[64]!==d||e[65]!==C||e[66]!==Y||e[67]!==D||e[68]!==b?(w=s.jsxs(d,{className:D,children:[b,C,Y]}),e[64]=d,e[65]=C,e[66]=Y,e[67]=D,e[68]=b,e[69]=w):w=e[69];let U;return e[70]!==p||e[71]!==w||e[72]!==O||e[73]!==v?(U=s.jsx(p,{open:O,onOpenChange:v,children:w}),e[70]=p,e[71]=w,e[72]=O,e[73]=v,e[74]=U):U=e[74],U}function Ps(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:r,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:x,onAddMemberDialogOpenChange:m}=t,f=r===void 0?!1:r,g=o===void 0?void 0:o,a=ie(),u=K.useDeferredValue(c),{data:h}=_t();let d,p,S;if(e[0]!==h?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==f||e[5]!==g||e[6]!==c||e[7]!==a){const D=h?.data?.members??[];let b;e[11]!==l?(b=i=>l.includes(i.id),e[11]=l,e[12]=b):b=e[12];const O=D.filter(b);let v;e[13]!==u?(v=i=>{const I=u.toLowerCase();return i.user?.name?.toLowerCase().includes(I)||i.user?.email?.toLowerCase().includes(I)},e[13]=u,e[14]=v):v=e[14];const E=O.filter(v);let C;e[15]!==g||e[16]!==a?(C=g??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=a,e[17]=C):C=e[17];const y=C;S="flex flex-col h-full",d="flex-1 overflow-auto",p=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:E.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(bt,{url:i.user?.image??void 0,fallback:Rt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),f?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(nt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:y})})]})}):s.jsx(ae,{variant:"ghost",size:"sm",onClick:()=>n(l.filter(I=>I!==i.id)),children:s.jsx(nt,{size:16})})]},i.id))}),e[0]=h?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=f,e[5]=g,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=S}else d=e[8],p=e[9],S=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let _;e[21]!==l||e[22]!==n?(_=D=>n([...l,...D]),e[21]=l,e[22]=n,e[23]=_):_=e[23];let A;e[24]!==x||e[25]!==l||e[26]!==m||e[27]!==_?(A=s.jsx(ws,{open:x,onOpenChange:m,selectedMemberIds:l,onAddMembers:_}),e[24]=x,e[25]=l,e[26]=m,e[27]=_,e[28]=A):A=e[28];let N;return e[29]!==S||e[30]!==R||e[31]!==A?(N=s.jsxs("div",{className:S,children:[R,A]}),e[29]=S,e[30]=R,e[31]=A,e[32]=N):N=e[32],N}function Ls(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(K.Suspense,{fallback:l,children:s.jsx(Ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const ks={owner:[],admin:[],user:[]};function Gs(t,e,l,n){const r=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:r,staticPermissions:ks[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},r=n.self||[],o=r.includes("*"),c=o?[]:r.filter(a=>a!=="*"),x={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const h of l)x[h.id]=u.includes("*")?h.tools?.map(d=>d.name)??[]:u;else{const h=l.find(d=>d.id===a);h&&(x[a]=u.includes("*")?h.tools?.map(d=>d.name)??[]:u)}const m=n.models||[],f=m.length===0||m.includes("*:*"),g={};if(!f)for(const a of m){const u=a.indexOf(":");if(u===-1)continue;const h=a.slice(0,u),d=a.slice(u+1);g[h]||(g[h]=[]),g[h].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:x,allowAllModels:f,modelSet:g,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,r]of Object.entries(t.toolSet))if(r.length>0){const c=e.find(x=>x.id===n)?.tools?.map(x=>x.name)??[];l[n]=c.length>0&&c.every(x=>r.includes(x))?["*"]:r}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[r,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${r}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function zs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:n,onOpen:r}=t,o=n===void 0?void 0:n,c=ie();let x;e[0]!==o||e[1]!==c?(x=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=x):x=e[2];const m=x;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ye,{size:16}),e[3]=u):u=e[3];let h;e[4]!==c?(h=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=h):h=e[5];let d;e[6]!==h?(d=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[u,h]})})}),e[6]=h,e[7]=d):d=e[7];let p;e[8]!==m?(p=s.jsx(Le,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=p):p=e[9];let S;return e[10]!==d||e[11]!==p?(S=s.jsx(ye,{children:s.jsxs(we,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=S):S=e[12],S}let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ye,{size:16}),e[13]=f):f=e[13];let g;e[14]!==c?(g=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=g):g=e[15];let a;return e[16]!==r||e[17]!==g?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:r,children:[f,g]}),e[16]=r,e[17]=g,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Be(),n=$e(),r=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let x;e[4]!==o||e[5]!==c?(x={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=x):x=e[6];const{data:m,isPending:f}=Fe(x);if(f||!r){let h;return e[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=h):h=e[7],h}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const a=g;let u;return e[10]!==r||e[11]!==a||e[12]!==t?(u=s.jsx(Fs,{...t,members:a,connections:r}),e[10]=r,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Fs({target:t,onBack:e,onSaved:l,members:n,connections:r}){const o=ie(),{locator:c}=Be(),x=$e(),m=rt(),f=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,h]=K.useState(f?"org":"mcp"),d=jt({resolver:vt(us),defaultValues:Vs(t,n,r)}),p=d.formState.isValid,S=d.formState.isDirty,R=at({mutationFn:async i=>{const I=Bs(i,r),B=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),L=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(w,U)=>{const z=n.filter(V=>V.role===(U??w)).map(V=>V.id),k=i.memberIds.filter(V=>!z.includes(V)),$=z.filter(V=>!i.memberIds.includes(V));for(const V of k){const G=await x.organization.updateMemberRole({memberId:V,role:[w]});if(G?.error)throw new Error(G.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const V of $){const G=await x.organization.updateMemberRole({memberId:V,role:["user"]});if(G?.error)throw new Error(G.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(L)return await Y(i.role.slug),i;if(i.role.id){const w=i.role.label.toLowerCase().replace(/\s+/g,"-"),U=i.role.slug,z=w!==U,k=await x.organization.updateRole({roleId:i.role.id,data:{permission:I,...z?{roleName:w}:{}}});if(k?.error)throw new Error(k.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(z?w:U,z?U:void 0),z?{...i,role:{...i.role,slug:w}}:i}else{const w=await x.organization.createRole({role:B,permission:I});if(w?.error)throw new Error(w.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const U of i.memberIds){const z=await x.organization.updateMemberRole({memberId:U,role:[B]});if(z?.error)throw new Error(z.error.message)}return{...i,role:{...i.role,id:w.data?.roleData?.id,slug:B}}}},onSuccess:(i,I)=>{m.invalidateQueries({queryKey:de.members(c)}),m.invalidateQueries({queryKey:de.organizationRoles(c)});const B=!I.role.id&&!I.role.slug,L=I.role.slug==="owner"&&!I.role.id;Ke(L?"role_members_updated":B?"role_created":"role_updated",{role_slug:I.role.slug??null}),ve.success(o(L?"settings.orgRoleDetail.membersUpdatedSuccessfully":B?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(i),l(i.role.id)},onError:i=>{ve.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),_=d.handleSubmit(i=>{if(!i.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(i)}),A=!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:"members",label:o("settings.orgRoleDetail.members")}],[b,O]=K.useState(""),[v,E]=K.useState(!1),C=i=>{h(i),O("")},y={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ne,{children:s.jsxs(ne.Content,{className:Z("flex flex-col",u!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ne.Title,{actions:A&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:_,disabled:R.isPending||!p||!S,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?dt(t.role,!0):Lt(d.watch("role.label")))}),g&&s.jsx(ct,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:D.map(i=>s.jsx("button",{type:"button",onClick:()=>C(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===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:b,onChange:O,placeholder:y[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(zs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>E(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!g&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:i=>d.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:b}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:i=>d.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>d.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:b}),u==="models"&&s.jsx(Ms,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:i=>d.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>d.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:b}),u==="members"&&s.jsx(Ls,{memberIds:d.watch("memberIds"),onMemberIdsChange:i=>d.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:b,addMemberDialogOpen:v,onAddMemberDialogOpenChange:E})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=X.c(6),{area:l,children:n}=t,{isPrivileged:r,loading:o,error:c}=ts();let x;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==r||e[4]!==o?(x=s.jsx(ss,{granted:r,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=r,e[4]=o,e[5]=x):x=e[5],x}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Hs(){const t=X.c(135),e=ie(),[l,n]=K.useState(""),[r,o]=K.useState(null),c=yt();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x={strict:!1},t[0]=x):x=t[0];const{role:m}=wt(x),{locator:f}=Be(),g=$e(),a=rt(),{customRoles:u,refetch:h}=Pt();let d;t[1]!==c?(d=j=>c({to:".",search:P=>({...P,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;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 j;t[3]!==m?(j=ee=>ee.id===m,t[3]=m,t[4]=j):j=t[4];const P=u.find(j);S=P?{kind:"custom",role:P}:null}const R=S;let _;t[5]!==f?(_=de.members(f),t[5]=f,t[6]=_):_=t[6];let A;t[7]!==g?(A=()=>g.organization.listMembers(),t[7]=g,t[8]=A):A=t[8];let N;t[9]!==_||t[10]!==A?(N={queryKey:_,queryFn:A},t[9]=_,t[10]=A,t[11]=N):N=t[11];const{data:D}=Fe(N);let b;t[12]!==D?.data?.members?(b=D?.data?.members??[],t[12]=D?.data?.members,t[13]=b):b=t[13];const O=b;let v;t[14]!==O?(v=j=>O.filter(P=>P.role===j).length,t[14]=O,t[15]=v):v=t[15];const E=v;let C;if(t[16]!==u||t[17]!==E||t[18]!==l||t[19]!==e){let j;t[21]!==E||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:E(ce.role),label:e(ce.labelKey)}}),t[21]=E,t[22]=e,t[23]=j):j=t[23];const P=Qs.map(j);let ee;t[24]!==E?(ee=ce=>({kind:"custom",role:{...ce,memberCount:E(ce.role)}}),t[24]=E,t[25]=ee):ee=t[25];const St=u.map(ee);if(C=[...P,...St],l){const ce=l.toLowerCase();C=C.filter(At=>At.role.label.toLowerCase().includes(ce))}t[16]=u,t[17]=E,t[18]=l,t[19]=e,t[20]=C}else C=t[20];let y;t[26]!==g?(y=async j=>{const P=await g.organization.deleteRole({roleId:j});if(P?.error)throw new Error(P.error.message);return P?.data},t[26]=g,t[27]=y):y=t[27];const i=at({mutationFn:y,onSuccess:(j,P)=>{Ke("role_deleted",{role_id:P}),a.invalidateQueries({queryKey:de.members(f)}),a.invalidateQueries({queryKey:de.organizationRoles(f)}),ve.success(e("settings.roles.deletedSuccessfully")),h(),R?.kind==="custom"&&R.role.id===P&&p(void 0)},onError:Xs});let I;t[28]!==e?(I=e("settings.roles.columnRole"),t[28]=e,t[29]=I):I=t[29];let B;t[30]!==I?(B={id:"role",header:I,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=I,t[31]=B):B=t[31];let L;t[32]!==e?(L=e("settings.roles.columnType"),t[32]=e,t[33]=L):L=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(Me,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Me,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let w;t[36]!==L||t[37]!==Y?(w={id:"type",header:L,render:Y,cellClassName:"w-28 shrink-0"},t[36]=L,t[37]=Y,t[38]=w):w=t[38];let U;t[39]!==e?(U=e("settings.roles.columnPermissions"),t[39]=e,t[40]=U):U=t[40];let z;t[41]!==e?(z=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const P=j.role,ee=[];return P.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):P.staticPermissionCount&&P.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:P.staticPermissionCount})),P.allowsAllConnections?ee.push(e("settings.roles.allConnections")):P.connectionCount&&P.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:P.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]=z):z=t[42];let k;t[43]!==U||t[44]!==z?(k={id:"permissions",header:U,render:z,cellClassName:"flex-1 min-w-0"},t[43]=U,t[44]=z,t[45]=k):k=t[45];let $;t[46]!==e?($=e("settings.roles.columnMembers"),t[46]=e,t[47]=$):$=t[47];let V;t[48]!==$?(V={id:"members",header:$,render:Ws,cellClassName:"w-24 shrink-0"},t[48]=$,t[49]=V):V=t[49];let G;t[50]!==e?(G={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(kt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zs,children:s.jsx(Vt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:qs,children:s.jsxs(Bt,{variant:"destructive",onClick:()=>{const P=j.role;P.id&&o({id:P.id,label:P.label})},children:[s.jsx(zt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=G):G=t[51];let q;t[52]!==B||t[53]!==w||t[54]!==k||t[55]!==V||t[56]!==G?(q=[B,w,k,V,G],t[52]=B,t[53]=w,t[54]=k,t[55]=V,t[56]=G,t[57]=q):q=t[57];const W=q;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const P=j.role;p(P.id)}},t[58]=p,t[59]=te):te=t[59];const se=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let P;return t[62]!==h||t[63]!==p?(P=()=>{h(),p(void 0)},t[62]=h,t[63]=p,t[64]=P):P=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:P},Ks(R))}let F;t[65]!==e?(F=e("settings.roles.pageTitle"),t[65]=e,t[66]=F):F=t[66];let T;t[67]!==F?(T=s.jsx(ne.Title,{children:F}),t[67]=F,t[68]=T):T=t[68];let M;t[69]!==e?(M=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=M):M=t[70];let H;t[71]===Symbol.for("react.memo_cache_sentinel")?(H=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=H):H=t[71];let Q;t[72]!==l||t[73]!==M?(Q=s.jsx(Qe,{value:l,onChange:n,placeholder:M,className:"w-full md:w-[375px]",onKeyDown:H}),t[72]=l,t[73]=M,t[74]=Q):Q=t[74];let J;t[75]!==p?(J=()=>p("new"),t[75]=p,t[76]=J):J=t[76];let oe;t[77]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(Ye,{size:16}),t[77]=oe):oe=t[77];let le;t[78]!==e?(le=e("settings.roles.createRole"),t[78]=e,t[79]=le):le=t[79];let me;t[80]!==J||t[81]!==le?(me=s.jsxs(ae,{onClick:J,children:[oe,le]}),t[80]=J,t[81]=le,t[82]=me):me=t[82];let ue;t[83]!==Q||t[84]!==me?(ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Q,me]}),t[83]=Q,t[84]=me,t[85]=ue):ue=t[85];let fe;t[86]!==l||t[87]!==e?(fe=l?s.jsx(tt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(tt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[86]=l,t[87]=e,t[88]=fe):fe=t[88];let ge;t[89]!==C||t[90]!==W||t[91]!==se||t[92]!==fe?(ge=s.jsx(Yt,{columns:W,data:C,isLoading:!1,onRowClick:se,emptyState:fe}),t[89]=C,t[90]=W,t[91]=se,t[92]=fe,t[93]=ge):ge=t[93];let he;t[94]!==T||t[95]!==ue||t[96]!==ge?(he=s.jsx(ne.Content,{children:s.jsx(ne.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[T,ue,ge]})})}),t[94]=T,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=r!==null;let ke;t[98]===Symbol.for("react.memo_cache_sentinel")?(ke=j=>!j&&o(null),t[98]=ke):ke=t[98];let xe;t[99]!==e?(xe=e("settings.roles.deleteRoleTitle"),t[99]=e,t[100]=xe):xe=t[100];let pe;t[101]!==xe?(pe=s.jsx(ft,{children:xe}),t[101]=xe,t[102]=pe):pe=t[102];const ze=r?.label??"";let Te;t[103]!==e||t[104]!==ze?(Te=e("settings.roles.deleteRoleConfirm",{role:ze}),t[103]=e,t[104]=ze,t[105]=Te):Te=t[105];let Ee;t[106]!==Te?(Ee=s.jsx(gt,{children:Te}),t[106]=Te,t[107]=Ee):Ee=t[107];let Ie;t[108]!==pe||t[109]!==Ee?(Ie=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=Ie):Ie=t[110];let _e;t[111]!==e?(_e=e("settings.roles.cancel"),t[111]=e,t[112]=_e):_e=t[112];let Re;t[113]!==_e?(Re=s.jsx(xt,{children:_e}),t[113]=_e,t[114]=Re):Re=t[114];let be;t[115]!==i||t[116]!==r?(be=()=>{r?.id&&i.mutate(r.id),o(null)},t[115]=i,t[116]=r,t[117]=be):be=t[117];let Ne;t[118]!==e?(Ne=e("settings.roles.delete"),t[118]=e,t[119]=Ne):Ne=t[119];let Ce;t[120]!==be||t[121]!==Ne?(Ce=s.jsx(pt,{onClick:be,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ne}),t[120]=be,t[121]=Ne,t[122]=Ce):Ce=t[122];let Se;t[123]!==Re||t[124]!==Ce?(Se=s.jsxs(Tt,{children:[Re,Ce]}),t[123]=Re,t[124]=Ce,t[125]=Se):Se=t[125];let Ae;t[126]!==Ie||t[127]!==Se?(Ae=s.jsxs(ut,{children:[Ie,Se]}),t[126]=Ie,t[127]=Se,t[128]=Ae):Ae=t[128];let Oe;t[129]!==Ve||t[130]!==Ae?(Oe=s.jsx(mt,{open:Ve,onOpenChange:ke,children:Ae}),t[129]=Ve,t[130]=Ae,t[131]=Oe):Oe=t[131];let Ge;return t[132]!==he||t[133]!==Oe?(Ge=s.jsxs(ne,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=Ge):Ge=t[134],Ge}function qs(t){return t.stopPropagation()}function Zs(t){return t.stopPropagation()}function Ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",dt(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(ct,{size:12,className:"text-muted-foreground shrink-0"})]})}function Xs(t,e){Ke("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 el(){const t=X.c(7),e=ie();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K.Suspense,{fallback:s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Hs,{})}),t[4]=r):r=t[4];let o;return t[5]!==n?(o=s.jsx(Dt,{fallback:n,children:r}),t[5]=n,t[6]=o):o=t[6],o}function Do(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{Do as default};
1
+ import{r as K,C as Be,K as de,b4 as Ot,m as Fe,j as s,l as Z,i as je,B as ae,c as X,H as Je,ad as Ue,I as re,af as Xe,ag as et,n as rt,M as jt,J as vt,d as at,t as ve,p as Ke,w as ct,x as Mt,E as Dt,b as yt,u as wt}from"./index-VazNHrO3.js";import{u as Pt}from"./use-organization-roles-Ev36QIQK.js";import{u as $e}from"./use-org-auth-client-tox-aigT.js";import{u as ie}from"./use-t-CvXQXPPS.js";import{g as dt,a as Lt}from"./role-color-Dn2tXDDF.js";import{B as Me}from"./badge-CHPMmYmt.js";import{f as mt,a as ut,c as ft,d as gt,b as ht,A as xt,g as pt,e as Tt}from"./alert-dialog-Dp7Qz6rw.js";import{D as kt,a as Gt,c as Ut,d as Bt}from"./dropdown-menu-LEcMeufE.js";import{i as Vt}from"./DotsVertical-bvDG8sRh.js";import{s as Ye}from"./Plus-DT-2W1wT.js";import{s as zt}from"./Trash01-UQjosBE6.js";import{C as Yt}from"./collection-table-wrapper-dKvZq1Le.js";import{P as ne}from"./index-D3WGUwBg.js";import{E as tt}from"./empty-state-BTjg_Aje.js";import{S as Qe}from"./search-input-D77R2Qlj.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as He}from"./integration-icon-CHnUYdE2.js";import{u as Ft}from"./use-infinite-scroll-HqU26K5r.js";import{C as qe}from"./checkbox-BSEtc01G.js";import{b as Kt}from"./Settings02-C1s-98Ge.js";import{u as $t}from"./useSuspenseInfiniteQuery-CoSrihVf.js";import{u as Qt,S as Ht}from"./use-mcp-client-WisUNJdN.js";import{C as qt}from"./collection-search-DGOwHYSB.js";import{u as _t}from"./use-members-C6oejWDG.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-DyhWyxCB.js";import{u as Wt,c as Jt}from"./use-ai-providers-CZ05oGju.js";import{A as bt}from"./avatar-C6qQgELM.js";import{S as De}from"./switch-IxJ12UUN.js";import{c as ye,b as we,T as Pe,a as Le}from"./tooltip-plNKOrsB.js";import{S as st,a as lt,b as ot}from"./settings-section-DN4ehJk4.js";import{t as Xt}from"./ChevronDown-DyjAqI3m.js";import{i as es}from"./ChevronRight-Df2B68Ds.js";import{i as nt}from"./X-BWn3kDs2.js";import{a as ts}from"./use-capability-PzwH7JXT.js";import{A as ss}from"./access-gate-7v8G4_rr.js";import"./ChevronUp-DAExiZbv.js";import"./table-BRS5-Ghi.js";import"./ArrowUp-DsZMdHlI.js";import"./sidebar-BudM_B2c.js";import"./LayoutLeft-fGt4B_V6.js";import"./use-mobile-D6QzYWiJ.js";import"./SearchMd-MXpFHXYg.js";import"./Tool02-CSWTlCLd.js";import"./agent-icon-DHXwUm9P.js";import"./AlertCircle-CF1-Ouso.js";import"./Tool01-CSRypqfM.js";import"./XCircle-CrP1StfT.js";import"./ArrowUpRight-Bxfx0mGn.js";import"./TrendUp01-Di8K_0Ub.js";import"./ZapSquare-C6uVpqjQ.js";import"./ZoomOut-D_KRNWSe.js";import"./Users03-DTELiT5U.js";import"./CheckCircle-wiCB7A1l.js";import"./Stars02-DcCuWVPa.js";import"./Copy01-yl04KoRE.js";import"./Globe01-CrriuSxO.js";import"./Eye-BFJNvxsd.js";import"./FilterLines-BqZk99p5.js";import"./Star01-DwAl9-p_.js";import"./Globe04-DACPo7x7.js";import"./SwitchHorizontal01-DNrUeigm.js";import"./HardDrive-LjQciFQe.js";import"./Image01-BYSIhLh2.js";import"./Key01-Lzz0ThQp.js";import"./LinkExternal01-BRIrxBM1.js";import"./Monitor01-B6UVUJyc.js";import"./Sun-CF2vhsLR.js";import"./Package-CrYiuzsO.js";import"./Palette-C48f3v4Y.js";import"./Play-DIYdniDd.js";import"./SearchLg-DTthHNBJ.js";import"./Shield01-DWL6KGgf.js";import"./Stars01-DNB2jBIt.js";import"./Upload01-CnCVZJAv.js";import"./User01-CF6pDsdw.js";import"./Users01-C_k5OJBp.js";import"./XClose-CjGp1c1G.js";import"./Zap-BZCkBdl0.js";import"./auth-SBllEMuV.js";import"./use-collections-Du2dq1-S.js";import"./studio-tools-JQnAx-yt.js";import"./card-CHkDvr9O.js";import"./capability-load-error-BPWNkWfC.js";const Ze="basic-usage",We=[{id:Ze,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","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{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"]},{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_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_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",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{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"]},{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}];[...We.find(t=>t.id===Ze)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(We.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of We){if(e.id===Ze)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 ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const r=new Set(e);for(const o of t.tools)r.add(o);return Array.from(r)}const n=new Set(e);for(const r of t.tools)n.delete(r);return Array.from(n)}function rs(t){const e=X.c(21),{connection:l,isSelected:n,hasToolsEnabled:r,activeToolsCount:o,totalToolsCount:c,onSelect:x,onToggle:m}=t,f=n?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==f?(g=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",f),e[0]=f,e[1]=g):g=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(He,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=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]=u):u=e[6];let h;e[7]!==x||e[8]!==a||e[9]!==u?(h=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:x,children:[a,u]}),e[7]=x,e[8]=a,e[9]=u,e[10]=h):h=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==r||e[14]!==m||e[15]!==c?(d=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(qe,{checked:r,onCheckedChange:m,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=r,e[14]=m,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==g||e[18]!==h||e[19]!==d?(p=s.jsxs("div",{className:g,children:[h,d]}),e[17]=g,e[18]=h,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=X.c(18),{connectionId:l,tool:n,isSelected:r,onToggle:o}=t,c=`tool-${l}-${n.name}`,x=r?"text-foreground":"text-muted-foreground";let m;e[0]!==x?(m=Z("text-sm font-medium",x),e[0]=x,e[1]=m):m=e[1];let f;e[2]!==m||e[3]!==n.name?(f=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:n.name})}),e[2]=m,e[3]=n.name,e[4]=f):f=e[4];let g;e[5]!==n.description?(g=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=g):g=e[6];let a;e[7]!==f||e[8]!==g?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[7]=f,e[8]=g,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let h;e[10]!==r||e[11]!==o||e[12]!==u?(h=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(qe,{id:u,checked:r,onCheckedChange:o,onClick:ds})}),e[10]=r,e[11]=o,e[12]=u,e[13]=h):h=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==h?(d=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,h]}),e[14]=c,e[15]=a,e[16]=h,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const[r,o]=K.useState(""),c=n!==void 0?n:r,x=K.useDeferredValue(c),[m,f]=K.useState("all"),[g,a]=K.useState(!1),u=K.useRef(new Set(Object.keys(t))),{org:h}=Be(),d=Qt({connectionId:Ht,orgId:h.id,orgSlug:h.slug}),p=100,S=x.trim(),R=S?{operator:"or",conditions:[{field:["title"],operator:"contains",value:S},{field:["description"],operator:"contains",value:S}]}:void 0,_=!!l,A={...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:p,offset:0,..._&&{include_virtual:!0}},N=JSON.stringify(A),{data:D,fetchNextPage:b,hasNextPage:O,isFetchingNextPage:v}=$t({queryKey:de.collectionListInfinite(d,h.id,"","CONNECTIONS",N),queryFn:async({pageParam:T=0})=>(await d.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:p,offset:T,..._&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,M)=>{if(T?.hasMore)return M.reduce((H,Q)=>H+(Q?.items?.length??0),0)},staleTime:3e4}),E=D?.pages.flatMap(T=>T?.items??[])??[],C=Ft(b,O??!1,v),y=l?E.filter(T=>T.connection_type!=="VIRTUAL"?!0:Ot(T.connection_url)!==l):E,i=u.current,I=[...i.values()].map(T=>y.find(M=>M.id===T)).filter(T=>T!==void 0),B=y.filter(T=>!i.has(T.id)),L=[...I,...B],Y=T=>{const M=t[T];return M!==void 0&&M.length>0},w=L.filter(T=>{if(m==="all")return!0;const M=Y(T.id);return m==="selected"?M:m==="unselected"?!M:!0}),[U,z]=K.useState(L[0]?.id??null),k=U?L.find(T=>T.id===U)??null:null,{data:$,isFetching:V}=Fe({queryKey:de.collectionItem(d,h.id,"","CONNECTIONS",U??""),queryFn:async()=>U?(await d.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:U}})).structuredContent?.item??null:null,enabled:!!U,staleTime:3e4}),G=$?.tools??[],q=(T,M)=>t[T]?.includes(M)??!1,W=(T,M)=>{const H=t[T]??[],Q=H.includes(M),J={...t};if(Q){const oe=H.filter(le=>le!==M);oe.length===0?delete J[T]:J[T]=oe}else J[T]=[...H,M];e(J)},te=T=>{const M=T===U?G:[];if(!M.length)return;const H=t[T]??[],Q=M.map(le=>le.name),J=H.length>0&&Q.every(le=>H.includes(le)),oe={...t};J?delete oe[T]:(oe[T]=Q,z(T)),e(oe)},se=T=>{z(T),a(!0)},F=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",g&&"hidden md:flex"),children:[n===void 0&&s.jsx(qt,{value:r,onChange:o,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>f("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>f("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:c?"No connections found":m==="selected"?"No servers selected":m==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[w.map(T=>{const M=U===T.id,H=M?G.length:0,Q=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:M?G:T.tools},isSelected:M,hasToolsEnabled:Y(T.id),activeToolsCount:Q,totalToolsCount:H,onSelect:()=>se(T.id),onToggle:()=>te(T.id)},T.id)}),s.jsx("div",{ref:C,className:"h-4"}),v&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",g?"flex":"hidden md:flex"),children:k?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:F,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Kt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(He,{icon:k.icon,name:k.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:k.title}),k.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:k.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:V?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})}):G.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:G.map(T=>s.jsx(cs,{connectionId:k.id,tool:T,isSelected:q(k.id,T.name),onToggle:()=>W(k.id,T.name)},T.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:"Select a connection to view its tools"})})})]})}const us=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:et(),staticPermissions:Ue(re()),toolSet:Xe(re(),Ue(re())),allowAllModels:et(),modelSet:Xe(re(),Ue(re())),memberIds:Ue(re())});function it(t,e,l){const n=ie(),r=s.jsx(De,{checked:t,disabled:e,onCheckedChange:l});return e?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:r})}),s.jsx(Le,{children:s.jsx("p",{children:n("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):r}function fs(t){const e=X.c(40),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:r,onPermissionsChange:o,readOnly:c,searchQuery:x}=t,m=c===void 0?!1:c,f=ie();let g;e[0]!==x?(g=x.trim().toLowerCase(),e[0]=x,e[1]=g):g=e[1];const a=K.useDeferredValue(g);let u;if(e[2]!==l||e[3]!==a||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==x||e[8]!==n||e[9]!==f){const h=os(),d=(E,C)=>{if(!m){if(l&&C){const y=h.flatMap(xs).flatMap(hs);r(!1),o(y.filter(i=>!E.tools.includes(i)));return}l||o(is(E,n,!C))}};let p;e[11]!==a?(p=E=>{const{section:C,capabilities:y}=E;return{section:C,capabilities:y.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const S=h.map(p).filter(gs);let R;e[13]!==f?(R=f("settings.orgRoleDetail.general"),e[13]=f,e[14]=R):R=e[14];let _;e[15]!==f?(_=f("settings.orgRoleDetail.allOrgPermissions"),e[15]=f,e[16]=_):_=e[16];let A;e[17]!==f?(A=f("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=f,e[18]=A):A=e[18];let N;e[19]!==l||e[20]!==r||e[21]!==o?(N=()=>{r(!l),o([])},e[19]=l,e[20]=r,e[21]=o,e[22]=N):N=e[22];let D;e[23]!==l||e[24]!==m||e[25]!==N?(D=it(l,m,N),e[23]=l,e[24]=m,e[25]=N,e[26]=D):D=e[26];let b;e[27]!==l||e[28]!==r||e[29]!==o||e[30]!==m?(b=m?void 0:()=>{r(!l),o([])},e[27]=l,e[28]=r,e[29]=o,e[30]=m,e[31]=b):b=e[31];let O;e[32]!==b||e[33]!==_||e[34]!==A||e[35]!==D?(O=s.jsx(lt,{children:s.jsx(ot,{title:_,description:A,action:D,onClick:b})}),e[32]=b,e[33]=_,e[34]=A,e[35]=D,e[36]=O):O=e[36];let v;e[37]!==O||e[38]!==R?(v=s.jsx(st,{title:R,children:O}),e[37]=O,e[38]=R,e[39]=v):v=e[39],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[v,S.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:f("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:x})}):S.map(E=>{const{section:C,capabilities:y}=E;return s.jsx(st,{title:C,children:s.jsx(lt,{children:y.map(i=>{const I=ns(i,n,l);return s.jsx(ot,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(Mt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:it(I,m,()=>d(i,I)),onClick:m?void 0:()=>d(i,I)},i.id)})})},C)})]})}),e[2]=l,e[3]=a,e[4]=r,e[5]=o,e[6]=m,e[7]=x,e[8]=n,e[9]=f,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={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 Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Es(t){return ps[t]??Nt[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function _s(t){const e=X.c(40),{connectionId:l,subProviderId:n,subProviderName:r,groupLogo:o,models:c,allConnectionModelIds:x,selectedModels:m,allowAllModels:f,allConnectionModelsSelected:g,onToggleModel:a,onExitAllowAll:u,readOnly:h,defaultExpanded:d}=t,p=ie(),[S,R]=K.useState(d),_=d||S,A=R,[N,D]=K.useState(Ct);let b;e[0]!==g||e[1]!==f||e[2]!==m?(b=E=>f||g||m.includes("*")||m.includes(E),e[0]=g,e[1]=f,e[2]=m,e[3]=b):b=e[3];const O=b;let v;if(e[4]!==x||e[5]!==f||e[6]!==l||e[7]!==_||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==h||e[14]!==n||e[15]!==r||e[16]!==p||e[17]!==N){let E;e[19]!==O?(E=G=>O(G.id),e[19]=O,e[20]=E):E=e[20];const C=c.filter(E).length,y=c.slice(0,N),i=c.length>N;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>A(Cs),e[21]=I):I=e[21];const B=o??Et[n]??It;let L;e[22]!==r||e[23]!==B?(L=s.jsx(He,{icon:B,name:r,size:"sm"}),e[22]=r,e[23]=B,e[24]=L):L=e[24];let Y;e[25]!==r?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:r}),e[25]=r,e[26]=Y):Y=e[26];let w;e[27]!==L||e[28]!==Y?(w=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[L,Y]}),e[27]=L,e[28]=Y,e[29]=w):w=e[29];const U=p("settings.orgRoleDetail.enabledCount",{enabledCount:C,total:c.length});let z;e[30]!==U?(z=s.jsx(Me,{variant:"secondary",className:"text-xs text-muted-foreground",children:U}),e[30]=U,e[31]=z):z=e[31];let k;e[32]!==_?(k=_?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=_,e[33]=k):k=e[33];let $;e[34]!==z||e[35]!==k?($=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[z,k]}),e[34]=z,e[35]=k,e[36]=$):$=e[36];let V;e[37]!==$||e[38]!==w?(V=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:I,children:[w,$]}),e[37]=$,e[38]=w,e[39]=V):V=e[39],v=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[V,_&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[y.map(G=>{const q=O(G.id),W=()=>{if(!h){if(f){u(l,x,G.id);return}a(l,G.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!h&&"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:G.title})}),s.jsx("div",{onClick:Ns,children:h?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:q,disabled:!0,onCheckedChange:bs})})}),s.jsx(Le,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:q,onCheckedChange:W})})]},G.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(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=x,e[5]=f,e[6]=l,e[7]=_,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=h,e[14]=n,e[15]=r,e[16]=p,e[17]=N,e[18]=v}else v=e[18];return v}function Rs(t){return t+Ct}function bs(){}function Ns(t){return t.stopPropagation()}function Cs(t){return!t}function Ss(t){const e=X.c(33),{connection:l,selectedModels:n,allowAllModels:r,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:x,searchQuery:m,readOnly:f}=t,g=Jt(l.id);let a,u,h,d,p;if(e[0]!==x||e[1]!==r||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==g||e[8]!==f||e[9]!==m||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let _;e[16]!==l.label?(_=I=>({...I,id:I.modelId,provider:l.label}),e[16]=l.label,e[17]=_):_=e[17];const A=g.filter(vs).map(_),N=m.trim().toLowerCase(),D=N?A.filter(I=>I.title.toLowerCase().includes(N)||I.id.toLowerCase().includes(N)||I.provider?.toLowerCase().includes(N)):A;if(D.length===0){p=null;break e}const b=new Map;for(const I of D){const B=Ts(I.id,l.providerId),L=b.get(B)??{models:[],logo:null};L.models.push({id:I.id,title:Is(I.title),logo:I.logo}),!L.logo&&I.logo&&(L.logo=I.logo),b.set(B,L)}const O=Array.from(b.entries()).map(js).sort(Os),v=O.length===1||N.length>0;h="flex flex-col gap-3";const E=Et[l.providerId]??It;let C;e[18]!==l.providerId||e[19]!==E?(C=s.jsx("img",{src:E,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,e[20]=C):C=e[20];const y=Nt[l.providerId]??l.providerId;let i;e[21]!==y?(i=s.jsx("h4",{className:"text-sm font-medium",children:y}),e[21]=y,e[22]=i):i=e[22],e[23]!==i||e[24]!==C?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[C,i]}),e[23]=i,e[24]=C,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(I=>s.jsx(_s,{connectionId:l.id,subProviderId:I.id,subProviderName:I.name,groupLogo:I.logo,models:I.models,allConnectionModelIds:A.map(As),selectedModels:n,allowAllModels:r,allConnectionModelsSelected:x,onToggleModel:o,onExitAllowAll:c,readOnly:f,defaultExpanded:v},I.id))}e[0]=x,e[1]=r,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=g,e[8]=f,e[9]=m,e[10]=n,e[11]=a,e[12]=u,e[13]=h,e[14]=d,e[15]=p}else a=e[11],u=e[12],h=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let S;e[26]!==a||e[27]!==u?(S=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=S):S=e[28];let R;return e[29]!==h||e[30]!==d||e[31]!==S?(R=s.jsxs("div",{className:h,children:[d,S]}),e[29]=h,e[30]=d,e[31]=S,e[32]=R):R=e[32],R}function As(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function vs(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:r,onModelSetChange:o,readOnly:c,searchQuery:x}=t,m=c===void 0?!1:c,f=ie(),g=K.useDeferredValue(x),a=Wt();let u;e[0]!==n||e[1]!==o?(u=(E,C)=>{const y=n[E]??[],i={...n};if(y.includes(C)){const I=y.filter(B=>B!==C);I.length===0?delete i[E]:i[E]=I}else i[E]=[...y,C];o(i)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const h=u;let d;e[3]!==n||e[4]!==r||e[5]!==o?(d=(E,C,y)=>{r(!1),o({...n,[E]:C.filter(i=>i!==y)})},e[3]=n,e[4]=r,e[5]=o,e[6]=d):d=e[6];const p=d,S=!m&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==S?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=R):R=e[8];let _;e[9]!==l||e[10]!==r||e[11]!==o||e[12]!==m?(_=()=>{if(m)return;const E=!l;r(E),E&&o({})},e[9]=l,e[10]=r,e[11]=o,e[12]=m,e[13]=_):_=e[13];let A;e[14]!==f?(A=f("settings.orgRoleDetail.allModels"),e[14]=f,e[15]=A):A=e[15];let N;e[16]!==A?(N=s.jsx("span",{className:"text-sm font-medium",children:A}),e[16]=A,e[17]=N):N=e[17];let D;e[18]!==l||e[19]!==r||e[20]!==o||e[21]!==m||e[22]!==f?(D=s.jsx("div",{onClick:ys,children:m?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{children:s.jsx("p",{children:f("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:l,onCheckedChange:E=>{r(E),E&&o({})}})}),e[18]=l,e[19]=r,e[20]=o,e[21]=m,e[22]=f,e[23]=D):D=e[23];let b;e[24]!==R||e[25]!==_||e[26]!==N||e[27]!==D?(b=s.jsxs("div",{className:R,onClick:_,children:[N,D]}),e[24]=R,e[25]=_,e[26]=N,e[27]=D,e[28]=b):b=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==g||e[32]!==p||e[33]!==n||e[34]!==m||e[35]!==f||e[36]!==h?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:f("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(E=>s.jsx(K.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 animate-spin"}),f("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ss,{connection:E,selectedModels:n[E.id]??[],allowAllModels:l,onToggleModel:h,onExitAllowAll:p,allConnectionModelsSelected:(n[E.id]??[]).includes("*"),searchQuery:g,readOnly:m})},E.id)),e[29]=a,e[30]=l,e[31]=g,e[32]=p,e[33]=n,e[34]=m,e[35]=f,e[36]=h,e[37]=O):O=e[37];let v;return e[38]!==b||e[39]!==O?(v=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[b,O]}),e[38]=b,e[39]=O,e[40]=v):v=e[40],v}function Ds(){}function ys(t){return t.stopPropagation()}function ws(t){const e=X.c(75),{open:l,onOpenChange:n,selectedMemberIds:r,onAddMembers:o}=t,c=ie(),[x,m]=K.useState(""),f=K.useDeferredValue(x);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[a,u]=K.useState(g),{data:h}=_t();let d,p,S,R,_,A,N,D,b,O,v;if(e[1]!==h?.data?.members||e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==x||e[8]!==r||e[9]!==c){const z=h?.data?.members??[];let k;e[21]!==f?(k=F=>{const T=f.toLowerCase();return F.user?.name?.toLowerCase().includes(T)||F.user?.email?.toLowerCase().includes(T)},e[21]=f,e[22]=k):k=e[22];const $=z.filter(k);let V;e[23]!==o||e[24]!==n||e[25]!==a?(V=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=V):V=e[26],S=V,p=mt,O=l,v=n,d=ut,D="sm:max-w-md p-0";let G;e[27]!==c?(G=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=G):G=e[28];let q;e[29]!==G?(q=s.jsx(ft,{children:G}),e[29]=G,e[30]=q):q=e[30];let W;e[31]!==c?(W=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(gt,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==q||e[36]!==te?(b=s.jsxs(ht,{className:"px-6 pt-6",children:[q,te]}),e[35]=q,e[36]=te,e[37]=b):b=e[37],A="flex flex-col h-80";let se;e[38]!==c?(se=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=se):se=e[39],e[40]!==x||e[41]!==se?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:x,onChange:m,placeholder:se,className:"w-full"})}),e[40]=x,e[41]=se,e[42]=N):N=e[42],R="flex-1 overflow-auto",_=$.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(x?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:$.map(F=>{const T=F.role!=="owner",M=r.includes(F.id),H=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!T||M?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(qe,{checked:H||M,onCheckedChange:()=>{!T||M||u(Q=>Q.includes(F.id)?Q.filter(J=>J!==F.id):[...Q,F.id])},disabled:!T||M}),s.jsx(bt,{url:F.user?.image??void 0,fallback:Rt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!T&&s.jsx(Me,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),M&&T&&s.jsx(Me,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=h?.data?.members,e[2]=f,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=x,e[8]=r,e[9]=c,e[10]=d,e[11]=p,e[12]=S,e[13]=R,e[14]=_,e[15]=A,e[16]=N,e[17]=D,e[18]=b,e[19]=O,e[20]=v}else d=e[10],p=e[11],S=e[12],R=e[13],_=e[14],A=e[15],N=e[16],D=e[17],b=e[18],O=e[19],v=e[20];let E;e[43]!==R||e[44]!==_?(E=s.jsx("div",{className:R,children:_}),e[43]=R,e[44]=_,e[45]=E):E=e[45];let C;e[46]!==E||e[47]!==A||e[48]!==N?(C=s.jsxs("div",{className:A,children:[N,E]}),e[46]=E,e[47]=A,e[48]=N,e[49]=C):C=e[49];let y;e[50]!==c?(y=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=y):y=e[51];let i;e[52]!==y?(i=s.jsx(xt,{children:y}),e[52]=y,e[53]=i):i=e[53];const I=a.length===0;let B;e[54]!==a.length||e[55]!==c?(B=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=B):B=e[56];let L;e[57]!==S||e[58]!==I||e[59]!==B?(L=s.jsx(pt,{onClick:S,disabled:I,children:B}),e[57]=S,e[58]=I,e[59]=B,e[60]=L):L=e[60];let Y;e[61]!==i||e[62]!==L?(Y=s.jsxs(Tt,{className:"px-6 pb-6",children:[i,L]}),e[61]=i,e[62]=L,e[63]=Y):Y=e[63];let w;e[64]!==d||e[65]!==C||e[66]!==Y||e[67]!==D||e[68]!==b?(w=s.jsxs(d,{className:D,children:[b,C,Y]}),e[64]=d,e[65]=C,e[66]=Y,e[67]=D,e[68]=b,e[69]=w):w=e[69];let U;return e[70]!==p||e[71]!==w||e[72]!==O||e[73]!==v?(U=s.jsx(p,{open:O,onOpenChange:v,children:w}),e[70]=p,e[71]=w,e[72]=O,e[73]=v,e[74]=U):U=e[74],U}function Ps(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:r,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:x,onAddMemberDialogOpenChange:m}=t,f=r===void 0?!1:r,g=o===void 0?void 0:o,a=ie(),u=K.useDeferredValue(c),{data:h}=_t();let d,p,S;if(e[0]!==h?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==f||e[5]!==g||e[6]!==c||e[7]!==a){const D=h?.data?.members??[];let b;e[11]!==l?(b=i=>l.includes(i.id),e[11]=l,e[12]=b):b=e[12];const O=D.filter(b);let v;e[13]!==u?(v=i=>{const I=u.toLowerCase();return i.user?.name?.toLowerCase().includes(I)||i.user?.email?.toLowerCase().includes(I)},e[13]=u,e[14]=v):v=e[14];const E=O.filter(v);let C;e[15]!==g||e[16]!==a?(C=g??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=a,e[17]=C):C=e[17];const y=C;S="flex flex-col h-full",d="flex-1 overflow-auto",p=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:E.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(bt,{url:i.user?.image??void 0,fallback:Rt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),f?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(nt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:y})})]})}):s.jsx(ae,{variant:"ghost",size:"sm",onClick:()=>n(l.filter(I=>I!==i.id)),children:s.jsx(nt,{size:16})})]},i.id))}),e[0]=h?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=f,e[5]=g,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=S}else d=e[8],p=e[9],S=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let _;e[21]!==l||e[22]!==n?(_=D=>n([...l,...D]),e[21]=l,e[22]=n,e[23]=_):_=e[23];let A;e[24]!==x||e[25]!==l||e[26]!==m||e[27]!==_?(A=s.jsx(ws,{open:x,onOpenChange:m,selectedMemberIds:l,onAddMembers:_}),e[24]=x,e[25]=l,e[26]=m,e[27]=_,e[28]=A):A=e[28];let N;return e[29]!==S||e[30]!==R||e[31]!==A?(N=s.jsxs("div",{className:S,children:[R,A]}),e[29]=S,e[30]=R,e[31]=A,e[32]=N):N=e[32],N}function Ls(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(K.Suspense,{fallback:l,children:s.jsx(Ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const ks={owner:[],admin:[],user:[]};function Gs(t,e,l,n){const r=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:r,staticPermissions:ks[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},r=n.self||[],o=r.includes("*"),c=o?[]:r.filter(a=>a!=="*"),x={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const h of l)x[h.id]=u.includes("*")?h.tools?.map(d=>d.name)??[]:u;else{const h=l.find(d=>d.id===a);h&&(x[a]=u.includes("*")?h.tools?.map(d=>d.name)??[]:u)}const m=n.models||[],f=m.length===0||m.includes("*:*"),g={};if(!f)for(const a of m){const u=a.indexOf(":");if(u===-1)continue;const h=a.slice(0,u),d=a.slice(u+1);g[h]||(g[h]=[]),g[h].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:x,allowAllModels:f,modelSet:g,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,r]of Object.entries(t.toolSet))if(r.length>0){const c=e.find(x=>x.id===n)?.tools?.map(x=>x.name)??[];l[n]=c.length>0&&c.every(x=>r.includes(x))?["*"]:r}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[r,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${r}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function zs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:n,onOpen:r}=t,o=n===void 0?void 0:n,c=ie();let x;e[0]!==o||e[1]!==c?(x=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=x):x=e[2];const m=x;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ye,{size:16}),e[3]=u):u=e[3];let h;e[4]!==c?(h=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=h):h=e[5];let d;e[6]!==h?(d=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[u,h]})})}),e[6]=h,e[7]=d):d=e[7];let p;e[8]!==m?(p=s.jsx(Le,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=p):p=e[9];let S;return e[10]!==d||e[11]!==p?(S=s.jsx(ye,{children:s.jsxs(we,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=S):S=e[12],S}let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ye,{size:16}),e[13]=f):f=e[13];let g;e[14]!==c?(g=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=g):g=e[15];let a;return e[16]!==r||e[17]!==g?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:r,children:[f,g]}),e[16]=r,e[17]=g,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Be(),n=$e(),r=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let x;e[4]!==o||e[5]!==c?(x={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=x):x=e[6];const{data:m,isPending:f}=Fe(x);if(f||!r){let h;return e[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=h):h=e[7],h}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const a=g;let u;return e[10]!==r||e[11]!==a||e[12]!==t?(u=s.jsx(Fs,{...t,members:a,connections:r}),e[10]=r,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Fs({target:t,onBack:e,onSaved:l,members:n,connections:r}){const o=ie(),{locator:c}=Be(),x=$e(),m=rt(),f=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,h]=K.useState(f?"org":"mcp"),d=jt({resolver:vt(us),defaultValues:Vs(t,n,r)}),p=d.formState.isValid,S=d.formState.isDirty,R=at({mutationFn:async i=>{const I=Bs(i,r),B=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),L=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(w,U)=>{const z=n.filter(V=>V.role===(U??w)).map(V=>V.id),k=i.memberIds.filter(V=>!z.includes(V)),$=z.filter(V=>!i.memberIds.includes(V));for(const V of k){const G=await x.organization.updateMemberRole({memberId:V,role:[w]});if(G?.error)throw new Error(G.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const V of $){const G=await x.organization.updateMemberRole({memberId:V,role:["user"]});if(G?.error)throw new Error(G.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(L)return await Y(i.role.slug),i;if(i.role.id){const w=i.role.label.toLowerCase().replace(/\s+/g,"-"),U=i.role.slug,z=w!==U,k=await x.organization.updateRole({roleId:i.role.id,data:{permission:I,...z?{roleName:w}:{}}});if(k?.error)throw new Error(k.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(z?w:U,z?U:void 0),z?{...i,role:{...i.role,slug:w}}:i}else{const w=await x.organization.createRole({role:B,permission:I});if(w?.error)throw new Error(w.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const U of i.memberIds){const z=await x.organization.updateMemberRole({memberId:U,role:[B]});if(z?.error)throw new Error(z.error.message)}return{...i,role:{...i.role,id:w.data?.roleData?.id,slug:B}}}},onSuccess:(i,I)=>{m.invalidateQueries({queryKey:de.members(c)}),m.invalidateQueries({queryKey:de.organizationRoles(c)});const B=!I.role.id&&!I.role.slug,L=I.role.slug==="owner"&&!I.role.id;Ke(L?"role_members_updated":B?"role_created":"role_updated",{role_slug:I.role.slug??null}),ve.success(o(L?"settings.orgRoleDetail.membersUpdatedSuccessfully":B?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(i),l(i.role.id)},onError:i=>{ve.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),_=d.handleSubmit(i=>{if(!i.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(i)}),A=!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:"members",label:o("settings.orgRoleDetail.members")}],[b,O]=K.useState(""),[v,E]=K.useState(!1),C=i=>{h(i),O("")},y={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ne,{children:s.jsxs(ne.Content,{className:Z("flex flex-col",u!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ne.Title,{actions:A&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:_,disabled:R.isPending||!p||!S,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?dt(t.role,!0):Lt(d.watch("role.label")))}),g&&s.jsx(ct,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:D.map(i=>s.jsx("button",{type:"button",onClick:()=>C(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===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:b,onChange:O,placeholder:y[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(zs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>E(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!g&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:i=>d.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:b}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:i=>d.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>d.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:b}),u==="models"&&s.jsx(Ms,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:i=>d.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>d.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:b}),u==="members"&&s.jsx(Ls,{memberIds:d.watch("memberIds"),onMemberIdsChange:i=>d.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:b,addMemberDialogOpen:v,onAddMemberDialogOpenChange:E})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=X.c(6),{area:l,children:n}=t,{isPrivileged:r,loading:o,error:c}=ts();let x;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==r||e[4]!==o?(x=s.jsx(ss,{granted:r,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=r,e[4]=o,e[5]=x):x=e[5],x}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Hs(){const t=X.c(135),e=ie(),[l,n]=K.useState(""),[r,o]=K.useState(null),c=yt();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x={strict:!1},t[0]=x):x=t[0];const{role:m}=wt(x),{locator:f}=Be(),g=$e(),a=rt(),{customRoles:u,refetch:h}=Pt();let d;t[1]!==c?(d=j=>c({to:".",search:P=>({...P,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;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 j;t[3]!==m?(j=ee=>ee.id===m,t[3]=m,t[4]=j):j=t[4];const P=u.find(j);S=P?{kind:"custom",role:P}:null}const R=S;let _;t[5]!==f?(_=de.members(f),t[5]=f,t[6]=_):_=t[6];let A;t[7]!==g?(A=()=>g.organization.listMembers(),t[7]=g,t[8]=A):A=t[8];let N;t[9]!==_||t[10]!==A?(N={queryKey:_,queryFn:A},t[9]=_,t[10]=A,t[11]=N):N=t[11];const{data:D}=Fe(N);let b;t[12]!==D?.data?.members?(b=D?.data?.members??[],t[12]=D?.data?.members,t[13]=b):b=t[13];const O=b;let v;t[14]!==O?(v=j=>O.filter(P=>P.role===j).length,t[14]=O,t[15]=v):v=t[15];const E=v;let C;if(t[16]!==u||t[17]!==E||t[18]!==l||t[19]!==e){let j;t[21]!==E||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:E(ce.role),label:e(ce.labelKey)}}),t[21]=E,t[22]=e,t[23]=j):j=t[23];const P=Qs.map(j);let ee;t[24]!==E?(ee=ce=>({kind:"custom",role:{...ce,memberCount:E(ce.role)}}),t[24]=E,t[25]=ee):ee=t[25];const St=u.map(ee);if(C=[...P,...St],l){const ce=l.toLowerCase();C=C.filter(At=>At.role.label.toLowerCase().includes(ce))}t[16]=u,t[17]=E,t[18]=l,t[19]=e,t[20]=C}else C=t[20];let y;t[26]!==g?(y=async j=>{const P=await g.organization.deleteRole({roleId:j});if(P?.error)throw new Error(P.error.message);return P?.data},t[26]=g,t[27]=y):y=t[27];const i=at({mutationFn:y,onSuccess:(j,P)=>{Ke("role_deleted",{role_id:P}),a.invalidateQueries({queryKey:de.members(f)}),a.invalidateQueries({queryKey:de.organizationRoles(f)}),ve.success(e("settings.roles.deletedSuccessfully")),h(),R?.kind==="custom"&&R.role.id===P&&p(void 0)},onError:Xs});let I;t[28]!==e?(I=e("settings.roles.columnRole"),t[28]=e,t[29]=I):I=t[29];let B;t[30]!==I?(B={id:"role",header:I,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=I,t[31]=B):B=t[31];let L;t[32]!==e?(L=e("settings.roles.columnType"),t[32]=e,t[33]=L):L=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(Me,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Me,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let w;t[36]!==L||t[37]!==Y?(w={id:"type",header:L,render:Y,cellClassName:"w-28 shrink-0"},t[36]=L,t[37]=Y,t[38]=w):w=t[38];let U;t[39]!==e?(U=e("settings.roles.columnPermissions"),t[39]=e,t[40]=U):U=t[40];let z;t[41]!==e?(z=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const P=j.role,ee=[];return P.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):P.staticPermissionCount&&P.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:P.staticPermissionCount})),P.allowsAllConnections?ee.push(e("settings.roles.allConnections")):P.connectionCount&&P.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:P.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]=z):z=t[42];let k;t[43]!==U||t[44]!==z?(k={id:"permissions",header:U,render:z,cellClassName:"flex-1 min-w-0"},t[43]=U,t[44]=z,t[45]=k):k=t[45];let $;t[46]!==e?($=e("settings.roles.columnMembers"),t[46]=e,t[47]=$):$=t[47];let V;t[48]!==$?(V={id:"members",header:$,render:Ws,cellClassName:"w-24 shrink-0"},t[48]=$,t[49]=V):V=t[49];let G;t[50]!==e?(G={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(kt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zs,children:s.jsx(Vt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:qs,children:s.jsxs(Bt,{variant:"destructive",onClick:()=>{const P=j.role;P.id&&o({id:P.id,label:P.label})},children:[s.jsx(zt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=G):G=t[51];let q;t[52]!==B||t[53]!==w||t[54]!==k||t[55]!==V||t[56]!==G?(q=[B,w,k,V,G],t[52]=B,t[53]=w,t[54]=k,t[55]=V,t[56]=G,t[57]=q):q=t[57];const W=q;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const P=j.role;p(P.id)}},t[58]=p,t[59]=te):te=t[59];const se=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let P;return t[62]!==h||t[63]!==p?(P=()=>{h(),p(void 0)},t[62]=h,t[63]=p,t[64]=P):P=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:P},Ks(R))}let F;t[65]!==e?(F=e("settings.roles.pageTitle"),t[65]=e,t[66]=F):F=t[66];let T;t[67]!==F?(T=s.jsx(ne.Title,{children:F}),t[67]=F,t[68]=T):T=t[68];let M;t[69]!==e?(M=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=M):M=t[70];let H;t[71]===Symbol.for("react.memo_cache_sentinel")?(H=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=H):H=t[71];let Q;t[72]!==l||t[73]!==M?(Q=s.jsx(Qe,{value:l,onChange:n,placeholder:M,className:"w-full md:w-[375px]",onKeyDown:H}),t[72]=l,t[73]=M,t[74]=Q):Q=t[74];let J;t[75]!==p?(J=()=>p("new"),t[75]=p,t[76]=J):J=t[76];let oe;t[77]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(Ye,{size:16}),t[77]=oe):oe=t[77];let le;t[78]!==e?(le=e("settings.roles.createRole"),t[78]=e,t[79]=le):le=t[79];let me;t[80]!==J||t[81]!==le?(me=s.jsxs(ae,{onClick:J,children:[oe,le]}),t[80]=J,t[81]=le,t[82]=me):me=t[82];let ue;t[83]!==Q||t[84]!==me?(ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Q,me]}),t[83]=Q,t[84]=me,t[85]=ue):ue=t[85];let fe;t[86]!==l||t[87]!==e?(fe=l?s.jsx(tt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(tt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[86]=l,t[87]=e,t[88]=fe):fe=t[88];let ge;t[89]!==C||t[90]!==W||t[91]!==se||t[92]!==fe?(ge=s.jsx(Yt,{columns:W,data:C,isLoading:!1,onRowClick:se,emptyState:fe}),t[89]=C,t[90]=W,t[91]=se,t[92]=fe,t[93]=ge):ge=t[93];let he;t[94]!==T||t[95]!==ue||t[96]!==ge?(he=s.jsx(ne.Content,{children:s.jsx(ne.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[T,ue,ge]})})}),t[94]=T,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=r!==null;let ke;t[98]===Symbol.for("react.memo_cache_sentinel")?(ke=j=>!j&&o(null),t[98]=ke):ke=t[98];let xe;t[99]!==e?(xe=e("settings.roles.deleteRoleTitle"),t[99]=e,t[100]=xe):xe=t[100];let pe;t[101]!==xe?(pe=s.jsx(ft,{children:xe}),t[101]=xe,t[102]=pe):pe=t[102];const ze=r?.label??"";let Te;t[103]!==e||t[104]!==ze?(Te=e("settings.roles.deleteRoleConfirm",{role:ze}),t[103]=e,t[104]=ze,t[105]=Te):Te=t[105];let Ee;t[106]!==Te?(Ee=s.jsx(gt,{children:Te}),t[106]=Te,t[107]=Ee):Ee=t[107];let Ie;t[108]!==pe||t[109]!==Ee?(Ie=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=Ie):Ie=t[110];let _e;t[111]!==e?(_e=e("settings.roles.cancel"),t[111]=e,t[112]=_e):_e=t[112];let Re;t[113]!==_e?(Re=s.jsx(xt,{children:_e}),t[113]=_e,t[114]=Re):Re=t[114];let be;t[115]!==i||t[116]!==r?(be=()=>{r?.id&&i.mutate(r.id),o(null)},t[115]=i,t[116]=r,t[117]=be):be=t[117];let Ne;t[118]!==e?(Ne=e("settings.roles.delete"),t[118]=e,t[119]=Ne):Ne=t[119];let Ce;t[120]!==be||t[121]!==Ne?(Ce=s.jsx(pt,{onClick:be,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ne}),t[120]=be,t[121]=Ne,t[122]=Ce):Ce=t[122];let Se;t[123]!==Re||t[124]!==Ce?(Se=s.jsxs(Tt,{children:[Re,Ce]}),t[123]=Re,t[124]=Ce,t[125]=Se):Se=t[125];let Ae;t[126]!==Ie||t[127]!==Se?(Ae=s.jsxs(ut,{children:[Ie,Se]}),t[126]=Ie,t[127]=Se,t[128]=Ae):Ae=t[128];let Oe;t[129]!==Ve||t[130]!==Ae?(Oe=s.jsx(mt,{open:Ve,onOpenChange:ke,children:Ae}),t[129]=Ve,t[130]=Ae,t[131]=Oe):Oe=t[131];let Ge;return t[132]!==he||t[133]!==Oe?(Ge=s.jsxs(ne,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=Ge):Ge=t[134],Ge}function qs(t){return t.stopPropagation()}function Zs(t){return t.stopPropagation()}function Ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",dt(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(ct,{size:12,className:"text-muted-foreground shrink-0"})]})}function Xs(t,e){Ke("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 el(){const t=X.c(7),e=ie();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K.Suspense,{fallback:s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Hs,{})}),t[4]=r):r=t[4];let o;return t[5]!==n?(o=s.jsx(Dt,{fallback:n,children:r}),t[5]=n,t[6]=o):o=t[6],o}function Do(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{Do as default};
@@ -1 +1 @@
1
- import{c as b,l as w,j as a,i as j}from"./index-ClpcoO6Q.js";import{i as N}from"./SearchMd-Dc8ZuJP4.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(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]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin 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=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{c as b,l as w,j as a,i as j}from"./index-VazNHrO3.js";import{i as N}from"./SearchMd-MXpFHXYg.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(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]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin 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=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{c as j,j as s,E as $,r as v,w as k,B as _,t as w}from"./index-ClpcoO6Q.js";import{i as F}from"./AlertCircle-BQ1VD_6t.js";import{s as E}from"./Plus-D9IhgCqF.js";import{s as B}from"./User01-DWci-S07.js";import{t as L}from"./Users01-Crl5FzV9.js";import{e as O,d as R,D as A,a as I,h as q,c as V}from"./dialog-B22XpC_l.js";import{I as z}from"./input-Cp47skDA.js";import{L as N}from"./label-Du7ujnBI.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-jpxQ8auT.js";import{S as M}from"./skeleton-6V7643HY.js";import{T as Q}from"./textarea-BupGR0lI.js";import{P as C}from"./index-CbIVN48S.js";import{c as U}from"./settings-section-D930bDYf.js";import{u as y}from"./use-t-BXvEcdAl.js";import{u as W,a as X}from"./use-secrets-YTJssPKP.js";import{R as Y}from"./require-capability-CQCfm9yJ.js";import"./X-Co3pcYLo.js";import"./tooltip-Jvhix_io.js";import"./ChevronUp-BPw1soSf.js";import"./ChevronDown-CDtylotE.js";import"./sidebar-CPBjqlbL.js";import"./LayoutLeft-BFUCyerF.js";import"./use-mobile-BsG2oqso.js";import"./card-KUe_gAVz.js";import"./ArrowUpRight-NYJdbNYo.js";import"./studio-tools-B-vV1MI8.js";import"./use-capability-kFJWZ1io.js";import"./access-gate-BQaPImNO.js";import"./capability-load-error-DaPJcbc4.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(F,{size:16}),e[0]=o):o=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 c;return e[4]!==n?(c=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=c):c=e[5],c}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),o=r==="user"?B:L;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 c=n;let l;e[3]!==o?(l=s.jsx(o,{size:12}),e[3]=o,e[4]=l):l=e[4];let a;return e[5]!==c||e[6]!==l?(a=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:[l,c]}),e[5]=c,e[6]=l,e[7]=a):a=e[7],a}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 o;e[1]!==r.name?(o=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=o):o=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 c;e[5]!==o||e[6]!==n?(c=s.jsxs("div",{className:"flex items-center gap-2",children:[o,n]}),e[5]=o,e[6]=n,e[7]=c):c=e[7];let l;e[8]!==r.description?(l=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]=l):l=e[9];let a;e[10]!==c||e[11]!==l?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[c,l]})]}),e[10]=c,e[11]=l,e[12]=a):a=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 d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let c;e[3]!==n?(c=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=c):c=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let a;e[7]!==l?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=a):a=e[8];let u;e[9]!==c||e[10]!==a?(u=s.jsxs("div",{children:[c,a]}),e[9]=c,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=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:[o,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,o]=v.useState("organization"),[n,c]=v.useState(""),[l,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){o("organization"),c(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!l))try{await m.mutateAsync({scope:i,name:n.trim(),value:l,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{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(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>o(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{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(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>c(f.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(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!l,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,o]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>o(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:o})]}),t[1]=i,t[2]=m):m=t[2],m}let n,c,l;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"":"s";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e("settings.secrets.secretsCount",{count:r.length,plural:p}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>o(!0),t[14]=f):f=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:f,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],c=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.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,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.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=c,t[7]=l}else n=t[5],c=t[6],l=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:o}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==c||t[27]!==l||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,c,l,a]}),t[25]=n,t[26]=c,t[27]=l,t[28]=a,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(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(C.Title,{children:"Secrets"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[e,s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})})]})})})}),t[1]=r):r=t[1],r}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){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{Re as default};
1
+ import{c as j,j as s,E as $,r as v,w as k,B as _,t as w}from"./index-VazNHrO3.js";import{i as F}from"./AlertCircle-CF1-Ouso.js";import{s as E}from"./Plus-DT-2W1wT.js";import{s as B}from"./User01-CF6pDsdw.js";import{t as L}from"./Users01-C_k5OJBp.js";import{e as O,d as R,D as A,a as I,h as q,c as V}from"./dialog-TaEY2Kx_.js";import{I as z}from"./input-BC7Dr3Si.js";import{L as N}from"./label-BvlvBg6i.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-BuKjeCrb.js";import{S as M}from"./skeleton-BmuNVVtD.js";import{T as Q}from"./textarea-DILcuTPp.js";import{P as C}from"./index-D3WGUwBg.js";import{c as U}from"./settings-section-DN4ehJk4.js";import{u as y}from"./use-t-CvXQXPPS.js";import{u as W,a as X}from"./use-secrets-ANIEIjB0.js";import{R as Y}from"./require-capability-BD4RU70c.js";import"./X-BWn3kDs2.js";import"./tooltip-plNKOrsB.js";import"./ChevronUp-DAExiZbv.js";import"./ChevronDown-DyjAqI3m.js";import"./sidebar-BudM_B2c.js";import"./LayoutLeft-fGt4B_V6.js";import"./use-mobile-D6QzYWiJ.js";import"./card-CHkDvr9O.js";import"./ArrowUpRight-Bxfx0mGn.js";import"./studio-tools-JQnAx-yt.js";import"./use-capability-PzwH7JXT.js";import"./access-gate-7v8G4_rr.js";import"./capability-load-error-BPWNkWfC.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(F,{size:16}),e[0]=o):o=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 c;return e[4]!==n?(c=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=c):c=e[5],c}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),o=r==="user"?B:L;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 c=n;let l;e[3]!==o?(l=s.jsx(o,{size:12}),e[3]=o,e[4]=l):l=e[4];let a;return e[5]!==c||e[6]!==l?(a=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:[l,c]}),e[5]=c,e[6]=l,e[7]=a):a=e[7],a}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 o;e[1]!==r.name?(o=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=o):o=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 c;e[5]!==o||e[6]!==n?(c=s.jsxs("div",{className:"flex items-center gap-2",children:[o,n]}),e[5]=o,e[6]=n,e[7]=c):c=e[7];let l;e[8]!==r.description?(l=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]=l):l=e[9];let a;e[10]!==c||e[11]!==l?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[c,l]})]}),e[10]=c,e[11]=l,e[12]=a):a=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 d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let c;e[3]!==n?(c=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=c):c=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let a;e[7]!==l?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=a):a=e[8];let u;e[9]!==c||e[10]!==a?(u=s.jsxs("div",{children:[c,a]}),e[9]=c,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=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:[o,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,o]=v.useState("organization"),[n,c]=v.useState(""),[l,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){o("organization"),c(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!l))try{await m.mutateAsync({scope:i,name:n.trim(),value:l,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{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(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>o(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{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(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>c(f.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(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!l,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,o]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>o(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:o})]}),t[1]=i,t[2]=m):m=t[2],m}let n,c,l;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"":"s";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e("settings.secrets.secretsCount",{count:r.length,plural:p}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>o(!0),t[14]=f):f=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:f,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],c=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.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,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.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=c,t[7]=l}else n=t[5],c=t[6],l=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:o}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==c||t[27]!==l||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,c,l,a]}),t[25]=n,t[26]=c,t[27]=l,t[28]=a,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(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(C.Title,{children:"Secrets"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[e,s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})})]})})})}),t[1]=r):r=t[1],r}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){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{Re as default};