decocms 4.262.2 → 4.262.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.
- package/dist/client/assets/{AlertCircle-Cs0_5dJP.js → AlertCircle-BvnCHRsL.js} +1 -1
- package/dist/client/assets/{AreaChart-CHQsVobR.js → AreaChart-CM7Z3257.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BV5kr608.js → ArrowLeft-DSnMT0wO.js} +1 -1
- package/dist/client/assets/{ArrowUp-CYYNqqtk.js → ArrowUp-DeOdfuRg.js} +1 -1
- package/dist/client/assets/{Check-oaDdBPY_.js → Check-CvmqPlvr.js} +1 -1
- package/dist/client/assets/{CheckCircle-DOwlTosc.js → CheckCircle-qbxVqwNt.js} +1 -1
- package/dist/client/assets/{ChevronDown-D4KJzncC.js → ChevronDown-Bw9gK0Xq.js} +1 -1
- package/dist/client/assets/{ChevronRight-D0_D6Gjp.js → ChevronRight-exnNya0u.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DVW_1Xkp.js → ChevronSelectorVertical-BehAh9wJ.js} +1 -1
- package/dist/client/assets/{ChevronUp-DO_yMzFn.js → ChevronUp-MaQ-QeOM.js} +1 -1
- package/dist/client/assets/{Copy01-C8MiKxAi.js → Copy01-vLHgvY5u.js} +1 -1
- package/dist/client/assets/{CreditCard01-Dud41vSB.js → CreditCard01-CaCvJmnt.js} +1 -1
- package/dist/client/assets/{DotsVertical-CLgrZzec.js → DotsVertical-Cvw7phqC.js} +1 -1
- package/dist/client/assets/{Download01-eRicV-i2.js → Download01-DTlq4gRe.js} +1 -1
- package/dist/client/assets/{Eye-Bd2Hxw5w.js → Eye-DVc3JZNh.js} +1 -1
- package/dist/client/assets/{FilterLines-CHGYljjI.js → FilterLines-Db4KNc5A.js} +1 -1
- package/dist/client/assets/{Globe01-BqPfLYYz.js → Globe01-CGhdOPeO.js} +1 -1
- package/dist/client/assets/{Globe04-R7VMBrL6.js → Globe04-Bn7L7yJn.js} +1 -1
- package/dist/client/assets/{HardDrive-CHIdpXWk.js → HardDrive-CeTpIa5B.js} +1 -1
- package/dist/client/assets/{Key01-DGzjYvtu.js → Key01-CoTP2UMr.js} +1 -1
- package/dist/client/assets/{LinkExternal01-ChnQgBmq.js → LinkExternal01-sFAx5Ukt.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-D8bJMWmy.js → LockUnlocked01-CUMEjJeX.js} +1 -1
- package/dist/client/assets/{LogOut01-CKQOVxEj.js → LogOut01-nrR9abDU.js} +1 -1
- package/dist/client/assets/{Monitor01-AEiZZnuX.js → Monitor01-Caa2kHbv.js} +1 -1
- package/dist/client/assets/{Palette-4FLBrtbC.js → Palette-qIK2euAO.js} +1 -1
- package/dist/client/assets/{Play-BKsJRxtz.js → Play-9DT0q0lw.js} +1 -1
- package/dist/client/assets/{Plus-C6jj2XdA.js → Plus-CcMb81sq.js} +1 -1
- package/dist/client/assets/{SearchLg-DrH7OUXX.js → SearchLg-BM4kNaJH.js} +1 -1
- package/dist/client/assets/{SearchMd-uyl5rjs_.js → SearchMd-VcuMXm67.js} +1 -1
- package/dist/client/assets/{Settings02-DbLXkDpj.js → Settings02-CVmbd-FU.js} +1 -1
- package/dist/client/assets/{Share07-gfLIkwCQ.js → Share07-CPph4sPw.js} +1 -1
- package/dist/client/assets/{Shield01-CzWrY2pq.js → Shield01-Q9YdpfGm.js} +1 -1
- package/dist/client/assets/{Stars01-D0oo9JkS.js → Stars01-DwXtGLac.js} +1 -1
- package/dist/client/assets/{Stars02-fSLomnZb.js → Stars02-C7s7bRT8.js} +1 -1
- package/dist/client/assets/{Sun-CYT3AzfW.js → Sun-Wqe7_tya.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CtNoRAHC.js → SwitchHorizontal01-c5W4LuWP.js} +1 -1
- package/dist/client/assets/{Tool01-BTKw-DrV.js → Tool01-CHrRmwEP.js} +1 -1
- package/dist/client/assets/{Tool02-BznGIgWv.js → Tool02--4JFOFNk.js} +1 -1
- package/dist/client/assets/{Trash01-rLv0gf6B.js → Trash01-Dwcak20e.js} +1 -1
- package/dist/client/assets/{TrendUp01-kz6M8XZt.js → TrendUp01-Cg5hOl22.js} +1 -1
- package/dist/client/assets/{Upload01-B0CpLID5.js → Upload01-BfWAgMYo.js} +1 -1
- package/dist/client/assets/{User01-B_dmPap3.js → User01-bzqmgkdh.js} +1 -1
- package/dist/client/assets/{UserSquare-BvrjDKas.js → UserSquare-Cqogxcq4.js} +1 -1
- package/dist/client/assets/{Users01-D02GvOji.js → Users01-8maiPdfp.js} +1 -1
- package/dist/client/assets/{Users03-BPXvVP2T.js → Users03-BWb9cXAs.js} +1 -1
- package/dist/client/assets/{XCircle-JHrviimK.js → XCircle-BAgn0fqe.js} +1 -1
- package/dist/client/assets/{XClose-BPG2AK2u.js → XClose-BMb-wb3G.js} +1 -1
- package/dist/client/assets/{YAxis-BbFbrrvZ.js → YAxis-BRPAf7XN.js} +1 -1
- package/dist/client/assets/{Zap-e2oHqv2R.js → Zap-BlGJcPsL.js} +1 -1
- package/dist/client/assets/{ZapSquare-C6x_2obb.js → ZapSquare-BIY-vKSa.js} +1 -1
- package/dist/client/assets/{access-gate-FsLdBJwD.js → access-gate-DMwqkzwZ.js} +1 -1
- package/dist/client/assets/{agent-icon-BREl9kPZ.js → agent-icon-Bg93N3p3.js} +1 -1
- package/dist/client/assets/{agents-list-Dbiv6IK5.js → agents-list-w0DVpwed.js} +1 -1
- package/dist/client/assets/{ai-providers-DxCWV98i.js → ai-providers-DjbOb33t.js} +1 -1
- package/dist/client/assets/{alert-CrFQQGoH.js → alert-Cy8GQrAW.js} +1 -1
- package/dist/client/assets/{alert-dialog-BblLZdJ2.js → alert-dialog-Blc5Cb_n.js} +1 -1
- package/dist/client/assets/{api-keys-_ELOxMNr.js → api-keys-4IIvoiO2.js} +1 -1
- package/dist/client/assets/{app-editor-DU9Xstf5.js → app-editor-9pkBQ6Nv.js} +1 -1
- package/dist/client/assets/{auth-BtSQB73z.js → auth-BiJfhAJo.js} +1 -1
- package/dist/client/assets/{auth-catchall-BanAiGgv.js → auth-catchall-CIuphYlY.js} +1 -1
- package/dist/client/assets/{auth-entry-DBxw1F97.js → auth-entry--RSvMdYj.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Ungm7C4H.js → auth-split-layout-C1TsLr6w.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-jjJv5TUF.js → authenticate-and-persist-oauth-C6dmtZJC.js} +1 -1
- package/dist/client/assets/{automation-list-row-Ccl7kkMS.js → automation-list-row-BaMhHZG8.js} +1 -1
- package/dist/client/assets/{automation-runs-NIKzdYRJ.js → automation-runs-CS-kj52m.js} +1 -1
- package/dist/client/assets/{automations-CRY1l_B-.js → automations-aVxEfVo_.js} +1 -1
- package/dist/client/assets/{avatar-DqiNWzD_.js → avatar-DC9Z2qvJ.js} +1 -1
- package/dist/client/assets/{badge-CIdIzfAb.js → badge-B8-k3EUv.js} +1 -1
- package/dist/client/assets/{block-document-DuWkuTQG.js → block-document-DCfyS2MB.js} +1 -1
- package/dist/client/assets/{buckets-Bi_BdciW.js → buckets-DL9BzYMN.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-C8M2uEI9.js → bulk-category-panel-InR_b8T9.js} +1 -1
- package/dist/client/assets/{capability-load-error-CnSjoSp0.js → capability-load-error-Bt5z8vOI.js} +1 -1
- package/dist/client/assets/{cards-ZfXzoeMH.js → cards-CfOMIeup.js} +1 -1
- package/dist/client/assets/{category-editor-CJ_gQ-Ly.js → category-editor-C-141yRd.js} +1 -1
- package/dist/client/assets/{chart-BX5w8SBV.js → chart-Bp_8lNWc.js} +1 -1
- package/dist/client/assets/{chat-context-fF1VUEpR.js → chat-context-BVcFZzRo.js} +1 -1
- package/dist/client/assets/{checkbox-CRLq7hyZ.js → checkbox-gtgappW6.js} +1 -1
- package/dist/client/assets/{choose-editor-yGlktlBl.js → choose-editor-BT0zYOpp.js} +1 -1
- package/dist/client/assets/{cli-auth-success-D6FEJpx1.js → cli-auth-success-BUeNE325.js} +1 -1
- package/dist/client/assets/{collection-detail-CjjaxuFv.js → collection-detail-BlwWgUUK.js} +1 -1
- package/dist/client/assets/{collection-display-button-B8zum8EY.js → collection-display-button-BPrVUB4m.js} +1 -1
- package/dist/client/assets/{collection-search-CxxFS6Ig.js → collection-search-Vac8r93V.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-yxY4QGSw.js → collection-table-wrapper-CpdGzWQF.js} +1 -1
- package/dist/client/assets/{collection-tabs-CyjLcngS.js → collection-tabs-C9VoP140.js} +1 -1
- package/dist/client/assets/{command-CjxG2Iro.js → command-CcinGNo9.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-B3UFOgg2.js → commerce-onboarding-DcQTTTO7.js} +1 -1
- package/dist/client/assets/{connect-DGSvdjGa.js → connect-CSzIyoYe.js} +1 -1
- package/dist/client/assets/{connection-DE_K_JMd.js → connection-BXsmmHUF.js} +1 -1
- package/dist/client/assets/{connection-card-WA8IAQ5R.js → connection-card-RUMSvvgt.js} +1 -1
- package/dist/client/assets/{connection-detail-CJyszTHN.js → connection-detail-D_mSdG0d.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BJLMkuwA.js → connection-form-helpers-n9dgvIOZ.js} +1 -1
- package/dist/client/assets/{connections-Cs86-Yhw.js → connections-DbHR38pT.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DFDSj-P5.js → decopilot-sse-pool-BdL2p5Zn.js} +1 -1
- package/dist/client/assets/{dialog-Di5cV5GA.js → dialog-BxxhOAOz.js} +1 -1
- package/dist/client/assets/{domain-settings-CCz74J23.js → domain-settings-BL-RzCoY.js} +1 -1
- package/dist/client/assets/{drawer-DAD7zKxC.js → drawer-CWCCrbvj.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DzsdK4_X.js → dropdown-menu-DjqcVkft.js} +1 -1
- package/dist/client/assets/{empty-state-DqUFc3hM.js → empty-state-BjhrOSZy.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BFYw2yZq.js → extract-connection-data-Co_I7r-u.js} +1 -1
- package/dist/client/assets/{file-explorer-Bg8FzATq.js → file-explorer-Ge5kfrQE.js} +1 -1
- package/dist/client/assets/{file-type-icon-CUMNQIou.js → file-type-icon-CXfu_sLu.js} +1 -1
- package/dist/client/assets/{form-CyEYjhyK.js → form-BDj8tP8f.js} +1 -1
- package/dist/client/assets/{general-BuYUOxR5.js → general-Cjqq4ZAN.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BY8Kps_u.js → github-repo-picker-CHfsU0i2.js} +1 -1
- package/dist/client/assets/{hooks-DZF3bc8l.js → hooks-abNM-N_i.js} +1 -1
- package/dist/client/assets/{index-CiSe8Cac.js → index-4Yq2AnCq.js} +5 -5
- package/dist/client/assets/{index-yn9u7znV.js → index-B0XhPTMj.js} +1 -1
- package/dist/client/assets/{index-C7q5tOP5.js → index-BM9Vh1Yj.js} +42 -42
- package/dist/client/assets/{index-COtsXzG2.js → index-BP4SsG97.js} +1 -1
- package/dist/client/assets/{index-Bkau3X3N.js → index-BYFE8WzE.js} +1 -1
- package/dist/client/assets/{index-DYbJAlRQ.js → index-BphIQXnQ.js} +1 -1
- package/dist/client/assets/{index-JCSsTu88.js → index-CrW_FWNw.js} +1 -1
- package/dist/client/assets/{index-D2QDj8mv.js → index-D15SPebw.js} +1 -1
- package/dist/client/assets/{index-21bAMZzQ.js → index-Ddz3moYq.js} +1 -1
- package/dist/client/assets/{index-BiZkFUB0.js → index-hhsQi3AL.js} +1 -1
- package/dist/client/assets/{index-redirect-BJaa8ScU.js → index-redirect-DQZCibN3.js} +1 -1
- package/dist/client/assets/{infra-billing-CkBxMNdJ.js → infra-billing-Cu6b4VZm.js} +1 -1
- package/dist/client/assets/{input-BeHo3cOe.js → input-BgqlRc0-.js} +1 -1
- package/dist/client/assets/{integration-icon-CE0pC06S.js → integration-icon-bu5yzyqj.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DELtimvm.js → invite-member-dialog-DCR52CVj.js} +1 -1
- package/dist/client/assets/{label-fg-bJqsj.js → label-C_X4tCX_.js} +1 -1
- package/dist/client/assets/{layout-DCH95yBh.js → layout-D7j48Ulr.js} +1 -1
- package/dist/client/assets/{login-DlOtIpZ8.js → login-Dta3DklU.js} +1 -1
- package/dist/client/assets/{mcp-oauth-0mbfPzWv.js → mcp-oauth-D1ERDyCx.js} +1 -1
- package/dist/client/assets/{members-xjPI9f89.js → members-GXLEk5Lf.js} +1 -1
- package/dist/client/assets/{monaco-editor-Cu2eIpH7.js → monaco-editor-BWHKq03x.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-uH5_-pOM.js → monitoring-stats-row-DfHcNfrZ.js} +1 -1
- package/dist/client/assets/{multi-select-BHaFFvTI.js → multi-select-hMIHDWXx.js} +1 -1
- package/dist/client/assets/{oauth-callback-CaYCTKw1.js → oauth-callback-BdQr1Zgy.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-3JK73-Jn.js → oauth-callback-ai-provider-B8Til3I5.js} +1 -1
- package/dist/client/assets/{onboarding-BqTRC0BX.js → onboarding-C8MOy5D4.js} +1 -1
- package/dist/client/assets/{org-layout-658hGD_u.js → org-layout-CNw28QT8.js} +1 -1
- package/dist/client/assets/{organization-choice-I4Nn73St.js → organization-choice-BRlxfJjE.js} +1 -1
- package/dist/client/assets/{orgs-BLtKxfRv.js → orgs-Deevzdw_.js} +1 -1
- package/dist/client/assets/{page-seo-form-ZWpWOge_.js → page-seo-form-BxHhmgJI.js} +1 -1
- package/dist/client/assets/{popover-CsU_Al3m.js → popover-DVhADKGT.js} +1 -1
- package/dist/client/assets/{post-calendar-BDk4_0vL.js → post-calendar-DfXufxog.js} +1 -1
- package/dist/client/assets/{post-editor-_Ayl-yhb.js → post-editor-B9QmuIAN.js} +1 -1
- package/dist/client/assets/{primitives-DJN0y5_u.js → primitives-DBNBpEIr.js} +1 -1
- package/dist/client/assets/{profile-CGstW6cW.js → profile-Fudg8Rj-.js} +1 -1
- package/dist/client/assets/{project-app-view-eB1cBeXR.js → project-app-view-f5KhJYpF.js} +1 -1
- package/dist/client/assets/record-editor-7XhzkNI5.js +1 -0
- package/dist/client/assets/{redirect-editor-CKGkAqGh.js → redirect-editor-RofnM1-d.js} +1 -1
- package/dist/client/assets/registry-DP2-dRUr.js +2 -0
- package/dist/client/assets/{registry-layout-BoFeBLYZ.js → registry-layout-QvRa4zWg.js} +1 -1
- package/dist/client/assets/{reports-CFGBybVG.js → reports-SIPJ_FTu.js} +1 -1
- package/dist/client/assets/{require-capability-Cj3dV9Kf.js → require-capability-i_K5dXXM.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cyaw_iy8.js → required-auth-layout-C2YDhAkS.js} +1 -1
- package/dist/client/assets/{reset-password-CagUInGX.js → reset-password-DUYh_Ex0.js} +1 -1
- package/dist/client/assets/{roles-CHkEiAFW.js → roles-rWGeG0Gk.js} +1 -1
- package/dist/client/assets/{search-input-DN3i2WD-.js → search-input-CE1-9e_W.js} +1 -1
- package/dist/client/assets/{secrets-Dv_mMPJY.js → secrets-BYvrb71b.js} +1 -1
- package/dist/client/assets/{sections-editor-C9mkO_1V.js → sections-editor-XOT8ORMu.js} +1 -1
- package/dist/client/assets/{select-DCoiFI7M.js → select-D4XDO-b1.js} +1 -1
- package/dist/client/assets/{select-model-CvLwRIPZ.js → select-model-LzEeSCi-.js} +1 -1
- package/dist/client/assets/{self-tool-result-BEWYx8r-.js → self-tool-result-C0QACTme.js} +1 -1
- package/dist/client/assets/{seo-editor-DlPm0nnL.js → seo-editor-CCMJwcdN.js} +1 -1
- package/dist/client/assets/{settings-layout-CBMQHJZ9.js → settings-layout-CNjGXU1i.js} +1 -1
- package/dist/client/assets/{shell-controls-BbfCqc5U.js → shell-controls-DkU_rf0e.js} +1 -1
- package/dist/client/assets/{shell-layout-yWSFAx6Q.js → shell-layout-Di7Xlkue.js} +1 -1
- package/dist/client/assets/{spinner-CitdR1OI.js → spinner-o36YaNXG.js} +1 -1
- package/dist/client/assets/{sprints-CzaQOXIh.js → sprints-B6GIs6D5.js} +1 -1
- package/dist/client/assets/{sso-CMTdP9RH.js → sso-DhwkpX81.js} +1 -1
- package/dist/client/assets/{store-Deqt71S6.js → store-bEZd_Bf0.js} +1 -1
- package/dist/client/assets/store-registry-BU_soOsj.js +2 -0
- package/dist/client/assets/{switch-DGGAf7Ky.js → switch-BzkLU8Zp.js} +1 -1
- package/dist/client/assets/{synced-repos-D84q8t8K.js → synced-repos-FbD-wxyo.js} +1 -1
- package/dist/client/assets/{tab-id-Bl6vDiX_.js → tab-id-SwGHGNsn.js} +1 -1
- package/dist/client/assets/{table-qhdJL7ym.js → table-D9qBqsbI.js} +1 -1
- package/dist/client/assets/{tabs-CJ63Yelw.js → tabs-DX5CgudF.js} +1 -1
- package/dist/client/assets/{task-key-poglsLlV.js → task-key-DFK-svCh.js} +1 -1
- package/dist/client/assets/{tasks-BwuoP6ym.js → tasks-ChTPUQIR.js} +1 -1
- package/dist/client/assets/{textarea-DT5jKN3I.js → textarea-JZ07srxU.js} +1 -1
- package/dist/client/assets/{toggle-group-BrjNVHZg.js → toggle-group-C-8jj8vb.js} +1 -1
- package/dist/client/assets/{toolbar-BPTf2PkK.js → toolbar-KC_M2zlG.js} +1 -1
- package/dist/client/assets/{track-C1PgBR98.js → track-DMzFIwuY.js} +1 -1
- package/dist/client/assets/{types-nWiotTzC.js → types-e4E0Y6_p.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Dt0BoQ6R.js → use-ai-providers-BhDW0mip.js} +1 -1
- package/dist/client/assets/{use-api-keys-CdJTFKix.js → use-api-keys-DUe0nOoD.js} +1 -1
- package/dist/client/assets/{use-automations-Dec6_P7o.js → use-automations-DW5mqeZw.js} +1 -1
- package/dist/client/assets/{use-autosave-CFo-d0lk.js → use-autosave-DPidqB8P.js} +1 -1
- package/dist/client/assets/{use-clock-tick-C2R7dZgK.js → use-clock-tick-Bo5MaslT.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-okiAFVKu.js → use-commerce-diagnostic-c0vbWTGh.js} +1 -1
- package/dist/client/assets/{use-connection-CEoMJ5BZ.js → use-connection-dlqCn-N5.js} +1 -1
- package/dist/client/assets/{use-copy-D8TPMAIP.js → use-copy-DCBv-AgW.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-pzNa9orI.js → use-create-virtual-mcp-Bv3do38i.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Dd4BmXBu.js → use-debounced-autosave-D_ODzKn4.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BGTwxMpt.js → use-debounced-value-DTvnosuU.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-d-IQFiB-.js → use-decopilot-events-j8KKt5Ge.js} +1 -1
- package/dist/client/assets/{use-delete-connection-22yEKKhO.js → use-delete-connection-CsbIV6It.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DUbNwnwl.js → use-deployment-admin-BZoxs44p.js} +1 -1
- package/dist/client/assets/{use-file-configs-D7s6vZyr.js → use-file-configs-MSi6dNk7.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B-ZdDRBK.js → use-infinite-scroll-i_XhEpG8.js} +1 -1
- package/dist/client/assets/{use-join-requests-B9ENuKdZ.js → use-join-requests-Cu4anPNe.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B0NvdMFO.js → use-mcp-client-zn-75Bb8.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BXGqh6u2.js → use-mcp-tools-1uxhMFj3.js} +1 -1
- package/dist/client/assets/{use-members-CjqUwIa1.js → use-members-D8_mU_mD.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DFBX4NgD.js → use-navigate-to-agent-BWwhqkJd.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BlTgW5hO.js → use-org-auth-client-DX7KVEgG.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BXj5U8dw.js → use-org-repo-syncs-DVaY2GD5.js} +1 -1
- package/dist/client/assets/{use-org-sso-Sr1yAqdO.js → use-org-sso-cJMtLFjg.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bn7X5xfA.js → use-organization-roles-CIz7DCUv.js} +1 -1
- package/dist/client/assets/{use-organization-settings-VXr7XQBv.js → use-organization-settings-BX22DgX6.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CZT01-wP.js → use-registry-connections-BRXyUJoG.js} +1 -1
- package/dist/client/assets/{use-secrets-DuVOojdg.js → use-secrets-BxcvnoPW.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BFSp1G_A.js → use-section-preview-base-BqDGrbIq.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DgRIdB6D.js → use-status-sounds-BE3lscmh.js} +1 -1
- package/dist/client/assets/{use-tags-CcOQ6JUf.js → use-tags-CFAYQWxM.js} +1 -1
- package/dist/client/assets/{use-view-mode-i7-x3fEd.js → use-view-mode-X9z97RzC.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BWngGnxf.js → use-virtual-mcp-C2v5l8qY.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B3t9rQO7.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-zeW-Zl8F.js +1 -0
- package/dist/client/assets/{users-BOtdsp6D.js → users-BT8O6l9E.js} +1 -1
- package/dist/client/assets/{variant-calendar-osbD9ZaI.js → variant-calendar-BAYjKcS4.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CpGIMSpM.js → view-mode-toggle-DU-njYCZ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/record-editor-CA8MGulp.js +0 -1
- package/dist/client/assets/registry-D6lbkf0U.js +0 -2
- package/dist/client/assets/store-registry-D5AcBWuP.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BLdoNguA.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bm4SyG80.js +0 -1
package/dist/client/assets/{require-capability-Cj3dV9Kf.js → require-capability-i_K5dXXM.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,aR as l,j as m}from"./index-
|
|
1
|
+
import{c as p,aR as l,j as m}from"./index-4Yq2AnCq.js";import{A as u}from"./access-gate-DMwqkzwZ.js";function f(c){const t=p.c(6),{capability:n,area:e,children:r}=c,{granted:i,loading:s,error:o}=l(n);let a;return t[0]!==e||t[1]!==r||t[2]!==o||t[3]!==i||t[4]!==s?(a=m.jsx(u,{granted:i,loading:s,error:o,area:e,children:r}),t[0]=e,t[1]=r,t[2]=o,t[3]=i,t[4]=s,t[5]=a):a=t[5],a}export{f as R};
|
package/dist/client/assets/{required-auth-layout-Cyaw_iy8.js → required-auth-layout-C2YDhAkS.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-
|
|
1
|
+
import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-4Yq2AnCq.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(g,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function f(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{f as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-
|
|
1
|
+
import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-4Yq2AnCq.js";import{I as D}from"./input-BgqlRc0-.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ie,r as $,H as Ge,K as de,o as Ve,j as s,n as Z,k as Ce,B as ae,c as X,ak as qe,al as we,am as re,aq as Ze,ar as Je,p as ot,ao as bt,ap as Ot,e as nt,t as be,q as Ye,P as Ae,C as it,d6 as We,d7 as Xe,d8 as et,D as jt,aa as Me,ab as De,a8 as ve,a9 as Le,aj as tt,bF as Mt,u as rt,da as at,eT as Dt,E as vt,d as Lt}from"./index-CiSe8Cac.js";import{u as Pt}from"./use-organization-roles-Bn7X5xfA.js";import{u as ze}from"./use-org-auth-client-BlTgW5hO.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as Oe}from"./badge-CIdIzfAb.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as ht,g as xt,e as Tt}from"./alert-dialog-BblLZdJ2.js";import{c as wt,D as Gt,b as kt,a as Ut}from"./dropdown-menu-DzsdK4_X.js";import{a as Bt}from"./DotsVertical-CLgrZzec.js";import{s as Be}from"./Plus-C6jj2XdA.js";import{s as Vt}from"./Trash01-rLv0gf6B.js";import{C as Yt}from"./collection-table-wrapper-yxY4QGSw.js";import{E as st}from"./empty-state-DqUFc3hM.js";import{S as Ke}from"./search-input-DN3i2WD-.js";import{P as pt,D as _t}from"./ai-providers-logos-DD3qZ33J.js";import{I as Fe}from"./integration-icon-CE0pC06S.js";import{u as zt}from"./use-infinite-scroll-B-ZdDRBK.js";import{C as $e}from"./checkbox-CRLq7hyZ.js";import{i as Kt}from"./ArrowLeft-BV5kr608.js";import{u as Ft}from"./useSuspenseInfiniteQuery-Bm4SyG80.js";import{u as $t}from"./use-mcp-client-B0NvdMFO.js";import{S as Qt}from"./constants-_08zpzmT.js";import{C as Ht}from"./collection-search-CxxFS6Ig.js";import{p as qt}from"./connection-DE_K_JMd.js";import{a as Et}from"./use-members-CjqUwIa1.js";import{g as It}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-CEoMJ5BZ.js";import{u as Jt,g as Wt}from"./use-ai-providers-Dt0BoQ6R.js";import{A as Rt}from"./avatar-DqiNWzD_.js";import{S as je}from"./switch-DGGAf7Ky.js";import{t as Xt}from"./ChevronDown-D4KJzncC.js";import{i as es}from"./ChevronRight-D0_D6Gjp.js";import{A as ts}from"./access-gate-FsLdBJwD.js";import"./Check-oaDdBPY_.js";import"./table-qhdJL7ym.js";import"./ArrowUp-CYYNqqtk.js";import"./SearchMd-uyl5rjs_.js";import"./Tool02-BznGIgWv.js";import"./agent-icon-BREl9kPZ.js";import"./AlertCircle-Cs0_5dJP.js";import"./Tool01-BTKw-DrV.js";import"./XCircle-JHrviimK.js";import"./TrendUp01-kz6M8XZt.js";import"./ZapSquare-C6x_2obb.js";import"./Users03-BPXvVP2T.js";import"./UserSquare-BvrjDKas.js";import"./CheckCircle-DOwlTosc.js";import"./ChevronSelectorVertical-DVW_1Xkp.js";import"./ChevronUp-DO_yMzFn.js";import"./Stars02-fSLomnZb.js";import"./Copy01-C8MiKxAi.js";import"./CreditCard01-Dud41vSB.js";import"./Download01-eRicV-i2.js";import"./Settings02-DbLXkDpj.js";import"./Eye-Bd2Hxw5w.js";import"./FilterLines-CHGYljjI.js";import"./Share07-gfLIkwCQ.js";import"./Globe01-BqPfLYYz.js";import"./Globe04-R7VMBrL6.js";import"./SwitchHorizontal01-CtNoRAHC.js";import"./HardDrive-CHIdpXWk.js";import"./Key01-DGzjYvtu.js";import"./LinkExternal01-ChnQgBmq.js";import"./LockUnlocked01-D8bJMWmy.js";import"./LogOut01-CKQOVxEj.js";import"./Monitor01-AEiZZnuX.js";import"./Sun-CYT3AzfW.js";import"./Palette-4FLBrtbC.js";import"./Play-BKsJRxtz.js";import"./SearchLg-DrH7OUXX.js";import"./Shield01-CzWrY2pq.js";import"./Stars01-D0oo9JkS.js";import"./Upload01-B0CpLID5.js";import"./User01-B_dmPap3.js";import"./Users01-D02GvOji.js";import"./XClose-BPG2AK2u.js";import"./Zap-e2oHqv2R.js";import"./auth-BtSQB73z.js";import"./capability-load-error-CnSjoSp0.js";const Qe="basic-usage",He=[{id:Qe,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","GITHUB_SEARCH_BRANCHES","GITHUB_PR_STATE","GITHUB_LAST_PUBLISHED_PR","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_ITEM_PR_LINK","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_SYNC_RUN"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...He.find(t=>t.id===Qe)?.tools??[]];const ss=["agents:manage","connections:manage"];new Set(He.filter(t=>ss.includes(t.id)).flatMap(t=>t.tools));function ls(){const t=new Map;for(const e of He){if(e.id===Qe)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function os(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ns(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}function is(t){const e=X.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:c,onSelect:u,onToggle:f}=t,d=r?"bg-accent/50":"hover:bg-muted/50";let h;e[0]!==d?(h=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=h):h=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Fe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let g;e[5]!==l.title?(g=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=g):g=e[6];let x;e[7]!==u||e[8]!==a||e[9]!==g?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:u,children:[a,g]}),e[7]=u,e[8]=a,e[9]=g,e[10]=x):x=e[10];let m;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==f||e[15]!==c?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx($e,{checked:n,onCheckedChange:f,onClick:rs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=f,e[15]=c,e[16]=m):m=e[16];let T;return e[17]!==h||e[18]!==x||e[19]!==m?(T=s.jsxs("div",{className:h,children:[x,m]}),e[17]=h,e[18]=x,e[19]=m,e[20]=T):T=e[20],T}function rs(t){return t.stopPropagation()}function as(t){const e=X.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,c=`tool-${l}-${r.name}`,u=n?"text-foreground":"text-muted-foreground";let f;e[0]!==u?(f=Z("text-sm font-medium",u),e[0]=u,e[1]=f):f=e[1];let d;e[2]!==f||e[3]!==r.name?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:f,children:r.name})}),e[2]=f,e[3]=r.name,e[4]=d):d=e[4];let h;e[5]!==r.description?(h=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=h):h=e[6];let a;e[7]!==d||e[8]!==h?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,h]}),e[7]=d,e[8]=h,e[9]=a):a=e[9];const g=`tool-${l}-${r.name}`;let x;e[10]!==n||e[11]!==o||e[12]!==g?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx($e,{id:g,checked:n,onCheckedChange:o,onClick:cs})}),e[10]=n,e[11]=o,e[12]=g,e[13]=x):x=e[13];let m;return e[14]!==c||e[15]!==a||e[16]!==x?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,x]}),e[14]=c,e[15]=a,e[16]=x,e[17]=m):m=e[17],m}function cs(t){return t.stopPropagation()}function ds({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,c]=$.useState(""),u=r!==void 0?r:o,f=$.useDeferredValue(u),[d,h]=$.useState("all"),[a,g]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:m}=Ge(),T=$t({connectionId:Qt,orgId:m.id,orgSlug:m.slug}),C=100,R=f.trim(),I=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,b=!!l,N={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:0,...b&&{include_virtual:!0}},M=JSON.stringify(N),{data:S,fetchNextPage:O,hasNextPage:D,isFetchingNextPage:_}=Ft({queryKey:de.collectionListInfinite(T,m.id,"","CONNECTIONS",M),queryFn:async({pageParam:p=0})=>(await T.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:p,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(p,w)=>{if(p?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),A=S?.pages.flatMap(p=>p?.items??[])??[],v=zt(O,D??!1,_),i=l?A.filter(p=>p.connection_type!=="VIRTUAL"?!0:qt(p.connection_url)!==l):A,E=x.current,k=[...E.values()].map(p=>i.find(w=>w.id===p)).filter(p=>p!==void 0),G=i.filter(p=>!E.has(p.id)),Y=[...k,...G],L=p=>{const w=t[p];return w!==void 0&&w.length>0},z=Y.filter(p=>{if(d==="all")return!0;const w=L(p.id);return d==="selected"?w:d==="unselected"?!w:!0}),[P,K]=$.useState(Y[0]?.id??null),V=P?Y.find(p=>p.id===P)??null:null,{data:U,isFetching:B}=Ve({queryKey:de.collectionItem(T,m.id,"","CONNECTIONS",P??""),queryFn:async()=>P?(await T.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:P}})).structuredContent?.item??null:null,enabled:!!P,staleTime:3e4}),Q=U?.tools??[],J=(p,w)=>t[p]?.includes(w)??!1,te=(p,w)=>{const H=t[p]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[p]:se[p]=le}else se[p]=[...H,w];e(se)},oe=p=>{const w=p===P?Q:[];if(!w.length)return;const H=t[p]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[p]:(le[p]=q,K(p)),e(le)},F=p=>{K(p),g(!0)},W=()=>{g(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[r===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>h("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>h("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>h("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:z.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(u?"common.toolSetSelector.noConnectionsFound":d==="selected"?"common.toolSetSelector.noServersSelected":d==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[z.map(p=>{const w=P===p.id,H=w?Q.length:0,q=t[p.id]?.length??0;return s.jsx(is,{connection:{...p,tools:w?Q:p.tools},isSelected:w,hasToolsEnabled:L(p.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>F(p.id),onToggle:()=>oe(p.id)},p.id)}),s.jsx("div",{ref:v,className:"h-4"}),_&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Ce,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Kt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Fe,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ce,{size:18,className:"animate-spin text-muted-foreground"})}):Q.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:Q.map(p=>s.jsx(as,{connectionId:V.id,tool:p,isSelected:J(V.id,p.name),onToggle:()=>te(V.id,p.name)},p.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const ms=qe({role:qe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Je(),staticPermissions:we(re()),toolSet:Ze(re(),we(re())),allowAllModels:Je(),modelSet:Ze(re(),we(re())),memberIds:we(re())});function lt(t,e,l,r){const n=s.jsx(je,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(Le,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function us(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie();let h;e[0]!==u?(h=u.trim().toLowerCase(),e[0]=u,e[1]=h):h=e[1];const a=$.useDeferredValue(h);let g;if(e[2]!==l||e[3]!==a||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==d){const x=ls(),m=(_,A)=>{if(!f){if(l&&A){const v=x.flatMap(hs).flatMap(gs);n(!1),o(v.filter(i=>!_.tools.includes(i)));return}l||o(ns(_,r,!A))}};let T;e[11]!==a?(T=_=>{const{section:A,capabilities:v}=_;return{section:A,capabilities:v.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=T):T=e[12];const C=x.map(T).filter(fs);let R;e[13]!==d?(R=d("settings.orgRoleDetail.general"),e[13]=d,e[14]=R):R=e[14];let I;e[15]!==d?(I=d("settings.orgRoleDetail.allOrgPermissions"),e[15]=d,e[16]=I):I=e[16];let b;e[17]!==d?(b=d("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=d,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==n||e[21]!==o?(N=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=N):N=e[22];let M;e[23]!==l||e[24]!==f||e[25]!==d||e[26]!==N?(M=lt(d,l,f,N),e[23]=l,e[24]=f,e[25]=d,e[26]=N,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==f?(S=f?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=f,e[32]=S):S=e[32];let O;e[33]!==S||e[34]!==I||e[35]!==b||e[36]!==M?(O=s.jsx(Xe,{children:s.jsx(et,{title:I,description:b,action:M,onClick:S})}),e[33]=S,e[34]=I,e[35]=b,e[36]=M,e[37]=O):O=e[37];let D;e[38]!==O||e[39]!==R?(D=s.jsx(We,{title:R,children:O}),e[38]=O,e[39]=R,e[40]=D):D=e[40],g=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,C.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:d("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:u})}):C.map(_=>{const{section:A,capabilities:v}=_;return s.jsx(We,{title:A,children:s.jsx(Xe,{children:v.map(i=>{const E=os(i,r,l);return s.jsx(et,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:lt(d,E,f,()=>m(i,E)),onClick:f?void 0:()=>m(i,E)},i.id)})})},A)})]})}),e[2]=l,e[3]=a,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=r,e[9]=d,e[10]=g}else g=e[10];return g}function fs(t){return t.capabilities.length>0}function gs(t){return t.tools}function hs(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},xs={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("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function ps(t){return xs[t]??St[t]??t}function _s(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Nt=30;function Es(t){const e=X.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:c,allConnectionModelIds:u,selectedModels:f,allowAllModels:d,allConnectionModelsSelected:h,onToggleModel:a,onExitAllowAll:g,readOnly:x,defaultExpanded:m}=t,T=ie(),[C,R]=$.useState(m),I=m||C,b=R,[N,M]=$.useState(Nt);let S;e[0]!==h||e[1]!==d||e[2]!==f?(S=_=>d||h||f.includes("*")||f.includes(_),e[0]=h,e[1]=d,e[2]=f,e[3]=S):S=e[3];const O=S;let D;if(e[4]!==u||e[5]!==d||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==g||e[12]!==a||e[13]!==x||e[14]!==r||e[15]!==n||e[16]!==T||e[17]!==N){let _;e[19]!==O?(_=B=>O(B.id),e[19]=O,e[20]=_):_=e[20];const A=c.filter(_).length,v=c.slice(0,N),i=c.length>N;let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=()=>b(Ns),e[21]=E):E=e[21];const k=o??pt[r]??_t;let G;e[22]!==n||e[23]!==k?(G=s.jsx(Fe,{icon:k,name:n,size:"sm"}),e[22]=n,e[23]=k,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let L;e[27]!==G||e[28]!==Y?(L=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=L):L=e[29];const z=T("settings.orgRoleDetail.enabledCount",{enabledCount:A,total:c.length});let P;e[30]!==z?(P=s.jsx(Oe,{variant:"secondary",className:"text-xs text-muted-foreground",children:z}),e[30]=z,e[31]=P):P=e[31];let K;e[32]!==I?(K=I?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,e[33]=K):K=e[33];let V;e[34]!==P||e[35]!==K?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[P,K]}),e[34]=P,e[35]=K,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==L?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:E,children:[L,V]}),e[37]=V,e[38]=L,e[39]=U):U=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[v.map(B=>{const Q=O(B.id),J=()=>{if(!x){if(d){g(l,u,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:J,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ss,children:x?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:Q,disabled:!0,onCheckedChange:Rs})})}),s.jsx(Le,{children:s.jsx("p",{children:T("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:Q,onCheckedChange:J})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(Is),children:T("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=u,e[5]=d,e[6]=l,e[7]=I,e[8]=o,e[9]=O,e[10]=c,e[11]=g,e[12]=a,e[13]=x,e[14]=r,e[15]=n,e[16]=T,e[17]=N,e[18]=D}else D=e[18];return D}function Is(t){return t+Nt}function Rs(){}function Ss(t){return t.stopPropagation()}function Ns(t){return!t}function As(t){const e=X.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:u,searchQuery:f,readOnly:d}=t,h=Wt(l.id);let a,g,x,m,T;if(e[0]!==u||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==h||e[8]!==d||e[9]!==f||e[10]!==r){T=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=E=>({...E,id:E.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const b=h.filter(js).map(I),N=f.trim().toLowerCase(),M=N?b.filter(E=>E.title.toLowerCase().includes(N)||E.id.toLowerCase().includes(N)||E.provider?.toLowerCase().includes(N)):b;if(M.length===0){T=null;break e}const S=new Map;for(const E of M){const k=Ts(E.id,l.providerId),G=S.get(k)??{models:[],logo:null};G.models.push({id:E.id,title:_s(E.title),logo:E.logo}),!G.logo&&E.logo&&(G.logo=E.logo),S.set(k,G)}const O=Array.from(S.entries()).map(Os).sort(bs),D=O.length===1||N.length>0;x="flex flex-col gap-3";const _=pt[l.providerId]??_t;let A;e[18]!==l.providerId||e[19]!==_?(A=s.jsx("img",{src:_,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=_,e[20]=A):A=e[20];const v=St[l.providerId]??l.providerId;let i;e[21]!==v?(i=s.jsx("h4",{className:"text-sm font-medium",children:v}),e[21]=v,e[22]=i):i=e[22],e[23]!==i||e[24]!==A?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[A,i]}),e[23]=i,e[24]=A,e[25]=m):m=e[25],a="flex flex-col gap-3",g=O.map(E=>s.jsx(Es,{connectionId:l.id,subProviderId:E.id,subProviderName:E.name,groupLogo:E.logo,models:E.models,allConnectionModelIds:b.map(Cs),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:u,onToggleModel:o,onExitAllowAll:c,readOnly:d,defaultExpanded:D},E.id))}e[0]=u,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=h,e[8]=d,e[9]=f,e[10]=r,e[11]=a,e[12]=g,e[13]=x,e[14]=m,e[15]=T}else a=e[11],g=e[12],x=e[13],m=e[14],T=e[15];if(T!==Symbol.for("react.early_return_sentinel"))return T;let C;e[26]!==a||e[27]!==g?(C=s.jsx("div",{className:a,children:g}),e[26]=a,e[27]=g,e[28]=C):C=e[28];let R;return e[29]!==x||e[30]!==m||e[31]!==C?(R=s.jsxs("div",{className:x,children:[m,C]}),e[29]=x,e[30]=m,e[31]=C,e[32]=R):R=e[32],R}function Cs(t){return t.id}function bs(t,e){return t.name.localeCompare(e.name)}function Os(t){const[e,l]=t;return{id:e,name:ps(e),logo:l.logo,models:l.models}}function js(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie(),h=$.useDeferredValue(u),a=Jt();let g;e[0]!==r||e[1]!==o?(g=(_,A)=>{const v=r[_]??[],i={...r};if(v.includes(A)){const E=v.filter(k=>k!==A);E.length===0?delete i[_]:i[_]=E}else i[_]=[...v,A];o(i)},e[0]=r,e[1]=o,e[2]=g):g=e[2];const x=g;let m;e[3]!==r||e[4]!==n||e[5]!==o?(m=(_,A,v)=>{n(!1),o({...r,[_]:A.filter(i=>i!==v)})},e[3]=r,e[4]=n,e[5]=o,e[6]=m):m=e[6];const T=m,C=!f&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==C?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",C),e[7]=C,e[8]=R):R=e[8];let I;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==f?(I=()=>{if(f)return;const _=!l;n(_),_&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=f,e[13]=I):I=e[13];let b;e[14]!==d?(b=d("settings.orgRoleDetail.allModels"),e[14]=d,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let M;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==f||e[22]!==d?(M=s.jsx("div",{onClick:vs,children:f?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{children:s.jsx("p",{children:d("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:l,onCheckedChange:_=>{n(_),_&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=f,e[22]=d,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==I||e[26]!==N||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:I,children:[N,M]}),e[24]=R,e[25]=I,e[26]=N,e[27]=M,e[28]=S):S=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==h||e[32]!==T||e[33]!==r||e[34]!==f||e[35]!==d||e[36]!==x?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(_=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ce,{className:"size-4 animate-spin"}),d("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(As,{connection:_,selectedModels:r[_.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:T,allConnectionModelsSelected:(r[_.id]??[]).includes("*"),searchQuery:h,readOnly:f})},_.id)),e[29]=a,e[30]=l,e[31]=h,e[32]=T,e[33]=r,e[34]=f,e[35]=d,e[36]=x,e[37]=O):O=e[37];let D;return e[38]!==S||e[39]!==O?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,O]}),e[38]=S,e[39]=O,e[40]=D):D=e[40],D}function Ds(){}function vs(t){return t.stopPropagation()}function Ls(t){const e=X.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,c=ie(),[u,f]=$.useState(""),d=$.useDeferredValue(u);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[a,g]=$.useState(h),{data:x}=Et();let m,T,C,R,I,b,N,M,S,O,D;if(e[1]!==x?.data?.members||e[2]!==d||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==u||e[8]!==n||e[9]!==c){const P=x?.data?.members??[];let K;e[21]!==d?(K=F=>{const W=d.toLowerCase();return F.user?.name?.toLowerCase().includes(W)||F.user?.email?.toLowerCase().includes(W)},e[21]=d,e[22]=K):K=e[22];const V=P.filter(K);let U;e[23]!==o||e[24]!==r||e[25]!==a?(U=()=>{o(a),g([]),r(!1)},e[23]=o,e[24]=r,e[25]=a,e[26]=U):U=e[26],C=U,T=dt,O=l,D=r,m=mt,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let Q;e[29]!==B?(Q=s.jsx(ut,{children:B}),e[29]=B,e[30]=Q):Q=e[30];let J;e[31]!==c?(J=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=J):J=e[32];let te;e[33]!==J?(te=s.jsx(ft,{children:J}),e[33]=J,e[34]=te):te=e[34],e[35]!==Q||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[Q,te]}),e[35]=Q,e[36]=te,e[37]=S):S=e[37],b="flex flex-col h-80";let oe;e[38]!==c?(oe=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=oe):oe=e[39],e[40]!==u||e[41]!==oe?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Ke,{value:u,onChange:f,placeholder:oe,className:"w-full"})}),e[40]=u,e[41]=oe,e[42]=N):N=e[42],R="flex-1 overflow-auto",I=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(u?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const W=F.role!=="owner",p=n.includes(F.id),w=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!W||p?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx($e,{checked:w||p,onCheckedChange:()=>{!W||p||g(H=>H.includes(F.id)?H.filter(q=>q!==F.id):[...H,F.id])},disabled:!W||p}),s.jsx(Rt,{url:F.user?.image??void 0,fallback:It(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!W&&s.jsx(Oe,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),p&&W&&s.jsx(Oe,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=x?.data?.members,e[2]=d,e[3]=o,e[4]=r,e[5]=l,e[6]=a,e[7]=u,e[8]=n,e[9]=c,e[10]=m,e[11]=T,e[12]=C,e[13]=R,e[14]=I,e[15]=b,e[16]=N,e[17]=M,e[18]=S,e[19]=O,e[20]=D}else m=e[10],T=e[11],C=e[12],R=e[13],I=e[14],b=e[15],N=e[16],M=e[17],S=e[18],O=e[19],D=e[20];let _;e[43]!==R||e[44]!==I?(_=s.jsx("div",{className:R,children:I}),e[43]=R,e[44]=I,e[45]=_):_=e[45];let A;e[46]!==_||e[47]!==b||e[48]!==N?(A=s.jsxs("div",{className:b,children:[N,_]}),e[46]=_,e[47]=b,e[48]=N,e[49]=A):A=e[49];let v;e[50]!==c?(v=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=v):v=e[51];let i;e[52]!==v?(i=s.jsx(ht,{children:v}),e[52]=v,e[53]=i):i=e[53];const E=a.length===0;let k;e[54]!==a.length||e[55]!==c?(k=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=k):k=e[56];let G;e[57]!==C||e[58]!==E||e[59]!==k?(G=s.jsx(xt,{onClick:C,disabled:E,children:k}),e[57]=C,e[58]=E,e[59]=k,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(Tt,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let L;e[64]!==m||e[65]!==A||e[66]!==Y||e[67]!==M||e[68]!==S?(L=s.jsxs(m,{className:M,children:[S,A,Y]}),e[64]=m,e[65]=A,e[66]=Y,e[67]=M,e[68]=S,e[69]=L):L=e[69];let z;return e[70]!==T||e[71]!==L||e[72]!==O||e[73]!==D?(z=s.jsx(T,{open:O,onOpenChange:D,children:L}),e[70]=T,e[71]=L,e[72]=O,e[73]=D,e[74]=z):z=e[74],z}function Ps(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=n===void 0?!1:n,h=o===void 0?void 0:o,a=ie(),g=$.useDeferredValue(c),{data:x}=Et();let m,T,C;if(e[0]!==x?.data?.members||e[1]!==g||e[2]!==l||e[3]!==r||e[4]!==d||e[5]!==h||e[6]!==c||e[7]!==a){const M=x?.data?.members??[];let S;e[11]!==l?(S=i=>l.includes(i.id),e[11]=l,e[12]=S):S=e[12];const O=M.filter(S);let D;e[13]!==g?(D=i=>{const E=g.toLowerCase();return i.user?.name?.toLowerCase().includes(E)||i.user?.email?.toLowerCase().includes(E)},e[13]=g,e[14]=D):D=e[14];const _=O.filter(D);let A;e[15]!==h||e[16]!==a?(A=h??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=h,e[16]=a,e[17]=A):A=e[17];const v=A;C="flex flex-col h-full",m="flex-1 overflow-auto",T=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")})]})}):_.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:_.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:It(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),d?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(tt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:v})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(E=>E!==i.id)),children:s.jsx(tt,{size:16})})]},i.id))}),e[0]=x?.data?.members,e[1]=g,e[2]=l,e[3]=r,e[4]=d,e[5]=h,e[6]=c,e[7]=a,e[8]=m,e[9]=T,e[10]=C}else m=e[8],T=e[9],C=e[10];let R;e[18]!==m||e[19]!==T?(R=s.jsx("div",{className:m,children:T}),e[18]=m,e[19]=T,e[20]=R):R=e[20];let I;e[21]!==l||e[22]!==r?(I=M=>r([...l,...M]),e[21]=l,e[22]=r,e[23]=I):I=e[23];let b;e[24]!==u||e[25]!==l||e[26]!==f||e[27]!==I?(b=s.jsx(Ls,{open:u,onOpenChange:f,selectedMemberIds:l,onAddMembers:I}),e[24]=u,e[25]=l,e[26]=f,e[27]=I,e[28]=b):b=e[28];let N;return e[29]!==C||e[30]!==R||e[31]!==b?(N=s.jsxs("div",{className:C,children:[R,b]}),e[29]=C,e[30]=R,e[31]=b,e[32]=N):N=e[32],N}function ys(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ce,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx($.Suspense,{fallback:l,children:s.jsx(Ps,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const ws={owner:[],admin:[],user:[]};function Gs(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:ws[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function ks(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),c=o?[]:n.filter(a=>a!=="*"),u={};for(const[a,g]of Object.entries(r))if(!(a==="self"||a==="models"))if(a==="*")for(const x of l)u[x.id]=g.includes("*")?x.tools?.map(m=>m.name)??[]:g;else{const x=l.find(m=>m.id===a);x&&(u[a]=g.includes("*")?x.tools?.map(m=>m.name)??[]:g)}const f=r.models||[],d=f.length===0||f.includes("*:*"),h={};if(!d)for(const a of f){const g=a.indexOf(":");if(g===-1)continue;const x=a.slice(0,g),m=a.slice(g+1);h[x]||(h[x]=[]),h[x].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:u,allowAllModels:d,modelSet:h,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Us(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const c=e.find(u=>u.id===r)?.tools?.map(u=>u.name)??[];l[r]=c.length>0&&c.every(u=>n.includes(u))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const c of o)r.push(`${n}:${c}`);r.length>0&&(l.models=r)}return l}function Bs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?ks(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Vs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,c=ie();let u;e[0]!==o||e[1]!==c?(u=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=u):u=e[2];const f=u;if(l){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Be,{size:16}),e[3]=g):g=e[3];let x;e[4]!==c?(x=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=x):x=e[5];let m;e[6]!==x?(m=s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[g,x]})})}),e[6]=x,e[7]=m):m=e[7];let T;e[8]!==f?(T=s.jsx(Le,{children:s.jsx("p",{children:f})}),e[8]=f,e[9]=T):T=e[9];let C;return e[10]!==m||e[11]!==T?(C=s.jsx(Me,{children:s.jsxs(De,{children:[m,T]})}),e[10]=m,e[11]=T,e[12]=C):C=e[12],C}let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:16}),e[13]=d):d=e[13];let h;e[14]!==c?(h=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=h):h=e[15];let a;return e[16]!==n||e[17]!==h?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[d,h]}),e[16]=n,e[17]=h,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Ge(),r=ze(),n=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==r?(c=()=>r.organization.listMembers(),e[2]=r,e[3]=c):c=e[3];let u;e[4]!==o||e[5]!==c?(u={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=u):u=e[6];const{data:f,isPending:d}=Ve(u);if(d||!n){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=x):x=e[7],x}let h;e[8]!==f?.data?.members?(h=f?.data?.members??[],e[8]=f?.data?.members,e[9]=h):h=e[9];const a=h;let g;return e[10]!==n||e[11]!==a||e[12]!==t?(g=s.jsx(zs,{...t,members:a,connections:n}),e[10]=n,e[11]=a,e[12]=t,e[13]=g):g=e[13],g}function zs({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:c}=Ge(),u=ze(),f=ot(),d=t.kind==="builtin",h=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[g,x]=$.useState(d?"org":"mcp"),m=bt({resolver:Ot(ms),defaultValues:Bs(t,r,n)}),T=m.formState.isValid,C=m.formState.isDirty,R=nt({mutationFn:async i=>{const E=Us(i,n),k=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(L,z)=>{const P=r.filter(U=>U.role===(z??L)).map(U=>U.id),K=i.memberIds.filter(U=>!P.includes(U)),V=P.filter(U=>!i.memberIds.includes(U));for(const U of K){const B=await u.organization.updateMemberRole({memberId:U,role:[L]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await u.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const L=i.role.label.toLowerCase().replace(/\s+/g,"-"),z=i.role.slug,P=L!==z,K=await u.organization.updateRole({roleId:i.role.id,data:{permission:E,...P?{roleName:L}:{}}});if(K?.error)throw new Error(K.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(P?L:z,P?z:void 0),P?{...i,role:{...i.role,slug:L}}:i}else{const L=await u.organization.createRole({role:k,permission:E});if(L?.error)throw new Error(L.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const z of i.memberIds){const P=await u.organization.updateMemberRole({memberId:z,role:[k]});if(P?.error)throw new Error(P.error.message)}return{...i,role:{...i.role,id:L.data?.roleData?.id,slug:k}}}},onSuccess:(i,E)=>{f.invalidateQueries({queryKey:de.members(c)}),f.invalidateQueries({queryKey:de.organizationRoles(c)});const k=!E.role.id&&!E.role.slug,G=E.role.slug==="owner"&&!E.role.id;Ye(G?"role_members_updated":k?"role_created":"role_updated",{role_slug:E.role.slug??null}),be.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),m.reset(i),l(i.role.id)},onError:i=>{be.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=m.handleSubmit(i=>{if(!i.role.label.trim()){be.error(o("settings.orgRoleDetail.roleNameIsRequired")),m.setFocus("role.label");return}R.mutate(i)}),b=!h,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...h?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,O]=$.useState(""),[D,_]=$.useState(!1),A=i=>{x(i),O("")},v={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ae,{children:s.jsxs(Ae.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ae.Title,{actions:b&&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:I,disabled:R.isPending||!T||!C,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(m.watch("role.label")))}),h&&s.jsx(it,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...m.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(i=>s.jsx("button",{type:"button",onClick:()=>A(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Ke,{value:S,onChange:O,placeholder:v[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(Vs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>_(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!h&&s.jsx(ds,{toolSet:m.watch("toolSet"),onToolSetChange:i=>m.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:S}),g==="org"&&s.jsx(us,{allowAllStaticPermissions:m.watch("allowAllStaticPermissions"),staticPermissions:m.watch("staticPermissions"),onAllowAllChange:i=>m.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>m.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:h,searchQuery:S}),g==="models"&&s.jsx(Ms,{allowAllModels:m.watch("allowAllModels"),modelSet:m.watch("modelSet"),onAllowAllChange:i=>m.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>m.setValue("modelSet",i,{shouldDirty:!0}),readOnly:h,searchQuery:S}),g==="members"&&s.jsx(ys,{memberIds:m.watch("memberIds"),onMemberIdsChange:i=>m.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:_})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Fs(t){const e=X.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:c}=Mt();let u;return e[0]!==l||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o?(u=s.jsx(ts,{granted:n,loading:o,error:c,area:l,children:r}),e[0]=l,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}const $s=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Qs(){const t=X.c(128),e=ie(),[l,r]=$.useState(""),[n,o]=$.useState(null),c=Lt();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=rt(u),{locator:d}=Ge(),h=ze(),a=ot(),{customRoles:g,refetch:x}=Pt();let m;t[1]!==c?(m=j=>c({to:".",search:y=>({...y,role:j})}),t[1]=c,t[2]=m):m=t[2];const T=m;let C;e:{if(!f){C=null;break e}if(f==="new"){C={kind:"new"};break e}if(f.startsWith("builtin-")){C={kind:"builtin",role:f.slice(8)};break e}let j;t[3]!==f?(j=ee=>ee.id===f,t[3]=f,t[4]=j):j=t[4];const y=g.find(j);C=y?{kind:"custom",role:y}:null}const R=C;let I;t[5]!==d?(I=de.members(d),t[5]=d,t[6]=I):I=t[6];let b;t[7]!==h?(b=()=>h.organization.listMembers(),t[7]=h,t[8]=b):b=t[8];let N;t[9]!==I||t[10]!==b?(N={queryKey:I,queryFn:b},t[9]=I,t[10]=b,t[11]=N):N=t[11];const{data:M}=Ve(N);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const O=S;let D;t[14]!==O?(D=j=>O.filter(y=>y.role===j).length,t[14]=O,t[15]=D):D=t[15];const _=D;let A;if(t[16]!==g||t[17]!==_||t[18]!==l||t[19]!==e){let j;t[21]!==_||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:_(ce.role),label:e(ce.labelKey)}}),t[21]=_,t[22]=e,t[23]=j):j=t[23];const y=$s.map(j);let ee;t[24]!==_?(ee=ce=>({kind:"custom",role:{...ce,memberCount:_(ce.role)}}),t[24]=_,t[25]=ee):ee=t[25];const At=g.map(ee);if(A=[...y,...At],l){const ce=l.toLowerCase();A=A.filter(Ct=>Ct.role.label.toLowerCase().includes(ce))}t[16]=g,t[17]=_,t[18]=l,t[19]=e,t[20]=A}else A=t[20];let v;t[26]!==h?(v=async j=>{const y=await h.organization.deleteRole({roleId:j});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=h,t[27]=v):v=t[27];const i=nt({mutationFn:v,onSuccess:(j,y)=>{Ye("role_deleted",{role_id:y}),a.invalidateQueries({queryKey:de.members(d)}),a.invalidateQueries({queryKey:de.organizationRoles(d)}),be.success(e("settings.roles.deletedSuccessfully")),x(),R?.kind==="custom"&&R.role.id===y&&T(void 0)},onError:Ws});let E;t[28]!==e?(E=e("settings.roles.columnRole"),t[28]=e,t[29]=E):E=t[29];let k;t[30]!==E?(k={id:"role",header:E,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=E,t[31]=k):k=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(Oe,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Oe,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let L;t[36]!==G||t[37]!==Y?(L={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=L):L=t[38];let z;t[39]!==e?(z=e("settings.roles.columnPermissions"),t[39]=e,t[40]=z):z=t[40];let P;t[41]!==e?(P=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=j.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=P):P=t[42];let K;t[43]!==z||t[44]!==P?(K={id:"permissions",header:z,render:P,cellClassName:"flex-1 min-w-0"},t[43]=z,t[44]=P,t[45]=K):K=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:Zs,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(kt,{align:"end",onClick:Hs,children:s.jsxs(Ut,{variant:"destructive",onClick:()=>{const y=j.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let Q;t[52]!==k||t[53]!==L||t[54]!==K||t[55]!==U||t[56]!==B?(Q=[k,L,K,U,B],t[52]=k,t[53]=L,t[54]=K,t[55]=U,t[56]=B,t[57]=Q):Q=t[57];const J=Q;let te;t[58]!==T?(te=j=>{if(j.kind==="builtin")T(`builtin-${j.role.role}`);else{const y=j.role;T(y.id)}},t[58]=T,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==T?(j=()=>T(void 0),t[60]=T,t[61]=j):j=t[61];let y;return t[62]!==x||t[63]!==T?(y=()=>{x(),T(void 0)},t[62]=x,t[63]=T,t[64]=y):y=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:y},Ks(R))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let W;t[67]===Symbol.for("react.memo_cache_sentinel")?(W=j=>{j.key==="Escape"&&(r(""),j.target.blur())},t[67]=W):W=t[67];let p;t[68]!==l||t[69]!==F?(p=s.jsx(Ke,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:W}),t[68]=l,t[69]=F,t[70]=p):p=t[70];let w;t[71]!==T?(w=()=>T("new"),t[71]=T,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Be,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==p||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p,se]}),t[79]=p,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(st,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(st,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let me;t[85]!==A||t[86]!==J||t[87]!==oe||t[88]!==ne?(me=s.jsx(Yt,{columns:J,data:A,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=A,t[86]=J,t[87]=oe,t[88]=ne,t[89]=me):me=t[89];const ke=n!==null;let Pe;t[90]===Symbol.for("react.memo_cache_sentinel")?(Pe=j=>!j&&o(null),t[90]=Pe):Pe=t[90];let ue;t[91]!==e?(ue=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=ue):ue=t[92];let fe;t[93]!==ue?(fe=s.jsx(ut,{children:ue}),t[93]=ue,t[94]=fe):fe=t[94];const Ue=n?.label??"";let ge;t[95]!==e||t[96]!==Ue?(ge=e("settings.roles.deleteRoleConfirm",{role:Ue}),t[95]=e,t[96]=Ue,t[97]=ge):ge=t[97];let he;t[98]!==ge?(he=s.jsx(ft,{children:ge}),t[98]=ge,t[99]=he):he=t[99];let xe;t[100]!==fe||t[101]!==he?(xe=s.jsxs(gt,{children:[fe,he]}),t[100]=fe,t[101]=he,t[102]=xe):xe=t[102];let Te;t[103]!==e?(Te=e("settings.roles.cancel"),t[103]=e,t[104]=Te):Te=t[104];let pe;t[105]!==Te?(pe=s.jsx(ht,{children:Te}),t[105]=Te,t[106]=pe):pe=t[106];let _e;t[107]!==i||t[108]!==n?(_e=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=_e):_e=t[109];let Ee;t[110]!==e?(Ee=e("settings.roles.delete"),t[110]=e,t[111]=Ee):Ee=t[111];let Ie;t[112]!==_e||t[113]!==Ee?(Ie=s.jsx(xt,{onClick:_e,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),t[112]=_e,t[113]=Ee,t[114]=Ie):Ie=t[114];let Re;t[115]!==pe||t[116]!==Ie?(Re=s.jsxs(Tt,{children:[pe,Ie]}),t[115]=pe,t[116]=Ie,t[117]=Re):Re=t[117];let Se;t[118]!==xe||t[119]!==Re?(Se=s.jsxs(mt,{children:[xe,Re]}),t[118]=xe,t[119]=Re,t[120]=Se):Se=t[120];let Ne;t[121]!==ke||t[122]!==Se?(Ne=s.jsx(dt,{open:ke,onOpenChange:Pe,children:Se}),t[121]=ke,t[122]=Se,t[123]=Ne):Ne=t[123];let ye;return t[124]!==le||t[125]!==me||t[126]!==Ne?(ye=s.jsxs(at,{group:"members",className:"gap-6",children:[le,me,Ne]}),t[124]=le,t[125]=me,t[126]=Ne,t[127]=ye):ye=t[127],ye}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Zs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",ct(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(it,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ws(t,e){Ye("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),be.error(t instanceof Error?t.message:"Failed to delete role")}function Xs(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=rt(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let c;t[5]!==r?(c=r?s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})})}):s.jsx(at,{group:"members",className:"gap-6",children:s.jsx(Dt,{})}),t[5]=r,t[6]=c):c=t[6];let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Qs,{}),t[7]=u):u=t[7];let f;t[8]!==c?(f=s.jsx($.Suspense,{fallback:c,children:u}),t[8]=c,t[9]=f):f=t[9];let d;return t[10]!==o||t[11]!==f?(d=s.jsx(vt,{fallback:o,children:f}),t[10]=o,t[11]=f,t[12]=d):d=t[12],d}function Ao(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{area:"roles",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{Ao as default};
|
|
1
|
+
import{b as ie,r as $,H as Ge,K as de,o as Ve,j as s,n as Z,k as Ce,B as ae,c as X,ak as qe,al as we,am as re,aq as Ze,ar as Je,p as ot,ao as bt,ap as Ot,e as nt,t as be,q as Ye,P as Ae,C as it,d6 as We,d7 as Xe,d8 as et,D as jt,aa as Me,ab as De,a8 as ve,a9 as Le,aj as tt,bF as Mt,u as rt,da as at,eT as Dt,E as vt,d as Lt}from"./index-4Yq2AnCq.js";import{u as Pt}from"./use-organization-roles-CIz7DCUv.js";import{u as ze}from"./use-org-auth-client-DX7KVEgG.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as Oe}from"./badge-B8-k3EUv.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as ht,g as xt,e as Tt}from"./alert-dialog-Blc5Cb_n.js";import{c as wt,D as Gt,b as kt,a as Ut}from"./dropdown-menu-DjqcVkft.js";import{a as Bt}from"./DotsVertical-Cvw7phqC.js";import{s as Be}from"./Plus-CcMb81sq.js";import{s as Vt}from"./Trash01-Dwcak20e.js";import{C as Yt}from"./collection-table-wrapper-CpdGzWQF.js";import{E as st}from"./empty-state-BjhrOSZy.js";import{S as Ke}from"./search-input-CE1-9e_W.js";import{P as pt,D as _t}from"./ai-providers-logos-DD3qZ33J.js";import{I as Fe}from"./integration-icon-bu5yzyqj.js";import{u as zt}from"./use-infinite-scroll-i_XhEpG8.js";import{C as $e}from"./checkbox-gtgappW6.js";import{i as Kt}from"./ArrowLeft-DSnMT0wO.js";import{u as Ft}from"./useSuspenseInfiniteQuery-zeW-Zl8F.js";import{u as $t}from"./use-mcp-client-zn-75Bb8.js";import{S as Qt}from"./constants-_08zpzmT.js";import{C as Ht}from"./collection-search-Vac8r93V.js";import{p as qt}from"./connection-BXsmmHUF.js";import{a as Et}from"./use-members-D8_mU_mD.js";import{g as It}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-dlqCn-N5.js";import{u as Jt,g as Wt}from"./use-ai-providers-BhDW0mip.js";import{A as Rt}from"./avatar-DC9Z2qvJ.js";import{S as je}from"./switch-BzkLU8Zp.js";import{t as Xt}from"./ChevronDown-Bw9gK0Xq.js";import{i as es}from"./ChevronRight-exnNya0u.js";import{A as ts}from"./access-gate-DMwqkzwZ.js";import"./Check-CvmqPlvr.js";import"./table-D9qBqsbI.js";import"./ArrowUp-DeOdfuRg.js";import"./SearchMd-VcuMXm67.js";import"./Tool02--4JFOFNk.js";import"./agent-icon-Bg93N3p3.js";import"./AlertCircle-BvnCHRsL.js";import"./Tool01-CHrRmwEP.js";import"./XCircle-BAgn0fqe.js";import"./TrendUp01-Cg5hOl22.js";import"./ZapSquare-BIY-vKSa.js";import"./Users03-BWb9cXAs.js";import"./UserSquare-Cqogxcq4.js";import"./CheckCircle-qbxVqwNt.js";import"./ChevronSelectorVertical-BehAh9wJ.js";import"./ChevronUp-MaQ-QeOM.js";import"./Stars02-C7s7bRT8.js";import"./Copy01-vLHgvY5u.js";import"./CreditCard01-CaCvJmnt.js";import"./Download01-DTlq4gRe.js";import"./Settings02-CVmbd-FU.js";import"./Eye-DVc3JZNh.js";import"./FilterLines-Db4KNc5A.js";import"./Share07-CPph4sPw.js";import"./Globe01-CGhdOPeO.js";import"./Globe04-Bn7L7yJn.js";import"./SwitchHorizontal01-c5W4LuWP.js";import"./HardDrive-CeTpIa5B.js";import"./Key01-CoTP2UMr.js";import"./LinkExternal01-sFAx5Ukt.js";import"./LockUnlocked01-CUMEjJeX.js";import"./LogOut01-nrR9abDU.js";import"./Monitor01-Caa2kHbv.js";import"./Sun-Wqe7_tya.js";import"./Palette-qIK2euAO.js";import"./Play-9DT0q0lw.js";import"./SearchLg-BM4kNaJH.js";import"./Shield01-Q9YdpfGm.js";import"./Stars01-DwXtGLac.js";import"./Upload01-BfWAgMYo.js";import"./User01-bzqmgkdh.js";import"./Users01-8maiPdfp.js";import"./XClose-BMb-wb3G.js";import"./Zap-BlGJcPsL.js";import"./auth-BiJfhAJo.js";import"./capability-load-error-Bt5z8vOI.js";const Qe="basic-usage",He=[{id:Qe,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","GITHUB_SEARCH_BRANCHES","GITHUB_PR_STATE","GITHUB_LAST_PUBLISHED_PR","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_ITEM_PR_LINK","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_SYNC_RUN"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...He.find(t=>t.id===Qe)?.tools??[]];const ss=["agents:manage","connections:manage"];new Set(He.filter(t=>ss.includes(t.id)).flatMap(t=>t.tools));function ls(){const t=new Map;for(const e of He){if(e.id===Qe)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function os(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ns(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}function is(t){const e=X.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:c,onSelect:u,onToggle:f}=t,d=r?"bg-accent/50":"hover:bg-muted/50";let h;e[0]!==d?(h=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=h):h=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Fe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let g;e[5]!==l.title?(g=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=g):g=e[6];let x;e[7]!==u||e[8]!==a||e[9]!==g?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:u,children:[a,g]}),e[7]=u,e[8]=a,e[9]=g,e[10]=x):x=e[10];let m;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==f||e[15]!==c?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx($e,{checked:n,onCheckedChange:f,onClick:rs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=f,e[15]=c,e[16]=m):m=e[16];let T;return e[17]!==h||e[18]!==x||e[19]!==m?(T=s.jsxs("div",{className:h,children:[x,m]}),e[17]=h,e[18]=x,e[19]=m,e[20]=T):T=e[20],T}function rs(t){return t.stopPropagation()}function as(t){const e=X.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,c=`tool-${l}-${r.name}`,u=n?"text-foreground":"text-muted-foreground";let f;e[0]!==u?(f=Z("text-sm font-medium",u),e[0]=u,e[1]=f):f=e[1];let d;e[2]!==f||e[3]!==r.name?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:f,children:r.name})}),e[2]=f,e[3]=r.name,e[4]=d):d=e[4];let h;e[5]!==r.description?(h=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=h):h=e[6];let a;e[7]!==d||e[8]!==h?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,h]}),e[7]=d,e[8]=h,e[9]=a):a=e[9];const g=`tool-${l}-${r.name}`;let x;e[10]!==n||e[11]!==o||e[12]!==g?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx($e,{id:g,checked:n,onCheckedChange:o,onClick:cs})}),e[10]=n,e[11]=o,e[12]=g,e[13]=x):x=e[13];let m;return e[14]!==c||e[15]!==a||e[16]!==x?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,x]}),e[14]=c,e[15]=a,e[16]=x,e[17]=m):m=e[17],m}function cs(t){return t.stopPropagation()}function ds({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,c]=$.useState(""),u=r!==void 0?r:o,f=$.useDeferredValue(u),[d,h]=$.useState("all"),[a,g]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:m}=Ge(),T=$t({connectionId:Qt,orgId:m.id,orgSlug:m.slug}),C=100,R=f.trim(),I=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,b=!!l,N={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:0,...b&&{include_virtual:!0}},M=JSON.stringify(N),{data:S,fetchNextPage:O,hasNextPage:D,isFetchingNextPage:_}=Ft({queryKey:de.collectionListInfinite(T,m.id,"","CONNECTIONS",M),queryFn:async({pageParam:p=0})=>(await T.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:p,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(p,w)=>{if(p?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),A=S?.pages.flatMap(p=>p?.items??[])??[],v=zt(O,D??!1,_),i=l?A.filter(p=>p.connection_type!=="VIRTUAL"?!0:qt(p.connection_url)!==l):A,E=x.current,k=[...E.values()].map(p=>i.find(w=>w.id===p)).filter(p=>p!==void 0),G=i.filter(p=>!E.has(p.id)),Y=[...k,...G],L=p=>{const w=t[p];return w!==void 0&&w.length>0},z=Y.filter(p=>{if(d==="all")return!0;const w=L(p.id);return d==="selected"?w:d==="unselected"?!w:!0}),[P,K]=$.useState(Y[0]?.id??null),V=P?Y.find(p=>p.id===P)??null:null,{data:U,isFetching:B}=Ve({queryKey:de.collectionItem(T,m.id,"","CONNECTIONS",P??""),queryFn:async()=>P?(await T.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:P}})).structuredContent?.item??null:null,enabled:!!P,staleTime:3e4}),Q=U?.tools??[],J=(p,w)=>t[p]?.includes(w)??!1,te=(p,w)=>{const H=t[p]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[p]:se[p]=le}else se[p]=[...H,w];e(se)},oe=p=>{const w=p===P?Q:[];if(!w.length)return;const H=t[p]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[p]:(le[p]=q,K(p)),e(le)},F=p=>{K(p),g(!0)},W=()=>{g(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[r===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>h("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>h("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>h("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:z.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(u?"common.toolSetSelector.noConnectionsFound":d==="selected"?"common.toolSetSelector.noServersSelected":d==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[z.map(p=>{const w=P===p.id,H=w?Q.length:0,q=t[p.id]?.length??0;return s.jsx(is,{connection:{...p,tools:w?Q:p.tools},isSelected:w,hasToolsEnabled:L(p.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>F(p.id),onToggle:()=>oe(p.id)},p.id)}),s.jsx("div",{ref:v,className:"h-4"}),_&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Ce,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Kt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Fe,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ce,{size:18,className:"animate-spin text-muted-foreground"})}):Q.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:Q.map(p=>s.jsx(as,{connectionId:V.id,tool:p,isSelected:J(V.id,p.name),onToggle:()=>te(V.id,p.name)},p.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const ms=qe({role:qe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Je(),staticPermissions:we(re()),toolSet:Ze(re(),we(re())),allowAllModels:Je(),modelSet:Ze(re(),we(re())),memberIds:we(re())});function lt(t,e,l,r){const n=s.jsx(je,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(Le,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function us(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie();let h;e[0]!==u?(h=u.trim().toLowerCase(),e[0]=u,e[1]=h):h=e[1];const a=$.useDeferredValue(h);let g;if(e[2]!==l||e[3]!==a||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==d){const x=ls(),m=(_,A)=>{if(!f){if(l&&A){const v=x.flatMap(hs).flatMap(gs);n(!1),o(v.filter(i=>!_.tools.includes(i)));return}l||o(ns(_,r,!A))}};let T;e[11]!==a?(T=_=>{const{section:A,capabilities:v}=_;return{section:A,capabilities:v.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=T):T=e[12];const C=x.map(T).filter(fs);let R;e[13]!==d?(R=d("settings.orgRoleDetail.general"),e[13]=d,e[14]=R):R=e[14];let I;e[15]!==d?(I=d("settings.orgRoleDetail.allOrgPermissions"),e[15]=d,e[16]=I):I=e[16];let b;e[17]!==d?(b=d("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=d,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==n||e[21]!==o?(N=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=N):N=e[22];let M;e[23]!==l||e[24]!==f||e[25]!==d||e[26]!==N?(M=lt(d,l,f,N),e[23]=l,e[24]=f,e[25]=d,e[26]=N,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==f?(S=f?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=f,e[32]=S):S=e[32];let O;e[33]!==S||e[34]!==I||e[35]!==b||e[36]!==M?(O=s.jsx(Xe,{children:s.jsx(et,{title:I,description:b,action:M,onClick:S})}),e[33]=S,e[34]=I,e[35]=b,e[36]=M,e[37]=O):O=e[37];let D;e[38]!==O||e[39]!==R?(D=s.jsx(We,{title:R,children:O}),e[38]=O,e[39]=R,e[40]=D):D=e[40],g=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,C.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:d("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:u})}):C.map(_=>{const{section:A,capabilities:v}=_;return s.jsx(We,{title:A,children:s.jsx(Xe,{children:v.map(i=>{const E=os(i,r,l);return s.jsx(et,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:lt(d,E,f,()=>m(i,E)),onClick:f?void 0:()=>m(i,E)},i.id)})})},A)})]})}),e[2]=l,e[3]=a,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=r,e[9]=d,e[10]=g}else g=e[10];return g}function fs(t){return t.capabilities.length>0}function gs(t){return t.tools}function hs(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},xs={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("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function ps(t){return xs[t]??St[t]??t}function _s(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Nt=30;function Es(t){const e=X.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:c,allConnectionModelIds:u,selectedModels:f,allowAllModels:d,allConnectionModelsSelected:h,onToggleModel:a,onExitAllowAll:g,readOnly:x,defaultExpanded:m}=t,T=ie(),[C,R]=$.useState(m),I=m||C,b=R,[N,M]=$.useState(Nt);let S;e[0]!==h||e[1]!==d||e[2]!==f?(S=_=>d||h||f.includes("*")||f.includes(_),e[0]=h,e[1]=d,e[2]=f,e[3]=S):S=e[3];const O=S;let D;if(e[4]!==u||e[5]!==d||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==g||e[12]!==a||e[13]!==x||e[14]!==r||e[15]!==n||e[16]!==T||e[17]!==N){let _;e[19]!==O?(_=B=>O(B.id),e[19]=O,e[20]=_):_=e[20];const A=c.filter(_).length,v=c.slice(0,N),i=c.length>N;let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=()=>b(Ns),e[21]=E):E=e[21];const k=o??pt[r]??_t;let G;e[22]!==n||e[23]!==k?(G=s.jsx(Fe,{icon:k,name:n,size:"sm"}),e[22]=n,e[23]=k,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let L;e[27]!==G||e[28]!==Y?(L=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=L):L=e[29];const z=T("settings.orgRoleDetail.enabledCount",{enabledCount:A,total:c.length});let P;e[30]!==z?(P=s.jsx(Oe,{variant:"secondary",className:"text-xs text-muted-foreground",children:z}),e[30]=z,e[31]=P):P=e[31];let K;e[32]!==I?(K=I?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,e[33]=K):K=e[33];let V;e[34]!==P||e[35]!==K?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[P,K]}),e[34]=P,e[35]=K,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==L?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:E,children:[L,V]}),e[37]=V,e[38]=L,e[39]=U):U=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[v.map(B=>{const Q=O(B.id),J=()=>{if(!x){if(d){g(l,u,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:J,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ss,children:x?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:Q,disabled:!0,onCheckedChange:Rs})})}),s.jsx(Le,{children:s.jsx("p",{children:T("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:Q,onCheckedChange:J})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(Is),children:T("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=u,e[5]=d,e[6]=l,e[7]=I,e[8]=o,e[9]=O,e[10]=c,e[11]=g,e[12]=a,e[13]=x,e[14]=r,e[15]=n,e[16]=T,e[17]=N,e[18]=D}else D=e[18];return D}function Is(t){return t+Nt}function Rs(){}function Ss(t){return t.stopPropagation()}function Ns(t){return!t}function As(t){const e=X.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:u,searchQuery:f,readOnly:d}=t,h=Wt(l.id);let a,g,x,m,T;if(e[0]!==u||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==h||e[8]!==d||e[9]!==f||e[10]!==r){T=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=E=>({...E,id:E.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const b=h.filter(js).map(I),N=f.trim().toLowerCase(),M=N?b.filter(E=>E.title.toLowerCase().includes(N)||E.id.toLowerCase().includes(N)||E.provider?.toLowerCase().includes(N)):b;if(M.length===0){T=null;break e}const S=new Map;for(const E of M){const k=Ts(E.id,l.providerId),G=S.get(k)??{models:[],logo:null};G.models.push({id:E.id,title:_s(E.title),logo:E.logo}),!G.logo&&E.logo&&(G.logo=E.logo),S.set(k,G)}const O=Array.from(S.entries()).map(Os).sort(bs),D=O.length===1||N.length>0;x="flex flex-col gap-3";const _=pt[l.providerId]??_t;let A;e[18]!==l.providerId||e[19]!==_?(A=s.jsx("img",{src:_,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=_,e[20]=A):A=e[20];const v=St[l.providerId]??l.providerId;let i;e[21]!==v?(i=s.jsx("h4",{className:"text-sm font-medium",children:v}),e[21]=v,e[22]=i):i=e[22],e[23]!==i||e[24]!==A?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[A,i]}),e[23]=i,e[24]=A,e[25]=m):m=e[25],a="flex flex-col gap-3",g=O.map(E=>s.jsx(Es,{connectionId:l.id,subProviderId:E.id,subProviderName:E.name,groupLogo:E.logo,models:E.models,allConnectionModelIds:b.map(Cs),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:u,onToggleModel:o,onExitAllowAll:c,readOnly:d,defaultExpanded:D},E.id))}e[0]=u,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=h,e[8]=d,e[9]=f,e[10]=r,e[11]=a,e[12]=g,e[13]=x,e[14]=m,e[15]=T}else a=e[11],g=e[12],x=e[13],m=e[14],T=e[15];if(T!==Symbol.for("react.early_return_sentinel"))return T;let C;e[26]!==a||e[27]!==g?(C=s.jsx("div",{className:a,children:g}),e[26]=a,e[27]=g,e[28]=C):C=e[28];let R;return e[29]!==x||e[30]!==m||e[31]!==C?(R=s.jsxs("div",{className:x,children:[m,C]}),e[29]=x,e[30]=m,e[31]=C,e[32]=R):R=e[32],R}function Cs(t){return t.id}function bs(t,e){return t.name.localeCompare(e.name)}function Os(t){const[e,l]=t;return{id:e,name:ps(e),logo:l.logo,models:l.models}}function js(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie(),h=$.useDeferredValue(u),a=Jt();let g;e[0]!==r||e[1]!==o?(g=(_,A)=>{const v=r[_]??[],i={...r};if(v.includes(A)){const E=v.filter(k=>k!==A);E.length===0?delete i[_]:i[_]=E}else i[_]=[...v,A];o(i)},e[0]=r,e[1]=o,e[2]=g):g=e[2];const x=g;let m;e[3]!==r||e[4]!==n||e[5]!==o?(m=(_,A,v)=>{n(!1),o({...r,[_]:A.filter(i=>i!==v)})},e[3]=r,e[4]=n,e[5]=o,e[6]=m):m=e[6];const T=m,C=!f&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==C?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",C),e[7]=C,e[8]=R):R=e[8];let I;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==f?(I=()=>{if(f)return;const _=!l;n(_),_&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=f,e[13]=I):I=e[13];let b;e[14]!==d?(b=d("settings.orgRoleDetail.allModels"),e[14]=d,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let M;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==f||e[22]!==d?(M=s.jsx("div",{onClick:vs,children:f?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{children:s.jsx("p",{children:d("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:l,onCheckedChange:_=>{n(_),_&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=f,e[22]=d,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==I||e[26]!==N||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:I,children:[N,M]}),e[24]=R,e[25]=I,e[26]=N,e[27]=M,e[28]=S):S=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==h||e[32]!==T||e[33]!==r||e[34]!==f||e[35]!==d||e[36]!==x?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(_=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ce,{className:"size-4 animate-spin"}),d("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(As,{connection:_,selectedModels:r[_.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:T,allConnectionModelsSelected:(r[_.id]??[]).includes("*"),searchQuery:h,readOnly:f})},_.id)),e[29]=a,e[30]=l,e[31]=h,e[32]=T,e[33]=r,e[34]=f,e[35]=d,e[36]=x,e[37]=O):O=e[37];let D;return e[38]!==S||e[39]!==O?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,O]}),e[38]=S,e[39]=O,e[40]=D):D=e[40],D}function Ds(){}function vs(t){return t.stopPropagation()}function Ls(t){const e=X.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,c=ie(),[u,f]=$.useState(""),d=$.useDeferredValue(u);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[a,g]=$.useState(h),{data:x}=Et();let m,T,C,R,I,b,N,M,S,O,D;if(e[1]!==x?.data?.members||e[2]!==d||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==u||e[8]!==n||e[9]!==c){const P=x?.data?.members??[];let K;e[21]!==d?(K=F=>{const W=d.toLowerCase();return F.user?.name?.toLowerCase().includes(W)||F.user?.email?.toLowerCase().includes(W)},e[21]=d,e[22]=K):K=e[22];const V=P.filter(K);let U;e[23]!==o||e[24]!==r||e[25]!==a?(U=()=>{o(a),g([]),r(!1)},e[23]=o,e[24]=r,e[25]=a,e[26]=U):U=e[26],C=U,T=dt,O=l,D=r,m=mt,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let Q;e[29]!==B?(Q=s.jsx(ut,{children:B}),e[29]=B,e[30]=Q):Q=e[30];let J;e[31]!==c?(J=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=J):J=e[32];let te;e[33]!==J?(te=s.jsx(ft,{children:J}),e[33]=J,e[34]=te):te=e[34],e[35]!==Q||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[Q,te]}),e[35]=Q,e[36]=te,e[37]=S):S=e[37],b="flex flex-col h-80";let oe;e[38]!==c?(oe=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=oe):oe=e[39],e[40]!==u||e[41]!==oe?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Ke,{value:u,onChange:f,placeholder:oe,className:"w-full"})}),e[40]=u,e[41]=oe,e[42]=N):N=e[42],R="flex-1 overflow-auto",I=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(u?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const W=F.role!=="owner",p=n.includes(F.id),w=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!W||p?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx($e,{checked:w||p,onCheckedChange:()=>{!W||p||g(H=>H.includes(F.id)?H.filter(q=>q!==F.id):[...H,F.id])},disabled:!W||p}),s.jsx(Rt,{url:F.user?.image??void 0,fallback:It(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!W&&s.jsx(Oe,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),p&&W&&s.jsx(Oe,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=x?.data?.members,e[2]=d,e[3]=o,e[4]=r,e[5]=l,e[6]=a,e[7]=u,e[8]=n,e[9]=c,e[10]=m,e[11]=T,e[12]=C,e[13]=R,e[14]=I,e[15]=b,e[16]=N,e[17]=M,e[18]=S,e[19]=O,e[20]=D}else m=e[10],T=e[11],C=e[12],R=e[13],I=e[14],b=e[15],N=e[16],M=e[17],S=e[18],O=e[19],D=e[20];let _;e[43]!==R||e[44]!==I?(_=s.jsx("div",{className:R,children:I}),e[43]=R,e[44]=I,e[45]=_):_=e[45];let A;e[46]!==_||e[47]!==b||e[48]!==N?(A=s.jsxs("div",{className:b,children:[N,_]}),e[46]=_,e[47]=b,e[48]=N,e[49]=A):A=e[49];let v;e[50]!==c?(v=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=v):v=e[51];let i;e[52]!==v?(i=s.jsx(ht,{children:v}),e[52]=v,e[53]=i):i=e[53];const E=a.length===0;let k;e[54]!==a.length||e[55]!==c?(k=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=k):k=e[56];let G;e[57]!==C||e[58]!==E||e[59]!==k?(G=s.jsx(xt,{onClick:C,disabled:E,children:k}),e[57]=C,e[58]=E,e[59]=k,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(Tt,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let L;e[64]!==m||e[65]!==A||e[66]!==Y||e[67]!==M||e[68]!==S?(L=s.jsxs(m,{className:M,children:[S,A,Y]}),e[64]=m,e[65]=A,e[66]=Y,e[67]=M,e[68]=S,e[69]=L):L=e[69];let z;return e[70]!==T||e[71]!==L||e[72]!==O||e[73]!==D?(z=s.jsx(T,{open:O,onOpenChange:D,children:L}),e[70]=T,e[71]=L,e[72]=O,e[73]=D,e[74]=z):z=e[74],z}function Ps(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=n===void 0?!1:n,h=o===void 0?void 0:o,a=ie(),g=$.useDeferredValue(c),{data:x}=Et();let m,T,C;if(e[0]!==x?.data?.members||e[1]!==g||e[2]!==l||e[3]!==r||e[4]!==d||e[5]!==h||e[6]!==c||e[7]!==a){const M=x?.data?.members??[];let S;e[11]!==l?(S=i=>l.includes(i.id),e[11]=l,e[12]=S):S=e[12];const O=M.filter(S);let D;e[13]!==g?(D=i=>{const E=g.toLowerCase();return i.user?.name?.toLowerCase().includes(E)||i.user?.email?.toLowerCase().includes(E)},e[13]=g,e[14]=D):D=e[14];const _=O.filter(D);let A;e[15]!==h||e[16]!==a?(A=h??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=h,e[16]=a,e[17]=A):A=e[17];const v=A;C="flex flex-col h-full",m="flex-1 overflow-auto",T=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")})]})}):_.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:_.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:It(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),d?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(tt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:v})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(E=>E!==i.id)),children:s.jsx(tt,{size:16})})]},i.id))}),e[0]=x?.data?.members,e[1]=g,e[2]=l,e[3]=r,e[4]=d,e[5]=h,e[6]=c,e[7]=a,e[8]=m,e[9]=T,e[10]=C}else m=e[8],T=e[9],C=e[10];let R;e[18]!==m||e[19]!==T?(R=s.jsx("div",{className:m,children:T}),e[18]=m,e[19]=T,e[20]=R):R=e[20];let I;e[21]!==l||e[22]!==r?(I=M=>r([...l,...M]),e[21]=l,e[22]=r,e[23]=I):I=e[23];let b;e[24]!==u||e[25]!==l||e[26]!==f||e[27]!==I?(b=s.jsx(Ls,{open:u,onOpenChange:f,selectedMemberIds:l,onAddMembers:I}),e[24]=u,e[25]=l,e[26]=f,e[27]=I,e[28]=b):b=e[28];let N;return e[29]!==C||e[30]!==R||e[31]!==b?(N=s.jsxs("div",{className:C,children:[R,b]}),e[29]=C,e[30]=R,e[31]=b,e[32]=N):N=e[32],N}function ys(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ce,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx($.Suspense,{fallback:l,children:s.jsx(Ps,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const ws={owner:[],admin:[],user:[]};function Gs(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:ws[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function ks(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),c=o?[]:n.filter(a=>a!=="*"),u={};for(const[a,g]of Object.entries(r))if(!(a==="self"||a==="models"))if(a==="*")for(const x of l)u[x.id]=g.includes("*")?x.tools?.map(m=>m.name)??[]:g;else{const x=l.find(m=>m.id===a);x&&(u[a]=g.includes("*")?x.tools?.map(m=>m.name)??[]:g)}const f=r.models||[],d=f.length===0||f.includes("*:*"),h={};if(!d)for(const a of f){const g=a.indexOf(":");if(g===-1)continue;const x=a.slice(0,g),m=a.slice(g+1);h[x]||(h[x]=[]),h[x].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:u,allowAllModels:d,modelSet:h,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Us(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const c=e.find(u=>u.id===r)?.tools?.map(u=>u.name)??[];l[r]=c.length>0&&c.every(u=>n.includes(u))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const c of o)r.push(`${n}:${c}`);r.length>0&&(l.models=r)}return l}function Bs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?ks(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Vs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,c=ie();let u;e[0]!==o||e[1]!==c?(u=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=u):u=e[2];const f=u;if(l){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Be,{size:16}),e[3]=g):g=e[3];let x;e[4]!==c?(x=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=x):x=e[5];let m;e[6]!==x?(m=s.jsx(ve,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[g,x]})})}),e[6]=x,e[7]=m):m=e[7];let T;e[8]!==f?(T=s.jsx(Le,{children:s.jsx("p",{children:f})}),e[8]=f,e[9]=T):T=e[9];let C;return e[10]!==m||e[11]!==T?(C=s.jsx(Me,{children:s.jsxs(De,{children:[m,T]})}),e[10]=m,e[11]=T,e[12]=C):C=e[12],C}let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:16}),e[13]=d):d=e[13];let h;e[14]!==c?(h=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=h):h=e[15];let a;return e[16]!==n||e[17]!==h?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[d,h]}),e[16]=n,e[17]=h,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Ge(),r=ze(),n=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==r?(c=()=>r.organization.listMembers(),e[2]=r,e[3]=c):c=e[3];let u;e[4]!==o||e[5]!==c?(u={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=u):u=e[6];const{data:f,isPending:d}=Ve(u);if(d||!n){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=x):x=e[7],x}let h;e[8]!==f?.data?.members?(h=f?.data?.members??[],e[8]=f?.data?.members,e[9]=h):h=e[9];const a=h;let g;return e[10]!==n||e[11]!==a||e[12]!==t?(g=s.jsx(zs,{...t,members:a,connections:n}),e[10]=n,e[11]=a,e[12]=t,e[13]=g):g=e[13],g}function zs({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:c}=Ge(),u=ze(),f=ot(),d=t.kind==="builtin",h=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[g,x]=$.useState(d?"org":"mcp"),m=bt({resolver:Ot(ms),defaultValues:Bs(t,r,n)}),T=m.formState.isValid,C=m.formState.isDirty,R=nt({mutationFn:async i=>{const E=Us(i,n),k=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(L,z)=>{const P=r.filter(U=>U.role===(z??L)).map(U=>U.id),K=i.memberIds.filter(U=>!P.includes(U)),V=P.filter(U=>!i.memberIds.includes(U));for(const U of K){const B=await u.organization.updateMemberRole({memberId:U,role:[L]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await u.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const L=i.role.label.toLowerCase().replace(/\s+/g,"-"),z=i.role.slug,P=L!==z,K=await u.organization.updateRole({roleId:i.role.id,data:{permission:E,...P?{roleName:L}:{}}});if(K?.error)throw new Error(K.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(P?L:z,P?z:void 0),P?{...i,role:{...i.role,slug:L}}:i}else{const L=await u.organization.createRole({role:k,permission:E});if(L?.error)throw new Error(L.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const z of i.memberIds){const P=await u.organization.updateMemberRole({memberId:z,role:[k]});if(P?.error)throw new Error(P.error.message)}return{...i,role:{...i.role,id:L.data?.roleData?.id,slug:k}}}},onSuccess:(i,E)=>{f.invalidateQueries({queryKey:de.members(c)}),f.invalidateQueries({queryKey:de.organizationRoles(c)});const k=!E.role.id&&!E.role.slug,G=E.role.slug==="owner"&&!E.role.id;Ye(G?"role_members_updated":k?"role_created":"role_updated",{role_slug:E.role.slug??null}),be.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),m.reset(i),l(i.role.id)},onError:i=>{be.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=m.handleSubmit(i=>{if(!i.role.label.trim()){be.error(o("settings.orgRoleDetail.roleNameIsRequired")),m.setFocus("role.label");return}R.mutate(i)}),b=!h,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...h?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,O]=$.useState(""),[D,_]=$.useState(!1),A=i=>{x(i),O("")},v={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ae,{children:s.jsxs(Ae.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ae.Title,{actions:b&&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:I,disabled:R.isPending||!T||!C,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(m.watch("role.label")))}),h&&s.jsx(it,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...m.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(i=>s.jsx("button",{type:"button",onClick:()=>A(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Ke,{value:S,onChange:O,placeholder:v[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(Vs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>_(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!h&&s.jsx(ds,{toolSet:m.watch("toolSet"),onToolSetChange:i=>m.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:S}),g==="org"&&s.jsx(us,{allowAllStaticPermissions:m.watch("allowAllStaticPermissions"),staticPermissions:m.watch("staticPermissions"),onAllowAllChange:i=>m.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>m.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:h,searchQuery:S}),g==="models"&&s.jsx(Ms,{allowAllModels:m.watch("allowAllModels"),modelSet:m.watch("modelSet"),onAllowAllChange:i=>m.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>m.setValue("modelSet",i,{shouldDirty:!0}),readOnly:h,searchQuery:S}),g==="members"&&s.jsx(ys,{memberIds:m.watch("memberIds"),onMemberIdsChange:i=>m.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:_})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Fs(t){const e=X.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:c}=Mt();let u;return e[0]!==l||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o?(u=s.jsx(ts,{granted:n,loading:o,error:c,area:l,children:r}),e[0]=l,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}const $s=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Qs(){const t=X.c(128),e=ie(),[l,r]=$.useState(""),[n,o]=$.useState(null),c=Lt();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=rt(u),{locator:d}=Ge(),h=ze(),a=ot(),{customRoles:g,refetch:x}=Pt();let m;t[1]!==c?(m=j=>c({to:".",search:y=>({...y,role:j})}),t[1]=c,t[2]=m):m=t[2];const T=m;let C;e:{if(!f){C=null;break e}if(f==="new"){C={kind:"new"};break e}if(f.startsWith("builtin-")){C={kind:"builtin",role:f.slice(8)};break e}let j;t[3]!==f?(j=ee=>ee.id===f,t[3]=f,t[4]=j):j=t[4];const y=g.find(j);C=y?{kind:"custom",role:y}:null}const R=C;let I;t[5]!==d?(I=de.members(d),t[5]=d,t[6]=I):I=t[6];let b;t[7]!==h?(b=()=>h.organization.listMembers(),t[7]=h,t[8]=b):b=t[8];let N;t[9]!==I||t[10]!==b?(N={queryKey:I,queryFn:b},t[9]=I,t[10]=b,t[11]=N):N=t[11];const{data:M}=Ve(N);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const O=S;let D;t[14]!==O?(D=j=>O.filter(y=>y.role===j).length,t[14]=O,t[15]=D):D=t[15];const _=D;let A;if(t[16]!==g||t[17]!==_||t[18]!==l||t[19]!==e){let j;t[21]!==_||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:_(ce.role),label:e(ce.labelKey)}}),t[21]=_,t[22]=e,t[23]=j):j=t[23];const y=$s.map(j);let ee;t[24]!==_?(ee=ce=>({kind:"custom",role:{...ce,memberCount:_(ce.role)}}),t[24]=_,t[25]=ee):ee=t[25];const At=g.map(ee);if(A=[...y,...At],l){const ce=l.toLowerCase();A=A.filter(Ct=>Ct.role.label.toLowerCase().includes(ce))}t[16]=g,t[17]=_,t[18]=l,t[19]=e,t[20]=A}else A=t[20];let v;t[26]!==h?(v=async j=>{const y=await h.organization.deleteRole({roleId:j});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=h,t[27]=v):v=t[27];const i=nt({mutationFn:v,onSuccess:(j,y)=>{Ye("role_deleted",{role_id:y}),a.invalidateQueries({queryKey:de.members(d)}),a.invalidateQueries({queryKey:de.organizationRoles(d)}),be.success(e("settings.roles.deletedSuccessfully")),x(),R?.kind==="custom"&&R.role.id===y&&T(void 0)},onError:Ws});let E;t[28]!==e?(E=e("settings.roles.columnRole"),t[28]=e,t[29]=E):E=t[29];let k;t[30]!==E?(k={id:"role",header:E,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=E,t[31]=k):k=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(Oe,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Oe,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let L;t[36]!==G||t[37]!==Y?(L={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=L):L=t[38];let z;t[39]!==e?(z=e("settings.roles.columnPermissions"),t[39]=e,t[40]=z):z=t[40];let P;t[41]!==e?(P=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=j.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=P):P=t[42];let K;t[43]!==z||t[44]!==P?(K={id:"permissions",header:z,render:P,cellClassName:"flex-1 min-w-0"},t[43]=z,t[44]=P,t[45]=K):K=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:Zs,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(kt,{align:"end",onClick:Hs,children:s.jsxs(Ut,{variant:"destructive",onClick:()=>{const y=j.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let Q;t[52]!==k||t[53]!==L||t[54]!==K||t[55]!==U||t[56]!==B?(Q=[k,L,K,U,B],t[52]=k,t[53]=L,t[54]=K,t[55]=U,t[56]=B,t[57]=Q):Q=t[57];const J=Q;let te;t[58]!==T?(te=j=>{if(j.kind==="builtin")T(`builtin-${j.role.role}`);else{const y=j.role;T(y.id)}},t[58]=T,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==T?(j=()=>T(void 0),t[60]=T,t[61]=j):j=t[61];let y;return t[62]!==x||t[63]!==T?(y=()=>{x(),T(void 0)},t[62]=x,t[63]=T,t[64]=y):y=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:y},Ks(R))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let W;t[67]===Symbol.for("react.memo_cache_sentinel")?(W=j=>{j.key==="Escape"&&(r(""),j.target.blur())},t[67]=W):W=t[67];let p;t[68]!==l||t[69]!==F?(p=s.jsx(Ke,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:W}),t[68]=l,t[69]=F,t[70]=p):p=t[70];let w;t[71]!==T?(w=()=>T("new"),t[71]=T,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Be,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==p||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p,se]}),t[79]=p,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(st,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(st,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let me;t[85]!==A||t[86]!==J||t[87]!==oe||t[88]!==ne?(me=s.jsx(Yt,{columns:J,data:A,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=A,t[86]=J,t[87]=oe,t[88]=ne,t[89]=me):me=t[89];const ke=n!==null;let Pe;t[90]===Symbol.for("react.memo_cache_sentinel")?(Pe=j=>!j&&o(null),t[90]=Pe):Pe=t[90];let ue;t[91]!==e?(ue=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=ue):ue=t[92];let fe;t[93]!==ue?(fe=s.jsx(ut,{children:ue}),t[93]=ue,t[94]=fe):fe=t[94];const Ue=n?.label??"";let ge;t[95]!==e||t[96]!==Ue?(ge=e("settings.roles.deleteRoleConfirm",{role:Ue}),t[95]=e,t[96]=Ue,t[97]=ge):ge=t[97];let he;t[98]!==ge?(he=s.jsx(ft,{children:ge}),t[98]=ge,t[99]=he):he=t[99];let xe;t[100]!==fe||t[101]!==he?(xe=s.jsxs(gt,{children:[fe,he]}),t[100]=fe,t[101]=he,t[102]=xe):xe=t[102];let Te;t[103]!==e?(Te=e("settings.roles.cancel"),t[103]=e,t[104]=Te):Te=t[104];let pe;t[105]!==Te?(pe=s.jsx(ht,{children:Te}),t[105]=Te,t[106]=pe):pe=t[106];let _e;t[107]!==i||t[108]!==n?(_e=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=_e):_e=t[109];let Ee;t[110]!==e?(Ee=e("settings.roles.delete"),t[110]=e,t[111]=Ee):Ee=t[111];let Ie;t[112]!==_e||t[113]!==Ee?(Ie=s.jsx(xt,{onClick:_e,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),t[112]=_e,t[113]=Ee,t[114]=Ie):Ie=t[114];let Re;t[115]!==pe||t[116]!==Ie?(Re=s.jsxs(Tt,{children:[pe,Ie]}),t[115]=pe,t[116]=Ie,t[117]=Re):Re=t[117];let Se;t[118]!==xe||t[119]!==Re?(Se=s.jsxs(mt,{children:[xe,Re]}),t[118]=xe,t[119]=Re,t[120]=Se):Se=t[120];let Ne;t[121]!==ke||t[122]!==Se?(Ne=s.jsx(dt,{open:ke,onOpenChange:Pe,children:Se}),t[121]=ke,t[122]=Se,t[123]=Ne):Ne=t[123];let ye;return t[124]!==le||t[125]!==me||t[126]!==Ne?(ye=s.jsxs(at,{group:"members",className:"gap-6",children:[le,me,Ne]}),t[124]=le,t[125]=me,t[126]=Ne,t[127]=ye):ye=t[127],ye}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Zs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",ct(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(it,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ws(t,e){Ye("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),be.error(t instanceof Error?t.message:"Failed to delete role")}function Xs(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=rt(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let c;t[5]!==r?(c=r?s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})})}):s.jsx(at,{group:"members",className:"gap-6",children:s.jsx(Dt,{})}),t[5]=r,t[6]=c):c=t[6];let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Qs,{}),t[7]=u):u=t[7];let f;t[8]!==c?(f=s.jsx($.Suspense,{fallback:c,children:u}),t[8]=c,t[9]=f):f=t[9];let d;return t[10]!==o||t[11]!==f?(d=s.jsx(vt,{fallback:o,children:f}),t[10]=o,t[11]=f,t[12]=d):d=t[12],d}function Ao(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{area:"roles",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{Ao as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,n as w,j as a,k as j}from"./index-
|
|
1
|
+
import{c as b,n as w,j as a,k as j}from"./index-4Yq2AnCq.js";import{i as k}from"./SearchMd-VcuMXm67.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(k,{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,b as y,j as s,P as N,d9 as $,E as F,r as v,Y as B,C as k,B as _,t as w}from"./index-
|
|
1
|
+
import{c as j,b as y,j as s,P as N,d9 as $,E as F,r as v,Y as B,C as k,B as _,t as w}from"./index-4Yq2AnCq.js";import{i as L}from"./AlertCircle-BvnCHRsL.js";import{s as E}from"./Plus-CcMb81sq.js";import{s as O}from"./User01-bzqmgkdh.js";import{t as R}from"./Users01-8maiPdfp.js";import{e as A,d as I,a as q,b as V,h as H,c as Y}from"./dialog-BxxhOAOz.js";import{I as z}from"./input-BgqlRc0-.js";import{L as C}from"./label-C_X4tCX_.js";import{S as G,a as J,b as K,c as M,d as D}from"./select-D4XDO-b1.js";import{T as Q}from"./textarea-JZ07srxU.js";import{u as U,a as W}from"./use-secrets-BxcvnoPW.js";import{R as X}from"./require-capability-i_K5dXXM.js";import"./Check-CvmqPlvr.js";import"./ChevronDown-Bw9gK0Xq.js";import"./ChevronUp-MaQ-QeOM.js";import"./access-gate-DMwqkzwZ.js";import"./capability-load-error-Bt5z8vOI.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(L,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?O:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let o;return e[5]!==l||e[6]!==a?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[a,l]}),e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=a):a=e[9];let o;e[10]!==l||e[11]!==a?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=o):o=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let m;e[15]!==u?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=m):m=e[16];let d;return e[17]!==o||e[18]!==m?(d=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=d):d=e[19],d}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let a;e[5]!==i?(a=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=a):a=e[6];let o;e[7]!==a?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=o):o=e[8];let u;e[9]!==l||e[10]!==o?(u=s.jsxs("div",{children:[l,o]}),e[9]=l,e[10]=o,e[11]=u):u=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(E,{size:14}),e[12]=m):m=e[12];let d;e[13]!==i?(d=i("settings.secrets.newSecret"),e[13]=i,e[14]=d):d=e[14];let p;e[15]!==r||e[16]!==d?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[m,d]}),e[15]=r,e[16]=d,e[17]=p):p=e[17];let f;return e[18]!==u||e[19]!==p?(f=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=f):f=e[20],f}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[a,o]=v.useState(""),[u,m]=v.useState(""),d=W();function p(){c("organization"),l(""),o(""),m("")}function f(){p(),e(!1)}async function g(x){if(x.preventDefault(),!(!n.trim()||!a))try{await d.mutateAsync({scope:i,name:n.trim(),value:a,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),f()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(A,{open:t,onOpenChange:x=>{x?e(x):f()},children:s.jsxs(I,{className:"sm:max-w-lg",children:[s.jsxs(q,{children:[s.jsx(V,{children:r("settings.secrets.newSecretTitle")}),s.jsx(H,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(G,{value:i,onValueChange:x=>c(x),children:[s.jsx(J,{id:"secret-scope",children:s.jsx(K,{})}),s.jsxs(M,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:x=>l(x.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:a,onChange:x=>o(x.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:x=>m(x.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(Y,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:f,disabled:d.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:d.isPending||!n.trim()||!a,children:d.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=U(),[i,c]=v.useState(!1);if(r.length===0){let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=m):m=t[0];let d;return t[1]!==i?(d=s.jsxs(s.Fragment,{children:[m,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=d):d=t[2],d}let n,l,a;if(t[3]!==r||t[4]!==e){const m=r.filter(ce),d=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let f;t[8]!==r.length||t[9]!==e||t[10]!==p?(f=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=f):f=t[11];let g;t[12]!==f?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:f}),t[12]=f,t[13]=g):g=t[13];let x;t[14]===Symbol.for("react.memo_cache_sentinel")?(x=()=>c(!0),t[14]=x):x=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:x,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:m.map(ne)})]}):null,a=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:d.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=a}else n=t[5],l=t[6],a=t[7];let o;t[23]!==i?(o=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=o):o=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==a||t[28]!==o?(u=s.jsxs(s.Fragment,{children:[n,l,a,o]}),t[25]=n,t[26]=l,t[27]=a,t[28]=o,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(N.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:ae,children:s.jsx(v.Suspense,{fallback:s.jsx(B,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(N,{children:s.jsx(N.Content,{children:s.jsx(N.Body,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function ae(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function we(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{we as default};
|