decocms 4.92.0 → 4.92.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BtNVN6lT.js → AlertCircle-Cvc_10Uv.js} +1 -1
- package/dist/client/assets/{AreaChart-G7ca0KYF.js → AreaChart-D4PMIsMV.js} +1 -1
- package/dist/client/assets/{ArrowUp-SfmKmvG1.js → ArrowUp-Dq6JgHsq.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DPmhEMyl.js → ArrowUpRight-DgI9ki5h.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dqg_7udX.js → CheckCircle-B5oIKeSF.js} +1 -1
- package/dist/client/assets/{ChevronDown-CtpYRw0N.js → ChevronDown-D_W2bIqv.js} +1 -1
- package/dist/client/assets/{ChevronRight-DQFD5vOs.js → ChevronRight-BnIvJcIZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-Bu3KYaYp.js → ChevronUp-Ci-XiWb6.js} +1 -1
- package/dist/client/assets/{Copy01-B4AQ9voq.js → Copy01-Q4xZmPKp.js} +1 -1
- package/dist/client/assets/{DotsVertical-4fMK5hdE.js → DotsVertical-Bcfqjiks.js} +1 -1
- package/dist/client/assets/{Eye-7UpR5EsV.js → Eye-BuukW7MV.js} +1 -1
- package/dist/client/assets/{FilterLines-jo0eHglf.js → FilterLines-Do4UgzmV.js} +1 -1
- package/dist/client/assets/{Globe01-BEuNOgWE.js → Globe01-qjaQZUfN.js} +1 -1
- package/dist/client/assets/{Globe04-ezZLp1FH.js → Globe04-CqIGMVDi.js} +1 -1
- package/dist/client/assets/{HardDrive-Bx0yMIUr.js → HardDrive-DrLvUMYg.js} +1 -1
- package/dist/client/assets/{Image01-BemfbeRy.js → Image01-BWotytID.js} +1 -1
- package/dist/client/assets/{Key01-wlopeCn8.js → Key01-BPZUhUcV.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DgCOjEX2.js → LayoutLeft-COV7zlIC.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DjHN0DVc.js → LinkExternal01-CyMOdGfe.js} +1 -1
- package/dist/client/assets/{Monitor01-CvVGHJ2u.js → Monitor01-dLHbd0CB.js} +1 -1
- package/dist/client/assets/{Package-Dkg7P-qU.js → Package-B7Qii2Tl.js} +1 -1
- package/dist/client/assets/{Palette-DnEGtR5r.js → Palette-tVNOj7Ym.js} +1 -1
- package/dist/client/assets/{Play-pFWdRfmo.js → Play-BE8nTtBp.js} +1 -1
- package/dist/client/assets/{Plus-BhgoGeba.js → Plus-5VWQJEkS.js} +1 -1
- package/dist/client/assets/{SearchLg-D7iDyCtR.js → SearchLg-BiyFAMx0.js} +1 -1
- package/dist/client/assets/{SearchMd-DU7sZsGX.js → SearchMd-LbMkvaPD.js} +1 -1
- package/dist/client/assets/{Settings02-Kn3GUgY3.js → Settings02-CU2rilKq.js} +1 -1
- package/dist/client/assets/{Shield01-BF7nZR91.js → Shield01-7KT2UKvg.js} +1 -1
- package/dist/client/assets/{Star01-UbWAuLRP.js → Star01-D4LxiizA.js} +1 -1
- package/dist/client/assets/{Stars01-CKHcD24W.js → Stars01-HAbkffzq.js} +1 -1
- package/dist/client/assets/{Stars02-ByALJtc-.js → Stars02-CdgckoDr.js} +1 -1
- package/dist/client/assets/{Sun-ERdj2Ruh.js → Sun-Ca3eslhz.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B2hcs1rw.js → SwitchHorizontal01-DNcPUv7P.js} +1 -1
- package/dist/client/assets/{Tool01-DoTp9Ymb.js → Tool01-DBXzU6aR.js} +1 -1
- package/dist/client/assets/{Tool02-f6hCEEx5.js → Tool02-rl8XhSPG.js} +1 -1
- package/dist/client/assets/{Trash01-Dgm4FHaX.js → Trash01-DxXosbkh.js} +1 -1
- package/dist/client/assets/{TrendUp01-DdLolkHU.js → TrendUp01-BmzCTIbp.js} +1 -1
- package/dist/client/assets/{Upload01-DPgiWRF2.js → Upload01-CXsTipbe.js} +1 -1
- package/dist/client/assets/{User01-4oxhkWpc.js → User01-CZgThaZQ.js} +1 -1
- package/dist/client/assets/{Users01-CbDWoQDz.js → Users01-IdyAszrF.js} +1 -1
- package/dist/client/assets/{Users03-DQDFsIZA.js → Users03-3HXi1aia.js} +1 -1
- package/dist/client/assets/{X-BJznV24Z.js → X-CLG08ht8.js} +1 -1
- package/dist/client/assets/{XCircle-Mn7Ozb-Q.js → XCircle-pZ6nD22L.js} +1 -1
- package/dist/client/assets/{XClose-BYGQndp2.js → XClose-BYq2BBpT.js} +1 -1
- package/dist/client/assets/{Zap-SMAt3bB0.js → Zap-C6tkfs5m.js} +1 -1
- package/dist/client/assets/{ZapSquare-Chem9D1s.js → ZapSquare-DdKvM81Z.js} +1 -1
- package/dist/client/assets/{ZoomOut-znim4joS.js → ZoomOut-DAAhtu2Z.js} +1 -1
- package/dist/client/assets/{access-gate-CXUaT8Bg.js → access-gate-B8spscer.js} +1 -1
- package/dist/client/assets/add-section-modal-De0GxBTc.js +1 -0
- package/dist/client/assets/agent-icon-BIj6WxKp.js +1 -0
- package/dist/client/assets/{agents-list-CxMjWnYV.js → agents-list-Cc-986WT.js} +1 -1
- package/dist/client/assets/{ai-providers-V_ToPNx9.js → ai-providers-Ck_-NP1I.js} +1 -1
- package/dist/client/assets/{alert-DCHONWz2.js → alert-CI7flGPF.js} +1 -1
- package/dist/client/assets/{alert-dialog-9jx8jzEO.js → alert-dialog-D2oa47X8.js} +1 -1
- package/dist/client/assets/{app-editor-B5Y1RFnh.js → app-editor-Cn-tT-ug.js} +1 -1
- package/dist/client/assets/{auth-wA89jw5z.js → auth-Kymy4xkz.js} +1 -1
- package/dist/client/assets/{auth-catchall-gpLRqkDV.js → auth-catchall-B0gQyYvu.js} +1 -1
- package/dist/client/assets/{auth-entry-ByL0Zb6R.js → auth-entry-Crrd0hkP.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BoMjBMXD.js → auth-split-layout-BO4l9cCp.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CO2Dkq5Q.js → authenticate-and-persist-oauth-DAAmwSgR.js} +1 -1
- package/dist/client/assets/{automation-list-row-CZVotwYb.js → automation-list-row-D-cT9rxb.js} +1 -1
- package/dist/client/assets/{automation-runs-oeg4SZH2.js → automation-runs-_XAGR1m2.js} +1 -1
- package/dist/client/assets/{automations-kL1ULwau.js → automations-Bh1OF4xf.js} +1 -1
- package/dist/client/assets/{autosend-DFAdUSMh.js → autosend-D-JHJKNK.js} +1 -1
- package/dist/client/assets/{avatar-D2faXu9B.js → avatar-1o2VQKTj.js} +1 -1
- package/dist/client/assets/{badge-C22fJvJ9.js → badge-dHBIjKyY.js} +1 -1
- package/dist/client/assets/{block-document-F7Fz2w43.js → block-document-nemKITlN.js} +1 -1
- package/dist/client/assets/{brand-context-CwktNs2n.js → brand-context-DSZ7O9_c.js} +1 -1
- package/dist/client/assets/{buckets-BqmVHHty.js → buckets-BDkQllTH.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DEnhQv4x.js → bulk-category-panel-Cn58Io0u.js} +1 -1
- package/dist/client/assets/{calendar-C55pfZGp.js → calendar-C9b1I5Xh.js} +1 -1
- package/dist/client/assets/{capability-load-error-D-GHd7kt.js → capability-load-error-DI4Ww9LY.js} +1 -1
- package/dist/client/assets/{card-BZY4DqkC.js → card-CoG27DVs.js} +1 -1
- package/dist/client/assets/category-editor-BmpcIx1s.js +1 -0
- package/dist/client/assets/{chat-context-8zti4wkh.js → chat-context-glCfFIWX.js} +1 -1
- package/dist/client/assets/{checkbox-DvRekaoI.js → checkbox-BOAToSlJ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BwJqzavM.js → cli-auth-success-CqzQrYb8.js} +1 -1
- package/dist/client/assets/collection-detail-I0O1ME9a.js +1 -0
- package/dist/client/assets/{collection-display-button-Su2JKz2G.js → collection-display-button-Bw2bFMNm.js} +1 -1
- package/dist/client/assets/{collection-search-B4ji9AjC.js → collection-search-DuPY-s4R.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DhT1Pcxz.js → collection-table-wrapper-BOKHq7cp.js} +1 -1
- package/dist/client/assets/{collection-tabs-DTWzD8v3.js → collection-tabs-CcN3J070.js} +1 -1
- package/dist/client/assets/{command-BeMVvNyF.js → command-BB6Oir8o.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-wd060R0w.js → commerce-onboarding-DejhsIyX.js} +1 -1
- package/dist/client/assets/{companions-core-D6ZCzGBn.js → companions-core-C-kZqiTC.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-ekgjUng_.js → connect-desktop-dialog-CUGIAU17.js} +1 -1
- package/dist/client/assets/{connection-card-7Jlr5ou8.js → connection-card-7gBTmFox.js} +1 -1
- package/dist/client/assets/{connection-detail-CVc89tOZ.js → connection-detail-BB0rtYjx.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BT4sViBb.js → connection-form-helpers-CJKig9hy.js} +1 -1
- package/dist/client/assets/{connections-U8gRLumN.js → connections-E7mextbc.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-us-M5mS8.js → decopilot-sse-pool-DEJZ4gJu.js} +1 -1
- package/dist/client/assets/{dialog-B_MtszrV.js → dialog-ChJw5xnr.js} +1 -1
- package/dist/client/assets/{domain-settings-C_FTyjE2.js → domain-settings-B6Co6UtW.js} +1 -1
- package/dist/client/assets/{drawer-BsQ2VY2t.js → drawer-_WfOhyRU.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CCf9b-Ue.js → dropdown-menu-B7HOgSu8.js} +1 -1
- package/dist/client/assets/{empty-state-uOmVY7AV.js → empty-state-kSEyPCAz.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B1PMDhhA.js → extract-connection-data-oUFnwuwD.js} +1 -1
- package/dist/client/assets/{file-explorer-Cq-sGwnZ.js → file-explorer-CnTvRnvj.js} +1 -1
- package/dist/client/assets/{file-type-icon-DLDSmTyC.js → file-type-icon-CeQVzqDu.js} +1 -1
- package/dist/client/assets/{files-CCiFVnRx.js → files-CCxNqj9u.js} +1 -1
- package/dist/client/assets/{form-CBH5rcB6.js → form-BUM27CLj.js} +1 -1
- package/dist/client/assets/{general-DnViTnDI.js → general-BjF2DfAd.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DWdab-4Y.js → github-repo-picker-4TIPzYjR.js} +1 -1
- package/dist/client/assets/{hooks-CQZHp8Dt.js → hooks-CJqrF4BQ.js} +1 -1
- package/dist/client/assets/{index-BfunopXO.js → index-BHqz24vm.js} +1 -1
- package/dist/client/assets/index-B_qFi_-_.js +519 -0
- package/dist/client/assets/{index-CodlhltM.js → index-BderZvBT.js} +1 -1
- package/dist/client/assets/{index-F-zmfSqw.js → index-Bj_MaVUP.js} +1 -1
- package/dist/client/assets/{index-QeeIyPD-.js → index-C8rlFaFO.js} +3 -3
- package/dist/client/assets/{index-d_66hXvz.js → index-CHWLrEqX.js} +1 -1
- package/dist/client/assets/{index-CmemNDJU.js → index-CQwS9Ezr.js} +1 -1
- package/dist/client/assets/{index-DWmvNX0u.js → index-CR0rMz7E.js} +1 -1
- package/dist/client/assets/{index-C1alCXBf.js → index-CWGwstEz.js} +3 -3
- package/dist/client/assets/{index-CAK7n_FO.js → index-CWlzI7M3.js} +2 -2
- package/dist/client/assets/{index-hhU2F3WQ.js → index-D6ixbRYa.js} +1 -1
- package/dist/client/assets/{index-DWS4NoqH.js → index-DVotD2Sm.js} +1 -1
- package/dist/client/assets/{index-B-kvMeNd.js → index-DyXd0E61.js} +1 -1
- package/dist/client/assets/{index-C_AuPrej.js → index-WDnleR3r.js} +1 -1
- package/dist/client/assets/{index-redirect-BRH-3ZCu.js → index-redirect-CZuVtK8Y.js} +1 -1
- package/dist/client/assets/{input-ksjqlSwm.js → input-CWExGH7j.js} +1 -1
- package/dist/client/assets/{integration-icon-nHJfLZDJ.js → integration-icon-BXEpLE2r.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-C6cxYu7U.js → invite-member-dialog-Cj35CA_W.js} +1 -1
- package/dist/client/assets/{label-B8xrTNKP.js → label-BbLr7wPS.js} +1 -1
- package/dist/client/assets/{layout-BJDwPfq0.js → layout-yKsHfaYu.js} +1 -1
- package/dist/client/assets/{login-DlJSNcQs.js → login-g6Yf2A86.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C_zNkYXB.js → mcp-oauth-B2KaqQoI.js} +1 -1
- package/dist/client/assets/{members-BM7Uqu1Q.js → members-yX31omZQ.js} +1 -1
- package/dist/client/assets/{monaco-editor-CAwKA7tN.js → monaco-editor-CJKnQM68.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CC7F0Phb.js → monitoring-stats-row-DTqvYy56.js} +1 -1
- package/dist/client/assets/{multi-select-5dvonfKB.js → multi-select-C9lH7lr4.js} +1 -1
- package/dist/client/assets/{oauth-callback-8qeP_w61.js → oauth-callback-DPu8Jv31.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BmIt9KYD.js → oauth-callback-ai-provider-DXhgROtl.js} +1 -1
- package/dist/client/assets/{onboarding-Cg0DtUJd.js → onboarding-b8UESLyK.js} +1 -1
- package/dist/client/assets/{org-install-CTi6z1kk.js → org-install-DFTAzRMO.js} +1 -1
- package/dist/client/assets/{org-layout-tdajFZ6u.js → org-layout-BbjFIQ-M.js} +1 -1
- package/dist/client/assets/{organization-choice-GMUL1NeO.js → organization-choice-DjVV9MCZ.js} +1 -1
- package/dist/client/assets/{orgs-6ZiXdiJ2.js → orgs-B1jGApXW.js} +1 -1
- package/dist/client/assets/{page-seo-form-CGZUz0ph.js → page-seo-form-DeD_2a8R.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BWnl0tVz.js +1 -0
- package/dist/client/assets/{popover-3l0deoOx.js → popover-kOy_asOa.js} +1 -1
- package/dist/client/assets/post-editor-BZQdhdwo.js +1 -0
- package/dist/client/assets/{primitives-DGvfP5N2.js → primitives-Cyz_TV23.js} +1 -1
- package/dist/client/assets/{profile-BjX7gD7e.js → profile-D5HUGTyF.js} +1 -1
- package/dist/client/assets/project-app-view-Bsaa-6LK.js +1 -0
- package/dist/client/assets/record-editor-Bjgurgfp.js +1 -0
- package/dist/client/assets/redirect-editor-DnT7ef0C.js +1 -0
- package/dist/client/assets/registry-DHjmo34d.js +2 -0
- package/dist/client/assets/{registry-layout-50Nc58LU.js → registry-layout-JPmaR-tb.js} +1 -1
- package/dist/client/assets/{reports-CMuw_Eim.js → reports-Btc-1oN-.js} +1 -1
- package/dist/client/assets/{require-capability-BMCPfqFj.js → require-capability-BBszzyH9.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BON6U2A_.js → required-auth-layout-CR5_YK6W.js} +1 -1
- package/dist/client/assets/{reset-password-CuQp3WxW.js → reset-password-u9Nbv0bS.js} +1 -1
- package/dist/client/assets/{roles-flCogJRV.js → roles-B7bUsR2h.js} +1 -1
- package/dist/client/assets/{search-input-UOEApV9M.js → search-input-B6akQV4Y.js} +1 -1
- package/dist/client/assets/{secrets-CUe-abV1.js → secrets-Dsj3iy5H.js} +1 -1
- package/dist/client/assets/sections-editor-CvIj0bPs.js +2 -0
- package/dist/client/assets/{select-BK6Fwx47.js → select-4-vdHbLT.js} +1 -1
- package/dist/client/assets/{select-model-FeZ2YvBx.js → select-model-CVcEVUsi.js} +1 -1
- package/dist/client/assets/{self-tool-result-BblMArR-.js → self-tool-result-Cwdk21K_.js} +1 -1
- package/dist/client/assets/{seo-editor-D48-7A97.js → seo-editor-B0_qMHl0.js} +1 -1
- package/dist/client/assets/{settings-layout-DEiZmbv4.js → settings-layout-BURikhtl.js} +1 -1
- package/dist/client/assets/{settings-section--wnksRdd.js → settings-section-DxqR9iml.js} +1 -1
- package/dist/client/assets/{shell-controls-6ZpSpxU3.js → shell-controls-DYq3DSuV.js} +1 -1
- package/dist/client/assets/{shell-layout-CGSn6NPr.js → shell-layout-DvMdeukx.js} +1 -1
- package/dist/client/assets/{sidebar-BjCGlNJL.js → sidebar-AfeWMY1r.js} +1 -1
- package/dist/client/assets/{skeleton-4wAys1SB.js → skeleton-DraYvTQP.js} +1 -1
- package/dist/client/assets/{sso-C8y4ysn5.js → sso-DWBNvY6X.js} +1 -1
- package/dist/client/assets/{store-EbX-J8BD.js → store-BFhYLhoT.js} +1 -1
- package/dist/client/assets/store-registry-C50_5LUp.js +2 -0
- package/dist/client/assets/{studio-tools-Dz5m3DDC.js → studio-tools-B3FHZXsQ.js} +1 -1
- package/dist/client/assets/{switch-BGTwAogo.js → switch-CyZjNvfZ.js} +1 -1
- package/dist/client/assets/{table-FWVzL2nm.js → table-iG6kCmeS.js} +1 -1
- package/dist/client/assets/{tabs-BovIXRni.js → tabs-C1LpzuaJ.js} +1 -1
- package/dist/client/assets/{textarea-B0BnrQRd.js → textarea-B8dhUfp9.js} +1 -1
- package/dist/client/assets/{toggle-group-DvzPCkJs.js → toggle-group-c5TjS6xS.js} +1 -1
- package/dist/client/assets/{toolbar-Dde3UP0K.js → toolbar-Daz4jqLs.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BGzii147.js → toolbar-icon-button-Bbbo7hyv.js} +1 -1
- package/dist/client/assets/{tooltip-CfmdP-aL.js → tooltip-DE_gqCm3.js} +1 -1
- package/dist/client/assets/{use-ai-providers-UWnZZKKY.js → use-ai-providers-CGzSWtp7.js} +1 -1
- package/dist/client/assets/{use-automations-URCauyn7.js → use-automations-Btiu7Z09.js} +1 -1
- package/dist/client/assets/{use-autosave-BjhwOY2t.js → use-autosave-DphOvxb9.js} +1 -1
- package/dist/client/assets/{use-capability-B2RpFGXs.js → use-capability-BNcFOggs.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CI9n9Iqh.js → use-clock-tick-Dw7sAB29.js} +1 -1
- package/dist/client/assets/{use-collections-CI5XorIY.js → use-collections-u5tkBX1a.js} +1 -1
- package/dist/client/assets/{use-connection-BlWYloF8.js → use-connection-CcmTBTY-.js} +1 -1
- package/dist/client/assets/{use-copy-CCSClSvL.js → use-copy-CveeH2p4.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D97QNssr.js → use-create-virtual-mcp-jvSmQNTU.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DbO1S1EK.js → use-debounced-autosave-DFle-8Sb.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DuzsGBjb.js → use-debounced-value-D1xFGN32.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Bov6Ef1l.js → use-deco-credits-CV7sw9Em.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CqSDZlRU.js → use-decopilot-events-VInARyiN.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B_AyED2-.js → use-delete-connection-DDV7XY4a.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CSBPrawc.js → use-deployment-admin-h9tth1Ey.js} +1 -1
- package/dist/client/assets/{use-file-configs-BsBJamST.js → use-file-configs-BEHJ-b8Q.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Cylb4hyl.js → use-infinite-scroll-BI8YTyTt.js} +1 -1
- package/dist/client/assets/{use-join-requests-Cy4mJo9l.js → use-join-requests-V5rMqfIc.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D-mrOgSF.js → use-mcp-auth-status-DINFEYgi.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DXFWWHbs.js → use-mcp-client-PcphUWIj.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-ePfAnuof.js → use-mcp-tools-CakNulXp.js} +1 -1
- package/dist/client/assets/{use-members-C1OZBryu.js → use-members-JooO5O_z.js} +1 -1
- package/dist/client/assets/{use-mobile-CEVETdVq.js → use-mobile-C57pT7o9.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CflMFlHw.js → use-navigate-to-agent-DVHUkqpb.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BFFpNQiA.js → use-org-auth-client-C0qPMRhc.js} +1 -1
- package/dist/client/assets/{use-org-sso-QrZAqFtN.js → use-org-sso-BaYh30WC.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CYJSylgX.js → use-organization-roles-BG6jMK7e.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BpxUnud5.js → use-organization-settings-DBhnNnJm.js} +1 -1
- package/dist/client/assets/{use-registry-app-CkuNrX2M.js → use-registry-app-Dyfesgrg.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DWBXDDYI.js → use-registry-connections-CTtHQqlB.js} +1 -1
- package/dist/client/assets/{use-secrets-C8ssS7Ik.js → use-secrets-BYzFSfMf.js} +1 -1
- package/dist/client/assets/{use-status-sounds-2UIUBUS4.js → use-status-sounds-DJxvpKl9.js} +1 -1
- package/dist/client/assets/{use-t-BKpqHjpb.js → use-t-BeHordU2.js} +1 -1
- package/dist/client/assets/{use-view-mode-BEQ3VoIc.js → use-view-mode-C0yNdLzJ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D9jFTGjm.js → use-virtual-mcp-BtFe5DoR.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-mNPfD3Pk.js +1 -0
- package/dist/client/assets/{useRouterState-d9mo2HNv.js → useRouterState-C6jzqArr.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DIVSilzv.js +1 -0
- package/dist/client/assets/{users-B6WaBMxE.js → users-C0dY9LVq.js} +1 -1
- package/dist/client/assets/{variant-calendar-D4S-Oofs.js → variant-calendar-FpbApEV2.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CQ-IPomp.js → view-mode-toggle-DwdmtuKb.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-Bu0jJfTp.js +0 -1
- package/dist/client/assets/agent-icon-CMi9hXve.js +0 -1
- package/dist/client/assets/category-editor-DZf03BWu.js +0 -1
- package/dist/client/assets/collection-detail-BCNd0Ifz.js +0 -1
- package/dist/client/assets/index-D_TDrkT8.js +0 -519
- package/dist/client/assets/page-seo-sheet-DB06C8Zh.js +0 -1
- package/dist/client/assets/post-editor-Cf2q6koS.js +0 -1
- package/dist/client/assets/project-app-view-CInCPGOf.js +0 -1
- package/dist/client/assets/record-editor-C1rBRosQ.js +0 -1
- package/dist/client/assets/redirect-editor-DH3saw4e.js +0 -1
- package/dist/client/assets/registry-BIMV2dS4.js +0 -2
- package/dist/client/assets/sections-editor-BCCsHWJ1.js +0 -2
- package/dist/client/assets/store-registry-C4UWjh6m.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DvViU0Gq.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-COT_NVJE.js +0 -1
package/dist/client/assets/{require-capability-BMCPfqFj.js → require-capability-BBszzyH9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as m}from"./index-
|
|
1
|
+
import{c as p,j as m}from"./index-C8rlFaFO.js";import{u as l}from"./use-capability-BNcFOggs.js";import{A as u}from"./access-gate-B8spscer.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
|
package/dist/client/assets/{required-auth-layout-BON6U2A_.js → required-auth-layout-CR5_YK6W.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,j as s,A as a,S as m,f as h,h as u,N as f}from"./index-
|
|
1
|
+
import{c as l,j as s,A as a,S as m,f as h,h as u,N as f}from"./index-C8rlFaFO.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(f,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function g(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{g as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as q,u as Y,b as A,r as B,d as G,j as s,B as z,a as K}from"./index-
|
|
1
|
+
import{c as q,u as Y,b as A,r as B,d as G,j as s,B as z,a as K}from"./index-C8rlFaFO.js";import{I as L}from"./input-CWExGH7j.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let g;e[22]!==a||e[23]!==t?(g=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=g):g=e[24];let f;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(f=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=f):f=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==g||e[42]!==f||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,g,f,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=g,e[42]=f,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as K,C as Be,K as de,b4 as Ot,m as Fe,j as s,l as Z,i as je,B as ae,c as X,H as Je,ad as Ue,I as re,af as Xe,ag as et,n as rt,M as jt,J as vt,d as at,t as ve,p as Ke,w as ct,x as Mt,E as Dt,b as yt,u as wt}from"./index-QeeIyPD-.js";import{u as Pt}from"./use-organization-roles-CYJSylgX.js";import{u as $e}from"./use-org-auth-client-BFFpNQiA.js";import{u as ie}from"./use-t-BKpqHjpb.js";import{g as dt,a as Lt}from"./role-color-Dn2tXDDF.js";import{B as Me}from"./badge-C22fJvJ9.js";import{f as mt,a as ut,c as ft,d as gt,b as ht,A as xt,g as pt,e as Tt}from"./alert-dialog-9jx8jzEO.js";import{D as kt,a as Gt,c as Ut,d as Bt}from"./dropdown-menu-CCf9b-Ue.js";import{i as Vt}from"./DotsVertical-4fMK5hdE.js";import{s as Ye}from"./Plus-BhgoGeba.js";import{s as zt}from"./Trash01-Dgm4FHaX.js";import{C as Yt}from"./collection-table-wrapper-DhT1Pcxz.js";import{P as ne}from"./index-F-zmfSqw.js";import{E as tt}from"./empty-state-uOmVY7AV.js";import{S as Qe}from"./search-input-UOEApV9M.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as He}from"./integration-icon-nHJfLZDJ.js";import{u as Ft}from"./use-infinite-scroll-Cylb4hyl.js";import{C as qe}from"./checkbox-DvRekaoI.js";import{b as Kt}from"./Settings02-Kn3GUgY3.js";import{u as $t}from"./useSuspenseInfiniteQuery-COT_NVJE.js";import{u as Qt,S as Ht}from"./use-mcp-client-DXFWWHbs.js";import{C as qt}from"./collection-search-B4ji9AjC.js";import{a as _t}from"./use-members-C1OZBryu.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-BlWYloF8.js";import{u as Wt,c as Jt}from"./use-ai-providers-UWnZZKKY.js";import{A as bt}from"./avatar-D2faXu9B.js";import{S as De}from"./switch-BGTwAogo.js";import{c as ye,b as we,T as Pe,a as Le}from"./tooltip-CfmdP-aL.js";import{S as st,a as lt,b as ot}from"./settings-section--wnksRdd.js";import{t as Xt}from"./ChevronDown-CtpYRw0N.js";import{i as es}from"./ChevronRight-DQFD5vOs.js";import{i as nt}from"./X-BJznV24Z.js";import{a as ts}from"./use-capability-B2RpFGXs.js";import{A as ss}from"./access-gate-CXUaT8Bg.js";import"./ChevronUp-Bu3KYaYp.js";import"./table-FWVzL2nm.js";import"./ArrowUp-SfmKmvG1.js";import"./sidebar-BjCGlNJL.js";import"./LayoutLeft-DgCOjEX2.js";import"./use-mobile-CEVETdVq.js";import"./SearchMd-DU7sZsGX.js";import"./Tool02-f6hCEEx5.js";import"./agent-icon-CMi9hXve.js";import"./AlertCircle-BtNVN6lT.js";import"./Tool01-DoTp9Ymb.js";import"./XCircle-Mn7Ozb-Q.js";import"./ArrowUpRight-DPmhEMyl.js";import"./TrendUp01-DdLolkHU.js";import"./ZapSquare-Chem9D1s.js";import"./ZoomOut-znim4joS.js";import"./Users03-DQDFsIZA.js";import"./CheckCircle-Dqg_7udX.js";import"./Stars02-ByALJtc-.js";import"./Copy01-B4AQ9voq.js";import"./Globe01-BEuNOgWE.js";import"./Eye-7UpR5EsV.js";import"./FilterLines-jo0eHglf.js";import"./Star01-UbWAuLRP.js";import"./Globe04-ezZLp1FH.js";import"./SwitchHorizontal01-B2hcs1rw.js";import"./HardDrive-Bx0yMIUr.js";import"./Image01-BemfbeRy.js";import"./Key01-wlopeCn8.js";import"./LinkExternal01-DjHN0DVc.js";import"./Monitor01-CvVGHJ2u.js";import"./Sun-ERdj2Ruh.js";import"./Package-Dkg7P-qU.js";import"./Palette-DnEGtR5r.js";import"./Play-pFWdRfmo.js";import"./SearchLg-D7iDyCtR.js";import"./Shield01-BF7nZR91.js";import"./Stars01-CKHcD24W.js";import"./Upload01-DPgiWRF2.js";import"./User01-4oxhkWpc.js";import"./Users01-CbDWoQDz.js";import"./XClose-BYGQndp2.js";import"./Zap-SMAt3bB0.js";import"./auth-wA89jw5z.js";import"./use-collections-CI5XorIY.js";import"./studio-tools-Dz5m3DDC.js";import"./card-BZY4DqkC.js";import"./capability-load-error-D-GHd7kt.js";const Ze="basic-usage",We=[{id:Ze,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...We.find(t=>t.id===Ze)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(We.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of We){if(e.id===Ze)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const r=new Set(e);for(const o of t.tools)r.add(o);return Array.from(r)}const n=new Set(e);for(const r of t.tools)n.delete(r);return Array.from(n)}function rs(t){const e=X.c(21),{connection:l,isSelected:n,hasToolsEnabled:r,activeToolsCount:o,totalToolsCount:c,onSelect:x,onToggle:m}=t,f=n?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==f?(g=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",f),e[0]=f,e[1]=g):g=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(He,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=u):u=e[6];let h;e[7]!==x||e[8]!==a||e[9]!==u?(h=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:x,children:[a,u]}),e[7]=x,e[8]=a,e[9]=u,e[10]=h):h=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==r||e[14]!==m||e[15]!==c?(d=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(qe,{checked:r,onCheckedChange:m,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=r,e[14]=m,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==g||e[18]!==h||e[19]!==d?(p=s.jsxs("div",{className:g,children:[h,d]}),e[17]=g,e[18]=h,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=X.c(18),{connectionId:l,tool:n,isSelected:r,onToggle:o}=t,c=`tool-${l}-${n.name}`,x=r?"text-foreground":"text-muted-foreground";let m;e[0]!==x?(m=Z("text-sm font-medium",x),e[0]=x,e[1]=m):m=e[1];let f;e[2]!==m||e[3]!==n.name?(f=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:n.name})}),e[2]=m,e[3]=n.name,e[4]=f):f=e[4];let g;e[5]!==n.description?(g=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=g):g=e[6];let a;e[7]!==f||e[8]!==g?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[7]=f,e[8]=g,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let h;e[10]!==r||e[11]!==o||e[12]!==u?(h=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(qe,{id:u,checked:r,onCheckedChange:o,onClick:ds})}),e[10]=r,e[11]=o,e[12]=u,e[13]=h):h=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==h?(d=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,h]}),e[14]=c,e[15]=a,e[16]=h,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const[r,o]=K.useState(""),c=n!==void 0?n:r,x=K.useDeferredValue(c),[m,f]=K.useState("all"),[g,a]=K.useState(!1),u=K.useRef(new Set(Object.keys(t))),{org:h}=Be(),d=Qt({connectionId:Ht,orgId:h.id,orgSlug:h.slug}),p=100,S=x.trim(),R=S?{operator:"or",conditions:[{field:["title"],operator:"contains",value:S},{field:["description"],operator:"contains",value:S}]}:void 0,_=!!l,A={...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:p,offset:0,..._&&{include_virtual:!0}},N=JSON.stringify(A),{data:D,fetchNextPage:b,hasNextPage:O,isFetchingNextPage:v}=$t({queryKey:de.collectionListInfinite(d,h.id,"","CONNECTIONS",N),queryFn:async({pageParam:T=0})=>(await d.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:p,offset:T,..._&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,M)=>{if(T?.hasMore)return M.reduce((H,Q)=>H+(Q?.items?.length??0),0)},staleTime:3e4}),E=D?.pages.flatMap(T=>T?.items??[])??[],C=Ft(b,O??!1,v),y=l?E.filter(T=>T.connection_type!=="VIRTUAL"?!0:Ot(T.connection_url)!==l):E,i=u.current,I=[...i.values()].map(T=>y.find(M=>M.id===T)).filter(T=>T!==void 0),B=y.filter(T=>!i.has(T.id)),L=[...I,...B],Y=T=>{const M=t[T];return M!==void 0&&M.length>0},w=L.filter(T=>{if(m==="all")return!0;const M=Y(T.id);return m==="selected"?M:m==="unselected"?!M:!0}),[U,z]=K.useState(L[0]?.id??null),k=U?L.find(T=>T.id===U)??null:null,{data:$,isFetching:V}=Fe({queryKey:de.collectionItem(d,h.id,"","CONNECTIONS",U??""),queryFn:async()=>U?(await d.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:U}})).structuredContent?.item??null:null,enabled:!!U,staleTime:3e4}),G=$?.tools??[],q=(T,M)=>t[T]?.includes(M)??!1,W=(T,M)=>{const H=t[T]??[],Q=H.includes(M),J={...t};if(Q){const oe=H.filter(le=>le!==M);oe.length===0?delete J[T]:J[T]=oe}else J[T]=[...H,M];e(J)},te=T=>{const M=T===U?G:[];if(!M.length)return;const H=t[T]??[],Q=M.map(le=>le.name),J=H.length>0&&Q.every(le=>H.includes(le)),oe={...t};J?delete oe[T]:(oe[T]=Q,z(T)),e(oe)},se=T=>{z(T),a(!0)},F=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",g&&"hidden md:flex"),children:[n===void 0&&s.jsx(qt,{value:r,onChange:o,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>f("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>f("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:c?"No connections found":m==="selected"?"No servers selected":m==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[w.map(T=>{const M=U===T.id,H=M?G.length:0,Q=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:M?G:T.tools},isSelected:M,hasToolsEnabled:Y(T.id),activeToolsCount:Q,totalToolsCount:H,onSelect:()=>se(T.id),onToggle:()=>te(T.id)},T.id)}),s.jsx("div",{ref:C,className:"h-4"}),v&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",g?"flex":"hidden md:flex"),children:k?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Kt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(He,{icon:k.icon,name:k.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:k.title}),k.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:k.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:V?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})}):G.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:G.map(T=>s.jsx(cs,{connectionId:k.id,tool:T,isSelected:q(k.id,T.name),onToggle:()=>W(k.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const us=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:et(),staticPermissions:Ue(re()),toolSet:Xe(re(),Ue(re())),allowAllModels:et(),modelSet:Xe(re(),Ue(re())),memberIds:Ue(re())});function it(t,e,l){const n=ie(),r=s.jsx(De,{checked:t,disabled:e,onCheckedChange:l});return e?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:r})}),s.jsx(Le,{children:s.jsx("p",{children:n("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):r}function fs(t){const e=X.c(40),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:r,onPermissionsChange:o,readOnly:c,searchQuery:x}=t,m=c===void 0?!1:c,f=ie();let g;e[0]!==x?(g=x.trim().toLowerCase(),e[0]=x,e[1]=g):g=e[1];const a=K.useDeferredValue(g);let u;if(e[2]!==l||e[3]!==a||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==x||e[8]!==n||e[9]!==f){const h=os(),d=(E,C)=>{if(!m){if(l&&C){const y=h.flatMap(xs).flatMap(hs);r(!1),o(y.filter(i=>!E.tools.includes(i)));return}l||o(is(E,n,!C))}};let p;e[11]!==a?(p=E=>{const{section:C,capabilities:y}=E;return{section:C,capabilities:y.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const S=h.map(p).filter(gs);let R;e[13]!==f?(R=f("settings.orgRoleDetail.general"),e[13]=f,e[14]=R):R=e[14];let _;e[15]!==f?(_=f("settings.orgRoleDetail.allOrgPermissions"),e[15]=f,e[16]=_):_=e[16];let A;e[17]!==f?(A=f("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=f,e[18]=A):A=e[18];let N;e[19]!==l||e[20]!==r||e[21]!==o?(N=()=>{r(!l),o([])},e[19]=l,e[20]=r,e[21]=o,e[22]=N):N=e[22];let D;e[23]!==l||e[24]!==m||e[25]!==N?(D=it(l,m,N),e[23]=l,e[24]=m,e[25]=N,e[26]=D):D=e[26];let b;e[27]!==l||e[28]!==r||e[29]!==o||e[30]!==m?(b=m?void 0:()=>{r(!l),o([])},e[27]=l,e[28]=r,e[29]=o,e[30]=m,e[31]=b):b=e[31];let O;e[32]!==b||e[33]!==_||e[34]!==A||e[35]!==D?(O=s.jsx(lt,{children:s.jsx(ot,{title:_,description:A,action:D,onClick:b})}),e[32]=b,e[33]=_,e[34]=A,e[35]=D,e[36]=O):O=e[36];let v;e[37]!==O||e[38]!==R?(v=s.jsx(st,{title:R,children:O}),e[37]=O,e[38]=R,e[39]=v):v=e[39],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[v,S.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:f("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:x})}):S.map(E=>{const{section:C,capabilities:y}=E;return s.jsx(st,{title:C,children:s.jsx(lt,{children:y.map(i=>{const I=ns(i,n,l);return s.jsx(ot,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(Mt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:it(I,m,()=>d(i,I)),onClick:m?void 0:()=>d(i,I)},i.id)})})},C)})]})}),e[2]=l,e[3]=a,e[4]=r,e[5]=o,e[6]=m,e[7]=x,e[8]=n,e[9]=f,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Es(t){return ps[t]??Nt[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function _s(t){const e=X.c(40),{connectionId:l,subProviderId:n,subProviderName:r,groupLogo:o,models:c,allConnectionModelIds:x,selectedModels:m,allowAllModels:f,allConnectionModelsSelected:g,onToggleModel:a,onExitAllowAll:u,readOnly:h,defaultExpanded:d}=t,p=ie(),[S,R]=K.useState(d),_=d||S,A=R,[N,D]=K.useState(Ct);let b;e[0]!==g||e[1]!==f||e[2]!==m?(b=E=>f||g||m.includes("*")||m.includes(E),e[0]=g,e[1]=f,e[2]=m,e[3]=b):b=e[3];const O=b;let v;if(e[4]!==x||e[5]!==f||e[6]!==l||e[7]!==_||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==h||e[14]!==n||e[15]!==r||e[16]!==p||e[17]!==N){let E;e[19]!==O?(E=G=>O(G.id),e[19]=O,e[20]=E):E=e[20];const C=c.filter(E).length,y=c.slice(0,N),i=c.length>N;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>A(Cs),e[21]=I):I=e[21];const B=o??Et[n]??It;let L;e[22]!==r||e[23]!==B?(L=s.jsx(He,{icon:B,name:r,size:"sm"}),e[22]=r,e[23]=B,e[24]=L):L=e[24];let Y;e[25]!==r?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:r}),e[25]=r,e[26]=Y):Y=e[26];let w;e[27]!==L||e[28]!==Y?(w=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[L,Y]}),e[27]=L,e[28]=Y,e[29]=w):w=e[29];const U=p("settings.orgRoleDetail.enabledCount",{enabledCount:C,total:c.length});let z;e[30]!==U?(z=s.jsx(Me,{variant:"secondary",className:"text-xs text-muted-foreground",children:U}),e[30]=U,e[31]=z):z=e[31];let k;e[32]!==_?(k=_?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=_,e[33]=k):k=e[33];let $;e[34]!==z||e[35]!==k?($=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[z,k]}),e[34]=z,e[35]=k,e[36]=$):$=e[36];let V;e[37]!==$||e[38]!==w?(V=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:I,children:[w,$]}),e[37]=$,e[38]=w,e[39]=V):V=e[39],v=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[V,_&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[y.map(G=>{const q=O(G.id),W=()=>{if(!h){if(f){u(l,x,G.id);return}a(l,G.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!h&&"hover:bg-muted/50 cursor-pointer"),onClick:W,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:G.title})}),s.jsx("div",{onClick:Ns,children:h?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:q,disabled:!0,onCheckedChange:bs})})}),s.jsx(Le,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:q,onCheckedChange:W})})]},G.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>D(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=x,e[5]=f,e[6]=l,e[7]=_,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=h,e[14]=n,e[15]=r,e[16]=p,e[17]=N,e[18]=v}else v=e[18];return v}function Rs(t){return t+Ct}function bs(){}function Ns(t){return t.stopPropagation()}function Cs(t){return!t}function Ss(t){const e=X.c(33),{connection:l,selectedModels:n,allowAllModels:r,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:x,searchQuery:m,readOnly:f}=t,g=Jt(l.id);let a,u,h,d,p;if(e[0]!==x||e[1]!==r||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==g||e[8]!==f||e[9]!==m||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let _;e[16]!==l.label?(_=I=>({...I,id:I.modelId,provider:l.label}),e[16]=l.label,e[17]=_):_=e[17];const A=g.filter(vs).map(_),N=m.trim().toLowerCase(),D=N?A.filter(I=>I.title.toLowerCase().includes(N)||I.id.toLowerCase().includes(N)||I.provider?.toLowerCase().includes(N)):A;if(D.length===0){p=null;break e}const b=new Map;for(const I of D){const B=Ts(I.id,l.providerId),L=b.get(B)??{models:[],logo:null};L.models.push({id:I.id,title:Is(I.title),logo:I.logo}),!L.logo&&I.logo&&(L.logo=I.logo),b.set(B,L)}const O=Array.from(b.entries()).map(js).sort(Os),v=O.length===1||N.length>0;h="flex flex-col gap-3";const E=Et[l.providerId]??It;let C;e[18]!==l.providerId||e[19]!==E?(C=s.jsx("img",{src:E,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=E,e[20]=C):C=e[20];const y=Nt[l.providerId]??l.providerId;let i;e[21]!==y?(i=s.jsx("h4",{className:"text-sm font-medium",children:y}),e[21]=y,e[22]=i):i=e[22],e[23]!==i||e[24]!==C?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[C,i]}),e[23]=i,e[24]=C,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(I=>s.jsx(_s,{connectionId:l.id,subProviderId:I.id,subProviderName:I.name,groupLogo:I.logo,models:I.models,allConnectionModelIds:A.map(As),selectedModels:n,allowAllModels:r,allConnectionModelsSelected:x,onToggleModel:o,onExitAllowAll:c,readOnly:f,defaultExpanded:v},I.id))}e[0]=x,e[1]=r,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=g,e[8]=f,e[9]=m,e[10]=n,e[11]=a,e[12]=u,e[13]=h,e[14]=d,e[15]=p}else a=e[11],u=e[12],h=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let S;e[26]!==a||e[27]!==u?(S=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=S):S=e[28];let R;return e[29]!==h||e[30]!==d||e[31]!==S?(R=s.jsxs("div",{className:h,children:[d,S]}),e[29]=h,e[30]=d,e[31]=S,e[32]=R):R=e[32],R}function As(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function vs(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:r,onModelSetChange:o,readOnly:c,searchQuery:x}=t,m=c===void 0?!1:c,f=ie(),g=K.useDeferredValue(x),a=Wt();let u;e[0]!==n||e[1]!==o?(u=(E,C)=>{const y=n[E]??[],i={...n};if(y.includes(C)){const I=y.filter(B=>B!==C);I.length===0?delete i[E]:i[E]=I}else i[E]=[...y,C];o(i)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const h=u;let d;e[3]!==n||e[4]!==r||e[5]!==o?(d=(E,C,y)=>{r(!1),o({...n,[E]:C.filter(i=>i!==y)})},e[3]=n,e[4]=r,e[5]=o,e[6]=d):d=e[6];const p=d,S=!m&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==S?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=R):R=e[8];let _;e[9]!==l||e[10]!==r||e[11]!==o||e[12]!==m?(_=()=>{if(m)return;const E=!l;r(E),E&&o({})},e[9]=l,e[10]=r,e[11]=o,e[12]=m,e[13]=_):_=e[13];let A;e[14]!==f?(A=f("settings.orgRoleDetail.allModels"),e[14]=f,e[15]=A):A=e[15];let N;e[16]!==A?(N=s.jsx("span",{className:"text-sm font-medium",children:A}),e[16]=A,e[17]=N):N=e[17];let D;e[18]!==l||e[19]!==r||e[20]!==o||e[21]!==m||e[22]!==f?(D=s.jsx("div",{onClick:ys,children:m?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{children:s.jsx("p",{children:f("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:l,onCheckedChange:E=>{r(E),E&&o({})}})}),e[18]=l,e[19]=r,e[20]=o,e[21]=m,e[22]=f,e[23]=D):D=e[23];let b;e[24]!==R||e[25]!==_||e[26]!==N||e[27]!==D?(b=s.jsxs("div",{className:R,onClick:_,children:[N,D]}),e[24]=R,e[25]=_,e[26]=N,e[27]=D,e[28]=b):b=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==g||e[32]!==p||e[33]!==n||e[34]!==m||e[35]!==f||e[36]!==h?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:f("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(E=>s.jsx(K.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 animate-spin"}),f("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ss,{connection:E,selectedModels:n[E.id]??[],allowAllModels:l,onToggleModel:h,onExitAllowAll:p,allConnectionModelsSelected:(n[E.id]??[]).includes("*"),searchQuery:g,readOnly:m})},E.id)),e[29]=a,e[30]=l,e[31]=g,e[32]=p,e[33]=n,e[34]=m,e[35]=f,e[36]=h,e[37]=O):O=e[37];let v;return e[38]!==b||e[39]!==O?(v=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[b,O]}),e[38]=b,e[39]=O,e[40]=v):v=e[40],v}function Ds(){}function ys(t){return t.stopPropagation()}function ws(t){const e=X.c(75),{open:l,onOpenChange:n,selectedMemberIds:r,onAddMembers:o}=t,c=ie(),[x,m]=K.useState(""),f=K.useDeferredValue(x);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[a,u]=K.useState(g),{data:h}=_t();let d,p,S,R,_,A,N,D,b,O,v;if(e[1]!==h?.data?.members||e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==x||e[8]!==r||e[9]!==c){const z=h?.data?.members??[];let k;e[21]!==f?(k=F=>{const T=f.toLowerCase();return F.user?.name?.toLowerCase().includes(T)||F.user?.email?.toLowerCase().includes(T)},e[21]=f,e[22]=k):k=e[22];const $=z.filter(k);let V;e[23]!==o||e[24]!==n||e[25]!==a?(V=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=V):V=e[26],S=V,p=mt,O=l,v=n,d=ut,D="sm:max-w-md p-0";let G;e[27]!==c?(G=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=G):G=e[28];let q;e[29]!==G?(q=s.jsx(ft,{children:G}),e[29]=G,e[30]=q):q=e[30];let W;e[31]!==c?(W=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(gt,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==q||e[36]!==te?(b=s.jsxs(ht,{className:"px-6 pt-6",children:[q,te]}),e[35]=q,e[36]=te,e[37]=b):b=e[37],A="flex flex-col h-80";let se;e[38]!==c?(se=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=se):se=e[39],e[40]!==x||e[41]!==se?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:x,onChange:m,placeholder:se,className:"w-full"})}),e[40]=x,e[41]=se,e[42]=N):N=e[42],R="flex-1 overflow-auto",_=$.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(x?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:$.map(F=>{const T=F.role!=="owner",M=r.includes(F.id),H=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!T||M?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(qe,{checked:H||M,onCheckedChange:()=>{!T||M||u(Q=>Q.includes(F.id)?Q.filter(J=>J!==F.id):[...Q,F.id])},disabled:!T||M}),s.jsx(bt,{url:F.user?.image??void 0,fallback:Rt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!T&&s.jsx(Me,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),M&&T&&s.jsx(Me,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=h?.data?.members,e[2]=f,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=x,e[8]=r,e[9]=c,e[10]=d,e[11]=p,e[12]=S,e[13]=R,e[14]=_,e[15]=A,e[16]=N,e[17]=D,e[18]=b,e[19]=O,e[20]=v}else d=e[10],p=e[11],S=e[12],R=e[13],_=e[14],A=e[15],N=e[16],D=e[17],b=e[18],O=e[19],v=e[20];let E;e[43]!==R||e[44]!==_?(E=s.jsx("div",{className:R,children:_}),e[43]=R,e[44]=_,e[45]=E):E=e[45];let C;e[46]!==E||e[47]!==A||e[48]!==N?(C=s.jsxs("div",{className:A,children:[N,E]}),e[46]=E,e[47]=A,e[48]=N,e[49]=C):C=e[49];let y;e[50]!==c?(y=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=y):y=e[51];let i;e[52]!==y?(i=s.jsx(xt,{children:y}),e[52]=y,e[53]=i):i=e[53];const I=a.length===0;let B;e[54]!==a.length||e[55]!==c?(B=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=B):B=e[56];let L;e[57]!==S||e[58]!==I||e[59]!==B?(L=s.jsx(pt,{onClick:S,disabled:I,children:B}),e[57]=S,e[58]=I,e[59]=B,e[60]=L):L=e[60];let Y;e[61]!==i||e[62]!==L?(Y=s.jsxs(Tt,{className:"px-6 pb-6",children:[i,L]}),e[61]=i,e[62]=L,e[63]=Y):Y=e[63];let w;e[64]!==d||e[65]!==C||e[66]!==Y||e[67]!==D||e[68]!==b?(w=s.jsxs(d,{className:D,children:[b,C,Y]}),e[64]=d,e[65]=C,e[66]=Y,e[67]=D,e[68]=b,e[69]=w):w=e[69];let U;return e[70]!==p||e[71]!==w||e[72]!==O||e[73]!==v?(U=s.jsx(p,{open:O,onOpenChange:v,children:w}),e[70]=p,e[71]=w,e[72]=O,e[73]=v,e[74]=U):U=e[74],U}function Ps(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:r,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:x,onAddMemberDialogOpenChange:m}=t,f=r===void 0?!1:r,g=o===void 0?void 0:o,a=ie(),u=K.useDeferredValue(c),{data:h}=_t();let d,p,S;if(e[0]!==h?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==f||e[5]!==g||e[6]!==c||e[7]!==a){const D=h?.data?.members??[];let b;e[11]!==l?(b=i=>l.includes(i.id),e[11]=l,e[12]=b):b=e[12];const O=D.filter(b);let v;e[13]!==u?(v=i=>{const I=u.toLowerCase();return i.user?.name?.toLowerCase().includes(I)||i.user?.email?.toLowerCase().includes(I)},e[13]=u,e[14]=v):v=e[14];const E=O.filter(v);let C;e[15]!==g||e[16]!==a?(C=g??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=a,e[17]=C):C=e[17];const y=C;S="flex flex-col h-full",d="flex-1 overflow-auto",p=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:E.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(bt,{url:i.user?.image??void 0,fallback:Rt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),f?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(nt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:y})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>n(l.filter(I=>I!==i.id)),children:s.jsx(nt,{size:16})})]},i.id))}),e[0]=h?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=f,e[5]=g,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=S}else d=e[8],p=e[9],S=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let _;e[21]!==l||e[22]!==n?(_=D=>n([...l,...D]),e[21]=l,e[22]=n,e[23]=_):_=e[23];let A;e[24]!==x||e[25]!==l||e[26]!==m||e[27]!==_?(A=s.jsx(ws,{open:x,onOpenChange:m,selectedMemberIds:l,onAddMembers:_}),e[24]=x,e[25]=l,e[26]=m,e[27]=_,e[28]=A):A=e[28];let N;return e[29]!==S||e[30]!==R||e[31]!==A?(N=s.jsxs("div",{className:S,children:[R,A]}),e[29]=S,e[30]=R,e[31]=A,e[32]=N):N=e[32],N}function Ls(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(K.Suspense,{fallback:l,children:s.jsx(Ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const ks={owner:[],admin:[],user:[]};function Gs(t,e,l,n){const r=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:r,staticPermissions:ks[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},r=n.self||[],o=r.includes("*"),c=o?[]:r.filter(a=>a!=="*"),x={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const h of l)x[h.id]=u.includes("*")?h.tools?.map(d=>d.name)??[]:u;else{const h=l.find(d=>d.id===a);h&&(x[a]=u.includes("*")?h.tools?.map(d=>d.name)??[]:u)}const m=n.models||[],f=m.length===0||m.includes("*:*"),g={};if(!f)for(const a of m){const u=a.indexOf(":");if(u===-1)continue;const h=a.slice(0,u),d=a.slice(u+1);g[h]||(g[h]=[]),g[h].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:x,allowAllModels:f,modelSet:g,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,r]of Object.entries(t.toolSet))if(r.length>0){const c=e.find(x=>x.id===n)?.tools?.map(x=>x.name)??[];l[n]=c.length>0&&c.every(x=>r.includes(x))?["*"]:r}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[r,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${r}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function zs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:n,onOpen:r}=t,o=n===void 0?void 0:n,c=ie();let x;e[0]!==o||e[1]!==c?(x=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=x):x=e[2];const m=x;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ye,{size:16}),e[3]=u):u=e[3];let h;e[4]!==c?(h=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=h):h=e[5];let d;e[6]!==h?(d=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[u,h]})})}),e[6]=h,e[7]=d):d=e[7];let p;e[8]!==m?(p=s.jsx(Le,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=p):p=e[9];let S;return e[10]!==d||e[11]!==p?(S=s.jsx(ye,{children:s.jsxs(we,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=S):S=e[12],S}let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ye,{size:16}),e[13]=f):f=e[13];let g;e[14]!==c?(g=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=g):g=e[15];let a;return e[16]!==r||e[17]!==g?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:r,children:[f,g]}),e[16]=r,e[17]=g,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Be(),n=$e(),r=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let x;e[4]!==o||e[5]!==c?(x={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=x):x=e[6];const{data:m,isPending:f}=Fe(x);if(f||!r){let h;return e[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=h):h=e[7],h}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const a=g;let u;return e[10]!==r||e[11]!==a||e[12]!==t?(u=s.jsx(Fs,{...t,members:a,connections:r}),e[10]=r,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Fs({target:t,onBack:e,onSaved:l,members:n,connections:r}){const o=ie(),{locator:c}=Be(),x=$e(),m=rt(),f=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,h]=K.useState(f?"org":"mcp"),d=jt({resolver:vt(us),defaultValues:Vs(t,n,r)}),p=d.formState.isValid,S=d.formState.isDirty,R=at({mutationFn:async i=>{const I=Bs(i,r),B=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),L=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(w,U)=>{const z=n.filter(V=>V.role===(U??w)).map(V=>V.id),k=i.memberIds.filter(V=>!z.includes(V)),$=z.filter(V=>!i.memberIds.includes(V));for(const V of k){const G=await x.organization.updateMemberRole({memberId:V,role:[w]});if(G?.error)throw new Error(G.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const V of $){const G=await x.organization.updateMemberRole({memberId:V,role:["user"]});if(G?.error)throw new Error(G.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(L)return await Y(i.role.slug),i;if(i.role.id){const w=i.role.label.toLowerCase().replace(/\s+/g,"-"),U=i.role.slug,z=w!==U,k=await x.organization.updateRole({roleId:i.role.id,data:{permission:I,...z?{roleName:w}:{}}});if(k?.error)throw new Error(k.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(z?w:U,z?U:void 0),z?{...i,role:{...i.role,slug:w}}:i}else{const w=await x.organization.createRole({role:B,permission:I});if(w?.error)throw new Error(w.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const U of i.memberIds){const z=await x.organization.updateMemberRole({memberId:U,role:[B]});if(z?.error)throw new Error(z.error.message)}return{...i,role:{...i.role,id:w.data?.roleData?.id,slug:B}}}},onSuccess:(i,I)=>{m.invalidateQueries({queryKey:de.members(c)}),m.invalidateQueries({queryKey:de.organizationRoles(c)});const B=!I.role.id&&!I.role.slug,L=I.role.slug==="owner"&&!I.role.id;Ke(L?"role_members_updated":B?"role_created":"role_updated",{role_slug:I.role.slug??null}),ve.success(o(L?"settings.orgRoleDetail.membersUpdatedSuccessfully":B?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(i),l(i.role.id)},onError:i=>{ve.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),_=d.handleSubmit(i=>{if(!i.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(i)}),A=!g,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",D=[...g?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[b,O]=K.useState(""),[v,E]=K.useState(!1),C=i=>{h(i),O("")},y={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ne,{children:s.jsxs(ne.Content,{className:Z("flex flex-col",u!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ne.Title,{actions:A&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:_,disabled:R.isPending||!p||!S,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?dt(t.role,!0):Lt(d.watch("role.label")))}),g&&s.jsx(ct,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:D.map(i=>s.jsx("button",{type:"button",onClick:()=>C(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Qe,{value:b,onChange:O,placeholder:y[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(zs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>E(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!g&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:i=>d.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:b}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:i=>d.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>d.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:b}),u==="models"&&s.jsx(Ms,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:i=>d.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>d.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:b}),u==="members"&&s.jsx(Ls,{memberIds:d.watch("memberIds"),onMemberIdsChange:i=>d.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:b,addMemberDialogOpen:v,onAddMemberDialogOpenChange:E})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=X.c(6),{area:l,children:n}=t,{isPrivileged:r,loading:o,error:c}=ts();let x;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==r||e[4]!==o?(x=s.jsx(ss,{granted:r,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=r,e[4]=o,e[5]=x):x=e[5],x}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Hs(){const t=X.c(135),e=ie(),[l,n]=K.useState(""),[r,o]=K.useState(null),c=yt();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x={strict:!1},t[0]=x):x=t[0];const{role:m}=wt(x),{locator:f}=Be(),g=$e(),a=rt(),{customRoles:u,refetch:h}=Pt();let d;t[1]!==c?(d=j=>c({to:".",search:P=>({...P,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;let S;e:{if(!m){S=null;break e}if(m==="new"){S={kind:"new"};break e}if(m.startsWith("builtin-")){S={kind:"builtin",role:m.slice(8)};break e}let j;t[3]!==m?(j=ee=>ee.id===m,t[3]=m,t[4]=j):j=t[4];const P=u.find(j);S=P?{kind:"custom",role:P}:null}const R=S;let _;t[5]!==f?(_=de.members(f),t[5]=f,t[6]=_):_=t[6];let A;t[7]!==g?(A=()=>g.organization.listMembers(),t[7]=g,t[8]=A):A=t[8];let N;t[9]!==_||t[10]!==A?(N={queryKey:_,queryFn:A},t[9]=_,t[10]=A,t[11]=N):N=t[11];const{data:D}=Fe(N);let b;t[12]!==D?.data?.members?(b=D?.data?.members??[],t[12]=D?.data?.members,t[13]=b):b=t[13];const O=b;let v;t[14]!==O?(v=j=>O.filter(P=>P.role===j).length,t[14]=O,t[15]=v):v=t[15];const E=v;let C;if(t[16]!==u||t[17]!==E||t[18]!==l||t[19]!==e){let j;t[21]!==E||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:E(ce.role),label:e(ce.labelKey)}}),t[21]=E,t[22]=e,t[23]=j):j=t[23];const P=Qs.map(j);let ee;t[24]!==E?(ee=ce=>({kind:"custom",role:{...ce,memberCount:E(ce.role)}}),t[24]=E,t[25]=ee):ee=t[25];const St=u.map(ee);if(C=[...P,...St],l){const ce=l.toLowerCase();C=C.filter(At=>At.role.label.toLowerCase().includes(ce))}t[16]=u,t[17]=E,t[18]=l,t[19]=e,t[20]=C}else C=t[20];let y;t[26]!==g?(y=async j=>{const P=await g.organization.deleteRole({roleId:j});if(P?.error)throw new Error(P.error.message);return P?.data},t[26]=g,t[27]=y):y=t[27];const i=at({mutationFn:y,onSuccess:(j,P)=>{Ke("role_deleted",{role_id:P}),a.invalidateQueries({queryKey:de.members(f)}),a.invalidateQueries({queryKey:de.organizationRoles(f)}),ve.success(e("settings.roles.deletedSuccessfully")),h(),R?.kind==="custom"&&R.role.id===P&&p(void 0)},onError:Xs});let I;t[28]!==e?(I=e("settings.roles.columnRole"),t[28]=e,t[29]=I):I=t[29];let B;t[30]!==I?(B={id:"role",header:I,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=I,t[31]=B):B=t[31];let L;t[32]!==e?(L=e("settings.roles.columnType"),t[32]=e,t[33]=L):L=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(Me,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Me,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let w;t[36]!==L||t[37]!==Y?(w={id:"type",header:L,render:Y,cellClassName:"w-28 shrink-0"},t[36]=L,t[37]=Y,t[38]=w):w=t[38];let U;t[39]!==e?(U=e("settings.roles.columnPermissions"),t[39]=e,t[40]=U):U=t[40];let z;t[41]!==e?(z=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const P=j.role,ee=[];return P.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):P.staticPermissionCount&&P.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:P.staticPermissionCount})),P.allowsAllConnections?ee.push(e("settings.roles.allConnections")):P.connectionCount&&P.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:P.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=z):z=t[42];let k;t[43]!==U||t[44]!==z?(k={id:"permissions",header:U,render:z,cellClassName:"flex-1 min-w-0"},t[43]=U,t[44]=z,t[45]=k):k=t[45];let $;t[46]!==e?($=e("settings.roles.columnMembers"),t[46]=e,t[47]=$):$=t[47];let V;t[48]!==$?(V={id:"members",header:$,render:Ws,cellClassName:"w-24 shrink-0"},t[48]=$,t[49]=V):V=t[49];let G;t[50]!==e?(G={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(kt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zs,children:s.jsx(Vt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:qs,children:s.jsxs(Bt,{variant:"destructive",onClick:()=>{const P=j.role;P.id&&o({id:P.id,label:P.label})},children:[s.jsx(zt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=G):G=t[51];let q;t[52]!==B||t[53]!==w||t[54]!==k||t[55]!==V||t[56]!==G?(q=[B,w,k,V,G],t[52]=B,t[53]=w,t[54]=k,t[55]=V,t[56]=G,t[57]=q):q=t[57];const W=q;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const P=j.role;p(P.id)}},t[58]=p,t[59]=te):te=t[59];const se=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let P;return t[62]!==h||t[63]!==p?(P=()=>{h(),p(void 0)},t[62]=h,t[63]=p,t[64]=P):P=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:P},Ks(R))}let F;t[65]!==e?(F=e("settings.roles.pageTitle"),t[65]=e,t[66]=F):F=t[66];let T;t[67]!==F?(T=s.jsx(ne.Title,{children:F}),t[67]=F,t[68]=T):T=t[68];let M;t[69]!==e?(M=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=M):M=t[70];let H;t[71]===Symbol.for("react.memo_cache_sentinel")?(H=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=H):H=t[71];let Q;t[72]!==l||t[73]!==M?(Q=s.jsx(Qe,{value:l,onChange:n,placeholder:M,className:"w-full md:w-[375px]",onKeyDown:H}),t[72]=l,t[73]=M,t[74]=Q):Q=t[74];let J;t[75]!==p?(J=()=>p("new"),t[75]=p,t[76]=J):J=t[76];let oe;t[77]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(Ye,{size:16}),t[77]=oe):oe=t[77];let le;t[78]!==e?(le=e("settings.roles.createRole"),t[78]=e,t[79]=le):le=t[79];let me;t[80]!==J||t[81]!==le?(me=s.jsxs(ae,{onClick:J,children:[oe,le]}),t[80]=J,t[81]=le,t[82]=me):me=t[82];let ue;t[83]!==Q||t[84]!==me?(ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Q,me]}),t[83]=Q,t[84]=me,t[85]=ue):ue=t[85];let fe;t[86]!==l||t[87]!==e?(fe=l?s.jsx(tt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(tt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[86]=l,t[87]=e,t[88]=fe):fe=t[88];let ge;t[89]!==C||t[90]!==W||t[91]!==se||t[92]!==fe?(ge=s.jsx(Yt,{columns:W,data:C,isLoading:!1,onRowClick:se,emptyState:fe}),t[89]=C,t[90]=W,t[91]=se,t[92]=fe,t[93]=ge):ge=t[93];let he;t[94]!==T||t[95]!==ue||t[96]!==ge?(he=s.jsx(ne.Content,{children:s.jsx(ne.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[T,ue,ge]})})}),t[94]=T,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=r!==null;let ke;t[98]===Symbol.for("react.memo_cache_sentinel")?(ke=j=>!j&&o(null),t[98]=ke):ke=t[98];let xe;t[99]!==e?(xe=e("settings.roles.deleteRoleTitle"),t[99]=e,t[100]=xe):xe=t[100];let pe;t[101]!==xe?(pe=s.jsx(ft,{children:xe}),t[101]=xe,t[102]=pe):pe=t[102];const ze=r?.label??"";let Te;t[103]!==e||t[104]!==ze?(Te=e("settings.roles.deleteRoleConfirm",{role:ze}),t[103]=e,t[104]=ze,t[105]=Te):Te=t[105];let Ee;t[106]!==Te?(Ee=s.jsx(gt,{children:Te}),t[106]=Te,t[107]=Ee):Ee=t[107];let Ie;t[108]!==pe||t[109]!==Ee?(Ie=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=Ie):Ie=t[110];let _e;t[111]!==e?(_e=e("settings.roles.cancel"),t[111]=e,t[112]=_e):_e=t[112];let Re;t[113]!==_e?(Re=s.jsx(xt,{children:_e}),t[113]=_e,t[114]=Re):Re=t[114];let be;t[115]!==i||t[116]!==r?(be=()=>{r?.id&&i.mutate(r.id),o(null)},t[115]=i,t[116]=r,t[117]=be):be=t[117];let Ne;t[118]!==e?(Ne=e("settings.roles.delete"),t[118]=e,t[119]=Ne):Ne=t[119];let Ce;t[120]!==be||t[121]!==Ne?(Ce=s.jsx(pt,{onClick:be,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ne}),t[120]=be,t[121]=Ne,t[122]=Ce):Ce=t[122];let Se;t[123]!==Re||t[124]!==Ce?(Se=s.jsxs(Tt,{children:[Re,Ce]}),t[123]=Re,t[124]=Ce,t[125]=Se):Se=t[125];let Ae;t[126]!==Ie||t[127]!==Se?(Ae=s.jsxs(ut,{children:[Ie,Se]}),t[126]=Ie,t[127]=Se,t[128]=Ae):Ae=t[128];let Oe;t[129]!==Ve||t[130]!==Ae?(Oe=s.jsx(mt,{open:Ve,onOpenChange:ke,children:Ae}),t[129]=Ve,t[130]=Ae,t[131]=Oe):Oe=t[131];let Ge;return t[132]!==he||t[133]!==Oe?(Ge=s.jsxs(ne,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=Ge):Ge=t[134],Ge}function qs(t){return t.stopPropagation()}function Zs(t){return t.stopPropagation()}function Ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",dt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(ct,{size:12,className:"text-muted-foreground shrink-0"})]})}function Xs(t,e){Ke("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ve.error(t instanceof Error?t.message:"Failed to delete role")}function el(){const t=X.c(7),e=ie();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K.Suspense,{fallback:s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Hs,{})}),t[4]=r):r=t[4];let o;return t[5]!==n?(o=s.jsx(Dt,{fallback:n,children:r}),t[5]=n,t[6]=o):o=t[6],o}function Do(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{Do as default};
|
|
1
|
+
import{r as K,C as Be,K as de,b4 as Ot,m as Fe,j as s,l as Z,i as je,B as ae,c as X,H as Je,ad as Ue,I as re,af as Xe,ag as et,n as rt,M as jt,J as vt,d as at,t as ve,p as Ke,w as ct,x as Mt,E as Dt,b as yt,u as wt}from"./index-C8rlFaFO.js";import{u as Pt}from"./use-organization-roles-BG6jMK7e.js";import{u as $e}from"./use-org-auth-client-C0qPMRhc.js";import{u as ie}from"./use-t-BeHordU2.js";import{g as dt,a as Lt}from"./role-color-Dn2tXDDF.js";import{B as Me}from"./badge-dHBIjKyY.js";import{f as mt,a as ut,c as ft,d as gt,b as ht,A as xt,g as pt,e as Tt}from"./alert-dialog-D2oa47X8.js";import{D as kt,a as Gt,c as Ut,d as Bt}from"./dropdown-menu-B7HOgSu8.js";import{i as Vt}from"./DotsVertical-Bcfqjiks.js";import{s as Ye}from"./Plus-5VWQJEkS.js";import{s as zt}from"./Trash01-DxXosbkh.js";import{C as Yt}from"./collection-table-wrapper-BOKHq7cp.js";import{P as ne}from"./index-Bj_MaVUP.js";import{E as tt}from"./empty-state-kSEyPCAz.js";import{S as Qe}from"./search-input-B6akQV4Y.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as He}from"./integration-icon-BXEpLE2r.js";import{u as Ft}from"./use-infinite-scroll-BI8YTyTt.js";import{C as qe}from"./checkbox-BOAToSlJ.js";import{b as Kt}from"./Settings02-CU2rilKq.js";import{u as $t}from"./useSuspenseInfiniteQuery-DIVSilzv.js";import{u as Qt,S as Ht}from"./use-mcp-client-PcphUWIj.js";import{C as qt}from"./collection-search-DuPY-s4R.js";import{a as _t}from"./use-members-JooO5O_z.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as Zt}from"./use-connection-CcmTBTY-.js";import{u as Wt,c as Jt}from"./use-ai-providers-CGzSWtp7.js";import{A as bt}from"./avatar-1o2VQKTj.js";import{S as De}from"./switch-CyZjNvfZ.js";import{c as ye,b as we,T as Pe,a as Le}from"./tooltip-DE_gqCm3.js";import{S as st,a as lt,b as ot}from"./settings-section-DxqR9iml.js";import{t as Xt}from"./ChevronDown-D_W2bIqv.js";import{i as es}from"./ChevronRight-BnIvJcIZ.js";import{i as nt}from"./X-CLG08ht8.js";import{a as ts}from"./use-capability-BNcFOggs.js";import{A as ss}from"./access-gate-B8spscer.js";import"./ChevronUp-Ci-XiWb6.js";import"./table-iG6kCmeS.js";import"./ArrowUp-Dq6JgHsq.js";import"./sidebar-AfeWMY1r.js";import"./LayoutLeft-COV7zlIC.js";import"./use-mobile-C57pT7o9.js";import"./SearchMd-LbMkvaPD.js";import"./Tool02-rl8XhSPG.js";import"./agent-icon-BIj6WxKp.js";import"./AlertCircle-Cvc_10Uv.js";import"./Tool01-DBXzU6aR.js";import"./XCircle-pZ6nD22L.js";import"./ArrowUpRight-DgI9ki5h.js";import"./TrendUp01-BmzCTIbp.js";import"./ZapSquare-DdKvM81Z.js";import"./ZoomOut-DAAhtu2Z.js";import"./Users03-3HXi1aia.js";import"./CheckCircle-B5oIKeSF.js";import"./Stars02-CdgckoDr.js";import"./Copy01-Q4xZmPKp.js";import"./Globe01-qjaQZUfN.js";import"./Eye-BuukW7MV.js";import"./FilterLines-Do4UgzmV.js";import"./Star01-D4LxiizA.js";import"./Globe04-CqIGMVDi.js";import"./SwitchHorizontal01-DNcPUv7P.js";import"./HardDrive-DrLvUMYg.js";import"./Image01-BWotytID.js";import"./Key01-BPZUhUcV.js";import"./LinkExternal01-CyMOdGfe.js";import"./Monitor01-dLHbd0CB.js";import"./Sun-Ca3eslhz.js";import"./Package-B7Qii2Tl.js";import"./Palette-tVNOj7Ym.js";import"./Play-BE8nTtBp.js";import"./SearchLg-BiyFAMx0.js";import"./Shield01-7KT2UKvg.js";import"./Stars01-HAbkffzq.js";import"./Upload01-CXsTipbe.js";import"./User01-CZgThaZQ.js";import"./Users01-IdyAszrF.js";import"./XClose-BYq2BBpT.js";import"./Zap-C6tkfs5m.js";import"./auth-Kymy4xkz.js";import"./use-collections-u5tkBX1a.js";import"./studio-tools-B3FHZXsQ.js";import"./card-CoG27DVs.js";import"./capability-load-error-DI4Ww9LY.js";const Ze="basic-usage",We=[{id:Ze,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...We.find(t=>t.id===Ze)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(We.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of We){if(e.id===Ze)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const r=new Set(e);for(const o of t.tools)r.add(o);return Array.from(r)}const n=new Set(e);for(const r of t.tools)n.delete(r);return Array.from(n)}function rs(t){const e=X.c(21),{connection:l,isSelected:n,hasToolsEnabled:r,activeToolsCount:o,totalToolsCount:c,onSelect:x,onToggle:m}=t,f=n?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==f?(g=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",f),e[0]=f,e[1]=g):g=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(He,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=u):u=e[6];let h;e[7]!==x||e[8]!==a||e[9]!==u?(h=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:x,children:[a,u]}),e[7]=x,e[8]=a,e[9]=u,e[10]=h):h=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==r||e[14]!==m||e[15]!==c?(d=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(qe,{checked:r,onCheckedChange:m,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=r,e[14]=m,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==g||e[18]!==h||e[19]!==d?(p=s.jsxs("div",{className:g,children:[h,d]}),e[17]=g,e[18]=h,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=X.c(18),{connectionId:l,tool:n,isSelected:r,onToggle:o}=t,c=`tool-${l}-${n.name}`,x=r?"text-foreground":"text-muted-foreground";let m;e[0]!==x?(m=Z("text-sm font-medium",x),e[0]=x,e[1]=m):m=e[1];let f;e[2]!==m||e[3]!==n.name?(f=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:n.name})}),e[2]=m,e[3]=n.name,e[4]=f):f=e[4];let g;e[5]!==n.description?(g=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=g):g=e[6];let a;e[7]!==f||e[8]!==g?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[7]=f,e[8]=g,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let h;e[10]!==r||e[11]!==o||e[12]!==u?(h=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(qe,{id:u,checked:r,onCheckedChange:o,onClick:ds})}),e[10]=r,e[11]=o,e[12]=u,e[13]=h):h=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==h?(d=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,h]}),e[14]=c,e[15]=a,e[16]=h,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const[r,o]=K.useState(""),c=n!==void 0?n:r,x=K.useDeferredValue(c),[m,f]=K.useState("all"),[g,a]=K.useState(!1),u=K.useRef(new Set(Object.keys(t))),{org:h}=Be(),d=Qt({connectionId:Ht,orgId:h.id,orgSlug:h.slug}),p=100,S=x.trim(),R=S?{operator:"or",conditions:[{field:["title"],operator:"contains",value:S},{field:["description"],operator:"contains",value:S}]}:void 0,_=!!l,A={...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:p,offset:0,..._&&{include_virtual:!0}},N=JSON.stringify(A),{data:D,fetchNextPage:b,hasNextPage:O,isFetchingNextPage:v}=$t({queryKey:de.collectionListInfinite(d,h.id,"","CONNECTIONS",N),queryFn:async({pageParam:T=0})=>(await d.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:p,offset:T,..._&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,M)=>{if(T?.hasMore)return M.reduce((H,Q)=>H+(Q?.items?.length??0),0)},staleTime:3e4}),E=D?.pages.flatMap(T=>T?.items??[])??[],C=Ft(b,O??!1,v),y=l?E.filter(T=>T.connection_type!=="VIRTUAL"?!0:Ot(T.connection_url)!==l):E,i=u.current,I=[...i.values()].map(T=>y.find(M=>M.id===T)).filter(T=>T!==void 0),B=y.filter(T=>!i.has(T.id)),L=[...I,...B],Y=T=>{const M=t[T];return M!==void 0&&M.length>0},w=L.filter(T=>{if(m==="all")return!0;const M=Y(T.id);return m==="selected"?M:m==="unselected"?!M:!0}),[U,z]=K.useState(L[0]?.id??null),k=U?L.find(T=>T.id===U)??null:null,{data:$,isFetching:V}=Fe({queryKey:de.collectionItem(d,h.id,"","CONNECTIONS",U??""),queryFn:async()=>U?(await d.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:U}})).structuredContent?.item??null:null,enabled:!!U,staleTime:3e4}),G=$?.tools??[],q=(T,M)=>t[T]?.includes(M)??!1,W=(T,M)=>{const H=t[T]??[],Q=H.includes(M),J={...t};if(Q){const oe=H.filter(le=>le!==M);oe.length===0?delete J[T]:J[T]=oe}else J[T]=[...H,M];e(J)},te=T=>{const M=T===U?G:[];if(!M.length)return;const H=t[T]??[],Q=M.map(le=>le.name),J=H.length>0&&Q.every(le=>H.includes(le)),oe={...t};J?delete oe[T]:(oe[T]=Q,z(T)),e(oe)},se=T=>{z(T),a(!0)},F=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",g&&"hidden md:flex"),children:[n===void 0&&s.jsx(qt,{value:r,onChange:o,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>f("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>f("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:c?"No connections found":m==="selected"?"No servers selected":m==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[w.map(T=>{const M=U===T.id,H=M?G.length:0,Q=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:M?G:T.tools},isSelected:M,hasToolsEnabled:Y(T.id),activeToolsCount:Q,totalToolsCount:H,onSelect:()=>se(T.id),onToggle:()=>te(T.id)},T.id)}),s.jsx("div",{ref:C,className:"h-4"}),v&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",g?"flex":"hidden md:flex"),children:k?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Kt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(He,{icon:k.icon,name:k.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:k.title}),k.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:k.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:V?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})}):G.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:G.map(T=>s.jsx(cs,{connectionId:k.id,tool:T,isSelected:q(k.id,T.name),onToggle:()=>W(k.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const us=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:et(),staticPermissions:Ue(re()),toolSet:Xe(re(),Ue(re())),allowAllModels:et(),modelSet:Xe(re(),Ue(re())),memberIds:Ue(re())});function it(t,e,l){const n=ie(),r=s.jsx(De,{checked:t,disabled:e,onCheckedChange:l});return e?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:r})}),s.jsx(Le,{children:s.jsx("p",{children:n("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):r}function fs(t){const e=X.c(40),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:r,onPermissionsChange:o,readOnly:c,searchQuery:x}=t,m=c===void 0?!1:c,f=ie();let g;e[0]!==x?(g=x.trim().toLowerCase(),e[0]=x,e[1]=g):g=e[1];const a=K.useDeferredValue(g);let u;if(e[2]!==l||e[3]!==a||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==x||e[8]!==n||e[9]!==f){const h=os(),d=(E,C)=>{if(!m){if(l&&C){const y=h.flatMap(xs).flatMap(hs);r(!1),o(y.filter(i=>!E.tools.includes(i)));return}l||o(is(E,n,!C))}};let p;e[11]!==a?(p=E=>{const{section:C,capabilities:y}=E;return{section:C,capabilities:y.filter(i=>!a||i.label.toLowerCase().includes(a)||i.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const S=h.map(p).filter(gs);let R;e[13]!==f?(R=f("settings.orgRoleDetail.general"),e[13]=f,e[14]=R):R=e[14];let _;e[15]!==f?(_=f("settings.orgRoleDetail.allOrgPermissions"),e[15]=f,e[16]=_):_=e[16];let A;e[17]!==f?(A=f("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=f,e[18]=A):A=e[18];let N;e[19]!==l||e[20]!==r||e[21]!==o?(N=()=>{r(!l),o([])},e[19]=l,e[20]=r,e[21]=o,e[22]=N):N=e[22];let D;e[23]!==l||e[24]!==m||e[25]!==N?(D=it(l,m,N),e[23]=l,e[24]=m,e[25]=N,e[26]=D):D=e[26];let b;e[27]!==l||e[28]!==r||e[29]!==o||e[30]!==m?(b=m?void 0:()=>{r(!l),o([])},e[27]=l,e[28]=r,e[29]=o,e[30]=m,e[31]=b):b=e[31];let O;e[32]!==b||e[33]!==_||e[34]!==A||e[35]!==D?(O=s.jsx(lt,{children:s.jsx(ot,{title:_,description:A,action:D,onClick:b})}),e[32]=b,e[33]=_,e[34]=A,e[35]=D,e[36]=O):O=e[36];let v;e[37]!==O||e[38]!==R?(v=s.jsx(st,{title:R,children:O}),e[37]=O,e[38]=R,e[39]=v):v=e[39],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[v,S.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:f("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:x})}):S.map(E=>{const{section:C,capabilities:y}=E;return s.jsx(st,{title:C,children:s.jsx(lt,{children:y.map(i=>{const I=ns(i,n,l);return s.jsx(ot,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(Mt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:it(I,m,()=>d(i,I)),onClick:m?void 0:()=>d(i,I)},i.id)})})},C)})]})}),e[2]=l,e[3]=a,e[4]=r,e[5]=o,e[6]=m,e[7]=x,e[8]=n,e[9]=f,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Es(t){return ps[t]??Nt[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function _s(t){const e=X.c(40),{connectionId:l,subProviderId:n,subProviderName:r,groupLogo:o,models:c,allConnectionModelIds:x,selectedModels:m,allowAllModels:f,allConnectionModelsSelected:g,onToggleModel:a,onExitAllowAll:u,readOnly:h,defaultExpanded:d}=t,p=ie(),[S,R]=K.useState(d),_=d||S,A=R,[N,D]=K.useState(Ct);let b;e[0]!==g||e[1]!==f||e[2]!==m?(b=E=>f||g||m.includes("*")||m.includes(E),e[0]=g,e[1]=f,e[2]=m,e[3]=b):b=e[3];const O=b;let v;if(e[4]!==x||e[5]!==f||e[6]!==l||e[7]!==_||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==h||e[14]!==n||e[15]!==r||e[16]!==p||e[17]!==N){let E;e[19]!==O?(E=G=>O(G.id),e[19]=O,e[20]=E):E=e[20];const C=c.filter(E).length,y=c.slice(0,N),i=c.length>N;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>A(Cs),e[21]=I):I=e[21];const B=o??Et[n]??It;let L;e[22]!==r||e[23]!==B?(L=s.jsx(He,{icon:B,name:r,size:"sm"}),e[22]=r,e[23]=B,e[24]=L):L=e[24];let Y;e[25]!==r?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:r}),e[25]=r,e[26]=Y):Y=e[26];let w;e[27]!==L||e[28]!==Y?(w=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[L,Y]}),e[27]=L,e[28]=Y,e[29]=w):w=e[29];const U=p("settings.orgRoleDetail.enabledCount",{enabledCount:C,total:c.length});let z;e[30]!==U?(z=s.jsx(Me,{variant:"secondary",className:"text-xs text-muted-foreground",children:U}),e[30]=U,e[31]=z):z=e[31];let k;e[32]!==_?(k=_?s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=_,e[33]=k):k=e[33];let $;e[34]!==z||e[35]!==k?($=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[z,k]}),e[34]=z,e[35]=k,e[36]=$):$=e[36];let V;e[37]!==$||e[38]!==w?(V=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:I,children:[w,$]}),e[37]=$,e[38]=w,e[39]=V):V=e[39],v=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[V,_&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[y.map(G=>{const q=O(G.id),W=()=>{if(!h){if(f){u(l,x,G.id);return}a(l,G.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!h&&"hover:bg-muted/50 cursor-pointer"),onClick:W,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:G.title})}),s.jsx("div",{onClick:Ns,children:h?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:q,disabled:!0,onCheckedChange:bs})})}),s.jsx(Le,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:q,onCheckedChange:W})})]},G.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>D(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=x,e[5]=f,e[6]=l,e[7]=_,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=h,e[14]=n,e[15]=r,e[16]=p,e[17]=N,e[18]=v}else v=e[18];return v}function Rs(t){return t+Ct}function bs(){}function Ns(t){return t.stopPropagation()}function Cs(t){return!t}function Ss(t){const e=X.c(33),{connection:l,selectedModels:n,allowAllModels:r,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:x,searchQuery:m,readOnly:f}=t,g=Jt(l.id);let a,u,h,d,p;if(e[0]!==x||e[1]!==r||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==g||e[8]!==f||e[9]!==m||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let _;e[16]!==l.label?(_=I=>({...I,id:I.modelId,provider:l.label}),e[16]=l.label,e[17]=_):_=e[17];const A=g.filter(vs).map(_),N=m.trim().toLowerCase(),D=N?A.filter(I=>I.title.toLowerCase().includes(N)||I.id.toLowerCase().includes(N)||I.provider?.toLowerCase().includes(N)):A;if(D.length===0){p=null;break e}const b=new Map;for(const I of D){const B=Ts(I.id,l.providerId),L=b.get(B)??{models:[],logo:null};L.models.push({id:I.id,title:Is(I.title),logo:I.logo}),!L.logo&&I.logo&&(L.logo=I.logo),b.set(B,L)}const O=Array.from(b.entries()).map(js).sort(Os),v=O.length===1||N.length>0;h="flex flex-col gap-3";const E=Et[l.providerId]??It;let C;e[18]!==l.providerId||e[19]!==E?(C=s.jsx("img",{src:E,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=E,e[20]=C):C=e[20];const y=Nt[l.providerId]??l.providerId;let i;e[21]!==y?(i=s.jsx("h4",{className:"text-sm font-medium",children:y}),e[21]=y,e[22]=i):i=e[22],e[23]!==i||e[24]!==C?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[C,i]}),e[23]=i,e[24]=C,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(I=>s.jsx(_s,{connectionId:l.id,subProviderId:I.id,subProviderName:I.name,groupLogo:I.logo,models:I.models,allConnectionModelIds:A.map(As),selectedModels:n,allowAllModels:r,allConnectionModelsSelected:x,onToggleModel:o,onExitAllowAll:c,readOnly:f,defaultExpanded:v},I.id))}e[0]=x,e[1]=r,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=g,e[8]=f,e[9]=m,e[10]=n,e[11]=a,e[12]=u,e[13]=h,e[14]=d,e[15]=p}else a=e[11],u=e[12],h=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let S;e[26]!==a||e[27]!==u?(S=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=S):S=e[28];let R;return e[29]!==h||e[30]!==d||e[31]!==S?(R=s.jsxs("div",{className:h,children:[d,S]}),e[29]=h,e[30]=d,e[31]=S,e[32]=R):R=e[32],R}function As(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function vs(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ms(t){const e=X.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:r,onModelSetChange:o,readOnly:c,searchQuery:x}=t,m=c===void 0?!1:c,f=ie(),g=K.useDeferredValue(x),a=Wt();let u;e[0]!==n||e[1]!==o?(u=(E,C)=>{const y=n[E]??[],i={...n};if(y.includes(C)){const I=y.filter(B=>B!==C);I.length===0?delete i[E]:i[E]=I}else i[E]=[...y,C];o(i)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const h=u;let d;e[3]!==n||e[4]!==r||e[5]!==o?(d=(E,C,y)=>{r(!1),o({...n,[E]:C.filter(i=>i!==y)})},e[3]=n,e[4]=r,e[5]=o,e[6]=d):d=e[6];const p=d,S=!m&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==S?(R=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=R):R=e[8];let _;e[9]!==l||e[10]!==r||e[11]!==o||e[12]!==m?(_=()=>{if(m)return;const E=!l;r(E),E&&o({})},e[9]=l,e[10]=r,e[11]=o,e[12]=m,e[13]=_):_=e[13];let A;e[14]!==f?(A=f("settings.orgRoleDetail.allModels"),e[14]=f,e[15]=A):A=e[15];let N;e[16]!==A?(N=s.jsx("span",{className:"text-sm font-medium",children:A}),e[16]=A,e[17]=N):N=e[17];let D;e[18]!==l||e[19]!==r||e[20]!==o||e[21]!==m||e[22]!==f?(D=s.jsx("div",{onClick:ys,children:m?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{children:s.jsx("p",{children:f("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:l,onCheckedChange:E=>{r(E),E&&o({})}})}),e[18]=l,e[19]=r,e[20]=o,e[21]=m,e[22]=f,e[23]=D):D=e[23];let b;e[24]!==R||e[25]!==_||e[26]!==N||e[27]!==D?(b=s.jsxs("div",{className:R,onClick:_,children:[N,D]}),e[24]=R,e[25]=_,e[26]=N,e[27]=D,e[28]=b):b=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==g||e[32]!==p||e[33]!==n||e[34]!==m||e[35]!==f||e[36]!==h?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:f("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(E=>s.jsx(K.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 animate-spin"}),f("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ss,{connection:E,selectedModels:n[E.id]??[],allowAllModels:l,onToggleModel:h,onExitAllowAll:p,allConnectionModelsSelected:(n[E.id]??[]).includes("*"),searchQuery:g,readOnly:m})},E.id)),e[29]=a,e[30]=l,e[31]=g,e[32]=p,e[33]=n,e[34]=m,e[35]=f,e[36]=h,e[37]=O):O=e[37];let v;return e[38]!==b||e[39]!==O?(v=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[b,O]}),e[38]=b,e[39]=O,e[40]=v):v=e[40],v}function Ds(){}function ys(t){return t.stopPropagation()}function ws(t){const e=X.c(75),{open:l,onOpenChange:n,selectedMemberIds:r,onAddMembers:o}=t,c=ie(),[x,m]=K.useState(""),f=K.useDeferredValue(x);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[a,u]=K.useState(g),{data:h}=_t();let d,p,S,R,_,A,N,D,b,O,v;if(e[1]!==h?.data?.members||e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==x||e[8]!==r||e[9]!==c){const z=h?.data?.members??[];let k;e[21]!==f?(k=F=>{const T=f.toLowerCase();return F.user?.name?.toLowerCase().includes(T)||F.user?.email?.toLowerCase().includes(T)},e[21]=f,e[22]=k):k=e[22];const $=z.filter(k);let V;e[23]!==o||e[24]!==n||e[25]!==a?(V=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=V):V=e[26],S=V,p=mt,O=l,v=n,d=ut,D="sm:max-w-md p-0";let G;e[27]!==c?(G=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=G):G=e[28];let q;e[29]!==G?(q=s.jsx(ft,{children:G}),e[29]=G,e[30]=q):q=e[30];let W;e[31]!==c?(W=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(gt,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==q||e[36]!==te?(b=s.jsxs(ht,{className:"px-6 pt-6",children:[q,te]}),e[35]=q,e[36]=te,e[37]=b):b=e[37],A="flex flex-col h-80";let se;e[38]!==c?(se=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=se):se=e[39],e[40]!==x||e[41]!==se?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:x,onChange:m,placeholder:se,className:"w-full"})}),e[40]=x,e[41]=se,e[42]=N):N=e[42],R="flex-1 overflow-auto",_=$.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(x?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:$.map(F=>{const T=F.role!=="owner",M=r.includes(F.id),H=a.includes(F.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!T||M?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(qe,{checked:H||M,onCheckedChange:()=>{!T||M||u(Q=>Q.includes(F.id)?Q.filter(J=>J!==F.id):[...Q,F.id])},disabled:!T||M}),s.jsx(bt,{url:F.user?.image??void 0,fallback:Rt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!T&&s.jsx(Me,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),M&&T&&s.jsx(Me,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=h?.data?.members,e[2]=f,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=x,e[8]=r,e[9]=c,e[10]=d,e[11]=p,e[12]=S,e[13]=R,e[14]=_,e[15]=A,e[16]=N,e[17]=D,e[18]=b,e[19]=O,e[20]=v}else d=e[10],p=e[11],S=e[12],R=e[13],_=e[14],A=e[15],N=e[16],D=e[17],b=e[18],O=e[19],v=e[20];let E;e[43]!==R||e[44]!==_?(E=s.jsx("div",{className:R,children:_}),e[43]=R,e[44]=_,e[45]=E):E=e[45];let C;e[46]!==E||e[47]!==A||e[48]!==N?(C=s.jsxs("div",{className:A,children:[N,E]}),e[46]=E,e[47]=A,e[48]=N,e[49]=C):C=e[49];let y;e[50]!==c?(y=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=y):y=e[51];let i;e[52]!==y?(i=s.jsx(xt,{children:y}),e[52]=y,e[53]=i):i=e[53];const I=a.length===0;let B;e[54]!==a.length||e[55]!==c?(B=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=B):B=e[56];let L;e[57]!==S||e[58]!==I||e[59]!==B?(L=s.jsx(pt,{onClick:S,disabled:I,children:B}),e[57]=S,e[58]=I,e[59]=B,e[60]=L):L=e[60];let Y;e[61]!==i||e[62]!==L?(Y=s.jsxs(Tt,{className:"px-6 pb-6",children:[i,L]}),e[61]=i,e[62]=L,e[63]=Y):Y=e[63];let w;e[64]!==d||e[65]!==C||e[66]!==Y||e[67]!==D||e[68]!==b?(w=s.jsxs(d,{className:D,children:[b,C,Y]}),e[64]=d,e[65]=C,e[66]=Y,e[67]=D,e[68]=b,e[69]=w):w=e[69];let U;return e[70]!==p||e[71]!==w||e[72]!==O||e[73]!==v?(U=s.jsx(p,{open:O,onOpenChange:v,children:w}),e[70]=p,e[71]=w,e[72]=O,e[73]=v,e[74]=U):U=e[74],U}function Ps(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:r,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:x,onAddMemberDialogOpenChange:m}=t,f=r===void 0?!1:r,g=o===void 0?void 0:o,a=ie(),u=K.useDeferredValue(c),{data:h}=_t();let d,p,S;if(e[0]!==h?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==f||e[5]!==g||e[6]!==c||e[7]!==a){const D=h?.data?.members??[];let b;e[11]!==l?(b=i=>l.includes(i.id),e[11]=l,e[12]=b):b=e[12];const O=D.filter(b);let v;e[13]!==u?(v=i=>{const I=u.toLowerCase();return i.user?.name?.toLowerCase().includes(I)||i.user?.email?.toLowerCase().includes(I)},e[13]=u,e[14]=v):v=e[14];const E=O.filter(v);let C;e[15]!==g||e[16]!==a?(C=g??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=a,e[17]=C):C=e[17];const y=C;S="flex flex-col h-full",d="flex-1 overflow-auto",p=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:E.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(bt,{url:i.user?.image??void 0,fallback:Rt(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),f?s.jsx(ye,{children:s.jsxs(we,{children:[s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(nt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:y})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:i.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>n(l.filter(I=>I!==i.id)),children:s.jsx(nt,{size:16})})]},i.id))}),e[0]=h?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=f,e[5]=g,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=S}else d=e[8],p=e[9],S=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let _;e[21]!==l||e[22]!==n?(_=D=>n([...l,...D]),e[21]=l,e[22]=n,e[23]=_):_=e[23];let A;e[24]!==x||e[25]!==l||e[26]!==m||e[27]!==_?(A=s.jsx(ws,{open:x,onOpenChange:m,selectedMemberIds:l,onAddMembers:_}),e[24]=x,e[25]=l,e[26]=m,e[27]=_,e[28]=A):A=e[28];let N;return e[29]!==S||e[30]!==R||e[31]!==A?(N=s.jsxs("div",{className:S,children:[R,A]}),e[29]=S,e[30]=R,e[31]=A,e[32]=N):N=e[32],N}function Ls(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(K.Suspense,{fallback:l,children:s.jsx(Ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const ks={owner:[],admin:[],user:[]};function Gs(t,e,l,n){const r=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:r,staticPermissions:ks[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},r=n.self||[],o=r.includes("*"),c=o?[]:r.filter(a=>a!=="*"),x={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const h of l)x[h.id]=u.includes("*")?h.tools?.map(d=>d.name)??[]:u;else{const h=l.find(d=>d.id===a);h&&(x[a]=u.includes("*")?h.tools?.map(d=>d.name)??[]:u)}const m=n.models||[],f=m.length===0||m.includes("*:*"),g={};if(!f)for(const a of m){const u=a.indexOf(":");if(u===-1)continue;const h=a.slice(0,u),d=a.slice(u+1);g[h]||(g[h]=[]),g[h].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:x,allowAllModels:f,modelSet:g,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,r]of Object.entries(t.toolSet))if(r.length>0){const c=e.find(x=>x.id===n)?.tools?.map(x=>x.name)??[];l[n]=c.length>0&&c.every(x=>r.includes(x))?["*"]:r}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[r,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${r}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?Gs(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function zs(t){const e=X.c(19),{readOnly:l,readOnlyMessage:n,onOpen:r}=t,o=n===void 0?void 0:n,c=ie();let x;e[0]!==o||e[1]!==c?(x=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=x):x=e[2];const m=x;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ye,{size:16}),e[3]=u):u=e[3];let h;e[4]!==c?(h=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=h):h=e[5];let d;e[6]!==h?(d=s.jsx(Pe,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[u,h]})})}),e[6]=h,e[7]=d):d=e[7];let p;e[8]!==m?(p=s.jsx(Le,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=p):p=e[9];let S;return e[10]!==d||e[11]!==p?(S=s.jsx(ye,{children:s.jsxs(we,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=S):S=e[12],S}let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ye,{size:16}),e[13]=f):f=e[13];let g;e[14]!==c?(g=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=g):g=e[15];let a;return e[16]!==r||e[17]!==g?(a=s.jsxs(ae,{variant:"outline",size:"sm",onClick:r,children:[f,g]}),e[16]=r,e[17]=g,e[18]=a):a=e[18],a}function Ys(t){const e=X.c(14),{locator:l}=Be(),n=$e(),r=Zt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let x;e[4]!==o||e[5]!==c?(x={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=x):x=e[6];const{data:m,isPending:f}=Fe(x);if(f||!r){let h;return e[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=h):h=e[7],h}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const a=g;let u;return e[10]!==r||e[11]!==a||e[12]!==t?(u=s.jsx(Fs,{...t,members:a,connections:r}),e[10]=r,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Fs({target:t,onBack:e,onSaved:l,members:n,connections:r}){const o=ie(),{locator:c}=Be(),x=$e(),m=rt(),f=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,h]=K.useState(f?"org":"mcp"),d=jt({resolver:vt(us),defaultValues:Vs(t,n,r)}),p=d.formState.isValid,S=d.formState.isDirty,R=at({mutationFn:async i=>{const I=Bs(i,r),B=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),L=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(w,U)=>{const z=n.filter(V=>V.role===(U??w)).map(V=>V.id),k=i.memberIds.filter(V=>!z.includes(V)),$=z.filter(V=>!i.memberIds.includes(V));for(const V of k){const G=await x.organization.updateMemberRole({memberId:V,role:[w]});if(G?.error)throw new Error(G.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const V of $){const G=await x.organization.updateMemberRole({memberId:V,role:["user"]});if(G?.error)throw new Error(G.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(L)return await Y(i.role.slug),i;if(i.role.id){const w=i.role.label.toLowerCase().replace(/\s+/g,"-"),U=i.role.slug,z=w!==U,k=await x.organization.updateRole({roleId:i.role.id,data:{permission:I,...z?{roleName:w}:{}}});if(k?.error)throw new Error(k.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(z?w:U,z?U:void 0),z?{...i,role:{...i.role,slug:w}}:i}else{const w=await x.organization.createRole({role:B,permission:I});if(w?.error)throw new Error(w.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const U of i.memberIds){const z=await x.organization.updateMemberRole({memberId:U,role:[B]});if(z?.error)throw new Error(z.error.message)}return{...i,role:{...i.role,id:w.data?.roleData?.id,slug:B}}}},onSuccess:(i,I)=>{m.invalidateQueries({queryKey:de.members(c)}),m.invalidateQueries({queryKey:de.organizationRoles(c)});const B=!I.role.id&&!I.role.slug,L=I.role.slug==="owner"&&!I.role.id;Ke(L?"role_members_updated":B?"role_created":"role_updated",{role_slug:I.role.slug??null}),ve.success(o(L?"settings.orgRoleDetail.membersUpdatedSuccessfully":B?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(i),l(i.role.id)},onError:i=>{ve.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),_=d.handleSubmit(i=>{if(!i.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(i)}),A=!g,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",D=[...g?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[b,O]=K.useState(""),[v,E]=K.useState(!1),C=i=>{h(i),O("")},y={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ne,{children:s.jsxs(ne.Content,{className:Z("flex flex-col",u!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ne.Title,{actions:A&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:_,disabled:R.isPending||!p||!S,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?dt(t.role,!0):Lt(d.watch("role.label")))}),g&&s.jsx(ct,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:D.map(i=>s.jsx("button",{type:"button",onClick:()=>C(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Qe,{value:b,onChange:O,placeholder:y[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(zs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>E(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!g&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:i=>d.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:b}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:i=>d.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>d.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:b}),u==="models"&&s.jsx(Ms,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:i=>d.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>d.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:b}),u==="members"&&s.jsx(Ls,{memberIds:d.watch("memberIds"),onMemberIdsChange:i=>d.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:b,addMemberDialogOpen:v,onAddMemberDialogOpenChange:E})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=X.c(6),{area:l,children:n}=t,{isPrivileged:r,loading:o,error:c}=ts();let x;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==r||e[4]!==o?(x=s.jsx(ss,{granted:r,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=r,e[4]=o,e[5]=x):x=e[5],x}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Hs(){const t=X.c(135),e=ie(),[l,n]=K.useState(""),[r,o]=K.useState(null),c=yt();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x={strict:!1},t[0]=x):x=t[0];const{role:m}=wt(x),{locator:f}=Be(),g=$e(),a=rt(),{customRoles:u,refetch:h}=Pt();let d;t[1]!==c?(d=j=>c({to:".",search:P=>({...P,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;let S;e:{if(!m){S=null;break e}if(m==="new"){S={kind:"new"};break e}if(m.startsWith("builtin-")){S={kind:"builtin",role:m.slice(8)};break e}let j;t[3]!==m?(j=ee=>ee.id===m,t[3]=m,t[4]=j):j=t[4];const P=u.find(j);S=P?{kind:"custom",role:P}:null}const R=S;let _;t[5]!==f?(_=de.members(f),t[5]=f,t[6]=_):_=t[6];let A;t[7]!==g?(A=()=>g.organization.listMembers(),t[7]=g,t[8]=A):A=t[8];let N;t[9]!==_||t[10]!==A?(N={queryKey:_,queryFn:A},t[9]=_,t[10]=A,t[11]=N):N=t[11];const{data:D}=Fe(N);let b;t[12]!==D?.data?.members?(b=D?.data?.members??[],t[12]=D?.data?.members,t[13]=b):b=t[13];const O=b;let v;t[14]!==O?(v=j=>O.filter(P=>P.role===j).length,t[14]=O,t[15]=v):v=t[15];const E=v;let C;if(t[16]!==u||t[17]!==E||t[18]!==l||t[19]!==e){let j;t[21]!==E||t[22]!==e?(j=ce=>({kind:"builtin",role:{...ce,memberCount:E(ce.role),label:e(ce.labelKey)}}),t[21]=E,t[22]=e,t[23]=j):j=t[23];const P=Qs.map(j);let ee;t[24]!==E?(ee=ce=>({kind:"custom",role:{...ce,memberCount:E(ce.role)}}),t[24]=E,t[25]=ee):ee=t[25];const St=u.map(ee);if(C=[...P,...St],l){const ce=l.toLowerCase();C=C.filter(At=>At.role.label.toLowerCase().includes(ce))}t[16]=u,t[17]=E,t[18]=l,t[19]=e,t[20]=C}else C=t[20];let y;t[26]!==g?(y=async j=>{const P=await g.organization.deleteRole({roleId:j});if(P?.error)throw new Error(P.error.message);return P?.data},t[26]=g,t[27]=y):y=t[27];const i=at({mutationFn:y,onSuccess:(j,P)=>{Ke("role_deleted",{role_id:P}),a.invalidateQueries({queryKey:de.members(f)}),a.invalidateQueries({queryKey:de.organizationRoles(f)}),ve.success(e("settings.roles.deletedSuccessfully")),h(),R?.kind==="custom"&&R.role.id===P&&p(void 0)},onError:Xs});let I;t[28]!==e?(I=e("settings.roles.columnRole"),t[28]=e,t[29]=I):I=t[29];let B;t[30]!==I?(B={id:"role",header:I,render:Js,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=I,t[31]=B):B=t[31];let L;t[32]!==e?(L=e("settings.roles.columnType"),t[32]=e,t[33]=L):L=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(Me,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Me,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let w;t[36]!==L||t[37]!==Y?(w={id:"type",header:L,render:Y,cellClassName:"w-28 shrink-0"},t[36]=L,t[37]=Y,t[38]=w):w=t[38];let U;t[39]!==e?(U=e("settings.roles.columnPermissions"),t[39]=e,t[40]=U):U=t[40];let z;t[41]!==e?(z=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const P=j.role,ee=[];return P.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):P.staticPermissionCount&&P.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:P.staticPermissionCount})),P.allowsAllConnections?ee.push(e("settings.roles.allConnections")):P.connectionCount&&P.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:P.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=z):z=t[42];let k;t[43]!==U||t[44]!==z?(k={id:"permissions",header:U,render:z,cellClassName:"flex-1 min-w-0"},t[43]=U,t[44]=z,t[45]=k):k=t[45];let $;t[46]!==e?($=e("settings.roles.columnMembers"),t[46]=e,t[47]=$):$=t[47];let V;t[48]!==$?(V={id:"members",header:$,render:Ws,cellClassName:"w-24 shrink-0"},t[48]=$,t[49]=V):V=t[49];let G;t[50]!==e?(G={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(kt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zs,children:s.jsx(Vt,{size:16})})}),s.jsx(Ut,{align:"end",onClick:qs,children:s.jsxs(Bt,{variant:"destructive",onClick:()=>{const P=j.role;P.id&&o({id:P.id,label:P.label})},children:[s.jsx(zt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=G):G=t[51];let q;t[52]!==B||t[53]!==w||t[54]!==k||t[55]!==V||t[56]!==G?(q=[B,w,k,V,G],t[52]=B,t[53]=w,t[54]=k,t[55]=V,t[56]=G,t[57]=q):q=t[57];const W=q;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const P=j.role;p(P.id)}},t[58]=p,t[59]=te):te=t[59];const se=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let P;return t[62]!==h||t[63]!==p?(P=()=>{h(),p(void 0)},t[62]=h,t[63]=p,t[64]=P):P=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:P},Ks(R))}let F;t[65]!==e?(F=e("settings.roles.pageTitle"),t[65]=e,t[66]=F):F=t[66];let T;t[67]!==F?(T=s.jsx(ne.Title,{children:F}),t[67]=F,t[68]=T):T=t[68];let M;t[69]!==e?(M=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=M):M=t[70];let H;t[71]===Symbol.for("react.memo_cache_sentinel")?(H=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=H):H=t[71];let Q;t[72]!==l||t[73]!==M?(Q=s.jsx(Qe,{value:l,onChange:n,placeholder:M,className:"w-full md:w-[375px]",onKeyDown:H}),t[72]=l,t[73]=M,t[74]=Q):Q=t[74];let J;t[75]!==p?(J=()=>p("new"),t[75]=p,t[76]=J):J=t[76];let oe;t[77]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(Ye,{size:16}),t[77]=oe):oe=t[77];let le;t[78]!==e?(le=e("settings.roles.createRole"),t[78]=e,t[79]=le):le=t[79];let me;t[80]!==J||t[81]!==le?(me=s.jsxs(ae,{onClick:J,children:[oe,le]}),t[80]=J,t[81]=le,t[82]=me):me=t[82];let ue;t[83]!==Q||t[84]!==me?(ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Q,me]}),t[83]=Q,t[84]=me,t[85]=ue):ue=t[85];let fe;t[86]!==l||t[87]!==e?(fe=l?s.jsx(tt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(tt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[86]=l,t[87]=e,t[88]=fe):fe=t[88];let ge;t[89]!==C||t[90]!==W||t[91]!==se||t[92]!==fe?(ge=s.jsx(Yt,{columns:W,data:C,isLoading:!1,onRowClick:se,emptyState:fe}),t[89]=C,t[90]=W,t[91]=se,t[92]=fe,t[93]=ge):ge=t[93];let he;t[94]!==T||t[95]!==ue||t[96]!==ge?(he=s.jsx(ne.Content,{children:s.jsx(ne.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[T,ue,ge]})})}),t[94]=T,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=r!==null;let ke;t[98]===Symbol.for("react.memo_cache_sentinel")?(ke=j=>!j&&o(null),t[98]=ke):ke=t[98];let xe;t[99]!==e?(xe=e("settings.roles.deleteRoleTitle"),t[99]=e,t[100]=xe):xe=t[100];let pe;t[101]!==xe?(pe=s.jsx(ft,{children:xe}),t[101]=xe,t[102]=pe):pe=t[102];const ze=r?.label??"";let Te;t[103]!==e||t[104]!==ze?(Te=e("settings.roles.deleteRoleConfirm",{role:ze}),t[103]=e,t[104]=ze,t[105]=Te):Te=t[105];let Ee;t[106]!==Te?(Ee=s.jsx(gt,{children:Te}),t[106]=Te,t[107]=Ee):Ee=t[107];let Ie;t[108]!==pe||t[109]!==Ee?(Ie=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=Ie):Ie=t[110];let _e;t[111]!==e?(_e=e("settings.roles.cancel"),t[111]=e,t[112]=_e):_e=t[112];let Re;t[113]!==_e?(Re=s.jsx(xt,{children:_e}),t[113]=_e,t[114]=Re):Re=t[114];let be;t[115]!==i||t[116]!==r?(be=()=>{r?.id&&i.mutate(r.id),o(null)},t[115]=i,t[116]=r,t[117]=be):be=t[117];let Ne;t[118]!==e?(Ne=e("settings.roles.delete"),t[118]=e,t[119]=Ne):Ne=t[119];let Ce;t[120]!==be||t[121]!==Ne?(Ce=s.jsx(pt,{onClick:be,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ne}),t[120]=be,t[121]=Ne,t[122]=Ce):Ce=t[122];let Se;t[123]!==Re||t[124]!==Ce?(Se=s.jsxs(Tt,{children:[Re,Ce]}),t[123]=Re,t[124]=Ce,t[125]=Se):Se=t[125];let Ae;t[126]!==Ie||t[127]!==Se?(Ae=s.jsxs(ut,{children:[Ie,Se]}),t[126]=Ie,t[127]=Se,t[128]=Ae):Ae=t[128];let Oe;t[129]!==Ve||t[130]!==Ae?(Oe=s.jsx(mt,{open:Ve,onOpenChange:ke,children:Ae}),t[129]=Ve,t[130]=Ae,t[131]=Oe):Oe=t[131];let Ge;return t[132]!==he||t[133]!==Oe?(Ge=s.jsxs(ne,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=Ge):Ge=t[134],Ge}function qs(t){return t.stopPropagation()}function Zs(t){return t.stopPropagation()}function Ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Js(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",dt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(ct,{size:12,className:"text-muted-foreground shrink-0"})]})}function Xs(t,e){Ke("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ve.error(t instanceof Error?t.message:"Failed to delete role")}function el(){const t=X.c(7),e=ie();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K.Suspense,{fallback:s.jsx(ne,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Hs,{})}),t[4]=r):r=t[4];let o;return t[5]!==n?(o=s.jsx(Dt,{fallback:n,children:r}),t[5]=n,t[6]=o):o=t[6],o}function Do(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{Do as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,l as w,j as a,i as j}from"./index-
|
|
1
|
+
import{c as b,l as w,j as a,i as j}from"./index-C8rlFaFO.js";import{i as N}from"./SearchMd-LbMkvaPD.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,j as s,E as $,r as v,w as k,B as _,t as w}from"./index-QeeIyPD-.js";import{i as F}from"./AlertCircle-BtNVN6lT.js";import{s as E}from"./Plus-BhgoGeba.js";import{s as B}from"./User01-4oxhkWpc.js";import{t as L}from"./Users01-CbDWoQDz.js";import{e as O,d as R,D as A,a as I,h as q,c as V}from"./dialog-B_MtszrV.js";import{I as z}from"./input-ksjqlSwm.js";import{L as N}from"./label-B8xrTNKP.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-BK6Fwx47.js";import{S as M}from"./skeleton-4wAys1SB.js";import{T as Q}from"./textarea-B0BnrQRd.js";import{P as C}from"./index-F-zmfSqw.js";import{c as U}from"./settings-section--wnksRdd.js";import{u as y}from"./use-t-BKpqHjpb.js";import{u as W,a as X}from"./use-secrets-C8ssS7Ik.js";import{R as Y}from"./require-capability-BMCPfqFj.js";import"./X-BJznV24Z.js";import"./tooltip-CfmdP-aL.js";import"./ChevronUp-Bu3KYaYp.js";import"./ChevronDown-CtpYRw0N.js";import"./sidebar-BjCGlNJL.js";import"./LayoutLeft-DgCOjEX2.js";import"./use-mobile-CEVETdVq.js";import"./card-BZY4DqkC.js";import"./ArrowUpRight-DPmhEMyl.js";import"./studio-tools-Dz5m3DDC.js";import"./use-capability-B2RpFGXs.js";import"./access-gate-CXUaT8Bg.js";import"./capability-load-error-D-GHd7kt.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(F,{size:16}),e[0]=o):o=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==n?(c=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=c):c=e[5],c}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),o=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const c=n;let l;e[3]!==o?(l=s.jsx(o,{size:12}),e[3]=o,e[4]=l):l=e[4];let a;return e[5]!==c||e[6]!==l?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,c]}),e[5]=c,e[6]=l,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let o;e[1]!==r.name?(o=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=o):o=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let c;e[5]!==o||e[6]!==n?(c=s.jsxs("div",{className:"flex items-center gap-2",children:[o,n]}),e[5]=o,e[6]=n,e[7]=c):c=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let a;e[10]!==c||e[11]!==l?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[c,l]})]}),e[10]=c,e[11]=l,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=o):o=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let c;e[3]!==n?(c=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=c):c=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let a;e[7]!==l?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=a):a=e[8];let u;e[9]!==c||e[10]!==a?(u=s.jsxs("div",{children:[c,a]}),e[9]=c,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[o,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,o]=v.useState("organization"),[n,c]=v.useState(""),[l,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){o("organization"),c(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!l))try{await m.mutateAsync({scope:i,name:n.trim(),value:l,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>o(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>c(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!l,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,o]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>o(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:o})]}),t[1]=i,t[2]=m):m=t[2],m}let n,c,l;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"":"s";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e("settings.secrets.secretsCount",{count:r.length,plural:p}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>o(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],c=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,l=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=c,t[7]=l}else n=t[5],c=t[6],l=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:o}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==c||t[27]!==l||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,c,l,a]}),t[25]=n,t[26]=c,t[27]=l,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(C.Title,{children:"Secrets"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[e,s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})})]})})})}),t[1]=r):r=t[1],r}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
|
|
1
|
+
import{c as j,j as s,E as $,r as v,w as k,B as _,t as w}from"./index-C8rlFaFO.js";import{i as F}from"./AlertCircle-Cvc_10Uv.js";import{s as E}from"./Plus-5VWQJEkS.js";import{s as B}from"./User01-CZgThaZQ.js";import{t as L}from"./Users01-IdyAszrF.js";import{e as O,d as R,D as A,a as I,h as q,c as V}from"./dialog-ChJw5xnr.js";import{I as z}from"./input-CWExGH7j.js";import{L as N}from"./label-BbLr7wPS.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-4-vdHbLT.js";import{S as M}from"./skeleton-DraYvTQP.js";import{T as Q}from"./textarea-B8dhUfp9.js";import{P as C}from"./index-Bj_MaVUP.js";import{c as U}from"./settings-section-DxqR9iml.js";import{u as y}from"./use-t-BeHordU2.js";import{u as W,a as X}from"./use-secrets-BYzFSfMf.js";import{R as Y}from"./require-capability-BBszzyH9.js";import"./X-CLG08ht8.js";import"./tooltip-DE_gqCm3.js";import"./ChevronUp-Ci-XiWb6.js";import"./ChevronDown-D_W2bIqv.js";import"./sidebar-AfeWMY1r.js";import"./LayoutLeft-COV7zlIC.js";import"./use-mobile-C57pT7o9.js";import"./card-CoG27DVs.js";import"./ArrowUpRight-DgI9ki5h.js";import"./studio-tools-B3FHZXsQ.js";import"./use-capability-BNcFOggs.js";import"./access-gate-B8spscer.js";import"./capability-load-error-DI4Ww9LY.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(F,{size:16}),e[0]=o):o=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==n?(c=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=c):c=e[5],c}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),o=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const c=n;let l;e[3]!==o?(l=s.jsx(o,{size:12}),e[3]=o,e[4]=l):l=e[4];let a;return e[5]!==c||e[6]!==l?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,c]}),e[5]=c,e[6]=l,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let o;e[1]!==r.name?(o=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=o):o=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let c;e[5]!==o||e[6]!==n?(c=s.jsxs("div",{className:"flex items-center gap-2",children:[o,n]}),e[5]=o,e[6]=n,e[7]=c):c=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let a;e[10]!==c||e[11]!==l?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[c,l]})]}),e[10]=c,e[11]=l,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=o):o=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let c;e[3]!==n?(c=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=c):c=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let a;e[7]!==l?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=a):a=e[8];let u;e[9]!==c||e[10]!==a?(u=s.jsxs("div",{children:[c,a]}),e[9]=c,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[o,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,o]=v.useState("organization"),[n,c]=v.useState(""),[l,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){o("organization"),c(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!l))try{await m.mutateAsync({scope:i,name:n.trim(),value:l,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>o(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>c(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!l,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,o]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>o(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:o})]}),t[1]=i,t[2]=m):m=t[2],m}let n,c,l;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"":"s";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e("settings.secrets.secretsCount",{count:r.length,plural:p}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>o(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],c=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,l=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=c,t[7]=l}else n=t[5],c=t[6],l=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:o}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==c||t[27]!==l||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,c,l,a]}),t[25]=n,t[26]=c,t[27]=l,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(C.Title,{children:"Secrets"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[e,s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})})]})})})}),t[1]=r):r=t[1],r}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as ze,r as N,l as Ee,j as n,B as Ge,i as Fn,n as vs,t as G,K as Ss}from"./index-C8rlFaFO.js";import{a1 as xs,a2 as bs,a3 as ys,H as In,J as zt,K as zn,P as Hn,i as Wn,a4 as _s,V as Un,W as Gn,a5 as js,G as ks,a6 as ws,L as qn,M as Rt,Q as Jn,U as Yn,N as Qn,_ as Xn,a7 as Zn,a8 as Rs,a9 as Nt,aa as Ns,S as ea,ab as tt,ac as Ds,ad as Vs,ae as Cs,af as Ts,e as Ps,k as As,ag as Ms,ah as Es,ai as Ks,aj as $s,r as Ot,ak as Bt,al as Os,am as ut,an as jt,ao as Bs,ap as Ls,aq as Ye,ar as Dn,as as Fs,at as kt,au as Lt,av as Is,aw as sn,ax as zs,ay as xt,az as Hs,aA as Ws,aB as Us,aC as Gs,aD as qs,aE as dt,aF as Js,aG as Ys,aH as Qs,m as Xs,aI as Vn,aJ as wt,aK as Zs,aL as er,aM as tr,aN as nr,aO as rn,aP as Cn,aQ as Tn,aR as bt,aS as Ft,aT as Pn,aU as ar,aV as on,aW as sr,aX as rr,aY as or,aZ as An,a_ as ir}from"./index-B_qFi_-_.js";import{t as lr}from"./ChevronDown-D_W2bIqv.js";import{_ as cn,T as ta,D as cr,x as na,$ as ur,a0 as dr}from"./agent-icon-BIj6WxKp.js";import{i as aa}from"./ChevronRight-BnIvJcIZ.js";import{n as mr}from"./ChevronUp-Ci-XiWb6.js";import{i as fr}from"./Globe01-qjaQZUfN.js";import{m as It}from"./automation-runs-_XAGR1m2.js";import{b as mt,T as ft,a as pt}from"./tooltip-DE_gqCm3.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-ChJw5xnr.js";import{I as br}from"./input-CWExGH7j.js";import{a as sa}from"./Copy01-Q4xZmPKp.js";import{b as yr}from"./ZoomOut-DAAhtu2Z.js";import{i as _r}from"./Settings02-CU2rilKq.js";import{s as jr}from"./Eye-BuukW7MV.js";import{s as ra}from"./TrendUp01-BmzCTIbp.js";import{s as un}from"./Plus-5VWQJEkS.js";import{s as oa}from"./Trash01-DxXosbkh.js";import{i as kr}from"./Zap-C6tkfs5m.js";import{d as it,a as ia,D as la,c as ca,j as wr}from"./dropdown-menu-B7HOgSu8.js";import{S as Rr,r as Mn,a as Nr,d as Dr,b as Vr,i as Cr,f as Tr,P as Pr,c as Ar}from"./page-seo-form-DeD_2a8R.js";import{b as Mr}from"./Tool01-DBXzU6aR.js";import{A as Er}from"./add-section-modal-De0GxBTc.js";import"./ArrowUp-Dq6JgHsq.js";import"./chat-context-glCfFIWX.js";import"./autosend-D-JHJKNK.js";import"./hooks-CJqrF4BQ.js";import"./use-mcp-client-PcphUWIj.js";import"./auth-Kymy4xkz.js";import"./decopilot-sse-pool-DEJZ4gJu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-B3FHZXsQ.js";import"./use-virtual-mcp-BtFe5DoR.js";import"./use-collections-u5tkBX1a.js";import"./use-ai-providers-CGzSWtp7.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-VInARyiN.js";import"./use-organization-settings-DBhnNnJm.js";import"./drawer-_WfOhyRU.js";import"./collection-search-DuPY-s4R.js";import"./SearchMd-LbMkvaPD.js";import"./use-mobile-C57pT7o9.js";import"./AreaChart-D4PMIsMV.js";import"./index-CHWLrEqX.js";import"./calendar-C9b1I5Xh.js";import"./X-CLG08ht8.js";import"./shell-layout-DvMdeukx.js";import"./avatar-1o2VQKTj.js";import"./User01-CZgThaZQ.js";import"./Users03-3HXi1aia.js";import"./SearchLg-BiyFAMx0.js";import"./Stars02-CdgckoDr.js";import"./XClose-BYq2BBpT.js";import"./CheckCircle-B5oIKeSF.js";import"./FilterLines-Do4UgzmV.js";import"./use-t-BeHordU2.js";import"./required-auth-layout-CR5_YK6W.js";import"./use-org-sso-BaYh30WC.js";import"./index-CWlzI7M3.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-DNcPUv7P.js";import"./use-registry-app-Dyfesgrg.js";import"./use-mcp-tools-CakNulXp.js";import"./use-connection-CcmTBTY-.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DAAmwSgR.js";import"./mcp-oauth-B2KaqQoI.js";import"./extract-connection-data-oUFnwuwD.js";import"./use-members-JooO5O_z.js";import"./use-org-auth-client-C0qPMRhc.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-Cvc_10Uv.js";import"./DotsVertical-Bcfqjiks.js";import"./popover-kOy_asOa.js";import"./command-BB6Oir8o.js";import"./index-CR0rMz7E.js";import"./use-copy-CveeH2p4.js";import"./LinkExternal01-CyMOdGfe.js";import"./XCircle-pZ6nD22L.js";import"./companions-core-C-kZqiTC.js";import"./ZapSquare-DdKvM81Z.js";import"./Star01-D4LxiizA.js";import"./Image01-BWotytID.js";import"./Upload01-CXsTipbe.js";import"./form-BUM27CLj.js";import"./label-BbLr7wPS.js";import"./select-4-vdHbLT.js";import"./tabs-C1LpzuaJ.js";import"./Tool02-rl8XhSPG.js";import"./toggle-group-c5TjS6xS.js";import"./use-deco-credits-CV7sw9Em.js";import"./connection-card-7gBTmFox.js";import"./use-registry-connections-CTtHQqlB.js";import"./useInfiniteQuery-mNPfD3Pk.js";import"./use-infinite-scroll-BI8YTyTt.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CoG27DVs.js";import"./integration-icon-BXEpLE2r.js";import"./textarea-B8dhUfp9.js";import"./connection-form-helpers-CJKig9hy.js";import"./collection-tabs-CcN3J070.js";import"./badge-dHBIjKyY.js";import"./useSuspenseInfiniteQuery-DIVSilzv.js";import"./Monitor01-dLHbd0CB.js";import"./connect-desktop-dialog-CUGIAU17.js";import"./select-model-CVcEVUsi.js";import"./checkbox-BOAToSlJ.js";import"./skeleton-DraYvTQP.js";import"./Key01-BPZUhUcV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DxqR9iml.js";import"./ArrowUpRight-DgI9ki5h.js";import"./Stars01-HAbkffzq.js";import"./index-CWGwstEz.js";import"./Palette-tVNOj7Ym.js";import"./alert-dialog-D2oa47X8.js";import"./file-type-icon-CeQVzqDu.js";import"./toolbar-Daz4jqLs.js";import"./Package-B7Qii2Tl.js";import"./use-debounced-value-D1xFGN32.js";import"./index-DyXd0E61.js";import"./LayoutLeft-COV7zlIC.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DJxvpKl9.js";import"./empty-state-kSEyPCAz.js";import"./use-capability-BNcFOggs.js";import"./toolbar-icon-button-Bbbo7hyv.js";import"./Play-BE8nTtBp.js";import"./use-debounced-autosave-DFle-8Sb.js";import"./index-Bj_MaVUP.js";import"./sidebar-AfeWMY1r.js";import"./search-input-B6akQV4Y.js";import"./use-mcp-auth-status-DINFEYgi.js";import"./switch-CyZjNvfZ.js";import"./github-repo-picker-4TIPzYjR.js";import"./use-navigate-to-agent-DVHUkqpb.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./Users01-IdyAszrF.js";import"./use-secrets-BYzFSfMf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./monaco-editor-CJKnQM68.js";import"./use-file-configs-BEHJ-b8Q.js";import"./use-automations-Btiu7Z09.js";import"./automation-list-row-D-cT9rxb.js";import"./Globe04-CqIGMVDi.js";import"./HardDrive-DrLvUMYg.js";import"./Sun-Ca3eslhz.js";import"./Shield01-7KT2UKvg.js";import"./table-iG6kCmeS.js";import"./use-clock-tick-Dw7sAB29.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let u=typeof c.image=="string"?c.image:void 0;if(!u&&Array.isArray(c.allOf)){const g=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof g=="string"){const S=g.replace("#/definitions/",""),f=r[S];u=typeof f?.image=="string"?f.image:void 0}}if(u?.includes("{{{"))return u}function Or(m,e){if(!e)return;const r=xs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const u=bs(c,r.data);if(u)return ys(u)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function En(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function ua(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return ua(m.slice(0,e));const r=Array.from({length:e-m.length},(c,u)=>({id:crypto.randomUUID(),index:m.length+u}));return[...m,...r]}function da(m){const e=ze.c(20),{section:r,raw:c,meta:u}=m,g=r.isSavedBlock===!0,S=r.isMultivariate===!0;let f;e[0]!==u||e[1]!==c?(f=c&&u?Or(c,u):void 0,e[0]=u,e[1]=c,e[2]=f):f=e[2];const v=f;let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(yr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=h):h=e[3];let x;e[4]!==v?(x=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=x):x=e[5];let D;e[6]!==S||e[7]!==g?(D=g?{color:ks}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=g,e[8]=D):D=e[8];let k;e[9]!==D?(k=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:D}),e[9]=D,e[10]=k):k=e[10];const _=r.isHidden&&"line-through opacity-50";let j;e[11]!==_?(j=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=j):j=e[12];let o;e[13]!==r.label||e[14]!==j?(o=n.jsx("span",{className:j,children:r.label}),e[13]=r.label,e[14]=j,e[15]=o):o=e[15];let w;return e[16]!==x||e[17]!==k||e[18]!==o?(w=n.jsxs(n.Fragment,{children:[h,x,k,o]}),e[16]=x,e[17]=k,e[18]=o,e[19]=w):w=e[19],w}function ma(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=ze.c(64),{section:r,raw:c,meta:u,sortableId:g,selected:S,onSelect:f,onDelete:v,onDuplicate:h,onMakeReusable:x,onToggleHidden:D,onToggleLazy:k,onAddVariant:_,onDetach:j}=m,o=c?Wn(c.__resolveType??""):!1;let w;e[0]!==r?(w=_s(r),e[0]=r,e[1]=w):w=e[1];const i=w;let K;e[2]!==g?(K={id:g,animateLayoutChanges:Gr},e[2]=g,e[3]=K):K=e[3];const{attributes:E,listeners:M,setNodeRef:d,transform:T,isDragging:ae}=Un(K);let P;e[4]!==T?(P=Gn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=ae?0:void 0;let V;e[6]!==P||e[7]!==pe?(V={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=V):V=e[8];const ce=V;let F;e[9]!==r?(F=js(r),e[9]=r,e[10]=F):F=e[10];const te=F,oe="button",Pe=0;let O;e[11]!==f?(O=B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),f())},e[11]=f,e[12]=O):O=e[12];const ue=ae?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ma(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==u||e[18]!==c||e[19]!==r?(je=n.jsx(da,{section:r,raw:c,meta:u}),e[17]=u,e[18]=c,e[19]=r,e[20]=je):je=e[20];const $=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:B=>{B.stopPropagation(),k()},onPointerDown:Ur,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==D||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:B=>{B.stopPropagation(),D()},onPointerDown:Wr,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=D,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ia,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(ta,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let De;e[26]!==h?(De=B=>{B.stopPropagation(),h()},e[26]=h,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(sa,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let se;e[29]!==De?(se=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=se):se=e[30];let q;e[31]!==i||e[32]!==_?(q=i&&n.jsxs(it,{className:ws,onClick:B=>{B.stopPropagation(),_()},children:[n.jsx(ra,{className:"h-4 w-4"}),"Add variant"]}),e[31]=i,e[32]=_,e[33]=q):q=e[33];let J;e[34]!==te||e[35]!==x?(J=te&&n.jsxs(it,{className:Lr,onClick:B=>{B.stopPropagation(),x()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=x,e[36]=J):J=e[36];let ne;e[37]!==j||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:B=>{B.stopPropagation(),j()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=j,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=B=>{B.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(oa,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==se||e[47]!==q||e[48]!==J||e[49]!==ne||e[50]!==Se?(de=n.jsxs(la,{children:[X,n.jsxs(ca,{align:"end",className:"w-44",children:[se,q,J,ne,Se]})]}),e[46]=se,e[47]=q,e[48]=J,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let ye;return e[52]!==E||e[53]!==M||e[54]!==f||e[55]!==d||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==$||e[60]!==Ae||e[61]!==de||e[62]!==O?(ye=n.jsxs("div",{ref:d,style:ce,...E,...M,role:oe,tabIndex:Pe,onClick:f,onKeyDown:O,className:ie,children:[je,$,Ae,de]}),e[52]=E,e[53]=M,e[54]=f,e[55]=d,e[56]=ce,e[57]=ie,e[58]=je,e[59]=$,e[60]=Ae,e[61]=de,e[62]=O,e[63]=ye):ye=e[63],ye}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(){return!1}function qr(m){const e=ze.c(90),{listKey:r,rawSections:c,sections:u,meta:g,selectedIndex:S,onSelect:f,onReorder:v,onDelete:h,onDuplicate:x,onMakeReusable:D,onToggleHidden:k,onToggleLazy:_,onAddVariant:j,onDetach:o,onAddSection:w,canAddSection:i}=m,K=i===void 0?!0:i;let E;e[0]!==u.length?(E=()=>En(u.length),e[0]=u.length,e[1]=E):E=e[1];const[M,d]=N.useState(E),[T,ae]=N.useState(null),[P,pe]=N.useState(r),[V,ce]=N.useState(u.length),F=N.useRef(!1);P!==r?(pe(r),ce(u.length),d(En(u.length))):V!==u.length&&(ce(u.length),d(I=>Fr(I,u.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:qn},e[3]=oe):oe=e[3];const Pe=In(zt(Hn,te),zt(zn,oe));let O;e[4]!==M?(O=M.map(Jr),e[4]=M,e[5]=O):O=e[5];const ue=O;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=I=>{ae(String(I.active.id))},e[6]=ie):ie=e[6];const je=ie;let $;e[7]!==ue||e[8]!==v?($=I=>{ae(null);const{active:re,over:Q}=I;if(!Q||re.id===Q.id)return;const Ie=ue.indexOf(String(re.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(d(Qe=>ua(Rt([...Qe],Ie,he))),F.current=!0,requestAnimationFrame(()=>{F.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=$):$=e[9];const Ae=$;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{ae(null)},e[10]=X):X=e[10];const De=X;let ve,se,q,J,ne,le,ke,Se,de,ye,B,Z,we,Ke,$e;if(e[11]!==T||e[12]!==K||e[13]!==M||e[14]!==ue||e[15]!==Ae||e[16]!==g||e[17]!==w||e[18]!==j||e[19]!==h||e[20]!==o||e[21]!==x||e[22]!==D||e[23]!==f||e[24]!==k||e[25]!==_||e[26]!==c||e[27]!==u||e[28]!==S||e[29]!==Pe){Ke=Symbol.for("react.early_return_sentinel");e:{const I=re=>{F.current||f(re)};if(e[45]!==T||e[46]!==K||e[47]!==M||e[48]!==w||e[49]!==c||e[50]!==u){const re=T?M.find(Q=>Q.id===T):null;if(J=re!=null?u[re.index]:null,q=re!=null?c[re.index]:void 0,M.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!K;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==w||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:w,children:[he,"Add section"]})]}),e[56]=w,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(re&&"cursor-grabbing"),e[45]=T,e[46]=K,e[47]=M,e[48]=w,e[49]=c,e[50]=u,e[51]=q,e[52]=J,e[53]=we}else q=e[51],J=e[52],we=e[53];se=Jn,Se=Pe,de=Yn,ye=je,B=Ae,Z=De,ve=Qn,le=ue,ke=Xn,$e="space-y-1",ne=M.map(re=>{const Q=u[re.index];return Q?n.jsx(Ir,{sortableId:re.id,section:Q,raw:c[re.index],meta:g,selected:S===re.index,onSelect:()=>I(re.index),onDelete:()=>h(re.index),onDuplicate:()=>x(re.index),onMakeReusable:()=>D(re.index),onToggleHidden:()=>k(re.index),onToggleLazy:()=>_(re.index),onAddVariant:()=>j(re.index),onDetach:()=>o(re.index)},re.id):null})}e[11]=T,e[12]=K,e[13]=M,e[14]=ue,e[15]=Ae,e[16]=g,e[17]=w,e[18]=j,e[19]=h,e[20]=o,e[21]=x,e[22]=D,e[23]=f,e[24]=k,e[25]=_,e[26]=c,e[27]=u,e[28]=S,e[29]=Pe,e[30]=ve,e[31]=se,e[32]=q,e[33]=J,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=ye,e[40]=B,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],se=e[31],q=e[32],J=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],ye=e[39],B=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Ce;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Ce=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Ce):Ce=e[66];let Oe;e[67]!==q||e[68]!==J||e[69]!==g?(Oe=J?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(J,!1)),children:n.jsx(da,{section:J,raw:q,meta:g})}):null,e[67]=q,e[68]=J,e[69]=g,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(Zn,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==se||e[74]!==Se||e[75]!==de||e[76]!==ye||e[77]!==B||e[78]!==Z||e[79]!==Ce||e[80]!==Fe?(Me=n.jsxs(se,{sensors:Se,collisionDetection:de,onDragStart:ye,onDragEnd:B,onDragCancel:Z,children:[Ce,Fe]}),e[73]=se,e[74]=Se,e[75]=de,e[76]=ye,e[77]=B,e[78]=Z,e[79]=Ce,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!K;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==w||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:w,children:[Re,"Add section"]}),e[83]=w,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Jr(m){return m.id}function Kn(m){const e=ze.c(38),{open:r,initialName:c,autoLabel:u,isPending:g,onSubmit:S,onOpenChange:f}=m,v=g===void 0?!1:g,[h,x]=N.useState(c),[D,k]=N.useState(r);r!==D&&(k(r),r&&x(c));let _;e[0]!==v||e[1]!==f?(_=oe=>{!oe&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=_):_=e[2];const j=_;let o;e[3]!==v||e[4]!==h||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(h.trim())},e[3]=v,e[4]=h,e[5]=S,e[6]=o):o=e[6];const w=o;let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(pr,{children:"Rename variant"}),e[7]=i):i=e[7];const K=u||"the rule";let E;e[8]!==K?(E=n.jsxs(hr,{children:[i,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:K}),"."]})]}),e[8]=K,e[9]=E):E=e[9];let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=M):M=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=oe=>x(oe.target.value),e[11]=d):d=e[11];let T;e[12]!==u||e[13]!==v||e[14]!==h?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[M,n.jsx(br,{id:"variant-rename-name",value:h,onChange:d,placeholder:u,autoFocus:!0,disabled:v})]}),e[12]=u,e[13]=v,e[14]=h,e[15]=T):T=e[15];let ae;e[16]!==f?(ae=()=>f(!1),e[16]=f,e[17]=ae):ae=e[17];let P;e[18]!==v||e[19]!==ae?(P=n.jsx(Ge,{type:"button",variant:"outline",onClick:ae,disabled:v,children:"Cancel"}),e[18]=v,e[19]=ae,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Fn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let V;e[23]!==v||e[24]!==pe?(V=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=V):V=e[25];let ce;e[26]!==P||e[27]!==V?(ce=n.jsxs(vr,{children:[P,V]}),e[26]=P,e[27]=V,e[28]=ce):ce=e[28];let F;e[29]!==w||e[30]!==ce||e[31]!==E||e[32]!==T?(F=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[E,T,ce]})}),e[29]=w,e[30]=ce,e[31]=E,e[32]=T,e[33]=F):F=e[33];let te;return e[34]!==j||e[35]!==r||e[36]!==F?(te=n.jsx(xr,{open:r,onOpenChange:j,children:F}),e[34]=j,e[35]=r,e[36]=F,e[37]=te):te=e[37],te}const Yr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",fa="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function pa(m){const e=ze.c(5),{rule:r,matchers:c}=m,u=r?.__resolveType??"";let g;if(e[0]!==c||e[1]!==u){const h=c.find(x=>x.resolveType===u)?.iconName??Rs(u);g=cr(h),e[0]=c,e[1]=u,e[2]=g}else g=e[2];const S=g;if(!S)return null;let f;return e[3]!==S?(f=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=f):f=e[4],f}function $n(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function ha(m){const e=ze.c(16),{label:r,effectiveRule:c,matchers:u,canDelete:g,dragging:S,onRename:f,onDuplicate:v,onDelete:h}=m;let x;e[0]!==c||e[1]!==u?(x=n.jsx(pa,{rule:c,matchers:u}),e[0]=c,e[1]=u,e[2]=x):x=e[2];let D;e[3]!==r?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=D):D=e[4];let k;e[5]!==g||e[6]!==S||e[7]!==r||e[8]!==h||e[9]!==v||e[10]!==f?(k=!S&&n.jsxs(la,{children:[n.jsx(ia,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(ta,{size:14})})}),n.jsxs(ca,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:j=>{j.stopPropagation(),f?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:j=>{j.stopPropagation(),v?.()},children:[n.jsx(sa,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!g,onClick:j=>{j.stopPropagation(),h?.()},children:[n.jsx(oa,{size:14}),"Delete"]})]})]}),e[5]=g,e[6]=S,e[7]=r,e[8]=h,e[9]=v,e[10]=f,e[11]=k):k=e[11];let _;return e[12]!==x||e[13]!==D||e[14]!==k?(_=n.jsxs(n.Fragment,{children:[x,D,k]}),e[12]=x,e[13]=D,e[14]=k,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=ze.c(33),{entry:r,sortableId:c,isActive:u,canDelete:g,decofile:S,meta:f,matchers:v,onSelect:h,onRename:x,onDuplicate:D,onDelete:k}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:j,listeners:o,setNodeRef:w,transform:i,isDragging:K}=Un(_);let E;e[2]!==i?(E=Gn.Transform.toString(i?{...i,x:0}:null),e[2]=i,e[3]=E):E=e[3];const M=K?0:void 0;let d;e[4]!==E||e[5]!==M?(d={transform:E,opacity:M},e[4]=E,e[5]=M,e[6]=d):d=e[6];const T=d,ae=f??void 0;let P;e[7]!==S||e[8]!==r.variant.rule||e[9]!==ae?(P=Nt(r.variant.rule,S,ae),e[7]=S,e[8]=r.variant.rule,e[9]=ae,e[10]=P):P=e[10];const pe=P;let V;e[11]!==h?(V=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),h())},e[11]=h,e[12]=V):V=e[12];const ce=K?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",F=u?fa:Yr;let te;e[13]!==ce||e[14]!==F?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,F),e[13]=ce,e[14]=F,e[15]=te):te=e[15];let oe;e[16]!==g||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==k||e[21]!==D||e[22]!==x?(oe=n.jsx(ha,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:g,onRename:x,onDuplicate:D,onDelete:k}),e[16]=g,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=k,e[21]=D,e[22]=x,e[23]=oe):oe=e[23];let Pe;return e[24]!==j||e[25]!==o||e[26]!==h||e[27]!==w||e[28]!==T||e[29]!==te||e[30]!==oe||e[31]!==V?(Pe=n.jsx("div",{ref:w,style:T,...j,...o,onClick:h,onKeyDown:V,className:te,children:oe}),e[24]=j,e[25]=o,e[26]=h,e[27]=w,e[28]=T,e[29]=te,e[30]=oe,e[31]=V,e[32]=Pe):Pe=e[32],Pe}function to(){return!1}function no(m){const e=ze.c(9),{variant:r,decofile:c,meta:u,matchers:g}=m,S=u??void 0;let f;e[0]!==c||e[1]!==S||e[2]!==r.rule?(f=Nt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=f):f=e[3];const v=f;let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",fa),e[4]=h):h=e[4];let x;return e[5]!==v||e[6]!==g||e[7]!==r.label?(x=n.jsx("div",{className:h,children:n.jsx(ha,{label:r.label,effectiveRule:v,matchers:g,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=g,e[7]=r.label,e[8]=x):x=e[8],x}function ao(m){const e=ze.c(77),{listKey:r,variants:c,activeIndex:u,decofile:g,meta:S,matchers:f,onSelect:v,onReorder:h,onRename:x,onDuplicate:D,onDelete:k,onAdd:_}=m;let j;e[0]!==c?(j=()=>ln(c),e[0]=c,e[1]=j):j=e[1];const[o,w]=N.useState(j),[i,K]=N.useState(null),[E,M]=N.useState(r),[d,T]=N.useState(c.length);let ae;e[2]!==c?(ae=()=>$n(c),e[2]=c,e[3]=ae):ae=e[3];const[P,pe]=N.useState(ae),V=N.useRef(!1),ce=$n(c);E!==r?(M(r),T(c.length),pe(ce),w(ln(c))):d!==c.length?(T(c.length),pe(ce),w(ln(c))):P!==ce&&(pe(ce),w(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let F;e[4]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[4]=F):F=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:qn},e[5]=te):te=e[5];const oe=In(zt(Hn,F),zt(zn,te));let Pe;e[6]!==o?(Pe=o.map(so),e[6]=o,e[7]=Pe):Pe=e[7];const O=Pe,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);K(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let $;e[10]!==O||e[11]!==h?($=Me=>{K(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=O.indexOf(String(xe.id)),ee=O.indexOf(String(Re.id));me===-1||ee===-1||(w(I=>Qr(Rt([...I],me,ee))),V.current=!0,requestAnimationFrame(()=>{V.current=!1}),h(me,ee))},e[10]=O,e[11]=h,e[12]=$):$=e[12];const Ae=$;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{K(null)},e[13]=X):X=e[13];const De=X;let ve,se,q,J,ne,le,ke,Se,de,ye,B,Z,we;if(e[14]!==u||e[15]!==ue||e[16]!==g||e[17]!==o||e[18]!==O||e[19]!==Ae||e[20]!==je||e[21]!==f||e[22]!==S||e[23]!==_||e[24]!==k||e[25]!==D||e[26]!==x||e[27]!==v||e[28]!==oe){const Me=I=>{V.current||v(I)};B="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],se=Jn,le=oe,ke=Yn,Se=je,de=Ae,ye=De,ve=Qn,J=O,ne=Xn,we="space-y-0.5",q=o.map(I=>n.jsx(eo,{sortableId:I.id,entry:I,isActive:I.index===u,canDelete:ue,decofile:g,meta:S,matchers:f,onSelect:()=>Me(I.index),onRename:()=>x(I.index),onDuplicate:()=>D(I.index),onDelete:()=>k(I.index)},I.id)),e[14]=u,e[15]=ue,e[16]=g,e[17]=o,e[18]=O,e[19]=Ae,e[20]=je,e[21]=f,e[22]=S,e[23]=_,e[24]=k,e[25]=D,e[26]=x,e[27]=v,e[28]=oe,e[29]=ve,e[30]=se,e[31]=q,e[32]=J,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=ye,e[39]=B,e[40]=Z,e[41]=we}else ve=e[29],se=e[30],q=e[31],J=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],ye=e[38],B=e[39],Z=e[40],we=e[41];let Ke;e[49]!==q||e[50]!==we?(Ke=n.jsx("div",{className:we,children:q}),e[49]=q,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==J||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:J,strategy:ne,children:Ke}),e[52]=ve,e[53]=J,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==i||e[58]!==g||e[59]!==f||e[60]!==S?(Le=i?n.jsx(no,{variant:i.variant,decofile:g,meta:S,matchers:f}):null,e[57]=i,e[58]=g,e[59]=f,e[60]=S,e[61]=Le):Le=e[61];let Ce;e[62]!==Le?(Ce=n.jsx(Zn,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Ce):Ce=e[63];let Oe;e[64]!==se||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==ye||e[70]!==$e||e[71]!==Ce?(Oe=n.jsxs(se,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:ye,children:[$e,Ce]}),e[64]=se,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=ye,e[70]=$e,e[71]=Ce,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==B||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:B,children:[Z,Oe]}),e[73]=B,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function ro(m){const e=ze.c(15),{schema:r,value:c,onChange:u,meta:g,decofile:S,onSaveReferencedBlock:f,sandbox:v}=m;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[x,D]=N.useState(h);let k;e[1]!==x?(k=x.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(na,{className:"size-3.5"})}),x.map((o,w)=>{const i=w===x.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[w>0&&n.jsx(aa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(x.slice(0,w+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",i?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${w}`)})]}),e[1]=x,e[2]=k):k=e[2];let _;e[3]!==x||e[4]!==S||e[5]!==g||e[6]!==u||e[7]!==f||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(ea,{schema:r,value:c,onChange:u,basePath:"",breadcrumbPath:x,onBreadcrumbChange:D,meta:g,decofile:S,onSaveReferencedBlock:f,sandbox:v}),e[3]=x,e[4]=S,e[5]=g,e[6]=u,e[7]=f,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let j;return e[12]!==k||e[13]!==_?(j=n.jsxs("div",{className:"space-y-2",children:[k,_]}),e[12]=k,e[13]=_,e[14]=j):j=e[14],j}function On(m){const e=ze.c(21),{activeSchema:r,formValue:c,formResetKey:u,onFormChange:g,onBreadcrumbChange:S,breadcrumbPath:f,emptyMessage:v,beforeForm:h,seoResolveType:x,siteDefaultSeo:D,meta:k,decofile:_,onSaveReferencedBlock:j,sandbox:o}=m;let w;e[0]!==f?(w=f===void 0?[]:f,e[0]=f,e[1]=w):w=e[1];const i=w;let K;e[2]!==r||e[3]!==i||e[4]!==_||e[5]!==u||e[6]!==c||e[7]!==k||e[8]!==S||e[9]!==g||e[10]!==j||e[11]!==o||e[12]!==x||e[13]!==D?(K=r&&c?x?n.jsx(Rr,{schema:r,resolveType:x,value:c,formResetKey:u,onChange:g,onBreadcrumbChange:S,siteDefaultSeo:D}):n.jsx(ea,{schema:r,value:c,onChange:g,basePath:"",breadcrumbPath:i,onBreadcrumbChange:S,meta:k,decofile:_,onSaveReferencedBlock:j,sandbox:o},u):null,e[2]=r,e[3]=i,e[4]=_,e[5]=u,e[6]=c,e[7]=k,e[8]=S,e[9]=g,e[10]=j,e[11]=o,e[12]=x,e[13]=D,e[14]=K):K=e[14];const E=K;let M;e[15]!==v||e[16]!==E?(M=E??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=E,e[17]=M):M=e[17];let d;return e[18]!==h||e[19]!==M?(d=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[h,M]})}),e[18]=h,e[19]=M,e[20]=d):d=e[20],d}const oo="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function io(m,e){return Ns(m,e,tt)}function lo(m){const e=ze.c(13),{pageKey:r,initialName:c,initialPath:u,onFieldChange:g}=m,[S,f]=N.useState(c),[v,h]=N.useState(u),[x,D]=N.useState(r);x!==r&&(D(r),f(c),h(u));let k;e[0]!==g?(k=i=>{f(i.target.value),g("name",i.target.value)},e[0]=g,e[1]=k):k=e[1];let _;e[2]!==S||e[3]!==k?(_=n.jsx("input",{type:"text",value:S,onChange:k,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=k,e[4]=_):_=e[4];let j;e[5]!==g?(j=i=>{h(i.target.value),g("path",i.target.value)},e[5]=g,e[6]=j):j=e[6];let o;e[7]!==v||e[8]!==j?(o=n.jsx("input",{type:"text",value:v,onChange:j,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=j,e[9]=o):o=e[9];let w;return e[10]!==_||e[11]!==o?(w=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=w):w=e[12],w}function Bn(m){const e=ze.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ra,{size:14}),e[0]=c):c=e[0];let u;e[1]!==r?(u=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=u):u=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=g):g=e[3];let S;return e[4]!==u?(S=n.jsxs(mt,{children:[u,g]}),e[4]=u,e[5]=S):S=e[5],S}function Ln(m){const e=ze.c(21),{currentRt:r,currentLabel:c,currentGlobalKey:u,matchers:g,globals:S,onSelect:f,onSelectGlobal:v,schema:h,formValue:x,onChange:D,formKey:k,formWrapperClassName:_,meta:j,decofile:o,onSaveReferencedBlock:w,sandbox:i}=m;let K;e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==S||e[4]!==g||e[5]!==f||e[6]!==v?(K=n.jsx(Ds,{currentRt:r,currentLabel:c,currentGlobalKey:u,matchers:g,globals:S,onSelect:f,onSelectGlobal:v}),e[0]=u,e[1]=c,e[2]=r,e[3]=S,e[4]=g,e[5]=f,e[6]=v,e[7]=K):K=e[7];let E;e[8]!==o||e[9]!==k||e[10]!==x||e[11]!==_||e[12]!==j||e[13]!==D||e[14]!==w||e[15]!==i||e[16]!==h?(E=h&&x&&n.jsx("div",{className:_,children:n.jsx(ro,{schema:h,value:x,onChange:D,meta:j,decofile:o,onSaveReferencedBlock:w,sandbox:i},k)}),e[8]=o,e[9]=k,e[10]=x,e[11]=_,e[12]=j,e[13]=D,e[14]=w,e[15]=i,e[16]=h,e[17]=E):E=e[17];let M;return e[18]!==K||e[19]!==E?(M=n.jsxs(n.Fragment,{children:[K,E]}),e[18]=K,e[19]=E,e[20]=M):M=e[20],M}function ac({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:u,currentPath:g,activePageBlockKey:S=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:h,initialEditSeo:x=!1,onExitSeo:D,onViewJsonFile:k,onVariantPreviewOverride:_}){const j=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:u}:null,{data:o,isLoading:w}=Vs(j),{data:i,isLoading:K}=Cs(j),E=Ts(),M=E?.entity?.id===e?E.entity.metadata?.siteSlug??null:null,[d,T]=N.useState(null),[ae,P]=N.useState(null),[pe,V]=N.useState(null),[ce,F]=N.useState(0),[te,oe]=N.useState(void 0),[Pe,O]=N.useState(null),[ue,ie]=N.useState(null),[je,$]=N.useState([]),[Ae,X]=N.useState(0),[De,ve]=N.useState(null),[se,q]=N.useState(null),[J,ne]=N.useState(null),[le,ke]=N.useState(!0),[Se,de]=N.useState(!1),[ye,B]=N.useState(!1),[Z,we]=N.useState(x),[Ke,$e]=N.useState(x);x&&!Ke&&($e(!0),we(!0),T(null),P(null),V(null),$([])),!x&&Ke&&$e(!1);const[Le,Ce]=N.useState(null),[Oe,Fe]=N.useState(void 0),[Me,xe]=N.useState([]),[Re,me]=N.useState(0),[ee,I]=N.useState(0),[re,Q]=N.useState(null),[Ie,he]=N.useState(null),[Qe,dn]=N.useState(null),ga=vs(),va=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[Sa,xa]=N.useState(g),[ba,ya]=N.useState(S),[_a,ja]=N.useState(f);(Sa!==g||ba!==S||_a!==f)&&(queueMicrotask(()=>Ht.flush()),xa(g),ya(S),ja(f),T(null),P(null),V(null),F(0),O(null),ie(null),I(0),Q(null),he(null),$([]),X(t=>t+1),we(!1),Ce(null),Fe(void 0),xe([]),me(t=>t+1));const be=As({orgSlug:m,virtualMcpId:e,branch:r}),Dt=Xs((t,a)=>{be.mutate({blockKey:t,data:a},{onSuccess:()=>h?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Wt=Ms({orgSlug:m,virtualMcpId:e,branch:r}),[yt,Vt]=N.useState(!1),Ut=N.useRef(null),ht=N.useRef(null),gt=N.useRef(null),Gt=N.useRef({}),qe=N.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||w||K)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Fn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const ka=Es(o),_e=!!f,He=_e?null:Ks(ka,g,S),R=_e?f:He?.key??null,qt=_e&&f?o[f]:void 0,mn=_e&&f&&qt?$s(f,qt):_e&&f?f:"",Ct=!_e&&R&&o[R]?o[R]:null,Jt=Z&&o&&i&&R&&He?Mn(o,{kind:"page",pageKey:R,pageName:String(He.name??""),path:String(He.path??"")},i):null,wa=Z?Ct?.seo:void 0,Yt=Oe!==void 0?Oe:wa,Ra=Z?Nr(Yt):void 0,Na=Jt?.seoTypeOptions??[],Da=Z&&i?Dr(i):"",fn=Le??Ra??{},Qt=Z&&Jt?Vr(fn,Jt):null,Va=Z&&Qt&&Cr(Yt)?Ot(Qt,i):null,Ca=Z?Tr(o,i)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:f}]}]:io(Ct?.sections,o??{}),Tt=Be.length>1,Ve=Math.min(ce,Be.length-1),nt=Be[Ve],H=nt?.sections??[],Te=Bt(H,o),pn=!_e&&Os(Ct?.sections);if(_e&&f&&Qe!==f){dn(f);const t=H[0],a=Te[0];if(t&&a){T(0),I(0),$([]);const s=ut(t,a,o);s&&(P(s.data),V(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),qe.current={rawSections:H,parsedSections:Te,decofile:o??{},activePageKey:R,pageVariants:Be,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:d};const Ta=()=>({multivariate:pn,index:Ve,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!R||!pn||t.length<=1){_(null);return}const s=Pn(R,{multivariate:!0,index:a,variants:t},o,i);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!R){_(null);return}const l=Ta(),p=Pn(R,l,o,i);if(!t||a<0){_(p.length>0?p:null);return}const y=ar({pageKey:R,page:l,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:i}),b=[...p,...y];_(b.length>0?b:null)},at=(t,a,s,l=d??-1,p=!1)=>{const y=Ye(t,a);if(!y){P(null),V(null),he(null),Q(null),p&&vt(null,l,s);return}const C=Dn(y,tt)[s];if(!C){P(null),V(null),he(null),Q(null),p&&vt(null,l,s);return}const Y=Hs(C.value,o);P(Y?.data??null),V(Y?.resolveType??null);const{resolveType:A,formValue:L}=jt(C.rule,o,i??void 0);he(A),Q(L),p&&vt(y,l,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=H[v],a=Te[v];if(t&&a)if(T(v),I(0),$([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(P(s.data),V(s.resolveType)):(P(null),V(null)),he(null),Q(null)}}const Pt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:u??void 0,siteSlug:M},Xt=pe&&i?Ot(pe,i):null,We=(t,a)=>{if(!R)return;const s=wt(o,R,t,Ve,Be);be.mutate({blockKey:R,data:s},{onSuccess:()=>a?.onSuccess?.()??h?.(),onError:l=>G.error(`Save failed: ${l.message}`)})},St=()=>{T(null),P(null),V(null),I(0),Q(null),he(null),$([]),X(t=>t+1)},Pa=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=qe.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current,A=l[a];if(!A)return;const L=p[a];if(!L)return;if(L.isSavedBlock){const W=L.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;be.mutate({blockKey:W,data:t},{onSuccess:()=>h?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!b)return;const z={...y[b]},ge=[...l];if(L.isMultivariate){const W=Ye(A,L);if(!W||!b)return;const U=rr(W,s,t);ge[a]=dt(A,L,U)}else if(L.isHidden){const W=Wn(A.__resolveType),U=W?{...A.section}:{...A},Ne=Array.isArray(U.variants)?[...U.variants]:[];Ne[0]&&(Ne[0]={...Ne[0],value:t}),U.variants=Ne,W?ge[a]={...A,section:U}:ge[a]=U}else L.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const W=z.sections,U=[...W?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),z.sections={...W,variants:U}}else z.sections=ge;be.mutate({blockKey:b,data:z},{onSuccess:()=>h?.(),onError:W=>G.error(`Save failed: ${W.message}`)})},on)},Aa=t=>{T(t),I(0),$([]),X(p=>p+1);const a=H[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const l=ut(a,s,o);if(!l){P(null),V(null),he(null),Q(null),vt(null,t,0);return}P(l.data),V(l.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;P(a),d!==null&&Pa(a,d)},Zt=t=>{if(!R||!o||!i||!He)return;const a={kind:"page",pageKey:R,pageName:String(He.name??""),path:String(He.path??"")},s=Mn(o,a,i);s&&Ht.save(R,()=>{const l=ga.getQueryData(Ss.decofile(va))?.[R];if(!l||typeof l!="object"||l===null||Array.isArray(l))return null;const p={...l,...Gt.current};return Gt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?Ar(a,s,p,t.inner):p})},Ma=(t,a)=>{R&&(Gt.current[t]=a,Zt())},Ea=(t,a)=>{if(!R)return;const s=Rt([...H],t,a);d!==null&&(d===t?T(a):t<d&&a>=d?T(d-1):t>d&&a<=d&&T(d+1)),We(s)},Ka=t=>{if(!R)return;const a=H.filter((s,l)=>l!==t);d===t?St():d!==null&&d>t&&T(d-1),We(a)},$a=t=>{if(!R)return;const a=H[t];if(!a)return;const s=[...H];s.splice(t+1,0,nr(a)),d!==null&&d>t&&T(d+1),We(s)},Oa=t=>{if(!R)return;const a=H[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const l=s.isHidden?er(a):tr(a);if(!l)return;const p=[...H];p[t]=l,d===t&&St(),We(p)},Ba=t=>{if(!R)return;const a=H[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const l=Zs(a);if(!l)return;const p=[...H];p[t]=l,d===t&&St(),We(p)},La=t=>{if(!R)return;const a=H[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const l=ut(a,s,o);if(!l?.data)return;const{name:p,...y}=l.data,b=[...H];s.isLazy?b[t]={...a,section:y}:b[t]=y,d===t&&St(),We(b)},Fa=t=>{if(!R)return;const a=[...H,{__resolveType:t.resolveType}],s=a.length-1;We(a,{onSuccess:()=>{de(!1),T(s),I(0),$([]),X(b=>b+1);const l=a[s],p=Bt(a,o)[s];if(!l||!p)return;if(p.isMultivariate){at(l,p,0);return}const y=ut(l,p,o);if(!y){P(null),V(null),he(null),Q(null);return}P(y.data),V(y.resolveType),he(null),Q(null)}})},Ia=t=>{if(d===null)return;const a=H[d],s=Te[d];!a||!s?.isMultivariate||(I(t),$([]),X(l=>l+1),at(a,s,t,d,!0))},za=t=>{if(d===null||!R)return;const a=H[d],s=Te[d];if(!a||!s?.isMultivariate)return;const l=Ye(a,s);if(!l)return;const p=Ys(l,t);if(!p){G.error("Cannot delete the only variant.");return}const y=[...H];y[d]=dt(a,s,p);const b=p.variants;let C=ee;t===ee?C=Math.min(t,b.length-1):t<ee&&(C=ee-1),I(C),$([]),X(Y=>Y+1),at(y[d],s,C),We(y)},Ha=t=>{if(d===null||!R)return;const a=H[d],s=Te[d];if(!a||!s?.isMultivariate)return;const l=Ye(a,s);if(!l)return;const p=Qs(l,t),y=[...H];y[d]=dt(a,s,p);const b=t+1;I(b),$([]),X(C=>C+1),at(y[d],s,b),We(y)},Wa=(t,a)=>{if(d===null||!R||t===a)return;const s=H[d],l=Te[d];if(!s||!l?.isMultivariate)return;const p=Ye(s,l);if(!p)return;const y=qs(p,t,a),b=[...H];b[d]=dt(s,l,y);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),I(C),at(b[d],l,C),We(b)},en=t=>{const a=t??d;if(a===null||!R)return;const s=H[a],l=Te[a];if(!s||!l)return;const p=Ws(s,l);if(!p){G.error("This section cannot have variants.");return}const y=[...H];y[a]=p.section;const b=Bt(y,o)[a];if(!b?.isMultivariate){G.error("Could not add variant.");return}T(a),I(p.newVariantIndex),$([]),X(C=>C+1),at(p.section,b,p.newVariantIndex,a),We(y)},Ua=()=>{if(d===null||!R)return;const t=H[d],a=Te[d];if(!t||!a?.isMultivariate)return;const s=Ye(t,a);if(!s)return;const l=Js(t,a,s);if(!l){G.error("Could not remove variants.");return}const p=[...H];p[d]=l;const y=Bt(p,o)[d];if(!y)return;I(0),he(null),Q(null),$([]),X(C=>C+1);const b=ut(l,y,o);b?(P(b.data),V(b.resolveType)):(P(null),V(null)),vt(null,d,0),We(p)},Ga=async t=>{if(De===null||!R)return;const a=rn(t,o);if(a){G.error(a);return}const s=H[De],l=Te[De];if(!s||!l)return;const p=ut(s,l,o);if(!p){G.error("This section cannot be saved as global.");return}const y={...p.data,name:t};try{await be.mutateAsync({blockKey:t,data:y});const b=[...H];b[De]={__resolveType:t},await be.mutateAsync({blockKey:R,data:wt(o,R,b,Ve,Be)}),d===De&&St(),ve(null),G.success(`Saved global block "${t}"`),h?.()}catch(b){G.error(b instanceof Error?b.message:"Failed to save global block")}},vn=nt?.rule;if(Tt&&d===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},i??void 0);ie(t),O(a)}const At=i?Bs(i):[],Sn=i&&o?Ls(i,o):[],qa=!_e&&!!(u&&i&&o),Ja=ue&&i?Ot(ue,i):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,i)>0))try{await Wt.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:l}=qe.current;if(!a)return;const p={...s[a]},y={...p.sections},b=[...y.variants??[]],C=b[l],Y=C?.rule;if(xt(Y,s,i)){const A=Y?.__resolveType??"",L=s[A],z=typeof L?.name=="string"?L.name:A,{__resolveType:ge,...W}=t;be.mutate({blockKey:A,data:bt(ge??"",W,z)},{onSuccess:()=>h?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(b[l]={...C,rule:t}),p.sections={...y,variants:b},be.mutate({blockKey:a,data:p},{onSuccess:()=>h?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},on)},Ya=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:An};O({}),xn(a)},Qa=t=>{const a=t;O(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Xa=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:l}=qe.current;if(!a)return;const p=s[a],y=p?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const b=y;if(!Array.isArray(b.variants))return;const C=[...b.variants],Y=C[l];if(!Y)return;const A=kt(Y.rule,s,i),L=Ft(t);C[l]={...Y,rule:L};const z={...s,[a]:{...p,sections:{...b,variants:C}}},{resolveType:ge,formValue:W}=jt(L,z,i??void 0);ie(ge),O(W);try{await be.mutateAsync({blockKey:a,data:z[a]}),A&&A!==t&&await _t(A,z),h?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},bn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(!b)return;const A=l[a],L=p[a];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const W=(z.variants??[])[s]?.rule;if(xt(W,y,i)){const fe=W?.__resolveType??"",Ue=y[fe],Ze=typeof Ue?.name=="string"?Ue.name:fe,{__resolveType:rt,...et}=t;be.mutate({blockKey:fe,data:bt(rt??"",et,Ze)},{onSuccess:()=>h?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Vn(z,s,t),Ne=[...l];Ne[a]=dt(A,L,U);const Je=wt(y,b,Ne,Y,C);be.mutate({blockKey:b,data:Je},{onSuccess:()=>h?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},on))},Za=t=>{he(t),Q({}),bn(t?{__resolveType:t}:{__resolveType:An})},es=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};bn(s)},ts=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!b)return;const A=l[a],L=p[a];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const ge=z.variants??[],W=kt(ge[s]?.rule,y,i),U=Ft(t),Ne=Vn(z,s,U),Je=[...l];Je[a]=dt(A,L,Ne);const fe=wt(y,b,Je,Y,C),Ue={...y,[b]:fe},{resolveType:Ze,formValue:rt}=jt(U,Ue,i??void 0);he(Ze),Q(rt);try{await be.mutateAsync({blockKey:b,data:fe}),W&&W!==t&&await _t(W,Ue),h?.()}catch(et){G.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!He)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",g]});if(_e&&!qt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const st=d!==null?Te[d]??null:null,yn=d!==null?H[d]:null,_n=yn&&st?.isMultivariate?Ye(yn,st):null,lt=_n?Dn(_n,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,jn=d!==null&&st!==null,Kt=jn&&(ct||!!(Xt&&ae)),ns=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ns,as=_e?mn:st?.label??"",ss=Ie&&i?Ot(Ie,i):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[He.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],rs=Z&&He?[He.name,"SEO",...Me]:[],$t=Z?rs:Xe?nn.length>0?nn:[as]:nn,kn=()=>{if(!R)return;const t=o[R],a=Us(t.sections,H);if(!a)return;const s=Gs(a);be.mutate({blockKey:R,data:{...t,sections:a}},{onSuccess:()=>{F(s),T(null),P(null),V(null),$([]),O(null),ie(null)},onError:l=>G.error(`Save failed: ${l.message}`)})},an=(t,a,s)=>{if(!R)return;const l=o[R],p=l.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const y=p;if(!Array.isArray(y.variants))return;const b=t([...y.variants]);if(!b)return;const C=or(y,b),Y={...o,[R]:{...l,sections:C}};be.mutate({blockKey:R,data:Y[R]},{onSuccess:()=>{a?.(),s&&_t(s,Y)},onError:A=>G.error(`Save failed: ${A.message}`)})},os=t=>{q(null),F(t),T(null),P(null),V(null),$([]);const a=Be[t]?.rule,{resolveType:s,formValue:l}=jt(a,o??{},i??void 0);ie(s),O(l),hn(Be.map(p=>({rule:p.rule})),t)},is=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),F(s);const l=Rt(Be.map(p=>({rule:p.rule})),t,a);hn(l,s),an(p=>Rt(p,t,a))},ls=t=>{const a=Be[t]?.rule,s=kt(a,o??{},i??void 0);an(l=>l.length<=1?null:(l.splice(t,1),l),()=>{Be.length-1===1?F(0):t<Ve?F(Ve-1):t===Ve&&F(Math.max(0,t-1)),T(null),P(null),V(null),$([]),O(null),ie(null)},s)},cs=t=>{an(a=>ir(a,t),()=>{F(t+1),T(null),P(null),V(null),$([]),O(null),ie(null)})},us=async(t,a)=>{Mt();const s=qe.current.activePageKey,l=qe.current.decofile;if(!s)return;const p=l[s],y=p.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const b=y;if(!Array.isArray(b.variants))return;const C=[...b.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=Y.rule,L=a.trim();Vt(!0);try{if(!L){if(!xt(A,l,i)){q(null);return}const Je=A.__resolveType??"";C[t]={...Y,rule:Cn(A,l,i)};const fe={...l,[s]:{...p,sections:{...b,variants:C}}};await be.mutateAsync({blockKey:s,data:fe[s]}),await _t(Je,fe),q(null),h?.();return}const z=Tn(A,l,i);if(!z){G.error("Could not read this variant's matcher rule.");return}if(z.blockKey){await be.mutateAsync({blockKey:z.blockKey,data:bt(z.resolveType,z.data,L)}),q(null),h?.();return}const ge=sn(L),W=rn(ge,l);if(W){G.error(W);return}const U=bt(z.resolveType,z.data,L);let Ne=null;try{await be.mutateAsync({blockKey:ge,data:U}),Ne=ge,C[t]={...Y,rule:Ft(ge)},await be.mutateAsync({blockKey:s,data:{...p,sections:{...b,variants:C}}}),Ne=null}catch(Je){throw Ne&&await Wt.mutateAsync({blockKey:Ne}).catch(()=>{}),Je}q(null),G.success(`Saved matcher as global block "${L}"`),h?.()}catch(z){G.error(z instanceof Error?z.message:"Failed to rename variant")}finally{Vt(!1)}},ds=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:l,parsedSections:p,decofile:y,activePageKey:b,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!b)return;const A=l[s],L=p[s];if(!A||!L?.isMultivariate)return;const z=Ye(A,L);if(!z)return;const ge=z.variants??[],W=ge[t];if(!W?.rule||typeof W.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=W.rule,Ne=a.trim();Vt(!0);const Je=async fe=>{const Ue={...z,variants:fe},Ze=[...l];Ze[s]=dt(A,L,Ue);const rt=wt(y,b,Ze,Y,C);return await be.mutateAsync({blockKey:b,data:rt}),{...y,[b]:rt}};try{if(!Ne){if(!xt(U,y,i)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...W,rule:Cn(U,y,i)};const gs=await Je(Nn);await _t(ot,gs),ne(null),h?.();return}const fe=Tn(U,y,i);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await be.mutateAsync({blockKey:fe.blockKey,data:bt(fe.resolveType,fe.data,Ne)}),ne(null),h?.();return}const Ue=sn(Ne),Ze=rn(Ue,y);if(Ze){G.error(Ze);return}const rt=bt(fe.resolveType,fe.data,Ne);let et=null;try{await be.mutateAsync({blockKey:Ue,data:rt}),et=Ue;const ot=[...ge];ot[t]={...W,rule:Ft(Ue)},await Je(ot),et=null}catch(ot){throw et&&await Wt.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${Ne}"`),h?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},wn=()=>{St()},ms=t=>{Ce(t),Zt({inner:t})},fs=t=>{Fe(t),Zt({raw:t})},ps=()=>{Ce(null),xe([])},hs=()=>me(t=>t+1),Rn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Ce(null),Fe(void 0),xe([]),me(s=>s+1),D?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){$(je.slice(0,t)),X(s=>s+1);return}if(t===0){wn();return}if(t===1){$([]),X(s=>s+1);return}if(ct&&t===2){$([]),X(s=>s+1);return}const a=ct?2:1;$(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Rn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(na,{className:"size-4"})}),!_e&&Tt&&nt&&n.jsxs("button",{type:"button",onClick:wn,title:`Editing in variant: ${nt.label}`,className:Ee("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",oo),children:[n.jsx(pa,{rule:Nt(nt.rule,o??{},i??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(aa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Rn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),jn&&!ct&&!st?.isHidden&&R&&n.jsx(Bn,{onClick:()=>en()})]}),Xe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(lo,{pageKey:R,initialName:He.name,initialPath:He.path,onFieldChange:Ma})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(ur,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>k&&R?k(R):B(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(Bn,{onClick:kn})]})}),Z?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&R?n.jsx(Pr,{rawSeo:Yt,innerSeo:fn,defaultResolveType:Da,seoSchema:Va,activeResolveType:Qt,seoTypeOptions:Na,formResetKey:Re,siteDefaultSeo:Ca,onBreadcrumbChange:xe,onPersistRaw:fs,onInnerChange:ms,onClearForm:ps,onBumpFormKey:hs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${R??""}:${d??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ia,onRename:ne,onDuplicate:Ha,onDelete:za,onRemoveAll:Ua,onReorder:Wa,onAdd:()=>en()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Ln,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,i??void 0),currentGlobalKey:kt(Et?.rule,o??{},i??void 0)??void 0,matchers:At,globals:Sn,onSelect:Za,onSelectGlobal:ts,schema:ss,formValue:re,onChange:es,formKey:`${d??"none"}:${tn}:${Ie??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]})]}),n.jsx(On,{activeSchema:Xt,formValue:ae,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:$,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:i,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(On,{activeSchema:Xt,formValue:ae,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:$,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:i,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Tt&&R&&n.jsx(ao,{listKey:R,variants:Be,activeIndex:Ve,decofile:o??{},meta:i,matchers:At,onSelect:os,onReorder:is,onRename:q,onDuplicate:cs,onDelete:ls,onAdd:kn}),Tt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(mr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsx("div",{className:Ee("space-y-3",yt&&"pointer-events-none opacity-50"),children:n.jsx(Ln,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,i??void 0),currentGlobalKey:kt(nt?.rule,o??{},i??void 0)??void 0,matchers:At,globals:Sn,onSelect:Ya,onSelectGlobal:Xa,schema:Ja,formValue:Pe,onChange:Qa,formKey:`${Ve}:${ue??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${R??""}-${Ve}`,rawSections:H,sections:Te,meta:i,selectedIndex:d,onSelect:Aa,onReorder:Ea,onDelete:Ka,onDuplicate:$a,onMakeReusable:ve,onToggleHidden:Oa,onToggleLazy:Ba,onAddVariant:en,onDetach:La,onAddSection:()=>de(!0),canAddSection:qa})})]}),n.jsx(Is,{open:De!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:De!==null?sn(Te[De]?.label??""):"",isPending:be.isPending,onSubmit:Ga}),u&&n.jsx(Er,{open:Se,onOpenChange:de,meta:i,decofile:o,previewBaseUrl:u,onSelect:Fa}),ye&&R&&o&&n.jsx(zs,{open:ye,onOpenChange:B,pageKey:R,decofile:o}),se!==null&&n.jsx(Kn,{open:!0,initialName:xt(Be[se]?.rule,o??{},i??void 0)?Lt(Be[se]?.rule,o??{},tt,i??void 0):"",autoLabel:tt(Nt(Be[se]?.rule,o??{},i??void 0)),isPending:yt,onSubmit:async t=>{await us(se,t)},onOpenChange:t=>{!t&&!yt&&q(null)}}),J!==null&&n.jsx(Kn,{open:!0,initialName:xt(lt[J]?.rule,o??{},i??void 0)?Lt(lt[J]?.rule,o??{},tt,i??void 0):"",autoLabel:tt(Nt(lt[J]?.rule,o??{},i??void 0)),isPending:yt,onSubmit:async t=>{await ds(J,t)},onOpenChange:t=>{!t&&!yt&&ne(null)}})]})}export{ac as SectionsEditor};
|