decocms 4.339.0 → 4.339.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-S07uSGUV.js → AlertCircle-COFB2d-k.js} +1 -1
- package/dist/client/assets/{AreaChart-RLACQQ3X.js → AreaChart-xaiGT9tS.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BH7Gh79U.js → ArrowLeft-B_Sm8nZF.js} +1 -1
- package/dist/client/assets/{ArrowUp-DvPWBDm2.js → ArrowUp-DtnUC7b1.js} +1 -1
- package/dist/client/assets/{Check-CO7Wij_G.js → Check-RwOXYzpY.js} +1 -1
- package/dist/client/assets/{CheckCircle-DMNXDKJx.js → CheckCircle-BakDkudF.js} +1 -1
- package/dist/client/assets/{ChevronRight-CvkDeRys.js → ChevronRight-BId4MMJ9.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DQ7kEVnV.js → ChevronSelectorVertical-BPZJCzil.js} +1 -1
- package/dist/client/assets/{ChevronUp-fhQ6Axth.js → ChevronUp-CKGVkzNf.js} +1 -1
- package/dist/client/assets/{Copy01-CKSS0EBG.js → Copy01-D8F1H1Rm.js} +1 -1
- package/dist/client/assets/{CreditCard01-9BVP9JSP.js → CreditCard01-hwp2k2z5.js} +1 -1
- package/dist/client/assets/{DotsVertical-BwgQQHgd.js → DotsVertical-CiZ90LaC.js} +1 -1
- package/dist/client/assets/{Download01-dK8p5EXl.js → Download01-BFWoFyp5.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-Djv7bj24.js → ErrorBarContext-DgbmJPin.js} +1 -1
- package/dist/client/assets/{Eye-ni0CzCCc.js → Eye-BkYoLh_d.js} +1 -1
- package/dist/client/assets/{GitBranch01-Dw9pX0qw.js → GitBranch01-wBN2Zyoy.js} +1 -1
- package/dist/client/assets/{Globe01-DIEWGOdB.js → Globe01-D_ldoikY.js} +1 -1
- package/dist/client/assets/{HardDrive-BoGojPck.js → HardDrive-ChbOVw3L.js} +1 -1
- package/dist/client/assets/{Image01-BQ751Vs7.js → Image01-CVmN_WRr.js} +1 -1
- package/dist/client/assets/{Key01-CUOUB1_8.js → Key01-n-kxmORy.js} +1 -1
- package/dist/client/assets/{Link01-CilyfKEd.js → Link01-ngcEVr-U.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DAMPJq2T.js → LinkExternal01-CYGJDolS.js} +1 -1
- package/dist/client/assets/{Monitor01-LxLRjbmv.js → Monitor01-B3YP0Q4Y.js} +1 -1
- package/dist/client/assets/{Package-CzcPt2_z.js → Package-D3FCZEz9.js} +1 -1
- package/dist/client/assets/{Palette-Bu0kFe6V.js → Palette-B8VxVOuh.js} +1 -1
- package/dist/client/assets/{Play-BNQYseaq.js → Play-BJDJ0Cd_.js} +1 -1
- package/dist/client/assets/{Plus-iuQHfppX.js → Plus-f1J7CslD.js} +1 -1
- package/dist/client/assets/{SearchLg-CEt6QXfV.js → SearchLg-ijCBByfF.js} +1 -1
- package/dist/client/assets/{SearchMd-D-RA9v7D.js → SearchMd-BxQNX78D.js} +1 -1
- package/dist/client/assets/{Sector-CbZzVjRd.js → Sector-DjNoLuA2.js} +1 -1
- package/dist/client/assets/{Settings02-OLs927oO.js → Settings02-DI7LVcro.js} +1 -1
- package/dist/client/assets/{Share07-i6nyeBY0.js → Share07-BlQxtP9X.js} +1 -1
- package/dist/client/assets/{Shield01-BHm6PFQF.js → Shield01-arn3OL5A.js} +1 -1
- package/dist/client/assets/{Stars01-DYf5EZg3.js → Stars01-C7zRxa-s.js} +1 -1
- package/dist/client/assets/{Sun-DXxx_pQ2.js → Sun-CudPxUwF.js} +1 -1
- package/dist/client/assets/{Tool01-CwmEt4SM.js → Tool01-CsI9zgpV.js} +1 -1
- package/dist/client/assets/{Tool02-BIpvQa4r.js → Tool02-BFWUmpcW.js} +1 -1
- package/dist/client/assets/{Trash01-hTjL8EuS.js → Trash01-JArTmXvL.js} +1 -1
- package/dist/client/assets/{TrendUp01-BAD83f_Y.js → TrendUp01-BXyuZrfj.js} +1 -1
- package/dist/client/assets/{Upload01-DxSmPWTB.js → Upload01-TH_UzEO5.js} +1 -1
- package/dist/client/assets/{User01-BGEHR2yU.js → User01-BQutGTr9.js} +1 -1
- package/dist/client/assets/{UserSquare-BdoiSxAh.js → UserSquare-EeCR50Jd.js} +1 -1
- package/dist/client/assets/{Users01-C0UfM8Qv.js → Users01-BlGMCWje.js} +1 -1
- package/dist/client/assets/{Users03-DZSnEG1B.js → Users03-DBIwkies.js} +1 -1
- package/dist/client/assets/{XCircle-BMEXXBpM.js → XCircle-B-U8MZ3l.js} +1 -1
- package/dist/client/assets/{XClose-Cy11W9uC.js → XClose-Dz9b9dRZ.js} +1 -1
- package/dist/client/assets/{Zap-BJayzjVo.js → Zap-Dpl5zC2B.js} +1 -1
- package/dist/client/assets/{ZoomOut-T29bK6p-.js → ZoomOut-d1whDSJ4.js} +1 -1
- package/dist/client/assets/{access-gate-IhYuji1M.js → access-gate-CgpWlbs5.js} +1 -1
- package/dist/client/assets/{agent-icon-BYPFWuLT.js → agent-icon-COOgI3ay.js} +1 -1
- package/dist/client/assets/{agents-list-B4DX5igL.js → agents-list-B3Y5y06D.js} +1 -1
- package/dist/client/assets/{ai-providers-C1BaR-Lk.js → ai-providers-C9ObWIua.js} +1 -1
- package/dist/client/assets/{alert-DRYt1I2B.js → alert--Dt-uESS.js} +1 -1
- package/dist/client/assets/{alert-dialog-BNTeNqfT.js → alert-dialog-CADzi4i2.js} +1 -1
- package/dist/client/assets/{analytics-tab-DJbK2-FV.js → analytics-tab-BzVQHWsw.js} +1 -1
- package/dist/client/assets/api-keys-Cyhr6yA9.js +1 -0
- package/dist/client/assets/{api-keys-Dkx4q4h2.js → api-keys-DR6-cuN4.js} +1 -1
- package/dist/client/assets/app-editor-D4awjVz8.js +1 -0
- package/dist/client/assets/{auth-CziOpIXF.js → auth-CDNWJs_H.js} +1 -1
- package/dist/client/assets/{auth-catchall-tUU6t5VR.js → auth-catchall-DL3O1q4B.js} +1 -1
- package/dist/client/assets/{auth-entry-BBW1NYXb.js → auth-entry-C1LZapjz.js} +1 -1
- package/dist/client/assets/{auth-split-layout-SJR3WXIJ.js → auth-split-layout-Gop3ynxc.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BNRS7ur6.js → authenticate-and-persist-oauth-Bc7-Czof.js} +1 -1
- package/dist/client/assets/{automation-list-row-Be0wJgce.js → automation-list-row-DTvuVLg8.js} +1 -1
- package/dist/client/assets/{automation-runs-BJSc7yYz.js → automation-runs-jJdD2kMw.js} +1 -1
- package/dist/client/assets/{automations-DuEYjTjL.js → automations-DtgECkvr.js} +1 -1
- package/dist/client/assets/{autosend-DD4s2miU.js → autosend-DnWitnAW.js} +1 -1
- package/dist/client/assets/{avatar-DqScveeb.js → avatar-DelCpRBk.js} +1 -1
- package/dist/client/assets/{badge-DVwHlInw.js → badge-CzoDeQX5.js} +1 -1
- package/dist/client/assets/{block-document-CUBzlad8.js → block-document-CYynEyMa.js} +1 -1
- package/dist/client/assets/{breadcrumb-CHyD0HWK.js → breadcrumb-Ci8qwvwh.js} +1 -1
- package/dist/client/assets/{buckets-2qChFQZq.js → buckets-7DRsNGEd.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-C5CrdSsx.js → bulk-category-panel-CBcpSaVj.js} +1 -1
- package/dist/client/assets/{capability-load-error-B2vJZOPj.js → capability-load-error-GWNWVbL6.js} +1 -1
- package/dist/client/assets/{cards-wuVZ2F9C.js → cards-Cj23GDZ7.js} +1 -1
- package/dist/client/assets/{category-editor-BX3MmA-s.js → category-editor-242jZ9R1.js} +1 -1
- package/dist/client/assets/{cdn-tab-DacTXU11.js → cdn-tab-CxrKZ9BM.js} +1 -1
- package/dist/client/assets/{chart-K3FHPN-T.js → chart-xWqOKrT9.js} +1 -1
- package/dist/client/assets/{chat-context-BWI3X79H.js → chat-context-YazMDsfb.js} +1 -1
- package/dist/client/assets/{checkbox-Dup0-e8q.js → checkbox-5kuFpJGJ.js} +1 -1
- package/dist/client/assets/{choose-editor-T9v2SHOR.js → choose-editor-CoN8FJC-.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CQat4aKu.js → cli-auth-success-BR4HnqSw.js} +1 -1
- package/dist/client/assets/{client-icons-DemcJYR4.js → client-icons-BJAudV-4.js} +1 -1
- package/dist/client/assets/{collection-detail-DrpM_Y2Q.js → collection-detail-TohUC5eL.js} +1 -1
- package/dist/client/assets/{collection-display-button-Ce8P24xA.js → collection-display-button-C3Z23sMQ.js} +1 -1
- package/dist/client/assets/{collection-search-TlKZmpmc.js → collection-search-x0S64zby.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CL7cq0ac.js → collection-table-wrapper-Be1BrSKV.js} +1 -1
- package/dist/client/assets/{collection-tabs-pe0vIoAX.js → collection-tabs-BI0Rhp1n.js} +1 -1
- package/dist/client/assets/{command-CIHjFwuN.js → command-DvAIiR-Z.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DPFJPcUR.js → commerce-onboarding-rsu4xpmu.js} +1 -1
- package/dist/client/assets/{connect-6ZcEKRm6.js → connect-CPAQI-Wa.js} +1 -1
- package/dist/client/assets/{connect-layout-mqy9k1WM.js → connect-layout-DnTik73n.js} +1 -1
- package/dist/client/assets/{connection-BGRlXWJy.js → connection-DVZ0x-CQ.js} +1 -1
- package/dist/client/assets/{connection-card-DvdHgFtl.js → connection-card-CSJ2w0Dp.js} +1 -1
- package/dist/client/assets/{connection-detail-C4npgyXI.js → connection-detail-BQl9INRf.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-YJt_XZ50.js → connection-form-helpers-BGULertj.js} +1 -1
- package/dist/client/assets/{connections-DXxpH81s.js → connections-CJ3AQ7bL.js} +1 -1
- package/dist/client/assets/{constants-BRGHAWVM.js → constants-Daqiz8AS.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-QTEkdX9-.js → create-organization-dialog-BrRJMZ9P.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BTLrAUpt.js → decopilot-sse-pool-T7r443E8.js} +1 -1
- package/dist/client/assets/{dialog-Dbvc6M5C.js → dialog-ClXo-ILY.js} +1 -1
- package/dist/client/assets/{domain-settings-5nRm4h5m.js → domain-settings-D4vHkL29.js} +1 -1
- package/dist/client/assets/{drawer-DxoBKpfJ.js → drawer-4yZNiDGz.js} +1 -1
- package/dist/client/assets/{dropdown-menu-D4P0HJXh.js → dropdown-menu-ChRlmtGH.js} +1 -1
- package/dist/client/assets/{e2e-tab-WP8tC0Uq.js → e2e-tab-DE_h1PjG.js} +1 -1
- package/dist/client/assets/{editor-BFNJb3dt.js → editor-C8IlfhPf.js} +1 -1
- package/dist/client/assets/{empty-state-DLYL1z5C.js → empty-state-CMDRQGT-.js} +1 -1
- package/dist/client/assets/{empty-state-9y8YHZTO.js → empty-state-CmJs9n9u.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DCWyDgX-.js → extract-connection-data-CBaHjHii.js} +1 -1
- package/dist/client/assets/{file-explorer-DXfH_v6s.js → file-explorer-bszPPJMi.js} +1 -1
- package/dist/client/assets/{file-type-icon-BvewENDx.js → file-type-icon-CCS82EWp.js} +1 -1
- package/dist/client/assets/{folder-icon-D_dDA2rx.js → folder-icon-BprwUfXF.js} +1 -1
- package/dist/client/assets/{form-CrSXzdNz.js → form-BbPYrZM0.js} +1 -1
- package/dist/client/assets/{general--y0V0aky.js → general-Jx6iT4LG.js} +1 -1
- package/dist/client/assets/{github-icon-DzBDKxcO.js → github-icon-BamvWtlu.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CnfFb2Dj.js → github-repo-picker-_9hUfw1v.js} +1 -1
- package/dist/client/assets/{gitlab-icon-Buv9Y7Of.js → gitlab-icon-BvCV8hCq.js} +1 -1
- package/dist/client/assets/{hooks-D3UVpJ2w.js → hooks-Dp9_KjXz.js} +1 -1
- package/dist/client/assets/{hosting-tab-C15P9Lut.js → hosting-tab-CvfAAsG1.js} +1 -1
- package/dist/client/assets/{index-Co2WraFt.js → index-B59o9_T8.js} +1 -1
- package/dist/client/assets/{index-CrPWe_q5.js → index-Bo46yES1.js} +1 -1
- package/dist/client/assets/{index-CC1t5q8S.js → index-CeY5DP2H.js} +1 -1
- package/dist/client/assets/{index-Lmi8-lLW.js → index-Cg7xMas6.js} +1 -1
- package/dist/client/assets/{index-oV8a7M8h.js → index-DE8RFRam.js} +1 -1
- package/dist/client/assets/{index-CZZhDIX-.js → index-DIek05Ni.js} +2 -2
- package/dist/client/assets/{index-CC6ajhFI.js → index-DMbrlz1m.js} +1 -1
- package/dist/client/assets/{index-CkPzmpQ4.js → index-DMoSkttT.js} +1 -1
- package/dist/client/assets/{index-D-0ALyMd.js → index-owJhPnZu.js} +6 -6
- package/dist/client/assets/{index-redirect-BWWatcfU.js → index-redirect-BSQNK0c5.js} +1 -1
- package/dist/client/assets/{index-heR3_2Y4.js → index-xqZUEhiq.js} +1 -1
- package/dist/client/assets/{infra-billing-tdT12_gM.js → infra-billing-D81JNr_4.js} +1 -1
- package/dist/client/assets/{input-DRyyvExE.js → input-B6-nFuh0.js} +1 -1
- package/dist/client/assets/{integration-icon-iQQ4uEFp.js → integration-icon-BdFo1XXn.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-hv300B4f.js → invite-member-dialog-D9VCDEZZ.js} +1 -1
- package/dist/client/assets/{label-CKOVZbvu.js → label-Bzd8c-RA.js} +1 -1
- package/dist/client/assets/{layout-Ddl5C-Ll.js → layout-BZVLMtZ0.js} +1 -1
- package/dist/client/assets/{login-C0rra4zX.js → login-DbWxzcWy.js} +1 -1
- package/dist/client/assets/{markdown-HhyxSwvx.js → markdown-CtbNHSiX.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BNHlE2hU.js → mcp-app-renderer-BtErdXgT.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DKve0iL-.js → mcp-oauth-D3PGb0x2.js} +1 -1
- package/dist/client/assets/{members-B9YubxNe.js → members-X7tkSv1G.js} +1 -1
- package/dist/client/assets/{monaco-editor-BH0t50ft.js → monaco-editor-DMcAThqN.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-rjTAWXVa.js → monitoring-stats-row-DKvLbjkP.js} +1 -1
- package/dist/client/assets/{multi-select-DT7er9Zs.js → multi-select-DGNYTNEk.js} +1 -1
- package/dist/client/assets/{oauth-callback-DT-Hp6_c.js → oauth-callback-Ca0yqV1C.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Crad4tdP.js → oauth-callback-ai-provider-DOQ0G2c1.js} +1 -1
- package/dist/client/assets/{onboarding-Mu-8sSy3.js → onboarding-CiXSJ2qw.js} +1 -1
- package/dist/client/assets/{org-layout-Do4qTNoq.js → org-layout-CPBdd6Bg.js} +1 -1
- package/dist/client/assets/{organization-choice-Cu9cVA9v.js → organization-choice-DW679eUB.js} +1 -1
- package/dist/client/assets/{orgs-zwhYS3Xf.js → orgs-CbnIGbcT.js} +1 -1
- package/dist/client/assets/{page-seo-form-Bf9lIp-1.js → page-seo-form-CNpNwABh.js} +1 -1
- package/dist/client/assets/{popover-DndlrhLY.js → popover-DNtfUsCB.js} +1 -1
- package/dist/client/assets/{post-calendar-DpzoQcji.js → post-calendar-B07y2JsG.js} +1 -1
- package/dist/client/assets/{post-editor-DFC9E75o.js → post-editor-B2SPGEHG.js} +1 -1
- package/dist/client/assets/{primitives-D7580aqu.js → primitives-CDC6DfBN.js} +1 -1
- package/dist/client/assets/{profile-Dk_r9hVx.js → profile-D0A66T6t.js} +1 -1
- package/dist/client/assets/{project-app-view-BEBZPRLl.js → project-app-view-D3HZP3xn.js} +1 -1
- package/dist/client/assets/project-icon-BKwNPyDH.js +1 -0
- package/dist/client/assets/{prompts-hgkVVr6D.js → prompts-f-nECtr8.js} +1 -1
- package/dist/client/assets/record-editor-BO0tdXdW.js +1 -0
- package/dist/client/assets/redirect-editor-aVa1U6bV.js +1 -0
- package/dist/client/assets/registry-CavqWnpp.js +2 -0
- package/dist/client/assets/{registry-layout-CqPrYGT4.js → registry-layout-_YKt4pUw.js} +1 -1
- package/dist/client/assets/{reports-DHQec-OV.js → reports-CJdrG2bq.js} +1 -1
- package/dist/client/assets/{repositories-xMoRN746.js → repositories-DSl4FF_U.js} +1 -1
- package/dist/client/assets/{require-capability-BVKrozDO.js → require-capability-CsSJsgrd.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DUlUu24V.js → required-auth-layout-XPR00FzH.js} +1 -1
- package/dist/client/assets/{reset-password-oQP3PBn2.js → reset-password-C7jgcNbQ.js} +1 -1
- package/dist/client/assets/{review-settings-DCFG0W_h.js → review-settings-Md-jLxYt.js} +1 -1
- package/dist/client/assets/{roles-C6uXm2kj.js → roles-CXp8d28s.js} +1 -1
- package/dist/client/assets/{schema-CxuJmt6l.js → schema-DWDQ6ryI.js} +1 -1
- package/dist/client/assets/{scroll-area-5j5BFZ3Q.js → scroll-area-DGWiXZ1w.js} +1 -1
- package/dist/client/assets/{search-input-DgcQ8X-7.js → search-input-C6-gsMRW.js} +1 -1
- package/dist/client/assets/{secrets-dcyTcO8I.js → secrets-DhZRaOsn.js} +1 -1
- package/dist/client/assets/{sections-editor-9urpbFEv.js → sections-editor-Bj3bltq-.js} +1 -1
- package/dist/client/assets/{select-Def8PZTe.js → select-DQ8iiyqK.js} +1 -1
- package/dist/client/assets/{select-model-3Z7SO31e.js → select-model-CNLldzs6.js} +1 -1
- package/dist/client/assets/{self-tool-result-BLHxGAa3.js → self-tool-result-BklMHu3Z.js} +1 -1
- package/dist/client/assets/{seo-editor-BOwKQq4F.js → seo-editor-DZXDnR6Q.js} +1 -1
- package/dist/client/assets/settings-layout-B3CufETO.js +1 -0
- package/dist/client/assets/{settings-sidebar-CP9xIUkr.js → settings-sidebar-C4thiWjt.js} +1 -1
- package/dist/client/assets/{shell-controls-yIVW5Okd.js → shell-controls-D1BhH3wU.js} +1 -1
- package/dist/client/assets/{shell-layout-wuOytugY.js → shell-layout-DPGy1SNU.js} +1 -1
- package/dist/client/assets/{skill-preview-DPFEA385.js → skill-preview-uCDTII4c.js} +1 -1
- package/dist/client/assets/{skills-Cjf4-whB.js → skills-NhAovMUS.js} +1 -1
- package/dist/client/assets/{sso-C53IdYzm.js → sso-DvAkMGsr.js} +1 -1
- package/dist/client/assets/{store-xP8gffHC.js → store-BXnHEyof.js} +1 -1
- package/dist/client/assets/store-registry-CW_ddR1G.js +2 -0
- package/dist/client/assets/{switch-DIWUUV8n.js → switch-PGr_evzH.js} +1 -1
- package/dist/client/assets/{synced-repos-DDXrnf1y.js → synced-repos-CnYBF3Cu.js} +1 -1
- package/dist/client/assets/{table-CxzBjje0.js → table-CSG_zh9i.js} +1 -1
- package/dist/client/assets/{tabs-BJ7YG8Hu.js → tabs-2whhUI-U.js} +1 -1
- package/dist/client/assets/{task-board-DdaYZr0-.js → task-board-Cc_Je1Tl.js} +1 -1
- package/dist/client/assets/{task-route-BpWiq5Ag.js → task-route-DwIJjDqc.js} +1 -1
- package/dist/client/assets/{tasks-h8S2PrSP.js → tasks-cqDWMluZ.js} +1 -1
- package/dist/client/assets/{textarea-PxnioS23.js → textarea-Bd7RaMNl.js} +1 -1
- package/dist/client/assets/{thread-intent-SUTUyO2r.js → thread-intent-8XofJk4L.js} +1 -1
- package/dist/client/assets/{thread-route-CEnPdOqp.js → thread-route-d5I3uQSg.js} +1 -1
- package/dist/client/assets/{toggle-group-DAoNrdQa.js → toggle-group-HtX54j1S.js} +1 -1
- package/dist/client/assets/{toolbar-Bxa1Csy1.js → toolbar-aNyqdI6F.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DLE_CUWr.js → toolbar-icon-button-TVZ9wV20.js} +1 -1
- package/dist/client/assets/{track-CIkQgIxz.js → track-CJ7UTAbv.js} +1 -1
- package/dist/client/assets/{types-BBGtHgPK.js → types-WjdgXYHr.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BDgXkXb7.js → use-ai-providers-4XpSsDac.js} +1 -1
- package/dist/client/assets/{use-automations-CXF9wVEN.js → use-automations-DDYhlGUd.js} +1 -1
- package/dist/client/assets/{use-autosave-BvUE4IWU.js → use-autosave-BjCysC8V.js} +1 -1
- package/dist/client/assets/{use-connection-Y80-W5XG.js → use-connection-CwE_S8Fn.js} +1 -1
- package/dist/client/assets/{use-copy-LQdqB_lX.js → use-copy-ijs7Eg_a.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D1nsVDcZ.js → use-create-virtual-mcp-oTZRb5vp.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CG3EWfq6.js → use-debounced-autosave-D655Ka7O.js} +1 -1
- package/dist/client/assets/{use-debounced-value-bSWM1ua3.js → use-debounced-value-BbelcnFE.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CwmPrxCU.js → use-decopilot-events-DmOH7Ko7.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CQUMR2Yb.js → use-delete-connection-CLOPkvMX.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CB55y6ml.js → use-deployment-admin-Cwa1-AYh.js} +1 -1
- package/dist/client/assets/{use-destination-route-BwC8_iuF.js → use-destination-route-5cTdDwgV.js} +1 -1
- package/dist/client/assets/{use-file-configs-31SY2GsC.js → use-file-configs-C_x_aysA.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C6ZTw43Y.js → use-infinite-scroll-DqFZUY4N.js} +1 -1
- package/dist/client/assets/{use-join-requests-D8sVgxGv.js → use-join-requests-BQwmRhwt.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DADJZIVz.js → use-mcp-auth-status-DS6JPyoV.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BkrerDuR.js → use-mcp-client-TErTfSlr.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-QkZmkPIB.js → use-mcp-prompts-Cdr9RVeH.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-6oUOjcFL.js → use-mcp-tools-CUsFOk8y.js} +1 -1
- package/dist/client/assets/{use-members-D_EFJ7Hj.js → use-members-DHc3PfZ3.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BMeWdOsw.js → use-navigate-to-agent-DVwAusa4.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-FsCjqx4j.js → use-org-auth-client-iR6n2Ufe.js} +1 -1
- package/dist/client/assets/{use-org-notice-D3MLk7h3.js → use-org-notice-DXsc-iYj.js} +1 -1
- package/dist/client/assets/{use-org-sso-DfKbZVjz.js → use-org-sso-B84iMdmV.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C1MKFMSj.js → use-organization-roles-DD8iZIN6.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D5wn42FV.js → use-organization-settings-Bbmygdp8.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BcteNiek.js → use-panel-navigate-By4OUY2Q.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DLtGxGPe.js → use-registry-connections-DECk2LFw.js} +1 -1
- package/dist/client/assets/{use-secrets-DEDiD4q8.js → use-secrets-JuG9mGc4.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BHxqWO0y.js → use-section-preview-base-PbBwq_3M.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Cgt_VFHq.js → use-status-sounds-D9R6Dfxe.js} +1 -1
- package/dist/client/assets/{use-tags-u7_o2lTX.js → use-tags-jHUVem-1.js} +1 -1
- package/dist/client/assets/{use-view-mode-CaXidzUp.js → use-view-mode-C9jdp1Mr.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BHg7Ip14.js → use-virtual-mcp-B0KZ5f7x.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CwkiBLlS.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BTeTh9yc.js +1 -0
- package/dist/client/assets/{users-pr7cTbef.js → users-D-CFyrsb.js} +1 -1
- package/dist/client/assets/{variant-calendar-DhxJNH4v.js → variant-calendar-B-Z6ag4J.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-zL0xx5UT.js → view-mode-toggle-B2DIjtO4.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +546 -546
- package/dist/server/server.js +387 -387
- package/package.json +1 -1
- package/dist/client/assets/api-keys-i5KdlVJs.js +0 -1
- package/dist/client/assets/app-editor-Cr44dFnx.js +0 -1
- package/dist/client/assets/project-icon-js05OW_j.js +0 -1
- package/dist/client/assets/record-editor-Bg2tXUw8.js +0 -1
- package/dist/client/assets/redirect-editor-D3taIYDy.js +0 -1
- package/dist/client/assets/registry-DU0xKzyV.js +0 -2
- package/dist/client/assets/settings-layout-C1uEOb82.js +0 -1
- package/dist/client/assets/store-registry-cTp5b70N.js +0 -2
- package/dist/client/assets/useInfiniteQuery-D6YjHsd8.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D6u3q8aI.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ee,j as s,dt as ct,b as re,r as le,t as ce,B as F,b4 as De,dp as Ye}from"./index-CZZhDIX-.js";import{n as at}from"./LinkExternal01-DAMPJq2T.js";import{s as Ee}from"./Plus-iuQHfppX.js";import{c as Ie,d as Oe,b as $e,f as Le,g as Be,e as He,a as Fe,A as Ke}from"./alert-dialog-BNTeNqfT.js";import{B as Te}from"./badge-DVwHlInw.js";import{d as Ze,h as et,c as tt,e as st,b as it,D as lt}from"./dialog-Dbvc6M5C.js";import{I as Pe}from"./input-DRyyvExE.js";import{L as Se}from"./label-CKOVZbvu.js";import{c as we,a as Ve,b as qe,d as Me,S as Qe}from"./select-Def8PZTe.js";import{b as Je,c as dt,T as We,a as ft}from"./tabs-BJ7YG8Hu.js";import{G as Re}from"./github-icon-DzBDKxcO.js";import{u as nt,d as ut,e as ht,a as gt,b as pt,f as rt,G as ze,c as mt,g as xt}from"./gitlab-icon-Buv9Y7Of.js";import{u as jt}from"./use-debounced-value-bSWM1ua3.js";import{R as bt}from"./require-capability-BVKrozDO.js";import"./Check-CO7Wij_G.js";import"./ChevronUp-fhQ6Axth.js";import"./access-gate-IhYuji1M.js";import"./capability-load-error-B2vJZOPj.js";const vt=300,Ae="__none__";function Ue(t){const e=ee.c(3),{provider:r,size:h}=t,i=h===void 0?16:h;let l;return e[0]!==r||e[1]!==i?(l=r==="gitlab"?s.jsx(ze,{size:i,className:"text-muted-foreground"}):s.jsx(Re,{size:i,className:"text-muted-foreground"}),e[0]=r,e[1]=i,e[2]=l):l=e[2],l}function Ne(t,e){return t instanceof Error&&t.message?t.message:e}function yt(t,e){return t.authKind==="github_app"?e("settings.repositories.authKindGithubApp"):t.authKind==="oauth"?e("settings.repositories.authKindOauth"):e("settings.repositories.authKindToken")}function kt(t,e){return t==="public"?e("settings.repositories.visibilityPublic"):t==="private"?e("settings.repositories.visibilityPrivate"):t==="internal"?e("settings.repositories.visibilityInternal"):null}function Nt(t){const e=ee.c(34),{account:r,onDisconnect:h}=t,i=re(),l=r.status==="revoked"||!r.servable;let o;e[0]!==r.type?(o=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(Ue,{provider:r.type})}),e[0]=r.type,e[1]=o):o=e[1];let g;e[2]!==r.login?(g=s.jsx("span",{className:"font-medium text-sm truncate",children:r.login}),e[2]=r.login,e[3]=g):g=e[3];let d;e[4]!==l||e[5]!==i?(d=l&&s.jsx(Te,{variant:"outline",className:"shrink-0",children:i("settings.repositories.needsReconnect")}),e[4]=l,e[5]=i,e[6]=d):d=e[6];let f;e[7]!==g||e[8]!==d?(f=s.jsxs("div",{className:"flex items-center gap-2",children:[g,d]}),e[7]=g,e[8]=d,e[9]=f):f=e[9];const p=r.host;let a;e[10]!==r||e[11]!==i?(a=yt(r,i),e[10]=r,e[11]=i,e[12]=a):a=e[12];let u;e[13]!==r.host||e[14]!==a?(u=s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[p," · ",a]}),e[13]=r.host,e[14]=a,e[15]=u):u=e[15];let n;e[16]!==l||e[17]!==i?(n=l&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("settings.repositories.needsReconnectHint")}),e[16]=l,e[17]=i,e[18]=n):n=e[18];let c;e[19]!==f||e[20]!==u||e[21]!==n?(c=s.jsxs("div",{className:"min-w-0",children:[f,u,n]}),e[19]=f,e[20]=u,e[21]=n,e[22]=c):c=e[22];let m;e[23]!==o||e[24]!==c?(m=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[o,c]}),e[23]=o,e[24]=c,e[25]=m):m=e[25];let j;e[26]!==i?(j=i("settings.repositories.disconnect"),e[26]=i,e[27]=j):j=e[27];let x;e[28]!==h||e[29]!==j?(x=s.jsx(F,{variant:"outline",size:"sm",onClick:h,children:j}),e[28]=h,e[29]=j,e[30]=x):x=e[30];let b;return e[31]!==m||e[32]!==x?(b=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,x]}),e[31]=m,e[32]=x,e[33]=b):b=e[33],b}function Ct(t){const e=ee.c(45),{repository:r,onUnlink:h}=t,i=re();let l;e[0]!==r.visibility||e[1]!==i?(l=kt(r.visibility,i),e[0]=r.visibility,e[1]=i,e[2]=l):l=e[2];const o=l;let g;e[3]!==r.provider?(g=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(Ue,{provider:r.provider})}),e[3]=r.provider,e[4]=g):g=e[4];let d;e[5]!==r.path?(d=s.jsx("span",{className:"font-medium text-sm truncate",children:r.path}),e[5]=r.path,e[6]=d):d=e[6];let f;e[7]!==o?(f=o&&s.jsx(Te,{variant:"secondary",className:"shrink-0",children:o}),e[7]=o,e[8]=f):f=e[8];let p;e[9]!==r.accountId||e[10]!==i?(p=!r.accountId&&s.jsx(Te,{variant:"outline",className:"shrink-0",children:i("settings.repositories.anonymousClone")}),e[9]=r.accountId,e[10]=i,e[11]=p):p=e[11];let a;e[12]!==d||e[13]!==f||e[14]!==p?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[d,f,p]}),e[12]=d,e[13]=f,e[14]=p,e[15]=a):a=e[15];let u;e[16]!==r.defaultBranch||e[17]!==i?(u=r.defaultBranch?` · ${i("settings.repositories.defaultBranch",{branch:r.defaultBranch})}`:"",e[16]=r.defaultBranch,e[17]=i,e[18]=u):u=e[18];let n;e[19]!==r.host||e[20]!==u?(n=s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[r.host,u]}),e[19]=r.host,e[20]=u,e[21]=n):n=e[21];let c;e[22]!==a||e[23]!==n?(c=s.jsxs("div",{className:"min-w-0",children:[a,n]}),e[22]=a,e[23]=n,e[24]=c):c=e[24];let m;e[25]!==g||e[26]!==c?(m=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[g,c]}),e[25]=g,e[26]=c,e[27]=m):m=e[27];const j=r.webUrl;let x;e[28]!==i?(x=i("settings.repositories.openInProvider"),e[28]=i,e[29]=x):x=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(at,{size:14}),e[30]=b):b=e[30];let N;e[31]!==r.webUrl||e[32]!==x?(N=s.jsx(F,{variant:"ghost",size:"sm",asChild:!0,children:s.jsx("a",{href:j,target:"_blank",rel:"noreferrer","aria-label":x,children:b})}),e[31]=r.webUrl,e[32]=x,e[33]=N):N=e[33];let k;e[34]!==i?(k=i("settings.repositories.unlink"),e[34]=i,e[35]=k):k=e[35];let v;e[36]!==h||e[37]!==k?(v=s.jsx(F,{variant:"outline",size:"sm",onClick:h,children:k}),e[36]=h,e[37]=k,e[38]=v):v=e[38];let y;e[39]!==N||e[40]!==v?(y=s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[N,v]}),e[39]=N,e[40]=v,e[41]=y):y=e[41];let C;return e[42]!==m||e[43]!==y?(C=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,y]}),e[42]=m,e[43]=y,e[44]=C):C=e[44],C}function Pt(t){const e=ee.c(76),{open:r,onOpenChange:h}=t,i=re(),l=xt(),[o,g]=le.useState("gitlab.com"),[d,f]=le.useState("");let p;e[0]!==l||e[1]!==o||e[2]!==h||e[3]!==i||e[4]!==d?(p=function(){!o.trim()||!d.trim()||l.mutate({type:"gitlab",host:o.trim(),token:d.trim()},{onSuccess:I=>{ce.success(i("settings.repositories.connected",{login:I.login})),f(""),h(!1)},onError:I=>ce.error(Ne(I,i("settings.repositories.failed")))})},e[0]=l,e[1]=o,e[2]=h,e[3]=i,e[4]=d,e[5]=p):p=e[5];const a=p;let u;e[6]!==i?(u=i("settings.repositories.tokenDialogTitle"),e[6]=i,e[7]=u):u=e[7];let n;e[8]!==u?(n=s.jsx(Ze,{children:u}),e[8]=u,e[9]=n):n=e[9];let c;e[10]!==i?(c=i("settings.repositories.tokenDialogDescription"),e[10]=i,e[11]=c):c=e[11];let m;e[12]!==c?(m=s.jsx(et,{children:c}),e[12]=c,e[13]=m):m=e[13];let j;e[14]!==n||e[15]!==m?(j=s.jsxs(tt,{children:[n,m]}),e[14]=n,e[15]=m,e[16]=j):j=e[16];let x;e[17]!==i?(x=i("settings.repositories.tokenHostLabel"),e[17]=i,e[18]=x):x=e[18];let b;e[19]!==x?(b=s.jsx(Se,{htmlFor:"gitlab-host",children:x}),e[19]=x,e[20]=b):b=e[20];let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=H=>g(H.target.value),e[21]=N):N=e[21];let k;e[22]!==i?(k=i("settings.repositories.tokenHostPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]!==o||e[25]!==k?(v=s.jsx(Pe,{id:"gitlab-host",value:o,onChange:N,placeholder:k}),e[24]=o,e[25]=k,e[26]=v):v=e[26];let y;e[27]!==v||e[28]!==b?(y=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[b,v]}),e[27]=v,e[28]=b,e[29]=y):y=e[29];let C;e[30]!==i?(C=i("settings.repositories.tokenLabel"),e[30]=i,e[31]=C):C=e[31];let U;e[32]!==C?(U=s.jsx(Se,{htmlFor:"gitlab-token",children:C}),e[32]=C,e[33]=U):U=e[33];let $;e[34]===Symbol.for("react.memo_cache_sentinel")?($=H=>f(H.target.value),e[34]=$):$=e[34];let P;e[35]!==i?(P=i("settings.repositories.tokenPlaceholder"),e[35]=i,e[36]=P):P=e[36];let S;e[37]!==P||e[38]!==d?(S=s.jsx(Pe,{id:"gitlab-token",type:"password",value:d,onChange:$,placeholder:P,autoComplete:"off"}),e[37]=P,e[38]=d,e[39]=S):S=e[39];let D;e[40]!==U||e[41]!==S?(D=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[U,S]}),e[40]=U,e[41]=S,e[42]=D):D=e[42];let E;e[43]!==y||e[44]!==D?(E=s.jsxs("div",{className:"flex flex-col gap-3",children:[y,D]}),e[43]=y,e[44]=D,e[45]=E):E=e[45];let G;e[46]!==h?(G=()=>h(!1),e[46]=h,e[47]=G):G=e[47];const L=l.isPending;let _;e[48]!==i?(_=i("settings.repositories.cancel"),e[48]=i,e[49]=_):_=e[49];let A;e[50]!==l.isPending||e[51]!==G||e[52]!==_?(A=s.jsx(F,{variant:"outline",onClick:G,disabled:L,children:_}),e[50]=l.isPending,e[51]=G,e[52]=_,e[53]=A):A=e[53];let T;e[54]!==l.isPending||e[55]!==o||e[56]!==d?(T=!o.trim()||!d.trim()||l.isPending,e[54]=l.isPending,e[55]=o,e[56]=d,e[57]=T):T=e[57];let w;e[58]!==l.isPending||e[59]!==i?(w=l.isPending?i("settings.repositories.connecting"):i("settings.repositories.connect"),e[58]=l.isPending,e[59]=i,e[60]=w):w=e[60];let R;e[61]!==a||e[62]!==T||e[63]!==w?(R=s.jsx(F,{onClick:a,disabled:T,children:w}),e[61]=a,e[62]=T,e[63]=w,e[64]=R):R=e[64];let z;e[65]!==A||e[66]!==R?(z=s.jsxs(st,{children:[A,R]}),e[65]=A,e[66]=R,e[67]=z):z=e[67];let B;e[68]!==E||e[69]!==z||e[70]!==j?(B=s.jsxs(it,{className:"sm:max-w-md",children:[j,E,z]}),e[68]=E,e[69]=z,e[70]=j,e[71]=B):B=e[71];let O;return e[72]!==h||e[73]!==r||e[74]!==B?(O=s.jsx(lt,{open:r,onOpenChange:h,children:B}),e[72]=h,e[73]=r,e[74]=B,e[75]=O):O=e[75],O}function St(t){const e=ee.c(27),{accountId:r,query:h,onPick:i,linkingUrl:l}=t,o=re(),g=jt(h,vt),d=pt(r,g);if(r===null){let n;e[0]!==o?(n=o("settings.repositories.searchNoAccount"),e[0]=o,e[1]=n):n=e[1];let c;return e[2]!==n?(c=s.jsx("p",{className:"text-xs text-muted-foreground py-6 text-center",children:n}),e[2]=n,e[3]=c):c=e[3],c}if(d.isPending){let n;return e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{className:"h-40 w-full"}),e[4]=n):n=e[4],n}if(d.isError){let n;e[5]!==d.error||e[6]!==o?(n=Ne(d.error,o("settings.repositories.searchFailed")),e[5]=d.error,e[6]=o,e[7]=n):n=e[7];let c;return e[8]!==n?(c=s.jsx("p",{className:"text-xs text-destructive py-6 text-center",children:n}),e[8]=n,e[9]=c):c=e[9],c}let f;e[10]!==d.data?(f=d.data??[],e[10]=d.data,e[11]=f):f=e[11];const p=f;if(p.length===0){let n;e[12]!==o?(n=o("settings.repositories.searchEmpty"),e[12]=o,e[13]=n):n=e[13];let c;return e[14]!==n?(c=s.jsx("p",{className:"text-xs text-muted-foreground py-6 text-center",children:n}),e[14]=n,e[15]=c):c=e[15],c}let a;if(e[16]!==l||e[17]!==i||e[18]!==p||e[19]!==o){let n;e[21]!==l||e[22]!==i||e[23]!==o?(n=c=>s.jsxs("button",{type:"button",onClick:()=>i(c),disabled:l!==null,className:"w-full flex items-start gap-3 px-3 py-2 text-left border-b border-border/60 last:border-b-0 hover:bg-muted/60 disabled:opacity-60",children:[s.jsx(Ue,{provider:c.ref.provider}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"text-sm truncate block",children:c.ref.path}),c.description&&s.jsx("span",{className:"text-xs text-muted-foreground truncate block",children:c.description})]}),l===c.webUrl&&s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o("settings.repositories.linking")})]},`${c.ref.host}/${c.ref.path}`),e[21]=l,e[22]=i,e[23]=o,e[24]=n):n=e[24],a=p.map(n),e[16]=l,e[17]=i,e[18]=p,e[19]=o,e[20]=a}else a=e[20];let u;return e[25]!==a?(u=s.jsx("div",{className:"max-h-64 overflow-y-auto rounded-lg border border-border/60",children:a}),e[25]=a,e[26]=u):u=e[26],u}function Dt(t){const e=ee.c(135),{open:r,onOpenChange:h,accounts:i}=t,l=re(),o=gt(),[g,d]=le.useState(i[0]?.id??null),[f,p]=le.useState(Ae),[a,u]=le.useState(""),[n,c]=le.useState(""),[m,j]=le.useState(null);let x;e[0]!==o||e[1]!==h||e[2]!==l?(x=function(Ge){j(Ge.url),o.mutate(Ge,{onSuccess:_e=>{ce.success(l("settings.repositories.linked",{path:_e.path})),c(""),h(!1)},onError:_e=>ce.error(Ne(_e,l("settings.repositories.failed"))),onSettled:()=>j(null)})},e[0]=o,e[1]=h,e[2]=l,e[3]=x):x=e[3];const b=x;let N;e[4]!==l?(N=l("settings.repositories.addDialogTitle"),e[4]=l,e[5]=N):N=e[5];let k;e[6]!==N?(k=s.jsx(Ze,{children:N}),e[6]=N,e[7]=k):k=e[7];let v;e[8]!==l?(v=l("settings.repositories.addDialogDescription"),e[8]=l,e[9]=v):v=e[9];let y;e[10]!==v?(y=s.jsx(et,{children:v}),e[10]=v,e[11]=y):y=e[11];let C;e[12]!==k||e[13]!==y?(C=s.jsxs(tt,{children:[k,y]}),e[12]=k,e[13]=y,e[14]=C):C=e[14];let U;e[15]!==l?(U=l("settings.repositories.tabSearch"),e[15]=l,e[16]=U):U=e[16];let $;e[17]!==U?($=s.jsx(Je,{value:"search",children:U}),e[17]=U,e[18]=$):$=e[18];let P;e[19]!==l?(P=l("settings.repositories.tabUrl"),e[19]=l,e[20]=P):P=e[20];let S;e[21]!==P?(S=s.jsx(Je,{value:"url",children:P}),e[21]=P,e[22]=S):S=e[22];let D;e[23]!==S||e[24]!==$?(D=s.jsxs(dt,{children:[$,S]}),e[23]=S,e[24]=$,e[25]=D):D=e[25];const E=g??void 0;let G;e[26]===Symbol.for("react.memo_cache_sentinel")?(G=oe=>d(oe),e[26]=G):G=e[26];let L;e[27]!==l?(L=l("settings.repositories.accountLabel"),e[27]=l,e[28]=L):L=e[28];let _;e[29]!==l?(_=l("settings.repositories.accountPlaceholder"),e[29]=l,e[30]=_):_=e[30];let A;e[31]!==_?(A=s.jsx(Ve,{placeholder:_}),e[31]=_,e[32]=A):A=e[32];let T;e[33]!==L||e[34]!==A?(T=s.jsx(qe,{"aria-label":L,children:A}),e[33]=L,e[34]=A,e[35]=T):T=e[35];let w;e[36]!==i?(w=i.map(At),e[36]=i,e[37]=w):w=e[37];let R;e[38]!==w?(R=s.jsx(Me,{children:w}),e[38]=w,e[39]=R):R=e[39];let z;e[40]!==E||e[41]!==T||e[42]!==R?(z=s.jsxs(Qe,{value:E,onValueChange:G,children:[T,R]}),e[40]=E,e[41]=T,e[42]=R,e[43]=z):z=e[43];let B;e[44]===Symbol.for("react.memo_cache_sentinel")?(B=oe=>u(oe.target.value),e[44]=B):B=e[44];let O;e[45]!==l?(O=l("settings.repositories.searchPlaceholder"),e[45]=l,e[46]=O):O=e[46];let H;e[47]!==a||e[48]!==O?(H=s.jsx(Pe,{value:a,onChange:B,placeholder:O}),e[47]=a,e[48]=O,e[49]=H):H=e[49];let I;e[50]!==g||e[51]!==b?(I=oe=>b({url:oe.webUrl,...g?{accountId:g}:{}}),e[50]=g,e[51]=b,e[52]=I):I=e[52];let K;e[53]!==g||e[54]!==m||e[55]!==a||e[56]!==I?(K=s.jsx(St,{accountId:g,query:a,linkingUrl:m,onPick:I}),e[53]=g,e[54]=m,e[55]=a,e[56]=I,e[57]=K):K=e[57];let V;e[58]!==z||e[59]!==H||e[60]!==K?(V=s.jsxs(We,{value:"search",className:"flex flex-col gap-3 pt-3",children:[z,H,K]}),e[58]=z,e[59]=H,e[60]=K,e[61]=V):V=e[61];let q;e[62]!==l?(q=l("settings.repositories.urlLabel"),e[62]=l,e[63]=q):q=e[63];let M;e[64]!==q?(M=s.jsx(Se,{htmlFor:"repository-url",children:q}),e[64]=q,e[65]=M):M=e[65];let te;e[66]===Symbol.for("react.memo_cache_sentinel")?(te=oe=>c(oe.target.value),e[66]=te):te=e[66];let Q;e[67]!==l?(Q=l("settings.repositories.urlPlaceholder"),e[67]=l,e[68]=Q):Q=e[68];let J;e[69]!==Q||e[70]!==n?(J=s.jsx(Pe,{id:"repository-url",value:n,onChange:te,placeholder:Q}),e[69]=Q,e[70]=n,e[71]=J):J=e[71];let W;e[72]!==M||e[73]!==J?(W=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[M,J]}),e[72]=M,e[73]=J,e[74]=W):W=e[74];let X;e[75]!==l?(X=l("settings.repositories.accountLabel"),e[75]=l,e[76]=X):X=e[76];let Y;e[77]!==X?(Y=s.jsx(Se,{htmlFor:"repository-url-account",children:X}),e[77]=X,e[78]=Y):Y=e[78];let se;e[79]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx(qe,{id:"repository-url-account",children:s.jsx(Ve,{})}),e[79]=se):se=e[79];let ie;e[80]!==l?(ie=l("settings.repositories.accountNone"),e[80]=l,e[81]=ie):ie=e[81];let Z;e[82]!==ie?(Z=s.jsx(we,{value:Ae,children:ie}),e[82]=ie,e[83]=Z):Z=e[83];let ne;e[84]!==i?(ne=i.map(_t),e[84]=i,e[85]=ne):ne=e[85];let ae;e[86]!==Z||e[87]!==ne?(ae=s.jsxs(Me,{children:[Z,ne]}),e[86]=Z,e[87]=ne,e[88]=ae):ae=e[88];let de;e[89]!==ae||e[90]!==f?(de=s.jsxs(Qe,{value:f,onValueChange:p,children:[se,ae]}),e[89]=ae,e[90]=f,e[91]=de):de=e[91];let fe;e[92]!==Y||e[93]!==de?(fe=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[Y,de]}),e[92]=Y,e[93]=de,e[94]=fe):fe=e[94];let ue;e[95]!==h?(ue=()=>h(!1),e[95]=h,e[96]=ue):ue=e[96];const ot=o.isPending;let he;e[97]!==l?(he=l("settings.repositories.cancel"),e[97]=l,e[98]=he):he=e[98];let ge;e[99]!==o.isPending||e[100]!==ue||e[101]!==he?(ge=s.jsx(F,{variant:"outline",onClick:ue,disabled:ot,children:he}),e[99]=o.isPending,e[100]=ue,e[101]=he,e[102]=ge):ge=e[102];let pe;e[103]!==o.isPending||e[104]!==n?(pe=!n.trim()||o.isPending,e[103]=o.isPending,e[104]=n,e[105]=pe):pe=e[105];let me;e[106]!==b||e[107]!==n||e[108]!==f?(me=()=>b({url:n.trim(),...f===Ae?{}:{accountId:f}}),e[106]=b,e[107]=n,e[108]=f,e[109]=me):me=e[109];let xe;e[110]!==o.isPending||e[111]!==l?(xe=o.isPending?l("settings.repositories.linking"):l("settings.repositories.link"),e[110]=o.isPending,e[111]=l,e[112]=xe):xe=e[112];let je;e[113]!==pe||e[114]!==me||e[115]!==xe?(je=s.jsx(F,{disabled:pe,onClick:me,children:xe}),e[113]=pe,e[114]=me,e[115]=xe,e[116]=je):je=e[116];let be;e[117]!==ge||e[118]!==je?(be=s.jsxs(st,{children:[ge,je]}),e[117]=ge,e[118]=je,e[119]=be):be=e[119];let ve;e[120]!==W||e[121]!==fe||e[122]!==be?(ve=s.jsxs(We,{value:"url",className:"flex flex-col gap-3 pt-3",children:[W,fe,be]}),e[120]=W,e[121]=fe,e[122]=be,e[123]=ve):ve=e[123];let ye;e[124]!==D||e[125]!==V||e[126]!==ve?(ye=s.jsxs(ft,{defaultValue:"search",children:[D,V,ve]}),e[124]=D,e[125]=V,e[126]=ve,e[127]=ye):ye=e[127];let ke;e[128]!==ye||e[129]!==C?(ke=s.jsxs(it,{className:"sm:max-w-lg",children:[C,ye]}),e[128]=ye,e[129]=C,e[130]=ke):ke=e[130];let Ce;return e[131]!==h||e[132]!==r||e[133]!==ke?(Ce=s.jsx(lt,{open:r,onOpenChange:h,children:ke}),e[131]=h,e[132]=r,e[133]=ke,e[134]=Ce):Ce=e[134],Ce}function _t(t){return s.jsxs(we,{value:t.id,children:[t.login," · ",t.host]},t.id)}function At(t){return s.jsxs(we,{value:t.id,children:[t.login," · ",t.host]},t.id)}function Xe(t){const e=ee.c(24),{onTokenDialog:r,hasGithubAccount:h}=t,i=re(),l=rt(),o=l.data?.github,g=l.data?.gitlab,d=o?.configured===!0,f=(g?.oauthHosts.length??0)>0;if(l.isPending){let j;return e[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(De,{className:"h-9 w-40"}),e[0]=j):j=e[0],j}let p;e[1]!==o||e[2]!==d||e[3]!==i?(p=d&&o?.connectPath&&s.jsx(F,{size:"sm",asChild:!0,children:s.jsxs("a",{href:o.connectPath,children:[s.jsx(Re,{size:14}),i("settings.repositories.connectGithub")]})}),e[1]=o,e[2]=d,e[3]=i,e[4]=p):p=e[4];let a;e[5]!==o||e[6]!==d||e[7]!==h||e[8]!==i?(a=d&&h&&o?.installPath&&s.jsx(F,{size:"sm",variant:"outline",asChild:!0,children:s.jsx("a",{href:o.installPath,children:i("settings.repositories.installGithub")})}),e[5]=o,e[6]=d,e[7]=h,e[8]=i,e[9]=a):a=e[9];let u;e[10]!==g||e[11]!==f||e[12]!==i?(u=f&&g?.connectPath&&s.jsx(F,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs("a",{href:g.connectPath,children:[s.jsx(ze,{size:14}),i("settings.repositories.connectGitlab")]})}),e[10]=g,e[11]=f,e[12]=i,e[13]=u):u=e[13];let n;e[14]!==i?(n=i("settings.repositories.connectGitlabToken"),e[14]=i,e[15]=n):n=e[15];let c;e[16]!==r||e[17]!==n?(c=s.jsx(F,{size:"sm",variant:"outline",onClick:r,children:n}),e[16]=r,e[17]=n,e[18]=c):c=e[18];let m;return e[19]!==p||e[20]!==a||e[21]!==u||e[22]!==c?(m=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p,a,u,c]}),e[19]=p,e[20]=a,e[21]=u,e[22]=c,e[23]=m):m=e[23],m}function Tt(t){const e=ee.c(21),{onTokenDialog:r,onDisconnect:h}=t,i=re(),l=rt(),o=nt(),g=l.data?.github.configured===!0,d=(l.data?.gitlab.oauthHosts.length??0)>0,f=g||d;let p;e[0]!==o.data?(p=o.data??[],e[0]=o.data,e[1]=p):p=e[1];const a=p;let u;e[2]!==i?(u=i("settings.repositories.accountsTitle"),e[2]=i,e[3]=u):u=e[3];let n;e[4]!==i?(n=i("settings.repositories.accountsDescription"),e[4]=i,e[5]=n):n=e[5];let c;e[6]!==r||e[7]!==a?(c=a.length>0?s.jsx(Xe,{onTokenDialog:r,hasGithubAccount:a.some(wt)}):null,e[6]=r,e[7]=a,e[8]=c):c=e[8];let m;e[9]!==o.isPending||e[10]!==f||e[11]!==h||e[12]!==r||e[13]!==a||e[14]!==i?(m=o.isPending?s.jsx(De,{className:"h-24 w-full"}):!f&&a.length===0?s.jsxs("div",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsx("p",{className:"font-medium text-sm",children:i("settings.repositories.noProvidersTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground max-w-sm",children:i("settings.repositories.noProvidersDescription")}),s.jsxs(F,{size:"sm",variant:"outline",onClick:r,children:[s.jsx(ze,{size:14}),i("settings.repositories.connectGitlabToken")]})]}):a.length===0?s.jsxs("div",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(Re,{size:20,className:"text-muted-foreground"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:i("settings.repositories.accountsEmptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:i("settings.repositories.accountsEmptyDescription")})]}),s.jsx(Xe,{onTokenDialog:r,hasGithubAccount:!1})]}):s.jsx("section",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:a.map(x=>s.jsx(Nt,{account:x,onDisconnect:()=>h(x)},x.id))}),e[9]=o.isPending,e[10]=f,e[11]=h,e[12]=r,e[13]=a,e[14]=i,e[15]=m):m=e[15];let j;return e[16]!==u||e[17]!==n||e[18]!==c||e[19]!==m?(j=s.jsx(Ye,{title:u,description:n,actions:c,children:m}),e[16]=u,e[17]=n,e[18]=c,e[19]=m,e[20]=j):j=e[20],j}function wt(t){return t.type==="github"}function Rt(t){const e=ee.c(21),{onAdd:r,onUnlink:h}=t,i=re(),l=mt();let o;e[0]!==l.data?(o=l.data??[],e[0]=l.data,e[1]=o):o=e[1];const g=o;let d;e[2]!==i?(d=i("settings.repositories.reposTitle"),e[2]=i,e[3]=d):d=e[3];let f;e[4]!==i?(f=i("settings.repositories.reposDescription"),e[4]=i,e[5]=f):f=e[5];let p;e[6]!==r||e[7]!==g.length||e[8]!==i?(p=g.length>0?s.jsxs(F,{size:"sm",onClick:r,children:[s.jsx(Ee,{size:14}),i("settings.repositories.addRepository")]}):null,e[6]=r,e[7]=g.length,e[8]=i,e[9]=p):p=e[9];let a;e[10]!==r||e[11]!==h||e[12]!==l.isPending||e[13]!==g||e[14]!==i?(a=l.isPending?s.jsx(De,{className:"h-24 w-full"}):g.length===0?s.jsxs("div",{"data-testid":"repositories-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:i("settings.repositories.reposEmptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:i("settings.repositories.reposEmptyDescription")})]}),s.jsxs(F,{size:"sm",onClick:r,children:[s.jsx(Ee,{size:14}),i("settings.repositories.addRepository")]})]}):s.jsx("section",{"data-testid":"repositories-list",className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:g.map(n=>s.jsx(Ct,{repository:n,onUnlink:()=>h(n)},n.id))}),e[10]=r,e[11]=h,e[12]=l.isPending,e[13]=g,e[14]=i,e[15]=a):a=e[15];let u;return e[16]!==d||e[17]!==f||e[18]!==p||e[19]!==a?(u=s.jsx(Ye,{title:d,description:f,actions:p,children:a}),e[16]=d,e[17]=f,e[18]=p,e[19]=a,e[20]=u):u=e[20],u}function zt(){const t=ee.c(87),e=re(),r=nt(),h=ut(),i=ht(),[l,o]=le.useState(!1),[g,d]=le.useState(!1),[f,p]=le.useState(null),[a,u]=le.useState(null);let n;t[0]!==h||t[1]!==f||t[2]!==e?(n=function(){f&&h.mutate(f.id,{onSuccess:()=>ce.success(e("settings.repositories.disconnected")),onError:ne=>ce.error(Ne(ne,e("settings.repositories.failed"))),onSettled:()=>p(null)})},t[0]=h,t[1]=f,t[2]=e,t[3]=n):n=t[3];const c=n;let m;t[4]!==i||t[5]!==a||t[6]!==e?(m=function(){a&&i.mutate(a.id,{onSuccess:()=>ce.success(e("settings.repositories.unlinked")),onError:ne=>ce.error(Ne(ne,e("settings.repositories.failed"))),onSettled:()=>u(null)})},t[4]=i,t[5]=a,t[6]=e,t[7]=m):m=t[7];const j=m;let x;t[8]!==e?(x=e("settings.repositories.pageDescription"),t[8]=e,t[9]=x):x=t[9];let b;t[10]!==x?(b=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[10]=x,t[11]=b):b=t[11];let N;t[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Tt,{onTokenDialog:()=>o(!0),onDisconnect:p}),t[12]=N):N=t[12];let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Rt,{onAdd:()=>d(!0),onUnlink:u}),t[13]=k):k=t[13];let v;t[14]!==l?(v=s.jsx(Pt,{open:l,onOpenChange:o}),t[14]=l,t[15]=v):v=t[15];let y;t[16]!==r||t[17]!==g?(y=g&&s.jsx(Dt,{open:!0,onOpenChange:d,accounts:r.data??[]}),t[16]=r,t[17]=g,t[18]=y):y=t[18];const C=f!==null;let U;t[19]===Symbol.for("react.memo_cache_sentinel")?(U=Z=>{Z||p(null)},t[19]=U):U=t[19];const $=f?.login??"";let P;t[20]!==e||t[21]!==$?(P=e("settings.repositories.disconnectTitle",{login:$}),t[20]=e,t[21]=$,t[22]=P):P=t[22];let S;t[23]!==P?(S=s.jsx(Ie,{children:P}),t[23]=P,t[24]=S):S=t[24];let D;t[25]!==e?(D=e("settings.repositories.disconnectDescription"),t[25]=e,t[26]=D):D=t[26];let E;t[27]!==D?(E=s.jsx(Oe,{children:D}),t[27]=D,t[28]=E):E=t[28];let G;t[29]!==S||t[30]!==E?(G=s.jsxs($e,{children:[S,E]}),t[29]=S,t[30]=E,t[31]=G):G=t[31];let L;t[32]!==e?(L=e("settings.repositories.cancel"),t[32]=e,t[33]=L):L=t[33];let _;t[34]!==L?(_=s.jsx(Le,{children:L}),t[34]=L,t[35]=_):_=t[35];let A;t[36]!==e?(A=e("settings.repositories.disconnect"),t[36]=e,t[37]=A):A=t[37];let T;t[38]!==c||t[39]!==A?(T=s.jsx(Be,{onClick:c,children:A}),t[38]=c,t[39]=A,t[40]=T):T=t[40];let w;t[41]!==_||t[42]!==T?(w=s.jsxs(He,{children:[_,T]}),t[41]=_,t[42]=T,t[43]=w):w=t[43];let R;t[44]!==G||t[45]!==w?(R=s.jsxs(Fe,{children:[G,w]}),t[44]=G,t[45]=w,t[46]=R):R=t[46];let z;t[47]!==R||t[48]!==C?(z=s.jsx(Ke,{open:C,onOpenChange:U,children:R}),t[47]=R,t[48]=C,t[49]=z):z=t[49];const B=a!==null;let O;t[50]===Symbol.for("react.memo_cache_sentinel")?(O=Z=>{Z||u(null)},t[50]=O):O=t[50];const H=a?.path??"";let I;t[51]!==e||t[52]!==H?(I=e("settings.repositories.unlinkTitle",{path:H}),t[51]=e,t[52]=H,t[53]=I):I=t[53];let K;t[54]!==I?(K=s.jsx(Ie,{children:I}),t[54]=I,t[55]=K):K=t[55];let V;t[56]!==e?(V=e("settings.repositories.unlinkDescription"),t[56]=e,t[57]=V):V=t[57];let q;t[58]!==V?(q=s.jsx(Oe,{children:V}),t[58]=V,t[59]=q):q=t[59];let M;t[60]!==K||t[61]!==q?(M=s.jsxs($e,{children:[K,q]}),t[60]=K,t[61]=q,t[62]=M):M=t[62];let te;t[63]!==e?(te=e("settings.repositories.cancel"),t[63]=e,t[64]=te):te=t[64];let Q;t[65]!==te?(Q=s.jsx(Le,{children:te}),t[65]=te,t[66]=Q):Q=t[66];let J;t[67]!==e?(J=e("settings.repositories.unlink"),t[67]=e,t[68]=J):J=t[68];let W;t[69]!==j||t[70]!==J?(W=s.jsx(Be,{onClick:j,children:J}),t[69]=j,t[70]=J,t[71]=W):W=t[71];let X;t[72]!==Q||t[73]!==W?(X=s.jsxs(He,{children:[Q,W]}),t[72]=Q,t[73]=W,t[74]=X):X=t[74];let Y;t[75]!==M||t[76]!==X?(Y=s.jsxs(Fe,{children:[M,X]}),t[75]=M,t[76]=X,t[77]=Y):Y=t[77];let se;t[78]!==B||t[79]!==Y?(se=s.jsx(Ke,{open:B,onOpenChange:O,children:Y}),t[78]=B,t[79]=Y,t[80]=se):se=t[80];let ie;return t[81]!==z||t[82]!==b||t[83]!==se||t[84]!==v||t[85]!==y?(ie=s.jsxs(s.Fragment,{children:[b,N,k,v,y,z,se]}),t[81]=z,t[82]=b,t[83]=se,t[84]=v,t[85]=y,t[86]=ie):ie=t[86],ie}function Ut(){const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ct,{group:"storage",children:s.jsx(zt,{})}),t[0]=e):e=t[0],e}function Zt(){const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(bt,{capability:"file-configs:manage",area:"files",children:s.jsx(Ut,{})}),t[0]=e):e=t[0],e}export{Zt as default};
|
|
1
|
+
import{c as ee,j as s,dt as ct,b as re,r as le,t as ce,B as F,b4 as De,dp as Ye}from"./index-DIek05Ni.js";import{n as at}from"./LinkExternal01-CYGJDolS.js";import{s as Ee}from"./Plus-f1J7CslD.js";import{c as Ie,d as Oe,b as $e,f as Le,g as Be,e as He,a as Fe,A as Ke}from"./alert-dialog-CADzi4i2.js";import{B as Te}from"./badge-CzoDeQX5.js";import{d as Ze,h as et,c as tt,e as st,b as it,D as lt}from"./dialog-ClXo-ILY.js";import{I as Pe}from"./input-B6-nFuh0.js";import{L as Se}from"./label-Bzd8c-RA.js";import{c as we,a as Ve,b as qe,d as Me,S as Qe}from"./select-DQ8iiyqK.js";import{b as Je,c as dt,T as We,a as ft}from"./tabs-2whhUI-U.js";import{G as Re}from"./github-icon-BamvWtlu.js";import{u as nt,d as ut,e as ht,a as gt,b as pt,f as rt,G as ze,c as mt,g as xt}from"./gitlab-icon-BvCV8hCq.js";import{u as jt}from"./use-debounced-value-BbelcnFE.js";import{R as bt}from"./require-capability-CsSJsgrd.js";import"./Check-RwOXYzpY.js";import"./ChevronUp-CKGVkzNf.js";import"./access-gate-CgpWlbs5.js";import"./capability-load-error-GWNWVbL6.js";const vt=300,Ae="__none__";function Ue(t){const e=ee.c(3),{provider:r,size:h}=t,i=h===void 0?16:h;let l;return e[0]!==r||e[1]!==i?(l=r==="gitlab"?s.jsx(ze,{size:i,className:"text-muted-foreground"}):s.jsx(Re,{size:i,className:"text-muted-foreground"}),e[0]=r,e[1]=i,e[2]=l):l=e[2],l}function Ne(t,e){return t instanceof Error&&t.message?t.message:e}function yt(t,e){return t.authKind==="github_app"?e("settings.repositories.authKindGithubApp"):t.authKind==="oauth"?e("settings.repositories.authKindOauth"):e("settings.repositories.authKindToken")}function kt(t,e){return t==="public"?e("settings.repositories.visibilityPublic"):t==="private"?e("settings.repositories.visibilityPrivate"):t==="internal"?e("settings.repositories.visibilityInternal"):null}function Nt(t){const e=ee.c(34),{account:r,onDisconnect:h}=t,i=re(),l=r.status==="revoked"||!r.servable;let o;e[0]!==r.type?(o=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(Ue,{provider:r.type})}),e[0]=r.type,e[1]=o):o=e[1];let g;e[2]!==r.login?(g=s.jsx("span",{className:"font-medium text-sm truncate",children:r.login}),e[2]=r.login,e[3]=g):g=e[3];let d;e[4]!==l||e[5]!==i?(d=l&&s.jsx(Te,{variant:"outline",className:"shrink-0",children:i("settings.repositories.needsReconnect")}),e[4]=l,e[5]=i,e[6]=d):d=e[6];let f;e[7]!==g||e[8]!==d?(f=s.jsxs("div",{className:"flex items-center gap-2",children:[g,d]}),e[7]=g,e[8]=d,e[9]=f):f=e[9];const p=r.host;let a;e[10]!==r||e[11]!==i?(a=yt(r,i),e[10]=r,e[11]=i,e[12]=a):a=e[12];let u;e[13]!==r.host||e[14]!==a?(u=s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[p," · ",a]}),e[13]=r.host,e[14]=a,e[15]=u):u=e[15];let n;e[16]!==l||e[17]!==i?(n=l&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("settings.repositories.needsReconnectHint")}),e[16]=l,e[17]=i,e[18]=n):n=e[18];let c;e[19]!==f||e[20]!==u||e[21]!==n?(c=s.jsxs("div",{className:"min-w-0",children:[f,u,n]}),e[19]=f,e[20]=u,e[21]=n,e[22]=c):c=e[22];let m;e[23]!==o||e[24]!==c?(m=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[o,c]}),e[23]=o,e[24]=c,e[25]=m):m=e[25];let j;e[26]!==i?(j=i("settings.repositories.disconnect"),e[26]=i,e[27]=j):j=e[27];let x;e[28]!==h||e[29]!==j?(x=s.jsx(F,{variant:"outline",size:"sm",onClick:h,children:j}),e[28]=h,e[29]=j,e[30]=x):x=e[30];let b;return e[31]!==m||e[32]!==x?(b=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,x]}),e[31]=m,e[32]=x,e[33]=b):b=e[33],b}function Ct(t){const e=ee.c(45),{repository:r,onUnlink:h}=t,i=re();let l;e[0]!==r.visibility||e[1]!==i?(l=kt(r.visibility,i),e[0]=r.visibility,e[1]=i,e[2]=l):l=e[2];const o=l;let g;e[3]!==r.provider?(g=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(Ue,{provider:r.provider})}),e[3]=r.provider,e[4]=g):g=e[4];let d;e[5]!==r.path?(d=s.jsx("span",{className:"font-medium text-sm truncate",children:r.path}),e[5]=r.path,e[6]=d):d=e[6];let f;e[7]!==o?(f=o&&s.jsx(Te,{variant:"secondary",className:"shrink-0",children:o}),e[7]=o,e[8]=f):f=e[8];let p;e[9]!==r.accountId||e[10]!==i?(p=!r.accountId&&s.jsx(Te,{variant:"outline",className:"shrink-0",children:i("settings.repositories.anonymousClone")}),e[9]=r.accountId,e[10]=i,e[11]=p):p=e[11];let a;e[12]!==d||e[13]!==f||e[14]!==p?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[d,f,p]}),e[12]=d,e[13]=f,e[14]=p,e[15]=a):a=e[15];let u;e[16]!==r.defaultBranch||e[17]!==i?(u=r.defaultBranch?` · ${i("settings.repositories.defaultBranch",{branch:r.defaultBranch})}`:"",e[16]=r.defaultBranch,e[17]=i,e[18]=u):u=e[18];let n;e[19]!==r.host||e[20]!==u?(n=s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[r.host,u]}),e[19]=r.host,e[20]=u,e[21]=n):n=e[21];let c;e[22]!==a||e[23]!==n?(c=s.jsxs("div",{className:"min-w-0",children:[a,n]}),e[22]=a,e[23]=n,e[24]=c):c=e[24];let m;e[25]!==g||e[26]!==c?(m=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[g,c]}),e[25]=g,e[26]=c,e[27]=m):m=e[27];const j=r.webUrl;let x;e[28]!==i?(x=i("settings.repositories.openInProvider"),e[28]=i,e[29]=x):x=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(at,{size:14}),e[30]=b):b=e[30];let N;e[31]!==r.webUrl||e[32]!==x?(N=s.jsx(F,{variant:"ghost",size:"sm",asChild:!0,children:s.jsx("a",{href:j,target:"_blank",rel:"noreferrer","aria-label":x,children:b})}),e[31]=r.webUrl,e[32]=x,e[33]=N):N=e[33];let k;e[34]!==i?(k=i("settings.repositories.unlink"),e[34]=i,e[35]=k):k=e[35];let v;e[36]!==h||e[37]!==k?(v=s.jsx(F,{variant:"outline",size:"sm",onClick:h,children:k}),e[36]=h,e[37]=k,e[38]=v):v=e[38];let y;e[39]!==N||e[40]!==v?(y=s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[N,v]}),e[39]=N,e[40]=v,e[41]=y):y=e[41];let C;return e[42]!==m||e[43]!==y?(C=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,y]}),e[42]=m,e[43]=y,e[44]=C):C=e[44],C}function Pt(t){const e=ee.c(76),{open:r,onOpenChange:h}=t,i=re(),l=xt(),[o,g]=le.useState("gitlab.com"),[d,f]=le.useState("");let p;e[0]!==l||e[1]!==o||e[2]!==h||e[3]!==i||e[4]!==d?(p=function(){!o.trim()||!d.trim()||l.mutate({type:"gitlab",host:o.trim(),token:d.trim()},{onSuccess:I=>{ce.success(i("settings.repositories.connected",{login:I.login})),f(""),h(!1)},onError:I=>ce.error(Ne(I,i("settings.repositories.failed")))})},e[0]=l,e[1]=o,e[2]=h,e[3]=i,e[4]=d,e[5]=p):p=e[5];const a=p;let u;e[6]!==i?(u=i("settings.repositories.tokenDialogTitle"),e[6]=i,e[7]=u):u=e[7];let n;e[8]!==u?(n=s.jsx(Ze,{children:u}),e[8]=u,e[9]=n):n=e[9];let c;e[10]!==i?(c=i("settings.repositories.tokenDialogDescription"),e[10]=i,e[11]=c):c=e[11];let m;e[12]!==c?(m=s.jsx(et,{children:c}),e[12]=c,e[13]=m):m=e[13];let j;e[14]!==n||e[15]!==m?(j=s.jsxs(tt,{children:[n,m]}),e[14]=n,e[15]=m,e[16]=j):j=e[16];let x;e[17]!==i?(x=i("settings.repositories.tokenHostLabel"),e[17]=i,e[18]=x):x=e[18];let b;e[19]!==x?(b=s.jsx(Se,{htmlFor:"gitlab-host",children:x}),e[19]=x,e[20]=b):b=e[20];let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=H=>g(H.target.value),e[21]=N):N=e[21];let k;e[22]!==i?(k=i("settings.repositories.tokenHostPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]!==o||e[25]!==k?(v=s.jsx(Pe,{id:"gitlab-host",value:o,onChange:N,placeholder:k}),e[24]=o,e[25]=k,e[26]=v):v=e[26];let y;e[27]!==v||e[28]!==b?(y=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[b,v]}),e[27]=v,e[28]=b,e[29]=y):y=e[29];let C;e[30]!==i?(C=i("settings.repositories.tokenLabel"),e[30]=i,e[31]=C):C=e[31];let U;e[32]!==C?(U=s.jsx(Se,{htmlFor:"gitlab-token",children:C}),e[32]=C,e[33]=U):U=e[33];let $;e[34]===Symbol.for("react.memo_cache_sentinel")?($=H=>f(H.target.value),e[34]=$):$=e[34];let P;e[35]!==i?(P=i("settings.repositories.tokenPlaceholder"),e[35]=i,e[36]=P):P=e[36];let S;e[37]!==P||e[38]!==d?(S=s.jsx(Pe,{id:"gitlab-token",type:"password",value:d,onChange:$,placeholder:P,autoComplete:"off"}),e[37]=P,e[38]=d,e[39]=S):S=e[39];let D;e[40]!==U||e[41]!==S?(D=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[U,S]}),e[40]=U,e[41]=S,e[42]=D):D=e[42];let E;e[43]!==y||e[44]!==D?(E=s.jsxs("div",{className:"flex flex-col gap-3",children:[y,D]}),e[43]=y,e[44]=D,e[45]=E):E=e[45];let G;e[46]!==h?(G=()=>h(!1),e[46]=h,e[47]=G):G=e[47];const L=l.isPending;let _;e[48]!==i?(_=i("settings.repositories.cancel"),e[48]=i,e[49]=_):_=e[49];let A;e[50]!==l.isPending||e[51]!==G||e[52]!==_?(A=s.jsx(F,{variant:"outline",onClick:G,disabled:L,children:_}),e[50]=l.isPending,e[51]=G,e[52]=_,e[53]=A):A=e[53];let T;e[54]!==l.isPending||e[55]!==o||e[56]!==d?(T=!o.trim()||!d.trim()||l.isPending,e[54]=l.isPending,e[55]=o,e[56]=d,e[57]=T):T=e[57];let w;e[58]!==l.isPending||e[59]!==i?(w=l.isPending?i("settings.repositories.connecting"):i("settings.repositories.connect"),e[58]=l.isPending,e[59]=i,e[60]=w):w=e[60];let R;e[61]!==a||e[62]!==T||e[63]!==w?(R=s.jsx(F,{onClick:a,disabled:T,children:w}),e[61]=a,e[62]=T,e[63]=w,e[64]=R):R=e[64];let z;e[65]!==A||e[66]!==R?(z=s.jsxs(st,{children:[A,R]}),e[65]=A,e[66]=R,e[67]=z):z=e[67];let B;e[68]!==E||e[69]!==z||e[70]!==j?(B=s.jsxs(it,{className:"sm:max-w-md",children:[j,E,z]}),e[68]=E,e[69]=z,e[70]=j,e[71]=B):B=e[71];let O;return e[72]!==h||e[73]!==r||e[74]!==B?(O=s.jsx(lt,{open:r,onOpenChange:h,children:B}),e[72]=h,e[73]=r,e[74]=B,e[75]=O):O=e[75],O}function St(t){const e=ee.c(27),{accountId:r,query:h,onPick:i,linkingUrl:l}=t,o=re(),g=jt(h,vt),d=pt(r,g);if(r===null){let n;e[0]!==o?(n=o("settings.repositories.searchNoAccount"),e[0]=o,e[1]=n):n=e[1];let c;return e[2]!==n?(c=s.jsx("p",{className:"text-xs text-muted-foreground py-6 text-center",children:n}),e[2]=n,e[3]=c):c=e[3],c}if(d.isPending){let n;return e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{className:"h-40 w-full"}),e[4]=n):n=e[4],n}if(d.isError){let n;e[5]!==d.error||e[6]!==o?(n=Ne(d.error,o("settings.repositories.searchFailed")),e[5]=d.error,e[6]=o,e[7]=n):n=e[7];let c;return e[8]!==n?(c=s.jsx("p",{className:"text-xs text-destructive py-6 text-center",children:n}),e[8]=n,e[9]=c):c=e[9],c}let f;e[10]!==d.data?(f=d.data??[],e[10]=d.data,e[11]=f):f=e[11];const p=f;if(p.length===0){let n;e[12]!==o?(n=o("settings.repositories.searchEmpty"),e[12]=o,e[13]=n):n=e[13];let c;return e[14]!==n?(c=s.jsx("p",{className:"text-xs text-muted-foreground py-6 text-center",children:n}),e[14]=n,e[15]=c):c=e[15],c}let a;if(e[16]!==l||e[17]!==i||e[18]!==p||e[19]!==o){let n;e[21]!==l||e[22]!==i||e[23]!==o?(n=c=>s.jsxs("button",{type:"button",onClick:()=>i(c),disabled:l!==null,className:"w-full flex items-start gap-3 px-3 py-2 text-left border-b border-border/60 last:border-b-0 hover:bg-muted/60 disabled:opacity-60",children:[s.jsx(Ue,{provider:c.ref.provider}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"text-sm truncate block",children:c.ref.path}),c.description&&s.jsx("span",{className:"text-xs text-muted-foreground truncate block",children:c.description})]}),l===c.webUrl&&s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o("settings.repositories.linking")})]},`${c.ref.host}/${c.ref.path}`),e[21]=l,e[22]=i,e[23]=o,e[24]=n):n=e[24],a=p.map(n),e[16]=l,e[17]=i,e[18]=p,e[19]=o,e[20]=a}else a=e[20];let u;return e[25]!==a?(u=s.jsx("div",{className:"max-h-64 overflow-y-auto rounded-lg border border-border/60",children:a}),e[25]=a,e[26]=u):u=e[26],u}function Dt(t){const e=ee.c(135),{open:r,onOpenChange:h,accounts:i}=t,l=re(),o=gt(),[g,d]=le.useState(i[0]?.id??null),[f,p]=le.useState(Ae),[a,u]=le.useState(""),[n,c]=le.useState(""),[m,j]=le.useState(null);let x;e[0]!==o||e[1]!==h||e[2]!==l?(x=function(Ge){j(Ge.url),o.mutate(Ge,{onSuccess:_e=>{ce.success(l("settings.repositories.linked",{path:_e.path})),c(""),h(!1)},onError:_e=>ce.error(Ne(_e,l("settings.repositories.failed"))),onSettled:()=>j(null)})},e[0]=o,e[1]=h,e[2]=l,e[3]=x):x=e[3];const b=x;let N;e[4]!==l?(N=l("settings.repositories.addDialogTitle"),e[4]=l,e[5]=N):N=e[5];let k;e[6]!==N?(k=s.jsx(Ze,{children:N}),e[6]=N,e[7]=k):k=e[7];let v;e[8]!==l?(v=l("settings.repositories.addDialogDescription"),e[8]=l,e[9]=v):v=e[9];let y;e[10]!==v?(y=s.jsx(et,{children:v}),e[10]=v,e[11]=y):y=e[11];let C;e[12]!==k||e[13]!==y?(C=s.jsxs(tt,{children:[k,y]}),e[12]=k,e[13]=y,e[14]=C):C=e[14];let U;e[15]!==l?(U=l("settings.repositories.tabSearch"),e[15]=l,e[16]=U):U=e[16];let $;e[17]!==U?($=s.jsx(Je,{value:"search",children:U}),e[17]=U,e[18]=$):$=e[18];let P;e[19]!==l?(P=l("settings.repositories.tabUrl"),e[19]=l,e[20]=P):P=e[20];let S;e[21]!==P?(S=s.jsx(Je,{value:"url",children:P}),e[21]=P,e[22]=S):S=e[22];let D;e[23]!==S||e[24]!==$?(D=s.jsxs(dt,{children:[$,S]}),e[23]=S,e[24]=$,e[25]=D):D=e[25];const E=g??void 0;let G;e[26]===Symbol.for("react.memo_cache_sentinel")?(G=oe=>d(oe),e[26]=G):G=e[26];let L;e[27]!==l?(L=l("settings.repositories.accountLabel"),e[27]=l,e[28]=L):L=e[28];let _;e[29]!==l?(_=l("settings.repositories.accountPlaceholder"),e[29]=l,e[30]=_):_=e[30];let A;e[31]!==_?(A=s.jsx(Ve,{placeholder:_}),e[31]=_,e[32]=A):A=e[32];let T;e[33]!==L||e[34]!==A?(T=s.jsx(qe,{"aria-label":L,children:A}),e[33]=L,e[34]=A,e[35]=T):T=e[35];let w;e[36]!==i?(w=i.map(At),e[36]=i,e[37]=w):w=e[37];let R;e[38]!==w?(R=s.jsx(Me,{children:w}),e[38]=w,e[39]=R):R=e[39];let z;e[40]!==E||e[41]!==T||e[42]!==R?(z=s.jsxs(Qe,{value:E,onValueChange:G,children:[T,R]}),e[40]=E,e[41]=T,e[42]=R,e[43]=z):z=e[43];let B;e[44]===Symbol.for("react.memo_cache_sentinel")?(B=oe=>u(oe.target.value),e[44]=B):B=e[44];let O;e[45]!==l?(O=l("settings.repositories.searchPlaceholder"),e[45]=l,e[46]=O):O=e[46];let H;e[47]!==a||e[48]!==O?(H=s.jsx(Pe,{value:a,onChange:B,placeholder:O}),e[47]=a,e[48]=O,e[49]=H):H=e[49];let I;e[50]!==g||e[51]!==b?(I=oe=>b({url:oe.webUrl,...g?{accountId:g}:{}}),e[50]=g,e[51]=b,e[52]=I):I=e[52];let K;e[53]!==g||e[54]!==m||e[55]!==a||e[56]!==I?(K=s.jsx(St,{accountId:g,query:a,linkingUrl:m,onPick:I}),e[53]=g,e[54]=m,e[55]=a,e[56]=I,e[57]=K):K=e[57];let V;e[58]!==z||e[59]!==H||e[60]!==K?(V=s.jsxs(We,{value:"search",className:"flex flex-col gap-3 pt-3",children:[z,H,K]}),e[58]=z,e[59]=H,e[60]=K,e[61]=V):V=e[61];let q;e[62]!==l?(q=l("settings.repositories.urlLabel"),e[62]=l,e[63]=q):q=e[63];let M;e[64]!==q?(M=s.jsx(Se,{htmlFor:"repository-url",children:q}),e[64]=q,e[65]=M):M=e[65];let te;e[66]===Symbol.for("react.memo_cache_sentinel")?(te=oe=>c(oe.target.value),e[66]=te):te=e[66];let Q;e[67]!==l?(Q=l("settings.repositories.urlPlaceholder"),e[67]=l,e[68]=Q):Q=e[68];let J;e[69]!==Q||e[70]!==n?(J=s.jsx(Pe,{id:"repository-url",value:n,onChange:te,placeholder:Q}),e[69]=Q,e[70]=n,e[71]=J):J=e[71];let W;e[72]!==M||e[73]!==J?(W=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[M,J]}),e[72]=M,e[73]=J,e[74]=W):W=e[74];let X;e[75]!==l?(X=l("settings.repositories.accountLabel"),e[75]=l,e[76]=X):X=e[76];let Y;e[77]!==X?(Y=s.jsx(Se,{htmlFor:"repository-url-account",children:X}),e[77]=X,e[78]=Y):Y=e[78];let se;e[79]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx(qe,{id:"repository-url-account",children:s.jsx(Ve,{})}),e[79]=se):se=e[79];let ie;e[80]!==l?(ie=l("settings.repositories.accountNone"),e[80]=l,e[81]=ie):ie=e[81];let Z;e[82]!==ie?(Z=s.jsx(we,{value:Ae,children:ie}),e[82]=ie,e[83]=Z):Z=e[83];let ne;e[84]!==i?(ne=i.map(_t),e[84]=i,e[85]=ne):ne=e[85];let ae;e[86]!==Z||e[87]!==ne?(ae=s.jsxs(Me,{children:[Z,ne]}),e[86]=Z,e[87]=ne,e[88]=ae):ae=e[88];let de;e[89]!==ae||e[90]!==f?(de=s.jsxs(Qe,{value:f,onValueChange:p,children:[se,ae]}),e[89]=ae,e[90]=f,e[91]=de):de=e[91];let fe;e[92]!==Y||e[93]!==de?(fe=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[Y,de]}),e[92]=Y,e[93]=de,e[94]=fe):fe=e[94];let ue;e[95]!==h?(ue=()=>h(!1),e[95]=h,e[96]=ue):ue=e[96];const ot=o.isPending;let he;e[97]!==l?(he=l("settings.repositories.cancel"),e[97]=l,e[98]=he):he=e[98];let ge;e[99]!==o.isPending||e[100]!==ue||e[101]!==he?(ge=s.jsx(F,{variant:"outline",onClick:ue,disabled:ot,children:he}),e[99]=o.isPending,e[100]=ue,e[101]=he,e[102]=ge):ge=e[102];let pe;e[103]!==o.isPending||e[104]!==n?(pe=!n.trim()||o.isPending,e[103]=o.isPending,e[104]=n,e[105]=pe):pe=e[105];let me;e[106]!==b||e[107]!==n||e[108]!==f?(me=()=>b({url:n.trim(),...f===Ae?{}:{accountId:f}}),e[106]=b,e[107]=n,e[108]=f,e[109]=me):me=e[109];let xe;e[110]!==o.isPending||e[111]!==l?(xe=o.isPending?l("settings.repositories.linking"):l("settings.repositories.link"),e[110]=o.isPending,e[111]=l,e[112]=xe):xe=e[112];let je;e[113]!==pe||e[114]!==me||e[115]!==xe?(je=s.jsx(F,{disabled:pe,onClick:me,children:xe}),e[113]=pe,e[114]=me,e[115]=xe,e[116]=je):je=e[116];let be;e[117]!==ge||e[118]!==je?(be=s.jsxs(st,{children:[ge,je]}),e[117]=ge,e[118]=je,e[119]=be):be=e[119];let ve;e[120]!==W||e[121]!==fe||e[122]!==be?(ve=s.jsxs(We,{value:"url",className:"flex flex-col gap-3 pt-3",children:[W,fe,be]}),e[120]=W,e[121]=fe,e[122]=be,e[123]=ve):ve=e[123];let ye;e[124]!==D||e[125]!==V||e[126]!==ve?(ye=s.jsxs(ft,{defaultValue:"search",children:[D,V,ve]}),e[124]=D,e[125]=V,e[126]=ve,e[127]=ye):ye=e[127];let ke;e[128]!==ye||e[129]!==C?(ke=s.jsxs(it,{className:"sm:max-w-lg",children:[C,ye]}),e[128]=ye,e[129]=C,e[130]=ke):ke=e[130];let Ce;return e[131]!==h||e[132]!==r||e[133]!==ke?(Ce=s.jsx(lt,{open:r,onOpenChange:h,children:ke}),e[131]=h,e[132]=r,e[133]=ke,e[134]=Ce):Ce=e[134],Ce}function _t(t){return s.jsxs(we,{value:t.id,children:[t.login," · ",t.host]},t.id)}function At(t){return s.jsxs(we,{value:t.id,children:[t.login," · ",t.host]},t.id)}function Xe(t){const e=ee.c(24),{onTokenDialog:r,hasGithubAccount:h}=t,i=re(),l=rt(),o=l.data?.github,g=l.data?.gitlab,d=o?.configured===!0,f=(g?.oauthHosts.length??0)>0;if(l.isPending){let j;return e[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(De,{className:"h-9 w-40"}),e[0]=j):j=e[0],j}let p;e[1]!==o||e[2]!==d||e[3]!==i?(p=d&&o?.connectPath&&s.jsx(F,{size:"sm",asChild:!0,children:s.jsxs("a",{href:o.connectPath,children:[s.jsx(Re,{size:14}),i("settings.repositories.connectGithub")]})}),e[1]=o,e[2]=d,e[3]=i,e[4]=p):p=e[4];let a;e[5]!==o||e[6]!==d||e[7]!==h||e[8]!==i?(a=d&&h&&o?.installPath&&s.jsx(F,{size:"sm",variant:"outline",asChild:!0,children:s.jsx("a",{href:o.installPath,children:i("settings.repositories.installGithub")})}),e[5]=o,e[6]=d,e[7]=h,e[8]=i,e[9]=a):a=e[9];let u;e[10]!==g||e[11]!==f||e[12]!==i?(u=f&&g?.connectPath&&s.jsx(F,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs("a",{href:g.connectPath,children:[s.jsx(ze,{size:14}),i("settings.repositories.connectGitlab")]})}),e[10]=g,e[11]=f,e[12]=i,e[13]=u):u=e[13];let n;e[14]!==i?(n=i("settings.repositories.connectGitlabToken"),e[14]=i,e[15]=n):n=e[15];let c;e[16]!==r||e[17]!==n?(c=s.jsx(F,{size:"sm",variant:"outline",onClick:r,children:n}),e[16]=r,e[17]=n,e[18]=c):c=e[18];let m;return e[19]!==p||e[20]!==a||e[21]!==u||e[22]!==c?(m=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p,a,u,c]}),e[19]=p,e[20]=a,e[21]=u,e[22]=c,e[23]=m):m=e[23],m}function Tt(t){const e=ee.c(21),{onTokenDialog:r,onDisconnect:h}=t,i=re(),l=rt(),o=nt(),g=l.data?.github.configured===!0,d=(l.data?.gitlab.oauthHosts.length??0)>0,f=g||d;let p;e[0]!==o.data?(p=o.data??[],e[0]=o.data,e[1]=p):p=e[1];const a=p;let u;e[2]!==i?(u=i("settings.repositories.accountsTitle"),e[2]=i,e[3]=u):u=e[3];let n;e[4]!==i?(n=i("settings.repositories.accountsDescription"),e[4]=i,e[5]=n):n=e[5];let c;e[6]!==r||e[7]!==a?(c=a.length>0?s.jsx(Xe,{onTokenDialog:r,hasGithubAccount:a.some(wt)}):null,e[6]=r,e[7]=a,e[8]=c):c=e[8];let m;e[9]!==o.isPending||e[10]!==f||e[11]!==h||e[12]!==r||e[13]!==a||e[14]!==i?(m=o.isPending?s.jsx(De,{className:"h-24 w-full"}):!f&&a.length===0?s.jsxs("div",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsx("p",{className:"font-medium text-sm",children:i("settings.repositories.noProvidersTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground max-w-sm",children:i("settings.repositories.noProvidersDescription")}),s.jsxs(F,{size:"sm",variant:"outline",onClick:r,children:[s.jsx(ze,{size:14}),i("settings.repositories.connectGitlabToken")]})]}):a.length===0?s.jsxs("div",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(Re,{size:20,className:"text-muted-foreground"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:i("settings.repositories.accountsEmptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:i("settings.repositories.accountsEmptyDescription")})]}),s.jsx(Xe,{onTokenDialog:r,hasGithubAccount:!1})]}):s.jsx("section",{"data-testid":"git-accounts-list",className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:a.map(x=>s.jsx(Nt,{account:x,onDisconnect:()=>h(x)},x.id))}),e[9]=o.isPending,e[10]=f,e[11]=h,e[12]=r,e[13]=a,e[14]=i,e[15]=m):m=e[15];let j;return e[16]!==u||e[17]!==n||e[18]!==c||e[19]!==m?(j=s.jsx(Ye,{title:u,description:n,actions:c,children:m}),e[16]=u,e[17]=n,e[18]=c,e[19]=m,e[20]=j):j=e[20],j}function wt(t){return t.type==="github"}function Rt(t){const e=ee.c(21),{onAdd:r,onUnlink:h}=t,i=re(),l=mt();let o;e[0]!==l.data?(o=l.data??[],e[0]=l.data,e[1]=o):o=e[1];const g=o;let d;e[2]!==i?(d=i("settings.repositories.reposTitle"),e[2]=i,e[3]=d):d=e[3];let f;e[4]!==i?(f=i("settings.repositories.reposDescription"),e[4]=i,e[5]=f):f=e[5];let p;e[6]!==r||e[7]!==g.length||e[8]!==i?(p=g.length>0?s.jsxs(F,{size:"sm",onClick:r,children:[s.jsx(Ee,{size:14}),i("settings.repositories.addRepository")]}):null,e[6]=r,e[7]=g.length,e[8]=i,e[9]=p):p=e[9];let a;e[10]!==r||e[11]!==h||e[12]!==l.isPending||e[13]!==g||e[14]!==i?(a=l.isPending?s.jsx(De,{className:"h-24 w-full"}):g.length===0?s.jsxs("div",{"data-testid":"repositories-list",className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:i("settings.repositories.reposEmptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:i("settings.repositories.reposEmptyDescription")})]}),s.jsxs(F,{size:"sm",onClick:r,children:[s.jsx(Ee,{size:14}),i("settings.repositories.addRepository")]})]}):s.jsx("section",{"data-testid":"repositories-list",className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:g.map(n=>s.jsx(Ct,{repository:n,onUnlink:()=>h(n)},n.id))}),e[10]=r,e[11]=h,e[12]=l.isPending,e[13]=g,e[14]=i,e[15]=a):a=e[15];let u;return e[16]!==d||e[17]!==f||e[18]!==p||e[19]!==a?(u=s.jsx(Ye,{title:d,description:f,actions:p,children:a}),e[16]=d,e[17]=f,e[18]=p,e[19]=a,e[20]=u):u=e[20],u}function zt(){const t=ee.c(87),e=re(),r=nt(),h=ut(),i=ht(),[l,o]=le.useState(!1),[g,d]=le.useState(!1),[f,p]=le.useState(null),[a,u]=le.useState(null);let n;t[0]!==h||t[1]!==f||t[2]!==e?(n=function(){f&&h.mutate(f.id,{onSuccess:()=>ce.success(e("settings.repositories.disconnected")),onError:ne=>ce.error(Ne(ne,e("settings.repositories.failed"))),onSettled:()=>p(null)})},t[0]=h,t[1]=f,t[2]=e,t[3]=n):n=t[3];const c=n;let m;t[4]!==i||t[5]!==a||t[6]!==e?(m=function(){a&&i.mutate(a.id,{onSuccess:()=>ce.success(e("settings.repositories.unlinked")),onError:ne=>ce.error(Ne(ne,e("settings.repositories.failed"))),onSettled:()=>u(null)})},t[4]=i,t[5]=a,t[6]=e,t[7]=m):m=t[7];const j=m;let x;t[8]!==e?(x=e("settings.repositories.pageDescription"),t[8]=e,t[9]=x):x=t[9];let b;t[10]!==x?(b=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[10]=x,t[11]=b):b=t[11];let N;t[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Tt,{onTokenDialog:()=>o(!0),onDisconnect:p}),t[12]=N):N=t[12];let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Rt,{onAdd:()=>d(!0),onUnlink:u}),t[13]=k):k=t[13];let v;t[14]!==l?(v=s.jsx(Pt,{open:l,onOpenChange:o}),t[14]=l,t[15]=v):v=t[15];let y;t[16]!==r||t[17]!==g?(y=g&&s.jsx(Dt,{open:!0,onOpenChange:d,accounts:r.data??[]}),t[16]=r,t[17]=g,t[18]=y):y=t[18];const C=f!==null;let U;t[19]===Symbol.for("react.memo_cache_sentinel")?(U=Z=>{Z||p(null)},t[19]=U):U=t[19];const $=f?.login??"";let P;t[20]!==e||t[21]!==$?(P=e("settings.repositories.disconnectTitle",{login:$}),t[20]=e,t[21]=$,t[22]=P):P=t[22];let S;t[23]!==P?(S=s.jsx(Ie,{children:P}),t[23]=P,t[24]=S):S=t[24];let D;t[25]!==e?(D=e("settings.repositories.disconnectDescription"),t[25]=e,t[26]=D):D=t[26];let E;t[27]!==D?(E=s.jsx(Oe,{children:D}),t[27]=D,t[28]=E):E=t[28];let G;t[29]!==S||t[30]!==E?(G=s.jsxs($e,{children:[S,E]}),t[29]=S,t[30]=E,t[31]=G):G=t[31];let L;t[32]!==e?(L=e("settings.repositories.cancel"),t[32]=e,t[33]=L):L=t[33];let _;t[34]!==L?(_=s.jsx(Le,{children:L}),t[34]=L,t[35]=_):_=t[35];let A;t[36]!==e?(A=e("settings.repositories.disconnect"),t[36]=e,t[37]=A):A=t[37];let T;t[38]!==c||t[39]!==A?(T=s.jsx(Be,{onClick:c,children:A}),t[38]=c,t[39]=A,t[40]=T):T=t[40];let w;t[41]!==_||t[42]!==T?(w=s.jsxs(He,{children:[_,T]}),t[41]=_,t[42]=T,t[43]=w):w=t[43];let R;t[44]!==G||t[45]!==w?(R=s.jsxs(Fe,{children:[G,w]}),t[44]=G,t[45]=w,t[46]=R):R=t[46];let z;t[47]!==R||t[48]!==C?(z=s.jsx(Ke,{open:C,onOpenChange:U,children:R}),t[47]=R,t[48]=C,t[49]=z):z=t[49];const B=a!==null;let O;t[50]===Symbol.for("react.memo_cache_sentinel")?(O=Z=>{Z||u(null)},t[50]=O):O=t[50];const H=a?.path??"";let I;t[51]!==e||t[52]!==H?(I=e("settings.repositories.unlinkTitle",{path:H}),t[51]=e,t[52]=H,t[53]=I):I=t[53];let K;t[54]!==I?(K=s.jsx(Ie,{children:I}),t[54]=I,t[55]=K):K=t[55];let V;t[56]!==e?(V=e("settings.repositories.unlinkDescription"),t[56]=e,t[57]=V):V=t[57];let q;t[58]!==V?(q=s.jsx(Oe,{children:V}),t[58]=V,t[59]=q):q=t[59];let M;t[60]!==K||t[61]!==q?(M=s.jsxs($e,{children:[K,q]}),t[60]=K,t[61]=q,t[62]=M):M=t[62];let te;t[63]!==e?(te=e("settings.repositories.cancel"),t[63]=e,t[64]=te):te=t[64];let Q;t[65]!==te?(Q=s.jsx(Le,{children:te}),t[65]=te,t[66]=Q):Q=t[66];let J;t[67]!==e?(J=e("settings.repositories.unlink"),t[67]=e,t[68]=J):J=t[68];let W;t[69]!==j||t[70]!==J?(W=s.jsx(Be,{onClick:j,children:J}),t[69]=j,t[70]=J,t[71]=W):W=t[71];let X;t[72]!==Q||t[73]!==W?(X=s.jsxs(He,{children:[Q,W]}),t[72]=Q,t[73]=W,t[74]=X):X=t[74];let Y;t[75]!==M||t[76]!==X?(Y=s.jsxs(Fe,{children:[M,X]}),t[75]=M,t[76]=X,t[77]=Y):Y=t[77];let se;t[78]!==B||t[79]!==Y?(se=s.jsx(Ke,{open:B,onOpenChange:O,children:Y}),t[78]=B,t[79]=Y,t[80]=se):se=t[80];let ie;return t[81]!==z||t[82]!==b||t[83]!==se||t[84]!==v||t[85]!==y?(ie=s.jsxs(s.Fragment,{children:[b,N,k,v,y,z,se]}),t[81]=z,t[82]=b,t[83]=se,t[84]=v,t[85]=y,t[86]=ie):ie=t[86],ie}function Ut(){const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ct,{group:"storage",children:s.jsx(zt,{})}),t[0]=e):e=t[0],e}function Zt(){const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(bt,{capability:"file-configs:manage",area:"files",children:s.jsx(Ut,{})}),t[0]=e):e=t[0],e}export{Zt as default};
|
package/dist/client/assets/{require-capability-BVKrozDO.js → require-capability-CsSJsgrd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,b8 as l,j as m}from"./index-
|
|
1
|
+
import{c as p,b8 as l,j as m}from"./index-DIek05Ni.js";import{A as u}from"./access-gate-CgpWlbs5.js";function f(c){const t=p.c(6),{capability:n,area:r,children:a}=c,{granted:i,loading:s,error:o}=l(n);let e;return t[0]!==r||t[1]!==a||t[2]!==o||t[3]!==i||t[4]!==s?(e=m.jsx(u,{granted:i,loading:s,error:o,area:r,children:a}),t[0]=r,t[1]=a,t[2]=o,t[3]=i,t[4]=s,t[5]=e):e=t[5],e}export{f as R};
|
package/dist/client/assets/{required-auth-layout-DUlUu24V.js → required-auth-layout-XPR00FzH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,b as u,a as f,j as s,h as d,N as h}from"./index-
|
|
1
|
+
import{c as a,b as u,a as f,j as s,h as d,N as h}from"./index-DIek05Ni.js";function x(){const i=a.c(1),e=window.location.pathname+window.location.search;let n;if(i[0]===Symbol.for("react.memo_cache_sentinel")){const c=e==="/login"||e.startsWith("/login?")?{}:{next:e};n=s.jsx(h,{to:"/login",search:c,replace:!0}),i[0]=n}else n=i[0];return n}function j(i){const e=a.c(7),{children:n}=i,o=u(),{data:c,isPending:m}=f.useSession();if(c){let t;return e[0]!==n?(t=s.jsx(s.Fragment,{children:n}),e[0]=n,e[1]=t):t=e[1],t}if(m){let t;e[2]!==o?(t=o("common.loading"),e[2]=o,e[3]=t):t=e[3];let l;return e[4]!==t?(l=s.jsx("div",{className:"flex min-h-dvh w-full items-center justify-center",children:s.jsx(d,{className:"size-5 text-muted-foreground",label:t})}),e[4]=t,e[5]=l):l=e[5],l}let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(x,{}),e[6]=r):r=e[6],r}export{j as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-
|
|
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-DIek05Ni.js";import{I as D}from"./input-B6-nFuh0.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,b as j,j as n,dq as w,dp as h,t as S,dr as K}from"./index-
|
|
1
|
+
import{c as x,b as j,j as n,dq as w,dp as h,t as S,dr as K}from"./index-DIek05Ni.js";import{S as C}from"./switch-PGr_evzH.js";import{e as R,a as A,i as $,d as z,f as D,c as M,b as k}from"./UserSquare-EeCR50Jd.js";import{i as E}from"./GitBranch01-wBN2Zyoy.js";import{i as F,u as O,j as P}from"./use-organization-settings-Bbmygdp8.js";function H(){const e=x.c(13),t=j();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=t("settings.review.description"),e[2]=t,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(g,{flag:"reviewer_enabled",icon:n.jsx(R,{size:16}),titleKey:"settings.review.reviewerTitle",descriptionKey:"settings.review.reviewerDescription"}),e[4]=o):o=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(g,{flag:"cheap_reviewer_model",icon:n.jsx(A,{size:16}),titleKey:"settings.review.cheapReviewerModelTitle",descriptionKey:"settings.review.cheapReviewerModelDescription"}),e[5]=r):r=e[5];let d,l;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(g,{flag:"auto_merge",icon:n.jsx($,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),l=n.jsx(L,{}),e[6]=d,e[7]=l):(d=e[6],l=e[7]);let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(g,{flag:"delivery_lanes_enabled",icon:n.jsx(z,{size:16}),titleKey:"settings.review.deliveryLanesTitle",descriptionKey:"settings.review.deliveryLanesDescription"}),e[8]=f):f=e[8];let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs(w,{children:[o,r,d,l,f,n.jsx(g,{flag:"auto_assign_report_tasks_to_super_agent",icon:n.jsx(D,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[9]=a):a=e[9];let c;return e[10]!==s||e[11]!==i?(c=n.jsx(h,{title:s,description:i,children:a}),e[10]=s,e[11]=i,e[12]=c):c=e[12],c}function J(){const e=x.c(8),t=j();let s;e[0]!==t?(s=t("settings.agentTools.title"),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=t("settings.agentTools.description"),e[2]=t,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(w,{children:n.jsx(g,{flag:"coding_agent_org_mcps",icon:n.jsx(M,{size:16}),titleKey:"settings.agentTools.orgMcpsTitle",descriptionKey:"settings.agentTools.orgMcpsDescription"})}),e[4]=o):o=e[4];let r;return e[5]!==s||e[6]!==i?(r=n.jsx(h,{title:s,description:i,children:o}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function N(){const e=x.c(5),t=j();let s;e[0]!==t?(s=t("sidebar.agentsSection.codeAgents"),e[0]=t,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(w,{children:n.jsx(g,{flag:"coding_agents_claude_code",icon:n.jsx(k,{size:16}),titleKey:"settings.agentTools.codingAgentsClaudeCodeTitle",descriptionKey:"settings.agentTools.codingAgentsClaudeCodeDescription"})}),e[2]=i):i=e[2];let o;return e[3]!==s?(o=n.jsx(h,{title:s,children:i}),e[3]=s,e[4]=o):o=e[4],o}function L(){const e=x.c(3),t=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(E,{size:16}),e[0]=s):s=e[0];let i;return e[1]!==t?(i=n.jsx(g,{flag:"auto_resolve_conflicts",icon:s,titleKey:"settings.review.autoResolveConflictsTitle",descriptionKey:"settings.review.autoResolveConflictsDescription",enabled:t}),e[1]=t,e[2]=i):i=e[2],i}function g(e){const t=x.c(23),{flag:s,icon:i,titleKey:o,descriptionKey:r,enabled:d}=e,l=j(),f=O(s),a=d??f,c=P();let p;t[0]!==l||t[1]!==o?(p=l(o),t[0]=l,t[1]=o,t[2]=p):p=t[2];let m;t[3]!==r||t[4]!==l?(m=l(r),t[3]=r,t[4]=l,t[5]=m):m=t[5];const T=c.isPending;let _;t[6]!==l||t[7]!==o?(_=l(o),t[6]=l,t[7]=o,t[8]=_):_=t[8];let u;t[9]!==s||t[10]!==c||t[11]!==l?(u=b=>c.mutate(s,b,{onError:()=>S.error(l("settings.review.updateError"))}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12];let v;t[13]!==a||t[14]!==c.isPending||t[15]!==_||t[16]!==u?(v=n.jsx(C,{checked:a,disabled:T,"aria-label":_,onCheckedChange:u}),t[13]=a,t[14]=c.isPending,t[15]=_,t[16]=u,t[17]=v):v=t[17];let y;return t[18]!==i||t[19]!==p||t[20]!==m||t[21]!==v?(y=n.jsx(K,{icon:i,title:p,description:m,action:v}),t[18]=i,t[19]=p,t[20]=m,t[21]=v,t[22]=y):y=t[22],y}export{J as A,N as C,H as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ie,r as Q,G as Ge,K as de,m as Ve,j as s,l as Z,h as Oe,B as ae,c as X,ae as qe,af as we,ag as re,ak as Ze,ah as Je,n as ot,aq as Ct,ar as bt,e as nt,t as Ce,o as Ye,P as Ne,z as it,dp as We,dq as Xe,dr as et,C as jt,a3 as Me,a4 as De,a1 as Pe,a2 as ve,ap as tt,bZ as Mt,u as rt,dt as at,fh as Dt,E as Pt,d as vt}from"./index-CZZhDIX-.js";import{u as Lt}from"./use-organization-roles-C1MKFMSj.js";import{u as Ke}from"./use-org-auth-client-FsCjqx4j.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as be}from"./badge-DVwHlInw.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as Tt,g as _t,e as ht}from"./alert-dialog-BNTeNqfT.js";import{c as wt,D as Gt,b as Ut,a as kt}from"./dropdown-menu-D4P0HJXh.js";import{i as Bt}from"./DotsVertical-BwgQQHgd.js";import{s as Be}from"./Plus-iuQHfppX.js";import{s as Vt}from"./Trash01-hTjL8EuS.js";import{C as Yt}from"./collection-table-wrapper-CL7cq0ac.js";import{E as st}from"./empty-state-DLYL1z5C.js";import{S as ze}from"./search-input-DgcQ8X-7.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Fe}from"./integration-icon-iQQ4uEFp.js";import{u as Kt}from"./use-infinite-scroll-C6ZTw43Y.js";import{C as Qe}from"./checkbox-Dup0-e8q.js";import{i as zt}from"./ArrowLeft-BH7Gh79U.js";import{u as Ft}from"./useSuspenseInfiniteQuery-D6u3q8aI.js";import{u as Qt}from"./use-mcp-client-BkrerDuR.js";import{S as $t}from"./constants-BRGHAWVM.js";import{C as Ht}from"./collection-search-TlKZmpmc.js";import{p as qt}from"./connection-BGRlXWJy.js";import{a as xt}from"./use-members-D_EFJ7Hj.js";import{g as pt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-Y80-W5XG.js";import{u as Jt,g as Wt}from"./use-ai-providers-BDgXkXb7.js";import{A as Rt}from"./avatar-DqScveeb.js";import{S as je}from"./switch-DIWUUV8n.js";import{t as Xt}from"./ChevronUp-fhQ6Axth.js";import{i as es}from"./ChevronRight-CvkDeRys.js";import{A as ts}from"./access-gate-IhYuji1M.js";import"./Check-CO7Wij_G.js";import"./table-CxzBjje0.js";import"./ArrowUp-DvPWBDm2.js";import"./SearchMd-D-RA9v7D.js";import"./Tool02-BIpvQa4r.js";import"./agent-icon-BYPFWuLT.js";import"./AlertCircle-S07uSGUV.js";import"./Tool01-CwmEt4SM.js";import"./XCircle-BMEXXBpM.js";import"./TrendUp01-BAD83f_Y.js";import"./ZoomOut-T29bK6p-.js";import"./Users03-DZSnEG1B.js";import"./CheckCircle-DMNXDKJx.js";import"./ChevronSelectorVertical-DQ7kEVnV.js";import"./UserSquare-BdoiSxAh.js";import"./Copy01-CKSS0EBG.js";import"./CreditCard01-9BVP9JSP.js";import"./Download01-dK8p5EXl.js";import"./Settings02-OLs927oO.js";import"./Eye-ni0CzCCc.js";import"./Share07-i6nyeBY0.js";import"./GitBranch01-Dw9pX0qw.js";import"./Globe01-DIEWGOdB.js";import"./XClose-Cy11W9uC.js";import"./HardDrive-BoGojPck.js";import"./Image01-BQ751Vs7.js";import"./Key01-CUOUB1_8.js";import"./Link01-CilyfKEd.js";import"./LinkExternal01-DAMPJq2T.js";import"./Monitor01-LxLRjbmv.js";import"./Sun-DXxx_pQ2.js";import"./Package-CzcPt2_z.js";import"./Palette-Bu0kFe6V.js";import"./Play-BNQYseaq.js";import"./SearchLg-CEt6QXfV.js";import"./Shield01-BHm6PFQF.js";import"./Stars01-DYf5EZg3.js";import"./Upload01-DxSmPWTB.js";import"./User01-BGEHR2yU.js";import"./Users01-C0UfM8Qv.js";import"./Zap-BJayzjVo.js";import"./auth-CziOpIXF.js";import"./capability-load-error-B2vJZOPj.js";const $e="basic-usage",He=[{id:$e,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...He.find(t=>t.id===$e)?.tools??[]];const ss=["agents:manage","connections:manage"];new Set(He.filter(t=>ss.includes(t.id)).flatMap(t=>t.tools));function ls(){const t=new Map;for(const e of He){if(e.id===$e)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function os(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ns(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}function is(t){const e=X.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:c,onSelect:u,onToggle:f}=t,d=r?"bg-accent/50":"hover:bg-muted/50";let T;e[0]!==d?(T=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=T):T=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Fe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let g;e[5]!==l.title?(g=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=g):g=e[6];let _;e[7]!==u||e[8]!==a||e[9]!==g?(_=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:u,children:[a,g]}),e[7]=u,e[8]=a,e[9]=g,e[10]=_):_=e[10];let m;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==f||e[15]!==c?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(Qe,{checked:n,onCheckedChange:f,onClick:rs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=f,e[15]=c,e[16]=m):m=e[16];let h;return e[17]!==T||e[18]!==_||e[19]!==m?(h=s.jsxs("div",{className:T,children:[_,m]}),e[17]=T,e[18]=_,e[19]=m,e[20]=h):h=e[20],h}function rs(t){return t.stopPropagation()}function as(t){const e=X.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,c=`tool-${l}-${r.name}`,u=n?"text-foreground":"text-muted-foreground";let f;e[0]!==u?(f=Z("text-sm font-medium",u),e[0]=u,e[1]=f):f=e[1];let d;e[2]!==f||e[3]!==r.name?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:f,children:r.name})}),e[2]=f,e[3]=r.name,e[4]=d):d=e[4];let T;e[5]!==r.description?(T=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=T):T=e[6];let a;e[7]!==d||e[8]!==T?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,T]}),e[7]=d,e[8]=T,e[9]=a):a=e[9];const g=`tool-${l}-${r.name}`;let _;e[10]!==n||e[11]!==o||e[12]!==g?(_=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Qe,{id:g,checked:n,onCheckedChange:o,onClick:cs})}),e[10]=n,e[11]=o,e[12]=g,e[13]=_):_=e[13];let m;return e[14]!==c||e[15]!==a||e[16]!==_?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,_]}),e[14]=c,e[15]=a,e[16]=_,e[17]=m):m=e[17],m}function cs(t){return t.stopPropagation()}function ds({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,c]=Q.useState(""),u=r!==void 0?r:o,f=Q.useDeferredValue(u),[d,T]=Q.useState("all"),[a,g]=Q.useState(!1),_=Q.useRef(new Set(Object.keys(t))),{org:m}=Ge(),h=Qt({connectionId:$t,orgId:m.id,orgSlug:m.slug}),O=100,R=f.trim(),p=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,C=!!l,A={...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:0,...C&&{include_virtual:!0}},M=JSON.stringify(A),{data:S,fetchNextPage:b,hasNextPage:D,isFetchingNextPage:I}=Ft({queryKey:de.collectionListInfinite(h,m.id,"","CONNECTIONS",M),queryFn:async({pageParam:E=0})=>(await h.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:E,...C&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(E,w)=>{if(E?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),N=S?.pages.flatMap(E=>E?.items??[])??[],P=Kt(b,D??!1,I),i=l?N.filter(E=>E.connection_type!=="VIRTUAL"?!0:qt(E.connection_url)!==l):N,x=_.current,U=[...x.values()].map(E=>i.find(w=>w.id===E)).filter(E=>E!==void 0),G=i.filter(E=>!x.has(E.id)),Y=[...U,...G],v=E=>{const w=t[E];return w!==void 0&&w.length>0},K=Y.filter(E=>{if(d==="all")return!0;const w=v(E.id);return d==="selected"?w:d==="unselected"?!w:!0}),[L,z]=Q.useState(Y[0]?.id??null),V=L?Y.find(E=>E.id===L)??null:null,{data:k,isFetching:B}=Ve({queryKey:de.collectionItem(h,m.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await h.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=k?.tools??[],J=(E,w)=>t[E]?.includes(w)??!1,te=(E,w)=>{const H=t[E]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[E]:se[E]=le}else se[E]=[...H,w];e(se)},oe=E=>{const w=E===L?$:[];if(!w.length)return;const H=t[E]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[E]:(le[E]=q,z(E)),e(le)},F=E=>{z(E),g(!0)},W=()=>{g(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[r===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>T("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>T("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>T("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:K.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(u?"common.toolSetSelector.noConnectionsFound":d==="selected"?"common.toolSetSelector.noServersSelected":d==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(E=>{const w=L===E.id,H=w?$.length:0,q=t[E.id]?.length??0;return s.jsx(is,{connection:{...E,tools:w?$:E.tools},isSelected:w,hasToolsEnabled:v(E.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>F(E.id),onToggle:()=>oe(E.id)},E.id)}),s.jsx("div",{ref:P,className:"h-4"}),I&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(zt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Fe,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:$.map(E=>s.jsx(as,{connectionId:V.id,tool:E,isSelected:J(V.id,E.name),onToggle:()=>te(V.id,E.name)},E.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const ms=qe({role:qe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Je(),staticPermissions:we(re()),toolSet:Ze(re(),we(re())),allowAllModels:Je(),modelSet:Ze(re(),we(re())),memberIds:we(re())});function lt(t,e,l,r){const n=s.jsx(je,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(ve,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function us(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie();let T;e[0]!==u?(T=u.trim().toLowerCase(),e[0]=u,e[1]=T):T=e[1];const a=Q.useDeferredValue(T);let g;if(e[2]!==l||e[3]!==a||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==d){const _=ls(),m=(I,N)=>{if(!f){if(l&&N){const P=_.flatMap(Ts).flatMap(gs);n(!1),o(P.filter(i=>!I.tools.includes(i)));return}l||o(ns(I,r,!N))}};let h;e[11]!==a?(h=I=>{const{section:N,capabilities:P}=I;return{section:N,capabilities:P.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=h):h=e[12];const O=_.map(h).filter(fs);let R;e[13]!==d?(R=d("settings.orgRoleDetail.general"),e[13]=d,e[14]=R):R=e[14];let p;e[15]!==d?(p=d("settings.orgRoleDetail.allOrgPermissions"),e[15]=d,e[16]=p):p=e[16];let C;e[17]!==d?(C=d("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=d,e[18]=C):C=e[18];let A;e[19]!==l||e[20]!==n||e[21]!==o?(A=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=A):A=e[22];let M;e[23]!==l||e[24]!==f||e[25]!==d||e[26]!==A?(M=lt(d,l,f,A),e[23]=l,e[24]=f,e[25]=d,e[26]=A,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==f?(S=f?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=f,e[32]=S):S=e[32];let b;e[33]!==S||e[34]!==p||e[35]!==C||e[36]!==M?(b=s.jsx(Xe,{children:s.jsx(et,{title:p,description:C,action:M,onClick:S})}),e[33]=S,e[34]=p,e[35]=C,e[36]=M,e[37]=b):b=e[37];let D;e[38]!==b||e[39]!==R?(D=s.jsx(We,{title:R,children:b}),e[38]=b,e[39]=R,e[40]=D):D=e[40],g=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,O.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:d("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:u})}):O.map(I=>{const{section:N,capabilities:P}=I;return s.jsx(We,{title:N,children:s.jsx(Xe,{children:P.map(i=>{const x=os(i,r,l);return s.jsx(et,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:lt(d,x,f,()=>m(i,x)),onClick:f?void 0:()=>m(i,x)},i.id)})})},N)})]})}),e[2]=l,e[3]=a,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=r,e[9]=d,e[10]=g}else g=e[10];return g}function fs(t){return t.capabilities.length>0}function gs(t){return t.tools}function Ts(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},_s={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function hs(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function Es(t){return _s[t]??St[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const At=30;function xs(t){const e=X.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:c,allConnectionModelIds:u,selectedModels:f,allowAllModels:d,allConnectionModelsSelected:T,onToggleModel:a,onExitAllowAll:g,readOnly:_,defaultExpanded:m}=t,h=ie(),[O,R]=Q.useState(m),p=m||O,C=R,[A,M]=Q.useState(At);let S;e[0]!==T||e[1]!==d||e[2]!==f?(S=I=>d||T||f.includes("*")||f.includes(I),e[0]=T,e[1]=d,e[2]=f,e[3]=S):S=e[3];const b=S;let D;if(e[4]!==u||e[5]!==d||e[6]!==l||e[7]!==p||e[8]!==o||e[9]!==b||e[10]!==c||e[11]!==g||e[12]!==a||e[13]!==_||e[14]!==r||e[15]!==n||e[16]!==h||e[17]!==A){let I;e[19]!==b?(I=B=>b(B.id),e[19]=b,e[20]=I):I=e[20];const N=c.filter(I).length,P=c.slice(0,A),i=c.length>A;let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>C(As),e[21]=x):x=e[21];const U=o??Et[r]??It;let G;e[22]!==n||e[23]!==U?(G=s.jsx(Fe,{icon:U,name:n,size:"sm"}),e[22]=n,e[23]=U,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let v;e[27]!==G||e[28]!==Y?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=v):v=e[29];const K=h("settings.orgRoleDetail.enabledCount",{enabledCount:N,total:c.length});let L;e[30]!==K?(L=s.jsx(be,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let z;e[32]!==p?(z=p?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=p,e[33]=z):z=e[33];let V;e[34]!==L||e[35]!==z?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,z]}),e[34]=L,e[35]=z,e[36]=V):V=e[36];let k;e[37]!==V||e[38]!==v?(k=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:x,children:[v,V]}),e[37]=V,e[38]=v,e[39]=k):k=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[k,p&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[P.map(B=>{const $=b(B.id),J=()=>{if(!_){if(d){g(l,u,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!_&&"hover:bg-muted/50 cursor-pointer"),onClick:J,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ss,children:_?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:$,disabled:!0,onCheckedChange:Rs})})}),s.jsx(ve,{children:s.jsx("p",{children:h("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:$,onCheckedChange:J})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(ps),children:h("settings.orgRoleDetail.showMore",{remaining:c.length-A})})]})]}),e[4]=u,e[5]=d,e[6]=l,e[7]=p,e[8]=o,e[9]=b,e[10]=c,e[11]=g,e[12]=a,e[13]=_,e[14]=r,e[15]=n,e[16]=h,e[17]=A,e[18]=D}else D=e[18];return D}function ps(t){return t+At}function Rs(){}function Ss(t){return t.stopPropagation()}function As(t){return!t}function Ns(t){const e=X.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:u,searchQuery:f,readOnly:d}=t,T=Wt(l.id);let a,g,_,m,h;if(e[0]!==u||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==T||e[8]!==d||e[9]!==f||e[10]!==r){h=Symbol.for("react.early_return_sentinel");e:{let p;e[16]!==l.label?(p=x=>({...x,id:x.modelId,provider:l.label}),e[16]=l.label,e[17]=p):p=e[17];const C=T.filter(js).map(p),A=f.trim().toLowerCase(),M=A?C.filter(x=>x.title.toLowerCase().includes(A)||x.id.toLowerCase().includes(A)||x.provider?.toLowerCase().includes(A)):C;if(M.length===0){h=null;break e}const S=new Map;for(const x of M){const U=hs(x.id,l.providerId),G=S.get(U)??{models:[],logo:null};G.models.push({id:x.id,title:Is(x.title),logo:x.logo}),!G.logo&&x.logo&&(G.logo=x.logo),S.set(U,G)}const b=Array.from(S.entries()).map(bs).sort(Cs),D=b.length===1||A.length>0;_="flex flex-col gap-3";const I=Et[l.providerId]??It;let N;e[18]!==l.providerId||e[19]!==I?(N=s.jsx("img",{src:I,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=I,e[20]=N):N=e[20];const P=St[l.providerId]??l.providerId;let i;e[21]!==P?(i=s.jsx("h4",{className:"text-sm font-medium",children:P}),e[21]=P,e[22]=i):i=e[22],e[23]!==i||e[24]!==N?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[N,i]}),e[23]=i,e[24]=N,e[25]=m):m=e[25],a="flex flex-col gap-3",g=b.map(x=>s.jsx(xs,{connectionId:l.id,subProviderId:x.id,subProviderName:x.name,groupLogo:x.logo,models:x.models,allConnectionModelIds:C.map(Os),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:u,onToggleModel:o,onExitAllowAll:c,readOnly:d,defaultExpanded:D},x.id))}e[0]=u,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=T,e[8]=d,e[9]=f,e[10]=r,e[11]=a,e[12]=g,e[13]=_,e[14]=m,e[15]=h}else a=e[11],g=e[12],_=e[13],m=e[14],h=e[15];if(h!==Symbol.for("react.early_return_sentinel"))return h;let O;e[26]!==a||e[27]!==g?(O=s.jsx("div",{className:a,children:g}),e[26]=a,e[27]=g,e[28]=O):O=e[28];let R;return e[29]!==_||e[30]!==m||e[31]!==O?(R=s.jsxs("div",{className:_,children:[m,O]}),e[29]=_,e[30]=m,e[31]=O,e[32]=R):R=e[32],R}function Os(t){return t.id}function Cs(t,e){return t.name.localeCompare(e.name)}function bs(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function js(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie(),T=Q.useDeferredValue(u),a=Jt();let g;e[0]!==r||e[1]!==o?(g=(I,N)=>{const P=r[I]??[],i={...r};if(P.includes(N)){const x=P.filter(U=>U!==N);x.length===0?delete i[I]:i[I]=x}else i[I]=[...P,N];o(i)},e[0]=r,e[1]=o,e[2]=g):g=e[2];const _=g;let m;e[3]!==r||e[4]!==n||e[5]!==o?(m=(I,N,P)=>{n(!1),o({...r,[I]:N.filter(i=>i!==P)})},e[3]=r,e[4]=n,e[5]=o,e[6]=m):m=e[6];const h=m,O=!f&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==O?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",O),e[7]=O,e[8]=R):R=e[8];let p;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==f?(p=()=>{if(f)return;const I=!l;n(I),I&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=f,e[13]=p):p=e[13];let C;e[14]!==d?(C=d("settings.orgRoleDetail.allModels"),e[14]=d,e[15]=C):C=e[15];let A;e[16]!==C?(A=s.jsx("span",{className:"text-sm font-medium",children:C}),e[16]=C,e[17]=A):A=e[17];let M;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==f||e[22]!==d?(M=s.jsx("div",{onClick:Ps,children:f?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(ve,{children:s.jsx("p",{children:d("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:l,onCheckedChange:I=>{n(I),I&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=f,e[22]=d,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==p||e[26]!==A||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:p,children:[A,M]}),e[24]=R,e[25]=p,e[26]=A,e[27]=M,e[28]=S):S=e[28];let b;e[29]!==a||e[30]!==l||e[31]!==T||e[32]!==h||e[33]!==r||e[34]!==f||e[35]!==d||e[36]!==_?(b=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(I=>s.jsx(Q.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"size-4"}),d("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ns,{connection:I,selectedModels:r[I.id]??[],allowAllModels:l,onToggleModel:_,onExitAllowAll:h,allConnectionModelsSelected:(r[I.id]??[]).includes("*"),searchQuery:T,readOnly:f})},I.id)),e[29]=a,e[30]=l,e[31]=T,e[32]=h,e[33]=r,e[34]=f,e[35]=d,e[36]=_,e[37]=b):b=e[37];let D;return e[38]!==S||e[39]!==b?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,b]}),e[38]=S,e[39]=b,e[40]=D):D=e[40],D}function Ds(){}function Ps(t){return t.stopPropagation()}function vs(t){const e=X.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,c=ie(),[u,f]=Q.useState(""),d=Q.useDeferredValue(u);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[0]=T):T=e[0];const[a,g]=Q.useState(T),{data:_}=xt();let m,h,O,R,p,C,A,M,S,b,D;if(e[1]!==_?.data?.members||e[2]!==d||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==u||e[8]!==n||e[9]!==c){const L=_?.data?.members??[];let z;e[21]!==d?(z=F=>{const W=d.toLowerCase();return F.user?.name?.toLowerCase().includes(W)||F.user?.email?.toLowerCase().includes(W)},e[21]=d,e[22]=z):z=e[22];const V=L.filter(z);let k;e[23]!==o||e[24]!==r||e[25]!==a?(k=()=>{o(a),g([]),r(!1)},e[23]=o,e[24]=r,e[25]=a,e[26]=k):k=e[26],O=k,h=dt,b=l,D=r,m=mt,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(ut,{children:B}),e[29]=B,e[30]=$):$=e[30];let J;e[31]!==c?(J=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=J):J=e[32];let te;e[33]!==J?(te=s.jsx(ft,{children:J}),e[33]=J,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=S):S=e[37],C="flex flex-col h-80";let oe;e[38]!==c?(oe=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=oe):oe=e[39],e[40]!==u||e[41]!==oe?(A=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ze,{value:u,onChange:f,placeholder:oe,className:"w-full"})}),e[40]=u,e[41]=oe,e[42]=A):A=e[42],R="flex-1 overflow-auto",p=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(u?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const W=F.role!=="owner",E=n.includes(F.id),w=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!W||E?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Qe,{checked:w||E,onCheckedChange:()=>{!W||E||g(H=>H.includes(F.id)?H.filter(q=>q!==F.id):[...H,F.id])},disabled:!W||E}),s.jsx(Rt,{url:F.user?.image??void 0,fallback:pt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!W&&s.jsx(be,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),E&&W&&s.jsx(be,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=_?.data?.members,e[2]=d,e[3]=o,e[4]=r,e[5]=l,e[6]=a,e[7]=u,e[8]=n,e[9]=c,e[10]=m,e[11]=h,e[12]=O,e[13]=R,e[14]=p,e[15]=C,e[16]=A,e[17]=M,e[18]=S,e[19]=b,e[20]=D}else m=e[10],h=e[11],O=e[12],R=e[13],p=e[14],C=e[15],A=e[16],M=e[17],S=e[18],b=e[19],D=e[20];let I;e[43]!==R||e[44]!==p?(I=s.jsx("div",{className:R,children:p}),e[43]=R,e[44]=p,e[45]=I):I=e[45];let N;e[46]!==I||e[47]!==C||e[48]!==A?(N=s.jsxs("div",{className:C,children:[A,I]}),e[46]=I,e[47]=C,e[48]=A,e[49]=N):N=e[49];let P;e[50]!==c?(P=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=P):P=e[51];let i;e[52]!==P?(i=s.jsx(Tt,{children:P}),e[52]=P,e[53]=i):i=e[53];const x=a.length===0;let U;e[54]!==a.length||e[55]!==c?(U=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=U):U=e[56];let G;e[57]!==O||e[58]!==x||e[59]!==U?(G=s.jsx(_t,{onClick:O,disabled:x,children:U}),e[57]=O,e[58]=x,e[59]=U,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(ht,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==m||e[65]!==N||e[66]!==Y||e[67]!==M||e[68]!==S?(v=s.jsxs(m,{className:M,children:[S,N,Y]}),e[64]=m,e[65]=N,e[66]=Y,e[67]=M,e[68]=S,e[69]=v):v=e[69];let K;return e[70]!==h||e[71]!==v||e[72]!==b||e[73]!==D?(K=s.jsx(h,{open:b,onOpenChange:D,children:v}),e[70]=h,e[71]=v,e[72]=b,e[73]=D,e[74]=K):K=e[74],K}function Ls(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=n===void 0?!1:n,T=o===void 0?void 0:o,a=ie(),g=Q.useDeferredValue(c),{data:_}=xt();let m,h,O;if(e[0]!==_?.data?.members||e[1]!==g||e[2]!==l||e[3]!==r||e[4]!==d||e[5]!==T||e[6]!==c||e[7]!==a){const M=_?.data?.members??[];let S;e[11]!==l?(S=i=>l.includes(i.id),e[11]=l,e[12]=S):S=e[12];const b=M.filter(S);let D;e[13]!==g?(D=i=>{const x=g.toLowerCase();return i.user?.name?.toLowerCase().includes(x)||i.user?.email?.toLowerCase().includes(x)},e[13]=g,e[14]=D):D=e[14];const I=b.filter(D);let N;e[15]!==T||e[16]!==a?(N=T??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=T,e[16]=a,e[17]=N):N=e[17];const P=N;O="flex flex-col h-full",m="flex-1 overflow-auto",h=b.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):I.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:I.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:pt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),d?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(tt,{size:16})})})}),s.jsx(ve,{children:s.jsx("p",{children:P})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(x=>x!==i.id)),children:s.jsx(tt,{size:16})})]},i.id))}),e[0]=_?.data?.members,e[1]=g,e[2]=l,e[3]=r,e[4]=d,e[5]=T,e[6]=c,e[7]=a,e[8]=m,e[9]=h,e[10]=O}else m=e[8],h=e[9],O=e[10];let R;e[18]!==m||e[19]!==h?(R=s.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=R):R=e[20];let p;e[21]!==l||e[22]!==r?(p=M=>r([...l,...M]),e[21]=l,e[22]=r,e[23]=p):p=e[23];let C;e[24]!==u||e[25]!==l||e[26]!==f||e[27]!==p?(C=s.jsx(vs,{open:u,onOpenChange:f,selectedMemberIds:l,onAddMembers:p}),e[24]=u,e[25]=l,e[26]=f,e[27]=p,e[28]=C):C=e[28];let A;return e[29]!==O||e[30]!==R||e[31]!==C?(A=s.jsxs("div",{className:O,children:[R,C]}),e[29]=O,e[30]=R,e[31]=C,e[32]=A):A=e[32],A}function ys(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Q.Suspense,{fallback:l,children:s.jsx(Ls,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const ws={owner:[],admin:[],user:[]};function Gs(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:ws[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),c=o?[]:n.filter(a=>a!=="*"),u={};for(const[a,g]of Object.entries(r))if(!(a==="self"||a==="models"))if(a==="*")for(const _ of l)u[_.id]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g;else{const _=l.find(m=>m.id===a);_&&(u[a]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g)}const f=r.models||[],d=f.length===0||f.includes("*:*"),T={};if(!d)for(const a of f){const g=a.indexOf(":");if(g===-1)continue;const _=a.slice(0,g),m=a.slice(g+1);T[_]||(T[_]=[]),T[_].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:u,allowAllModels:d,modelSet:T,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function ks(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const c=e.find(u=>u.id===r)?.tools?.map(u=>u.name)??[];l[r]=c.length>0&&c.every(u=>n.includes(u))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const c of o)r.push(`${n}:${c}`);r.length>0&&(l.models=r)}return l}function Bs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Vs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,c=ie();let u;e[0]!==o||e[1]!==c?(u=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=u):u=e[2];const f=u;if(l){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Be,{size:16}),e[3]=g):g=e[3];let _;e[4]!==c?(_=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=_):_=e[5];let m;e[6]!==_?(m=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[g,_]})})}),e[6]=_,e[7]=m):m=e[7];let h;e[8]!==f?(h=s.jsx(ve,{children:s.jsx("p",{children:f})}),e[8]=f,e[9]=h):h=e[9];let O;return e[10]!==m||e[11]!==h?(O=s.jsx(Me,{children:s.jsxs(De,{children:[m,h]})}),e[10]=m,e[11]=h,e[12]=O):O=e[12],O}let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:16}),e[13]=d):d=e[13];let T;e[14]!==c?(T=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=T):T=e[15];let a;return e[16]!==n||e[17]!==T?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[d,T]}),e[16]=n,e[17]=T,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Ge(),r=Ke(),n=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==r?(c=()=>r.organization.listMembers(),e[2]=r,e[3]=c):c=e[3];let u;e[4]!==o||e[5]!==c?(u={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=u):u=e[6];const{data:f,isPending:d}=Ve(u);if(d||!n){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=_):_=e[7],_}let T;e[8]!==f?.data?.members?(T=f?.data?.members??[],e[8]=f?.data?.members,e[9]=T):T=e[9];const a=T;let g;return e[10]!==n||e[11]!==a||e[12]!==t?(g=s.jsx(Ks,{...t,members:a,connections:n}),e[10]=n,e[11]=a,e[12]=t,e[13]=g):g=e[13],g}function Ks({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:c}=Ge(),u=Ke(),f=ot(),d=t.kind==="builtin",T=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[g,_]=Q.useState(d?"org":"mcp"),m=Ct({resolver:bt(ms),defaultValues:Bs(t,r,n)}),h=m.formState.isValid,O=m.formState.isDirty,R=nt({mutationFn:async i=>{const x=ks(i,n),U=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(v,K)=>{const L=r.filter(k=>k.role===(K??v)).map(k=>k.id),z=i.memberIds.filter(k=>!L.includes(k)),V=L.filter(k=>!i.memberIds.includes(k));for(const k of z){const B=await u.organization.updateMemberRole({memberId:k,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const k of V){const B=await u.organization.updateMemberRole({memberId:k,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const v=i.role.label.toLowerCase().replace(/\s+/g,"-"),K=i.role.slug,L=v!==K,z=await u.organization.updateRole({roleId:i.role.id,data:{permission:x,...L?{roleName:v}:{}}});if(z?.error)throw new Error(z.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(L?v:K,L?K:void 0),L?{...i,role:{...i.role,slug:v}}:i}else{const v=await u.organization.createRole({role:U,permission:x});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await u.organization.updateMemberRole({memberId:K,role:[U]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:U}}}},onSuccess:(i,x)=>{f.invalidateQueries({queryKey:de.members(c)}),f.invalidateQueries({queryKey:de.organizationRoles(c)});const U=!x.role.id&&!x.role.slug,G=x.role.slug==="owner"&&!x.role.id;Ye(G?"role_members_updated":U?"role_created":"role_updated",{role_slug:x.role.slug??null}),Ce.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":U?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),m.reset(i),l(i.role.id)},onError:i=>{Ce.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),p=m.handleSubmit(i=>{if(!i.role.label.trim()){Ce.error(o("settings.orgRoleDetail.roleNameIsRequired")),m.setFocus("role.label");return}R.mutate(i)}),C=!T,A=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...T?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,b]=Q.useState(""),[D,I]=Q.useState(!1),N=i=>{_(i),b("")},P={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ne,{children:s.jsxs(Ne.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ne.Title,{actions:C&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:p,disabled:R.isPending||!h||!O,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(m.watch("role.label")))}),T&&s.jsx(it,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...m.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:A})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(i=>s.jsx("button",{type:"button",onClick:()=>N(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ze,{value:S,onChange:b,placeholder:P[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(Vs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>I(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!T&&s.jsx(ds,{toolSet:m.watch("toolSet"),onToolSetChange:i=>m.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:S}),g==="org"&&s.jsx(us,{allowAllStaticPermissions:m.watch("allowAllStaticPermissions"),staticPermissions:m.watch("staticPermissions"),onAllowAllChange:i=>m.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>m.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="models"&&s.jsx(Ms,{allowAllModels:m.watch("allowAllModels"),modelSet:m.watch("modelSet"),onAllowAllChange:i=>m.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>m.setValue("modelSet",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="members"&&s.jsx(ys,{memberIds:m.watch("memberIds"),onMemberIdsChange:i=>m.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:I})]})})]})})}function zs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Fs(t){const e=X.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:c}=Mt();let u;return e[0]!==l||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o?(u=s.jsx(ts,{granted:n,loading:o,error:c,area:l,children:r}),e[0]=l,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function $s(){const t=X.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),c=vt();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=rt(u),{locator:d}=Ge(),T=Ke(),a=ot(),{customRoles:g,refetch:_}=Lt();let m;t[1]!==c?(m=j=>c({to:".",search:y=>({...y,role:j})}),t[1]=c,t[2]=m):m=t[2];const h=m;let O;e:{if(!f){O=null;break e}if(f==="new"){O={kind:"new"};break e}if(f.startsWith("builtin-")){O={kind:"builtin",role:f.slice(8)};break e}let j;t[3]!==f?(j=ee=>ee.id===f,t[3]=f,t[4]=j):j=t[4];const y=g.find(j);O=y?{kind:"custom",role:y}:null}const R=O;let p;t[5]!==d?(p=de.members(d),t[5]=d,t[6]=p):p=t[6];let C;t[7]!==T?(C=()=>T.organization.listMembers(),t[7]=T,t[8]=C):C=t[8];let A;t[9]!==p||t[10]!==C?(A={queryKey:p,queryFn:C},t[9]=p,t[10]=C,t[11]=A):A=t[11];const{data:M}=Ve(A);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const b=S;let D;t[14]!==b?(D=j=>b.filter(y=>y.role===j).length,t[14]=b,t[15]=D):D=t[15];const I=D;let N;if(t[16]!==g||t[17]!==I||t[18]!==l||t[19]!==e){let j;t[21]!==I||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:I(ce.role),label:e(ce.labelKey)}}),t[21]=I,t[22]=e,t[23]=j):j=t[23];const y=Qs.map(j);let ee;t[24]!==I?(ee=ce=>({kind:"custom",role:{...ce,memberCount:I(ce.role)}}),t[24]=I,t[25]=ee):ee=t[25];const Nt=g.map(ee);if(N=[...y,...Nt],l){const ce=l.toLowerCase();N=N.filter(Ot=>Ot.role.label.toLowerCase().includes(ce))}t[16]=g,t[17]=I,t[18]=l,t[19]=e,t[20]=N}else N=t[20];let P;t[26]!==T?(P=async j=>{const y=await T.organization.deleteRole({roleId:j});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=T,t[27]=P):P=t[27];const i=nt({mutationFn:P,onSuccess:(j,y)=>{Ye("role_deleted",{role_id:y}),a.invalidateQueries({queryKey:de.members(d)}),a.invalidateQueries({queryKey:de.organizationRoles(d)}),Ce.success(e("settings.roles.deletedSuccessfully")),_(),R?.kind==="custom"&&R.role.id===y&&h(void 0)},onError:Ws});let x;t[28]!==e?(x=e("settings.roles.columnRole"),t[28]=e,t[29]=x):x=t[29];let U;t[30]!==x?(U={id:"role",header:x,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=x,t[31]=U):U=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(be,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(be,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let v;t[36]!==G||t[37]!==Y?(v={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=v):v=t[38];let K;t[39]!==e?(K=e("settings.roles.columnPermissions"),t[39]=e,t[40]=K):K=t[40];let L;t[41]!==e?(L=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=j.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=L):L=t[42];let z;t[43]!==K||t[44]!==L?(z={id:"permissions",header:K,render:L,cellClassName:"flex-1 min-w-0"},t[43]=K,t[44]=L,t[45]=z):z=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let k;t[48]!==V?(k={id:"members",header:V,render:Zs,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=k):k=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:Hs,children:s.jsxs(kt,{variant:"destructive",onClick:()=>{const y=j.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==U||t[53]!==v||t[54]!==z||t[55]!==k||t[56]!==B?($=[U,v,z,k,B],t[52]=U,t[53]=v,t[54]=z,t[55]=k,t[56]=B,t[57]=$):$=t[57];const J=$;let te;t[58]!==h?(te=j=>{if(j.kind==="builtin")h(`builtin-${j.role.role}`);else{const y=j.role;h(y.id)}},t[58]=h,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==h?(j=()=>h(void 0),t[60]=h,t[61]=j):j=t[61];let y;return t[62]!==_||t[63]!==h?(y=()=>{_(),h(void 0)},t[62]=_,t[63]=h,t[64]=y):y=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:y},zs(R))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let W;t[67]===Symbol.for("react.memo_cache_sentinel")?(W=j=>{j.key==="Escape"&&(r(""),j.target.blur())},t[67]=W):W=t[67];let E;t[68]!==l||t[69]!==F?(E=s.jsx(ze,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:W}),t[68]=l,t[69]=F,t[70]=E):E=t[70];let w;t[71]!==h?(w=()=>h("new"),t[71]=h,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Be,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==E||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,se]}),t[79]=E,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(st,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(st,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let me;t[85]!==N||t[86]!==J||t[87]!==oe||t[88]!==ne?(me=s.jsx(Yt,{columns:J,data:N,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=N,t[86]=J,t[87]=oe,t[88]=ne,t[89]=me):me=t[89];const Ue=n!==null;let Le;t[90]===Symbol.for("react.memo_cache_sentinel")?(Le=j=>!j&&o(null),t[90]=Le):Le=t[90];let ue;t[91]!==e?(ue=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=ue):ue=t[92];let fe;t[93]!==ue?(fe=s.jsx(ut,{children:ue}),t[93]=ue,t[94]=fe):fe=t[94];const ke=n?.label??"";let ge;t[95]!==e||t[96]!==ke?(ge=e("settings.roles.deleteRoleConfirm",{role:ke}),t[95]=e,t[96]=ke,t[97]=ge):ge=t[97];let Te;t[98]!==ge?(Te=s.jsx(ft,{children:ge}),t[98]=ge,t[99]=Te):Te=t[99];let _e;t[100]!==fe||t[101]!==Te?(_e=s.jsxs(gt,{children:[fe,Te]}),t[100]=fe,t[101]=Te,t[102]=_e):_e=t[102];let he;t[103]!==e?(he=e("settings.roles.cancel"),t[103]=e,t[104]=he):he=t[104];let Ee;t[105]!==he?(Ee=s.jsx(Tt,{children:he}),t[105]=he,t[106]=Ee):Ee=t[106];let Ie;t[107]!==i||t[108]!==n?(Ie=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ie):Ie=t[109];let xe;t[110]!==e?(xe=e("settings.roles.delete"),t[110]=e,t[111]=xe):xe=t[111];let pe;t[112]!==Ie||t[113]!==xe?(pe=s.jsx(_t,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:xe}),t[112]=Ie,t[113]=xe,t[114]=pe):pe=t[114];let Re;t[115]!==Ee||t[116]!==pe?(Re=s.jsxs(ht,{children:[Ee,pe]}),t[115]=Ee,t[116]=pe,t[117]=Re):Re=t[117];let Se;t[118]!==_e||t[119]!==Re?(Se=s.jsxs(mt,{children:[_e,Re]}),t[118]=_e,t[119]=Re,t[120]=Se):Se=t[120];let Ae;t[121]!==Ue||t[122]!==Se?(Ae=s.jsx(dt,{open:Ue,onOpenChange:Le,children:Se}),t[121]=Ue,t[122]=Se,t[123]=Ae):Ae=t[123];let ye;return t[124]!==le||t[125]!==me||t[126]!==Ae?(ye=s.jsxs(at,{group:"members",className:"gap-6",children:[le,me,Ae]}),t[124]=le,t[125]=me,t[126]=Ae,t[127]=ye):ye=t[127],ye}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Zs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",ct(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(it,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ws(t,e){Ye("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Ce.error(t instanceof Error?t.message:"Failed to delete role")}function Xs(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=rt(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let c;t[5]!==r?(c=r?s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(at,{group:"members",className:"gap-6",children:s.jsx(Dt,{})}),t[5]=r,t[6]=c):c=t[6];let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($s,{}),t[7]=u):u=t[7];let f;t[8]!==c?(f=s.jsx(Q.Suspense,{fallback:c,children:u}),t[8]=c,t[9]=f):f=t[9];let d;return t[10]!==o||t[11]!==f?(d=s.jsx(Pt,{fallback:o,children:f}),t[10]=o,t[11]=f,t[12]=d):d=t[12],d}function Ro(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{area:"roles",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{Ro as default};
|
|
1
|
+
import{b as ie,r as Q,G as Ge,K as de,m as Ve,j as s,l as Z,h as Oe,B as ae,c as X,ae as qe,af as we,ag as re,ak as Ze,ah as Je,n as ot,aq as Ct,ar as bt,e as nt,t as Ce,o as Ye,P as Ne,z as it,dp as We,dq as Xe,dr as et,C as jt,a3 as Me,a4 as De,a1 as Pe,a2 as ve,ap as tt,bZ as Mt,u as rt,dt as at,fh as Dt,E as Pt,d as vt}from"./index-DIek05Ni.js";import{u as Lt}from"./use-organization-roles-DD8iZIN6.js";import{u as Ke}from"./use-org-auth-client-iR6n2Ufe.js";import{g as ct,a as yt}from"./role-color-Dn2tXDDF.js";import{B as be}from"./badge-CzoDeQX5.js";import{A as dt,a as mt,c as ut,d as ft,b as gt,f as Tt,g as _t,e as ht}from"./alert-dialog-CADzi4i2.js";import{c as wt,D as Gt,b as Ut,a as kt}from"./dropdown-menu-ChRlmtGH.js";import{i as Bt}from"./DotsVertical-CiZ90LaC.js";import{s as Be}from"./Plus-f1J7CslD.js";import{s as Vt}from"./Trash01-JArTmXvL.js";import{C as Yt}from"./collection-table-wrapper-Be1BrSKV.js";import{E as st}from"./empty-state-CMDRQGT-.js";import{S as ze}from"./search-input-C6-gsMRW.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Fe}from"./integration-icon-BdFo1XXn.js";import{u as Kt}from"./use-infinite-scroll-DqFZUY4N.js";import{C as Qe}from"./checkbox-5kuFpJGJ.js";import{i as zt}from"./ArrowLeft-B_Sm8nZF.js";import{u as Ft}from"./useSuspenseInfiniteQuery-BTeTh9yc.js";import{u as Qt}from"./use-mcp-client-TErTfSlr.js";import{S as $t}from"./constants-Daqiz8AS.js";import{C as Ht}from"./collection-search-x0S64zby.js";import{p as qt}from"./connection-DVZ0x-CQ.js";import{a as xt}from"./use-members-DHc3PfZ3.js";import{g as pt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-CwE_S8Fn.js";import{u as Jt,g as Wt}from"./use-ai-providers-4XpSsDac.js";import{A as Rt}from"./avatar-DelCpRBk.js";import{S as je}from"./switch-PGr_evzH.js";import{t as Xt}from"./ChevronUp-CKGVkzNf.js";import{i as es}from"./ChevronRight-BId4MMJ9.js";import{A as ts}from"./access-gate-CgpWlbs5.js";import"./Check-RwOXYzpY.js";import"./table-CSG_zh9i.js";import"./ArrowUp-DtnUC7b1.js";import"./SearchMd-BxQNX78D.js";import"./Tool02-BFWUmpcW.js";import"./agent-icon-COOgI3ay.js";import"./AlertCircle-COFB2d-k.js";import"./Tool01-CsI9zgpV.js";import"./XCircle-B-U8MZ3l.js";import"./TrendUp01-BXyuZrfj.js";import"./ZoomOut-d1whDSJ4.js";import"./Users03-DBIwkies.js";import"./CheckCircle-BakDkudF.js";import"./ChevronSelectorVertical-BPZJCzil.js";import"./UserSquare-EeCR50Jd.js";import"./Copy01-D8F1H1Rm.js";import"./CreditCard01-hwp2k2z5.js";import"./Download01-BFWoFyp5.js";import"./Settings02-DI7LVcro.js";import"./Eye-BkYoLh_d.js";import"./Share07-BlQxtP9X.js";import"./GitBranch01-wBN2Zyoy.js";import"./Globe01-D_ldoikY.js";import"./XClose-Dz9b9dRZ.js";import"./HardDrive-ChbOVw3L.js";import"./Image01-CVmN_WRr.js";import"./Key01-n-kxmORy.js";import"./Link01-ngcEVr-U.js";import"./LinkExternal01-CYGJDolS.js";import"./Monitor01-B3YP0Q4Y.js";import"./Sun-CudPxUwF.js";import"./Package-D3FCZEz9.js";import"./Palette-B8VxVOuh.js";import"./Play-BJDJ0Cd_.js";import"./SearchLg-ijCBByfF.js";import"./Shield01-arn3OL5A.js";import"./Stars01-C7zRxa-s.js";import"./Upload01-TH_UzEO5.js";import"./User01-BQutGTr9.js";import"./Users01-BlGMCWje.js";import"./Zap-Dpl5zC2B.js";import"./auth-CDNWJs_H.js";import"./capability-load-error-GWNWVbL6.js";const $e="basic-usage",He=[{id:$e,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...He.find(t=>t.id===$e)?.tools??[]];const ss=["agents:manage","connections:manage"];new Set(He.filter(t=>ss.includes(t.id)).flatMap(t=>t.tools));function ls(){const t=new Map;for(const e of He){if(e.id===$e)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function os(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ns(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}function is(t){const e=X.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:c,onSelect:u,onToggle:f}=t,d=r?"bg-accent/50":"hover:bg-muted/50";let T;e[0]!==d?(T=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=T):T=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Fe,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let g;e[5]!==l.title?(g=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=g):g=e[6];let _;e[7]!==u||e[8]!==a||e[9]!==g?(_=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:u,children:[a,g]}),e[7]=u,e[8]=a,e[9]=g,e[10]=_):_=e[10];let m;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==f||e[15]!==c?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(Qe,{checked:n,onCheckedChange:f,onClick:rs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=f,e[15]=c,e[16]=m):m=e[16];let h;return e[17]!==T||e[18]!==_||e[19]!==m?(h=s.jsxs("div",{className:T,children:[_,m]}),e[17]=T,e[18]=_,e[19]=m,e[20]=h):h=e[20],h}function rs(t){return t.stopPropagation()}function as(t){const e=X.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,c=`tool-${l}-${r.name}`,u=n?"text-foreground":"text-muted-foreground";let f;e[0]!==u?(f=Z("text-sm font-medium",u),e[0]=u,e[1]=f):f=e[1];let d;e[2]!==f||e[3]!==r.name?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:f,children:r.name})}),e[2]=f,e[3]=r.name,e[4]=d):d=e[4];let T;e[5]!==r.description?(T=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=T):T=e[6];let a;e[7]!==d||e[8]!==T?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,T]}),e[7]=d,e[8]=T,e[9]=a):a=e[9];const g=`tool-${l}-${r.name}`;let _;e[10]!==n||e[11]!==o||e[12]!==g?(_=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Qe,{id:g,checked:n,onCheckedChange:o,onClick:cs})}),e[10]=n,e[11]=o,e[12]=g,e[13]=_):_=e[13];let m;return e[14]!==c||e[15]!==a||e[16]!==_?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,_]}),e[14]=c,e[15]=a,e[16]=_,e[17]=m):m=e[17],m}function cs(t){return t.stopPropagation()}function ds({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,c]=Q.useState(""),u=r!==void 0?r:o,f=Q.useDeferredValue(u),[d,T]=Q.useState("all"),[a,g]=Q.useState(!1),_=Q.useRef(new Set(Object.keys(t))),{org:m}=Ge(),h=Qt({connectionId:$t,orgId:m.id,orgSlug:m.slug}),O=100,R=f.trim(),p=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,C=!!l,A={...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:0,...C&&{include_virtual:!0}},M=JSON.stringify(A),{data:S,fetchNextPage:b,hasNextPage:D,isFetchingNextPage:I}=Ft({queryKey:de.collectionListInfinite(h,m.id,"","CONNECTIONS",M),queryFn:async({pageParam:E=0})=>(await h.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...p&&{where:p},orderBy:[{field:["updated_at"],direction:"asc"}],limit:O,offset:E,...C&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(E,w)=>{if(E?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),N=S?.pages.flatMap(E=>E?.items??[])??[],P=Kt(b,D??!1,I),i=l?N.filter(E=>E.connection_type!=="VIRTUAL"?!0:qt(E.connection_url)!==l):N,x=_.current,U=[...x.values()].map(E=>i.find(w=>w.id===E)).filter(E=>E!==void 0),G=i.filter(E=>!x.has(E.id)),Y=[...U,...G],v=E=>{const w=t[E];return w!==void 0&&w.length>0},K=Y.filter(E=>{if(d==="all")return!0;const w=v(E.id);return d==="selected"?w:d==="unselected"?!w:!0}),[L,z]=Q.useState(Y[0]?.id??null),V=L?Y.find(E=>E.id===L)??null:null,{data:k,isFetching:B}=Ve({queryKey:de.collectionItem(h,m.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await h.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=k?.tools??[],J=(E,w)=>t[E]?.includes(w)??!1,te=(E,w)=>{const H=t[E]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[E]:se[E]=le}else se[E]=[...H,w];e(se)},oe=E=>{const w=E===L?$:[];if(!w.length)return;const H=t[E]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[E]:(le[E]=q,z(E)),e(le)},F=E=>{z(E),g(!0)},W=()=>{g(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[r===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>T("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>T("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>T("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:K.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(u?"common.toolSetSelector.noConnectionsFound":d==="selected"?"common.toolSetSelector.noServersSelected":d==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(E=>{const w=L===E.id,H=w?$.length:0,q=t[E.id]?.length??0;return s.jsx(is,{connection:{...E,tools:w?$:E.tools},isSelected:w,hasToolsEnabled:v(E.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>F(E.id),onToggle:()=>oe(E.id)},E.id)}),s.jsx("div",{ref:P,className:"h-4"}),I&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(zt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Fe,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:$.map(E=>s.jsx(as,{connectionId:V.id,tool:E,isSelected:J(V.id,E.name),onToggle:()=>te(V.id,E.name)},E.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const ms=qe({role:qe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Je(),staticPermissions:we(re()),toolSet:Ze(re(),we(re())),allowAllModels:Je(),modelSet:Ze(re(),we(re())),memberIds:we(re())});function lt(t,e,l,r){const n=s.jsx(je,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(ve,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function us(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie();let T;e[0]!==u?(T=u.trim().toLowerCase(),e[0]=u,e[1]=T):T=e[1];const a=Q.useDeferredValue(T);let g;if(e[2]!==l||e[3]!==a||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==d){const _=ls(),m=(I,N)=>{if(!f){if(l&&N){const P=_.flatMap(Ts).flatMap(gs);n(!1),o(P.filter(i=>!I.tools.includes(i)));return}l||o(ns(I,r,!N))}};let h;e[11]!==a?(h=I=>{const{section:N,capabilities:P}=I;return{section:N,capabilities:P.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=h):h=e[12];const O=_.map(h).filter(fs);let R;e[13]!==d?(R=d("settings.orgRoleDetail.general"),e[13]=d,e[14]=R):R=e[14];let p;e[15]!==d?(p=d("settings.orgRoleDetail.allOrgPermissions"),e[15]=d,e[16]=p):p=e[16];let C;e[17]!==d?(C=d("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=d,e[18]=C):C=e[18];let A;e[19]!==l||e[20]!==n||e[21]!==o?(A=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=A):A=e[22];let M;e[23]!==l||e[24]!==f||e[25]!==d||e[26]!==A?(M=lt(d,l,f,A),e[23]=l,e[24]=f,e[25]=d,e[26]=A,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==f?(S=f?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=f,e[32]=S):S=e[32];let b;e[33]!==S||e[34]!==p||e[35]!==C||e[36]!==M?(b=s.jsx(Xe,{children:s.jsx(et,{title:p,description:C,action:M,onClick:S})}),e[33]=S,e[34]=p,e[35]=C,e[36]=M,e[37]=b):b=e[37];let D;e[38]!==b||e[39]!==R?(D=s.jsx(We,{title:R,children:b}),e[38]=b,e[39]=R,e[40]=D):D=e[40],g=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,O.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:d("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:u})}):O.map(I=>{const{section:N,capabilities:P}=I;return s.jsx(We,{title:N,children:s.jsx(Xe,{children:P.map(i=>{const x=os(i,r,l);return s.jsx(et,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(jt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:lt(d,x,f,()=>m(i,x)),onClick:f?void 0:()=>m(i,x)},i.id)})})},N)})]})}),e[2]=l,e[3]=a,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=r,e[9]=d,e[10]=g}else g=e[10];return g}function fs(t){return t.capabilities.length>0}function gs(t){return t.tools}function Ts(t){return t.capabilities}const St={anthropic:"Anthropic",openrouter:"OpenRouter"},_s={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function hs(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function Es(t){return _s[t]??St[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const At=30;function xs(t){const e=X.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:c,allConnectionModelIds:u,selectedModels:f,allowAllModels:d,allConnectionModelsSelected:T,onToggleModel:a,onExitAllowAll:g,readOnly:_,defaultExpanded:m}=t,h=ie(),[O,R]=Q.useState(m),p=m||O,C=R,[A,M]=Q.useState(At);let S;e[0]!==T||e[1]!==d||e[2]!==f?(S=I=>d||T||f.includes("*")||f.includes(I),e[0]=T,e[1]=d,e[2]=f,e[3]=S):S=e[3];const b=S;let D;if(e[4]!==u||e[5]!==d||e[6]!==l||e[7]!==p||e[8]!==o||e[9]!==b||e[10]!==c||e[11]!==g||e[12]!==a||e[13]!==_||e[14]!==r||e[15]!==n||e[16]!==h||e[17]!==A){let I;e[19]!==b?(I=B=>b(B.id),e[19]=b,e[20]=I):I=e[20];const N=c.filter(I).length,P=c.slice(0,A),i=c.length>A;let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>C(As),e[21]=x):x=e[21];const U=o??Et[r]??It;let G;e[22]!==n||e[23]!==U?(G=s.jsx(Fe,{icon:U,name:n,size:"sm"}),e[22]=n,e[23]=U,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let v;e[27]!==G||e[28]!==Y?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=v):v=e[29];const K=h("settings.orgRoleDetail.enabledCount",{enabledCount:N,total:c.length});let L;e[30]!==K?(L=s.jsx(be,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let z;e[32]!==p?(z=p?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=p,e[33]=z):z=e[33];let V;e[34]!==L||e[35]!==z?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,z]}),e[34]=L,e[35]=z,e[36]=V):V=e[36];let k;e[37]!==V||e[38]!==v?(k=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:x,children:[v,V]}),e[37]=V,e[38]=v,e[39]=k):k=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[k,p&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[P.map(B=>{const $=b(B.id),J=()=>{if(!_){if(d){g(l,u,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!_&&"hover:bg-muted/50 cursor-pointer"),onClick:J,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ss,children:_?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:$,disabled:!0,onCheckedChange:Rs})})}),s.jsx(ve,{children:s.jsx("p",{children:h("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:$,onCheckedChange:J})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(ps),children:h("settings.orgRoleDetail.showMore",{remaining:c.length-A})})]})]}),e[4]=u,e[5]=d,e[6]=l,e[7]=p,e[8]=o,e[9]=b,e[10]=c,e[11]=g,e[12]=a,e[13]=_,e[14]=r,e[15]=n,e[16]=h,e[17]=A,e[18]=D}else D=e[18];return D}function ps(t){return t+At}function Rs(){}function Ss(t){return t.stopPropagation()}function As(t){return!t}function Ns(t){const e=X.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:u,searchQuery:f,readOnly:d}=t,T=Wt(l.id);let a,g,_,m,h;if(e[0]!==u||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==T||e[8]!==d||e[9]!==f||e[10]!==r){h=Symbol.for("react.early_return_sentinel");e:{let p;e[16]!==l.label?(p=x=>({...x,id:x.modelId,provider:l.label}),e[16]=l.label,e[17]=p):p=e[17];const C=T.filter(js).map(p),A=f.trim().toLowerCase(),M=A?C.filter(x=>x.title.toLowerCase().includes(A)||x.id.toLowerCase().includes(A)||x.provider?.toLowerCase().includes(A)):C;if(M.length===0){h=null;break e}const S=new Map;for(const x of M){const U=hs(x.id,l.providerId),G=S.get(U)??{models:[],logo:null};G.models.push({id:x.id,title:Is(x.title),logo:x.logo}),!G.logo&&x.logo&&(G.logo=x.logo),S.set(U,G)}const b=Array.from(S.entries()).map(bs).sort(Cs),D=b.length===1||A.length>0;_="flex flex-col gap-3";const I=Et[l.providerId]??It;let N;e[18]!==l.providerId||e[19]!==I?(N=s.jsx("img",{src:I,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=I,e[20]=N):N=e[20];const P=St[l.providerId]??l.providerId;let i;e[21]!==P?(i=s.jsx("h4",{className:"text-sm font-medium",children:P}),e[21]=P,e[22]=i):i=e[22],e[23]!==i||e[24]!==N?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[N,i]}),e[23]=i,e[24]=N,e[25]=m):m=e[25],a="flex flex-col gap-3",g=b.map(x=>s.jsx(xs,{connectionId:l.id,subProviderId:x.id,subProviderName:x.name,groupLogo:x.logo,models:x.models,allConnectionModelIds:C.map(Os),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:u,onToggleModel:o,onExitAllowAll:c,readOnly:d,defaultExpanded:D},x.id))}e[0]=u,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=T,e[8]=d,e[9]=f,e[10]=r,e[11]=a,e[12]=g,e[13]=_,e[14]=m,e[15]=h}else a=e[11],g=e[12],_=e[13],m=e[14],h=e[15];if(h!==Symbol.for("react.early_return_sentinel"))return h;let O;e[26]!==a||e[27]!==g?(O=s.jsx("div",{className:a,children:g}),e[26]=a,e[27]=g,e[28]=O):O=e[28];let R;return e[29]!==_||e[30]!==m||e[31]!==O?(R=s.jsxs("div",{className:_,children:[m,O]}),e[29]=_,e[30]=m,e[31]=O,e[32]=R):R=e[32],R}function Os(t){return t.id}function Cs(t,e){return t.name.localeCompare(e.name)}function bs(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function js(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:c,searchQuery:u}=t,f=c===void 0?!1:c,d=ie(),T=Q.useDeferredValue(u),a=Jt();let g;e[0]!==r||e[1]!==o?(g=(I,N)=>{const P=r[I]??[],i={...r};if(P.includes(N)){const x=P.filter(U=>U!==N);x.length===0?delete i[I]:i[I]=x}else i[I]=[...P,N];o(i)},e[0]=r,e[1]=o,e[2]=g):g=e[2];const _=g;let m;e[3]!==r||e[4]!==n||e[5]!==o?(m=(I,N,P)=>{n(!1),o({...r,[I]:N.filter(i=>i!==P)})},e[3]=r,e[4]=n,e[5]=o,e[6]=m):m=e[6];const h=m,O=!f&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==O?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",O),e[7]=O,e[8]=R):R=e[8];let p;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==f?(p=()=>{if(f)return;const I=!l;n(I),I&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=f,e[13]=p):p=e[13];let C;e[14]!==d?(C=d("settings.orgRoleDetail.allModels"),e[14]=d,e[15]=C):C=e[15];let A;e[16]!==C?(A=s.jsx("span",{className:"text-sm font-medium",children:C}),e[16]=C,e[17]=A):A=e[17];let M;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==f||e[22]!==d?(M=s.jsx("div",{onClick:Ps,children:f?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(ve,{children:s.jsx("p",{children:d("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(je,{checked:l,onCheckedChange:I=>{n(I),I&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=f,e[22]=d,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==p||e[26]!==A||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:p,children:[A,M]}),e[24]=R,e[25]=p,e[26]=A,e[27]=M,e[28]=S):S=e[28];let b;e[29]!==a||e[30]!==l||e[31]!==T||e[32]!==h||e[33]!==r||e[34]!==f||e[35]!==d||e[36]!==_?(b=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(I=>s.jsx(Q.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"size-4"}),d("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ns,{connection:I,selectedModels:r[I.id]??[],allowAllModels:l,onToggleModel:_,onExitAllowAll:h,allConnectionModelsSelected:(r[I.id]??[]).includes("*"),searchQuery:T,readOnly:f})},I.id)),e[29]=a,e[30]=l,e[31]=T,e[32]=h,e[33]=r,e[34]=f,e[35]=d,e[36]=_,e[37]=b):b=e[37];let D;return e[38]!==S||e[39]!==b?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,b]}),e[38]=S,e[39]=b,e[40]=D):D=e[40],D}function Ds(){}function Ps(t){return t.stopPropagation()}function vs(t){const e=X.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,c=ie(),[u,f]=Q.useState(""),d=Q.useDeferredValue(u);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[0]=T):T=e[0];const[a,g]=Q.useState(T),{data:_}=xt();let m,h,O,R,p,C,A,M,S,b,D;if(e[1]!==_?.data?.members||e[2]!==d||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==u||e[8]!==n||e[9]!==c){const L=_?.data?.members??[];let z;e[21]!==d?(z=F=>{const W=d.toLowerCase();return F.user?.name?.toLowerCase().includes(W)||F.user?.email?.toLowerCase().includes(W)},e[21]=d,e[22]=z):z=e[22];const V=L.filter(z);let k;e[23]!==o||e[24]!==r||e[25]!==a?(k=()=>{o(a),g([]),r(!1)},e[23]=o,e[24]=r,e[25]=a,e[26]=k):k=e[26],O=k,h=dt,b=l,D=r,m=mt,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(ut,{children:B}),e[29]=B,e[30]=$):$=e[30];let J;e[31]!==c?(J=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=J):J=e[32];let te;e[33]!==J?(te=s.jsx(ft,{children:J}),e[33]=J,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(S=s.jsxs(gt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=S):S=e[37],C="flex flex-col h-80";let oe;e[38]!==c?(oe=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=oe):oe=e[39],e[40]!==u||e[41]!==oe?(A=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ze,{value:u,onChange:f,placeholder:oe,className:"w-full"})}),e[40]=u,e[41]=oe,e[42]=A):A=e[42],R="flex-1 overflow-auto",p=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(u?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const W=F.role!=="owner",E=n.includes(F.id),w=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!W||E?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Qe,{checked:w||E,onCheckedChange:()=>{!W||E||g(H=>H.includes(F.id)?H.filter(q=>q!==F.id):[...H,F.id])},disabled:!W||E}),s.jsx(Rt,{url:F.user?.image??void 0,fallback:pt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!W&&s.jsx(be,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),E&&W&&s.jsx(be,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=_?.data?.members,e[2]=d,e[3]=o,e[4]=r,e[5]=l,e[6]=a,e[7]=u,e[8]=n,e[9]=c,e[10]=m,e[11]=h,e[12]=O,e[13]=R,e[14]=p,e[15]=C,e[16]=A,e[17]=M,e[18]=S,e[19]=b,e[20]=D}else m=e[10],h=e[11],O=e[12],R=e[13],p=e[14],C=e[15],A=e[16],M=e[17],S=e[18],b=e[19],D=e[20];let I;e[43]!==R||e[44]!==p?(I=s.jsx("div",{className:R,children:p}),e[43]=R,e[44]=p,e[45]=I):I=e[45];let N;e[46]!==I||e[47]!==C||e[48]!==A?(N=s.jsxs("div",{className:C,children:[A,I]}),e[46]=I,e[47]=C,e[48]=A,e[49]=N):N=e[49];let P;e[50]!==c?(P=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=P):P=e[51];let i;e[52]!==P?(i=s.jsx(Tt,{children:P}),e[52]=P,e[53]=i):i=e[53];const x=a.length===0;let U;e[54]!==a.length||e[55]!==c?(U=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=U):U=e[56];let G;e[57]!==O||e[58]!==x||e[59]!==U?(G=s.jsx(_t,{onClick:O,disabled:x,children:U}),e[57]=O,e[58]=x,e[59]=U,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(ht,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==m||e[65]!==N||e[66]!==Y||e[67]!==M||e[68]!==S?(v=s.jsxs(m,{className:M,children:[S,N,Y]}),e[64]=m,e[65]=N,e[66]=Y,e[67]=M,e[68]=S,e[69]=v):v=e[69];let K;return e[70]!==h||e[71]!==v||e[72]!==b||e[73]!==D?(K=s.jsx(h,{open:b,onOpenChange:D,children:v}),e[70]=h,e[71]=v,e[72]=b,e[73]=D,e[74]=K):K=e[74],K}function Ls(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=n===void 0?!1:n,T=o===void 0?void 0:o,a=ie(),g=Q.useDeferredValue(c),{data:_}=xt();let m,h,O;if(e[0]!==_?.data?.members||e[1]!==g||e[2]!==l||e[3]!==r||e[4]!==d||e[5]!==T||e[6]!==c||e[7]!==a){const M=_?.data?.members??[];let S;e[11]!==l?(S=i=>l.includes(i.id),e[11]=l,e[12]=S):S=e[12];const b=M.filter(S);let D;e[13]!==g?(D=i=>{const x=g.toLowerCase();return i.user?.name?.toLowerCase().includes(x)||i.user?.email?.toLowerCase().includes(x)},e[13]=g,e[14]=D):D=e[14];const I=b.filter(D);let N;e[15]!==T||e[16]!==a?(N=T??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=T,e[16]=a,e[17]=N):N=e[17];const P=N;O="flex flex-col h-full",m="flex-1 overflow-auto",h=b.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):I.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:I.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Rt,{url:i.user?.image??void 0,fallback:pt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),d?s.jsx(Me,{children:s.jsxs(De,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(tt,{size:16})})})}),s.jsx(ve,{children:s.jsx("p",{children:P})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(x=>x!==i.id)),children:s.jsx(tt,{size:16})})]},i.id))}),e[0]=_?.data?.members,e[1]=g,e[2]=l,e[3]=r,e[4]=d,e[5]=T,e[6]=c,e[7]=a,e[8]=m,e[9]=h,e[10]=O}else m=e[8],h=e[9],O=e[10];let R;e[18]!==m||e[19]!==h?(R=s.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=R):R=e[20];let p;e[21]!==l||e[22]!==r?(p=M=>r([...l,...M]),e[21]=l,e[22]=r,e[23]=p):p=e[23];let C;e[24]!==u||e[25]!==l||e[26]!==f||e[27]!==p?(C=s.jsx(vs,{open:u,onOpenChange:f,selectedMemberIds:l,onAddMembers:p}),e[24]=u,e[25]=l,e[26]=f,e[27]=p,e[28]=C):C=e[28];let A;return e[29]!==O||e[30]!==R||e[31]!==C?(A=s.jsxs("div",{className:O,children:[R,C]}),e[29]=O,e[30]=R,e[31]=C,e[32]=A):A=e[32],A}function ys(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Q.Suspense,{fallback:l,children:s.jsx(Ls,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const ws={owner:[],admin:[],user:[]};function Gs(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:ws[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),c=o?[]:n.filter(a=>a!=="*"),u={};for(const[a,g]of Object.entries(r))if(!(a==="self"||a==="models"))if(a==="*")for(const _ of l)u[_.id]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g;else{const _=l.find(m=>m.id===a);_&&(u[a]=g.includes("*")?_.tools?.map(m=>m.name)??[]:g)}const f=r.models||[],d=f.length===0||f.includes("*:*"),T={};if(!d)for(const a of f){const g=a.indexOf(":");if(g===-1)continue;const _=a.slice(0,g),m=a.slice(g+1);T[_]||(T[_]=[]),T[_].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:u,allowAllModels:d,modelSet:T,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function ks(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const c=e.find(u=>u.id===r)?.tools?.map(u=>u.name)??[];l[r]=c.length>0&&c.every(u=>n.includes(u))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const c of o)r.push(`${n}:${c}`);r.length>0&&(l.models=r)}return l}function Bs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Vs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,c=ie();let u;e[0]!==o||e[1]!==c?(u=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=u):u=e[2];const f=u;if(l){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Be,{size:16}),e[3]=g):g=e[3];let _;e[4]!==c?(_=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=_):_=e[5];let m;e[6]!==_?(m=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[g,_]})})}),e[6]=_,e[7]=m):m=e[7];let h;e[8]!==f?(h=s.jsx(ve,{children:s.jsx("p",{children:f})}),e[8]=f,e[9]=h):h=e[9];let O;return e[10]!==m||e[11]!==h?(O=s.jsx(Me,{children:s.jsxs(De,{children:[m,h]})}),e[10]=m,e[11]=h,e[12]=O):O=e[12],O}let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:16}),e[13]=d):d=e[13];let T;e[14]!==c?(T=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=T):T=e[15];let a;return e[16]!==n||e[17]!==T?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[d,T]}),e[16]=n,e[17]=T,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Ge(),r=Ke(),n=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==r?(c=()=>r.organization.listMembers(),e[2]=r,e[3]=c):c=e[3];let u;e[4]!==o||e[5]!==c?(u={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=u):u=e[6];const{data:f,isPending:d}=Ve(u);if(d||!n){let _;return e[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=_):_=e[7],_}let T;e[8]!==f?.data?.members?(T=f?.data?.members??[],e[8]=f?.data?.members,e[9]=T):T=e[9];const a=T;let g;return e[10]!==n||e[11]!==a||e[12]!==t?(g=s.jsx(Ks,{...t,members:a,connections:n}),e[10]=n,e[11]=a,e[12]=t,e[13]=g):g=e[13],g}function Ks({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:c}=Ge(),u=Ke(),f=ot(),d=t.kind==="builtin",T=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[g,_]=Q.useState(d?"org":"mcp"),m=Ct({resolver:bt(ms),defaultValues:Bs(t,r,n)}),h=m.formState.isValid,O=m.formState.isDirty,R=nt({mutationFn:async i=>{const x=ks(i,n),U=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(v,K)=>{const L=r.filter(k=>k.role===(K??v)).map(k=>k.id),z=i.memberIds.filter(k=>!L.includes(k)),V=L.filter(k=>!i.memberIds.includes(k));for(const k of z){const B=await u.organization.updateMemberRole({memberId:k,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const k of V){const B=await u.organization.updateMemberRole({memberId:k,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const v=i.role.label.toLowerCase().replace(/\s+/g,"-"),K=i.role.slug,L=v!==K,z=await u.organization.updateRole({roleId:i.role.id,data:{permission:x,...L?{roleName:v}:{}}});if(z?.error)throw new Error(z.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(L?v:K,L?K:void 0),L?{...i,role:{...i.role,slug:v}}:i}else{const v=await u.organization.createRole({role:U,permission:x});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await u.organization.updateMemberRole({memberId:K,role:[U]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:U}}}},onSuccess:(i,x)=>{f.invalidateQueries({queryKey:de.members(c)}),f.invalidateQueries({queryKey:de.organizationRoles(c)});const U=!x.role.id&&!x.role.slug,G=x.role.slug==="owner"&&!x.role.id;Ye(G?"role_members_updated":U?"role_created":"role_updated",{role_slug:x.role.slug??null}),Ce.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":U?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),m.reset(i),l(i.role.id)},onError:i=>{Ce.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),p=m.handleSubmit(i=>{if(!i.role.label.trim()){Ce.error(o("settings.orgRoleDetail.roleNameIsRequired")),m.setFocus("role.label");return}R.mutate(i)}),C=!T,A=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...T?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,b]=Q.useState(""),[D,I]=Q.useState(!1),N=i=>{_(i),b("")},P={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ne,{children:s.jsxs(Ne.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ne.Title,{actions:C&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:p,disabled:R.isPending||!h||!O,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?ct(t.role,!0):yt(m.watch("role.label")))}),T&&s.jsx(it,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...m.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:A})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(i=>s.jsx("button",{type:"button",onClick:()=>N(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ze,{value:S,onChange:b,placeholder:P[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(Vs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>I(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!T&&s.jsx(ds,{toolSet:m.watch("toolSet"),onToolSetChange:i=>m.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:S}),g==="org"&&s.jsx(us,{allowAllStaticPermissions:m.watch("allowAllStaticPermissions"),staticPermissions:m.watch("staticPermissions"),onAllowAllChange:i=>m.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>m.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="models"&&s.jsx(Ms,{allowAllModels:m.watch("allowAllModels"),modelSet:m.watch("modelSet"),onAllowAllChange:i=>m.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>m.setValue("modelSet",i,{shouldDirty:!0}),readOnly:T,searchQuery:S}),g==="members"&&s.jsx(ys,{memberIds:m.watch("memberIds"),onMemberIdsChange:i=>m.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:I})]})})]})})}function zs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Fs(t){const e=X.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:c}=Mt();let u;return e[0]!==l||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o?(u=s.jsx(ts,{granted:n,loading:o,error:c,area:l,children:r}),e[0]=l,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function $s(){const t=X.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),c=vt();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=rt(u),{locator:d}=Ge(),T=Ke(),a=ot(),{customRoles:g,refetch:_}=Lt();let m;t[1]!==c?(m=j=>c({to:".",search:y=>({...y,role:j})}),t[1]=c,t[2]=m):m=t[2];const h=m;let O;e:{if(!f){O=null;break e}if(f==="new"){O={kind:"new"};break e}if(f.startsWith("builtin-")){O={kind:"builtin",role:f.slice(8)};break e}let j;t[3]!==f?(j=ee=>ee.id===f,t[3]=f,t[4]=j):j=t[4];const y=g.find(j);O=y?{kind:"custom",role:y}:null}const R=O;let p;t[5]!==d?(p=de.members(d),t[5]=d,t[6]=p):p=t[6];let C;t[7]!==T?(C=()=>T.organization.listMembers(),t[7]=T,t[8]=C):C=t[8];let A;t[9]!==p||t[10]!==C?(A={queryKey:p,queryFn:C},t[9]=p,t[10]=C,t[11]=A):A=t[11];const{data:M}=Ve(A);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const b=S;let D;t[14]!==b?(D=j=>b.filter(y=>y.role===j).length,t[14]=b,t[15]=D):D=t[15];const I=D;let N;if(t[16]!==g||t[17]!==I||t[18]!==l||t[19]!==e){let j;t[21]!==I||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:I(ce.role),label:e(ce.labelKey)}}),t[21]=I,t[22]=e,t[23]=j):j=t[23];const y=Qs.map(j);let ee;t[24]!==I?(ee=ce=>({kind:"custom",role:{...ce,memberCount:I(ce.role)}}),t[24]=I,t[25]=ee):ee=t[25];const Nt=g.map(ee);if(N=[...y,...Nt],l){const ce=l.toLowerCase();N=N.filter(Ot=>Ot.role.label.toLowerCase().includes(ce))}t[16]=g,t[17]=I,t[18]=l,t[19]=e,t[20]=N}else N=t[20];let P;t[26]!==T?(P=async j=>{const y=await T.organization.deleteRole({roleId:j});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=T,t[27]=P):P=t[27];const i=nt({mutationFn:P,onSuccess:(j,y)=>{Ye("role_deleted",{role_id:y}),a.invalidateQueries({queryKey:de.members(d)}),a.invalidateQueries({queryKey:de.organizationRoles(d)}),Ce.success(e("settings.roles.deletedSuccessfully")),_(),R?.kind==="custom"&&R.role.id===y&&h(void 0)},onError:Ws});let x;t[28]!==e?(x=e("settings.roles.columnRole"),t[28]=e,t[29]=x):x=t[29];let U;t[30]!==x?(U={id:"role",header:x,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=x,t[31]=U):U=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(be,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(be,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let v;t[36]!==G||t[37]!==Y?(v={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=v):v=t[38];let K;t[39]!==e?(K=e("settings.roles.columnPermissions"),t[39]=e,t[40]=K):K=t[40];let L;t[41]!==e?(L=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=j.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=L):L=t[42];let z;t[43]!==K||t[44]!==L?(z={id:"permissions",header:K,render:L,cellClassName:"flex-1 min-w-0"},t[43]=K,t[44]=L,t[45]=z):z=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let k;t[48]!==V?(k={id:"members",header:V,render:Zs,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=k):k=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:Hs,children:s.jsxs(kt,{variant:"destructive",onClick:()=>{const y=j.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==U||t[53]!==v||t[54]!==z||t[55]!==k||t[56]!==B?($=[U,v,z,k,B],t[52]=U,t[53]=v,t[54]=z,t[55]=k,t[56]=B,t[57]=$):$=t[57];const J=$;let te;t[58]!==h?(te=j=>{if(j.kind==="builtin")h(`builtin-${j.role.role}`);else{const y=j.role;h(y.id)}},t[58]=h,t[59]=te):te=t[59];const oe=te;if(R){let j;t[60]!==h?(j=()=>h(void 0),t[60]=h,t[61]=j):j=t[61];let y;return t[62]!==_||t[63]!==h?(y=()=>{_(),h(void 0)},t[62]=_,t[63]=h,t[64]=y):y=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:y},zs(R))}let F;t[65]!==e?(F=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=F):F=t[66];let W;t[67]===Symbol.for("react.memo_cache_sentinel")?(W=j=>{j.key==="Escape"&&(r(""),j.target.blur())},t[67]=W):W=t[67];let E;t[68]!==l||t[69]!==F?(E=s.jsx(ze,{value:l,onChange:r,placeholder:F,className:"w-full md:w-[375px]",onKeyDown:W}),t[68]=l,t[69]=F,t[70]=E):E=t[70];let w;t[71]!==h?(w=()=>h("new"),t[71]=h,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Be,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==E||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,se]}),t[79]=E,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(st,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(st,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let me;t[85]!==N||t[86]!==J||t[87]!==oe||t[88]!==ne?(me=s.jsx(Yt,{columns:J,data:N,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=N,t[86]=J,t[87]=oe,t[88]=ne,t[89]=me):me=t[89];const Ue=n!==null;let Le;t[90]===Symbol.for("react.memo_cache_sentinel")?(Le=j=>!j&&o(null),t[90]=Le):Le=t[90];let ue;t[91]!==e?(ue=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=ue):ue=t[92];let fe;t[93]!==ue?(fe=s.jsx(ut,{children:ue}),t[93]=ue,t[94]=fe):fe=t[94];const ke=n?.label??"";let ge;t[95]!==e||t[96]!==ke?(ge=e("settings.roles.deleteRoleConfirm",{role:ke}),t[95]=e,t[96]=ke,t[97]=ge):ge=t[97];let Te;t[98]!==ge?(Te=s.jsx(ft,{children:ge}),t[98]=ge,t[99]=Te):Te=t[99];let _e;t[100]!==fe||t[101]!==Te?(_e=s.jsxs(gt,{children:[fe,Te]}),t[100]=fe,t[101]=Te,t[102]=_e):_e=t[102];let he;t[103]!==e?(he=e("settings.roles.cancel"),t[103]=e,t[104]=he):he=t[104];let Ee;t[105]!==he?(Ee=s.jsx(Tt,{children:he}),t[105]=he,t[106]=Ee):Ee=t[106];let Ie;t[107]!==i||t[108]!==n?(Ie=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ie):Ie=t[109];let xe;t[110]!==e?(xe=e("settings.roles.delete"),t[110]=e,t[111]=xe):xe=t[111];let pe;t[112]!==Ie||t[113]!==xe?(pe=s.jsx(_t,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:xe}),t[112]=Ie,t[113]=xe,t[114]=pe):pe=t[114];let Re;t[115]!==Ee||t[116]!==pe?(Re=s.jsxs(ht,{children:[Ee,pe]}),t[115]=Ee,t[116]=pe,t[117]=Re):Re=t[117];let Se;t[118]!==_e||t[119]!==Re?(Se=s.jsxs(mt,{children:[_e,Re]}),t[118]=_e,t[119]=Re,t[120]=Se):Se=t[120];let Ae;t[121]!==Ue||t[122]!==Se?(Ae=s.jsx(dt,{open:Ue,onOpenChange:Le,children:Se}),t[121]=Ue,t[122]=Se,t[123]=Ae):Ae=t[123];let ye;return t[124]!==le||t[125]!==me||t[126]!==Ae?(ye=s.jsxs(at,{group:"members",className:"gap-6",children:[le,me,Ae]}),t[124]=le,t[125]=me,t[126]=Ae,t[127]=ye):ye=t[127],ye}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Zs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",ct(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(it,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ws(t,e){Ye("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Ce.error(t instanceof Error?t.message:"Failed to delete role")}function Xs(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=rt(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let c;t[5]!==r?(c=r?s.jsx(Ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(at,{group:"members",className:"gap-6",children:s.jsx(Dt,{})}),t[5]=r,t[6]=c):c=t[6];let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($s,{}),t[7]=u):u=t[7];let f;t[8]!==c?(f=s.jsx(Q.Suspense,{fallback:c,children:u}),t[8]=c,t[9]=f):f=t[9];let d;return t[10]!==o||t[11]!==f?(d=s.jsx(Pt,{fallback:o,children:f}),t[10]=o,t[11]=f,t[12]=d):d=t[12],d}function Ro(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{area:"roles",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{Ro as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as a,ah as t,ag as e,af as c,ak as d,ai as p,ao as m}from"./index-
|
|
1
|
+
import{ae as a,ah as t,ag as e,af as c,ak as d,ai as p,ao as m}from"./index-DIek05Ni.js";const s=500;a({title:e().max(s),url:e().max(s),icon:e().max(s)});a({registries:d(e().max(s),a({enabled:t()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:c(e().max(s)).describe("List of MCP app_name or app_id values to hide from the store.")});const i=a({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const _=a({tiers:a({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});a({tiers:a({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});a({ids:c(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const y=a({demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),cms_auto_fresh_branch:t().optional().describe("When a user opens the CMS on a branch whose last commit is older than the staleness window (2 days), move the session to a freshly minted branch cut from the default branch. The stale branch is left intact on GitHub. Off by default.")}),b=new Set(["reviewer_enabled","cheap_reviewer_model"]);function v(n,r){const h=n?.[r];return b.has(r)?h!==!1:h===!0}function w(n){const r=n?.auto_resolve_conflicts;return typeof r=="boolean"?r:n?.auto_merge===!0}const l=256*1024,u=50,o=500,f=5e3;a({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(f).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:a({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:a({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:c(d(e(),m())).max(u).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),m()).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{b as D,y as O,_ as S,w as a,v as o};
|