decocms 4.161.0 → 4.161.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-DLzeWW_T.js → AlertCircle-DkjWcZD-.js} +1 -1
- package/dist/client/assets/{AreaChart-pzs3vvOZ.js → AreaChart-BhkonnRg.js} +1 -1
- package/dist/client/assets/{ArrowUp-CxvtSdkN.js → ArrowUp-DAA8boPY.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DPC10cdm.js → ArrowUpRight-D8TPuRuJ.js} +1 -1
- package/dist/client/assets/{Check-Cc1URztt.js → Check-De5xpJ0K.js} +1 -1
- package/dist/client/assets/{CheckCircle-CKFQ-ojS.js → CheckCircle-DeJIdYYq.js} +1 -1
- package/dist/client/assets/{ChevronDown-CGQNWnd1.js → ChevronDown-grOM3xSX.js} +1 -1
- package/dist/client/assets/{ChevronRight-D8qRMofp.js → ChevronRight-Cyogjxfm.js} +1 -1
- package/dist/client/assets/{ChevronUp-B1MCgjPT.js → ChevronUp-DIUedEx1.js} +1 -1
- package/dist/client/assets/{Copy01-B_uUNvC1.js → Copy01-DEkTleE-.js} +1 -1
- package/dist/client/assets/{CpuChip01-TRNsH071.js → CpuChip01-Dsk680MX.js} +1 -1
- package/dist/client/assets/{DotsVertical-CVUQFIq0.js → DotsVertical-BaMvQPx5.js} +1 -1
- package/dist/client/assets/{Eye-YusYyNwB.js → Eye-DdzBJpW0.js} +1 -1
- package/dist/client/assets/{FilterLines-CnFW7BL3.js → FilterLines-1IFdHyBL.js} +1 -1
- package/dist/client/assets/{HardDrive-Dy4jOdZa.js → HardDrive-CZF0RiCb.js} +1 -1
- package/dist/client/assets/{Key01-VrpEHfUN.js → Key01-qFWWm7I0.js} +1 -1
- package/dist/client/assets/{LayoutLeft-wIsOdHDO.js → LayoutLeft-D3dfvOJc.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C08SeV4q.js → LinkExternal01-BUH7ViZX.js} +1 -1
- package/dist/client/assets/{LogOut01-CjdQdSFl.js → LogOut01-GO407ARs.js} +1 -1
- package/dist/client/assets/{Monitor01-B18puA3q.js → Monitor01-BBb-96JI.js} +1 -1
- package/dist/client/assets/{Palette-PEJqZgK-.js → Palette-G-qrN-IT.js} +1 -1
- package/dist/client/assets/{Play-DlOwS4QV.js → Play-CkvF8PeT.js} +1 -1
- package/dist/client/assets/{Plus-BPKrERKg.js → Plus-DolMQAo4.js} +1 -1
- package/dist/client/assets/{SearchLg-CvzWiMCw.js → SearchLg-CFQzg9fN.js} +1 -1
- package/dist/client/assets/{SearchMd-CzLFcViF.js → SearchMd-DCX7P32_.js} +1 -1
- package/dist/client/assets/{Settings02-CzZapEug.js → Settings02-QFTejQVV.js} +1 -1
- package/dist/client/assets/{Shield01--IU-F9zy.js → Shield01-BlitQe4N.js} +1 -1
- package/dist/client/assets/{Star01-D-FnejVv.js → Star01-D0qlrfqR.js} +1 -1
- package/dist/client/assets/{Stars01-CO1ZsKSM.js → Stars01-2TnupN6q.js} +1 -1
- package/dist/client/assets/{Stars02-BQiI_7bO.js → Stars02-DbK2oBak.js} +1 -1
- package/dist/client/assets/{Sun-Czb40wa5.js → Sun-DVajpqnC.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BMdCcnbl.js → SwitchHorizontal01-DY4K5cqR.js} +1 -1
- package/dist/client/assets/{Tool01-Czi-69SR.js → Tool01-CgtDQOgO.js} +1 -1
- package/dist/client/assets/{Tool02-DbFQnKm7.js → Tool02-MSwzSxke.js} +1 -1
- package/dist/client/assets/{Trash01-CJ5MTqKD.js → Trash01-DSxLTY0P.js} +1 -1
- package/dist/client/assets/{TrendUp01-Dx0eGCHh.js → TrendUp01-djHA1GEE.js} +1 -1
- package/dist/client/assets/{Upload01-DEQX-M-s.js → Upload01-W82kShpH.js} +1 -1
- package/dist/client/assets/{User01-aqOULbJy.js → User01-CXTn_TP5.js} +1 -1
- package/dist/client/assets/{Users01-Bd1Jrc1q.js → Users01-DQVb_7oO.js} +1 -1
- package/dist/client/assets/{Users03-C8IQMkHF.js → Users03-DK2c0NaU.js} +1 -1
- package/dist/client/assets/{X-C8pctpGF.js → X-DsGAzzV8.js} +1 -1
- package/dist/client/assets/{XCircle-tVWlex9c.js → XCircle-DuADiFVm.js} +1 -1
- package/dist/client/assets/{XClose-D7FEmbyQ.js → XClose-BOYWq1vy.js} +1 -1
- package/dist/client/assets/{Zap-C7Zkgnxi.js → Zap-Djw_FpdI.js} +1 -1
- package/dist/client/assets/{ZapSquare-DWTmsWCw.js → ZapSquare-C3s49zNL.js} +1 -1
- package/dist/client/assets/{access-gate-ZUTDiUUH.js → access-gate-BRcWAcEH.js} +1 -1
- package/dist/client/assets/{add-section-modal-C8iRgsqy.js → add-section-modal-DkaZh9cy.js} +1 -1
- package/dist/client/assets/{agent-icon-D24e3m8a.js → agent-icon-D0etPDkN.js} +1 -1
- package/dist/client/assets/{agents-list-C0oRDsUe.js → agents-list-1nArnMzn.js} +1 -1
- package/dist/client/assets/{ai-providers-CdUQIxJh.js → ai-providers-XeksWCKW.js} +1 -1
- package/dist/client/assets/{alert-CThEG15M.js → alert-I-_PUhRM.js} +1 -1
- package/dist/client/assets/{alert-dialog-BoL4E1L1.js → alert-dialog-B3JnEiZT.js} +1 -1
- package/dist/client/assets/{app-editor-Ds20lEQ8.js → app-editor-BbkYtqwi.js} +1 -1
- package/dist/client/assets/{auth-DRteaRo7.js → auth-BkcPrlSH.js} +1 -1
- package/dist/client/assets/{auth-catchall-CmHISeLm.js → auth-catchall-JZDu0xii.js} +1 -1
- package/dist/client/assets/{auth-entry-Cen2uJU1.js → auth-entry-D376ANc2.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BTlAo9cV.js → auth-split-layout-DULW70yu.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DS1Wi7hh.js → authenticate-and-persist-oauth-DZxhoF_0.js} +1 -1
- package/dist/client/assets/{automation-list-row-E0ENAv6T.js → automation-list-row-y5_hhf0p.js} +1 -1
- package/dist/client/assets/{automation-runs-CefJAXbk.js → automation-runs-DNqF8MQa.js} +1 -1
- package/dist/client/assets/{automations-DmXT_6Vl.js → automations-BTGiuB5f.js} +1 -1
- package/dist/client/assets/{avatar-BoeRrsu0.js → avatar-ShBwmidu.js} +1 -1
- package/dist/client/assets/{badge-DHPndUF3.js → badge-CLGDkcax.js} +1 -1
- package/dist/client/assets/{block-document-Db0r3CJO.js → block-document-DKkHndgg.js} +1 -1
- package/dist/client/assets/{brand-context-D7JuaFk9.js → brand-context-DidwD5g4.js} +1 -1
- package/dist/client/assets/{buckets-D4viXEBf.js → buckets-BXy6rRmD.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DVXKdwpG.js → bulk-category-panel-Pp9TOqgP.js} +1 -1
- package/dist/client/assets/{calendar-C7p8Pfcr.js → calendar-BcaXLcUe.js} +1 -1
- package/dist/client/assets/{capability-load-error-DsipVLJU.js → capability-load-error-CqdQPRYW.js} +1 -1
- package/dist/client/assets/{card-Sy0U3-Wx.js → card-C98b87L-.js} +1 -1
- package/dist/client/assets/{category-editor-Cx_SOHSc.js → category-editor-BnVhTkaR.js} +1 -1
- package/dist/client/assets/{chat-context-B6_ywnmh.js → chat-context-DAYV5YFw.js} +1 -1
- package/dist/client/assets/{checkbox-6YGZXahW.js → checkbox-hx3qwtU4.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BP_evRWj.js → cli-auth-success-CSA4lo7W.js} +1 -1
- package/dist/client/assets/{collection-detail-DGMNodpe.js → collection-detail-Dnt_8ShC.js} +1 -1
- package/dist/client/assets/{collection-display-button-B_hVwDI3.js → collection-display-button-D7ZFqgmc.js} +1 -1
- package/dist/client/assets/{collection-search-Dp6F4e-r.js → collection-search-BujcF3uz.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-ByCaiD9J.js → collection-table-wrapper-Dxzi1B76.js} +1 -1
- package/dist/client/assets/{collection-tabs-D7xdcSRl.js → collection-tabs-1Doa_k8q.js} +1 -1
- package/dist/client/assets/{command-CIKiJ9mI.js → command-DTif1pCh.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-FPVSwQmJ.js → commerce-onboarding-CkLAXxz7.js} +1 -1
- package/dist/client/assets/companions-core-DyTSbEDy.js +1 -0
- package/dist/client/assets/{connect-C-UeFeiC.js → connect-BQJsmY0Z.js} +1 -1
- package/dist/client/assets/{connection-DzettGC3.js → connection-DT5hjP5L.js} +1 -1
- package/dist/client/assets/{connection-card-CJ1zmea6.js → connection-card-BEnBoaJQ.js} +1 -1
- package/dist/client/assets/{connection-detail-DpZmlaBz.js → connection-detail-3HClPo6D.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Cz30_EcT.js → connection-form-helpers-D1M4SXKF.js} +1 -1
- package/dist/client/assets/{connections-TMKh5xRR.js → connections-ok4_lFFO.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-B-yIIkq7.js → decopilot-sse-pool-Z3wBsgik.js} +1 -1
- package/dist/client/assets/{dialog-CLRqjexh.js → dialog-B1XOtEFa.js} +1 -1
- package/dist/client/assets/{domain-settings-CUvlEo5L.js → domain-settings-BX-8JSGW.js} +1 -1
- package/dist/client/assets/{drawer-CJG4KQ31.js → drawer-Bindqbrh.js} +1 -1
- package/dist/client/assets/{dropdown-menu-LjQEXf6I.js → dropdown-menu-B2utwqdh.js} +1 -1
- package/dist/client/assets/{empty-state-B6Syio-N.js → empty-state-ClLU6296.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CGhHKZyY.js → extract-connection-data-DSg0AjMi.js} +1 -1
- package/dist/client/assets/{file-explorer-VOixh5LM.js → file-explorer-5gFVDcag.js} +1 -1
- package/dist/client/assets/{form-5ssuGL92.js → form-ujVSU6EU.js} +1 -1
- package/dist/client/assets/{general-DaNZQo1V.js → general-BgWx-5sJ.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CLYbDMRM.js → github-repo-picker-CuyTuY6S.js} +1 -1
- package/dist/client/assets/{hooks-B8L2k77M.js → hooks-BSzBu2tD.js} +1 -1
- package/dist/client/assets/{index-Cj6bcenP.js → index-B6q32zYz.js} +1 -1
- package/dist/client/assets/{index-BZ3okQg1.js → index-Bhxc2Isb.js} +1 -1
- package/dist/client/assets/{index-D0lOXkKe.js → index-BwQT5Hhi.js} +1 -1
- package/dist/client/assets/{index-BXpucqbV.js → index-CBD4gVZR.js} +1 -1
- package/dist/client/assets/{index-q4OC2fZp.js → index-Cx7SoZn_.js} +1 -1
- package/dist/client/assets/{index-DAs-9e2l.js → index-DJEeCuky.js} +5 -5
- package/dist/client/assets/{index-BJtgm97J.js → index-DLYm4Sa-.js} +1 -1
- package/dist/client/assets/{index-B2y9Di3y.js → index-DvtCTmmx.js} +16 -16
- package/dist/client/assets/{index-Smwq5Lyw.js → index-DyrZQfe8.js} +1 -1
- package/dist/client/assets/{index-DdrlaVv3.js → index-PxBIb6oF.js} +1 -1
- package/dist/client/assets/{index-BwtPwDkT.js → index-WEdfBcak.js} +5 -5
- package/dist/client/assets/{index-redirect-6PCgRgDl.js → index-redirect-CzO62sP0.js} +1 -1
- package/dist/client/assets/{input-CWOf_06B.js → input-psV6HQEl.js} +1 -1
- package/dist/client/assets/{integration-icon-D00h7u0u.js → integration-icon-DjHXNUPP.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DuQcrN4y.js → invite-member-dialog-CB5VBjiU.js} +1 -1
- package/dist/client/assets/{label-CfD3KdnG.js → label-6xyucx-s.js} +1 -1
- package/dist/client/assets/{layout-C4_zOxUK.js → layout-CBOg45xC.js} +1 -1
- package/dist/client/assets/{login-DxINR4-H.js → login-Cxn9KXio.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cf4CBqV8.js → mcp-oauth-CKixkOtS.js} +1 -1
- package/dist/client/assets/{members-C1o0DQ12.js → members-CL8x8Krr.js} +1 -1
- package/dist/client/assets/{monaco-editor-34s3IYG-.js → monaco-editor-DJpDPKHP.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-ep4hubUc.js → monitoring-stats-row-DPROMALt.js} +1 -1
- package/dist/client/assets/{multi-select-C4rW-VO5.js → multi-select-Bh_v-l_m.js} +1 -1
- package/dist/client/assets/{oauth-callback-zvSVQgyF.js → oauth-callback-DutuJ6V_.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CLfKk4Fa.js → oauth-callback-ai-provider-C4S55pOq.js} +1 -1
- package/dist/client/assets/{onboarding-C3SYWIF2.js → onboarding-DuerzaiT.js} +1 -1
- package/dist/client/assets/{org-layout-BnI1QlcR.js → org-layout-of8A1jAC.js} +1 -1
- package/dist/client/assets/{organization-choice-DYNikqVU.js → organization-choice-B3rPtstm.js} +1 -1
- package/dist/client/assets/{orgs-Cm8eXAuw.js → orgs-3twuRrYh.js} +1 -1
- package/dist/client/assets/{page-seo-form-DR8h-gQE.js → page-seo-form-BY3nYdel.js} +1 -1
- package/dist/client/assets/{popover-BHleKabJ.js → popover-BGrrSZ8M.js} +1 -1
- package/dist/client/assets/{post-editor-DCkAKPIS.js → post-editor-C4XyjEMt.js} +1 -1
- package/dist/client/assets/{primitives-C0AROOTz.js → primitives-CbLkj1JF.js} +1 -1
- package/dist/client/assets/{profile-CL6IQ3Fl.js → profile-QV2jNue9.js} +1 -1
- package/dist/client/assets/project-app-view-CZZgc1s8.js +1 -0
- package/dist/client/assets/record-editor-Bk_Re_fD.js +1 -0
- package/dist/client/assets/{redirect-editor-UQYpv5C_.js → redirect-editor-s6PMTrlX.js} +1 -1
- package/dist/client/assets/registry-BTKEcIS_.js +2 -0
- package/dist/client/assets/{registry-layout-NhqIRzzz.js → registry-layout-DO-5mJZI.js} +1 -1
- package/dist/client/assets/{reports-D4D2Os_H.js → reports-CwFf2f6b.js} +1 -1
- package/dist/client/assets/{require-capability-CB4rHeMC.js → require-capability-BeOopecx.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BPywrnYN.js → required-auth-layout-BFWyMRf5.js} +1 -1
- package/dist/client/assets/{reset-password-Br0nO7M8.js → reset-password-C_-lQlSH.js} +1 -1
- package/dist/client/assets/{roles-BJ06-jIc.js → roles-D_oBaje3.js} +1 -1
- package/dist/client/assets/{search-input-Dm_eTyGl.js → search-input-Bfg6VxQW.js} +1 -1
- package/dist/client/assets/{secrets-DTzGP45M.js → secrets-k2GFZysm.js} +1 -1
- package/dist/client/assets/{sections-editor-COBfPCM9.js → sections-editor-BujDptuZ.js} +1 -1
- package/dist/client/assets/{select-BbYS1E3l.js → select-CWMyLghp.js} +1 -1
- package/dist/client/assets/{select-model-pTvdtWWw.js → select-model-CXvd3jI3.js} +1 -1
- package/dist/client/assets/self-tool-result-BpCEaqPw.js +1 -0
- package/dist/client/assets/{seo-editor-CMm4jEb4.js → seo-editor-Cxh8JRxE.js} +1 -1
- package/dist/client/assets/{settings-layout-D181ueaI.js → settings-layout-D-wc3B9V.js} +1 -1
- package/dist/client/assets/{settings-section-D2FgE1NH.js → settings-section-Z9R6HthO.js} +1 -1
- package/dist/client/assets/{shell-controls-DmHgFQFH.js → shell-controls-DJv-74jc.js} +1 -1
- package/dist/client/assets/{shell-layout-DfiKUJAA.js → shell-layout-C7_zhx2J.js} +1 -1
- package/dist/client/assets/{sidebar-BAUTb--2.js → sidebar-CGksZnes.js} +1 -1
- package/dist/client/assets/{skeleton-EeUOKHea.js → skeleton-BpfjGmFh.js} +1 -1
- package/dist/client/assets/{spinner-C3MmgrM8.js → spinner-D0HY4fdO.js} +1 -1
- package/dist/client/assets/{sso-0Ja-RNZl.js → sso-Bz5k2CGO.js} +1 -1
- package/dist/client/assets/{store-BnDXQRe5.js → store-DT_Iylxw.js} +1 -1
- package/dist/client/assets/store-registry-DwAm5lvb.js +2 -0
- package/dist/client/assets/{studio-tools-B0hGD5Gd.js → studio-tools-ChooDZCt.js} +1 -1
- package/dist/client/assets/{switch-B3bEiCXf.js → switch-BmoPsk_L.js} +1 -1
- package/dist/client/assets/{tab-id-7BtS1Sf2.js → tab-id-DpWn0fbM.js} +1 -1
- package/dist/client/assets/{table-osBzVewG.js → table-BluVU23Z.js} +1 -1
- package/dist/client/assets/{tabs-Dwdju4U8.js → tabs-C9Dri0XB.js} +1 -1
- package/dist/client/assets/{textarea-8dJKevB7.js → textarea-CMhJIDqb.js} +1 -1
- package/dist/client/assets/{toggle-group-oSJPzYP5.js → toggle-group-BK4yx2ic.js} +1 -1
- package/dist/client/assets/{toolbar-1x2OYBi0.js → toolbar-CJN41Q0U.js} +1 -1
- package/dist/client/assets/{tooltip-DpCQ4VIp.js → tooltip-DCC06XNr.js} +1 -1
- package/dist/client/assets/{use-ai-providers-fwwaVRz9.js → use-ai-providers-CTGRuhSY.js} +1 -1
- package/dist/client/assets/{use-automations-D1WDAUDw.js → use-automations-CTEnO1Zu.js} +1 -1
- package/dist/client/assets/{use-autosave-CYMXofan.js → use-autosave-CgHGIUlv.js} +1 -1
- package/dist/client/assets/{use-capability-DBxj3ZBy.js → use-capability-BTlnzwER.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Bc1o7i2J.js → use-clock-tick-Dg1-zfZ4.js} +1 -1
- package/dist/client/assets/{use-connection-Vb2VF6Hp.js → use-connection-BTIHIL2U.js} +1 -1
- package/dist/client/assets/{use-copy-CHvgH5Lh.js → use-copy-Bkx7pWID.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bz7S0S4E.js → use-create-virtual-mcp-ClJmipur.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CBX0zn4k.js → use-debounced-autosave-Dp_dA5sI.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B7GbcCk6.js → use-debounced-value-Dx_Znjq0.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Dp9kIRuI.js → use-deco-credits-CnnQh7bH.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-C7QhM8s6.js → use-decopilot-events-B84Jbaf1.js} +1 -1
- package/dist/client/assets/{use-delete-connection-jJGa1r2P.js → use-delete-connection-Dd7d9SGg.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-kLCH3aEw.js → use-deployment-admin-CElXlSvL.js} +1 -1
- package/dist/client/assets/{use-file-configs-CAMwu8_0.js → use-file-configs-DUlhqIgH.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BerLzyTb.js → use-infinite-scroll-CRM4xUSx.js} +1 -1
- package/dist/client/assets/{use-join-requests-CbWjVaiY.js → use-join-requests-B0JwpKM9.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BCEeD3p5.js → use-mcp-auth-status-DH8oUnNS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-FfMc8-rx.js → use-mcp-client-C78T1evw.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CJRQx9mh.js → use-mcp-tools-qcP_UOWU.js} +1 -1
- package/dist/client/assets/{use-members-DmA1JBPe.js → use-members-5U5mLxdD.js} +1 -1
- package/dist/client/assets/{use-mobile-Ce6m_tdj.js → use-mobile-BufL0gpx.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BywRVo4r.js → use-navigate-to-agent-bcvHJsmR.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-qRcVIjeO.js → use-org-auth-client-B93vTKrZ.js} +1 -1
- package/dist/client/assets/{use-org-sso-CeCv1N-8.js → use-org-sso-BpALHDeh.js} +1 -1
- package/dist/client/assets/{use-organization-roles-3X0CAGAI.js → use-organization-roles-CHjz2_ga.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DIoSfGxH.js → use-organization-settings-rcLpLxq6.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BW6UlzJ3.js → use-registry-connections-XjUGFr5z.js} +1 -1
- package/dist/client/assets/{use-secrets-6OQFbWZR.js → use-secrets-DVGBRr0e.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DtpMl-Yx.js → use-status-sounds-CNPY1kJ-.js} +1 -1
- package/dist/client/assets/{use-tags-xUIAqM8l.js → use-tags-d-ihZKch.js} +1 -1
- package/dist/client/assets/{use-view-mode-BQOaov8k.js → use-view-mode-CxLEvfyI.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-LvfbHggF.js → use-virtual-mcp-tTUO8PD5.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C1ye6sqf.js +1 -0
- package/dist/client/assets/{useQueries-_Xy4vtop.js → useQueries-CX-pbcRo.js} +1 -1
- package/dist/client/assets/{useRouterState-CdWmcBSP.js → useRouterState-DM9ViZSm.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CiYM_Dv6.js +1 -0
- package/dist/client/assets/{users-CnNuEk_v.js → users-hps1B13C.js} +1 -1
- package/dist/client/assets/{variant-calendar-By4oAdg7.js → variant-calendar--g4p8stV.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BNBmVxxx.js → view-mode-toggle-Cn3ICdtv.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/companions-core-a4SdW3uj.js +0 -1
- package/dist/client/assets/project-app-view-DxvjSATo.js +0 -1
- package/dist/client/assets/record-editor-TbGKJxnE.js +0 -1
- package/dist/client/assets/registry-DLDJcqtc.js +0 -2
- package/dist/client/assets/self-tool-result-Yn_3N0cu.js +0 -1
- package/dist/client/assets/store-registry-Kq12eoMm.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Cm_QWUqt.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Ghh8fdTf.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge,b as me,j as o,v as Ae,t as le,B as ie,F as De,o as Ie,a as Le,r as W,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-BwtPwDkT.js";import{a as ne,b as ye,D as ue,c as pe}from"./dropdown-menu-LjQEXf6I.js";import{a as Ge}from"./Users03-C8IQMkHF.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-CLYbDMRM.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-LvfbHggF.js";import{P as ce}from"./index-D0lOXkKe.js";import{a as Ue}from"./DotsVertical-CVUQFIq0.js";import{A as Re,H as fe,aZ as $e}from"./agent-icon-D24e3m8a.js";import{a as He,b as Ve}from"./Settings02-CzZapEug.js";import{s as Ke}from"./Trash01-CJ5MTqKD.js";import{p as qe,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-BywRVo4r.js";import{e as Qe,h as Je}from"./use-organization-settings-DIoSfGxH.js";import{u as Se}from"./use-capability-DBxj3ZBy.js";import{C as Ye}from"./card-Sy0U3-Wx.js";import{E as We}from"./empty-state-B6Syio-N.js";import{u as Ze}from"./use-create-virtual-mcp-Bz7S0S4E.js";import{u as Xe}from"./use-connection-Vb2VF6Hp.js";import{u as xe,S as et}from"./use-mcp-client-FfMc8-rx.js";import{p as tt,a as je}from"./deco-site-production-url-CaKZ7xBn.js";import{g as ot,f as st,a as it,G as nt,p as rt}from"./provision-repo-scoped-github-connection-CAXumITS.js";import{e as lt,d as at,a as ct,b as mt,c as dt}from"./dialog-CLRqjexh.js";import{C as ut}from"./collection-search-Dp6F4e-r.js";import{c as pt,d as gt,b as ft,f as ht,g as xt,e as jt,a as Ct,A as bt}from"./alert-dialog-BoL4E1L1.js";import{S as Dt}from"./search-input-Dm_eTyGl.js";import{s as Ce}from"./Plus-BPKrERKg.js";import"./Check-Cc1URztt.js";import"./ChevronRight-D8qRMofp.js";import"./use-debounced-value-B7GbcCk6.js";import"./authenticate-and-persist-oauth-DS1Wi7hh.js";import"./mcp-oauth-Cf4CBqV8.js";import"./auth-DRteaRo7.js";import"./LinkExternal01-C08SeV4q.js";import"./use-mcp-tools-CJRQx9mh.js";import"./extract-connection-data-CGhHKZyY.js";import"./metadata-dUsYcpuu.js";import"./sidebar-BAUTb--2.js";import"./LayoutLeft-wIsOdHDO.js";import"./use-mobile-Ce6m_tdj.js";import"./X-C8pctpGF.js";import"./tooltip-DpCQ4VIp.js";import"./AlertCircle-DLzeWW_T.js";import"./Tool01-Czi-69SR.js";import"./ArrowUp-CxvtSdkN.js";import"./Tool02-DbFQnKm7.js";import"./XCircle-tVWlex9c.js";import"./ArrowUpRight-DPC10cdm.js";import"./TrendUp01-Dx0eGCHh.js";import"./ZapSquare-DWTmsWCw.js";import"./CheckCircle-CKFQ-ojS.js";import"./ChevronDown-CGQNWnd1.js";import"./ChevronUp-B1MCgjPT.js";import"./Stars02-BQiI_7bO.js";import"./Copy01-B_uUNvC1.js";import"./CpuChip01-TRNsH071.js";import"./Eye-YusYyNwB.js";import"./FilterLines-CnFW7BL3.js";import"./Star01-D-FnejVv.js";import"./Palette-PEJqZgK-.js";import"./SwitchHorizontal01-BMdCcnbl.js";import"./HardDrive-Dy4jOdZa.js";import"./Key01-VrpEHfUN.js";import"./LogOut01-CjdQdSFl.js";import"./Monitor01-B18puA3q.js";import"./Sun-Czb40wa5.js";import"./Play-DlOwS4QV.js";import"./SearchLg-CvzWiMCw.js";import"./SearchMd-CzLFcViF.js";import"./Shield01--IU-F9zy.js";import"./Stars01-CO1ZsKSM.js";import"./Upload01-DEQX-M-s.js";import"./User01-aqOULbJy.js";import"./Users01-Bd1Jrc1q.js";import"./XClose-D7FEmbyQ.js";import"./Zap-C7Zkgnxi.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-B8L2k77M.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B-yIIkq7.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-B0hGD5Gd.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:G,showBetaBadge:x}=t,M=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ge,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(ne,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(we,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(ne,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(ne,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==M||e[23]!==G||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(ye,{side:G,align:M,className:"w-48",children:[D,l,w]}),e[22]=M,e[23]=G,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=_e(),c=me(),[G]=Ae(),x=G.language==="pt-BR"?qe:void 0,{mainAgentId:M}=Qe(),d=Je(),{granted:T}=Se("org:manage"),m=M===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx(Re,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(He,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(ne,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(ne,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(ne,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ke,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(ye,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let _;e[33]!==z||e[34]!==l?(_=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=_):_=e[35];let N;e[36]!==i.title?(N=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=N):N=e[37];let v;e[38]!==m||e[39]!==c?(v=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=v):v=e[40];let P;e[41]!==N||e[42]!==v?(P=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[N,v]}),e[41]=N,e[42]=v,e[43]=P):P=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==P||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[P,s]}),e[46]=P,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==_||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[_,p]}),e[49]=_,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let S;e[57]!==b?(S=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=S):S=e[58];let A;e[59]!==g||e[60]!==S?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,S]}),e[59]=g,e[60]=S,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Ye,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function _t(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function St(t,e){const i=e?_t(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function Nt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function vt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=De(),f=_e(),c=Ie(),{data:G}=Le.useSession(),[x,M]=W.useState(null),[d,T]=W.useState(null),[m,D]=W.useState(""),j=xe({connectionId:et,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=ot(y),l=Me({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Te({queryKey:de.decoSites(G?.user?.email),queryFn:()=>vt(r.slug),enabled:t&&!!G?.user?.email,staleTime:6e4,retry:!1}),_=O?.sites??[],N=s=>{s||(M(null),T(null),D("")),e(s)},v=_.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),P=!x||v.some(s=>s.name===x),F=Ee({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await st(B=>j.callTool(B),h.id),g=_.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=St(s,g.metadata),S=it(p,b.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:nt}));let A=null,k=null,I=null;const J=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await Ne(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),U=B.connId;if(!U)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=U;const{childConnectionId:$}=await rt({orgSlug:r.slug,sourceConnection:h,installationId:S.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=$;const K=B.icon??null,q=Nt(s),re=s.toLowerCase(),Y=tt(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:re,productionUrl:Y,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:S.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:q,pinnedViews:[{connectionId:U,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:U,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:U},{connection_id:$}]}}}),R=Q.structuredContent??Q;if(!R.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=R.item.id,{slug:q,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await J(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const S=b.queryKey;return S[1]===r.id&&S[3]==="collection"&&S[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),N(!1),localStorage.setItem(Fe.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(lt,{open:t,onOpenChange:N,children:o.jsxs(at,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ct,{className:"sr-only",children:o.jsx(mt,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(Ve,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ie,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(we,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&_.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&_.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),v.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>M(s.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(dt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ie,{variant:"outline",onClick:()=>N(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ie,{disabled:!x||!P||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ns(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=W.useState("");let G;t[0]===Symbol.for("react.memo_cache_sentinel")?(G={navigateOnCreate:!0},t[0]=G):G=t[0];const{createVirtualMCP:x,isCreating:M}=Ze(G),[d,T]=W.useState(null),[m,D]=W.useState(!1),[j,y]=W.useState(!1),{granted:a}=Se("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Be(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:ve}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:ve}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let _;t[5]!==e?(_=e("routes.agentsList.title"),t[5]=e,t[6]=_):_=t[6];let N;t[7]!==_?(N=o.jsx(ce.Title,{children:_}),t[7]=_,t[8]=N):N=t[8];let v;t[9]!==e?(v=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=v):v=t[10];let P;t[11]===Symbol.for("react.memo_cache_sentinel")?(P=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=P):P=t[11];let F;t[12]!==f||t[13]!==v?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:v,className:"w-full md:w-[375px]",onKeyDown:P}),t[12]=f,t[13]=v,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==M||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ie,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:M,align:"end"})]}),t[15]=a,t[16]=x,t[17]=M,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==N?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,p]}),t[23]=p,t[24]=N,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(We,{image:o.jsx($e,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ie,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:M,align:"center",showBetaBadge:!0})]})})}),S=h.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==S||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,S]}),t[26]=g,t[27]=b,t[28]=S,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Pe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=t[37];const B=!!d;let U;t[38]===Symbol.for("react.memo_cache_sentinel")?(U=L=>!L&&T(null),t[38]=U):U=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let K;t[41]!==$?(K=o.jsx(pt,{children:$}),t[41]=$,t[42]=K):K=t[42];let q;t[43]!==e?(q=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=q):q=t[44];const re=d?.title;let Y;t[45]!==re?(Y=o.jsx("span",{className:"font-medium text-foreground",children:re}),t[45]=re,t[46]=Y):Y=t[46];let Q;t[47]!==q||t[48]!==Y?(Q=o.jsxs(gt,{children:[q," ",Y,"."]}),t[47]=q,t[48]=Y,t[49]=Q):Q=t[49];let R;t[50]!==K||t[51]!==Q?(R=o.jsxs(ft,{children:[K,Q]}),t[50]=K,t[51]=Q,t[52]=R):R=t[52];let H;t[53]!==e?(H=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=H):H=t[54];let Z;t[55]!==H?(Z=o.jsx(ht,{children:H}),t[55]=H,t[56]=Z):Z=t[56];let X;t[57]!==e?(X=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=X):X=t[58];let ee;t[59]!==u||t[60]!==X?(ee=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:X}),t[59]=u,t[60]=X,t[61]=ee):ee=t[61];let te;t[62]!==Z||t[63]!==ee?(te=o.jsxs(jt,{children:[Z,ee]}),t[62]=Z,t[63]=ee,t[64]=te):te=t[64];let oe;t[65]!==R||t[66]!==te?(oe=o.jsxs(Ct,{children:[R,te]}),t[65]=R,t[66]=te,t[67]=oe):oe=t[67];let se;t[68]!==B||t[69]!==oe?(se=o.jsx(bt,{open:B,onOpenChange:U,children:oe}),t[68]=B,t[69]=oe,t[70]=se):se=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==se?(ae=o.jsxs(O,{children:[k,I,J,se]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=se,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ns as default};
|
|
1
|
+
import{c as ge,b as me,j as o,v as Ae,t as le,B as ie,F as De,o as Ie,a as Le,r as W,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-WEdfBcak.js";import{a as ne,b as ye,D as ue,c as pe}from"./dropdown-menu-B2utwqdh.js";import{a as Ge}from"./Users03-DK2c0NaU.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-CuyTuY6S.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-tTUO8PD5.js";import{P as ce}from"./index-BwQT5Hhi.js";import{a as Ue}from"./DotsVertical-BaMvQPx5.js";import{A as Re,H as fe,aZ as $e}from"./agent-icon-D0etPDkN.js";import{a as He,b as Ve}from"./Settings02-QFTejQVV.js";import{s as Ke}from"./Trash01-DSxLTY0P.js";import{p as qe,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-bcvHJsmR.js";import{e as Qe,h as Je}from"./use-organization-settings-rcLpLxq6.js";import{u as Se}from"./use-capability-BTlnzwER.js";import{C as Ye}from"./card-C98b87L-.js";import{E as We}from"./empty-state-ClLU6296.js";import{u as Ze}from"./use-create-virtual-mcp-ClJmipur.js";import{u as Xe}from"./use-connection-BTIHIL2U.js";import{u as xe,S as et}from"./use-mcp-client-C78T1evw.js";import{p as tt,a as je}from"./deco-site-production-url-CaKZ7xBn.js";import{g as ot,f as st,a as it,G as nt,p as rt}from"./provision-repo-scoped-github-connection-CAXumITS.js";import{e as lt,d as at,a as ct,b as mt,c as dt}from"./dialog-B1XOtEFa.js";import{C as ut}from"./collection-search-BujcF3uz.js";import{c as pt,d as gt,b as ft,f as ht,g as xt,e as jt,a as Ct,A as bt}from"./alert-dialog-B3JnEiZT.js";import{S as Dt}from"./search-input-Bfg6VxQW.js";import{s as Ce}from"./Plus-DolMQAo4.js";import"./Check-De5xpJ0K.js";import"./ChevronRight-Cyogjxfm.js";import"./use-debounced-value-Dx_Znjq0.js";import"./authenticate-and-persist-oauth-DZxhoF_0.js";import"./mcp-oauth-CKixkOtS.js";import"./auth-BkcPrlSH.js";import"./LinkExternal01-BUH7ViZX.js";import"./use-mcp-tools-qcP_UOWU.js";import"./extract-connection-data-DSg0AjMi.js";import"./metadata-dUsYcpuu.js";import"./sidebar-CGksZnes.js";import"./LayoutLeft-D3dfvOJc.js";import"./use-mobile-BufL0gpx.js";import"./X-DsGAzzV8.js";import"./tooltip-DCC06XNr.js";import"./AlertCircle-DkjWcZD-.js";import"./Tool01-CgtDQOgO.js";import"./ArrowUp-DAA8boPY.js";import"./Tool02-MSwzSxke.js";import"./XCircle-DuADiFVm.js";import"./ArrowUpRight-D8TPuRuJ.js";import"./TrendUp01-djHA1GEE.js";import"./ZapSquare-C3s49zNL.js";import"./CheckCircle-DeJIdYYq.js";import"./ChevronDown-grOM3xSX.js";import"./ChevronUp-DIUedEx1.js";import"./Stars02-DbK2oBak.js";import"./Copy01-DEkTleE-.js";import"./CpuChip01-Dsk680MX.js";import"./Eye-DdzBJpW0.js";import"./FilterLines-1IFdHyBL.js";import"./Star01-D0qlrfqR.js";import"./Palette-G-qrN-IT.js";import"./SwitchHorizontal01-DY4K5cqR.js";import"./HardDrive-CZF0RiCb.js";import"./Key01-qFWWm7I0.js";import"./LogOut01-GO407ARs.js";import"./Monitor01-BBb-96JI.js";import"./Sun-DVajpqnC.js";import"./Play-CkvF8PeT.js";import"./SearchLg-CFQzg9fN.js";import"./SearchMd-DCX7P32_.js";import"./Shield01-BlitQe4N.js";import"./Stars01-2TnupN6q.js";import"./Upload01-W82kShpH.js";import"./User01-CXTn_TP5.js";import"./Users01-DQVb_7oO.js";import"./XClose-BOYWq1vy.js";import"./Zap-Djw_FpdI.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-BSzBu2tD.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Z3wBsgik.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-ChooDZCt.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:G,showBetaBadge:x}=t,M=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ge,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(ne,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(we,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(ne,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(ne,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==M||e[23]!==G||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(ye,{side:G,align:M,className:"w-48",children:[D,l,w]}),e[22]=M,e[23]=G,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=_e(),c=me(),[G]=Ae(),x=G.language==="pt-BR"?qe:void 0,{mainAgentId:M}=Qe(),d=Je(),{granted:T}=Se("org:manage"),m=M===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx(Re,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(He,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(ne,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(ne,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(ne,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ke,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(ye,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let _;e[33]!==z||e[34]!==l?(_=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=_):_=e[35];let N;e[36]!==i.title?(N=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=N):N=e[37];let v;e[38]!==m||e[39]!==c?(v=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=v):v=e[40];let P;e[41]!==N||e[42]!==v?(P=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[N,v]}),e[41]=N,e[42]=v,e[43]=P):P=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==P||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[P,s]}),e[46]=P,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==_||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[_,p]}),e[49]=_,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let S;e[57]!==b?(S=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=S):S=e[58];let A;e[59]!==g||e[60]!==S?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,S]}),e[59]=g,e[60]=S,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Ye,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function _t(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function St(t,e){const i=e?_t(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function Nt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function vt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=De(),f=_e(),c=Ie(),{data:G}=Le.useSession(),[x,M]=W.useState(null),[d,T]=W.useState(null),[m,D]=W.useState(""),j=xe({connectionId:et,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=ot(y),l=Me({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Te({queryKey:de.decoSites(G?.user?.email),queryFn:()=>vt(r.slug),enabled:t&&!!G?.user?.email,staleTime:6e4,retry:!1}),_=O?.sites??[],N=s=>{s||(M(null),T(null),D("")),e(s)},v=_.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),P=!x||v.some(s=>s.name===x),F=Ee({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await st(B=>j.callTool(B),h.id),g=_.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=St(s,g.metadata),S=it(p,b.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:nt}));let A=null,k=null,I=null;const J=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await Ne(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),U=B.connId;if(!U)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=U;const{childConnectionId:$}=await rt({orgSlug:r.slug,sourceConnection:h,installationId:S.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=$;const K=B.icon??null,q=Nt(s),re=s.toLowerCase(),Y=tt(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:re,productionUrl:Y,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:S.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:q,pinnedViews:[{connectionId:U,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:U,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:U},{connection_id:$}]}}}),R=Q.structuredContent??Q;if(!R.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=R.item.id,{slug:q,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await J(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const S=b.queryKey;return S[1]===r.id&&S[3]==="collection"&&S[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),N(!1),localStorage.setItem(Fe.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(lt,{open:t,onOpenChange:N,children:o.jsxs(at,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ct,{className:"sr-only",children:o.jsx(mt,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(Ve,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ie,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(we,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&_.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&_.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),v.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>M(s.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(dt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ie,{variant:"outline",onClick:()=>N(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ie,{disabled:!x||!P||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ns(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=W.useState("");let G;t[0]===Symbol.for("react.memo_cache_sentinel")?(G={navigateOnCreate:!0},t[0]=G):G=t[0];const{createVirtualMCP:x,isCreating:M}=Ze(G),[d,T]=W.useState(null),[m,D]=W.useState(!1),[j,y]=W.useState(!1),{granted:a}=Se("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Be(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:ve}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:ve}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let _;t[5]!==e?(_=e("routes.agentsList.title"),t[5]=e,t[6]=_):_=t[6];let N;t[7]!==_?(N=o.jsx(ce.Title,{children:_}),t[7]=_,t[8]=N):N=t[8];let v;t[9]!==e?(v=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=v):v=t[10];let P;t[11]===Symbol.for("react.memo_cache_sentinel")?(P=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=P):P=t[11];let F;t[12]!==f||t[13]!==v?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:v,className:"w-full md:w-[375px]",onKeyDown:P}),t[12]=f,t[13]=v,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==M||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ie,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:M,align:"end"})]}),t[15]=a,t[16]=x,t[17]=M,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==N?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,p]}),t[23]=p,t[24]=N,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(We,{image:o.jsx($e,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ie,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:M,align:"center",showBetaBadge:!0})]})})}),S=h.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==S||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,S]}),t[26]=g,t[27]=b,t[28]=S,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Pe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=t[37];const B=!!d;let U;t[38]===Symbol.for("react.memo_cache_sentinel")?(U=L=>!L&&T(null),t[38]=U):U=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let K;t[41]!==$?(K=o.jsx(pt,{children:$}),t[41]=$,t[42]=K):K=t[42];let q;t[43]!==e?(q=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=q):q=t[44];const re=d?.title;let Y;t[45]!==re?(Y=o.jsx("span",{className:"font-medium text-foreground",children:re}),t[45]=re,t[46]=Y):Y=t[46];let Q;t[47]!==q||t[48]!==Y?(Q=o.jsxs(gt,{children:[q," ",Y,"."]}),t[47]=q,t[48]=Y,t[49]=Q):Q=t[49];let R;t[50]!==K||t[51]!==Q?(R=o.jsxs(ft,{children:[K,Q]}),t[50]=K,t[51]=Q,t[52]=R):R=t[52];let H;t[53]!==e?(H=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=H):H=t[54];let Z;t[55]!==H?(Z=o.jsx(ht,{children:H}),t[55]=H,t[56]=Z):Z=t[56];let X;t[57]!==e?(X=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=X):X=t[58];let ee;t[59]!==u||t[60]!==X?(ee=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:X}),t[59]=u,t[60]=X,t[61]=ee):ee=t[61];let te;t[62]!==Z||t[63]!==ee?(te=o.jsxs(jt,{children:[Z,ee]}),t[62]=Z,t[63]=ee,t[64]=te):te=t[64];let oe;t[65]!==R||t[66]!==te?(oe=o.jsxs(Ct,{children:[R,te]}),t[65]=R,t[66]=te,t[67]=oe):oe=t[67];let se;t[68]!==B||t[69]!==oe?(se=o.jsx(bt,{open:B,onOpenChange:U,children:oe}),t[68]=B,t[69]=oe,t[70]=se):se=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==se?(ae=o.jsxs(O,{children:[k,I,J,se]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=se,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ns as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{X,Y as D,a2 as Re,a4 as Ae,a5 as de,a3 as qe,b7 as Te,c as Z,b as oe,Z as ze,_ as He,r as J,j as s,a6 as lt,t as ae,av as Be,F as we,o as Ke,e as _e,K as le,n as Le,m as $e,B as re,p as Ve,v as ot,E as nt}from"./index-BwtPwDkT.js";import{i as at}from"./AlertCircle-DLzeWW_T.js";import{P as Ne}from"./index-D0lOXkKe.js";import{S as Me}from"./skeleton-EeUOKHea.js";import{b as Qe,a as Ee,S as Fe,c as ct}from"./settings-section-D2FgE1NH.js";import{u as Ce,b as Ie,i as dt,c as mt,p as ut,d as Ge}from"./use-ai-providers-fwwaVRz9.js";import{i as ft}from"./CheckCircle-CKFQ-ojS.js";import{b as pt,j as gt}from"./use-organization-settings-DIoSfGxH.js";import{e as ht,f as Ye,P as xt,h as Oe}from"./select-model-pTvdtWWw.js";import{u as vt}from"./use-debounced-autosave-CBX0zn4k.js";import{I as De}from"./input-CWOf_06B.js";import{T as Ue,a as bt}from"./toggle-group-oSJPzYP5.js";import{c as We,d as Je,b as Xe,f as Ze,g as et,e as tt,a as st,A as it}from"./alert-dialog-BoL4E1L1.js";import{u as Se}from"./studio-tools-B0hGD5Gd.js";import{s as yt}from"./Plus-BPKrERKg.js";import{p as jt,f as St}from"./pt-BR-CLy76QW2.js";import{c as _t}from"./Tool01-Czi-69SR.js";import{s as Ct}from"./Trash01-CJ5MTqKD.js";import{A as kt}from"./avatar-BoeRrsu0.js";import{i as Pt}from"./Settings02-CzZapEug.js";import{s as Nt}from"./Eye-YusYyNwB.js";import{b as It,a as Dt,d as wt,e as Kt,c as At}from"./dialog-CLRqjexh.js";import{S as Rt}from"./spinner-C3MmgrM8.js";import{R as Mt}from"./require-capability-CB4rHeMC.js";import"./sidebar-BAUTb--2.js";import"./LayoutLeft-wIsOdHDO.js";import"./use-mobile-Ce6m_tdj.js";import"./X-C8pctpGF.js";import"./tooltip-DpCQ4VIp.js";import"./card-Sy0U3-Wx.js";import"./ArrowUpRight-DPC10cdm.js";import"./use-mcp-client-FfMc8-rx.js";import"./auth-DRteaRo7.js";import"./drawer-CJG4KQ31.js";import"./chat-context-B6_ywnmh.js";import"./tab-id-7BtS1Sf2.js";import"./Check-Cc1URztt.js";import"./Copy01-B_uUNvC1.js";import"./hooks-B8L2k77M.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B-yIIkq7.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-LvfbHggF.js";import"./use-decopilot-events-C7QhM8s6.js";import"./checkbox-6YGZXahW.js";import"./select-BbYS1E3l.js";import"./ChevronDown-CGQNWnd1.js";import"./ChevronUp-B1MCgjPT.js";import"./Key01-VrpEHfUN.js";import"./SearchMd-CzLFcViF.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-B18puA3q.js";import"./ChevronRight-D8qRMofp.js";import"./Stars01-CO1ZsKSM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-aqOULbJy.js";import"./use-capability-DBxj3ZBy.js";import"./access-gate-ZUTDiUUH.js";import"./capability-load-error-DsipVLJU.js";X({title:D(),url:D(),icon:D()});X({registries:Ae(D(),X({enabled:de()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Re(D()).describe("List of MCP app_name or app_id values to hide from the store.")});const ce=X({keyId:D(),modelId:D(),title:D().optional()}).nullable();qe(["fast","smart","thinking","image","web_search","deep_research"]);qe(["fast","smart","thinking"]);const Et=X({tiers:X({fast:ce,smart:ce,thinking:ce,image:ce,web_search:ce,deep_research:ce})});X({tiers:X({fast:ce.optional(),smart:ce.optional(),thinking:ce.optional()})});X({ids:Re(D()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:de().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:de().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:de().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:de().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:de().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human.")});X({id:D().describe("Brand context ID"),name:D().describe("Company name"),domain:D().describe("Company domain (e.g. example.com)"),overview:D().describe("Company overview / description"),logo:D().nullable().optional().describe("Logo URL"),favicon:D().nullable().optional().describe("Favicon URL"),ogImage:D().nullable().optional().describe("OG image URL"),fonts:X({heading:D().optional().describe("Font family for headings"),body:D().optional().describe("Font family for body text"),code:D().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:D().optional().describe("Primary brand color (hex)"),secondary:D().optional().describe("Secondary brand color (hex)"),accent:D().optional().describe("Accent / highlight color (hex)"),background:D().optional().describe("Background color (hex)"),foreground:D().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Re(Ae(D(),Te())).nullable().optional().describe("Brand images"),metadata:Ae(D(),Te()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:D().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:de().optional().describe("Whether this is the default brand for the organization")});const Ft=e=>e.capabilities?.includes("image")===!0,Tt=e=>dt(e),$t=e=>mt(e),Ot=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Ft},{key:"web_search",filter:Tt},{key:"deep_research",filter:$t}];function Ut(e){const t=Z.c(26),{slot:i,onSlotChange:l,filterModels:n,defaultKeyId:a}=e,c=Ce(),[o,b]=J.useState(i?.keyId??a);let C;t[0]!==i?(C=()=>{i?.keyId&&b(i.keyId)},t[0]=i,t[1]=C):C=t[1];const y=i?.keyId;let r;t[2]!==y?(r=[y],t[2]=y,t[3]=r):r=t[3],J.useEffect(C,r);const d=o??a;let m;t[4]!==d||t[5]!==c?(m=d?c.find(v=>v.id===d):null,t[4]=d,t[5]=c,t[6]=m):m=t[6];const f=m,{models:h,isLoading:g}=Ie(n?d??void 0:void 0),k=n?g||h.some(n):!0;let p;t[7]!==i||t[8]!==f?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:f?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=f?.providerId,t[9]=p):p=t[9];const j=p,N=oe();if(n&&!k){let v;t[10]!==N?(v=N("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[10]=N,t[11]=v):v=t[11];let w;return t[12]!==v?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:v}),t[12]=v,t[13]=w):w=t[13],w}let S;t[14]!==N?(S=N("settings.simpleModeSection.pickModel"),t[14]=N,t[15]=S):S=t[15];let _;t[16]===Symbol.for("react.memo_cache_sentinel")?(_=v=>b(v),t[16]=_):_=t[16];let u;t[17]!==d||t[18]!==l?(u=v=>{const w=v.keyId??d??"";b(w),l({keyId:w,modelId:v.modelId,title:v.title})},t[17]=d,t[18]=l,t[19]=u):u=t[19];let P;return t[20]!==d||t[21]!==n||t[22]!==j||t[23]!==S||t[24]!==u?(P=s.jsx(ht,{variant:"bordered",placeholder:S,model:j,credentialId:d,filterModels:n,onCredentialChange:_,onModelChange:u}),t[20]=d,t[21]=n,t[22]=j,t[23]=S,t[24]=u,t[25]=P):P=t[25],P}function qt(e){const t=Z.c(10),{isPending:i,showSaved:l}=e,n=oe();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let o;return t[3]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=o):o=t[4],o}if(l){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ft,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let o;return t[8]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=o):o=t[9],o}return null}function zt(){const e=Z.c(58),t=oe(),i=Ce(),l=pt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ze(Et),e[0]=a):a=e[0];let c;e[1]!==l?(c={resolver:a,values:l,mode:"onChange"},e[1]=l,e[2]=c):c=e[2];const o=He(c),{mutate:b,isPending:C,isSuccess:y}=gt(),r=o.formState.isDirty;let d;e[3]!==o||e[4]!==l||e[5]!==t||e[6]!==b?(d={delayMs:250,save:async()=>{const x=o.getValues();b(x,{onSuccess:()=>o.reset(x,{keepValues:!0}),onError:A=>{o.reset(l),ae.error(t("settings.simpleModeSection.failedToSave",{error:A.message}))}})}},e[3]=o,e[4]=l,e[5]=t,e[6]=b,e[7]=d):d=e[7];const{schedule:m}=vt(d),f=i[0],h=i[1],g=i[2],{models:k}=Ie(f?.id),{models:p}=Ie(h?.id),{models:j}=Ie(g?.id);let N,S;e[8]!==o||e[9]!==n?(N=()=>{n||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},S=[n,o],e[8]=o,e[9]=n,e[10]=N,e[11]=S):(N=e[10],S=e[11]),J.useEffect(N,S);let _;e[12]!==i||e[13]!==o||e[14]!==f||e[15]!==h||e[16]!==g||e[17]!==k||e[18]!==p||e[19]!==j?(_=()=>{const x=o.getValues(),A=new Set(i.map(Ht)),R={};f?.id&&(R[f.id]=k),h?.id&&(R[h.id]=p),g?.id&&(R[g.id]=j);const K=L=>L!=null&&!A.has(L.keyId),I={fast:K(x.tiers.fast)?null:x.tiers.fast,smart:K(x.tiers.smart)?null:x.tiers.smart,thinking:K(x.tiers.thinking)?null:x.tiers.thinking,image:K(x.tiers.image)?null:x.tiers.image,web_search:K(x.tiers.web_search)?null:x.tiers.web_search,deep_research:K(x.tiers.deep_research)?null:x.tiers.deep_research},Y=!I.fast||!I.smart||!I.thinking||!I.image||!I.web_search||!I.deep_research,W=I.fast===x.tiers.fast&&I.smart===x.tiers.smart&&I.thinking===x.tiers.thinking&&I.image===x.tiers.image&&I.web_search===x.tiers.web_search&&I.deep_research===x.tiers.deep_research;if(!Y&&W)return;const $=ut(i,R);o.reset({tiers:{fast:I.fast??$.chat.fast,smart:I.smart??$.chat.smart,thinking:I.thinking??$.chat.thinking,image:I.image??$.image,web_search:I.web_search??$.webSearch,deep_research:I.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=f,e[15]=h,e[16]=g,e[17]=k,e[18]=p,e[19]=j,e[20]=_):_=e[20];const u=f?.id,P=h?.id,v=g?.id;let w;e[21]!==i||e[22]!==o||e[23]!==k||e[24]!==p||e[25]!==j||e[26]!==u||e[27]!==P||e[28]!==v?(w=[o,i,k,p,j,u,P,v],e[21]=i,e[22]=o,e[23]=k,e[24]=p,e[25]=j,e[26]=u,e[27]=P,e[28]=v,e[29]=w):w=e[29],J.useEffect(_,w);let V;e[30]!==t?(V=x=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[x]||x,e[30]=t,e[31]=V):V=e[31];const B=V;let O;e[32]!==t?(O=x=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[x]||"",e[32]=t,e[33]=O):O=e[33];const Q=O;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let M;e[36]!==t?(M=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=M):M=e[37];let q;e[38]!==M?(q=s.jsx("p",{className:"text-sm text-muted-foreground",children:M}),e[38]=M,e[39]=q):q=e[39];const G=y&&!r;let z;e[40]!==C||e[41]!==G?(z=s.jsx(qt,{isPending:C,showSaved:G}),e[40]=C,e[41]=G,e[42]=z):z=e[42];let E;e[43]!==q||e[44]!==z?(E=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[q,z]}),e[43]=q,e[44]=z,e[45]=E):E=e[45];let F;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==Q||e[49]!==B||e[50]!==m?(F=Ot.map(x=>s.jsx(lt,{control:o.control,name:`tiers.${x.key}`,render:A=>{const{field:R}=A;return s.jsx(Qe,{title:B(x.key),description:Q(x.key),action:s.jsx(Ut,{slot:R.value,defaultKeyId:i[0]?.id??null,filterModels:x.filter,onSlotChange:K=>{R.onChange(K),m()}})})}},x.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=Q,e[49]=B,e[50]=m,e[51]=F):F=e[51];let T;e[52]!==F?(T=s.jsx(Ee,{children:F}),e[52]=F,e[53]=T):T=e[53];let H;return e[54]!==U||e[55]!==E||e[56]!==T?(H=s.jsxs(Fe,{title:U,headerClassName:"pl-0",children:[E,T]}),e[54]=U,e[55]=E,e[56]=T,e[57]=H):H=e[57],H}function Ht(e){return e.id}const Bt={usd:[10,20,100],brl:[50,100,500]};function Lt(){const e=Z.c(30),t=oe(),i=Se(),[l,n]=J.useState(!1);let a;e[0]!==t?(a=u=>{ae.error(t("settings.decoCreditsHero.topUpFailed",{message:u.message}))},e[0]=t,e[1]=a):a=e[1];const{mutate:c,isPending:o}=_e({mutationFn:async u=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:u,currency:d});return P},onSuccess:Vt,onError:a}),[b,C]=J.useState(""),[y,r]=J.useState("usd"),d=y,m=parseFloat(b),f=!isNaN(m)&&m>=1,h=d==="brl"?"R$":"$";let g;e[2]!==r?(g=u=>{u&&r(u)},e[2]=r,e[3]=g):g=e[3];let k,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Ue,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),p=s.jsx(Ue,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=k,e[5]=p):(k=e[4],p=e[5]);let j;e[6]!==d||e[7]!==g?(j=s.jsxs(bt,{type:"single",variant:"outline",size:"default",value:d,onValueChange:g,children:[k,p]}),e[6]=d,e[7]=g,e[8]=j):j=e[8];let N;e[9]!==d||e[10]!==h||e[11]!==l||e[12]!==o||e[13]!==t||e[14]!==c?(N=!l&&s.jsxs(s.Fragment,{children:[Bt[d].map(u=>s.jsxs(re,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:o,onClick:()=>c(u*100),children:[h,u]},u)),s.jsx(re,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:o,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=h,e[11]=l,e[12]=o,e[13]=t,e[14]=c,e[15]=N):N=e[15];let S;e[16]!==h||e[17]!==b||e[18]!==m||e[19]!==l||e[20]!==f||e[21]!==o||e[22]!==C||e[23]!==t||e[24]!==c?(S=l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:h}),s.jsx(De,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:b,onChange:u=>C(u.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(re,{className:"h-10",disabled:!f||o,onClick:()=>c(Math.round(m*100)),children:o?"...":t("settings.decoCreditsHero.add")}),s.jsx(re,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),C("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=h,e[17]=b,e[18]=m,e[19]=l,e[20]=f,e[21]=o,e[22]=C,e[23]=t,e[24]=c,e[25]=S):S=e[25];let _;return e[26]!==j||e[27]!==N||e[28]!==S?(_=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,N,S]})}),e[26]=j,e[27]=N,e[28]=S,e[29]=_):_=e[29],_}function Vt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Qt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Gt(){const e=Z.c(121),t=oe(),{org:i}=we(),l=Se(),n=Ke(),a=Ce();let c;e[0]!==a?(c=a.find(Yt),e[0]=a,e[1]=c):c=e[1];const o=c,[b,C]=J.useState(!1);let y;e[2]!==o||e[3]!==l?(y=async()=>{o&&await l.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=l,e[4]=y):y=e[4];let r;e[5]!==i.id||e[6]!==n||e[7]!==t?(r=()=>{n.invalidateQueries({queryKey:le.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:le.aiProviders(i.id)}),ae.success(t("settings.decoCreditsHero.disconnectSuccess")),C(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=r):r=e[8];let d;e[9]!==t?(d=rt=>{ae.error(t("settings.decoCreditsHero.disconnectError",{message:rt.message}))},e[9]=t,e[10]=d):d=e[10];let m;e[11]!==y||e[12]!==r||e[13]!==d?(m={mutationFn:y,onSuccess:r,onError:d},e[11]=y,e[12]=r,e[13]=d,e[14]=m):m=e[14];const{mutate:f,isPending:h}=_e(m);let g;e[15]!==i.id?(g=le.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=g):g=e[16];const k=!!o;let p;e[17]!==l?(p=async()=>{try{return await l.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=l,e[18]=p):p=e[18];let j;e[19]!==g||e[20]!==k||e[21]!==p?(j={queryKey:g,enabled:k,staleTime:6e4,queryFn:p},e[19]=g,e[20]=k,e[21]=p,e[22]=j):j=e[22];const{data:N,isLoading:S,refetch:_,isFetching:u}=Le(j);if(!o)return null;const P=N?.balanceCents!=null?N.balanceCents/100:null;let v;e[23]!==P?(v=P!=null?`$${P.toFixed(2)}`:"—",e[23]=P,e[24]=v):v=e[24];const w=v;let V;e[25]!==t?(V=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=V):V=e[26];let B;e[27]!==t?(B=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=B):B=e[28];let O;e[29]!==B?(O=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:B,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=B,e[30]=O):O=e[30];let Q;e[31]!==t?(Q=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=Q):Q=e[32];let U;e[33]!==Q?(U=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:Q})}),e[33]=Q,e[34]=U):U=e[34];let M;e[35]!==O||e[36]!==U?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[O,U]}),e[35]=O,e[36]=U,e[37]=M):M=e[37];let q;e[38]===Symbol.for("react.memo_cache_sentinel")?(q=()=>C(!0),e[38]=q):q=e[38];let G;e[39]!==t?(G=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=G):G=e[40];let z;e[41]!==h||e[42]!==G?(z=s.jsx(re,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:q,disabled:h,children:G}),e[41]=h,e[42]=G,e[43]=z):z=e[43];let E;e[44]!==M||e[45]!==z?(E=s.jsxs("div",{className:"flex items-center justify-between",children:[M,z]}),e[44]=M,e[45]=z,e[46]=E):E=e[46];let F;e[47]!==t?(F=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=F):F=e[48];let T;e[49]!==F?(T=s.jsx(We,{children:F}),e[49]=F,e[50]=T):T=e[50];let H;e[51]!==t?(H=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=H):H=e[52];let x;e[53]!==H?(x=s.jsx(Je,{children:H}),e[53]=H,e[54]=x):x=e[54];let A;e[55]!==T||e[56]!==x?(A=s.jsxs(Xe,{children:[T,x]}),e[55]=T,e[56]=x,e[57]=A):A=e[57];let R;e[58]!==t?(R=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=R):R=e[59];let K;e[60]!==R?(K=s.jsx(Ze,{children:R}),e[60]=R,e[61]=K):K=e[61];let I;e[62]!==f?(I=()=>f(),e[62]=f,e[63]=I):I=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==I||e[67]!==Y?(W=s.jsx(et,{onClick:I,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=I,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==K||e[70]!==W?($=s.jsxs(tt,{children:[K,W]}),e[69]=K,e[70]=W,e[71]=$):$=e[71];let L;e[72]!==A||e[73]!==$?(L=s.jsxs(st,{children:[A,$]}),e[72]=A,e[73]=$,e[74]=L):L=e[74];let ee;e[75]!==b||e[76]!==L?(ee=s.jsx(it,{open:b,onOpenChange:C,children:L}),e[75]=b,e[76]=L,e[77]=ee):ee=e[77];let te;e[78]!==P||e[79]!==w||e[80]!==u||e[81]!==S?(te=S||u?s.jsx(Me,{className:"h-9 w-24"}):s.jsx("span",{className:$e("text-3xl font-semibold tabular-nums tracking-tight",P!=null&&Qt(P)),children:w}),e[78]=P,e[79]=w,e[80]=u,e[81]=S,e[82]=te):te=e[82];let se;e[83]!==_?(se=()=>_(),e[83]=_,e[84]=se):se=e[84];let ie;e[85]!==t?(ie=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ie):ie=e[86];const ne=u&&"animate-spin";let me;e[87]!==ne?(me=$e(ne),e[87]=ne,e[88]=me):me=e[88];let ue;e[89]!==me?(ue=s.jsx(Be,{size:14,className:me}),e[89]=me,e[90]=ue):ue=e[90];let fe;e[91]!==u||e[92]!==se||e[93]!==ie||e[94]!==ue?(fe=s.jsx("button",{type:"button",onClick:se,disabled:u,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ie,children:ue}),e[91]=u,e[92]=se,e[93]=ie,e[94]=ue,e[95]=fe):fe=e[95];let pe;e[96]!==te||e[97]!==fe?(pe=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=pe):pe=e[98];let ge;e[99]!==t?(ge=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=ge):ge=e[100];let he;e[101]!==ge?(he=s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),e[101]=ge,e[102]=he):he=e[102];let xe;e[103]!==pe||e[104]!==he?(xe=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[pe,he]}),e[103]=pe,e[104]=he,e[105]=xe):xe=e[105];let ve;e[106]!==t?(ve=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=ve):ve=e[107];let be;e[108]!==ve?(be=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:ve}),e[108]=ve,e[109]=be):be=e[109];let ke;e[110]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Lt,{}),e[110]=ke):ke=e[110];let ye;e[111]!==be?(ye=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[be,ke]}),e[111]=be,e[112]=ye):ye=e[112];let je;e[113]!==E||e[114]!==ee||e[115]!==xe||e[116]!==ye?(je=s.jsx(Ee,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[E,ee,xe,ye]})}),e[113]=E,e[114]=ee,e[115]=xe,e[116]=ye,e[117]=je):je=e[117];let Pe;return e[118]!==V||e[119]!==je?(Pe=s.jsx(Fe,{title:V,children:je}),e[118]=V,e[119]=je,e[120]=Pe):Pe=e[120],Pe}function Yt(e){return e.providerId==="deco"}function Wt(){const e=Z.c(8),{org:t}=we(),i=Se(),l=Ke();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let a;e[2]!==t||e[3]!==l?(a=()=>{Ve("ai_provider_provision_succeeded",{provider_id:"deco"}),l.invalidateQueries({queryKey:le.aiProviderKeys(t.id)}),l.invalidateQueries({queryKey:le.aiProviders(t.id)}),ae.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==a?(c={mutationFn:n,onSuccess:a,onError:Jt},e[5]=n,e[6]=a,e[7]=c):c=e[7],_e(c)}function Jt(e){Ve("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ae.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Xt(){const e=Z.c(37),t=oe(),{mutate:i,isPending:l}=Wt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let o;e[4]!==c?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=o):o=e[5];let b;e[6]!==t?(b=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=b):b=e[7];let C;e[8]!==b?(C=s.jsx("p",{className:"text-base font-semibold",children:b}),e[8]=b,e[9]=C):C=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let r;e[12]!==y?(r=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:y}),e[12]=y,e[13]=r):r=e[13];let d;e[14]!==C||e[15]!==r?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[C,r]}),e[14]=C,e[15]=r,e[16]=d):d=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let f;e[19]!==m?(f=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=f):f=e[20];let h;e[21]!==f||e[22]!==d?(h=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,f]}),e[21]=f,e[22]=d,e[23]=h):h=e[23];let g;e[24]!==i?(g=()=>i(),e[24]=i,e[25]=g):g=e[25];let k;e[26]!==l||e[27]!==t?(k=t(l?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=l,e[27]=t,e[28]=k):k=e[28];let p;e[29]!==l||e[30]!==g||e[31]!==k?(p=s.jsx(re,{variant:"outline",disabled:l,onClick:g,children:k}),e[29]=l,e[30]=g,e[31]=k,e[32]=p):p=e[32];let j;return e[33]!==h||e[34]!==p||e[35]!==o?(j=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,h,p]})]}),e[33]=h,e[34]=p,e[35]=o,e[36]=j):j=e[36],j}const Zt=e=>X({label:D().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:D().optional(),baseUrl:D().optional()});function es({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:l}){return e&&!!t&&t!==i&&!l}function ts({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:o}){const{org:b}=we(),C=Se(),y=Ke(),r=oe(),[d,m]=J.useState(!1),f=t.id==="openai-compatible",h=t.supportedMethods.includes("api-key"),g=Zt(r),{register:k,handleSubmit:p,watch:j,setError:N,formState:{errors:S}}=He({resolver:ze(g),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),_=j("apiKey")??"",{mutate:u,isPending:P}=_e({mutationFn:async v=>{let w;v.apiKey&&(f?w=JSON.stringify({baseUrl:v.baseUrl||a||"",apiKey:v.apiKey}):w=v.apiKey),await C.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:v.label,...w!==void 0?{apiKey:w}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:le.aiProviderKeys(b.id)}),y.invalidateQueries({queryKey:le.aiProviders(b.id)}),ae.success(r("settings.editProviderDialog.providerUpdated")),o()},onError:v=>ae.error(r("settings.editProviderDialog.failedToUpdate",{error:v.message}))});return s.jsxs("form",{onSubmit:p(v=>{if(es({isOpenAICompatible:f,baseUrl:v.baseUrl,currentBaseUrl:a,apiKey:v.apiKey})){N("apiKey",{message:r("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}u(v)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.label")}),s.jsx(De,{placeholder:r("settings.editProviderDialog.labelPlaceholder"),...k("label"),className:"h-8 text-sm"}),S.label&&s.jsx("p",{className:"text-xs text-destructive",children:S.label.message})]}),f&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.baseUrl")}),s.jsx(De,{type:"url",placeholder:i?.baseUrlPlaceholder??r("settings.editProviderDialog.baseUrlPlaceholder"),...k("baseUrl"),className:"h-8 text-sm"})]}),h&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[r("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",r("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(De,{type:d&&_?"text":"password",placeholder:l,...k("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),_&&s.jsx("button",{type:"button",onClick:()=>m(!d),"aria-label":r(d?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(Pt,{size:14}):s.jsx(Nt,{size:14})})]}),S.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:S.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(At,{children:[s.jsx(re,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:P,children:r("settings.editProviderDialog.cancel")}),s.jsx(re,{type:"submit",size:"sm",disabled:P,children:r(P?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function ss(e){const t=Z.c(31),{providerKey:i,provider:l,open:n,onOpenChange:a}=e,c=oe(),o=Se(),b=l.id==="openai-compatible"&&i.presetId?Ye(i.presetId):void 0,C=b?.name??l.name;let y;t[0]!==i.id?(y=le.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let r;t[2]!==i.id||t[3]!==o?(r=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=r):r=t[4];let d;t[5]!==n||t[6]!==y||t[7]!==r?(d={queryKey:y,queryFn:r,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=r,t[8]=d):d=t[8];const{data:m,isLoading:f}=Le(d),h=Kt,g=wt,k="sm:max-w-md",p=Dt,j=It,N=c("settings.editProviderDialog.editTitle",{name:C});let S;t[9]!==j||t[10]!==N?(S=s.jsx(j,{children:N}),t[9]=j,t[10]=N,t[11]=S):S=t[11];let _;t[12]!==p||t[13]!==S?(_=s.jsx(p,{children:S}),t[12]=p,t[13]=S,t[14]=_):_=t[14];let u;t[15]!==f||t[16]!==a||t[17]!==b||t[18]!==m||t[19]!==l||t[20]!==i?(u=f||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Rt,{})}):s.jsx(ts,{providerKey:i,provider:l,preset:b,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=f,t[16]=a,t[17]=b,t[18]=m,t[19]=l,t[20]=i,t[21]=u):u=t[21];let P;t[22]!==g||t[23]!==_||t[24]!==u?(P=s.jsxs(g,{className:k,children:[_,u]}),t[22]=g,t[23]=_,t[24]=u,t[25]=P):P=t[25];let v;return t[26]!==h||t[27]!==a||t[28]!==n||t[29]!==P?(v=s.jsx(h,{open:n,onOpenChange:a,children:P}),t[26]=h,t[27]=a,t[28]=n,t[29]=P,t[30]=v):v=t[30],v}function is(e){const t=Z.c(88),{providerKey:i,provider:l}=e,{org:n}=we(),a=Se(),c=Ke(),[o,b]=J.useState(!1),[C,y]=J.useState(!1),r=oe(),[d]=ot(),m=d.language==="pt-BR"?jt:void 0,f=l.id==="openai-compatible";let h;t[0]!==f||t[1]!==i.presetId?(h=f&&i.presetId?Ye(i.presetId):void 0,t[0]=f,t[1]=i.presetId,t[2]=h):h=t[2];const g=h;let k;t[3]!==f||t[4]!==g||t[5]!==l.name||t[6]!==r?(k=g?g.name:f?r("settings.aiProviders.customOpenAiCompatible"):l.name,t[3]=f,t[4]=g,t[5]=l.name,t[6]=r,t[7]=k):k=t[7];const p=k,j=g?.logo??l.logo;let N;e:{if(f){N=i.label;break e}let ne;t[8]!==m||t[9]!==i.createdAt||t[10]!==i.label||t[11]!==r?(ne=r("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:St(new Date(i.createdAt),{locale:m})}),t[8]=m,t[9]=i.createdAt,t[10]=i.label,t[11]=r,t[12]=ne):ne=t[12],N=ne}const S=N;let _;t[13]!==i.id||t[14]!==a?(_=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[13]=i.id,t[14]=a,t[15]=_):_=t[15];let u;t[16]!==n||t[17]!==i.id||t[18]!==c||t[19]!==r?(u=()=>{c.invalidateQueries({queryKey:le.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:le.aiProviders(n.id)}),c.invalidateQueries({queryKey:le.aiProviderModels(n.id,i.id)}),ae.success(r("settings.providerKeyRow.keyDeleted")),b(!1)},t[16]=n,t[17]=i.id,t[18]=c,t[19]=r,t[20]=u):u=t[20];let P;t[21]!==r?(P=ne=>ae.error(r("settings.providerKeyRow.failedToDeleteKey",{error:ne.message})),t[21]=r,t[22]=P):P=t[22];let v;t[23]!==_||t[24]!==u||t[25]!==P?(v={mutationFn:_,onSuccess:u,onError:P},t[23]=_,t[24]=u,t[25]=P,t[26]=v):v=t[26];const{mutate:w,isPending:V}=_e(v);let B;t[27]!==p||t[28]!==j?(B=j?s.jsx("img",{src:j,alt:p,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(kt,{fallback:p.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[27]=p,t[28]=j,t[29]=B):B=t[29];let O;t[30]!==r?(O=r("settings.providerKeyRow.editProviderKey"),t[30]=r,t[31]=O):O=t[31];let Q,U;t[32]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>y(!0),U=s.jsx(_t,{size:14}),t[32]=Q,t[33]=U):(Q=t[32],U=t[33]);let M;t[34]!==O?(M=s.jsx(re,{variant:"ghost",size:"icon","aria-label":O,className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:Q,children:U}),t[34]=O,t[35]=M):M=t[35];let q;t[36]!==r?(q=r("settings.providerKeyRow.deleteProviderKey"),t[36]=r,t[37]=q):q=t[37];let G,z;t[38]===Symbol.for("react.memo_cache_sentinel")?(G=()=>b(!0),z=s.jsx(Ct,{size:14}),t[38]=G,t[39]=z):(G=t[38],z=t[39]);let E;t[40]!==V||t[41]!==q?(E=s.jsx(re,{variant:"ghost",size:"icon","aria-label":q,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:V,onClick:G,children:z}),t[40]=V,t[41]=q,t[42]=E):E=t[42];let F;t[43]!==M||t[44]!==E?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[M,E]}),t[43]=M,t[44]=E,t[45]=F):F=t[45];let T;t[46]!==S||t[47]!==p||t[48]!==F||t[49]!==B?(T=s.jsx(Qe,{icon:B,title:p,description:S,action:F}),t[46]=S,t[47]=p,t[48]=F,t[49]=B,t[50]=T):T=t[50];let H;t[51]!==C||t[52]!==l||t[53]!==i?(H=s.jsx(ss,{providerKey:i,provider:l,open:C,onOpenChange:y}),t[51]=C,t[52]=l,t[53]=i,t[54]=H):H=t[54];let x;t[55]!==r?(x=r("settings.providerKeyRow.deleteApiKey"),t[55]=r,t[56]=x):x=t[56];let A;t[57]!==x?(A=s.jsx(We,{children:x}),t[57]=x,t[58]=A):A=t[58];let R;t[59]!==i.label?(R=s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[59]=i.label,t[60]=R):R=t[60];let K;t[61]!==A||t[62]!==R?(K=s.jsxs(Xe,{children:[A,R]}),t[61]=A,t[62]=R,t[63]=K):K=t[63];let I;t[64]!==r?(I=r("settings.providerKeyRow.cancel"),t[64]=r,t[65]=I):I=t[65];let Y;t[66]!==I?(Y=s.jsx(Ze,{children:I}),t[66]=I,t[67]=Y):Y=t[67];let W;t[68]!==w?(W=()=>w(),t[68]=w,t[69]=W):W=t[69];let $;t[70]!==r?($=r("settings.providerKeyRow.delete"),t[70]=r,t[71]=$):$=t[71];let L;t[72]!==W||t[73]!==$?(L=s.jsx(et,{onClick:W,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),t[72]=W,t[73]=$,t[74]=L):L=t[74];let ee;t[75]!==Y||t[76]!==L?(ee=s.jsxs(tt,{children:[Y,L]}),t[75]=Y,t[76]=L,t[77]=ee):ee=t[77];let te;t[78]!==K||t[79]!==ee?(te=s.jsxs(st,{children:[K,ee]}),t[78]=K,t[79]=ee,t[80]=te):te=t[80];let se;t[81]!==o||t[82]!==te?(se=s.jsx(it,{open:o,onOpenChange:b,children:te}),t[81]=o,t[82]=te,t[83]=se):se=t[83];let ie;return t[84]!==T||t[85]!==H||t[86]!==se?(ie=s.jsxs(s.Fragment,{children:[T,H,se]}),t[84]=T,t[85]=H,t[86]=se,t[87]=ie):ie=t[87],ie}function rs(e){const t=Z.c(17),{onConnectClick:i}=e,l=oe(),n=Ce(),a=Ge();let c;t[0]!==a?.providers?(c=a?.providers??[],t[0]=a?.providers,t[1]=c):c=t[1];const o=c;let b;if(t[2]!==n||t[3]!==i||t[4]!==o||t[5]!==l){let C;t[7]!==o?(C=h=>({key:h,provider:o.find(g=>g.id===h.providerId)}),t[7]=o,t[8]=C):C=t[8];const y=n.filter(ns).map(C).filter(os);let r;t[9]!==l?(r=l("settings.connectedProvidersSection.sectionTitle"),t[9]=l,t[10]=r):r=t[10];let d;t[11]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(yt,{size:14}),t[11]=d):d=t[11];let m;t[12]!==l?(m=l("settings.connectedProvidersSection.connectButton"),t[12]=l,t[13]=m):m=t[13];let f;t[14]!==i||t[15]!==m?(f=s.jsxs(re,{size:"sm",onClick:i,children:[d,m]}),t[14]=i,t[15]=m,t[16]=f):f=t[16],b=s.jsx(Fe,{title:r,headerClassName:"px-0",actions:f,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:l("settings.connectedProvidersSection.emptyState")}):s.jsx(Ee,{children:y.map(ls)})}),t[2]=n,t[3]=i,t[4]=o,t[5]=l,t[6]=b}else b=t[6];return b}function ls(e){const{key:t,provider:i}=e;return s.jsx(is,{providerKey:t,provider:i},t.id)}function os(e){return e.provider!==void 0}function ns(e){return e.providerId!=="deco"}function as(e){const t=Z.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(at,{size:16}),t[0]=l):l=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function cs(){const e=Z.c(23),t=Ce();let i;e[0]!==t?(i=t.some(ds),e[0]=t,e[1]=i):i=e[1];const l=i,n=t.length>0,[a,c]=J.useState(!1),[o,b]=J.useState(null),C=Ge();let y;e[2]!==C?.providers?(y=C?.providers??[],e[2]=C?.providers,e[3]=y):y=e[3];const r=y;if(!n){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(!0),e[4]=k):k=e[4];let p;e[5]!==r?(p=s.jsx(xt,{providers:r,onSelect:b,onShowAll:k}),e[5]=r,e[6]=p):p=e[6];const j=o!==null||a;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=P=>{P||(b(null),c(!1))},e[7]=N):N=e[7];const S=o??void 0;let _;e[8]!==j||e[9]!==S?(_=s.jsx(Oe,{open:j,onOpenChange:N,initialProvider:S}),e[8]=j,e[9]=S,e[10]=_):_=e[10];let u;return e[11]!==p||e[12]!==_?(u=s.jsxs(s.Fragment,{children:[p,_]}),e[11]=p,e[12]=_,e[13]=u):u=e[13],u}let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-16 w-full"}),children:s.jsx(zt,{})}),e[14]=d):d=e[14];let m;e[15]!==l?(m=l?s.jsx(Gt,{}):s.jsx(Xt,{}),e[15]=l,e[16]=m):m=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(rs,{onConnectClick:()=>c(!0)}),e[17]=f):f=e[17];let h;e[18]!==a?(h=s.jsx(Oe,{open:a,onOpenChange:c}),e[18]=a,e[19]=h):h=e[19];let g;return e[20]!==m||e[21]!==h?(g=s.jsxs(s.Fragment,{children:[d,m,f,h]}),e[20]=m,e[21]=h,e[22]=g):g=e[22],g}function ds(e){return e.providerId==="deco"}function ms(){const e=Z.c(7),t=oe();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let l;e[2]!==i?(l=s.jsx(Ne.Title,{children:i}),e[2]=i,e[3]=l):l=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(nt,{fallback:us,children:s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-64 w-full"}),children:s.jsx(cs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==l?(a=s.jsx(Ne,{children:s.jsx(Ne.Content,{children:s.jsx(Ne.Body,{children:s.jsxs(ct,{children:[l,n]})})})}),e[5]=l,e[6]=a):a=e[6],a}function us(e){const{error:t}=e;return s.jsx(as,{error:t??new Error("Failed to load AI providers")})}function bi(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Mt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(ms,{})}),e[0]=t):t=e[0],t}export{bi as default};
|
|
1
|
+
import{X,Y as D,a2 as Re,a4 as Ae,a5 as de,a3 as qe,b7 as Te,c as Z,b as oe,Z as ze,_ as He,r as J,j as s,a6 as lt,t as ae,av as Be,F as we,o as Ke,e as _e,K as le,n as Le,m as $e,B as re,p as Ve,v as ot,E as nt}from"./index-WEdfBcak.js";import{i as at}from"./AlertCircle-DkjWcZD-.js";import{P as Ne}from"./index-BwQT5Hhi.js";import{S as Me}from"./skeleton-BpfjGmFh.js";import{b as Qe,a as Ee,S as Fe,c as ct}from"./settings-section-Z9R6HthO.js";import{u as Ce,b as Ie,i as dt,c as mt,p as ut,d as Ge}from"./use-ai-providers-CTGRuhSY.js";import{i as ft}from"./CheckCircle-DeJIdYYq.js";import{b as pt,j as gt}from"./use-organization-settings-rcLpLxq6.js";import{e as ht,f as Ye,P as xt,h as Oe}from"./select-model-CXvd3jI3.js";import{u as vt}from"./use-debounced-autosave-Dp_dA5sI.js";import{I as De}from"./input-psV6HQEl.js";import{T as Ue,a as bt}from"./toggle-group-BK4yx2ic.js";import{c as We,d as Je,b as Xe,f as Ze,g as et,e as tt,a as st,A as it}from"./alert-dialog-B3JnEiZT.js";import{u as Se}from"./studio-tools-ChooDZCt.js";import{s as yt}from"./Plus-DolMQAo4.js";import{p as jt,f as St}from"./pt-BR-CLy76QW2.js";import{c as _t}from"./Tool01-CgtDQOgO.js";import{s as Ct}from"./Trash01-DSxLTY0P.js";import{A as kt}from"./avatar-ShBwmidu.js";import{i as Pt}from"./Settings02-QFTejQVV.js";import{s as Nt}from"./Eye-DdzBJpW0.js";import{b as It,a as Dt,d as wt,e as Kt,c as At}from"./dialog-B1XOtEFa.js";import{S as Rt}from"./spinner-D0HY4fdO.js";import{R as Mt}from"./require-capability-BeOopecx.js";import"./sidebar-CGksZnes.js";import"./LayoutLeft-D3dfvOJc.js";import"./use-mobile-BufL0gpx.js";import"./X-DsGAzzV8.js";import"./tooltip-DCC06XNr.js";import"./card-C98b87L-.js";import"./ArrowUpRight-D8TPuRuJ.js";import"./use-mcp-client-C78T1evw.js";import"./auth-BkcPrlSH.js";import"./drawer-Bindqbrh.js";import"./chat-context-DAYV5YFw.js";import"./tab-id-DpWn0fbM.js";import"./Check-De5xpJ0K.js";import"./Copy01-DEkTleE-.js";import"./hooks-BSzBu2tD.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Z3wBsgik.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-tTUO8PD5.js";import"./use-decopilot-events-B84Jbaf1.js";import"./checkbox-hx3qwtU4.js";import"./select-CWMyLghp.js";import"./ChevronDown-grOM3xSX.js";import"./ChevronUp-DIUedEx1.js";import"./Key01-qFWWm7I0.js";import"./SearchMd-DCX7P32_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-BBb-96JI.js";import"./ChevronRight-Cyogjxfm.js";import"./Stars01-2TnupN6q.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-CXTn_TP5.js";import"./use-capability-BTlnzwER.js";import"./access-gate-BRcWAcEH.js";import"./capability-load-error-CqdQPRYW.js";X({title:D(),url:D(),icon:D()});X({registries:Ae(D(),X({enabled:de()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Re(D()).describe("List of MCP app_name or app_id values to hide from the store.")});const ce=X({keyId:D(),modelId:D(),title:D().optional()}).nullable();qe(["fast","smart","thinking","image","web_search","deep_research"]);qe(["fast","smart","thinking"]);const Et=X({tiers:X({fast:ce,smart:ce,thinking:ce,image:ce,web_search:ce,deep_research:ce})});X({tiers:X({fast:ce.optional(),smart:ce.optional(),thinking:ce.optional()})});X({ids:Re(D()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:de().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:de().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:de().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:de().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:de().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human.")});X({id:D().describe("Brand context ID"),name:D().describe("Company name"),domain:D().describe("Company domain (e.g. example.com)"),overview:D().describe("Company overview / description"),logo:D().nullable().optional().describe("Logo URL"),favicon:D().nullable().optional().describe("Favicon URL"),ogImage:D().nullable().optional().describe("OG image URL"),fonts:X({heading:D().optional().describe("Font family for headings"),body:D().optional().describe("Font family for body text"),code:D().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:D().optional().describe("Primary brand color (hex)"),secondary:D().optional().describe("Secondary brand color (hex)"),accent:D().optional().describe("Accent / highlight color (hex)"),background:D().optional().describe("Background color (hex)"),foreground:D().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Re(Ae(D(),Te())).nullable().optional().describe("Brand images"),metadata:Ae(D(),Te()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:D().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:de().optional().describe("Whether this is the default brand for the organization")});const Ft=e=>e.capabilities?.includes("image")===!0,Tt=e=>dt(e),$t=e=>mt(e),Ot=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Ft},{key:"web_search",filter:Tt},{key:"deep_research",filter:$t}];function Ut(e){const t=Z.c(26),{slot:i,onSlotChange:l,filterModels:n,defaultKeyId:a}=e,c=Ce(),[o,b]=J.useState(i?.keyId??a);let C;t[0]!==i?(C=()=>{i?.keyId&&b(i.keyId)},t[0]=i,t[1]=C):C=t[1];const y=i?.keyId;let r;t[2]!==y?(r=[y],t[2]=y,t[3]=r):r=t[3],J.useEffect(C,r);const d=o??a;let m;t[4]!==d||t[5]!==c?(m=d?c.find(v=>v.id===d):null,t[4]=d,t[5]=c,t[6]=m):m=t[6];const f=m,{models:h,isLoading:g}=Ie(n?d??void 0:void 0),k=n?g||h.some(n):!0;let p;t[7]!==i||t[8]!==f?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:f?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=f?.providerId,t[9]=p):p=t[9];const j=p,N=oe();if(n&&!k){let v;t[10]!==N?(v=N("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[10]=N,t[11]=v):v=t[11];let w;return t[12]!==v?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:v}),t[12]=v,t[13]=w):w=t[13],w}let S;t[14]!==N?(S=N("settings.simpleModeSection.pickModel"),t[14]=N,t[15]=S):S=t[15];let _;t[16]===Symbol.for("react.memo_cache_sentinel")?(_=v=>b(v),t[16]=_):_=t[16];let u;t[17]!==d||t[18]!==l?(u=v=>{const w=v.keyId??d??"";b(w),l({keyId:w,modelId:v.modelId,title:v.title})},t[17]=d,t[18]=l,t[19]=u):u=t[19];let P;return t[20]!==d||t[21]!==n||t[22]!==j||t[23]!==S||t[24]!==u?(P=s.jsx(ht,{variant:"bordered",placeholder:S,model:j,credentialId:d,filterModels:n,onCredentialChange:_,onModelChange:u}),t[20]=d,t[21]=n,t[22]=j,t[23]=S,t[24]=u,t[25]=P):P=t[25],P}function qt(e){const t=Z.c(10),{isPending:i,showSaved:l}=e,n=oe();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let o;return t[3]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=o):o=t[4],o}if(l){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ft,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let o;return t[8]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=o):o=t[9],o}return null}function zt(){const e=Z.c(58),t=oe(),i=Ce(),l=pt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ze(Et),e[0]=a):a=e[0];let c;e[1]!==l?(c={resolver:a,values:l,mode:"onChange"},e[1]=l,e[2]=c):c=e[2];const o=He(c),{mutate:b,isPending:C,isSuccess:y}=gt(),r=o.formState.isDirty;let d;e[3]!==o||e[4]!==l||e[5]!==t||e[6]!==b?(d={delayMs:250,save:async()=>{const x=o.getValues();b(x,{onSuccess:()=>o.reset(x,{keepValues:!0}),onError:A=>{o.reset(l),ae.error(t("settings.simpleModeSection.failedToSave",{error:A.message}))}})}},e[3]=o,e[4]=l,e[5]=t,e[6]=b,e[7]=d):d=e[7];const{schedule:m}=vt(d),f=i[0],h=i[1],g=i[2],{models:k}=Ie(f?.id),{models:p}=Ie(h?.id),{models:j}=Ie(g?.id);let N,S;e[8]!==o||e[9]!==n?(N=()=>{n||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},S=[n,o],e[8]=o,e[9]=n,e[10]=N,e[11]=S):(N=e[10],S=e[11]),J.useEffect(N,S);let _;e[12]!==i||e[13]!==o||e[14]!==f||e[15]!==h||e[16]!==g||e[17]!==k||e[18]!==p||e[19]!==j?(_=()=>{const x=o.getValues(),A=new Set(i.map(Ht)),R={};f?.id&&(R[f.id]=k),h?.id&&(R[h.id]=p),g?.id&&(R[g.id]=j);const K=L=>L!=null&&!A.has(L.keyId),I={fast:K(x.tiers.fast)?null:x.tiers.fast,smart:K(x.tiers.smart)?null:x.tiers.smart,thinking:K(x.tiers.thinking)?null:x.tiers.thinking,image:K(x.tiers.image)?null:x.tiers.image,web_search:K(x.tiers.web_search)?null:x.tiers.web_search,deep_research:K(x.tiers.deep_research)?null:x.tiers.deep_research},Y=!I.fast||!I.smart||!I.thinking||!I.image||!I.web_search||!I.deep_research,W=I.fast===x.tiers.fast&&I.smart===x.tiers.smart&&I.thinking===x.tiers.thinking&&I.image===x.tiers.image&&I.web_search===x.tiers.web_search&&I.deep_research===x.tiers.deep_research;if(!Y&&W)return;const $=ut(i,R);o.reset({tiers:{fast:I.fast??$.chat.fast,smart:I.smart??$.chat.smart,thinking:I.thinking??$.chat.thinking,image:I.image??$.image,web_search:I.web_search??$.webSearch,deep_research:I.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=f,e[15]=h,e[16]=g,e[17]=k,e[18]=p,e[19]=j,e[20]=_):_=e[20];const u=f?.id,P=h?.id,v=g?.id;let w;e[21]!==i||e[22]!==o||e[23]!==k||e[24]!==p||e[25]!==j||e[26]!==u||e[27]!==P||e[28]!==v?(w=[o,i,k,p,j,u,P,v],e[21]=i,e[22]=o,e[23]=k,e[24]=p,e[25]=j,e[26]=u,e[27]=P,e[28]=v,e[29]=w):w=e[29],J.useEffect(_,w);let V;e[30]!==t?(V=x=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[x]||x,e[30]=t,e[31]=V):V=e[31];const B=V;let O;e[32]!==t?(O=x=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[x]||"",e[32]=t,e[33]=O):O=e[33];const Q=O;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let M;e[36]!==t?(M=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=M):M=e[37];let q;e[38]!==M?(q=s.jsx("p",{className:"text-sm text-muted-foreground",children:M}),e[38]=M,e[39]=q):q=e[39];const G=y&&!r;let z;e[40]!==C||e[41]!==G?(z=s.jsx(qt,{isPending:C,showSaved:G}),e[40]=C,e[41]=G,e[42]=z):z=e[42];let E;e[43]!==q||e[44]!==z?(E=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[q,z]}),e[43]=q,e[44]=z,e[45]=E):E=e[45];let F;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==Q||e[49]!==B||e[50]!==m?(F=Ot.map(x=>s.jsx(lt,{control:o.control,name:`tiers.${x.key}`,render:A=>{const{field:R}=A;return s.jsx(Qe,{title:B(x.key),description:Q(x.key),action:s.jsx(Ut,{slot:R.value,defaultKeyId:i[0]?.id??null,filterModels:x.filter,onSlotChange:K=>{R.onChange(K),m()}})})}},x.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=Q,e[49]=B,e[50]=m,e[51]=F):F=e[51];let T;e[52]!==F?(T=s.jsx(Ee,{children:F}),e[52]=F,e[53]=T):T=e[53];let H;return e[54]!==U||e[55]!==E||e[56]!==T?(H=s.jsxs(Fe,{title:U,headerClassName:"pl-0",children:[E,T]}),e[54]=U,e[55]=E,e[56]=T,e[57]=H):H=e[57],H}function Ht(e){return e.id}const Bt={usd:[10,20,100],brl:[50,100,500]};function Lt(){const e=Z.c(30),t=oe(),i=Se(),[l,n]=J.useState(!1);let a;e[0]!==t?(a=u=>{ae.error(t("settings.decoCreditsHero.topUpFailed",{message:u.message}))},e[0]=t,e[1]=a):a=e[1];const{mutate:c,isPending:o}=_e({mutationFn:async u=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:u,currency:d});return P},onSuccess:Vt,onError:a}),[b,C]=J.useState(""),[y,r]=J.useState("usd"),d=y,m=parseFloat(b),f=!isNaN(m)&&m>=1,h=d==="brl"?"R$":"$";let g;e[2]!==r?(g=u=>{u&&r(u)},e[2]=r,e[3]=g):g=e[3];let k,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Ue,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),p=s.jsx(Ue,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=k,e[5]=p):(k=e[4],p=e[5]);let j;e[6]!==d||e[7]!==g?(j=s.jsxs(bt,{type:"single",variant:"outline",size:"default",value:d,onValueChange:g,children:[k,p]}),e[6]=d,e[7]=g,e[8]=j):j=e[8];let N;e[9]!==d||e[10]!==h||e[11]!==l||e[12]!==o||e[13]!==t||e[14]!==c?(N=!l&&s.jsxs(s.Fragment,{children:[Bt[d].map(u=>s.jsxs(re,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:o,onClick:()=>c(u*100),children:[h,u]},u)),s.jsx(re,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:o,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=h,e[11]=l,e[12]=o,e[13]=t,e[14]=c,e[15]=N):N=e[15];let S;e[16]!==h||e[17]!==b||e[18]!==m||e[19]!==l||e[20]!==f||e[21]!==o||e[22]!==C||e[23]!==t||e[24]!==c?(S=l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:h}),s.jsx(De,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:b,onChange:u=>C(u.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(re,{className:"h-10",disabled:!f||o,onClick:()=>c(Math.round(m*100)),children:o?"...":t("settings.decoCreditsHero.add")}),s.jsx(re,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),C("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=h,e[17]=b,e[18]=m,e[19]=l,e[20]=f,e[21]=o,e[22]=C,e[23]=t,e[24]=c,e[25]=S):S=e[25];let _;return e[26]!==j||e[27]!==N||e[28]!==S?(_=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,N,S]})}),e[26]=j,e[27]=N,e[28]=S,e[29]=_):_=e[29],_}function Vt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Qt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Gt(){const e=Z.c(121),t=oe(),{org:i}=we(),l=Se(),n=Ke(),a=Ce();let c;e[0]!==a?(c=a.find(Yt),e[0]=a,e[1]=c):c=e[1];const o=c,[b,C]=J.useState(!1);let y;e[2]!==o||e[3]!==l?(y=async()=>{o&&await l.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=l,e[4]=y):y=e[4];let r;e[5]!==i.id||e[6]!==n||e[7]!==t?(r=()=>{n.invalidateQueries({queryKey:le.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:le.aiProviders(i.id)}),ae.success(t("settings.decoCreditsHero.disconnectSuccess")),C(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=r):r=e[8];let d;e[9]!==t?(d=rt=>{ae.error(t("settings.decoCreditsHero.disconnectError",{message:rt.message}))},e[9]=t,e[10]=d):d=e[10];let m;e[11]!==y||e[12]!==r||e[13]!==d?(m={mutationFn:y,onSuccess:r,onError:d},e[11]=y,e[12]=r,e[13]=d,e[14]=m):m=e[14];const{mutate:f,isPending:h}=_e(m);let g;e[15]!==i.id?(g=le.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=g):g=e[16];const k=!!o;let p;e[17]!==l?(p=async()=>{try{return await l.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=l,e[18]=p):p=e[18];let j;e[19]!==g||e[20]!==k||e[21]!==p?(j={queryKey:g,enabled:k,staleTime:6e4,queryFn:p},e[19]=g,e[20]=k,e[21]=p,e[22]=j):j=e[22];const{data:N,isLoading:S,refetch:_,isFetching:u}=Le(j);if(!o)return null;const P=N?.balanceCents!=null?N.balanceCents/100:null;let v;e[23]!==P?(v=P!=null?`$${P.toFixed(2)}`:"—",e[23]=P,e[24]=v):v=e[24];const w=v;let V;e[25]!==t?(V=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=V):V=e[26];let B;e[27]!==t?(B=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=B):B=e[28];let O;e[29]!==B?(O=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:B,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=B,e[30]=O):O=e[30];let Q;e[31]!==t?(Q=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=Q):Q=e[32];let U;e[33]!==Q?(U=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:Q})}),e[33]=Q,e[34]=U):U=e[34];let M;e[35]!==O||e[36]!==U?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[O,U]}),e[35]=O,e[36]=U,e[37]=M):M=e[37];let q;e[38]===Symbol.for("react.memo_cache_sentinel")?(q=()=>C(!0),e[38]=q):q=e[38];let G;e[39]!==t?(G=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=G):G=e[40];let z;e[41]!==h||e[42]!==G?(z=s.jsx(re,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:q,disabled:h,children:G}),e[41]=h,e[42]=G,e[43]=z):z=e[43];let E;e[44]!==M||e[45]!==z?(E=s.jsxs("div",{className:"flex items-center justify-between",children:[M,z]}),e[44]=M,e[45]=z,e[46]=E):E=e[46];let F;e[47]!==t?(F=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=F):F=e[48];let T;e[49]!==F?(T=s.jsx(We,{children:F}),e[49]=F,e[50]=T):T=e[50];let H;e[51]!==t?(H=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=H):H=e[52];let x;e[53]!==H?(x=s.jsx(Je,{children:H}),e[53]=H,e[54]=x):x=e[54];let A;e[55]!==T||e[56]!==x?(A=s.jsxs(Xe,{children:[T,x]}),e[55]=T,e[56]=x,e[57]=A):A=e[57];let R;e[58]!==t?(R=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=R):R=e[59];let K;e[60]!==R?(K=s.jsx(Ze,{children:R}),e[60]=R,e[61]=K):K=e[61];let I;e[62]!==f?(I=()=>f(),e[62]=f,e[63]=I):I=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==I||e[67]!==Y?(W=s.jsx(et,{onClick:I,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=I,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==K||e[70]!==W?($=s.jsxs(tt,{children:[K,W]}),e[69]=K,e[70]=W,e[71]=$):$=e[71];let L;e[72]!==A||e[73]!==$?(L=s.jsxs(st,{children:[A,$]}),e[72]=A,e[73]=$,e[74]=L):L=e[74];let ee;e[75]!==b||e[76]!==L?(ee=s.jsx(it,{open:b,onOpenChange:C,children:L}),e[75]=b,e[76]=L,e[77]=ee):ee=e[77];let te;e[78]!==P||e[79]!==w||e[80]!==u||e[81]!==S?(te=S||u?s.jsx(Me,{className:"h-9 w-24"}):s.jsx("span",{className:$e("text-3xl font-semibold tabular-nums tracking-tight",P!=null&&Qt(P)),children:w}),e[78]=P,e[79]=w,e[80]=u,e[81]=S,e[82]=te):te=e[82];let se;e[83]!==_?(se=()=>_(),e[83]=_,e[84]=se):se=e[84];let ie;e[85]!==t?(ie=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ie):ie=e[86];const ne=u&&"animate-spin";let me;e[87]!==ne?(me=$e(ne),e[87]=ne,e[88]=me):me=e[88];let ue;e[89]!==me?(ue=s.jsx(Be,{size:14,className:me}),e[89]=me,e[90]=ue):ue=e[90];let fe;e[91]!==u||e[92]!==se||e[93]!==ie||e[94]!==ue?(fe=s.jsx("button",{type:"button",onClick:se,disabled:u,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ie,children:ue}),e[91]=u,e[92]=se,e[93]=ie,e[94]=ue,e[95]=fe):fe=e[95];let pe;e[96]!==te||e[97]!==fe?(pe=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=pe):pe=e[98];let ge;e[99]!==t?(ge=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=ge):ge=e[100];let he;e[101]!==ge?(he=s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),e[101]=ge,e[102]=he):he=e[102];let xe;e[103]!==pe||e[104]!==he?(xe=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[pe,he]}),e[103]=pe,e[104]=he,e[105]=xe):xe=e[105];let ve;e[106]!==t?(ve=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=ve):ve=e[107];let be;e[108]!==ve?(be=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:ve}),e[108]=ve,e[109]=be):be=e[109];let ke;e[110]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Lt,{}),e[110]=ke):ke=e[110];let ye;e[111]!==be?(ye=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[be,ke]}),e[111]=be,e[112]=ye):ye=e[112];let je;e[113]!==E||e[114]!==ee||e[115]!==xe||e[116]!==ye?(je=s.jsx(Ee,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[E,ee,xe,ye]})}),e[113]=E,e[114]=ee,e[115]=xe,e[116]=ye,e[117]=je):je=e[117];let Pe;return e[118]!==V||e[119]!==je?(Pe=s.jsx(Fe,{title:V,children:je}),e[118]=V,e[119]=je,e[120]=Pe):Pe=e[120],Pe}function Yt(e){return e.providerId==="deco"}function Wt(){const e=Z.c(8),{org:t}=we(),i=Se(),l=Ke();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let a;e[2]!==t||e[3]!==l?(a=()=>{Ve("ai_provider_provision_succeeded",{provider_id:"deco"}),l.invalidateQueries({queryKey:le.aiProviderKeys(t.id)}),l.invalidateQueries({queryKey:le.aiProviders(t.id)}),ae.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==a?(c={mutationFn:n,onSuccess:a,onError:Jt},e[5]=n,e[6]=a,e[7]=c):c=e[7],_e(c)}function Jt(e){Ve("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ae.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Xt(){const e=Z.c(37),t=oe(),{mutate:i,isPending:l}=Wt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let o;e[4]!==c?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=o):o=e[5];let b;e[6]!==t?(b=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=b):b=e[7];let C;e[8]!==b?(C=s.jsx("p",{className:"text-base font-semibold",children:b}),e[8]=b,e[9]=C):C=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let r;e[12]!==y?(r=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:y}),e[12]=y,e[13]=r):r=e[13];let d;e[14]!==C||e[15]!==r?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[C,r]}),e[14]=C,e[15]=r,e[16]=d):d=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let f;e[19]!==m?(f=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=f):f=e[20];let h;e[21]!==f||e[22]!==d?(h=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,f]}),e[21]=f,e[22]=d,e[23]=h):h=e[23];let g;e[24]!==i?(g=()=>i(),e[24]=i,e[25]=g):g=e[25];let k;e[26]!==l||e[27]!==t?(k=t(l?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=l,e[27]=t,e[28]=k):k=e[28];let p;e[29]!==l||e[30]!==g||e[31]!==k?(p=s.jsx(re,{variant:"outline",disabled:l,onClick:g,children:k}),e[29]=l,e[30]=g,e[31]=k,e[32]=p):p=e[32];let j;return e[33]!==h||e[34]!==p||e[35]!==o?(j=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,h,p]})]}),e[33]=h,e[34]=p,e[35]=o,e[36]=j):j=e[36],j}const Zt=e=>X({label:D().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:D().optional(),baseUrl:D().optional()});function es({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:l}){return e&&!!t&&t!==i&&!l}function ts({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:o}){const{org:b}=we(),C=Se(),y=Ke(),r=oe(),[d,m]=J.useState(!1),f=t.id==="openai-compatible",h=t.supportedMethods.includes("api-key"),g=Zt(r),{register:k,handleSubmit:p,watch:j,setError:N,formState:{errors:S}}=He({resolver:ze(g),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),_=j("apiKey")??"",{mutate:u,isPending:P}=_e({mutationFn:async v=>{let w;v.apiKey&&(f?w=JSON.stringify({baseUrl:v.baseUrl||a||"",apiKey:v.apiKey}):w=v.apiKey),await C.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:v.label,...w!==void 0?{apiKey:w}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:le.aiProviderKeys(b.id)}),y.invalidateQueries({queryKey:le.aiProviders(b.id)}),ae.success(r("settings.editProviderDialog.providerUpdated")),o()},onError:v=>ae.error(r("settings.editProviderDialog.failedToUpdate",{error:v.message}))});return s.jsxs("form",{onSubmit:p(v=>{if(es({isOpenAICompatible:f,baseUrl:v.baseUrl,currentBaseUrl:a,apiKey:v.apiKey})){N("apiKey",{message:r("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}u(v)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.label")}),s.jsx(De,{placeholder:r("settings.editProviderDialog.labelPlaceholder"),...k("label"),className:"h-8 text-sm"}),S.label&&s.jsx("p",{className:"text-xs text-destructive",children:S.label.message})]}),f&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.baseUrl")}),s.jsx(De,{type:"url",placeholder:i?.baseUrlPlaceholder??r("settings.editProviderDialog.baseUrlPlaceholder"),...k("baseUrl"),className:"h-8 text-sm"})]}),h&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[r("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",r("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(De,{type:d&&_?"text":"password",placeholder:l,...k("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),_&&s.jsx("button",{type:"button",onClick:()=>m(!d),"aria-label":r(d?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(Pt,{size:14}):s.jsx(Nt,{size:14})})]}),S.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:S.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(At,{children:[s.jsx(re,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:P,children:r("settings.editProviderDialog.cancel")}),s.jsx(re,{type:"submit",size:"sm",disabled:P,children:r(P?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function ss(e){const t=Z.c(31),{providerKey:i,provider:l,open:n,onOpenChange:a}=e,c=oe(),o=Se(),b=l.id==="openai-compatible"&&i.presetId?Ye(i.presetId):void 0,C=b?.name??l.name;let y;t[0]!==i.id?(y=le.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let r;t[2]!==i.id||t[3]!==o?(r=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=r):r=t[4];let d;t[5]!==n||t[6]!==y||t[7]!==r?(d={queryKey:y,queryFn:r,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=r,t[8]=d):d=t[8];const{data:m,isLoading:f}=Le(d),h=Kt,g=wt,k="sm:max-w-md",p=Dt,j=It,N=c("settings.editProviderDialog.editTitle",{name:C});let S;t[9]!==j||t[10]!==N?(S=s.jsx(j,{children:N}),t[9]=j,t[10]=N,t[11]=S):S=t[11];let _;t[12]!==p||t[13]!==S?(_=s.jsx(p,{children:S}),t[12]=p,t[13]=S,t[14]=_):_=t[14];let u;t[15]!==f||t[16]!==a||t[17]!==b||t[18]!==m||t[19]!==l||t[20]!==i?(u=f||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Rt,{})}):s.jsx(ts,{providerKey:i,provider:l,preset:b,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=f,t[16]=a,t[17]=b,t[18]=m,t[19]=l,t[20]=i,t[21]=u):u=t[21];let P;t[22]!==g||t[23]!==_||t[24]!==u?(P=s.jsxs(g,{className:k,children:[_,u]}),t[22]=g,t[23]=_,t[24]=u,t[25]=P):P=t[25];let v;return t[26]!==h||t[27]!==a||t[28]!==n||t[29]!==P?(v=s.jsx(h,{open:n,onOpenChange:a,children:P}),t[26]=h,t[27]=a,t[28]=n,t[29]=P,t[30]=v):v=t[30],v}function is(e){const t=Z.c(88),{providerKey:i,provider:l}=e,{org:n}=we(),a=Se(),c=Ke(),[o,b]=J.useState(!1),[C,y]=J.useState(!1),r=oe(),[d]=ot(),m=d.language==="pt-BR"?jt:void 0,f=l.id==="openai-compatible";let h;t[0]!==f||t[1]!==i.presetId?(h=f&&i.presetId?Ye(i.presetId):void 0,t[0]=f,t[1]=i.presetId,t[2]=h):h=t[2];const g=h;let k;t[3]!==f||t[4]!==g||t[5]!==l.name||t[6]!==r?(k=g?g.name:f?r("settings.aiProviders.customOpenAiCompatible"):l.name,t[3]=f,t[4]=g,t[5]=l.name,t[6]=r,t[7]=k):k=t[7];const p=k,j=g?.logo??l.logo;let N;e:{if(f){N=i.label;break e}let ne;t[8]!==m||t[9]!==i.createdAt||t[10]!==i.label||t[11]!==r?(ne=r("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:St(new Date(i.createdAt),{locale:m})}),t[8]=m,t[9]=i.createdAt,t[10]=i.label,t[11]=r,t[12]=ne):ne=t[12],N=ne}const S=N;let _;t[13]!==i.id||t[14]!==a?(_=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[13]=i.id,t[14]=a,t[15]=_):_=t[15];let u;t[16]!==n||t[17]!==i.id||t[18]!==c||t[19]!==r?(u=()=>{c.invalidateQueries({queryKey:le.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:le.aiProviders(n.id)}),c.invalidateQueries({queryKey:le.aiProviderModels(n.id,i.id)}),ae.success(r("settings.providerKeyRow.keyDeleted")),b(!1)},t[16]=n,t[17]=i.id,t[18]=c,t[19]=r,t[20]=u):u=t[20];let P;t[21]!==r?(P=ne=>ae.error(r("settings.providerKeyRow.failedToDeleteKey",{error:ne.message})),t[21]=r,t[22]=P):P=t[22];let v;t[23]!==_||t[24]!==u||t[25]!==P?(v={mutationFn:_,onSuccess:u,onError:P},t[23]=_,t[24]=u,t[25]=P,t[26]=v):v=t[26];const{mutate:w,isPending:V}=_e(v);let B;t[27]!==p||t[28]!==j?(B=j?s.jsx("img",{src:j,alt:p,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(kt,{fallback:p.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[27]=p,t[28]=j,t[29]=B):B=t[29];let O;t[30]!==r?(O=r("settings.providerKeyRow.editProviderKey"),t[30]=r,t[31]=O):O=t[31];let Q,U;t[32]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>y(!0),U=s.jsx(_t,{size:14}),t[32]=Q,t[33]=U):(Q=t[32],U=t[33]);let M;t[34]!==O?(M=s.jsx(re,{variant:"ghost",size:"icon","aria-label":O,className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:Q,children:U}),t[34]=O,t[35]=M):M=t[35];let q;t[36]!==r?(q=r("settings.providerKeyRow.deleteProviderKey"),t[36]=r,t[37]=q):q=t[37];let G,z;t[38]===Symbol.for("react.memo_cache_sentinel")?(G=()=>b(!0),z=s.jsx(Ct,{size:14}),t[38]=G,t[39]=z):(G=t[38],z=t[39]);let E;t[40]!==V||t[41]!==q?(E=s.jsx(re,{variant:"ghost",size:"icon","aria-label":q,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:V,onClick:G,children:z}),t[40]=V,t[41]=q,t[42]=E):E=t[42];let F;t[43]!==M||t[44]!==E?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[M,E]}),t[43]=M,t[44]=E,t[45]=F):F=t[45];let T;t[46]!==S||t[47]!==p||t[48]!==F||t[49]!==B?(T=s.jsx(Qe,{icon:B,title:p,description:S,action:F}),t[46]=S,t[47]=p,t[48]=F,t[49]=B,t[50]=T):T=t[50];let H;t[51]!==C||t[52]!==l||t[53]!==i?(H=s.jsx(ss,{providerKey:i,provider:l,open:C,onOpenChange:y}),t[51]=C,t[52]=l,t[53]=i,t[54]=H):H=t[54];let x;t[55]!==r?(x=r("settings.providerKeyRow.deleteApiKey"),t[55]=r,t[56]=x):x=t[56];let A;t[57]!==x?(A=s.jsx(We,{children:x}),t[57]=x,t[58]=A):A=t[58];let R;t[59]!==i.label?(R=s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[59]=i.label,t[60]=R):R=t[60];let K;t[61]!==A||t[62]!==R?(K=s.jsxs(Xe,{children:[A,R]}),t[61]=A,t[62]=R,t[63]=K):K=t[63];let I;t[64]!==r?(I=r("settings.providerKeyRow.cancel"),t[64]=r,t[65]=I):I=t[65];let Y;t[66]!==I?(Y=s.jsx(Ze,{children:I}),t[66]=I,t[67]=Y):Y=t[67];let W;t[68]!==w?(W=()=>w(),t[68]=w,t[69]=W):W=t[69];let $;t[70]!==r?($=r("settings.providerKeyRow.delete"),t[70]=r,t[71]=$):$=t[71];let L;t[72]!==W||t[73]!==$?(L=s.jsx(et,{onClick:W,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),t[72]=W,t[73]=$,t[74]=L):L=t[74];let ee;t[75]!==Y||t[76]!==L?(ee=s.jsxs(tt,{children:[Y,L]}),t[75]=Y,t[76]=L,t[77]=ee):ee=t[77];let te;t[78]!==K||t[79]!==ee?(te=s.jsxs(st,{children:[K,ee]}),t[78]=K,t[79]=ee,t[80]=te):te=t[80];let se;t[81]!==o||t[82]!==te?(se=s.jsx(it,{open:o,onOpenChange:b,children:te}),t[81]=o,t[82]=te,t[83]=se):se=t[83];let ie;return t[84]!==T||t[85]!==H||t[86]!==se?(ie=s.jsxs(s.Fragment,{children:[T,H,se]}),t[84]=T,t[85]=H,t[86]=se,t[87]=ie):ie=t[87],ie}function rs(e){const t=Z.c(17),{onConnectClick:i}=e,l=oe(),n=Ce(),a=Ge();let c;t[0]!==a?.providers?(c=a?.providers??[],t[0]=a?.providers,t[1]=c):c=t[1];const o=c;let b;if(t[2]!==n||t[3]!==i||t[4]!==o||t[5]!==l){let C;t[7]!==o?(C=h=>({key:h,provider:o.find(g=>g.id===h.providerId)}),t[7]=o,t[8]=C):C=t[8];const y=n.filter(ns).map(C).filter(os);let r;t[9]!==l?(r=l("settings.connectedProvidersSection.sectionTitle"),t[9]=l,t[10]=r):r=t[10];let d;t[11]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(yt,{size:14}),t[11]=d):d=t[11];let m;t[12]!==l?(m=l("settings.connectedProvidersSection.connectButton"),t[12]=l,t[13]=m):m=t[13];let f;t[14]!==i||t[15]!==m?(f=s.jsxs(re,{size:"sm",onClick:i,children:[d,m]}),t[14]=i,t[15]=m,t[16]=f):f=t[16],b=s.jsx(Fe,{title:r,headerClassName:"px-0",actions:f,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:l("settings.connectedProvidersSection.emptyState")}):s.jsx(Ee,{children:y.map(ls)})}),t[2]=n,t[3]=i,t[4]=o,t[5]=l,t[6]=b}else b=t[6];return b}function ls(e){const{key:t,provider:i}=e;return s.jsx(is,{providerKey:t,provider:i},t.id)}function os(e){return e.provider!==void 0}function ns(e){return e.providerId!=="deco"}function as(e){const t=Z.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(at,{size:16}),t[0]=l):l=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function cs(){const e=Z.c(23),t=Ce();let i;e[0]!==t?(i=t.some(ds),e[0]=t,e[1]=i):i=e[1];const l=i,n=t.length>0,[a,c]=J.useState(!1),[o,b]=J.useState(null),C=Ge();let y;e[2]!==C?.providers?(y=C?.providers??[],e[2]=C?.providers,e[3]=y):y=e[3];const r=y;if(!n){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(!0),e[4]=k):k=e[4];let p;e[5]!==r?(p=s.jsx(xt,{providers:r,onSelect:b,onShowAll:k}),e[5]=r,e[6]=p):p=e[6];const j=o!==null||a;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=P=>{P||(b(null),c(!1))},e[7]=N):N=e[7];const S=o??void 0;let _;e[8]!==j||e[9]!==S?(_=s.jsx(Oe,{open:j,onOpenChange:N,initialProvider:S}),e[8]=j,e[9]=S,e[10]=_):_=e[10];let u;return e[11]!==p||e[12]!==_?(u=s.jsxs(s.Fragment,{children:[p,_]}),e[11]=p,e[12]=_,e[13]=u):u=e[13],u}let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-16 w-full"}),children:s.jsx(zt,{})}),e[14]=d):d=e[14];let m;e[15]!==l?(m=l?s.jsx(Gt,{}):s.jsx(Xt,{}),e[15]=l,e[16]=m):m=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(rs,{onConnectClick:()=>c(!0)}),e[17]=f):f=e[17];let h;e[18]!==a?(h=s.jsx(Oe,{open:a,onOpenChange:c}),e[18]=a,e[19]=h):h=e[19];let g;return e[20]!==m||e[21]!==h?(g=s.jsxs(s.Fragment,{children:[d,m,f,h]}),e[20]=m,e[21]=h,e[22]=g):g=e[22],g}function ds(e){return e.providerId==="deco"}function ms(){const e=Z.c(7),t=oe();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let l;e[2]!==i?(l=s.jsx(Ne.Title,{children:i}),e[2]=i,e[3]=l):l=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(nt,{fallback:us,children:s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-64 w-full"}),children:s.jsx(cs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==l?(a=s.jsx(Ne,{children:s.jsx(Ne.Content,{children:s.jsx(Ne.Body,{children:s.jsxs(ct,{children:[l,n]})})})}),e[5]=l,e[6]=a):a=e[6],a}function us(e){const{error:t}=e;return s.jsx(as,{error:t??new Error("Failed to load AI providers")})}function bi(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Mt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(ms,{})}),e[0]=t):t=e[0],t}export{bi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,m as o,j as c,bB as d}from"./index-
|
|
1
|
+
import{c as n,m as o,j as c,bB as d}from"./index-WEdfBcak.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as r,cY as T,cZ as w,aB as m,c_ as A,e0 as O,H as M,aD as I,cy as z,e1 as D,cz as F,d5 as L,az as G,d7 as H,cA as Y,c as n,m as p,bT as v}from"./index-
|
|
1
|
+
import{r as i,j as r,cY as T,cZ as w,aB as m,c_ as A,e0 as O,H as M,aD as I,cy as z,e1 as D,cz as F,d5 as L,az as G,d7 as H,cA as Y,c as n,m as p,bT as v}from"./index-WEdfBcak.js";var x="AlertDialog",[k]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t,modal:!0})};N.displayName=x;var B="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});V.displayName=B;var W="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=W;var q="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(Y,{...o,...a,ref:e})});_.displayName=q;var f="AlertDialogContent",[Z,J]=k(f),K=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(Z,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(K,{children:a}),r.jsx(U,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});R.displayName=E;var Q="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=Q;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=J($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var U=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-BwtPwDkT.js";import{i as jt}from"./ChevronRight-D8qRMofp.js";import{l as Bt}from"./automation-runs-CefJAXbk.js";import{A as At}from"./add-section-modal-C8iRgsqy.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-DAs-9e2l.js";import"./select-BbYS1E3l.js";import"./tooltip-DpCQ4VIp.js";import"./Check-Cc1URztt.js";import"./ChevronDown-CGQNWnd1.js";import"./ChevronUp-B1MCgjPT.js";import"./useInfiniteQuery-Cm_QWUqt.js";import"./use-infinite-scroll-BerLzyTb.js";import"./use-connection-Vb2VF6Hp.js";import"./use-mcp-client-FfMc8-rx.js";import"./auth-DRteaRo7.js";import"./use-virtual-mcp-LvfbHggF.js";import"./card-Sy0U3-Wx.js";import"./sidebar-BAUTb--2.js";import"./LayoutLeft-wIsOdHDO.js";import"./use-mobile-Ce6m_tdj.js";import"./X-C8pctpGF.js";import"./table-osBzVewG.js";import"./empty-state-B6Syio-N.js";import"./use-members-DmA1JBPe.js";import"./use-org-auth-client-qRcVIjeO.js";import"./use-clock-tick-Bc1o7i2J.js";import"./AlertCircle-DLzeWW_T.js";import"./CheckCircle-CKFQ-ojS.js";import"./DotsVertical-CVUQFIq0.js";import"./agent-icon-D24e3m8a.js";import"./Tool01-Czi-69SR.js";import"./ArrowUp-CxvtSdkN.js";import"./Settings02-CzZapEug.js";import"./Tool02-DbFQnKm7.js";import"./XCircle-tVWlex9c.js";import"./ArrowUpRight-DPC10cdm.js";import"./TrendUp01-Dx0eGCHh.js";import"./ZapSquare-DWTmsWCw.js";import"./Users03-C8IQMkHF.js";import"./Stars02-BQiI_7bO.js";import"./Copy01-B_uUNvC1.js";import"./CpuChip01-TRNsH071.js";import"./Eye-YusYyNwB.js";import"./FilterLines-CnFW7BL3.js";import"./Star01-D-FnejVv.js";import"./Palette-PEJqZgK-.js";import"./SwitchHorizontal01-BMdCcnbl.js";import"./HardDrive-Dy4jOdZa.js";import"./Key01-VrpEHfUN.js";import"./LinkExternal01-C08SeV4q.js";import"./LogOut01-CjdQdSFl.js";import"./Monitor01-B18puA3q.js";import"./Sun-Czb40wa5.js";import"./Play-DlOwS4QV.js";import"./Plus-BPKrERKg.js";import"./SearchLg-CvzWiMCw.js";import"./SearchMd-CzLFcViF.js";import"./Shield01--IU-F9zy.js";import"./Stars01-CO1ZsKSM.js";import"./Trash01-CJ5MTqKD.js";import"./Upload01-DEQX-M-s.js";import"./User01-aqOULbJy.js";import"./Users01-Bd1Jrc1q.js";import"./XClose-D7FEmbyQ.js";import"./Zap-C7Zkgnxi.js";import"./use-automations-D1WDAUDw.js";import"./studio-tools-B0hGD5Gd.js";import"./useSuspenseInfiniteQuery-Ghh8fdTf.js";import"./avatar-BoeRrsu0.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CHvgH5Lh.js";import"./calendar-C7p8Pfcr.js";import"./dialog-CLRqjexh.js";import"./tab-id-7BtS1Sf2.js";import"./hooks-B8L2k77M.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B-yIIkq7.js";import"./chat-context-B6_ywnmh.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-fwwaVRz9.js";import"./use-decopilot-events-C7QhM8s6.js";import"./use-organization-settings-DIoSfGxH.js";import"./monaco-editor-34s3IYG-.js";import"./spinner-C3MmgrM8.js";import"./index-DdrlaVv3.js";import"./shell-layout-DfiKUJAA.js";import"./required-auth-layout-BPywrnYN.js";import"./use-org-sso-CeCv1N-8.js";import"./integration-icon-D00h7u0u.js";import"./use-navigate-to-agent-BywRVo4r.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-pzs3vvOZ.js";import"./form-5ssuGL92.js";import"./label-CfD3KdnG.js";import"./input-CWOf_06B.js";import"./drawer-CJG4KQ31.js";import"./collection-search-Dp6F4e-r.js";import"./index-B2y9Di3y.js";import"./get-initials-D-f_fDFw.js";import"./popover-BHleKabJ.js";import"./dropdown-menu-LjQEXf6I.js";import"./github-repo-picker-CLYbDMRM.js";import"./use-debounced-value-B7GbcCk6.js";import"./authenticate-and-persist-oauth-DS1Wi7hh.js";import"./mcp-oauth-Cf4CBqV8.js";import"./use-mcp-tools-CJRQx9mh.js";import"./extract-connection-data-CGhHKZyY.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./use-tags-xUIAqM8l.js";import"./skeleton-EeUOKHea.js";import"./command-CIKiJ9mI.js";import"./index-BZ3okQg1.js";import"./companions-core-a4SdW3uj.js";import"./tabs-Dwdju4U8.js";import"./toggle-group-oSJPzYP5.js";import"./use-deco-credits-Dp9kIRuI.js";import"./alert-dialog-BoL4E1L1.js";import"./toolbar-1x2OYBi0.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CJ1zmea6.js";import"./use-registry-connections-BW6UlzJ3.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-8dJKevB7.js";import"./connection-form-helpers-Cz30_EcT.js";import"./collection-tabs-D7xdcSRl.js";import"./badge-DHPndUF3.js";import"./select-model-pTvdtWWw.js";import"./checkbox-6YGZXahW.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D2FgE1NH.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DtpMl-Yx.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DBxj3ZBy.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-BCEeD3p5.js";import"./use-debounced-autosave-CBX0zn4k.js";import"./index-D0lOXkKe.js";import"./search-input-Dm_eTyGl.js";import"./switch-B3bEiCXf.js";import"./use-secrets-6OQFbWZR.js";import"./useQueries-_Xy4vtop.js";import"./use-file-configs-CAMwu8_0.js";import"./automation-list-row-E0ENAv6T.js";function Pt(l,t){const p=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),u=/^[A-Za-z]/.test(p)&&p.length>0?p:"Section",n=wt(t,u);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Ar(l){const t=gt.c(80),{orgSlug:p,virtualMcpId:u,branch:n,blockKey:i,block:c,meta:m,decofile:d,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=l,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,s=yt(),b=typeof c?.__resolveType=="string"?c.__resolveType:"";let R;t[0]!==G||t[1]!==m||t[2]!==b?(R=Et(b,m,G),t[0]=G,t[1]=m,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==c||t[7]!==i||t[8]!==m||t[9]!==Z?(K=Z??(c?Nt(i,c,m):i),t[6]=c,t[7]=i,t[8]=m,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==n||t[12]!==p||t[13]!==u?(T={orgSlug:p,virtualMcpId:u,branch:n},t[11]=n,t[12]=p,t[13]=u,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==n||t[16]!==p||t[17]!==u?(F={orgSlug:p,virtualMcpId:u,branch:n},t[15]=n,t[16]=p,t[17]=u,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(i),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[a,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==i&&(bt(i),dt(null),ft(zt),ut([]));let z;t[22]!==c?(z=c??{},t[22]=c,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==i||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(i,{...r,__resolveType:b})},t[29]=i,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==d||t[35]!==W||t[36]!==Y||t[37]!==s?(L=async(e,r)=>{try{const{blockKey:f,data:N}=Pt(e,d);await Y.mutateAsync({blockKey:f,data:N}),xt.success(s("sandbox.appEditor.createdSection",{name:f})),r({__resolveType:f}),W()}catch(f){const N=f,St=N instanceof Error?N.message:s("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=d,t[35]=W,t[36]=Y,t[37]=s,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,f=>{r(f),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==a||t[43]!==v?(H=a.length>0?[v,...a]:[],t[42]=a,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==a||t[46]!==E||t[47]!==s||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":s("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const f=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(a,r)),ft(Ot)},title:e,className:kt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",f?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=a,t[46]=E,t[47]=s,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==i||t[56]!==a||t[57]!==d||t[58]!==st||t[59]!==ot||t[60]!==y||t[61]!==pt||t[62]!==Q||t[63]!==m||t[64]!==x||t[65]!==tt||t[66]!==h||t[67]!==J||t[68]!==s?(B=o.jsx(Bt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:a,onBreadcrumbChange:at,decofile:d,meta:m,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${ot}`):J?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),s("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:s("sandbox.appEditor.noEditableSchema")})})})}),t[55]=i,t[56]=a,t[57]=d,t[58]=st,t[59]=ot,t[60]=y,t[61]=pt,t[62]=Q,t[63]=m,t[64]=x,t[65]=tt,t[66]=h,t[67]=J,t[68]=s,t[69]=B):B=t[69];let A;t[70]!==rt||t[71]!==d||t[72]!==lt||t[73]!==m||t[74]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:m,decofile:d,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[70]=rt,t[71]=d,t[72]=lt,t[73]=m,t[74]=x,t[75]=A):A=t[75];let M;return t[76]!==j||t[77]!==B||t[78]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[76]=j,t[77]=B,t[78]=A,t[79]=M):M=t[79],M}function Ot(l){return l+1}function zt(l){return l+1}export{Ar as AppEditor};
|
|
1
|
+
import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-WEdfBcak.js";import{i as jt}from"./ChevronRight-Cyogjxfm.js";import{l as Bt}from"./automation-runs-DNqF8MQa.js";import{A as At}from"./add-section-modal-DkaZh9cy.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-DJEeCuky.js";import"./select-CWMyLghp.js";import"./tooltip-DCC06XNr.js";import"./Check-De5xpJ0K.js";import"./ChevronDown-grOM3xSX.js";import"./ChevronUp-DIUedEx1.js";import"./useInfiniteQuery-C1ye6sqf.js";import"./use-infinite-scroll-CRM4xUSx.js";import"./use-connection-BTIHIL2U.js";import"./use-mcp-client-C78T1evw.js";import"./auth-BkcPrlSH.js";import"./use-virtual-mcp-tTUO8PD5.js";import"./card-C98b87L-.js";import"./sidebar-CGksZnes.js";import"./LayoutLeft-D3dfvOJc.js";import"./use-mobile-BufL0gpx.js";import"./X-DsGAzzV8.js";import"./table-BluVU23Z.js";import"./empty-state-ClLU6296.js";import"./use-members-5U5mLxdD.js";import"./use-org-auth-client-B93vTKrZ.js";import"./use-clock-tick-Dg1-zfZ4.js";import"./AlertCircle-DkjWcZD-.js";import"./CheckCircle-DeJIdYYq.js";import"./DotsVertical-BaMvQPx5.js";import"./agent-icon-D0etPDkN.js";import"./Tool01-CgtDQOgO.js";import"./ArrowUp-DAA8boPY.js";import"./Settings02-QFTejQVV.js";import"./Tool02-MSwzSxke.js";import"./XCircle-DuADiFVm.js";import"./ArrowUpRight-D8TPuRuJ.js";import"./TrendUp01-djHA1GEE.js";import"./ZapSquare-C3s49zNL.js";import"./Users03-DK2c0NaU.js";import"./Stars02-DbK2oBak.js";import"./Copy01-DEkTleE-.js";import"./CpuChip01-Dsk680MX.js";import"./Eye-DdzBJpW0.js";import"./FilterLines-1IFdHyBL.js";import"./Star01-D0qlrfqR.js";import"./Palette-G-qrN-IT.js";import"./SwitchHorizontal01-DY4K5cqR.js";import"./HardDrive-CZF0RiCb.js";import"./Key01-qFWWm7I0.js";import"./LinkExternal01-BUH7ViZX.js";import"./LogOut01-GO407ARs.js";import"./Monitor01-BBb-96JI.js";import"./Sun-DVajpqnC.js";import"./Play-CkvF8PeT.js";import"./Plus-DolMQAo4.js";import"./SearchLg-CFQzg9fN.js";import"./SearchMd-DCX7P32_.js";import"./Shield01-BlitQe4N.js";import"./Stars01-2TnupN6q.js";import"./Trash01-DSxLTY0P.js";import"./Upload01-W82kShpH.js";import"./User01-CXTn_TP5.js";import"./Users01-DQVb_7oO.js";import"./XClose-BOYWq1vy.js";import"./Zap-Djw_FpdI.js";import"./use-automations-CTEnO1Zu.js";import"./studio-tools-ChooDZCt.js";import"./useSuspenseInfiniteQuery-CiYM_Dv6.js";import"./avatar-ShBwmidu.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bkx7pWID.js";import"./calendar-BcaXLcUe.js";import"./dialog-B1XOtEFa.js";import"./tab-id-DpWn0fbM.js";import"./hooks-BSzBu2tD.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Z3wBsgik.js";import"./chat-context-DAYV5YFw.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CTGRuhSY.js";import"./use-decopilot-events-B84Jbaf1.js";import"./use-organization-settings-rcLpLxq6.js";import"./monaco-editor-DJpDPKHP.js";import"./spinner-D0HY4fdO.js";import"./index-PxBIb6oF.js";import"./shell-layout-C7_zhx2J.js";import"./required-auth-layout-BFWyMRf5.js";import"./use-org-sso-BpALHDeh.js";import"./integration-icon-DjHXNUPP.js";import"./use-navigate-to-agent-bcvHJsmR.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BhkonnRg.js";import"./form-ujVSU6EU.js";import"./label-6xyucx-s.js";import"./input-psV6HQEl.js";import"./drawer-Bindqbrh.js";import"./collection-search-BujcF3uz.js";import"./index-DvtCTmmx.js";import"./get-initials-D-f_fDFw.js";import"./popover-BGrrSZ8M.js";import"./dropdown-menu-B2utwqdh.js";import"./github-repo-picker-CuyTuY6S.js";import"./use-debounced-value-Dx_Znjq0.js";import"./authenticate-and-persist-oauth-DZxhoF_0.js";import"./mcp-oauth-CKixkOtS.js";import"./use-mcp-tools-qcP_UOWU.js";import"./extract-connection-data-DSg0AjMi.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./use-tags-d-ihZKch.js";import"./skeleton-BpfjGmFh.js";import"./command-DTif1pCh.js";import"./index-Bhxc2Isb.js";import"./companions-core-DyTSbEDy.js";import"./tabs-C9Dri0XB.js";import"./toggle-group-BK4yx2ic.js";import"./use-deco-credits-CnnQh7bH.js";import"./alert-dialog-B3JnEiZT.js";import"./toolbar-CJN41Q0U.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BEnBoaJQ.js";import"./use-registry-connections-XjUGFr5z.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CMhJIDqb.js";import"./connection-form-helpers-D1M4SXKF.js";import"./collection-tabs-1Doa_k8q.js";import"./badge-CLGDkcax.js";import"./select-model-CXvd3jI3.js";import"./checkbox-hx3qwtU4.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Z9R6HthO.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CNPY1kJ-.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-BTlnzwER.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-DH8oUnNS.js";import"./use-debounced-autosave-Dp_dA5sI.js";import"./index-BwQT5Hhi.js";import"./search-input-Bfg6VxQW.js";import"./switch-BmoPsk_L.js";import"./use-secrets-DVGBRr0e.js";import"./useQueries-CX-pbcRo.js";import"./use-file-configs-DUlhqIgH.js";import"./automation-list-row-y5_hhf0p.js";function Pt(l,t){const p=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),u=/^[A-Za-z]/.test(p)&&p.length>0?p:"Section",n=wt(t,u);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Ar(l){const t=gt.c(80),{orgSlug:p,virtualMcpId:u,branch:n,blockKey:i,block:c,meta:m,decofile:d,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=l,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,s=yt(),b=typeof c?.__resolveType=="string"?c.__resolveType:"";let R;t[0]!==G||t[1]!==m||t[2]!==b?(R=Et(b,m,G),t[0]=G,t[1]=m,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==c||t[7]!==i||t[8]!==m||t[9]!==Z?(K=Z??(c?Nt(i,c,m):i),t[6]=c,t[7]=i,t[8]=m,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==n||t[12]!==p||t[13]!==u?(T={orgSlug:p,virtualMcpId:u,branch:n},t[11]=n,t[12]=p,t[13]=u,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==n||t[16]!==p||t[17]!==u?(F={orgSlug:p,virtualMcpId:u,branch:n},t[15]=n,t[16]=p,t[17]=u,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(i),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[a,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==i&&(bt(i),dt(null),ft(zt),ut([]));let z;t[22]!==c?(z=c??{},t[22]=c,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==i||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(i,{...r,__resolveType:b})},t[29]=i,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==d||t[35]!==W||t[36]!==Y||t[37]!==s?(L=async(e,r)=>{try{const{blockKey:f,data:N}=Pt(e,d);await Y.mutateAsync({blockKey:f,data:N}),xt.success(s("sandbox.appEditor.createdSection",{name:f})),r({__resolveType:f}),W()}catch(f){const N=f,St=N instanceof Error?N.message:s("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=d,t[35]=W,t[36]=Y,t[37]=s,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,f=>{r(f),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==a||t[43]!==v?(H=a.length>0?[v,...a]:[],t[42]=a,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==a||t[46]!==E||t[47]!==s||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":s("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const f=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(a,r)),ft(Ot)},title:e,className:kt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",f?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=a,t[46]=E,t[47]=s,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==i||t[56]!==a||t[57]!==d||t[58]!==st||t[59]!==ot||t[60]!==y||t[61]!==pt||t[62]!==Q||t[63]!==m||t[64]!==x||t[65]!==tt||t[66]!==h||t[67]!==J||t[68]!==s?(B=o.jsx(Bt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:a,onBreadcrumbChange:at,decofile:d,meta:m,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${ot}`):J?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),s("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:s("sandbox.appEditor.noEditableSchema")})})})}),t[55]=i,t[56]=a,t[57]=d,t[58]=st,t[59]=ot,t[60]=y,t[61]=pt,t[62]=Q,t[63]=m,t[64]=x,t[65]=tt,t[66]=h,t[67]=J,t[68]=s,t[69]=B):B=t[69];let A;t[70]!==rt||t[71]!==d||t[72]!==lt||t[73]!==m||t[74]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:m,decofile:d,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[70]=rt,t[71]=d,t[72]=lt,t[73]=m,t[74]=x,t[75]=A):A=t[75];let M;return t[76]!==j||t[77]!==B||t[78]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[76]=j,t[77]=B,t[78]=A,t[79]=M):M=t[79],M}function Ot(l){return l+1}function zt(l){return l+1}export{Ar as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cG as v,cH as $,cI as W,cJ as L,cK as H,cL as D,cM as V,cN as x,cO as q,cP as j,cQ as y,cR as N,cS as B,cT as Z,cU as F}from"./index-BwtPwDkT.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await F(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
1
|
+
import{cG as v,cH as $,cI as W,cJ as L,cK as H,cL as D,cM as V,cN as x,cO as q,cP as j,cQ as y,cR as N,cS as B,cT as Z,cU as F}from"./index-WEdfBcak.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await F(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-
|
|
1
|
+
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-WEdfBcak.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|