decocms 4.462.1 → 4.462.3
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-BQdX39pt.js → AlertCircle-rm9vrEtW.js} +1 -1
- package/dist/client/assets/{AreaChart-DGA1ooZj.js → AreaChart-Bxeu7Flp.js} +1 -1
- package/dist/client/assets/{ArrowLeft-6EbZWTcH.js → ArrowLeft-q0aoA66K.js} +1 -1
- package/dist/client/assets/{ArrowUp-2XhoOsi0.js → ArrowUp-wgeukGJg.js} +1 -1
- package/dist/client/assets/{Building02-DkmblV_t.js → Building02-BPTZeJ83.js} +1 -1
- package/dist/client/assets/{CartesianChart-CBSx0vVi.js → CartesianChart-CeNVmGpJ.js} +1 -1
- package/dist/client/assets/{Check-DT07hOsy.js → Check-ycQN3J2t.js} +1 -1
- package/dist/client/assets/{CheckCircle-DKVKsPck.js → CheckCircle-C2px0gfY.js} +1 -1
- package/dist/client/assets/{ChevronUp-Bf0RRY9i.js → ChevronUp-B8UqekRj.js} +1 -1
- package/dist/client/assets/{Copy01-onj9VSIV.js → Copy01-DFSuVPvj.js} +1 -1
- package/dist/client/assets/{CreditCard01-CunAqtsE.js → CreditCard01-C13hgCp6.js} +1 -1
- package/dist/client/assets/{DotsVertical-BlZNH3M2.js → DotsVertical-8YiGOIqq.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DLyMMN4K.js → ErrorBarContext-DRxvuP2h.js} +1 -1
- package/dist/client/assets/{Image01-D-zCGCY4.js → Image01-CgjyCWgG.js} +1 -1
- package/dist/client/assets/{Key01-BSZJTaKJ.js → Key01-B1-8KpSg.js} +1 -1
- package/dist/client/assets/{Line-Cu8o9uY5.js → Line-DkNHkEZJ.js} +1 -1
- package/dist/client/assets/{Link01-BgOzUKXX.js → Link01-B8ajBJDc.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CG-HmcZF.js → LinkBroken01-C78kyif5.js} +1 -1
- package/dist/client/assets/{LinkExternal01-UbkWQoBv.js → LinkExternal01-Bn0SPqIC.js} +1 -1
- package/dist/client/assets/{Monitor01-vP9TH_Iv.js → Monitor01-DC2k418g.js} +1 -1
- package/dist/client/assets/{Palette-VovT0PnZ.js → Palette-DOpFqZPK.js} +1 -1
- package/dist/client/assets/{Plus-DQzzAz_7.js → Plus-DC_7nhbs.js} +1 -1
- package/dist/client/assets/{SearchMd-D6hQenCX.js → SearchMd-Be3GMdpX.js} +1 -1
- package/dist/client/assets/{Sector-RlVKS-cJ.js → Sector-CASMflPE.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Cv1HC6f2.js → ShoppingBag01-DNQzuGTX.js} +1 -1
- package/dist/client/assets/{Sun-4pXqabGH.js → Sun-COaeigjT.js} +1 -1
- package/dist/client/assets/{Tool01-R5YlhrWO.js → Tool01-BNeCU30E.js} +1 -1
- package/dist/client/assets/{Trash01-1y1rCSQ7.js → Trash01-BTpCOmuX.js} +1 -1
- package/dist/client/assets/{Upload01-4H_HtY1H.js → Upload01-Dfmvp3DJ.js} +1 -1
- package/dist/client/assets/{User01-Cc8kWxTi.js → User01-4R_aUn4g.js} +1 -1
- package/dist/client/assets/{UserSquare-DwmYgSB5.js → UserSquare-DJ8hiuYq.js} +1 -1
- package/dist/client/assets/{Users01-CYu_OK-x.js → Users01-v0Jyk4Ot.js} +1 -1
- package/dist/client/assets/{X-Bix2CJil.js → X-DLYqFuX1.js} +1 -1
- package/dist/client/assets/{XAxis-BRJUR_Yx.js → XAxis-Dt1OJoaL.js} +1 -1
- package/dist/client/assets/{XClose-D1JVUlwn.js → XClose-BbdvFCiX.js} +1 -1
- package/dist/client/assets/{ZoomOut-DK7mmj_3.js → ZoomOut-DFERFVow.js} +1 -1
- package/dist/client/assets/{access-gate-E9akvl7M.js → access-gate-CDypY0PL.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-C9NnYS0B.js → add-connection-dialog-C7D8wNe0.js} +1 -1
- package/dist/client/assets/{agent-analytics-BpvLWqp9.js → agent-analytics-BImzDnhS.js} +1 -1
- package/dist/client/assets/agent-app-CoPaMo44.js +1 -0
- package/dist/client/assets/{agent-assets-F0nAoteT.js → agent-assets-TjuTBaEj.js} +1 -1
- package/dist/client/assets/{agent-automation-CVWUvLWe.js → agent-automation-jGaRzmAt.js} +1 -1
- package/dist/client/assets/{agent-automations-CP-T_ZYT.js → agent-automations-Dfj6v173.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-Jt-weFtl.js → agent-connect-sources-BGMBLNVm.js} +1 -1
- package/dist/client/assets/agent-deck-LRjwh5gJ.js +1 -0
- package/dist/client/assets/{agent-e2e-RBJsPRE-.js → agent-e2e-D-iDy0X1.js} +1 -1
- package/dist/client/assets/{agent-experiments-CKwxukPG.js → agent-experiments-CrLfobcW.js} +1 -1
- package/dist/client/assets/{agent-file-BPv1WL5h.js → agent-file-CpxoMhYy.js} +1 -1
- package/dist/client/assets/{agent-hosting-B1n_QjSO.js → agent-hosting-Ccr3JHE_.js} +1 -1
- package/dist/client/assets/{agent-icon-zpWPhOfj.js → agent-icon-BhZZd37x.js} +1 -1
- package/dist/client/assets/agent-library-Bg7R_pV5.js +1 -0
- package/dist/client/assets/agent-library-file-C8OO6Uy9.js +1 -0
- package/dist/client/assets/{agent-monitor-rhzeTPAW.js → agent-monitor-tFj42gZE.js} +1 -1
- package/dist/client/assets/{agent-overview-DawzNEwc.js → agent-overview-nEVkVUxO.js} +1 -1
- package/dist/client/assets/agent-settings-OH2hBY9j.js +1 -0
- package/dist/client/assets/{agent-site-editor-CF1Vr1s-.js → agent-site-editor-CSh7k9QL.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DEtiY7c_.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-DybB0nyP.js → agent-site-editor-content-nUoK_dJG.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CYHo-ORA.js → agent-site-editor-preview-Bz2ZTG6q.js} +3 -3
- package/dist/client/assets/agent-view-ByM1tns8.js +1 -0
- package/dist/client/assets/{agent-view-guard-CdHrEVQK.js → agent-view-guard-w0LVmZ_n.js} +1 -1
- package/dist/client/assets/{agents-list-BUtJHEBq.js → agents-list-DgxnnHSC.js} +1 -1
- package/dist/client/assets/{ai-providers--62RVeJI.js → ai-providers-B6rDuzxD.js} +1 -1
- package/dist/client/assets/{alert-D7D03BKP.js → alert-DjgCgioe.js} +1 -1
- package/dist/client/assets/{alert-dialog-CyLBdAzL.js → alert-dialog-PTVX9d3Y.js} +1 -1
- package/dist/client/assets/{analytics-sections-St-vkcN9.js → analytics-sections-DBNJksaf.js} +1 -1
- package/dist/client/assets/{api-keys-8GLO1uKc.js → api-keys-CRRGgTH5.js} +1 -1
- package/dist/client/assets/api-keys-DwkggND0.js +1 -0
- package/dist/client/assets/app-editor-uI7CZhyW.js +1 -0
- package/dist/client/assets/{asset-utils-BXloR6dL.js → asset-utils-Dv9Q2xbg.js} +1 -1
- package/dist/client/assets/{auth-ydnDmdni.js → auth-CWILNz-R.js} +1 -1
- package/dist/client/assets/{auth-catchall-DV9J64DV.js → auth-catchall-Cc5_u2IL.js} +1 -1
- package/dist/client/assets/{auth-entry-oEfwo4SD.js → auth-entry-C9RssKbo.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CnSdMp2k.js → auth-split-layout-D_hmCTq4.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-0pLi3EbJ.js → authenticate-and-persist-oauth-_u_GUn2l.js} +1 -1
- package/dist/client/assets/{automation-list-row-Cs1Mmss0.js → automation-list-row-DfDWaaDG.js} +1 -1
- package/dist/client/assets/{automation-runs-DADbYz16.js → automation-runs-CiGqMkAr.js} +1 -1
- package/dist/client/assets/{automations-bWRzJt79.js → automations-17MTzB0I.js} +1 -1
- package/dist/client/assets/{autosend-BGaION3N.js → autosend-C7DyeWiW.js} +1 -1
- package/dist/client/assets/{avatar-CmK1yw1p.js → avatar-Dl_cPf4a.js} +1 -1
- package/dist/client/assets/{badge-DEsF_1Ia.js → badge-DhrYVT6A.js} +1 -1
- package/dist/client/assets/{block-document-BEKsZQFG.js → block-document-C4jgXyrX.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-I99wRxXQ.js → blocks-preview-workspace-context-CJB53TYU.js} +1 -1
- package/dist/client/assets/{blog-schema-ChdnOShd.js → blog-schema-Cm8V0ekp.js} +1 -1
- package/dist/client/assets/{buckets-CxWDcQDs.js → buckets-Cu7VxrxX.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CkwvsCJn.js → build-improve-prompt-doc-DzdB1psZ.js} +1 -1
- package/dist/client/assets/{calendar-CJu_GHUv.js → calendar-BLwaxQ6A.js} +1 -1
- package/dist/client/assets/{capability-load-error-Ljpou6Bo.js → capability-load-error-Gcuy_zZQ.js} +1 -1
- package/dist/client/assets/{category-editor-BP6pLKwh.js → category-editor-qccGK1pF.js} +1 -1
- package/dist/client/assets/{chart-D88KLoUP.js → chart-m7qkl4bi.js} +1 -1
- package/dist/client/assets/{chat-context-Bx9MVwv5.js → chat-context-Dx9zNHfj.js} +1 -1
- package/dist/client/assets/{chat-draft-BY29_iSs.js → chat-draft-BmX0POEt.js} +1 -1
- package/dist/client/assets/{checkbox-C49TGIp0.js → checkbox-BGY2RDHl.js} +1 -1
- package/dist/client/assets/{choose-editor-DB0cnGpT.js → choose-editor-Drm1rWH4.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-C3RYiVe8.js → claim-phase-copy-B4wRGWwJ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DwRQR0Ku.js → cli-auth-success-Bhd55UzL.js} +1 -1
- package/dist/client/assets/{client-icons-DAZktl5s.js → client-icons-Nclcrk8y.js} +1 -1
- package/dist/client/assets/{collapsible-syvMi5BG.js → collapsible-BUVugLgs.js} +1 -1
- package/dist/client/assets/{collection-detail-CjilUV-o.js → collection-detail-DP3jpGJn.js} +1 -1
- package/dist/client/assets/{collection-display-button-BeOcroLk.js → collection-display-button-T5vUt9Xp.js} +1 -1
- package/dist/client/assets/{collection-search-DHFp5D4H.js → collection-search-CKuVhNj4.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-ge6vt6wC.js → collection-table-wrapper-DjPT86lv.js} +1 -1
- package/dist/client/assets/{collection-tabs-DXzpq1Uc.js → collection-tabs-BamuvkGL.js} +1 -1
- package/dist/client/assets/{column-rules-BEG-LiIK.js → column-rules-Xz3xzzP-.js} +1 -1
- package/dist/client/assets/{combobox-B6ZiAdlR.js → combobox-CgUwJrOG.js} +1 -1
- package/dist/client/assets/{command-D7RcR1At.js → command-Czt06b2r.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-M9JXIs4F.js → companion-mcps-section-KDtsEeuf.js} +1 -1
- package/dist/client/assets/{config-DPgm9uDo.js → config-CGLxG-Gg.js} +1 -1
- package/dist/client/assets/{connect-DPzJM3Ss.js → connect-Dz_UGWIS.js} +1 -1
- package/dist/client/assets/{connect-layout-BkW0QYIq.js → connect-layout-Diov8B69.js} +1 -1
- package/dist/client/assets/{connection-8CqSsDm5.js → connection-Dyn6n84s.js} +1 -1
- package/dist/client/assets/{connection-card-XhoPzocB.js → connection-card-ZezUc4CB.js} +1 -1
- package/dist/client/assets/{connection-detail-C7APaNGj.js → connection-detail-BJExNdyL.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BmHNz6u_.js → connection-form-helpers-DBYs_bI7.js} +1 -1
- package/dist/client/assets/{connections-BWEZddgp.js → connections-oiXlAgUF.js} +1 -1
- package/dist/client/assets/{context-BcZ7togB.js → context-BjfN_2Ri.js} +1 -1
- package/dist/client/assets/{context-menu-hfM0OJ90.js → context-menu-DlkAUkV8.js} +1 -1
- package/dist/client/assets/{core.esm-BDakG4hN.js → core.esm-B3puu65K.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-kX3bAwvy.js → create-organization-dialog-CQl1wPgd.js} +1 -1
- package/dist/client/assets/{daily-pulse-DLNh3BNN.js → daily-pulse-Cap6vUBG.js} +1 -1
- package/dist/client/assets/{decopilot-BVdjTDzA.js → decopilot-CVtUuYjj.js} +1 -1
- package/dist/client/assets/{device-hint--Pl8erT8.js → device-hint-EZG6wkKu.js} +1 -1
- package/dist/client/assets/{dialog-DfdkHhmb.js → dialog-C8AdhrG0.js} +1 -1
- package/dist/client/assets/{discover-B_YJeQ0t.js → discover-DzeJVPL8.js} +1 -1
- package/dist/client/assets/{domain-settings-BNKv7CG9.js → domain-settings-DSaE4wpm.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CfJbVT9R.js → download-app-dialog-URSdQ4ke.js} +1 -1
- package/dist/client/assets/{drawer-CIqQnl1u.js → drawer-BZnmFrAT.js} +1 -1
- package/dist/client/assets/{editor-DPVBnzyg.js → editor-CK9raNB0.js} +1 -1
- package/dist/client/assets/{empty-state-BRfCy1KK.js → empty-state-CmS3chTn.js} +1 -1
- package/dist/client/assets/{empty-state-DSS4pT1g.js → empty-state-CoOL0M6Y.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BFK1aCsO.js → extract-connection-data-Ch1WBTd_.js} +1 -1
- package/dist/client/assets/{feature-gate-lUmvuNGP.js → feature-gate-Dzatwf08.js} +1 -1
- package/dist/client/assets/{feature-paywall-BHVpt9vY.js → feature-paywall-BoMIgBMw.js} +1 -1
- package/dist/client/assets/{file-explorer-BhvSUItT.js → file-explorer-nSFWWRTB.js} +1 -1
- package/dist/client/assets/{file-preview-Pk-Bxrs3.js → file-preview-DGEdQu7O.js} +1 -1
- package/dist/client/assets/{file-share-button-Drokhk1O.js → file-share-button-CpGZhwcv.js} +1 -1
- package/dist/client/assets/{file-type-icon-Dak7C2hB.js → file-type-icon-D3P3r_PX.js} +1 -1
- package/dist/client/assets/flat-project-Crgd2_CA.js +1 -0
- package/dist/client/assets/{folder-icon-BV7RkSpo.js → folder-icon-DmaVPQUY.js} +1 -1
- package/dist/client/assets/{form-L-QwU058.js → form-C_wkYdWR.js} +1 -1
- package/dist/client/assets/{gateway-client-DIx8y90K.js → gateway-client-n3scD1Cq.js} +1 -1
- package/dist/client/assets/{general-4i0UazBb.js → general-DY3X6fO5.js} +1 -1
- package/dist/client/assets/{home-DrUnBj11.js → home-D9b2CIU1.js} +1 -1
- package/dist/client/assets/{icon-button-CNx5vjvd.js → icon-button-C_Cp_29j.js} +1 -1
- package/dist/client/assets/{index-yySMOeUT.js → index-B-oPHPrA.js} +1 -1
- package/dist/client/assets/{index-D-j5tLoV.js → index-BADmvvU8.js} +1 -1
- package/dist/client/assets/{index-qxTKzwUa.js → index-BIGakDd7.js} +1 -1
- package/dist/client/assets/{index-CmfXJaKn.js → index-BSg0zn4o.js} +2 -2
- package/dist/client/assets/{index-DLUvq6N4.js → index-BWQjqyyC.js} +1 -1
- package/dist/client/assets/{index-slTQzhAF.js → index-BfKeTOyQ.js} +1 -1
- package/dist/client/assets/{index-hw5atO08.js → index-BmBDGBX2.js} +1 -1
- package/dist/client/assets/{index-Cha6sREf.js → index-CFZz__Xz.js} +1 -1
- package/dist/client/assets/{index-D6hcVQMy.js → index-CYmKWEH9.js} +1 -1
- package/dist/client/assets/{index-CpCp6flP.js → index-Cd-_V0_9.js} +1 -1
- package/dist/client/assets/{index-0eJRh8R4.js → index-CrcosZHv.js} +1 -1
- package/dist/client/assets/{index-BSNgOILO.js → index-Crqv9xoR.js} +3 -3
- package/dist/client/assets/{index-BIS-YXel.js → index-D-Q4GsTp.js} +1 -1
- package/dist/client/assets/{index-DLxL4E4g.js → index-DZYzJ3Ve.js} +1 -1
- package/dist/client/assets/{index-BBAhA6Le.js → index-hcdrCnDP.js} +1 -1
- package/dist/client/assets/{index-redirect-BsL3Wy60.js → index-redirect-CTFASjG4.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BV5hUiLD.js → infiniteQueryObserver-ByHfufml.js} +1 -1
- package/dist/client/assets/{infra-billing-CTgKPdho.js → infra-billing-xdyFXGeK.js} +1 -1
- package/dist/client/assets/{input-BNzPL_iy.js → input-CCnRshRN.js} +1 -1
- package/dist/client/assets/input-D1Ki90Pm.js +17 -0
- package/dist/client/assets/{input-4qEEcM12.js → input-DyRkn4pn.js} +1 -1
- package/dist/client/assets/{integration-icon-BonC-ogs.js → integration-icon-BiZmEnVi.js} +1 -1
- package/dist/client/assets/{label-bFgvSx58.js → label-Du2iAGWx.js} +1 -1
- package/dist/client/assets/{layout-C6WqLGyR.js → layout-D_g2vZ02.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BBL3IdDh.js → legacy-agents-deep-CzmcMxWx.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CfhJpa5K.js → legacy-main-redirect-CVsh9CL4.js} +1 -1
- package/dist/client/assets/library-D0xoHpix.js +1 -0
- package/dist/client/assets/{library-tab-BB8_-aXb.js → library-tab-C48kInYl.js} +1 -1
- package/dist/client/assets/{login-DHRUorQv.js → login-CWsZk4Ka.js} +1 -1
- package/dist/client/assets/{markdown-Bm0EnhxB.js → markdown-DienvDaS.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DrzyJZxY.js → mcp-app-renderer-CNPl_E2S.js} +1 -1
- package/dist/client/assets/{mcp-oauth-NtoAIxeI.js → mcp-oauth-BEjgJ8S3.js} +1 -1
- package/dist/client/assets/{members-rL_0NXs3.js → members-2EErop1f.js} +1 -1
- package/dist/client/assets/{memory-57liTbov.js → memory-yCjJoNDd.js} +1 -1
- package/dist/client/assets/{mini-report-page-2z90zMGC.js → mini-report-page-pXF8ynkH.js} +1 -1
- package/dist/client/assets/{mock-board-2vyeBIpi.js → mock-board-TQ8xh6Aq.js} +1 -1
- package/dist/client/assets/{monaco-editor-CgPa2BkS.js → monaco-editor-Ddyrxhnd.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B8BCbzN2.js → monitoring-stats-row-k_A2nsj4.js} +1 -1
- package/dist/client/assets/{multi-select-Eun7kW76.js → multi-select-C5JMY5HA.js} +1 -1
- package/dist/client/assets/{mustache-C8I_o4kv.js → mustache-2Fdvii3x.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BBDXUa7t.js → new-project-dialog-B7NjXDr6.js} +1 -1
- package/dist/client/assets/{oauth-callback-BRlmMjq0.js → oauth-callback-D5zHk1ID.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-dNKGDRz2.js → oauth-callback-ai-provider-CpRYlq4A.js} +1 -1
- package/dist/client/assets/{onboarding-DuoOHH_e.js → onboarding-C6mBd0qU.js} +1 -1
- package/dist/client/assets/{openai-conversation-CsZhzcK_.js → openai-conversation-BwKz3ZIx.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BBCxpQYT.js → optimistic-project-sidebar-views-B5YhmCh5.js} +1 -1
- package/dist/client/assets/{org-file-open-context-B_XQOD8z.js → org-file-open-context-CYLtVxSO.js} +1 -1
- package/dist/client/assets/{organization-choice-CZP-vgCu.js → organization-choice-BkwWYz2E.js} +1 -1
- package/dist/client/assets/{orgs-DqPSkSGZ.js → orgs-DlLwRria.js} +1 -1
- package/dist/client/assets/{page-seo-form-3EgL9cU4.js → page-seo-form-D8Vne1WG.js} +1 -1
- package/dist/client/assets/{pair-BNiFxIdB.js → pair-BRY0hFhL.js} +1 -1
- package/dist/client/assets/{plan-ladder-BJXeUQY6.js → plan-ladder-CqI-1A4t.js} +1 -1
- package/dist/client/assets/{popover-DwltHyyo.js → popover-CXCkGdFS.js} +1 -1
- package/dist/client/assets/{post-calendar-Dn93fgop.js → post-calendar-tlpRGAwb.js} +1 -1
- package/dist/client/assets/{post-editor-Df-Ydp56.js → post-editor-DrQUoUR6.js} +1 -1
- package/dist/client/assets/{preview-content-llp8A1Fx.js → preview-content-C6-NXNqs.js} +1 -1
- package/dist/client/assets/{preview-dialog-C0rIAVwJ.js → preview-dialog-mKfjI5de.js} +1 -1
- package/dist/client/assets/{preview-panel-kwICD-IP.js → preview-panel-CYOl_eyz.js} +1 -1
- package/dist/client/assets/{profile-CKI2V6L4.js → profile-DolOUYa-.js} +1 -1
- package/dist/client/assets/{project-app-view-n3cNFnjF.js → project-app-view-BT7xMHiG.js} +1 -1
- package/dist/client/assets/{project-feed-CrcM01NE.js → project-feed-DzOwWrsA.js} +1 -1
- package/dist/client/assets/{project-icon-BbgRznbE.js → project-icon-BtaqB0ne.js} +1 -1
- package/dist/client/assets/project-reports-CUmY8yFG.js +1 -0
- package/dist/client/assets/project-tasks-B-l5cw7H.js +1 -0
- package/dist/client/assets/{projects-C92Fpsys.js → projects-Ox8W8ETP.js} +1 -1
- package/dist/client/assets/{projects-empty-state-jalgUMXc.js → projects-empty-state-C6gu1t-4.js} +1 -1
- package/dist/client/assets/{prompts-I5dsKQL_.js → prompts-CoL_Tpxk.js} +1 -1
- package/dist/client/assets/record-editor-BrASt4GH.js +1 -0
- package/dist/client/assets/{redirect-editor-Be2R_jDZ.js → redirect-editor-lIGVngPQ.js} +1 -1
- package/dist/client/assets/{reports-8DYzRzah.js → reports-BEsbbpXT.js} +1 -1
- package/dist/client/assets/reports-C91C_dGk.js +1 -0
- package/dist/client/assets/{reports-onboarding-DHU4Avz5.js → reports-onboarding-nf8zCR8E.js} +1 -1
- package/dist/client/assets/{reports-tab-DRzkM6pV.js → reports-tab-B-zoXuhY.js} +2 -2
- package/dist/client/assets/{repositories-CIMUlOvj.js → repositories-C6qG4TgY.js} +1 -1
- package/dist/client/assets/{repository-binding-DLsaqYxe.js → repository-binding-CKlCwDDd.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BuXUq4VL.js → repository-import-picker-BWcgounQ.js} +1 -1
- package/dist/client/assets/{repository-picker-BiHs5x47.js → repository-picker-DJEubVOt.js} +1 -1
- package/dist/client/assets/{require-capability-BEya1FVv.js → require-capability-CMsD4Xq5.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DxbZpHcW.js → required-auth-layout-DXP1Sqka.js} +1 -1
- package/dist/client/assets/{reset-password-Cka0kEpf.js → reset-password-YWpHSvq5.js} +1 -1
- package/dist/client/assets/{resizable-B88Tf4WJ.js → resizable-Cvf4_ymQ.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-B5oufvSh.js → resolve-tab-icon-D9ziRjGB.js} +1 -1
- package/dist/client/assets/{review-settings-CjaZPAVN.js → review-settings-Btnt9yMf.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-Bx6xpmAj.js → rich-text-link-control-D3iH-JTZ.js} +1 -1
- package/dist/client/assets/{roles-CQY7V_Nv.js → roles-BVDu3Xxj.js} +1 -1
- package/dist/client/assets/route-Bt9vgrKS.js +1 -0
- package/dist/client/assets/{route-Chcgj5js.js → route-D7ZfYats.js} +1 -1
- package/dist/client/assets/{route-BJUf6dcj.js → route-DgSk67PK.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-36tIZdMB.js → runnable-block-editor-Yuh74xe3.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-C9BC0S3N.js → sandbox-lifecycle-context-C5QKAHul.js} +1 -1
- package/dist/client/assets/{schema-2UaHsULm.js → schema-XbMJIWRo.js} +1 -1
- package/dist/client/assets/{scroll-area-BYHvZ2mI.js → scroll-area-rRniZYni.js} +1 -1
- package/dist/client/assets/{search-input-B_YLozB3.js → search-input-f14Hs9DC.js} +1 -1
- package/dist/client/assets/{search-toggle-gk1lAOE-.js → search-toggle-ydmpt0vj.js} +1 -1
- package/dist/client/assets/{secret-picker-TXboPuNL.js → secret-picker-DA-ZCB_H.js} +1 -1
- package/dist/client/assets/{secrets-B0siWpRR.js → secrets-CQ_mYMKv.js} +1 -1
- package/dist/client/assets/{sections-editor-DbE334qL.js → sections-editor-CWdchB_1.js} +1 -1
- package/dist/client/assets/{select-CGUBnSdo.js → select-Bur9VSDp.js} +1 -1
- package/dist/client/assets/{select-model-CvAltrce.js → select-model-zDpmpaQm.js} +1 -1
- package/dist/client/assets/{seo-editor-B_4BH5be.js → seo-editor-DKGGKomG.js} +1 -1
- package/dist/client/assets/{separator-C5Q36va9.js → separator-B9VOmM03.js} +1 -1
- package/dist/client/assets/{settings-tab-BEu6uPlX.js → settings-tab-DZnwlssY.js} +1 -1
- package/dist/client/assets/{sheet-7Pf6aTpk.js → sheet-BB4O5OwT.js} +1 -1
- package/dist/client/assets/{shell-layout-iAP3M_t2.js → shell-layout-BirRSTwU.js} +1 -1
- package/dist/client/assets/{skills-beo1viZi.js → skills-BKzwcH1e.js} +1 -1
- package/dist/client/assets/{sso-nlgrPDDd.js → sso-Cc-0CboC.js} +1 -1
- package/dist/client/assets/{suggestion-BoHqZ2zm.js → suggestion-IyavxmVa.js} +1 -1
- package/dist/client/assets/{switch-DS7j-ERy.js → switch-DcSUAA1j.js} +1 -1
- package/dist/client/assets/{synced-repos--TVpMVGF.js → synced-repos-flwxau-o.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CqKc2Jnq.js → tab-icon-glyph-9bAxbZkC.js} +1 -1
- package/dist/client/assets/{table-B9nrZOlA.js → table-CRO39QUH.js} +1 -1
- package/dist/client/assets/{tabs-C4Ipd_wa.js → tabs-Bc9RHMFB.js} +1 -1
- package/dist/client/assets/{task-board-DsbM6d_k.js → task-board-Cd9YAvG-.js} +1 -1
- package/dist/client/assets/{task-route-Dw_pjXIQ.js → task-route-CkQytW7C.js} +1 -1
- package/dist/client/assets/{task-status-Bu8dWbMG.js → task-status-BOm3EuKx.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CoNiVl0J.js → taskboard-analytics-OFa_uhmF.js} +1 -1
- package/dist/client/assets/{tasks-BpRBMq0r.js → tasks-BG9XYgI5.js} +1 -1
- package/dist/client/assets/tasks-D5n9wt3t.js +1 -0
- package/dist/client/assets/{textarea-5M2oFUCk.js → textarea-DDxcalk2.js} +1 -1
- package/dist/client/assets/{thread-analytics-DBgLHsuG.js → thread-analytics-DOsXcQeb.js} +1 -1
- package/dist/client/assets/{thread-button-D6_ujRz8.js → thread-button-ch7Mep8K.js} +1 -1
- package/dist/client/assets/{thread-intent-DYi-88yf.js → thread-intent-2fXPHcAu.js} +1 -1
- package/dist/client/assets/{thread-route-D8jj7JQn.js → thread-route-2otWdMgJ.js} +1 -1
- package/dist/client/assets/{thread-route-Ddedz3K3.js → thread-route-BT336v58.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CQZ4Xzqy.js → thread-sheet-body-BbK1ZoYh.js} +1 -1
- package/dist/client/assets/{toggle-group-B-XGJasE.js → toggle-group-CdYcnuUH.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Cme8sKPF.js → toolbar-icon-button-DUnRowf-.js} +1 -1
- package/dist/client/assets/{tooltip-CyP-7aI0.js → tooltip-Dmxy6Iwp.js} +1 -1
- package/dist/client/assets/{track-B2INqJw_.js → track-BtwskyUg.js} +1 -1
- package/dist/client/assets/{types-BGNIxZfy.js → types-Bme2CFon.js} +1 -1
- package/dist/client/assets/{usage-stats-DzFZMIXh.js → usage-stats-DpcWm2xr.js} +1 -1
- package/dist/client/assets/{use-ai-providers-4F-zKGq7.js → use-ai-providers-Br3ruvyh.js} +1 -1
- package/dist/client/assets/{use-automations-CObCkDjZ.js → use-automations-CnXDK6LR.js} +1 -1
- package/dist/client/assets/{use-autosave-lnP7w6IA.js → use-autosave-CTFYBfkb.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-DeR1Tqdr.js → use-chat-layout-state-DVSuwZNL.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-B89SfaFP.js → use-chat-navigation-ouFeOKae.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CAj_vE5f.js → use-clock-tick-_TChM0B6.js} +1 -1
- package/dist/client/assets/{use-connect-companion-C08Ls9V4.js → use-connect-companion-BwQTXyWc.js} +1 -1
- package/dist/client/assets/{use-connection-DsbJp2WH.js → use-connection-KD1C-9SB.js} +1 -1
- package/dist/client/assets/{use-copy-gILaQNS5.js → use-copy-DbnPtzRq.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B9llzBQy.js → use-create-virtual-mcp-aO-X73SS.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-JG2XlcuE.js → use-date-fns-locale-CaAoeC3-.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BDX075Uf.js → use-debounced-autosave-BAYPxxZJ.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CkSh2sdJ.js → use-debounced-value-B8x7v3h2.js} +1 -1
- package/dist/client/assets/{use-deco-credits-B6M50c5m.js → use-deco-credits-8WOAM4-s.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-GRYBUdoh.js → use-decopilot-events-Cq-KvUjE.js} +1 -1
- package/dist/client/assets/{use-delete-connection-M4g6mXhR.js → use-delete-connection-Bffk9q4E.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DoRISvgr.js → use-deployment-admin-D0HzXml2.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-BPOBE2S-.js → use-ensure-project-folder-CB3UqvjF.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-apV5WYRi.js → use-fast-preview-draft-url-SLEqabcE.js} +1 -1
- package/dist/client/assets/{use-file-configs-BmdGrQgB.js → use-file-configs-CL6vJq8e.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BhcJa6Dv.js → use-infinite-scroll-CZDZwEPK.js} +1 -1
- package/dist/client/assets/{use-join-requests-B6pi4oC9.js → use-join-requests-DDvLcfrT.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Bn7Q_nKJ.js → use-main-panel-tabs-CMbieCSL.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BwGIXOfQ.js → use-mcp-auth-status-BUlD-JC0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bm7mYuOR.js → use-mcp-client-DtG-9LNW.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CSphD1Ew.js → use-mcp-prompts-Dv23JU44.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Yl5gKY2j.js → use-mcp-tools-CZKyId72.js} +1 -1
- package/dist/client/assets/{use-members-BkFO1Bt8.js → use-members-3vohvwE9.js} +1 -1
- package/dist/client/assets/{use-mobile-D-nsnibB.js → use-mobile-Bym6FABz.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-ilYOi1P6.js → use-navigate-to-agent-nbLDGPuK.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-0oELLtma.js +1 -0
- package/dist/client/assets/{use-open-billing-url-BJSxQsX7.js → use-open-billing-url-cGocgOTK.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Ch8FFgkf.js → use-org-auth-client-CtCYentb.js} +1 -1
- package/dist/client/assets/{use-org-fs-D7r3cXXb.js → use-org-fs-C77pAkF9.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-YBN6v1a-.js → use-org-repo-syncs-UmpiXEvv.js} +1 -1
- package/dist/client/assets/{use-org-sso-ColeXCJP.js → use-org-sso-wmpr49G0.js} +1 -1
- package/dist/client/assets/{use-organization-roles-5OyxiKHR.js → use-organization-roles-Q3cNmSGK.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bkbee1TC.js → use-organization-settings-DZQdd38B.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CFkRSy6M.js → use-panel-navigate-RzIXYjdO.js} +1 -1
- package/dist/client/assets/{use-project-scope-BhC0oTXz.js → use-project-scope--vhdJJ3J.js} +1 -1
- package/dist/client/assets/{use-releases-BmqYrGh7.js → use-releases-DBacCX5N.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CCwARN0J.js → use-reports-diagnostic-E_xn3Cgh.js} +1 -1
- package/dist/client/assets/{use-secrets-tjcKGh8r.js → use-secrets-17a_0cVZ.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BuZjO6fr.js → use-section-preview-base-DMPxgaEy.js} +1 -1
- package/dist/client/assets/{use-session-runtime-ComyTd-K.js → use-session-runtime-CLu1QwVf.js} +1 -1
- package/dist/client/assets/{use-tags-oEpdgu7W.js → use-tags-CuO6eJY0.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BAFH41CD.js → use-task-board-analytics-Cs7ROzdM.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CJEARXda.js → use-task-board-events-Bv_4UM8-.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DNM-o2cs.js → use-task-metadata--tlu5jBn.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BsDhHRrs.js → use-thread-analytics-aeaCgBwr.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Cv0FzPvX.js → use-thread-outputs-9ggjmILA.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BXyifNbh.js +1 -0
- package/dist/client/assets/{useQueries-BtiLqqyQ.js → useQueries-Cqn1aSQB.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cwe5IPmT.js +1 -0
- package/dist/client/assets/{users-DyQGgOV3.js → users-CsqcV55O.js} +1 -1
- package/dist/client/assets/{utils-C41e_wcL.js → utils-BH5vUtAG.js} +1 -1
- package/dist/client/assets/{variant-calendar-B4sM-EEp.js → variant-calendar-DkQ9UHQw.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DYorwBPR.js → variant-matcher-override-BYGwhlzE.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Dqx01hDb.js → view-mode-toggle-X9MGawfA.js} +1 -1
- package/dist/client/assets/{virtual-mcp-k-QS-zY_.js → virtual-mcp-BWO_9b2I.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/agent-app-DCZ8xzM-.js +0 -1
- package/dist/client/assets/agent-deck-D-q8ZKHY.js +0 -1
- package/dist/client/assets/agent-library-DOYiSA2I.js +0 -1
- package/dist/client/assets/agent-library-file-B0o-BaD1.js +0 -1
- package/dist/client/assets/agent-settings-C4N5XRQB.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CzC0UMgl.js +0 -2
- package/dist/client/assets/agent-view-BchMOwqQ.js +0 -1
- package/dist/client/assets/api-keys-WRek4yc5.js +0 -1
- package/dist/client/assets/app-editor-BP33ySjF.js +0 -1
- package/dist/client/assets/flat-project-CqacAsy2.js +0 -1
- package/dist/client/assets/input-C5EZjiM5.js +0 -17
- package/dist/client/assets/library-ChuqB8UQ.js +0 -1
- package/dist/client/assets/project-reports-B7UkSmH1.js +0 -1
- package/dist/client/assets/project-tasks-DRbeO-yg.js +0 -1
- package/dist/client/assets/record-editor-Bb9CxLRe.js +0 -1
- package/dist/client/assets/reports-BpSqXBgV.js +0 -1
- package/dist/client/assets/route-DIenLn_2.js +0 -1
- package/dist/client/assets/tasks-B8Jp1enk.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-BMeMurTo.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CguvOv70.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CjC1GQYU.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ue,b as pe,j as o,G as ae,p as _e,ao as Ie,H as Ce,Y as Te,ae as Le,F as be,B as ce,I as De,e$ as Fe,X as ge,a2 as ke,K as fe,m as ye,a as we,o as ve,r as z,d3 as Ee,z as Pe,e as Ge,q as Q,t as he,l as Oe,ad as ze,n as de}from"./index-CmfXJaKn.js";import{b as Me,f as Ue,k as Re}from"./repository-binding-DLsaqYxe.js";import{i as $e}from"./DotsVertical-BlZNH3M2.js";import{a as Ve}from"./Tool01-R5YlhrWO.js";import{s as He}from"./Trash01-1y1rCSQ7.js";import{A as Be,bz as qe}from"./agent-icon-zpWPhOfj.js";import{u as Ke,f as xe}from"./use-date-fns-locale-JG2XlcuE.js";import{u as Se}from"./use-navigate-to-agent-ilYOi1P6.js";import{n as Qe}from"./use-organization-settings-Bkbee1TC.js";import{E as Ye}from"./empty-state-BRfCy1KK.js";import{u as Je}from"./use-create-virtual-mcp-B9llzBQy.js";import{b as Xe,u as We}from"./use-connection-DsbJp2WH.js";import{u as je}from"./use-mcp-client-Bm7mYuOR.js";import{a as Ze}from"./authenticate-and-persist-oauth-0pLi3EbJ.js";import{e as et}from"./extract-connection-data-BFK1aCsO.js";import{i as tt,G as ot}from"./repository-picker-BiHs5x47.js";import{h as st,C as it}from"./thread-intent-DYi-88yf.js";import{a as nt}from"./github-repo-scope-ByTYKy_L.js";import{f as rt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-lckxpDHD.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-DfdkHhmb.js";import{i as ft}from"./ArrowLeft-6EbZWTcH.js";import{C as ht}from"./collection-search-DHFp5D4H.js";import{A as xt,a as jt,b as Ct,c as bt,g as Dt,d as yt,e as wt,f as vt}from"./alert-dialog-CyLBdAzL.js";import{S as St}from"./search-input-B_YLozB3.js";import{s as Nt}from"./Plus-DQzzAz_7.js";import{R as At}from"./repository-import-picker-BuXUq4VL.js";import{u as _t}from"./use-debounced-value-CkSh2sdJ.js";import"./AlertCircle-BQdX39pt.js";import"./ArrowUp-2XhoOsi0.js";import"./LinkBroken01-CG-HmcZF.js";import"./ShoppingBag01-Cv1HC6f2.js";import"./ZoomOut-DK7mmj_3.js";import"./Building02-DkmblV_t.js";import"./CheckCircle-DKVKsPck.js";import"./Check-DT07hOsy.js";import"./ChevronUp-Bf0RRY9i.js";import"./UserSquare-DwmYgSB5.js";import"./Copy01-onj9VSIV.js";import"./CreditCard01-CunAqtsE.js";import"./Image01-D-zCGCY4.js";import"./Palette-VovT0PnZ.js";import"./XClose-D1JVUlwn.js";import"./Key01-BSZJTaKJ.js";import"./Link01-BgOzUKXX.js";import"./LinkExternal01-UbkWQoBv.js";import"./Monitor01-vP9TH_Iv.js";import"./Sun-4pXqabGH.js";import"./SearchMd-D6hQenCX.js";import"./Upload01-4H_HtY1H.js";import"./User01-Cc8kWxTi.js";import"./Users01-CYu_OK-x.js";import"./X-Bix2CJil.js";import"./differenceInSeconds-C3x8sHUj.js";import"./schema-2UaHsULm.js";import"./task-board-DsbM6d_k.js";import"./auth-ydnDmdni.js";import"./mcp-oauth-NtoAIxeI.js";import"./metadata-D72DunRR.js";import"./connection-8CqSsDm5.js";import"./tooltip-CyP-7aI0.js";import"./index-BBAhA6Le.js";import"./input-4qEEcM12.js";import"./label-bFgvSx58.js";import"./useInfiniteQuery-CguvOv70.js";import"./infiniteQueryObserver-BV5hUiLD.js";import"./avatar-CmK1yw1p.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";function It(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:n,onImportDeco:r,isCreating:u,align:p,side:C,showBetaBadge:m,showDecoImport:D}=t,w=p===void 0?"end":p,g=pe();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(_e,{size:14}),e[0]=f):f=e[0];let h;e[1]!==g?(h=g("common.createAgentDropdown.createFromScratch"),e[1]=g,e[2]=h):h=e[2];let x;e[3]!==u||e[4]!==s||e[5]!==h?(x=o.jsxs(ae,{disabled:u,onClick:s,children:[f,h]}),e[3]=u,e[4]=s,e[5]=h,e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ie,{className:"size-3.5"}),e[7]=b):b=e[7];let l;e[8]!==g?(l=g("common.createAgentDropdown.importFromGitHub"),e[8]=g,e[9]=l):l=e[9];let a;e[10]!==m?(a=m&&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]=m,e[11]=a):a=e[11];let c;e[12]!==n||e[13]!==l||e[14]!==a?(c=o.jsxs(ae,{onClick:n,children:[b,l,a]}),e[12]=n,e[13]=l,e[14]=a,e[15]=c):c=e[15];let d;e[16]!==r||e[17]!==D||e[18]!==g?(d=D&&o.jsxs(ae,{onClick:r,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),g("common.createAgentDropdown.importFromDeco")]}),e[16]=r,e[17]=D,e[18]=g,e[19]=d):d=e[19];let j;return e[20]!==w||e[21]!==C||e[22]!==x||e[23]!==c||e[24]!==d?(j=o.jsxs(Ce,{side:C,align:w,className:"w-48",children:[x,c,d]}),e[20]=w,e[21]=C,e[22]=x,e[23]=c,e[24]=d,e[25]=j):j=e[25],j}function Tt(t){const e=ue.c(51),{project:s,lastUsedAt:n,onDeleteClick:r}=t,u=Se(),p=Te(),C=pe(),m=Ke();let D;e[0]!==s.metadata?.ui?.layout||e[1]!==p?(D=p?void 0:Le(s.metadata?.ui?.layout),e[0]=s.metadata?.ui?.layout,e[1]=p,e[2]=D):D=e[2];const w=D;let g;e[3]!==w||e[4]!==u||e[5]!==s.id?(g=()=>u(s.id,{panel:w}),e[3]=w,e[4]=u,e[5]=s.id,e[6]=g):g=e[6];let f;e[7]!==s.title||e[8]!==g?(f=o.jsx("button",{type:"button",onClick:g,className:"absolute inset-0 z-0","aria-label":s.title}),e[7]=s.title,e[8]=g,e[9]=f):f=e[9];let h;e[10]!==s.icon||e[11]!==s.title?(h=o.jsx(Be,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[10]=s.icon,e[11]=s.title,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(be,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx($e,{size:20})})}),e[13]=x):x=e[13];let b;e[14]!==u||e[15]!==s.id?(b=()=>u(s.id,{panel:"settings"}),e[14]=u,e[15]=s.id,e[16]=b):b=e[16];let l;e[17]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ve,{size:16}),e[17]=l):l=e[17];let a;e[18]!==b?(a=o.jsxs(ae,{onClick:b,children:[l,"Settings"]}),e[18]=b,e[19]=a):a=e[19];let c;e[20]!==r?(c=r&&o.jsxs(ae,{variant:"destructive",onClick:i=>{i.stopPropagation(),r(i)},children:[o.jsx(He,{size:16}),"Delete"]}),e[20]=r,e[21]=c):c=e[21];let d;e[22]!==a||e[23]!==c?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(De,{children:[x,o.jsxs(Ce,{align:"end",children:[a,c]})]})}),e[22]=a,e[23]=c,e[24]=d):d=e[24];let j;e[25]!==d||e[26]!==h?(j=o.jsxs("div",{className:"flex items-start justify-between",children:[h,d]}),e[25]=d,e[26]=h,e[27]=j):j=e[27];let y;e[28]!==s.title?(y=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[28]=s.title,e[29]=y):y=e[29];const B=s.description||"No description";let v;e[30]!==B?(v=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:B}),e[30]=B,e[31]=v):v=e[31];let P;e[32]!==y||e[33]!==v?(P=o.jsxs("div",{className:"flex flex-col gap-1",children:[y,v]}),e[32]=y,e[33]=v,e[34]=P):P=e[34];let S;e[35]!==j||e[36]!==P?(S=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,P]}),e[35]=j,e[36]=P,e[37]=S):S=e[37];let _;e[38]!==n||e[39]!==m||e[40]!==s.updated_at||e[41]!==C?(_=n?C("home.projectCard.lastUsed",{time:xe(new Date(n),{addSuffix:!0,locale:m})}):C("home.projectCard.updated",{time:xe(new Date(s.updated_at),{addSuffix:!0,locale:m})}),e[38]=n,e[39]=m,e[40]=s.updated_at,e[41]=C,e[42]=_):_=e[42];let I;e[43]!==_?(I=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:_})})}),e[43]=_,e[44]=I):I=e[44];let G;e[45]!==S||e[46]!==I?(G=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[S,I]}),e[45]=S,e[46]=I,e[47]=G):G=e[47];let E;return e[48]!==G||e[49]!==f?(E=o.jsxs(Fe,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[f,G]}),e[48]=G,e[49]=f,e[50]=E):E=e[50],E}function Lt(t,e){const s=ue.c(10),{org:n}=ge(),r=ke();let u;s[0]!==t||s[1]!==n.id?(u=fe.registryApp(n.id,t),s[0]=t,s[1]=n.id,s[2]=u):u=s[2];let p;s[3]!==t||s[4]!==r?(p=()=>r.call("COLLECTION_REGISTRY_APP_GET",{name:t}),s[3]=t,s[4]=r,s[5]=p):p=s[5];const C=e?.enabled??!0;let m;return s[6]!==u||s[7]!==p||s[8]!==C?(m={queryKey:u,queryFn:p,select:Ft,enabled:C,staleTime:3e5},s[6]=u,s[7]=p,s[8]=C,s[9]=m):m=s[9],ye(m)}function Ft(t){return t.item}const kt="deco/github-mcp";function Et(t){const{org:e}=ge(),{data:s}=we.useSession(),n=Xe(),r=ve(),[u,p]=z.useState("idle"),[C,m]=z.useState(null),[D,w]=z.useState(null),{data:g,isLoading:f}=Lt(kt,{enabled:t.enabled}),h=z.useRef(!1);t.enabled&&g&&!f&&!h.current&&s?.user?.id&&u==="idle"&&(h.current=!0,x());async function x(){if(!(!g||!s?.user?.id||!e))try{p("installing"),m(null);const l=et(g,e.id,s.user.id,{remoteIndex:0});if(!l.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:c}=await n.create.mutateAsync(l);p("authenticating");const d=await Ze({connectionId:c,orgId:e.id,orgSlug:e.slug,persistFallback:j=>n.update.mutateAsync({id:c,data:{connection_token:j}}).then(()=>{})});if(d.ran&&!d.ok){try{await n.delete.mutateAsync(c)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Ee(r,e.id),w(l),p("ready")}catch(l){m(l instanceof Error?l.message:String(l)),p("error")}}function b(){p("idle"),m(null),w(null),h.current=!1}return t.enabled&&f&&u==="idle"?{status:"installing",error:null,connection:null,retry:b}:{status:u,error:C,connection:D,retry:b}}function Pt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${s} (${n.status})`);return r}function Gt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Ot({open:t,onOpenChange:e,onBack:s}){const n=pe(),{org:r}=ge(),u=Se(),p=ve(),{data:C}=we.useSession(),[m,D]=z.useState(null),[w,g]=z.useState(null),[f,h]=z.useState(""),x=je({connectionId:Pe,orgId:r.id,orgSlug:r.slug}),b=We({slug:"mcp-github"}),l=nt(b),a=Et({enabled:t&&l.length===0}),c=l.length===1?l[0]??null:w,d=l.length>1&&!c,j=je({connectionId:c?.id??"",orgId:r.id,orgSlug:r.slug}),y=t&&l.length===0&&(a.status==="installing"||a.status==="authenticating"||a.status==="idle"),{data:B,isLoading:v,error:P}=ye({queryKey:fe.decoSites(C?.user?.email),queryFn:()=>Gt(r.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=B?.sites??[],_=i=>{i||(D(null),g(null),h("")),e(i)},I=S.filter(i=>i.name.toLowerCase().includes(f.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(f.toLowerCase())??!1)),G=!m||I.some(i=>i.name===m),E=Ge({mutationFn:async i=>{if(!c)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));Q("deco_site_import_started",{site_name:i});const{installations:N}=await rt(k=>x.callTool(k),c.id),T=S.find(k=>k.name===i);if(!T)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const L=tt(i,T.metadata),F=lt(N,L.owner);if(!F)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:L.owner,installUrl:at}));let M=null,q=null;const le=async()=>{q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:q}}).catch(()=>{}),M&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${r.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},n("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:U,reused:H}=await ct({orgSlug:r.slug,sourceConnection:c,installationId:F.installationId,owner:L.owner,repo:L.name,githubCallTool:K=>j.callTool(K),selfCallTool:K=>x.callTool(K)});M=H?null:U;const R=k.icon??null,Y=Pt(i),J=i.toLowerCase(),$=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:R??null,metadata:{instructions:null,siteSlug:J,previewServerUrl:$,productionUrl:$,repository:{owner:L.owner,name:L.name,url:L.url,installationId:F.installationId,connectionId:U},ui:{banner:null,bannerColor:"#22C55E",icon:R,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:U}]}}}),O=V.structuredContent??V;if(!O.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return q=O.item.id,{slug:Y,virtualMcpId:O.item.id,item:O.item}}catch(k){throw await le(),k}},onSuccess:({slug:i,virtualMcpId:N,item:T})=>{Q("deco_site_import_succeeded",{site_name:T.title,virtual_mcp_id:N,slug:i}),p.setQueryData(fe.collectionItem(x,r.id,"","VIRTUAL_MCP",N),{item:T}),p.invalidateQueries({predicate:L=>{const F=L.queryKey;return F[1]===r.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),he.success(n("common.importFromDecoDialog.importSuccess",{slug:i})),_(!1),u(N)},onError:i=>{Q("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),he.error(n("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:_,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:f,onChange:h,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&h("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[a.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:a.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ce,{variant:"outline",size:"sm",onClick:a.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),y&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),d&&!y&&a.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")})}),l.map(i=>o.jsxs("button",{type:"button",onClick:()=>g(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.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(ot,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),v&&!y&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!v&&!y&&!d&&a.status!=="error"&&!P&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!v&&!y&&!d&&a.status!=="error"&&S.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:[I.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:f})}),I.map(i=>{const N=it(i.domains),T=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>D(i.name),className:Oe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",T?"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:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.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:i.name}),N&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:N})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ce,{variant:"outline",onClick:()=>_(!1),disabled:E.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ce,{disabled:!m||!G||E.isPending||v||y||d||!c||a.status==="error",onClick:()=>m&&E.mutate(m),children:E.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function es(){const t=ue.c(80),e=pe(),{org:s}=ge(),[n,r]=z.useState(""),u=_t(n,300);let p;t[0]!==u?(p={searchTerm:u},t[0]=u,t[1]=p):p=t[1];const C=Me(p),m=Ue();let D;t[2]===Symbol.for("react.memo_cache_sentinel")?(D={navigateOnCreate:!0},t[2]=D):D=t[2];const{createVirtualMCP:w,isCreating:g}=Je(D),[f,h]=z.useState(null),[x,b]=z.useState(!1),[l,a]=z.useState(!1),{granted:c}=ze("agents:manage"),d=Qe();let j;t[3]!==s?(j=A=>A.id!==s.id,t[3]=s,t[4]=j):j=t[4];const y=C.filter(j),{data:B}=Re(y.map(zt));let v;t[5]!==m||t[6]!==f||t[7]!==e?(v=async()=>{if(!f)return;const{id:A,title:Ae}=f;h(null);try{await m.delete.mutateAsync(A),Q("agent_deleted",{agent_id:A,source:"agents_list"}),he.success(e("routes.agentsList.deletedAgent",{title:Ae}))}catch{}},t[5]=m,t[6]=f,t[7]=e,t[8]=v):v=t[8];const P=v;let S;t[9]!==c||t[10]!==w||t[11]!==g||t[12]!==d||t[13]!==e?(S=c&&o.jsxs(De,{children:[o.jsx(be,{asChild:!0,children:o.jsxs(ce,{size:"sm",children:[o.jsx(Nt,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(It,{onCreateFromScratch:()=>{Q("agent_create_clicked",{source:"agents_list",method:"scratch"}),w()},onImportGitHub:()=>{Q("agent_create_clicked",{source:"agents_list",method:"github"}),a(!0)},onImportDeco:()=>{Q("agent_create_clicked",{source:"agents_list",method:"deco"}),b(!0)},isCreating:g,align:"end",showDecoImport:d})]}),t[9]=c,t[10]=w,t[11]=g,t[12]=d,t[13]=e,t[14]=S):S=t[14];const _=S,I=de,G=de,E=de;let i;t[15]!==e?(i=e("routes.agentsList.title"),t[15]=e,t[16]=i):i=t[16];let N;t[17]!==_||t[18]!==i?(N=o.jsx(de.Title,{actions:_,children:i}),t[17]=_,t[18]=i,t[19]=N):N=t[19];let T;t[20]!==e?(T=e("routes.agentsList.searchPlaceholder"),t[20]=e,t[21]=T):T=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=A=>{A.key==="Escape"&&(r(""),A.target.blur())},t[22]=L):L=t[22];let F;t[23]!==n||t[24]!==T?(F=o.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:o.jsx(St,{value:n,onChange:r,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:L})}),t[23]=n,t[24]=T,t[25]=F):F=t[25];let M;t[26]!==F||t[27]!==N?(M=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,F]}),t[26]=F,t[27]=N,t[28]=M):M=t[28];const q=y.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{actions:!1,image:o.jsx(qe,{size:48,className:"text-muted-foreground"}),title:e(n?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:n?e("routes.agentsList.noAgentsMatchSearch",{search:n}):e(c?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate")})}),le=y.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:y.map(A=>o.jsx(Tt,{project:A,lastUsedAt:B?.get(A.id)?.last_used_at,onDeleteClick:c?()=>h({id:A.id,title:A.title}):void 0},A.id))})]});let k;t[29]!==M||t[30]!==q||t[31]!==le||t[32]!==E.Container?(k=o.jsxs(E.Container,{children:[M,q,le]}),t[29]=M,t[30]=q,t[31]=le,t[32]=E.Container,t[33]=k):k=t[33];let U;t[34]!==k||t[35]!==G.Content?(U=o.jsx(G.Content,{children:k}),t[34]=k,t[35]=G.Content,t[36]=U):U=t[36];let H;t[37]!==l?(H=o.jsx(At,{open:l,onOpenChange:a}),t[37]=l,t[38]=H):H=t[38];let R;t[39]!==x?(R=o.jsx(Ot,{open:x,onOpenChange:b}),t[39]=x,t[40]=R):R=t[40];const Y=!!f;let J;t[41]===Symbol.for("react.memo_cache_sentinel")?(J=A=>!A&&h(null),t[41]=J):J=t[41];let $;t[42]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[42]=e,t[43]=$):$=t[43];let V;t[44]!==$?(V=o.jsx(xt,{children:$}),t[44]=$,t[45]=V):V=t[45];let O;t[46]!==e?(O=e("routes.agentsList.deleteAgentDescription"),t[46]=e,t[47]=O):O=t[47];const K=f?.title;let X;t[48]!==K?(X=o.jsx("span",{className:"font-medium text-foreground",children:K}),t[48]=K,t[49]=X):X=t[49];let W;t[50]!==O||t[51]!==X?(W=o.jsxs(jt,{children:[O," ",X,"."]}),t[50]=O,t[51]=X,t[52]=W):W=t[52];let Z;t[53]!==V||t[54]!==W?(Z=o.jsxs(Ct,{children:[V,W]}),t[53]=V,t[54]=W,t[55]=Z):Z=t[55];let ee;t[56]!==e?(ee=e("routes.agentsList.cancelButton"),t[56]=e,t[57]=ee):ee=t[57];let te;t[58]!==ee?(te=o.jsx(bt,{children:ee}),t[58]=ee,t[59]=te):te=t[59];let oe;t[60]!==e?(oe=e("routes.agentsList.deleteButton"),t[60]=e,t[61]=oe):oe=t[61];let se;t[62]!==P||t[63]!==oe?(se=o.jsx(Dt,{onClick:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[62]=P,t[63]=oe,t[64]=se):se=t[64];let ie;t[65]!==te||t[66]!==se?(ie=o.jsxs(yt,{children:[te,se]}),t[65]=te,t[66]=se,t[67]=ie):ie=t[67];let ne;t[68]!==Z||t[69]!==ie?(ne=o.jsxs(wt,{children:[Z,ie]}),t[68]=Z,t[69]=ie,t[70]=ne):ne=t[70];let re;t[71]!==Y||t[72]!==ne?(re=o.jsx(vt,{open:Y,onOpenChange:J,children:ne}),t[71]=Y,t[72]=ne,t[73]=re):re=t[73];let me;return t[74]!==I||t[75]!==U||t[76]!==H||t[77]!==R||t[78]!==re?(me=o.jsxs(I,{children:[U,H,R,re]}),t[74]=I,t[75]=U,t[76]=H,t[77]=R,t[78]=re,t[79]=me):me=t[79],me}function zt(t){return t.id}export{es as default};
|
|
1
|
+
import{c as ue,b as pe,j as o,G as ae,p as _e,ao as Ie,H as Ce,Y as Te,ae as Le,F as be,B as ce,I as De,e$ as Fe,X as ge,a2 as ke,K as fe,m as ye,a as we,o as ve,r as z,d3 as Ee,z as Pe,e as Ge,q as Q,t as he,l as Oe,ad as ze,n as de}from"./index-BSg0zn4o.js";import{b as Me,f as Ue,k as Re}from"./repository-binding-CKlCwDDd.js";import{i as $e}from"./DotsVertical-8YiGOIqq.js";import{a as Ve}from"./Tool01-BNeCU30E.js";import{s as He}from"./Trash01-BTpCOmuX.js";import{A as Be,bz as qe}from"./agent-icon-BhZZd37x.js";import{u as Ke,f as xe}from"./use-date-fns-locale-CaAoeC3-.js";import{u as Se}from"./use-navigate-to-agent-nbLDGPuK.js";import{n as Qe}from"./use-organization-settings-DZQdd38B.js";import{E as Ye}from"./empty-state-CmS3chTn.js";import{u as Je}from"./use-create-virtual-mcp-aO-X73SS.js";import{b as Xe,u as We}from"./use-connection-KD1C-9SB.js";import{u as je}from"./use-mcp-client-DtG-9LNW.js";import{a as Ze}from"./authenticate-and-persist-oauth-_u_GUn2l.js";import{e as et}from"./extract-connection-data-Ch1WBTd_.js";import{i as tt,G as ot}from"./repository-picker-DJEubVOt.js";import{h as st,C as it}from"./thread-intent-2fXPHcAu.js";import{a as nt}from"./github-repo-scope-ByTYKy_L.js";import{f as rt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-lckxpDHD.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-C8AdhrG0.js";import{i as ft}from"./ArrowLeft-q0aoA66K.js";import{C as ht}from"./collection-search-CKuVhNj4.js";import{A as xt,a as jt,b as Ct,c as bt,g as Dt,d as yt,e as wt,f as vt}from"./alert-dialog-PTVX9d3Y.js";import{S as St}from"./search-input-f14Hs9DC.js";import{s as Nt}from"./Plus-DC_7nhbs.js";import{R as At}from"./repository-import-picker-BWcgounQ.js";import{u as _t}from"./use-debounced-value-B8x7v3h2.js";import"./AlertCircle-rm9vrEtW.js";import"./ArrowUp-wgeukGJg.js";import"./LinkBroken01-C78kyif5.js";import"./ShoppingBag01-DNQzuGTX.js";import"./ZoomOut-DFERFVow.js";import"./Building02-BPTZeJ83.js";import"./CheckCircle-C2px0gfY.js";import"./Check-ycQN3J2t.js";import"./ChevronUp-B8UqekRj.js";import"./UserSquare-DJ8hiuYq.js";import"./Copy01-DFSuVPvj.js";import"./CreditCard01-C13hgCp6.js";import"./Image01-CgjyCWgG.js";import"./Palette-DOpFqZPK.js";import"./XClose-BbdvFCiX.js";import"./Key01-B1-8KpSg.js";import"./Link01-B8ajBJDc.js";import"./LinkExternal01-Bn0SPqIC.js";import"./Monitor01-DC2k418g.js";import"./Sun-COaeigjT.js";import"./SearchMd-Be3GMdpX.js";import"./Upload01-Dfmvp3DJ.js";import"./User01-4R_aUn4g.js";import"./Users01-v0Jyk4Ot.js";import"./X-DLYqFuX1.js";import"./differenceInSeconds-C3x8sHUj.js";import"./schema-XbMJIWRo.js";import"./task-board-Cd9YAvG-.js";import"./auth-CWILNz-R.js";import"./mcp-oauth-BEjgJ8S3.js";import"./metadata-D72DunRR.js";import"./connection-Dyn6n84s.js";import"./tooltip-Dmxy6Iwp.js";import"./index-hcdrCnDP.js";import"./input-DyRkn4pn.js";import"./label-Du2iAGWx.js";import"./useInfiniteQuery-BXyifNbh.js";import"./infiniteQueryObserver-ByHfufml.js";import"./avatar-Dl_cPf4a.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";function It(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:n,onImportDeco:r,isCreating:u,align:p,side:C,showBetaBadge:m,showDecoImport:D}=t,w=p===void 0?"end":p,g=pe();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(_e,{size:14}),e[0]=f):f=e[0];let h;e[1]!==g?(h=g("common.createAgentDropdown.createFromScratch"),e[1]=g,e[2]=h):h=e[2];let x;e[3]!==u||e[4]!==s||e[5]!==h?(x=o.jsxs(ae,{disabled:u,onClick:s,children:[f,h]}),e[3]=u,e[4]=s,e[5]=h,e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ie,{className:"size-3.5"}),e[7]=b):b=e[7];let l;e[8]!==g?(l=g("common.createAgentDropdown.importFromGitHub"),e[8]=g,e[9]=l):l=e[9];let a;e[10]!==m?(a=m&&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]=m,e[11]=a):a=e[11];let c;e[12]!==n||e[13]!==l||e[14]!==a?(c=o.jsxs(ae,{onClick:n,children:[b,l,a]}),e[12]=n,e[13]=l,e[14]=a,e[15]=c):c=e[15];let d;e[16]!==r||e[17]!==D||e[18]!==g?(d=D&&o.jsxs(ae,{onClick:r,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),g("common.createAgentDropdown.importFromDeco")]}),e[16]=r,e[17]=D,e[18]=g,e[19]=d):d=e[19];let j;return e[20]!==w||e[21]!==C||e[22]!==x||e[23]!==c||e[24]!==d?(j=o.jsxs(Ce,{side:C,align:w,className:"w-48",children:[x,c,d]}),e[20]=w,e[21]=C,e[22]=x,e[23]=c,e[24]=d,e[25]=j):j=e[25],j}function Tt(t){const e=ue.c(51),{project:s,lastUsedAt:n,onDeleteClick:r}=t,u=Se(),p=Te(),C=pe(),m=Ke();let D;e[0]!==s.metadata?.ui?.layout||e[1]!==p?(D=p?void 0:Le(s.metadata?.ui?.layout),e[0]=s.metadata?.ui?.layout,e[1]=p,e[2]=D):D=e[2];const w=D;let g;e[3]!==w||e[4]!==u||e[5]!==s.id?(g=()=>u(s.id,{panel:w}),e[3]=w,e[4]=u,e[5]=s.id,e[6]=g):g=e[6];let f;e[7]!==s.title||e[8]!==g?(f=o.jsx("button",{type:"button",onClick:g,className:"absolute inset-0 z-0","aria-label":s.title}),e[7]=s.title,e[8]=g,e[9]=f):f=e[9];let h;e[10]!==s.icon||e[11]!==s.title?(h=o.jsx(Be,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[10]=s.icon,e[11]=s.title,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(be,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx($e,{size:20})})}),e[13]=x):x=e[13];let b;e[14]!==u||e[15]!==s.id?(b=()=>u(s.id,{panel:"settings"}),e[14]=u,e[15]=s.id,e[16]=b):b=e[16];let l;e[17]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ve,{size:16}),e[17]=l):l=e[17];let a;e[18]!==b?(a=o.jsxs(ae,{onClick:b,children:[l,"Settings"]}),e[18]=b,e[19]=a):a=e[19];let c;e[20]!==r?(c=r&&o.jsxs(ae,{variant:"destructive",onClick:i=>{i.stopPropagation(),r(i)},children:[o.jsx(He,{size:16}),"Delete"]}),e[20]=r,e[21]=c):c=e[21];let d;e[22]!==a||e[23]!==c?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(De,{children:[x,o.jsxs(Ce,{align:"end",children:[a,c]})]})}),e[22]=a,e[23]=c,e[24]=d):d=e[24];let j;e[25]!==d||e[26]!==h?(j=o.jsxs("div",{className:"flex items-start justify-between",children:[h,d]}),e[25]=d,e[26]=h,e[27]=j):j=e[27];let y;e[28]!==s.title?(y=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[28]=s.title,e[29]=y):y=e[29];const B=s.description||"No description";let v;e[30]!==B?(v=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:B}),e[30]=B,e[31]=v):v=e[31];let P;e[32]!==y||e[33]!==v?(P=o.jsxs("div",{className:"flex flex-col gap-1",children:[y,v]}),e[32]=y,e[33]=v,e[34]=P):P=e[34];let S;e[35]!==j||e[36]!==P?(S=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,P]}),e[35]=j,e[36]=P,e[37]=S):S=e[37];let _;e[38]!==n||e[39]!==m||e[40]!==s.updated_at||e[41]!==C?(_=n?C("home.projectCard.lastUsed",{time:xe(new Date(n),{addSuffix:!0,locale:m})}):C("home.projectCard.updated",{time:xe(new Date(s.updated_at),{addSuffix:!0,locale:m})}),e[38]=n,e[39]=m,e[40]=s.updated_at,e[41]=C,e[42]=_):_=e[42];let I;e[43]!==_?(I=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:_})})}),e[43]=_,e[44]=I):I=e[44];let G;e[45]!==S||e[46]!==I?(G=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[S,I]}),e[45]=S,e[46]=I,e[47]=G):G=e[47];let E;return e[48]!==G||e[49]!==f?(E=o.jsxs(Fe,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[f,G]}),e[48]=G,e[49]=f,e[50]=E):E=e[50],E}function Lt(t,e){const s=ue.c(10),{org:n}=ge(),r=ke();let u;s[0]!==t||s[1]!==n.id?(u=fe.registryApp(n.id,t),s[0]=t,s[1]=n.id,s[2]=u):u=s[2];let p;s[3]!==t||s[4]!==r?(p=()=>r.call("COLLECTION_REGISTRY_APP_GET",{name:t}),s[3]=t,s[4]=r,s[5]=p):p=s[5];const C=e?.enabled??!0;let m;return s[6]!==u||s[7]!==p||s[8]!==C?(m={queryKey:u,queryFn:p,select:Ft,enabled:C,staleTime:3e5},s[6]=u,s[7]=p,s[8]=C,s[9]=m):m=s[9],ye(m)}function Ft(t){return t.item}const kt="deco/github-mcp";function Et(t){const{org:e}=ge(),{data:s}=we.useSession(),n=Xe(),r=ve(),[u,p]=z.useState("idle"),[C,m]=z.useState(null),[D,w]=z.useState(null),{data:g,isLoading:f}=Lt(kt,{enabled:t.enabled}),h=z.useRef(!1);t.enabled&&g&&!f&&!h.current&&s?.user?.id&&u==="idle"&&(h.current=!0,x());async function x(){if(!(!g||!s?.user?.id||!e))try{p("installing"),m(null);const l=et(g,e.id,s.user.id,{remoteIndex:0});if(!l.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:c}=await n.create.mutateAsync(l);p("authenticating");const d=await Ze({connectionId:c,orgId:e.id,orgSlug:e.slug,persistFallback:j=>n.update.mutateAsync({id:c,data:{connection_token:j}}).then(()=>{})});if(d.ran&&!d.ok){try{await n.delete.mutateAsync(c)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Ee(r,e.id),w(l),p("ready")}catch(l){m(l instanceof Error?l.message:String(l)),p("error")}}function b(){p("idle"),m(null),w(null),h.current=!1}return t.enabled&&f&&u==="idle"?{status:"installing",error:null,connection:null,retry:b}:{status:u,error:C,connection:D,retry:b}}function Pt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${s} (${n.status})`);return r}function Gt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Ot({open:t,onOpenChange:e,onBack:s}){const n=pe(),{org:r}=ge(),u=Se(),p=ve(),{data:C}=we.useSession(),[m,D]=z.useState(null),[w,g]=z.useState(null),[f,h]=z.useState(""),x=je({connectionId:Pe,orgId:r.id,orgSlug:r.slug}),b=We({slug:"mcp-github"}),l=nt(b),a=Et({enabled:t&&l.length===0}),c=l.length===1?l[0]??null:w,d=l.length>1&&!c,j=je({connectionId:c?.id??"",orgId:r.id,orgSlug:r.slug}),y=t&&l.length===0&&(a.status==="installing"||a.status==="authenticating"||a.status==="idle"),{data:B,isLoading:v,error:P}=ye({queryKey:fe.decoSites(C?.user?.email),queryFn:()=>Gt(r.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=B?.sites??[],_=i=>{i||(D(null),g(null),h("")),e(i)},I=S.filter(i=>i.name.toLowerCase().includes(f.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(f.toLowerCase())??!1)),G=!m||I.some(i=>i.name===m),E=Ge({mutationFn:async i=>{if(!c)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));Q("deco_site_import_started",{site_name:i});const{installations:N}=await rt(k=>x.callTool(k),c.id),T=S.find(k=>k.name===i);if(!T)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const L=tt(i,T.metadata),F=lt(N,L.owner);if(!F)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:L.owner,installUrl:at}));let M=null,q=null;const le=async()=>{q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:q}}).catch(()=>{}),M&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${r.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},n("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:U,reused:H}=await ct({orgSlug:r.slug,sourceConnection:c,installationId:F.installationId,owner:L.owner,repo:L.name,githubCallTool:K=>j.callTool(K),selfCallTool:K=>x.callTool(K)});M=H?null:U;const R=k.icon??null,Y=Pt(i),J=i.toLowerCase(),$=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:R??null,metadata:{instructions:null,siteSlug:J,previewServerUrl:$,productionUrl:$,repository:{owner:L.owner,name:L.name,url:L.url,installationId:F.installationId,connectionId:U},ui:{banner:null,bannerColor:"#22C55E",icon:R,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:U}]}}}),O=V.structuredContent??V;if(!O.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return q=O.item.id,{slug:Y,virtualMcpId:O.item.id,item:O.item}}catch(k){throw await le(),k}},onSuccess:({slug:i,virtualMcpId:N,item:T})=>{Q("deco_site_import_succeeded",{site_name:T.title,virtual_mcp_id:N,slug:i}),p.setQueryData(fe.collectionItem(x,r.id,"","VIRTUAL_MCP",N),{item:T}),p.invalidateQueries({predicate:L=>{const F=L.queryKey;return F[1]===r.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),he.success(n("common.importFromDecoDialog.importSuccess",{slug:i})),_(!1),u(N)},onError:i=>{Q("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),he.error(n("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:_,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:f,onChange:h,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&h("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[a.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:a.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ce,{variant:"outline",size:"sm",onClick:a.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),y&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),d&&!y&&a.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")})}),l.map(i=>o.jsxs("button",{type:"button",onClick:()=>g(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.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(ot,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),v&&!y&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!v&&!y&&!d&&a.status!=="error"&&!P&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!v&&!y&&!d&&a.status!=="error"&&S.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:[I.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:f})}),I.map(i=>{const N=it(i.domains),T=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>D(i.name),className:Oe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",T?"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:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.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:i.name}),N&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:N})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ce,{variant:"outline",onClick:()=>_(!1),disabled:E.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ce,{disabled:!m||!G||E.isPending||v||y||d||!c||a.status==="error",onClick:()=>m&&E.mutate(m),children:E.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function es(){const t=ue.c(80),e=pe(),{org:s}=ge(),[n,r]=z.useState(""),u=_t(n,300);let p;t[0]!==u?(p={searchTerm:u},t[0]=u,t[1]=p):p=t[1];const C=Me(p),m=Ue();let D;t[2]===Symbol.for("react.memo_cache_sentinel")?(D={navigateOnCreate:!0},t[2]=D):D=t[2];const{createVirtualMCP:w,isCreating:g}=Je(D),[f,h]=z.useState(null),[x,b]=z.useState(!1),[l,a]=z.useState(!1),{granted:c}=ze("agents:manage"),d=Qe();let j;t[3]!==s?(j=A=>A.id!==s.id,t[3]=s,t[4]=j):j=t[4];const y=C.filter(j),{data:B}=Re(y.map(zt));let v;t[5]!==m||t[6]!==f||t[7]!==e?(v=async()=>{if(!f)return;const{id:A,title:Ae}=f;h(null);try{await m.delete.mutateAsync(A),Q("agent_deleted",{agent_id:A,source:"agents_list"}),he.success(e("routes.agentsList.deletedAgent",{title:Ae}))}catch{}},t[5]=m,t[6]=f,t[7]=e,t[8]=v):v=t[8];const P=v;let S;t[9]!==c||t[10]!==w||t[11]!==g||t[12]!==d||t[13]!==e?(S=c&&o.jsxs(De,{children:[o.jsx(be,{asChild:!0,children:o.jsxs(ce,{size:"sm",children:[o.jsx(Nt,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(It,{onCreateFromScratch:()=>{Q("agent_create_clicked",{source:"agents_list",method:"scratch"}),w()},onImportGitHub:()=>{Q("agent_create_clicked",{source:"agents_list",method:"github"}),a(!0)},onImportDeco:()=>{Q("agent_create_clicked",{source:"agents_list",method:"deco"}),b(!0)},isCreating:g,align:"end",showDecoImport:d})]}),t[9]=c,t[10]=w,t[11]=g,t[12]=d,t[13]=e,t[14]=S):S=t[14];const _=S,I=de,G=de,E=de;let i;t[15]!==e?(i=e("routes.agentsList.title"),t[15]=e,t[16]=i):i=t[16];let N;t[17]!==_||t[18]!==i?(N=o.jsx(de.Title,{actions:_,children:i}),t[17]=_,t[18]=i,t[19]=N):N=t[19];let T;t[20]!==e?(T=e("routes.agentsList.searchPlaceholder"),t[20]=e,t[21]=T):T=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=A=>{A.key==="Escape"&&(r(""),A.target.blur())},t[22]=L):L=t[22];let F;t[23]!==n||t[24]!==T?(F=o.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:o.jsx(St,{value:n,onChange:r,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:L})}),t[23]=n,t[24]=T,t[25]=F):F=t[25];let M;t[26]!==F||t[27]!==N?(M=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,F]}),t[26]=F,t[27]=N,t[28]=M):M=t[28];const q=y.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{actions:!1,image:o.jsx(qe,{size:48,className:"text-muted-foreground"}),title:e(n?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:n?e("routes.agentsList.noAgentsMatchSearch",{search:n}):e(c?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate")})}),le=y.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:y.map(A=>o.jsx(Tt,{project:A,lastUsedAt:B?.get(A.id)?.last_used_at,onDeleteClick:c?()=>h({id:A.id,title:A.title}):void 0},A.id))})]});let k;t[29]!==M||t[30]!==q||t[31]!==le||t[32]!==E.Container?(k=o.jsxs(E.Container,{children:[M,q,le]}),t[29]=M,t[30]=q,t[31]=le,t[32]=E.Container,t[33]=k):k=t[33];let U;t[34]!==k||t[35]!==G.Content?(U=o.jsx(G.Content,{children:k}),t[34]=k,t[35]=G.Content,t[36]=U):U=t[36];let H;t[37]!==l?(H=o.jsx(At,{open:l,onOpenChange:a}),t[37]=l,t[38]=H):H=t[38];let R;t[39]!==x?(R=o.jsx(Ot,{open:x,onOpenChange:b}),t[39]=x,t[40]=R):R=t[40];const Y=!!f;let J;t[41]===Symbol.for("react.memo_cache_sentinel")?(J=A=>!A&&h(null),t[41]=J):J=t[41];let $;t[42]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[42]=e,t[43]=$):$=t[43];let V;t[44]!==$?(V=o.jsx(xt,{children:$}),t[44]=$,t[45]=V):V=t[45];let O;t[46]!==e?(O=e("routes.agentsList.deleteAgentDescription"),t[46]=e,t[47]=O):O=t[47];const K=f?.title;let X;t[48]!==K?(X=o.jsx("span",{className:"font-medium text-foreground",children:K}),t[48]=K,t[49]=X):X=t[49];let W;t[50]!==O||t[51]!==X?(W=o.jsxs(jt,{children:[O," ",X,"."]}),t[50]=O,t[51]=X,t[52]=W):W=t[52];let Z;t[53]!==V||t[54]!==W?(Z=o.jsxs(Ct,{children:[V,W]}),t[53]=V,t[54]=W,t[55]=Z):Z=t[55];let ee;t[56]!==e?(ee=e("routes.agentsList.cancelButton"),t[56]=e,t[57]=ee):ee=t[57];let te;t[58]!==ee?(te=o.jsx(bt,{children:ee}),t[58]=ee,t[59]=te):te=t[59];let oe;t[60]!==e?(oe=e("routes.agentsList.deleteButton"),t[60]=e,t[61]=oe):oe=t[61];let se;t[62]!==P||t[63]!==oe?(se=o.jsx(Dt,{onClick:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[62]=P,t[63]=oe,t[64]=se):se=t[64];let ie;t[65]!==te||t[66]!==se?(ie=o.jsxs(yt,{children:[te,se]}),t[65]=te,t[66]=se,t[67]=ie):ie=t[67];let ne;t[68]!==Z||t[69]!==ie?(ne=o.jsxs(wt,{children:[Z,ie]}),t[68]=Z,t[69]=ie,t[70]=ne):ne=t[70];let re;t[71]!==Y||t[72]!==ne?(re=o.jsx(vt,{open:Y,onOpenChange:J,children:ne}),t[71]=Y,t[72]=ne,t[73]=re):re=t[73];let me;return t[74]!==I||t[75]!==U||t[76]!==H||t[77]!==R||t[78]!==re?(me=o.jsxs(I,{children:[U,H,R,re]}),t[74]=I,t[75]=U,t[76]=H,t[77]=R,t[78]=re,t[79]=me):me=t[79],me}function zt(t){return t.id}export{es as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as G,b as Z,as as tt,at as st,r as J,j as s,aU as vt,eg as it,t as ee,ef as Ne,ee as ae,aJ as lt,X as ne,a2 as le,o as be,e as re,x as Ae,B as W,K as X,m as Pe,aS as Se,l as oe,db as nt,fK as bt,e$ as Ce,ad as jt,ak as yt,L as Nt,q as Ve,h as St,au as Ct,av as Ke,fJ as Pt}from"./index-CmfXJaKn.js";import{i as _t}from"./AlertCircle-BQdX39pt.js";import{u as rt,a as ke,i as It,b as kt,p as wt,f as Ee,g as Dt,e as at}from"./use-ai-providers-4F-zKGq7.js";import{i as Kt}from"./CheckCircle-DKVKsPck.js";import{d as At,k as Et}from"./use-organization-settings-Bkbee1TC.js";import{S as Rt}from"./schema-2UaHsULm.js";import{M as Tt}from"./select-model-CvAltrce.js";import{u as Ut}from"./use-debounced-autosave-BDX075Uf.js";import{I as ye}from"./input-4qEEcM12.js";import{T as Ge,a as Mt}from"./toggle-group-B-XGJasE.js";import{A as Re,a as Te,b as Ue,c as Me,g as $e,d as Oe,e as Fe,f as Le}from"./alert-dialog-CyLBdAzL.js";import{u as De,e as qe,a as ot,f as $t}from"./use-decopilot-events-GRYBUdoh.js";import{u as ct}from"./use-open-billing-url-BJSxQsX7.js";import{u as dt,P as Be,a as Ot,i as Ft,f as Lt,F as qt,S as ut}from"./plan-ladder-BJXeUQY6.js";import{i as Bt}from"./Check-DT07hOsy.js";import{d as Ht,b as zt,c as Vt}from"./Tool01-R5YlhrWO.js";import{s as Gt}from"./Plus-DQzzAz_7.js";import{s as Qt}from"./Trash01-1y1rCSQ7.js";import{A as Yt}from"./avatar-CmK1yw1p.js";import{u as Wt,f as Zt}from"./use-date-fns-locale-JG2XlcuE.js";import{c as mt,P as Jt,C as Qe}from"./decopilot-BVdjTDzA.js";import{P as Xt}from"./ai-providers-logos-DD3qZ33J.js";import{s as es}from"./Image01-D-zCGCY4.js";import{d as ts,c as ss,b as is,D as ls,e as ns}from"./dialog-DfdkHhmb.js";import{R as rs}from"./require-capability-BEya1FVv.js";import"./task-board-DsbM6d_k.js";import"./drawer-CIqQnl1u.js";import"./use-mobile-D-nsnibB.js";import"./chat-context-Bx9MVwv5.js";import"./use-panel-navigate-CFkRSy6M.js";import"./thread-route-D8jj7JQn.js";import"./use-project-scope-BhC0oTXz.js";import"./repository-binding-DLsaqYxe.js";import"./use-mcp-client-Bm7mYuOR.js";import"./auth-ydnDmdni.js";import"./autosend-BGaION3N.js";import"./thread-intent-DYi-88yf.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-chat-navigation-B89SfaFP.js";import"./location-zK0I9Ia6.js";import"./index-DLxL4E4g.js";import"./User01-Cc8kWxTi.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-C49TGIp0.js";import"./select-CGUBnSdo.js";import"./index-BBAhA6Le.js";import"./ChevronUp-Bf0RRY9i.js";import"./ArrowLeft-6EbZWTcH.js";import"./Key01-BSZJTaKJ.js";import"./SearchMd-D6hQenCX.js";import"./Monitor01-vP9TH_Iv.js";import"./download-app-dialog-CfJbVT9R.js";import"./Copy01-onj9VSIV.js";import"./X-Bix2CJil.js";import"./access-gate-E9akvl7M.js";import"./capability-load-error-Ljpou6Bo.js";const as=e=>e.capabilities?.includes("image")===!0,os=e=>It(e),cs=e=>kt(e),ds=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:as},{key:"web_search",filter:os},{key:"deep_research",filter:cs}];function us(e){const t=G.c(27),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:r}=e,c=rt(),l=c.some(b=>b.id===i?.keyId)?i?.keyId:null,[d,f]=J.useState(l??r),[p,a]=J.useState(l);p!==l&&(a(l),l&&f(l));let m;t[0]!==c||t[1]!==r||t[2]!==d?(m=c.some(b=>b.id===d)?d:r,t[0]=c,t[1]=r,t[2]=d,t[3]=m):m=t[3];const u=m;let h;t[4]!==u||t[5]!==c?(h=u?c.find(b=>b.id===u):null,t[4]=u,t[5]=c,t[6]=h):h=t[6];const P=h,{models:S,isLoading:v}=ke(o?u??void 0:void 0),y=o?v||S.some(o):!0;let C;t[7]!==i||t[8]!==P?.providerId||t[9]!==l?(C=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:P?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=P?.providerId,t[9]=l,t[10]=C):C=t[10];const I=C,x=Z();if(o&&!y){let b;t[11]!==x?(b=x("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=x,t[12]=b):b=t[12];let w;return t[13]!==b?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[13]=b,t[14]=w):w=t[14],w}let j;t[15]!==x?(j=x("settings.simpleModeSection.pickModel"),t[15]=x,t[16]=j):j=t[16];let _;t[17]===Symbol.for("react.memo_cache_sentinel")?(_=b=>f(b),t[17]=_):_=t[17];let g;t[18]!==u||t[19]!==n?(g=b=>{const w=b.keyId??u??"";f(w),n({keyId:w,modelId:b.modelId,title:b.title})},t[18]=u,t[19]=n,t[20]=g):g=t[20];let N;return t[21]!==u||t[22]!==o||t[23]!==I||t[24]!==j||t[25]!==g?(N=s.jsx(Tt,{variant:"bordered",placeholder:j,model:I,credentialId:u,filterModels:o,onCredentialChange:_,onModelChange:g}),t[21]=u,t[22]=o,t[23]=I,t[24]=j,t[25]=g,t[26]=N):N=t[26],N}function ms(e){const t=G.c(10),{isPending:i,showSaved:n}=e,o=Z();if(i){let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(lt,{size:12,className:"animate-spin"}),t[0]=r):r=t[0];let c;t[1]!==o?(c=o("settings.simpleModeSection.saving"),t[1]=o,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r,c]}),t[3]=c,t[4]=l):l=t[4],l}if(n){let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Kt,{size:12}),t[5]=r):r=t[5];let c;t[6]!==o?(c=o("settings.simpleModeSection.saved"),t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function fs(){const e=G.c(58),t=Z(),i=rt(),n=At(),o=i.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=tt(Rt),e[0]=r):r=e[0];let c;e[1]!==n?(c={resolver:r,values:n,mode:"onChange"},e[1]=n,e[2]=c):c=e[2];const l=st(c),{mutate:d,isPending:f,isSuccess:p}=Et(),a=l.formState.isDirty;let m;e[3]!==l||e[4]!==n||e[5]!==t||e[6]!==d?(m={delayMs:250,save:async()=>{const k=l.getValues();d(k,{onSuccess:()=>l.reset(k,{keepValues:!0}),onError:F=>{l.reset(n),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=l,e[4]=n,e[5]=t,e[6]=d,e[7]=m):m=e[7];const{schedule:u}=Ut(m),h=i[0],P=i[1],S=i[2],{models:v}=ke(h?.id),{models:y}=ke(P?.id),{models:C}=ke(S?.id);let I,x;e[8]!==l||e[9]!==o?(I=()=>{o||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},x=[o,l],e[8]=l,e[9]=o,e[10]=I,e[11]=x):(I=e[10],x=e[11]),J.useEffect(I,x);let j;e[12]!==i||e[13]!==l||e[14]!==h||e[15]!==P||e[16]!==S||e[17]!==v||e[18]!==y||e[19]!==C?(j=()=>{const k=l.getValues(),F=new Set(i.map(ps)),B={};h?.id&&(B[h.id]=v),P?.id&&(B[P.id]=y),S?.id&&(B[S.id]=C);const z=se=>se!=null&&!F.has(se.keyId),T={fast:z(k.tiers.fast)?null:k.tiers.fast,smart:z(k.tiers.smart)?null:k.tiers.smart,thinking:z(k.tiers.thinking)?null:k.tiers.thinking,image:z(k.tiers.image)?null:k.tiers.image,web_search:z(k.tiers.web_search)?null:k.tiers.web_search,deep_research:z(k.tiers.deep_research)?null:k.tiers.deep_research},Q=!T.fast||!T.smart||!T.thinking||!T.image||!T.web_search||!T.deep_research,te=T.fast===k.tiers.fast&&T.smart===k.tiers.smart&&T.thinking===k.tiers.thinking&&T.image===k.tiers.image&&T.web_search===k.tiers.web_search&&T.deep_research===k.tiers.deep_research;if(!Q&&te)return;const Y=wt(i,B);l.reset({tiers:{fast:T.fast??Y.chat.fast,smart:T.smart??Y.chat.smart,thinking:T.thinking??Y.chat.thinking,image:T.image??Y.image,web_search:T.web_search??Y.webSearch,deep_research:T.deep_research??Y.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=h,e[15]=P,e[16]=S,e[17]=v,e[18]=y,e[19]=C,e[20]=j):j=e[20];const _=h?.id,g=P?.id,N=S?.id;let b;e[21]!==i||e[22]!==l||e[23]!==v||e[24]!==y||e[25]!==C||e[26]!==_||e[27]!==g||e[28]!==N?(b=[l,i,v,y,C,_,g,N],e[21]=i,e[22]=l,e[23]=v,e[24]=y,e[25]=C,e[26]=_,e[27]=g,e[28]=N,e[29]=b):b=e[29],J.useEffect(j,b);let w;e[30]!==t?(w=k=>({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")})[k]||k,e[30]=t,e[31]=w):w=e[31];const R=w;let K;e[32]!==t?(K=k=>({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")})[k]||"",e[32]=t,e[33]=K):K=e[33];const A=K;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let $;e[36]!==t?($=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=$):$=e[37];let E;e[38]!==$?(E=s.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=E):E=e[39];const L=p&&!a;let O;e[40]!==f||e[41]!==L?(O=s.jsx(ms,{isPending:f,showSaved:L}),e[40]=f,e[41]=L,e[42]=O):O=e[42];let q;e[43]!==E||e[44]!==O?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[E,O]}),e[43]=E,e[44]=O,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==A||e[49]!==R||e[50]!==u?(H=ds.map(k=>s.jsx(vt,{control:l.control,name:`tiers.${k.key}`,render:F=>{const{field:B}=F;return s.jsx(it,{title:R(k.key),description:A(k.key),action:s.jsx(us,{slot:B.value,defaultKeyId:i[0]?.id??null,filterModels:k.filter,onSlotChange:z=>{B.onChange(z),u()}})})}},k.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=A,e[49]=R,e[50]=u,e[51]=H):H=e[51];let D;e[52]!==H?(D=s.jsx(Ne,{children:H}),e[52]=H,e[53]=D):D=e[53];let M;return e[54]!==U||e[55]!==q||e[56]!==D?(M=s.jsxs(ae,{title:U,headerClassName:"pl-0",children:[q,D]}),e[54]=U,e[55]=q,e[56]=D,e[57]=M):M=e[57],M}function ps(e){return e.id}const gs={usd:[10,20,100],brl:[50,100,500]};function ft(){const e=G.c(30),t=Z(),i=le(),[n]=Ae(),[o,r]=J.useState(!1);let c;e[0]!==t?(c=g=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:g.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=re({mutationFn:async g=>{const{url:N}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:g,currency:u});return N},onSuccess:xs,onError:c}),[f,p]=J.useState(""),[a,m]=J.useState(n.language==="pt-BR"?"brl":"usd"),u=a,h=parseFloat(f),P=!isNaN(h)&&h>=1,S=u==="brl"?"R$":"$";let v;e[2]!==m?(v=g=>{g&&m(g)},e[2]=m,e[3]=v):v=e[3];let y,C;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ge,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),C=s.jsx(Ge,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=y,e[5]=C):(y=e[4],C=e[5]);let I;e[6]!==u||e[7]!==v?(I=s.jsxs(Mt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:v,children:[y,C]}),e[6]=u,e[7]=v,e[8]=I):I=e[8];let x;e[9]!==u||e[10]!==S||e[11]!==o||e[12]!==d||e[13]!==t||e[14]!==l?(x=!o&&s.jsxs(s.Fragment,{children:[gs[u].map(g=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(g*100),children:[S,g]},g)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>r(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=S,e[11]=o,e[12]=d,e[13]=t,e[14]=l,e[15]=x):x=e[15];let j;e[16]!==S||e[17]!==f||e[18]!==h||e[19]!==o||e[20]!==P||e[21]!==d||e[22]!==p||e[23]!==t||e[24]!==l?(j=o&&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:S}),s.jsx(ye,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:f,onChange:g=>p(g.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!P||d,onClick:()=>l(Math.round(h*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{r(!1),p("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=S,e[17]=f,e[18]=h,e[19]=o,e[20]=P,e[21]=d,e[22]=p,e[23]=t,e[24]=l,e[25]=j):j=e[25];let _;return e[26]!==I||e[27]!==x||e[28]!==j?(_=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[I,x,j]})}),e[26]=I,e[27]=x,e[28]=j,e[29]=_):_=e[29],_}function xs(e){e&&window.open(e,"_blank","noopener,noreferrer")}function hs(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function vs(e){const t=G.c(38),{enabled:i}=e,n=Z(),{org:o}=ne(),r=le();let c;t[0]!==o.id?(c=X.aiProviderCredits(o.id,"deco"),t[0]=o.id,t[1]=c):c=t[1];let l;t[2]!==r?(l=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=r,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:f,isLoading:p,refetch:a,isFetching:m}=Pe(d);if(!i)return null;const u=f?.balanceCents!=null?f.balanceCents/100:null;let h;t[8]!==u?(h=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=h):h=t[9];const P=h;let S;t[10]!==u||t[11]!==P||t[12]!==m||t[13]!==p?(S=p||m?s.jsx(Se,{className:"h-9 w-24"}):s.jsx("span",{className:oe("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&hs(u)),children:P}),t[10]=u,t[11]=P,t[12]=m,t[13]=p,t[14]=S):S=t[14];let v;t[15]!==a?(v=()=>a(),t[15]=a,t[16]=v):v=t[16];let y;t[17]!==n?(y=n("settings.decoCreditsHero.refreshBalance"),t[17]=n,t[18]=y):y=t[18];const C=m&&"animate-spin";let I;t[19]!==C?(I=oe(C),t[19]=C,t[20]=I):I=t[20];let x;t[21]!==I?(x=s.jsx(lt,{size:14,className:I}),t[21]=I,t[22]=x):x=t[22];let j;t[23]!==m||t[24]!==x||t[25]!==v||t[26]!==y?(j=s.jsx("button",{type:"button",onClick:v,disabled:m,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-lg hover:bg-muted/50","aria-label":y,children:x}),t[23]=m,t[24]=x,t[25]=v,t[26]=y,t[27]=j):j=t[27];let _;t[28]!==j||t[29]!==S?(_=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,j]}),t[28]=j,t[29]=S,t[30]=_):_=t[30];let g;t[31]!==n?(g=n("settings.decoCreditsHero.availableBalance"),t[31]=n,t[32]=g):g=t[32];let N;t[33]!==g?(N=s.jsx("p",{className:"text-xs text-muted-foreground",children:g}),t[33]=g,t[34]=N):N=t[34];let b;return t[35]!==_||t[36]!==N?(b=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[_,N]}),t[35]=_,t[36]=N,t[37]=b):b=t[37],b}function bs(){const e=G.c(74),t=Z(),{org:i}=ne(),n=le(),o=be(),r=Ee();let c;e[0]!==r?(c=r.find(js),e[0]=r,e[1]=c):c=e[1];const l=c,d=De(),f=qe("credits"),[p,a]=J.useState(!1);let m;e[2]!==l||e[3]!==n?(m=async()=>{l&&await n.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=n,e[4]=m):m=e[4];let u;e[5]!==i||e[6]!==o||e[7]!==t?(u=()=>{o.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),o.invalidateQueries({queryKey:X.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),a(!1)},e[5]=i,e[6]=o,e[7]=t,e[8]=u):u=e[8];let h;e[9]!==t?(h=z=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=h):h=e[10];let P;e[11]!==m||e[12]!==u||e[13]!==h?(P={mutationFn:m,onSuccess:u,onError:h},e[11]=m,e[12]=u,e[13]=h,e[14]=P):P=e[14];const{mutate:S,isPending:v}=re(P);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=e[16];let C;e[17]!==t?(C=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=C):C=e[18];let I;e[19]!==C?(I=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:C,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=C,e[20]=I):I=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>a(!0),e[21]=x):x=e[21];let j;e[22]!==t?(j=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=j):j=e[23];let _;e[24]!==v||e[25]!==j?(_=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:x,disabled:v,children:j}),e[24]=v,e[25]=j,e[26]=_):_=e[26];let g;e[27]!==_||e[28]!==I?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[I,_]}),e[27]=_,e[28]=I,e[29]=g):g=e[29];let N;e[30]!==t?(N=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=N):N=e[31];let b;e[32]!==N?(b=s.jsx(Re,{children:N}),e[32]=N,e[33]=b):b=e[33];let w;e[34]!==t?(w=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=w):w=e[35];let R;e[36]!==w?(R=s.jsx(Te,{children:w}),e[36]=w,e[37]=R):R=e[37];let K;e[38]!==b||e[39]!==R?(K=s.jsxs(Ue,{children:[b,R]}),e[38]=b,e[39]=R,e[40]=K):K=e[40];let A;e[41]!==t?(A=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=A):A=e[42];let U;e[43]!==A?(U=s.jsx(Me,{children:A}),e[43]=A,e[44]=U):U=e[44];let $;e[45]!==S?($=()=>S(),e[45]=S,e[46]=$):$=e[46];let E;e[47]!==t?(E=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=E):E=e[48];let L;e[49]!==$||e[50]!==E?(L=s.jsx($e,{onClick:$,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:E}),e[49]=$,e[50]=E,e[51]=L):L=e[51];let O;e[52]!==U||e[53]!==L?(O=s.jsxs(Oe,{children:[U,L]}),e[52]=U,e[53]=L,e[54]=O):O=e[54];let q;e[55]!==K||e[56]!==O?(q=s.jsxs(Fe,{children:[K,O]}),e[55]=K,e[56]=O,e[57]=q):q=e[57];let H;e[58]!==p||e[59]!==q?(H=s.jsx(Le,{open:p,onOpenChange:a,children:q}),e[58]=p,e[59]=q,e[60]=H):H=e[60];const D=!d;let M;e[61]!==D?(M=s.jsx(vs,{enabled:D}),e[61]=D,e[62]=M):M=e[62];let k;e[63]!==f||e[64]!==t?(k=f?s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:t("settings.decoCreditsHero.addCredits")}),s.jsx(ft,{})]}):null,e[63]=f,e[64]=t,e[65]=k):k=e[65];let F;e[66]!==g||e[67]!==H||e[68]!==M||e[69]!==k?(F=s.jsx(Ne,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[g,H,M,k]})}),e[66]=g,e[67]=H,e[68]=M,e[69]=k,e[70]=F):F=e[70];let B;return e[71]!==F||e[72]!==y?(B=s.jsx(ae,{title:y,children:F}),e[71]=F,e[72]=y,e[73]=B):B=e[73],B}function js(e){return e.providerId==="deco"}var He="Progress",ze=100,[ys]=bt(He),[Ns,Ss]=ys(He),pt=J.forwardRef((e,t)=>{const{__scopeProgress:i,value:n=null,max:o,getValueLabel:r=Cs,...c}=e;(o||o===0)&&!Ye(o)&&console.error(Ps(`${o}`,"Progress"));const l=Ye(o)?o:ze;n!==null&&!We(n,l)&&console.error(_s(`${n}`,"Progress"));const d=We(n,l)?n:null,f=we(d)?r(d,l):void 0;return s.jsx(Ns,{scope:i,value:d,max:l,children:s.jsx(nt.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":we(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":ht(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});pt.displayName=He;var gt="ProgressIndicator",xt=J.forwardRef((e,t)=>{const{__scopeProgress:i,...n}=e,o=Ss(gt,i);return s.jsx(nt.div,{"data-state":ht(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...n,ref:t})});xt.displayName=gt;function Cs(e,t){return`${Math.round(e/t*100)}%`}function ht(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function we(e){return typeof e=="number"}function Ye(e){return we(e)&&!isNaN(e)&&e>0}function We(e,t){return we(e)&&!isNaN(e)&&e<=t&&e>=0}function Ps(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ze}\`.`}function _s(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
1
|
+
import{c as G,b as Z,as as tt,at as st,r as J,j as s,aU as vt,eg as it,t as ee,ef as Ne,ee as ae,aJ as lt,X as ne,a2 as le,o as be,e as re,x as Ae,B as W,K as X,m as Pe,aS as Se,l as oe,db as nt,fK as bt,e$ as Ce,ad as jt,ak as yt,L as Nt,q as Ve,h as St,au as Ct,av as Ke,fJ as Pt}from"./index-BSg0zn4o.js";import{i as _t}from"./AlertCircle-rm9vrEtW.js";import{u as rt,a as ke,i as It,b as kt,p as wt,f as Ee,g as Dt,e as at}from"./use-ai-providers-Br3ruvyh.js";import{i as Kt}from"./CheckCircle-C2px0gfY.js";import{d as At,k as Et}from"./use-organization-settings-DZQdd38B.js";import{S as Rt}from"./schema-XbMJIWRo.js";import{M as Tt}from"./select-model-zDpmpaQm.js";import{u as Ut}from"./use-debounced-autosave-BAYPxxZJ.js";import{I as ye}from"./input-DyRkn4pn.js";import{T as Ge,a as Mt}from"./toggle-group-CdYcnuUH.js";import{A as Re,a as Te,b as Ue,c as Me,g as $e,d as Oe,e as Fe,f as Le}from"./alert-dialog-PTVX9d3Y.js";import{u as De,e as qe,a as ot,f as $t}from"./use-decopilot-events-Cq-KvUjE.js";import{u as ct}from"./use-open-billing-url-cGocgOTK.js";import{u as dt,P as Be,a as Ot,i as Ft,f as Lt,F as qt,S as ut}from"./plan-ladder-CqI-1A4t.js";import{i as Bt}from"./Check-ycQN3J2t.js";import{d as Ht,b as zt,c as Vt}from"./Tool01-BNeCU30E.js";import{s as Gt}from"./Plus-DC_7nhbs.js";import{s as Qt}from"./Trash01-BTpCOmuX.js";import{A as Yt}from"./avatar-Dl_cPf4a.js";import{u as Wt,f as Zt}from"./use-date-fns-locale-CaAoeC3-.js";import{c as mt,P as Jt,C as Qe}from"./decopilot-CVtUuYjj.js";import{P as Xt}from"./ai-providers-logos-DD3qZ33J.js";import{s as es}from"./Image01-CgjyCWgG.js";import{d as ts,c as ss,b as is,D as ls,e as ns}from"./dialog-C8AdhrG0.js";import{R as rs}from"./require-capability-CMsD4Xq5.js";import"./task-board-Cd9YAvG-.js";import"./drawer-BZnmFrAT.js";import"./use-mobile-Bym6FABz.js";import"./chat-context-Dx9zNHfj.js";import"./use-panel-navigate-RzIXYjdO.js";import"./thread-route-2otWdMgJ.js";import"./use-project-scope--vhdJJ3J.js";import"./repository-binding-CKlCwDDd.js";import"./use-mcp-client-DtG-9LNW.js";import"./auth-CWILNz-R.js";import"./autosend-C7DyeWiW.js";import"./thread-intent-2fXPHcAu.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-chat-navigation-ouFeOKae.js";import"./location-zK0I9Ia6.js";import"./index-DZYzJ3Ve.js";import"./User01-4R_aUn4g.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-BGY2RDHl.js";import"./select-Bur9VSDp.js";import"./index-hcdrCnDP.js";import"./ChevronUp-B8UqekRj.js";import"./ArrowLeft-q0aoA66K.js";import"./Key01-B1-8KpSg.js";import"./SearchMd-Be3GMdpX.js";import"./Monitor01-DC2k418g.js";import"./download-app-dialog-URSdQ4ke.js";import"./Copy01-DFSuVPvj.js";import"./X-DLYqFuX1.js";import"./access-gate-CDypY0PL.js";import"./capability-load-error-Gcuy_zZQ.js";const as=e=>e.capabilities?.includes("image")===!0,os=e=>It(e),cs=e=>kt(e),ds=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:as},{key:"web_search",filter:os},{key:"deep_research",filter:cs}];function us(e){const t=G.c(27),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:r}=e,c=rt(),l=c.some(b=>b.id===i?.keyId)?i?.keyId:null,[d,f]=J.useState(l??r),[p,a]=J.useState(l);p!==l&&(a(l),l&&f(l));let m;t[0]!==c||t[1]!==r||t[2]!==d?(m=c.some(b=>b.id===d)?d:r,t[0]=c,t[1]=r,t[2]=d,t[3]=m):m=t[3];const u=m;let h;t[4]!==u||t[5]!==c?(h=u?c.find(b=>b.id===u):null,t[4]=u,t[5]=c,t[6]=h):h=t[6];const P=h,{models:S,isLoading:v}=ke(o?u??void 0:void 0),y=o?v||S.some(o):!0;let C;t[7]!==i||t[8]!==P?.providerId||t[9]!==l?(C=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:P?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=P?.providerId,t[9]=l,t[10]=C):C=t[10];const I=C,x=Z();if(o&&!y){let b;t[11]!==x?(b=x("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=x,t[12]=b):b=t[12];let w;return t[13]!==b?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[13]=b,t[14]=w):w=t[14],w}let j;t[15]!==x?(j=x("settings.simpleModeSection.pickModel"),t[15]=x,t[16]=j):j=t[16];let _;t[17]===Symbol.for("react.memo_cache_sentinel")?(_=b=>f(b),t[17]=_):_=t[17];let g;t[18]!==u||t[19]!==n?(g=b=>{const w=b.keyId??u??"";f(w),n({keyId:w,modelId:b.modelId,title:b.title})},t[18]=u,t[19]=n,t[20]=g):g=t[20];let N;return t[21]!==u||t[22]!==o||t[23]!==I||t[24]!==j||t[25]!==g?(N=s.jsx(Tt,{variant:"bordered",placeholder:j,model:I,credentialId:u,filterModels:o,onCredentialChange:_,onModelChange:g}),t[21]=u,t[22]=o,t[23]=I,t[24]=j,t[25]=g,t[26]=N):N=t[26],N}function ms(e){const t=G.c(10),{isPending:i,showSaved:n}=e,o=Z();if(i){let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(lt,{size:12,className:"animate-spin"}),t[0]=r):r=t[0];let c;t[1]!==o?(c=o("settings.simpleModeSection.saving"),t[1]=o,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r,c]}),t[3]=c,t[4]=l):l=t[4],l}if(n){let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Kt,{size:12}),t[5]=r):r=t[5];let c;t[6]!==o?(c=o("settings.simpleModeSection.saved"),t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function fs(){const e=G.c(58),t=Z(),i=rt(),n=At(),o=i.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=tt(Rt),e[0]=r):r=e[0];let c;e[1]!==n?(c={resolver:r,values:n,mode:"onChange"},e[1]=n,e[2]=c):c=e[2];const l=st(c),{mutate:d,isPending:f,isSuccess:p}=Et(),a=l.formState.isDirty;let m;e[3]!==l||e[4]!==n||e[5]!==t||e[6]!==d?(m={delayMs:250,save:async()=>{const k=l.getValues();d(k,{onSuccess:()=>l.reset(k,{keepValues:!0}),onError:F=>{l.reset(n),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=l,e[4]=n,e[5]=t,e[6]=d,e[7]=m):m=e[7];const{schedule:u}=Ut(m),h=i[0],P=i[1],S=i[2],{models:v}=ke(h?.id),{models:y}=ke(P?.id),{models:C}=ke(S?.id);let I,x;e[8]!==l||e[9]!==o?(I=()=>{o||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},x=[o,l],e[8]=l,e[9]=o,e[10]=I,e[11]=x):(I=e[10],x=e[11]),J.useEffect(I,x);let j;e[12]!==i||e[13]!==l||e[14]!==h||e[15]!==P||e[16]!==S||e[17]!==v||e[18]!==y||e[19]!==C?(j=()=>{const k=l.getValues(),F=new Set(i.map(ps)),B={};h?.id&&(B[h.id]=v),P?.id&&(B[P.id]=y),S?.id&&(B[S.id]=C);const z=se=>se!=null&&!F.has(se.keyId),T={fast:z(k.tiers.fast)?null:k.tiers.fast,smart:z(k.tiers.smart)?null:k.tiers.smart,thinking:z(k.tiers.thinking)?null:k.tiers.thinking,image:z(k.tiers.image)?null:k.tiers.image,web_search:z(k.tiers.web_search)?null:k.tiers.web_search,deep_research:z(k.tiers.deep_research)?null:k.tiers.deep_research},Q=!T.fast||!T.smart||!T.thinking||!T.image||!T.web_search||!T.deep_research,te=T.fast===k.tiers.fast&&T.smart===k.tiers.smart&&T.thinking===k.tiers.thinking&&T.image===k.tiers.image&&T.web_search===k.tiers.web_search&&T.deep_research===k.tiers.deep_research;if(!Q&&te)return;const Y=wt(i,B);l.reset({tiers:{fast:T.fast??Y.chat.fast,smart:T.smart??Y.chat.smart,thinking:T.thinking??Y.chat.thinking,image:T.image??Y.image,web_search:T.web_search??Y.webSearch,deep_research:T.deep_research??Y.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=h,e[15]=P,e[16]=S,e[17]=v,e[18]=y,e[19]=C,e[20]=j):j=e[20];const _=h?.id,g=P?.id,N=S?.id;let b;e[21]!==i||e[22]!==l||e[23]!==v||e[24]!==y||e[25]!==C||e[26]!==_||e[27]!==g||e[28]!==N?(b=[l,i,v,y,C,_,g,N],e[21]=i,e[22]=l,e[23]=v,e[24]=y,e[25]=C,e[26]=_,e[27]=g,e[28]=N,e[29]=b):b=e[29],J.useEffect(j,b);let w;e[30]!==t?(w=k=>({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")})[k]||k,e[30]=t,e[31]=w):w=e[31];const R=w;let K;e[32]!==t?(K=k=>({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")})[k]||"",e[32]=t,e[33]=K):K=e[33];const A=K;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let $;e[36]!==t?($=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=$):$=e[37];let E;e[38]!==$?(E=s.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=E):E=e[39];const L=p&&!a;let O;e[40]!==f||e[41]!==L?(O=s.jsx(ms,{isPending:f,showSaved:L}),e[40]=f,e[41]=L,e[42]=O):O=e[42];let q;e[43]!==E||e[44]!==O?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[E,O]}),e[43]=E,e[44]=O,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==A||e[49]!==R||e[50]!==u?(H=ds.map(k=>s.jsx(vt,{control:l.control,name:`tiers.${k.key}`,render:F=>{const{field:B}=F;return s.jsx(it,{title:R(k.key),description:A(k.key),action:s.jsx(us,{slot:B.value,defaultKeyId:i[0]?.id??null,filterModels:k.filter,onSlotChange:z=>{B.onChange(z),u()}})})}},k.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=A,e[49]=R,e[50]=u,e[51]=H):H=e[51];let D;e[52]!==H?(D=s.jsx(Ne,{children:H}),e[52]=H,e[53]=D):D=e[53];let M;return e[54]!==U||e[55]!==q||e[56]!==D?(M=s.jsxs(ae,{title:U,headerClassName:"pl-0",children:[q,D]}),e[54]=U,e[55]=q,e[56]=D,e[57]=M):M=e[57],M}function ps(e){return e.id}const gs={usd:[10,20,100],brl:[50,100,500]};function ft(){const e=G.c(30),t=Z(),i=le(),[n]=Ae(),[o,r]=J.useState(!1);let c;e[0]!==t?(c=g=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:g.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=re({mutationFn:async g=>{const{url:N}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:g,currency:u});return N},onSuccess:xs,onError:c}),[f,p]=J.useState(""),[a,m]=J.useState(n.language==="pt-BR"?"brl":"usd"),u=a,h=parseFloat(f),P=!isNaN(h)&&h>=1,S=u==="brl"?"R$":"$";let v;e[2]!==m?(v=g=>{g&&m(g)},e[2]=m,e[3]=v):v=e[3];let y,C;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ge,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),C=s.jsx(Ge,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=y,e[5]=C):(y=e[4],C=e[5]);let I;e[6]!==u||e[7]!==v?(I=s.jsxs(Mt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:v,children:[y,C]}),e[6]=u,e[7]=v,e[8]=I):I=e[8];let x;e[9]!==u||e[10]!==S||e[11]!==o||e[12]!==d||e[13]!==t||e[14]!==l?(x=!o&&s.jsxs(s.Fragment,{children:[gs[u].map(g=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(g*100),children:[S,g]},g)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>r(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=S,e[11]=o,e[12]=d,e[13]=t,e[14]=l,e[15]=x):x=e[15];let j;e[16]!==S||e[17]!==f||e[18]!==h||e[19]!==o||e[20]!==P||e[21]!==d||e[22]!==p||e[23]!==t||e[24]!==l?(j=o&&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:S}),s.jsx(ye,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:f,onChange:g=>p(g.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!P||d,onClick:()=>l(Math.round(h*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{r(!1),p("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=S,e[17]=f,e[18]=h,e[19]=o,e[20]=P,e[21]=d,e[22]=p,e[23]=t,e[24]=l,e[25]=j):j=e[25];let _;return e[26]!==I||e[27]!==x||e[28]!==j?(_=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[I,x,j]})}),e[26]=I,e[27]=x,e[28]=j,e[29]=_):_=e[29],_}function xs(e){e&&window.open(e,"_blank","noopener,noreferrer")}function hs(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function vs(e){const t=G.c(38),{enabled:i}=e,n=Z(),{org:o}=ne(),r=le();let c;t[0]!==o.id?(c=X.aiProviderCredits(o.id,"deco"),t[0]=o.id,t[1]=c):c=t[1];let l;t[2]!==r?(l=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=r,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:f,isLoading:p,refetch:a,isFetching:m}=Pe(d);if(!i)return null;const u=f?.balanceCents!=null?f.balanceCents/100:null;let h;t[8]!==u?(h=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=h):h=t[9];const P=h;let S;t[10]!==u||t[11]!==P||t[12]!==m||t[13]!==p?(S=p||m?s.jsx(Se,{className:"h-9 w-24"}):s.jsx("span",{className:oe("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&hs(u)),children:P}),t[10]=u,t[11]=P,t[12]=m,t[13]=p,t[14]=S):S=t[14];let v;t[15]!==a?(v=()=>a(),t[15]=a,t[16]=v):v=t[16];let y;t[17]!==n?(y=n("settings.decoCreditsHero.refreshBalance"),t[17]=n,t[18]=y):y=t[18];const C=m&&"animate-spin";let I;t[19]!==C?(I=oe(C),t[19]=C,t[20]=I):I=t[20];let x;t[21]!==I?(x=s.jsx(lt,{size:14,className:I}),t[21]=I,t[22]=x):x=t[22];let j;t[23]!==m||t[24]!==x||t[25]!==v||t[26]!==y?(j=s.jsx("button",{type:"button",onClick:v,disabled:m,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-lg hover:bg-muted/50","aria-label":y,children:x}),t[23]=m,t[24]=x,t[25]=v,t[26]=y,t[27]=j):j=t[27];let _;t[28]!==j||t[29]!==S?(_=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,j]}),t[28]=j,t[29]=S,t[30]=_):_=t[30];let g;t[31]!==n?(g=n("settings.decoCreditsHero.availableBalance"),t[31]=n,t[32]=g):g=t[32];let N;t[33]!==g?(N=s.jsx("p",{className:"text-xs text-muted-foreground",children:g}),t[33]=g,t[34]=N):N=t[34];let b;return t[35]!==_||t[36]!==N?(b=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[_,N]}),t[35]=_,t[36]=N,t[37]=b):b=t[37],b}function bs(){const e=G.c(74),t=Z(),{org:i}=ne(),n=le(),o=be(),r=Ee();let c;e[0]!==r?(c=r.find(js),e[0]=r,e[1]=c):c=e[1];const l=c,d=De(),f=qe("credits"),[p,a]=J.useState(!1);let m;e[2]!==l||e[3]!==n?(m=async()=>{l&&await n.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=n,e[4]=m):m=e[4];let u;e[5]!==i||e[6]!==o||e[7]!==t?(u=()=>{o.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),o.invalidateQueries({queryKey:X.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),a(!1)},e[5]=i,e[6]=o,e[7]=t,e[8]=u):u=e[8];let h;e[9]!==t?(h=z=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=h):h=e[10];let P;e[11]!==m||e[12]!==u||e[13]!==h?(P={mutationFn:m,onSuccess:u,onError:h},e[11]=m,e[12]=u,e[13]=h,e[14]=P):P=e[14];const{mutate:S,isPending:v}=re(P);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=e[16];let C;e[17]!==t?(C=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=C):C=e[18];let I;e[19]!==C?(I=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:C,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=C,e[20]=I):I=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>a(!0),e[21]=x):x=e[21];let j;e[22]!==t?(j=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=j):j=e[23];let _;e[24]!==v||e[25]!==j?(_=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:x,disabled:v,children:j}),e[24]=v,e[25]=j,e[26]=_):_=e[26];let g;e[27]!==_||e[28]!==I?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[I,_]}),e[27]=_,e[28]=I,e[29]=g):g=e[29];let N;e[30]!==t?(N=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=N):N=e[31];let b;e[32]!==N?(b=s.jsx(Re,{children:N}),e[32]=N,e[33]=b):b=e[33];let w;e[34]!==t?(w=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=w):w=e[35];let R;e[36]!==w?(R=s.jsx(Te,{children:w}),e[36]=w,e[37]=R):R=e[37];let K;e[38]!==b||e[39]!==R?(K=s.jsxs(Ue,{children:[b,R]}),e[38]=b,e[39]=R,e[40]=K):K=e[40];let A;e[41]!==t?(A=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=A):A=e[42];let U;e[43]!==A?(U=s.jsx(Me,{children:A}),e[43]=A,e[44]=U):U=e[44];let $;e[45]!==S?($=()=>S(),e[45]=S,e[46]=$):$=e[46];let E;e[47]!==t?(E=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=E):E=e[48];let L;e[49]!==$||e[50]!==E?(L=s.jsx($e,{onClick:$,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:E}),e[49]=$,e[50]=E,e[51]=L):L=e[51];let O;e[52]!==U||e[53]!==L?(O=s.jsxs(Oe,{children:[U,L]}),e[52]=U,e[53]=L,e[54]=O):O=e[54];let q;e[55]!==K||e[56]!==O?(q=s.jsxs(Fe,{children:[K,O]}),e[55]=K,e[56]=O,e[57]=q):q=e[57];let H;e[58]!==p||e[59]!==q?(H=s.jsx(Le,{open:p,onOpenChange:a,children:q}),e[58]=p,e[59]=q,e[60]=H):H=e[60];const D=!d;let M;e[61]!==D?(M=s.jsx(vs,{enabled:D}),e[61]=D,e[62]=M):M=e[62];let k;e[63]!==f||e[64]!==t?(k=f?s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:t("settings.decoCreditsHero.addCredits")}),s.jsx(ft,{})]}):null,e[63]=f,e[64]=t,e[65]=k):k=e[65];let F;e[66]!==g||e[67]!==H||e[68]!==M||e[69]!==k?(F=s.jsx(Ne,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[g,H,M,k]})}),e[66]=g,e[67]=H,e[68]=M,e[69]=k,e[70]=F):F=e[70];let B;return e[71]!==F||e[72]!==y?(B=s.jsx(ae,{title:y,children:F}),e[71]=F,e[72]=y,e[73]=B):B=e[73],B}function js(e){return e.providerId==="deco"}var He="Progress",ze=100,[ys]=bt(He),[Ns,Ss]=ys(He),pt=J.forwardRef((e,t)=>{const{__scopeProgress:i,value:n=null,max:o,getValueLabel:r=Cs,...c}=e;(o||o===0)&&!Ye(o)&&console.error(Ps(`${o}`,"Progress"));const l=Ye(o)?o:ze;n!==null&&!We(n,l)&&console.error(_s(`${n}`,"Progress"));const d=We(n,l)?n:null,f=we(d)?r(d,l):void 0;return s.jsx(Ns,{scope:i,value:d,max:l,children:s.jsx(nt.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":we(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":ht(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});pt.displayName=He;var gt="ProgressIndicator",xt=J.forwardRef((e,t)=>{const{__scopeProgress:i,...n}=e,o=Ss(gt,i);return s.jsx(nt.div,{"data-state":ht(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...n,ref:t})});xt.displayName=gt;function Cs(e,t){return`${Math.round(e/t*100)}%`}function ht(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function we(e){return typeof e=="number"}function Ye(e){return we(e)&&!isNaN(e)&&e>0}function We(e,t){return we(e)&&!isNaN(e)&&e<=t&&e>=0}function Ps(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ze}\`.`}function _s(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2
2
|
- a positive number
|
|
3
3
|
- less than the value passed to \`max\` (or ${ze} if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as o,j as c,aH as d}from"./index-
|
|
1
|
+
import{c as n,l as o,j as c,aH as d}from"./index-BSg0zn4o.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{v as A,f as a,x as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r,bf as w,r as i,bm as m,dj as T,aw as O,bp as M,bg as I,bh as z,bl as A,dk as D,bi as F,de as k,bF as L,bj as G,bk as H,c as n,l as p,az as v}from"./index-
|
|
1
|
+
import{j as r,bf as w,r as i,bm as m,dj as T,aw as O,bp as M,bg as I,bh as z,bl as A,dk as D,bi as F,de as k,bF as L,bj as G,bk as H,c as n,l as p,az as v}from"./index-BSg0zn4o.js";var x="AlertDialog",[V]=L(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var W="AlertDialogTrigger",Y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});Y.displayName=W;var q="AlertDialogPortal",b=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};b.displayName=q;var B="AlertDialogOverlay",y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});y.displayName=B;var f="AlertDialogContent",[J,K]=V(f),Q=k("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(T,{contentName:f,titleName:_,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var _="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=_;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({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
|
|
package/dist/client/assets/{analytics-sections-St-vkcN9.js → analytics-sections-DBNJksaf.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as L,c as N,j as s,b as E}from"./index-
|
|
1
|
+
import{r as L,c as N,j as s,b as E}from"./index-BSg0zn4o.js";import{b as D,c as M,d as F,C as I,a as A}from"./chart-m7qkl4bi.js";import{T as B,a as H,b as _,c as K,d as U,e as z}from"./table-CRO39QUH.js";import{a0 as P,a1 as V,C as W,Y as X}from"./CartesianChart-CeNVmGpJ.js";import{L as Y}from"./Line-DkNHkEZJ.js";import{X as G}from"./XAxis-Dt1OJoaL.js";var q=["axis"],J=L.forwardRef((r,e)=>L.createElement(P,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:q,tooltipPayloadSearcher:V,categoricalChartProps:r,ref:e}));const v=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function R(r){const e=Math.abs(r);return e<60?`${Math.round(r)}s`:e<3600?`${Math.round(r/60)}m`:e<86400?`${(r/3600).toFixed(1)}h`:`${(r/86400).toFixed(1)}d`}function O(r,e){return r===null||Number.isNaN(r)?"—":e==="s"?R(r):e==="%"?`${r}%`:e==="USD"?`$${r.toFixed(2)}`:r.toLocaleString()}function Q(r){const e=N.c(4),{section:t}=r;let o;e[0]!==t.values?(o=t.values.map(Z),e[0]=t.values,e[1]=o):o=e[1];let a;return e[2]!==o?(a=s.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:o}),e[2]=o,e[3]=a):a=e[3],a}function Z(r){return s.jsxs("div",{className:"rounded-lg border border-border p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:r.label}),s.jsx("div",{className:"mt-1 text-2xl font-medium text-foreground tabular-nums",children:O(r.value,r.unit)})]},r.label)}function ee(r){return Array.from(new Set(r.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function te(r){const e=N.c(30),{section:t}=r,o=ee(t.points),a=Object.fromEntries(o.map(ne));let n;e[0]!==t.points?(n=t.points.map(se),e[0]=t.points,e[1]=n):n=e[1];const l=n,c=E();if(l.length===0){let m;e[2]!==c?(m=c("taskBoard.analytics.noDataInRange"),e[2]=c,e[3]=m):m=e[3];let T;return e[4]!==m?(T=s.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:m}),e[4]=m,e[5]=T):T=e[5],T}const d=F,x="img",p=t.title,b="h-64 w-full",g=J;let i,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(i={left:0,right:8,top:8,bottom:8},f=s.jsx(W,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[6]=i,e[7]=f):(i=e[6],f=e[7]);let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(G,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),e[8]=j):j=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h={fontSize:11,fill:"var(--muted-foreground)"},e[9]=h):h=e[9];let u;e[10]!==t.unit?(u=s.jsx(X,{axisLine:!1,tickLine:!1,tick:h,tickFormatter:m=>t.unit==="s"?R(m):String(m),width:48}),e[10]=t.unit,e[11]=u):u=e[11];let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k={stroke:"var(--border)",strokeDasharray:"4 4"},e[12]=k):k=e[12];let S;e[13]!==t.unit?(S=s.jsx(I,{cursor:k,content:s.jsx(A,{formatter:m=>O(Number(m),t.unit??void 0)})}),e[13]=t.unit,e[14]=S):S=e[14];const w=o.length>1&&s.jsx(D,{content:s.jsx(M,{})}),$=o.map(re);let C;e[15]!==g||e[16]!==l||e[17]!==S||e[18]!==w||e[19]!==$||e[20]!==i||e[21]!==f||e[22]!==j||e[23]!==u?(C=s.jsxs(g,{data:l,margin:i,children:[f,j,u,S,w,$]}),e[15]=g,e[16]=l,e[17]=S,e[18]=w,e[19]=$,e[20]=i,e[21]=f,e[22]=j,e[23]=u,e[24]=C):C=e[24];let y;return e[25]!==d||e[26]!==a||e[27]!==t.title||e[28]!==C?(y=s.jsx(d,{role:x,"aria-label":p,className:b,config:a,children:C}),e[25]=d,e[26]=a,e[27]=t.title,e[28]=C,e[29]=y):y=e[29],y}function re(r,e){return s.jsx(Y,{type:"linear",dataKey:r,stroke:v[e%v.length],strokeWidth:2,dot:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},animationDuration:300},r)}function se(r){return{...r,label:String(r.t??"").slice(0,10)}}function ne(r,e){return[r,{label:r,color:v[e%v.length]}]}function ae(r,e){return`/${encodeURIComponent(r)}/${encodeURIComponent(e)}`}function oe(r){const e=N.c(28),{section:t,threadLinks:o}=r,a=E(),n=t.columns.indexOf("Org");let l;e[0]!==n||e[1]!==t.columns||e[2]!==o?(l=o&&n>=0?t.columns.indexOf("Thread"):-1,e[0]=n,e[1]=t.columns,e[2]=o,e[3]=l):l=e[3];const c=l;if(t.rows.length===0){let i;e[4]!==a?(i=a("taskBoard.analytics.nothingToShow"),e[4]=a,e[5]=i):i=e[5];let f;return e[6]!==i?(f=s.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=f):f=e[7],f}let d;e[8]!==t.columns?(d=t.columns.map(ie),e[8]=t.columns,e[9]=d):d=e[9];let x;e[10]!==d?(x=s.jsx(H,{children:s.jsx(_,{children:d})}),e[10]=d,e[11]=x):x=e[11];let p;if(e[12]!==n||e[13]!==t.columns||e[14]!==t.rows||e[15]!==t.title||e[16]!==c){let i;e[18]!==n||e[19]!==t.columns||e[20]!==t.title||e[21]!==c?(i=(f,j)=>s.jsx(_,{children:f.map((h,u)=>s.jsx(K,{className:"max-w-md truncate text-sm tabular-nums",children:h===null?"—":u===c?s.jsx("a",{href:ae(String(f[n]),String(h)),target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-2 hover:underline",children:String(h)}):String(h)},t.columns[u]??String(u)))},`${t.title}-${j}`),e[18]=n,e[19]=t.columns,e[20]=t.title,e[21]=c,e[22]=i):i=e[22],p=t.rows.map(i),e[12]=n,e[13]=t.columns,e[14]=t.rows,e[15]=t.title,e[16]=c,e[17]=p}else p=e[17];let b;e[23]!==p?(b=s.jsx(U,{children:p}),e[23]=p,e[24]=b):b=e[24];let g;return e[25]!==x||e[26]!==b?(g=s.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:s.jsxs(z,{children:[x,b]})}),e[25]=x,e[26]=b,e[27]=g):g=e[27],g}function ie(r){return s.jsx(B,{className:"whitespace-nowrap",children:r},r)}function he(r){const e=N.c(14),{section:t,threadLinks:o}=r;let a;e[0]!==t.title?(a=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.title}),e[0]=t.title,e[1]=a):a=e[1];let n;e[2]!==t?(n=t.kind==="stat"&&s.jsx(Q,{section:t}),e[2]=t,e[3]=n):n=e[3];let l;e[4]!==t?(l=t.kind==="series"&&s.jsx(te,{section:t}),e[4]=t,e[5]=l):l=e[5];let c;e[6]!==t||e[7]!==o?(c=t.kind==="table"&&s.jsx(oe,{section:t,threadLinks:o}),e[6]=t,e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==n||e[11]!==l||e[12]!==c?(d=s.jsxs("section",{className:"flex flex-col gap-3",children:[a,n,l,c]}),e[9]=a,e[10]=n,e[11]=l,e[12]=c,e[13]=d):d=e[13],d}export{he as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,X as Q,z as R,K as Y,m as ce,o as X,e as U,j as i,fJ as de,b as F,r as O,ee as me,e$ as J,B as v,t as q}from"./index-CmfXJaKn.js";import{i as fe}from"./AlertCircle-BQdX39pt.js";import{a as ue}from"./Copy01-onj9VSIV.js";import{i as V}from"./Key01-BSZJTaKJ.js";import{s as W}from"./Plus-DQzzAz_7.js";import{s as ge}from"./Trash01-1y1rCSQ7.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-CyLBdAzL.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-DfdkHhmb.js";import{I as le}from"./input-4qEEcM12.js";import{L as De}from"./label-bFgvSx58.js";import{u as H}from"./use-mcp-client-Bm7mYuOR.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=X();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=X();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(V,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(V,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(W,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=L=>{L?r(L):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=L=>c(L.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let z;e[57]!==I||e[58]!==h?(z=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=z):z=e[59];let $;return e[60]!==a||e[61]!==z||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:z}),e[60]=a,e[61]=z,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(W,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
1
|
+
import{c as A,X as Q,z as R,K as Y,m as ce,o as X,e as U,j as i,fJ as de,b as F,r as O,ee as me,e$ as J,B as v,t as q}from"./index-BSg0zn4o.js";import{i as fe}from"./AlertCircle-rm9vrEtW.js";import{a as ue}from"./Copy01-DFSuVPvj.js";import{i as V}from"./Key01-B1-8KpSg.js";import{s as W}from"./Plus-DC_7nhbs.js";import{s as ge}from"./Trash01-BTpCOmuX.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-PTVX9d3Y.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-C8AdhrG0.js";import{I as le}from"./input-DyRkn4pn.js";import{L as De}from"./label-Du2iAGWx.js";import{u as H}from"./use-mcp-client-DtG-9LNW.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=X();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=X();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(V,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(V,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(W,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=L=>{L?r(L):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=L=>c(L.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let z;e[57]!==I||e[58]!==h?(z=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=z):z=e[59];let $;return e[60]!==a||e[61]!==z||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:z}),e[60]=a,e[61]=z,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(W,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o,j as r}from"./index-BSg0zn4o.js";import{O as m}from"./api-keys-CRRGgTH5.js";import{R as p}from"./require-capability-CMsD4Xq5.js";import"./AlertCircle-rm9vrEtW.js";import"./Copy01-DFSuVPvj.js";import"./Key01-B1-8KpSg.js";import"./Plus-DC_7nhbs.js";import"./Trash01-BTpCOmuX.js";import"./alert-dialog-PTVX9d3Y.js";import"./dialog-C8AdhrG0.js";import"./X-DLYqFuX1.js";import"./input-DyRkn4pn.js";import"./label-Du2iAGWx.js";import"./use-mcp-client-DtG-9LNW.js";import"./auth-CWILNz-R.js";import"./access-gate-CDypY0PL.js";import"./capability-load-error-Gcuy_zZQ.js";function A(){const t=o.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(p,{capability:"api-keys:manage",area:"api-keys",children:r.jsx(m,{})}),t[0]=i):i=t[0],i}export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as jt,b as Bt,r as A,j as o,ak as wt,l as _t,h as At,t as ht}from"./index-BSg0zn4o.js";import{u as Et}from"./chat-context-Dx9zNHfj.js";import{S as Nt}from"./scroll-area-rRniZYni.js";import{u as Rt,A as Tt}from"./use-section-preview-base-DMPxgaEy.js";import{x as Ct}from"./claim-phase-copy-B4wRGWwJ.js";import{j as Kt,u as Pt,w as Ft,ap as Ot,x as Ut,d as $t,aq as It}from"./runnable-block-editor-Yuh74xe3.js";import{n as qt,r as zt}from"./agent-site-editor-content-nUoK_dJG.js";import"./use-panel-navigate-RzIXYjdO.js";import"./thread-route-2otWdMgJ.js";import"./use-project-scope--vhdJJ3J.js";import"./repository-binding-CKlCwDDd.js";import"./use-mcp-client-DtG-9LNW.js";import"./auth-CWILNz-R.js";import"./autosend-C7DyeWiW.js";import"./thread-intent-2fXPHcAu.js";import"./backoff-8mStPHYB.js";import"./task-board-Cd9YAvG-.js";import"./schema-XbMJIWRo.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-Cq-KvUjE.js";import"./use-ai-providers-Br3ruvyh.js";import"./use-chat-navigation-ouFeOKae.js";import"./location-zK0I9Ia6.js";import"./use-organization-settings-DZQdd38B.js";import"./select-Bur9VSDp.js";import"./index-hcdrCnDP.js";import"./Check-ycQN3J2t.js";import"./ChevronUp-B8UqekRj.js";import"./UserSquare-DJ8hiuYq.js";import"./agent-icon-BhZZd37x.js";import"./AlertCircle-rm9vrEtW.js";import"./Tool01-BNeCU30E.js";import"./ArrowUp-wgeukGJg.js";import"./ArrowLeft-q0aoA66K.js";import"./LinkBroken01-C78kyif5.js";import"./ShoppingBag01-DNQzuGTX.js";import"./ZoomOut-DFERFVow.js";import"./Building02-BPTZeJ83.js";import"./CheckCircle-C2px0gfY.js";import"./Copy01-DFSuVPvj.js";import"./CreditCard01-C13hgCp6.js";import"./DotsVertical-8YiGOIqq.js";import"./Image01-CgjyCWgG.js";import"./Palette-DOpFqZPK.js";import"./XClose-BbdvFCiX.js";import"./Key01-B1-8KpSg.js";import"./Link01-B8ajBJDc.js";import"./LinkExternal01-Bn0SPqIC.js";import"./Monitor01-DC2k418g.js";import"./Sun-COaeigjT.js";import"./Plus-DC_7nhbs.js";import"./SearchMd-Be3GMdpX.js";import"./Trash01-BTpCOmuX.js";import"./Upload01-Dfmvp3DJ.js";import"./User01-4R_aUn4g.js";import"./Users01-v0Jyk4Ot.js";import"./X-DLYqFuX1.js";import"./dialog-C8AdhrG0.js";import"./input-DyRkn4pn.js";import"./use-new-blocks-editor-0oELLtma.js";import"./section-preview-url-7zfngvgW.js";import"./use-session-runtime-CLu1QwVf.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BRY0hFhL.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BUVugLgs.js";import"./use-copy-DbnPtzRq.js";import"./usage-stats-DpcWm2xr.js";import"./markdown-DienvDaS.js";import"./org-file-open-context-CYLtVxSO.js";import"./use-mobile-Bym6FABz.js";import"./tooltip-Dmxy6Iwp.js";import"./use-clock-tick-_TChM0B6.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CNPl_E2S.js";import"./types-Bme2CFon.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-n3scD1Cq.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./shell-layout-BirRSTwU.js";import"./avatar-Dl_cPf4a.js";import"./download-app-dialog-URSdQ4ke.js";import"./command-Czt06b2r.js";import"./index-BmBDGBX2.js";import"./integration-icon-BiZmEnVi.js";import"./project-icon-BtaqB0ne.js";import"./new-project-dialog-B7NjXDr6.js";import"./label-Du2iAGWx.js";import"./repository-import-picker-BWcgounQ.js";import"./use-navigate-to-agent-nbLDGPuK.js";import"./repository-picker-DJEubVOt.js";import"./useInfiniteQuery-BXyifNbh.js";import"./infiniteQueryObserver-ByHfufml.js";import"./collection-search-CKuVhNj4.js";import"./use-debounced-value-B8x7v3h2.js";import"./required-auth-layout-DXP1Sqka.js";import"./use-org-sso-wmpr49G0.js";import"./sheet-BB4O5OwT.js";import"./use-connection-KD1C-9SB.js";import"./use-mcp-prompts-Dv23JU44.js";import"./index-BADmvvU8.js";import"./form-C_wkYdWR.js";import"./use-thread-outputs-9ggjmILA.js";import"./file-type-icon-D3P3r_PX.js";import"./popover-CXCkGdFS.js";import"./utils-BH5vUtAG.js";import"./monaco-editor-Ddyrxhnd.js";import"./editor-CK9raNB0.js";import"./calendar-BLwaxQ6A.js";import"./textarea-DDxcalk2.js";import"./rich-text-link-control-D3iH-JTZ.js";import"./core.esm-B3puu65K.js";import"./switch-DcSUAA1j.js";import"./combobox-CgUwJrOG.js";import"./alert-dialog-PTVX9d3Y.js";import"./sandbox-url-D3mC8qhT.js";import"./search-input-f14Hs9DC.js";import"./tabs-Bc9RHMFB.js";import"./use-file-configs-CL6vJq8e.js";import"./asset-utils-Dv9Q2xbg.js";import"./use-chat-layout-state-DVSuwZNL.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-CdYcnuUH.js";import"./sandbox-git-api-DTIjDZTr.js";import"./agent-view-guard-w0LVmZ_n.js";import"./use-main-panel-tabs-CMbieCSL.js";import"./use-mcp-tools-CZKyId72.js";import"./index-BfKeTOyQ.js";import"./drawer-BZnmFrAT.js";import"./input-D1Ki90Pm.js";import"./icon-button-C_Cp_29j.js";import"./chat-draft-BmX0POEt.js";import"./use-deco-credits-8WOAM4-s.js";import"./use-open-billing-url-cGocgOTK.js";import"./decopilot-CVtUuYjj.js";import"./checkbox-BGY2RDHl.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-DZYzJ3Ve.js";import"./input-CCnRshRN.js";import"./suggestion-IyavxmVa.js";import"./use-org-fs-C77pAkF9.js";import"./question-004-sINsf4GQ.js";import"./use-members-3vohvwE9.js";import"./use-org-auth-client-CtCYentb.js";import"./feature-paywall-BoMIgBMw.js";import"./plan-ladder-CqI-1A4t.js";import"./add-connection-dialog-C7D8wNe0.js";import"./extract-connection-data-Ch1WBTd_.js";import"./metadata-D72DunRR.js";import"./connection-Dyn6n84s.js";import"./connection-card-ZezUc4CB.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-DBYs_bI7.js";import"./authenticate-and-persist-oauth-_u_GUn2l.js";import"./mcp-oauth-BEjgJ8S3.js";import"./collection-tabs-BamuvkGL.js";import"./badge-DhrYVT6A.js";import"./use-infinite-scroll-CZDZwEPK.js";import"./useSuspenseInfiniteQuery-Cwe5IPmT.js";import"./use-task-board-events-Bv_4UM8-.js";import"./sandbox-lifecycle-context-C5QKAHul.js";import"./resolve-tab-icon-D9ziRjGB.js";import"./use-task-metadata--tlu5jBn.js";import"./virtual-mcp-BWO_9b2I.js";import"./feature-gate-Dzatwf08.js";import"./mustache-2Fdvii3x.js";import"./empty-state-CoOL0M6Y.js";import"./empty-state-CmS3chTn.js";function Lt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",s=qt(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function ei(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:s,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=Et()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=zt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Ct(p,x,a):p);let C;t[9]!==s||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Kt(C);let K;t[13]!==s||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=Pt(K);let P;t[17]!==S?(P=$t((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),O=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Mt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==p||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let q;t[31]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{xt(e)},t[31]=q):q=t[31];const E=q;let z;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(z=async(e,r)=>{try{const{blockKey:u,data:f}=Lt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=z):z=t[36];const k=z;let L;t[37]!==d?(L=e=>{O.current=e.append,d(!0)},t[37]=d,t[38]=L):L=t[38];const st=L;let V;t[39]!==k||t[40]!==d?(V=async e=>{const r=O.current;if(r)try{await k(e,u=>{r(u),d(!1),O.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=V):V=t[41];const pt=V,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=Ft(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ot(g,r)),ft(Vt)},title:f,className:_t("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let j;t[42]!==W?(j=o.jsx(It,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let w;t[47]!==p||t[48]!==s||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==st||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(w=o.jsx(Nt,{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:J?o.jsx(Ut,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:st,sandbox:{orgSlug:m,virtualMcpId:i,branch:s,threadId:G}},`${p}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(At,{className:"size-4"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=s,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=st,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=w):w=t[67];let _;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(_=h&&o.jsx(Tt,{open:ot,onOpenChange:e=>{d(e),e||(O.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=_):_=t[74];let M;return t[75]!==B||t[76]!==w||t[77]!==_?(M=o.jsxs("div",{className:gt,children:[B,w,_]}),t[75]=B,t[76]=w,t[77]=_,t[78]=M):M=t[78],M}function Vt(n){return n+1}function Mt(n){return n+1}export{ei as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,X as d,e as g,a2 as m,K as I,o as O}from"./index-
|
|
1
|
+
import{c as u,X as d,e as g,a2 as m,K as I,o as O}from"./index-BSg0zn4o.js";import{u as $}from"./useInfiniteQuery-BXyifNbh.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,v as b,F as c,S as e,_ as f,w as i,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-CmfXJaKn.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 Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function X(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(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 K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(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 Q(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=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[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 $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)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 H(`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 S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"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 q.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"?V.parse(await o.json()):x.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 N(),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 b(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=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.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=b(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=b(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 j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
|
|
1
|
+
import{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-BSg0zn4o.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 Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function X(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(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 K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(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 Q(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=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[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 $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)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 H(`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 S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"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 q.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"?V.parse(await o.json()):x.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 N(),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 b(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=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.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=b(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=b(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 j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-
|
|
1
|
+
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-BSg0zn4o.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{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(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=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(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
|