decocms 3.83.6 → 3.84.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-C0MMJCns.js → AlertCircle-CmMED3h6.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-gVE5kRlQ.js → ArrowUpRight-DwILncVx.js} +1 -1
- package/dist/client/assets/{CheckCircle-B40vdc2l.js → CheckCircle-DpKZZDmN.js} +1 -1
- package/dist/client/assets/{ChevronDown-QQWh1U0r.js → ChevronDown-BjzwFuai.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CRDrddT9.js → ChevronLeft-uRkOj5F8.js} +1 -1
- package/dist/client/assets/{ChevronRight-CWp0460U.js → ChevronRight-BRGGbOax.js} +1 -1
- package/dist/client/assets/{ChevronUp-B0iQd-AD.js → ChevronUp-CzO_7LvF.js} +1 -1
- package/dist/client/assets/{DotsVertical-BBNwX5J5.js → DotsVertical-DshGnU_X.js} +1 -1
- package/dist/client/assets/{Eye-bN0xnD-o.js → Eye-BBVg-SSa.js} +1 -1
- package/dist/client/assets/{FilterLines-DttJL6KD.js → FilterLines-CowTK4HW.js} +1 -1
- package/dist/client/assets/{Globe01-DTi3Gxq3.js → Globe01-Cm82tRCS.js} +1 -1
- package/dist/client/assets/{Globe04-n0f96BbD.js → Globe04-DrE78eQQ.js} +1 -1
- package/dist/client/assets/{HardDrive-D5-uOHw9.js → HardDrive-DsahIXX5.js} +1 -1
- package/dist/client/assets/{Key01-DAsg8mdj.js → Key01-CwoTMTFC.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D2ad_kHx.js → LayoutLeft-_ZNcVcNz.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D6izDWZT.js → LinkExternal01-BeE3-oct.js} +1 -1
- package/dist/client/assets/{Monitor01-CaUMTT8S.js → Monitor01-Aa4wN2Ct.js} +1 -1
- package/dist/client/assets/{Palette-ceW3H3uT.js → Palette-DT-obB9z.js} +1 -1
- package/dist/client/assets/{Play-VLn5ww3u.js → Play-D7fUrl6h.js} +1 -1
- package/dist/client/assets/{Plus-BmqFkgYT.js → Plus-CK2CAzo5.js} +1 -1
- package/dist/client/assets/{SearchMd-rJiOFJwK.js → SearchMd-B3Rw93l5.js} +1 -1
- package/dist/client/assets/{Settings02-DG5mJ_xI.js → Settings02-B1ZVVT_e.js} +1 -1
- package/dist/client/assets/{Shield01-C7ZT-QsW.js → Shield01-BR2mZOZb.js} +1 -1
- package/dist/client/assets/{Star01-DPkaqbS_.js → Star01-DBcQByZk.js} +1 -1
- package/dist/client/assets/{Stars01-BM2OfAMq.js → Stars01-aJC5veoy.js} +1 -1
- package/dist/client/assets/{Stars02-CbFOXGiR.js → Stars02-BwRZ8reG.js} +1 -1
- package/dist/client/assets/{Sun-D9AuRcRz.js → Sun-BMePDS8S.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-dm0C0Tjx.js → SwitchHorizontal01-B_NmbobE.js} +1 -1
- package/dist/client/assets/{Tool01-BXc8J6xZ.js → Tool01-CZPk8Ney.js} +1 -1
- package/dist/client/assets/{Trash01-D1DmT9Mr.js → Trash01-SWS-_O9Z.js} +1 -1
- package/dist/client/assets/{Upload01-BpkBrNfw.js → Upload01-CoqelT_E.js} +1 -1
- package/dist/client/assets/{User01-DhqtO0lv.js → User01-Do5enW22.js} +1 -1
- package/dist/client/assets/{Users01-DScwWUp0.js → Users01-BmWtNHuf.js} +1 -1
- package/dist/client/assets/{Users03-BhaYLgGW.js → Users03-B_G71vm-.js} +1 -1
- package/dist/client/assets/{X-Dqpx-r1T.js → X-CO9z9Xp0.js} +1 -1
- package/dist/client/assets/{XCircle-D9qm_1Ut.js → XCircle-BFWoSw7W.js} +1 -1
- package/dist/client/assets/{XClose-BvKJTTlt.js → XClose-BO6FjXoT.js} +1 -1
- package/dist/client/assets/{Zap-C6SkRgFu.js → Zap-Bs_ao0zW.js} +1 -1
- package/dist/client/assets/{ZapSquare-CL6VANDT.js → ZapSquare-CmQdJEdR.js} +1 -1
- package/dist/client/assets/{ZoomOut-wqR_bKeR.js → ZoomOut-BR28jpI9.js} +1 -1
- package/dist/client/assets/{access-gate-DATyJxs9.js → access-gate-mrUaShW4.js} +1 -1
- package/dist/client/assets/{add-section-modal-DFnJjqFv.js → add-section-modal-BTy1RUe_.js} +1 -1
- package/dist/client/assets/{agent-icon-BHjJxJmC.js → agent-icon-BB0OI_Zf.js} +1 -1
- package/dist/client/assets/agents-list-DP438aHv.js +1 -0
- package/dist/client/assets/ai-providers-CHjXy2IX.js +1 -0
- package/dist/client/assets/{alert-BQLAuYif.js → alert-FpAPxAaA.js} +1 -1
- package/dist/client/assets/{alert-dialog-Cz6L6NXK.js → alert-dialog-CU4F0Cas.js} +1 -1
- package/dist/client/assets/app-editor-DbyBYBd1.js +1 -0
- package/dist/client/assets/{auth-C19hiZia.js → auth-DscXYOeb.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dw6lQ3Pv.js → auth-catchall-BtmfoD1y.js} +1 -1
- package/dist/client/assets/{auth-entry-DGjXLiVY.js → auth-entry-CC1ARBuN.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Dmg3NIiT.js → auth-split-layout-Cxddqcmf.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B1-SzA6A.js → authenticate-and-persist-oauth-KVWekoHI.js} +1 -1
- package/dist/client/assets/{automation-list-row-BYkbwrNr.js → automation-list-row-DdnU0_oJ.js} +1 -1
- package/dist/client/assets/{automation-runs-CFBKS4y-.js → automation-runs-CxkH2J7y.js} +1 -1
- package/dist/client/assets/automations-CHJDB1Wn.js +1 -0
- package/dist/client/assets/{avatar-Bbvs8iIt.js → avatar-B2rvHJ2u.js} +1 -1
- package/dist/client/assets/{badge-C3IXjCX0.js → badge-Bu3HgcYX.js} +1 -1
- package/dist/client/assets/{block-document-C3ZQBAYM.js → block-document-DR69_B0F.js} +1 -1
- package/dist/client/assets/brand-context-BsVjZN3k.js +1 -0
- package/dist/client/assets/buckets-BH1wtZ3x.js +1 -0
- package/dist/client/assets/{capability-load-error-DP8VgCQ8.js → capability-load-error-CmAUMxoM.js} +1 -1
- package/dist/client/assets/{card-RkuQTlVn.js → card-kDiEfTw9.js} +1 -1
- package/dist/client/assets/category-editor-CAYNohGr.js +1 -0
- package/dist/client/assets/{chat-context-D45ePksk.js → chat-context-D6S41DOV.js} +1 -1
- package/dist/client/assets/{checkbox-yMsno3zH.js → checkbox-CsCGEg8f.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dd0r_nul.js → cli-auth-success-B79VcMNm.js} +1 -1
- package/dist/client/assets/collection-detail-BV78giTN.js +1 -0
- package/dist/client/assets/{collection-display-button-BRBXcU18.js → collection-display-button-BKfSRcS4.js} +1 -1
- package/dist/client/assets/{collection-search-EReXMo3F.js → collection-search-Did_rDKr.js} +1 -1
- package/dist/client/assets/{collection-tabs-C3OblNuX.js → collection-tabs-BWGqEvBL.js} +1 -1
- package/dist/client/assets/{command-BsaV9rjm.js → command-HyE3vuW8.js} +1 -1
- package/dist/client/assets/commerce-onboarding-CbmMdla_.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-DuJwJvdQ.js → connect-desktop-dialog-DzyRhy80.js} +1 -1
- package/dist/client/assets/{connection-card-uZjILvOr.js → connection-card-D0jDIFWU.js} +1 -1
- package/dist/client/assets/connection-detail-CTydjWNJ.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DV9ppnRP.js → connection-form-helpers-DoxJStk3.js} +1 -1
- package/dist/client/assets/connections-BZqNukEV.js +1 -0
- package/dist/client/assets/{context-menu-DmgM_UZR.js → context-menu-CBHA394l.js} +1 -1
- package/dist/client/assets/{decopilot-CxoZlpZn.js → decopilot-Cs0sTBvJ.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BH11VGHE.js → decopilot-sse-pool-DCimHDb8.js} +1 -1
- package/dist/client/assets/{dialog-CHU--T7-.js → dialog-D4-cpiIq.js} +1 -1
- package/dist/client/assets/{domain-settings-MLZvo-1a.js → domain-settings-CpdgF4g-.js} +1 -1
- package/dist/client/assets/{drawer-D4XkXj4V.js → drawer-EynyRy5s.js} +1 -1
- package/dist/client/assets/{dropdown-menu-D2HxaMPU.js → dropdown-menu-DgXWnPV7.js} +1 -1
- package/dist/client/assets/{empty-state-DA37X_xl.js → empty-state-BqLGg5Qt.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Ws_H4ap3.js → extract-connection-data-BrfuWfn9.js} +1 -1
- package/dist/client/assets/file-explorer-l8kW6-_R.js +2 -0
- package/dist/client/assets/{file-type-icon-CVukPbEL.js → file-type-icon-vWAzpBPp.js} +1 -1
- package/dist/client/assets/{files-DcKK79mn.js → files-CelzOm7s.js} +1 -1
- package/dist/client/assets/{form-Bxj0TUqV.js → form-C0rXEiGF.js} +1 -1
- package/dist/client/assets/general-Bcxz5b3F.js +1 -0
- package/dist/client/assets/{github-repo-picker-nQicPdJf.js → github-repo-picker-BMm6sNS0.js} +1 -1
- package/dist/client/assets/{hooks-C9iWb2N3.js → hooks-iTnRVGBT.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-C6saVWDH.js → import-from-deco-dialog-CEwUaYj8.js} +1 -1
- package/dist/client/assets/{index-BO0QV1fb.js → index-7--My7Kk.js} +7 -7
- package/dist/client/assets/{index-C1iIfW5c.js → index-BHPHIMku.js} +2 -2
- package/dist/client/assets/{index-bmV9L0o4.js → index-BafofCVM.js} +1 -1
- package/dist/client/assets/{index-DzHbeUkj.js → index-BeL2IYvj.js} +1 -1
- package/dist/client/assets/{index-BFqTOqSJ.js → index-Bt_ZjPsW.js} +1 -1
- package/dist/client/assets/{index-BoDi6OBc.js → index-C1yj8oW9.js} +4 -4
- package/dist/client/assets/{index-NjN7v_96.js → index-C6QKjDvm.js} +1 -1
- package/dist/client/assets/index-C9vgWyOp.js +1 -0
- package/dist/client/assets/{index-akCm1VRq.js → index-CChD3seh.js} +2 -2
- package/dist/client/assets/{index-YYxzAkAN.js → index-ChS8eVb4.js} +1 -1
- package/dist/client/assets/{index-CprKTf1O.js → index-D5MvY5fk.js} +1 -1
- package/dist/client/assets/index-D6W1a9Ed.js +1 -0
- package/dist/client/assets/{index-BddhVtBs.js → index-DU_rFtey.js} +1 -1
- package/dist/client/assets/{index-ktUKbMYA.js → index-nQQO626p.js} +1 -1
- package/dist/client/assets/{index-redirect-DowDbKLD.js → index-redirect-ZLqUsySW.js} +1 -1
- package/dist/client/assets/index-uuDmStBi.js +1 -0
- package/dist/client/assets/{input-DJV4VNka.js → input-CjEjpxdM.js} +1 -1
- package/dist/client/assets/{integration-icon-BpZ3OsA4.js → integration-icon-CSYS5mut.js} +1 -1
- package/dist/client/assets/{label-7phVZ6ZM.js → label-B1XS6835.js} +1 -1
- package/dist/client/assets/{login-B4rCGJ9Y.js → login-BwzmQ6Vl.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BGRbdqPD.js → mcp-oauth-RIVS58UD.js} +1 -1
- package/dist/client/assets/{members-C5-ie2FC.js → members-Cv5_M0H8.js} +2 -2
- package/dist/client/assets/{monaco-editor-Cqq2xAH1.js → monaco-editor-BhcbAKhi.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C-saq1Fk.js → monitoring-stats-row-D2hdprzy.js} +1 -1
- package/dist/client/assets/{oauth-callback-7tCvDUJs.js → oauth-callback-Ca8aLtLz.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-k9CmEopW.js → oauth-callback-ai-provider-nS8-aDg-.js} +1 -1
- package/dist/client/assets/{onboarding-D7HThXnZ.js → onboarding-DokdM2si.js} +1 -1
- package/dist/client/assets/{org-install-BBNmxhuK.js → org-install-CFBQ5UN5.js} +1 -1
- package/dist/client/assets/{org-layout-uMJB-zBX.js → org-layout-2xw7J9o1.js} +1 -1
- package/dist/client/assets/{organization-choice-3XngO70I.js → organization-choice-B7gbF-gx.js} +1 -1
- package/dist/client/assets/{page-seo-form-Bp1CNfZX.js → page-seo-form-B9gdIgu6.js} +1 -1
- package/dist/client/assets/page-seo-sheet-Dim8a_29.js +1 -0
- package/dist/client/assets/{popover-Bo_sL62z.js → popover-C7DR14Uv.js} +1 -1
- package/dist/client/assets/post-editor-Dwsexwwq.js +1 -0
- package/dist/client/assets/{preview-dialog-B9gUDoJJ.js → preview-dialog-D0Xo8R0Y.js} +1 -1
- package/dist/client/assets/{primitives-Ch1GQ4pf.js → primitives-BGDftBXt.js} +1 -1
- package/dist/client/assets/profile-Tt594UKC.js +1 -0
- package/dist/client/assets/project-app-view-BWGayozD.js +1 -0
- package/dist/client/assets/record-editor-Cf-PzES3.js +1 -0
- package/dist/client/assets/registry-Bt-hzkrl.js +2 -0
- package/dist/client/assets/{registry-layout-BYi_5V3p.js → registry-layout-CepDP4zO.js} +2 -2
- package/dist/client/assets/{require-capability-Bnt0ZBRa.js → require-capability-CI6JAqgD.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BolsfPYi.js → required-auth-layout-Be42uHMA.js} +1 -1
- package/dist/client/assets/{reset-password-CpukUOwJ.js → reset-password-vSV6JpaW.js} +1 -1
- package/dist/client/assets/roles-DVimCkc2.js +1 -0
- package/dist/client/assets/{save-status-HMD0mFgw.js → save-status-B4LrYjc4.js} +1 -1
- package/dist/client/assets/{scroll-area-B1cpZQna.js → scroll-area-Btbw5x0S.js} +1 -1
- package/dist/client/assets/{search-input-H6T5GrKJ.js → search-input-BJySI9eP.js} +1 -1
- package/dist/client/assets/secrets-CgCqWHuI.js +1 -0
- package/dist/client/assets/sections-editor-73TndVEn.js +2 -0
- package/dist/client/assets/select-Bdte2-mH.js +1 -0
- package/dist/client/assets/{select-model-jVluH6Ea.js → select-model-Da9fCD4_.js} +1 -1
- package/dist/client/assets/seo-editor-oYyGw_6F.js +1 -0
- package/dist/client/assets/settings-layout-CnLgsNWc.js +1 -0
- package/dist/client/assets/{settings-section-CAKwpEKX.js → settings-section-BIuqqQso.js} +1 -1
- package/dist/client/assets/{sheet-BDdFViUD.js → sheet-CzR0tmZA.js} +1 -1
- package/dist/client/assets/{shell-controls-CiuZpo9F.js → shell-controls-B_8RFrNm.js} +1 -1
- package/dist/client/assets/{shell-layout-BFU4WLoP.js → shell-layout-DPTryinF.js} +1 -1
- package/dist/client/assets/{shell-route-loading-P7c6nIb-.js → shell-route-loading-D5ohEyID.js} +1 -1
- package/dist/client/assets/{sidebar-DoXfrWOj.js → sidebar-BLFhVRa1.js} +1 -1
- package/dist/client/assets/{skeleton-DpU2T6Js.js → skeleton-BhIDQEW6.js} +1 -1
- package/dist/client/assets/{sortable.esm-JwRAHi44.js → sortable.esm-BrVUE0Ot.js} +1 -1
- package/dist/client/assets/sso-Dz4ih-D0.js +1 -0
- package/dist/client/assets/store-41qcx4ON.js +1 -0
- package/dist/client/assets/store-registry-Du1ihhH9.js +2 -0
- package/dist/client/assets/{studio-tools-Lqif47iD.js → studio-tools-cTyVqaHA.js} +1 -1
- package/dist/client/assets/{switch-CzdCn_lr.js → switch-DoFOdYGu.js} +1 -1
- package/dist/client/assets/{table-CLXzS61A.js → table-zRS7Teha.js} +1 -1
- package/dist/client/assets/{tabs-DoKlXPZO.js → tabs-CQOpbrKh.js} +1 -1
- package/dist/client/assets/{task-status-DPcnbZIP.js → task-status-DjLIycFQ.js} +1 -1
- package/dist/client/assets/{textarea-BjequYD7.js → textarea-Cya3KDiz.js} +1 -1
- package/dist/client/assets/{toggle-group-DCz7F7cJ.js → toggle-group-DENfWHtP.js} +1 -1
- package/dist/client/assets/{toolbar-DMerIIuJ.js → toolbar-CO9czXOO.js} +1 -1
- package/dist/client/assets/tooltip-Cvbl_0l0.js +1 -0
- package/dist/client/assets/{types-BV8aIt26.js → types-DkLih0NK.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DuFfPCpZ.js → use-ai-providers-BB_netT8.js} +1 -1
- package/dist/client/assets/{use-automations-CauJKNE9.js → use-automations-C4-BEJDp.js} +1 -1
- package/dist/client/assets/{use-capability-DLjX445R.js → use-capability-DtJSLljk.js} +1 -1
- package/dist/client/assets/{use-clock-tick-aakwXYCP.js → use-clock-tick-Bo_9gN4h.js} +1 -1
- package/dist/client/assets/{use-collections-D4X4_zKE.js → use-collections-C5z5SeL0.js} +1 -1
- package/dist/client/assets/{use-connection-CyHDjrsh.js → use-connection-DYuQNBQ8.js} +1 -1
- package/dist/client/assets/{use-copy-V0KcMVib.js → use-copy-V2SquoUh.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CEKhGxvf.js → use-create-virtual-mcp-DqGii1ks.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-C-eVH4yR.js → use-debounced-autosave-B5XSTYsz.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CV3l3-SB.js → use-delete-connection-D_b2gPBM.js} +1 -1
- package/dist/client/assets/{use-file-configs-BG_rDJRo.js → use-file-configs-CSX8A1vE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-4IJEWhiu.js → use-infinite-scroll-BaJGyvxX.js} +1 -1
- package/dist/client/assets/{use-join-requests-Cab0xxnE.js → use-join-requests-dGis0QYB.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DuJQA2rV.js → use-mcp-client-90IJIS7G.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CmUaiuB7.js → use-mcp-prompts-D2ucpusX.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D715CcxL.js → use-mcp-tools-IJf4yY8f.js} +1 -1
- package/dist/client/assets/{use-members-DIDnJkLY.js → use-members-DSWXPVdi.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BNMv1Neu.js → use-navigate-to-agent-D_hba2ju.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DtHGY2-t.js → use-org-auth-client-Bmz_glRx.js} +1 -1
- package/dist/client/assets/{use-org-sso-BzsvKCfF.js → use-org-sso-d8VUjdDF.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BiPQEnrH.js → use-organization-roles-AnHrNvDP.js} +1 -1
- package/dist/client/assets/{use-organization-settings-nc8QZXyP.js → use-organization-settings-B-FYwlct.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CJhKWnft.js → use-registry-connections-COP2SiNd.js} +1 -1
- package/dist/client/assets/{use-secrets-CxFfyxif.js → use-secrets-CgpawoY3.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DaofAwGt.js → use-status-sounds-CO3Rxsnj.js} +1 -1
- package/dist/client/assets/{use-view-mode-m8F-CboW.js → use-view-mode-CbF51x_n.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BdsGMQZL.js → use-virtual-mcp-yUKVcLc_.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BxIrRxsB.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DENvoLd9.js +1 -0
- package/dist/client/assets/variant-calendar-Cjzj9fQr.js +1 -0
- package/dist/client/assets/{view-mode-toggle-C9q5ISiT.js → view-mode-toggle-D1TNBVMm.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +380 -380
- package/dist/server/server.js +246 -246
- package/package.json +1 -1
- package/dist/client/assets/agents-list-2Gq7Icxm.js +0 -1
- package/dist/client/assets/ai-providers-COV0MWUn.js +0 -1
- package/dist/client/assets/app-editor-6TH-Brv5.js +0 -1
- package/dist/client/assets/automations-OYmLeyhx.js +0 -1
- package/dist/client/assets/brand-context-BFvQ7Sbj.js +0 -1
- package/dist/client/assets/buckets-D1zQNpYB.js +0 -1
- package/dist/client/assets/category-editor-CBWEnxiL.js +0 -1
- package/dist/client/assets/collection-detail-MmIgTfSJ.js +0 -1
- package/dist/client/assets/commerce-onboarding-BPDYtCVh.js +0 -1
- package/dist/client/assets/connection-detail-sXXukvA0.js +0 -1
- package/dist/client/assets/connections-CUxM11Rz.js +0 -1
- package/dist/client/assets/file-explorer-BfmNHW6W.js +0 -2
- package/dist/client/assets/general-CYWDm58h.js +0 -1
- package/dist/client/assets/index-C7XT3JN9.js +0 -1
- package/dist/client/assets/index-HQC4CGFu.js +0 -1
- package/dist/client/assets/page-seo-sheet-DAfXAXRM.js +0 -1
- package/dist/client/assets/post-editor-Dh7W93cU.js +0 -1
- package/dist/client/assets/profile-2A5eHa2X.js +0 -1
- package/dist/client/assets/project-app-view-C3Xp90Nk.js +0 -1
- package/dist/client/assets/record-editor-Bmb0mb5Z.js +0 -1
- package/dist/client/assets/registry-C0CXy020.js +0 -2
- package/dist/client/assets/roles-PAp6Oo_Q.js +0 -1
- package/dist/client/assets/secrets-BGVscZvv.js +0 -1
- package/dist/client/assets/sections-editor-DQxu6nDY.js +0 -2
- package/dist/client/assets/select-DlsRm0pM.js +0 -1
- package/dist/client/assets/seo-editor-DAvYGMob.js +0 -1
- package/dist/client/assets/settings-layout-D1AOhck8.js +0 -1
- package/dist/client/assets/sso-BV0gs8-C.js +0 -1
- package/dist/client/assets/store-B7yfmn2A.js +0 -1
- package/dist/client/assets/store-registry-PU_3Djb3.js +0 -2
- package/dist/client/assets/tooltip-qf4kMmAF.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CkJOjicq.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-n6ZCdGbO.js +0 -1
- package/dist/client/assets/variant-calendar-YykiGxU4.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as se,j as s,B as Z,w as me,r as Y,s as v,t as de}from"./index-BoDi6OBc.js";import{c as w,b as ne,a as ee,D as te}from"./dropdown-menu-D2HxaMPU.js";import{s as pe}from"./Star01-DPkaqbS_.js";import{a as fe}from"./Users03-BhaYLgGW.js";import{a as ge,G as ue}from"./github-repo-picker-nQicPdJf.js";import{S as he,u as xe,H as ie,W as oe,I as je}from"./import-from-deco-dialog-C6saVWDH.js";import{u as _e,b as Ce,c as be}from"./use-virtual-mcp-BdsGMQZL.js";import{P as K}from"./index-BFqTOqSJ.js";import{a as ye}from"./DotsVertical-BBNwX5J5.js";import{a as Ne}from"./Settings02-DG5mJ_xI.js";import{s as Se}from"./Trash01-D1DmT9Mr.js";import{A as De,as as ve}from"./agent-icon-BHjJxJmC.js";import{m as Ae}from"./use-navigate-to-agent-BNMv1Neu.js";import{C as we}from"./card-RkuQTlVn.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ke}from"./use-capability-DLjX445R.js";import{E as Te}from"./empty-state-DA37X_xl.js";import{u as ze}from"./use-create-virtual-mcp-CEKhGxvf.js";import{c as Ie,b as Pe,d as He,A as Ee,e as Me,g as Oe,a as Be,f as Ge}from"./alert-dialog-Cz6L6NXK.js";import{S as $e}from"./search-input-H6T5GrKJ.js";import{s as le}from"./Plus-BmqFkgYT.js";import"./ChevronUp-B0iQd-AD.js";import"./ChevronRight-CWp0460U.js";import"./dialog-CHU--T7-.js";import"./X-Dqpx-r1T.js";import"./checkbox-yMsno3zH.js";import"./collection-search-EReXMo3F.js";import"./SearchMd-rJiOFJwK.js";import"./use-connection-CyHDjrsh.js";import"./use-collections-D4X4_zKE.js";import"./use-mcp-client-DuJQA2rV.js";import"./auth-C19hiZia.js";import"./authenticate-and-persist-oauth-B1-SzA6A.js";import"./mcp-oauth-BGRbdqPD.js";import"./use-mcp-tools-D715CcxL.js";import"./extract-connection-data-Ws_H4ap3.js";import"./sidebar-DoXfrWOj.js";import"./LayoutLeft-D2ad_kHx.js";import"./tooltip-qf4kMmAF.js";import"./sheet-BDdFViUD.js";import"./AlertCircle-C0MMJCns.js";import"./Tool01-BXc8J6xZ.js";import"./SwitchHorizontal01-dm0C0Tjx.js";import"./XCircle-D9qm_1Ut.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./ZapSquare-CL6VANDT.js";import"./CheckCircle-B40vdc2l.js";import"./ChevronDown-QQWh1U0r.js";import"./ChevronLeft-CRDrddT9.js";import"./Stars02-CbFOXGiR.js";import"./Eye-bN0xnD-o.js";import"./ZoomOut-wqR_bKeR.js";import"./Globe01-DTi3Gxq3.js";import"./FilterLines-DttJL6KD.js";import"./Globe04-n0f96BbD.js";import"./HardDrive-D5-uOHw9.js";import"./Key01-DAsg8mdj.js";import"./LinkExternal01-D6izDWZT.js";import"./Monitor01-CaUMTT8S.js";import"./Sun-D9AuRcRz.js";import"./Palette-ceW3H3uT.js";import"./Play-VLn5ww3u.js";import"./Shield01-C7ZT-QsW.js";import"./Stars01-BM2OfAMq.js";import"./Upload01-BpkBrNfw.js";import"./User01-DhqtO0lv.js";import"./Users01-DScwWUp0.js";import"./XClose-BvKJTTlt.js";import"./Zap-C6SkRgFu.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(w,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(w,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:he,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(w,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ge,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(w,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(w,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(w,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(w,{variant:"destructive",onClick:k=>{k.stopPropagation(),l(k)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(we,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function rs(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=xe(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=ke("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=K,A=K,k=K;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(K.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const q=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==k.Body||t[19]!==I||t[20]!==q?(P=s.jsxs(k.Body,{children:[I,q,J]}),t[17]=J,t[18]=k.Body,t[19]=I,t[20]=q,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(ue,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{rs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as B,C as N,aC as ae,aE as le,aF as he,aD as xe,b6 as me,c as U,F as ge,G as be,r as O,j as s,ae as Ee,t as Q,ad as ye,w as re,m as oe,d as J,K as G,k as ve,l as ue,B as V,s as je,E as Fe}from"./index-BoDi6OBc.js";import{i as $e}from"./AlertCircle-C0MMJCns.js";import{P as te}from"./index-BFqTOqSJ.js";import{S as ne}from"./skeleton-DpU2T6Js.js";import{b as _e,a as ce,S as de,c as Re}from"./settings-section-CAKwpEKX.js";import{u as X,b as se,c as Se}from"./use-ai-providers-DuFfPCpZ.js";import{i as Oe}from"./CheckCircle-B40vdc2l.js";import{i as Me,j as Te,p as Ue,S as ze}from"./chat-context-D45ePksk.js";import{d as qe,e as Le}from"./use-organization-settings-nc8QZXyP.js";import{M as Ve}from"./select-model-jVluH6Ea.js";import{u as Be}from"./use-debounced-autosave-C-eVH4yR.js";import{I as ie}from"./input-DJV4VNka.js";import{a as fe,T as Ge}from"./toggle-group-DCz7F7cJ.js";import{b as ke,c as Ie,d as Ce,A as Ne,a as Pe,e as we,g as De,f as Ae}from"./alert-dialog-Cz6L6NXK.js";import{u as H}from"./studio-tools-Lqif47iD.js";import{s as Qe}from"./Plus-BmqFkgYT.js";import{b as Ye}from"./Tool01-BXc8J6xZ.js";import{s as We}from"./Trash01-D1DmT9Mr.js";import{A as He}from"./avatar-Bbvs8iIt.js";import{O as Ke,P as Je,C as pe}from"./decopilot-CxoZlpZn.js";import{b as Xe}from"./Settings02-DG5mJ_xI.js";import{s as Ze}from"./Eye-bN0xnD-o.js";import{e as et,D as tt,a as st,c as it,d as rt}from"./dialog-CHU--T7-.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-Bnt0ZBRa.js";import"./sidebar-DoXfrWOj.js";import"./LayoutLeft-D2ad_kHx.js";import"./tooltip-qf4kMmAF.js";import"./sheet-BDdFViUD.js";import"./X-Dqpx-r1T.js";import"./card-RkuQTlVn.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./hooks-C9iWb2N3.js";import"./use-mcp-client-DuJQA2rV.js";import"./auth-C19hiZia.js";import"./decopilot-sse-pool-BH11VGHE.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BdsGMQZL.js";import"./use-collections-D4X4_zKE.js";import"./tab-id-BptcWVWa.js";import"./drawer-D4XkXj4V.js";import"./connect-desktop-dialog-DuJwJvdQ.js";import"./ChevronUp-B0iQd-AD.js";import"./User01-DhqtO0lv.js";import"./checkbox-yMsno3zH.js";import"./select-DlsRm0pM.js";import"./ChevronDown-QQWh1U0r.js";import"./Key01-DAsg8mdj.js";import"./SearchMd-rJiOFJwK.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-CaUMTT8S.js";import"./ChevronRight-CWp0460U.js";import"./Stars01-BM2OfAMq.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-DLjX445R.js";import"./access-gate-DATyJxs9.js";import"./capability-load-error-DP8VgCQ8.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Me(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],O.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const $=y.keyId??m??"";S($),a({keyId:$,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(p=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function ft(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function pt(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Be(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==f?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),F={};c?.id&&(F[c.id]=j),u?.id&&(F[u.id]=_),g?.id&&(F[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,F);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,$=g?.id;let M;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==$?(M=[o,t,j,_,f,p,y,$],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=f,e[25]=p,e[26]=y,e[27]=$,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const R=b&&!d;let D;e[30]!==S||e[31]!==R?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(ft,{isPending:S,showSaved:R})]}),e[30]=S,e[31]=R,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:F}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:F.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{F.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=O.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:yt,onError:bt}),[o,x]=O.useState(""),[S,b]=O.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(f=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&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:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,f,k]})}),e[22]=_,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=O.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const $=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let R;e[23]!==c?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=R):R=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[D,s.jsxs(we,{children:[A,s.jsx(De,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ae,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==p||e[33]!==$||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&vt(p)),children:$}),e[32]=p,e[33]=$,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const F=h&&"animate-spin";let P;e[39]!==F?(P=ue(F),e[39]=F,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=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:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==R||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,E,Y,Z]})})}),e[54]=R,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:f}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:G.aiProviders(S.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:j(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let f;return t[24]!==l||t[25]!==r||t[26]!==_?(f=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=f):f=t[27],f}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=O.useState(!1),[b,d]=O.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:G.aiProviders(r.id)}),o.invalidateQueries({queryKey:G.aiProviderModels(r.id,i.id)}),Q.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:At},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let $;t[18]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ye,{size:14})}),t[18]=$):$=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(!0),T=s.jsx(We,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let R;t[21]!==p?(R=s.jsxs("div",{className:"flex items-center gap-0.5",children:[$,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=R):R=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==R||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:R}),t[23]=_,t[24]=u,t[25]=R,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ne,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[v,s.jsx(De,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let F;t[38]!==E||t[39]!==w?(F=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=F):F=t[40];let P;t[41]!==x||t[42]!==F?(P=s.jsx(Ae,{open:x,onOpenChange:S,children:F}),t[41]=x,t[42]=F,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter($t).map(S).filter(Ft);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qe,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function Ft(e){return e.provider!==void 0}function $t(e){return e.providerId!=="deco"}function Rt(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($e,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Ot(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Mt),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=O.useState(!1),[x,S]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let f;e[5]!==n?(f=s.jsx(Je,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=$=>{$||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Mt(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Re,{children:[t,s.jsx(Fe,{fallback:Ut,children:s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Ot,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Rt,{error:t??new Error("Failed to load AI providers")})}function Bs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Bs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-BoDi6OBc.js";import{i as je}from"./ChevronRight-CWp0460U.js";import{S as ke}from"./scroll-area-B1cpZQna.js";import{A as _e}from"./add-section-modal-DFnJjqFv.js";import{an as Be,ao as we,ap as Ae,j as Ne,k as Re,aq as Ce,U as Ee,ab as Ke}from"./index-BO0QV1fb.js";import{S as Te}from"./save-status-HMD0mFgw.js";import"./agent-icon-BHjJxJmC.js";import"./AlertCircle-C0MMJCns.js";import"./Tool01-BXc8J6xZ.js";import"./SwitchHorizontal01-dm0C0Tjx.js";import"./Settings02-DG5mJ_xI.js";import"./XCircle-D9qm_1Ut.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./ZapSquare-CL6VANDT.js";import"./Users03-BhaYLgGW.js";import"./CheckCircle-B40vdc2l.js";import"./ChevronUp-B0iQd-AD.js";import"./ChevronDown-QQWh1U0r.js";import"./ChevronLeft-CRDrddT9.js";import"./DotsVertical-BBNwX5J5.js";import"./Stars02-CbFOXGiR.js";import"./Eye-bN0xnD-o.js";import"./ZoomOut-wqR_bKeR.js";import"./Globe01-DTi3Gxq3.js";import"./FilterLines-DttJL6KD.js";import"./Star01-DPkaqbS_.js";import"./Globe04-n0f96BbD.js";import"./HardDrive-D5-uOHw9.js";import"./Key01-DAsg8mdj.js";import"./LayoutLeft-D2ad_kHx.js";import"./LinkExternal01-D6izDWZT.js";import"./Monitor01-CaUMTT8S.js";import"./Sun-D9AuRcRz.js";import"./Palette-ceW3H3uT.js";import"./Play-VLn5ww3u.js";import"./Plus-BmqFkgYT.js";import"./SearchMd-rJiOFJwK.js";import"./Shield01-C7ZT-QsW.js";import"./Stars01-BM2OfAMq.js";import"./Trash01-D1DmT9Mr.js";import"./Upload01-BpkBrNfw.js";import"./User01-DhqtO0lv.js";import"./Users01-DScwWUp0.js";import"./XClose-BvKJTTlt.js";import"./X-Dqpx-r1T.js";import"./Zap-C6SkRgFu.js";import"./use-clock-tick-aakwXYCP.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-V0KcMVib.js";import"./tooltip-qf4kMmAF.js";import"./file-type-icon-CVukPbEL.js";import"./dialog-CHU--T7-.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BV8aIt26.js";import"./use-mcp-client-DuJQA2rV.js";import"./auth-C19hiZia.js";import"./chat-context-D45ePksk.js";import"./hooks-C9iWb2N3.js";import"./decopilot-sse-pool-BH11VGHE.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BdsGMQZL.js";import"./use-collections-D4X4_zKE.js";import"./use-ai-providers-DuFfPCpZ.js";import"./studio-tools-Lqif47iD.js";import"./use-organization-settings-nc8QZXyP.js";import"./shell-layout-BFU4WLoP.js";import"./avatar-Bbvs8iIt.js";import"./required-auth-layout-BolsfPYi.js";import"./use-org-sso-BzsvKCfF.js";import"./sheet-BDdFViUD.js";import"./integration-icon-BpZ3OsA4.js";import"./use-navigate-to-agent-BNMv1Neu.js";import"./use-connection-CyHDjrsh.js";import"./use-mcp-prompts-CmUaiuB7.js";import"./form-Bxj0TUqV.js";import"./label-7phVZ6ZM.js";import"./input-DJV4VNka.js";import"./select-DlsRm0pM.js";import"./index-YYxzAkAN.js";import"./drawer-D4XkXj4V.js";import"./collection-search-EReXMo3F.js";import"./tabs-DoKlXPZO.js";import"./toggle-group-DCz7F7cJ.js";import"./sortable.esm-JwRAHi44.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-uZjILvOr.js";import"./use-registry-connections-CJhKWnft.js";import"./useInfiniteQuery-CkJOjicq.js";import"./use-infinite-scroll-4IJEWhiu.js";import"./extract-connection-data-Ws_H4ap3.js";import"./card-RkuQTlVn.js";import"./collection-tabs-C3OblNuX.js";import"./badge-C3IXjCX0.js";import"./textarea-BjequYD7.js";import"./connection-form-helpers-DV9ppnRP.js";import"./authenticate-and-persist-oauth-B1-SzA6A.js";import"./mcp-oauth-BGRbdqPD.js";import"./useSuspenseInfiniteQuery-n6ZCdGbO.js";import"./connect-desktop-dialog-DuJwJvdQ.js";import"./decopilot-CxoZlpZn.js";import"./checkbox-yMsno3zH.js";import"./skeleton-DpU2T6Js.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CAKwpEKX.js";import"./popover-Bo_sL62z.js";import"./command-BsaV9rjm.js";import"./index-NjN7v_96.js";import"./dropdown-menu-D2HxaMPU.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DaofAwGt.js";import"./empty-state-DA37X_xl.js";import"./toolbar-DMerIIuJ.js";import"./preview-dialog-B9gUDoJJ.js";import"./index-CprKTf1O.js";import"./use-mcp-tools-D715CcxL.js";import"./use-capability-DLjX445R.js";import"./shell-route-loading-P7c6nIb-.js";import"./index-bmV9L0o4.js";import"./alert-dialog-Cz6L6NXK.js";import"./switch-CzdCn_lr.js";import"./use-debounced-autosave-C-eVH4yR.js";import"./index-BFqTOqSJ.js";import"./sidebar-DoXfrWOj.js";import"./search-input-H6T5GrKJ.js";import"./github-repo-picker-nQicPdJf.js";import"./use-secrets-CxFfyxif.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-C9q5ISiT.js";import"./automation-runs-CFBKS4y-.js";import"./table-CLXzS61A.js";import"./use-members-DIDnJkLY.js";import"./use-org-auth-client-DtHGY2-t.js";import"./task-status-DPcnbZIP.js";import"./use-automations-CauJKNE9.js";import"./use-file-configs-BG_rDJRo.js";import"./monaco-editor-Cqq2xAH1.js";import"./select-model-jVluH6Ea.js";import"./automation-list-row-BYkbwrNr.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function xr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,G=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const J=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:Q,isPending:W}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const X=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const Y=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let U;e[34]!==c||e[35]!==Q||e[36]!==X?(U=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await X.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=Q,e[36]=X,e[37]=U):U=e[37];const y=U;let V;e[38]===Symbol.for("react.memo_cache_sentinel")?(V=t=>{P.current=t.append,re(!0)},e[38]=V):V=e[38];const ve=V;let I;e[39]!==y?(I=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=I):I=e[40];const le=I;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==W?(j=o.jsx(Te,{isPending:W,isError:!1}),e[48]=W,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==J||e[61]!==s||e[62]!==u||e[63]!==Y||e[64]!==h||e[65]!==G?(_=o.jsx(ke,{className:"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(Ke,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=J,e[61]=s,e[62]=u,e[63]=Y,e[64]=h,e[65]=G,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{xr as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as B,j as o,w as L,b as T,r as $,B as M,s as N}from"./index-BoDi6OBc.js";import{s as q}from"./Plus-BmqFkgYT.js";import{i as S}from"./Zap-C6SkRgFu.js";import{S as D}from"./search-input-H6T5GrKJ.js";import{P as l}from"./index-BFqTOqSJ.js";import{E as b}from"./empty-state-DA37X_xl.js";import{c as O}from"./use-automations-CauJKNE9.js";import{m as V}from"./use-navigate-to-agent-BNMv1Neu.js";import{A as F}from"./automation-list-row-BYkbwrNr.js";import{o as G}from"./use-mcp-client-DuJQA2rV.js";import{u as H}from"./use-virtual-mcp-BdsGMQZL.js";import{R as J}from"./require-capability-Bnt0ZBRa.js";import"./SearchMd-rJiOFJwK.js";import"./sidebar-DoXfrWOj.js";import"./LayoutLeft-D2ad_kHx.js";import"./tooltip-qf4kMmAF.js";import"./sheet-BDdFViUD.js";import"./X-Dqpx-r1T.js";import"./studio-tools-Lqif47iD.js";import"./alert-dialog-Cz6L6NXK.js";import"./dropdown-menu-D2HxaMPU.js";import"./ChevronUp-B0iQd-AD.js";import"./ChevronRight-CWp0460U.js";import"./DotsVertical-BBNwX5J5.js";import"./Stars02-CbFOXGiR.js";import"./Trash01-D1DmT9Mr.js";import"./agent-icon-BHjJxJmC.js";import"./AlertCircle-C0MMJCns.js";import"./Tool01-BXc8J6xZ.js";import"./SwitchHorizontal01-dm0C0Tjx.js";import"./Settings02-DG5mJ_xI.js";import"./XCircle-D9qm_1Ut.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./ZapSquare-CL6VANDT.js";import"./Users03-BhaYLgGW.js";import"./CheckCircle-B40vdc2l.js";import"./ChevronDown-QQWh1U0r.js";import"./ChevronLeft-CRDrddT9.js";import"./Eye-bN0xnD-o.js";import"./ZoomOut-wqR_bKeR.js";import"./Globe01-DTi3Gxq3.js";import"./FilterLines-DttJL6KD.js";import"./Star01-DPkaqbS_.js";import"./Globe04-n0f96BbD.js";import"./HardDrive-D5-uOHw9.js";import"./Key01-DAsg8mdj.js";import"./LinkExternal01-D6izDWZT.js";import"./Monitor01-CaUMTT8S.js";import"./Sun-D9AuRcRz.js";import"./Palette-ceW3H3uT.js";import"./Play-VLn5ww3u.js";import"./Shield01-C7ZT-QsW.js";import"./Stars01-BM2OfAMq.js";import"./Upload01-BpkBrNfw.js";import"./User01-DhqtO0lv.js";import"./Users01-DScwWUp0.js";import"./XClose-BvKJTTlt.js";import"./auth-C19hiZia.js";import"./use-collections-D4X4_zKE.js";import"./use-capability-DLjX445R.js";import"./access-gate-DATyJxs9.js";import"./capability-load-error-DP8VgCQ8.js";function K(){const t=B.c(16),{org:i}=L(),{data:v}=O(void 0),u=v===void 0?[]:v,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const m=y.get(e.virtual_mcp_id);if(m&&m.title.toLowerCase().includes(g))return!0}return!1}),P=(e,m)=>{const A=m&&y.has(m)?m:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const w=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==w?(s=o.jsxs(j.Body,{children:[r,w]}),t[6]=j.Body,t[7]=r,t[8]=w,t[9]=s):s=t[9];let a;t[10]!==h.Content||t[11]!==s?(a=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=a):a=t[12];let c;return t[13]!==x||t[14]!==a?(c=o.jsx(x,{children:a}),t[13]=x,t[14]=a,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function eo(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{eo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as K,x as ze,w as Ie,m as Le,K as Oe,k as Ke,d as ge,j as n,B as Ae,s as H,t as L,r as Te,G as Ue,l as _e,ae as fe}from"./index-BoDi6OBc.js";import{t as Xe}from"./ChevronDown-QQWh1U0r.js";import{i as He}from"./ChevronRight-CWp0460U.js";import{s as qe,t as Me}from"./Star01-DPkaqbS_.js";import{n as Ve}from"./LinkExternal01-D6izDWZT.js";import{s as Re}from"./Plus-BmqFkgYT.js";import{s as Ge}from"./Trash01-D1DmT9Mr.js";import{i as Qe}from"./Zap-C6SkRgFu.js";import{c as Ye,b as Je,d as We,A as Ze,g as et,e as tt,a as st,f as nt}from"./alert-dialog-Cz6L6NXK.js";import{I as ue}from"./input-DJV4VNka.js";import{T as lt}from"./textarea-BjequYD7.js";import{P as Ne}from"./index-BFqTOqSJ.js";import{u as $e}from"./studio-tools-Lqif47iD.js";import{u as ot}from"./use-debounced-autosave-C-eVH4yR.js";import{R as rt}from"./require-capability-Bnt0ZBRa.js";import"./sidebar-DoXfrWOj.js";import"./LayoutLeft-D2ad_kHx.js";import"./tooltip-qf4kMmAF.js";import"./sheet-BDdFViUD.js";import"./X-Dqpx-r1T.js";import"./use-capability-DLjX445R.js";import"./access-gate-DATyJxs9.js";import"./capability-load-error-DP8VgCQ8.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Te.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Qe,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Ae,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ve,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(lt,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Te.useState(s.isDefault??!1),[f,g]=Te.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=ot(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let G;e[63]!==De?(G=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=G):G=e[64];let Q,Y;e[65]!==X?(Q=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=Q,e[67]=Y):(Q=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==G||e[73]!==Q||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:G,onClick:Q,onKeyDown:Y,title:ke,children:W}),e[72]=G,e[73]=Q,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ge,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Ye,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Je,{children:[je,n.jsx(We,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Ze,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(et,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(tt,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(st,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(nt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Ae,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Ae,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function Zt(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{Zt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-BoDi6OBc.js";import{i as J}from"./AlertCircle-C0MMJCns.js";import{i as O}from"./HardDrive-D5-uOHw9.js";import{s as L}from"./Plus-BmqFkgYT.js";import{s as Q}from"./Trash01-D1DmT9Mr.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-Cz6L6NXK.js";import{d as ne,c as le,D as ae,a as oe,b as ce,e as de}from"./dialog-CHU--T7-.js";import{I as N}from"./input-DJV4VNka.js";import{L as C}from"./label-7phVZ6ZM.js";import{d as me,b as ue,c as fe,S as pe,a as q}from"./select-DlsRm0pM.js";import{S as xe}from"./switch-CzdCn_lr.js";import{S as he}from"./skeleton-DpU2T6Js.js";import{T as ge}from"./textarea-BjequYD7.js";import{P}from"./index-BFqTOqSJ.js";import{c as je}from"./settings-section-CAKwpEKX.js";import{u as ye,b as be,c as ve}from"./use-file-configs-BG_rDJRo.js";import{R as Se}from"./require-capability-Bnt0ZBRa.js";import"./X-Dqpx-r1T.js";import"./tooltip-qf4kMmAF.js";import"./ChevronUp-B0iQd-AD.js";import"./ChevronDown-QQWh1U0r.js";import"./sidebar-DoXfrWOj.js";import"./LayoutLeft-D2ad_kHx.js";import"./sheet-BDdFViUD.js";import"./card-RkuQTlVn.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./studio-tools-Lqif47iD.js";import"./use-capability-DLjX445R.js";import"./access-gate-DATyJxs9.js";import"./capability-load-error-DP8VgCQ8.js";function Ce(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ne(s){const e=D.c(44),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(O,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(O,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(L,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(o=t.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:[n,r,t.jsxs(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(C,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function at(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{at as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as st,j as e,B as mt}from"./index-BoDi6OBc.js";import{i as lt}from"./XCircle-D9qm_1Ut.js";import{U as pt}from"./agent-icon-BHjJxJmC.js";import{I as tt}from"./input-DJV4VNka.js";import{L as et}from"./label-7phVZ6ZM.js";import{ar as at,as as nt,aA as ct,at as ft}from"./index-BO0QV1fb.js";import{u as dt,s as M,I as gt}from"./primitives-Ch1GQ4pf.js";import{S as ut}from"./save-status-HMD0mFgw.js";import{a as xt,B as ht,b as yt}from"./block-document-C3ZQBAYM.js";import"./AlertCircle-C0MMJCns.js";import"./Tool01-BXc8J6xZ.js";import"./SwitchHorizontal01-dm0C0Tjx.js";import"./Settings02-DG5mJ_xI.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./ZapSquare-CL6VANDT.js";import"./Users03-BhaYLgGW.js";import"./CheckCircle-B40vdc2l.js";import"./ChevronUp-B0iQd-AD.js";import"./ChevronDown-QQWh1U0r.js";import"./ChevronLeft-CRDrddT9.js";import"./ChevronRight-CWp0460U.js";import"./DotsVertical-BBNwX5J5.js";import"./Stars02-CbFOXGiR.js";import"./Eye-bN0xnD-o.js";import"./ZoomOut-wqR_bKeR.js";import"./Globe01-DTi3Gxq3.js";import"./FilterLines-DttJL6KD.js";import"./Star01-DPkaqbS_.js";import"./Globe04-n0f96BbD.js";import"./HardDrive-D5-uOHw9.js";import"./Key01-DAsg8mdj.js";import"./LayoutLeft-D2ad_kHx.js";import"./LinkExternal01-D6izDWZT.js";import"./Monitor01-CaUMTT8S.js";import"./Sun-D9AuRcRz.js";import"./Palette-ceW3H3uT.js";import"./Play-VLn5ww3u.js";import"./Plus-BmqFkgYT.js";import"./SearchMd-rJiOFJwK.js";import"./Shield01-C7ZT-QsW.js";import"./Stars01-BM2OfAMq.js";import"./Trash01-D1DmT9Mr.js";import"./Upload01-BpkBrNfw.js";import"./User01-DhqtO0lv.js";import"./Users01-DScwWUp0.js";import"./XClose-BvKJTTlt.js";import"./X-Dqpx-r1T.js";import"./Zap-C6SkRgFu.js";import"./index-YYxzAkAN.js";import"./chat-context-D45ePksk.js";import"./hooks-C9iWb2N3.js";import"./use-mcp-client-DuJQA2rV.js";import"./auth-C19hiZia.js";import"./decopilot-sse-pool-BH11VGHE.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BdsGMQZL.js";import"./use-collections-D4X4_zKE.js";import"./use-ai-providers-DuFfPCpZ.js";import"./studio-tools-Lqif47iD.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-nc8QZXyP.js";import"./scroll-area-B1cpZQna.js";import"./use-clock-tick-aakwXYCP.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-V0KcMVib.js";import"./tooltip-qf4kMmAF.js";import"./file-type-icon-CVukPbEL.js";import"./dialog-CHU--T7-.js";import"./content-blocks-o63cs2vh.js";import"./types-BV8aIt26.js";import"./shell-layout-BFU4WLoP.js";import"./avatar-Bbvs8iIt.js";import"./required-auth-layout-BolsfPYi.js";import"./use-org-sso-BzsvKCfF.js";import"./sheet-BDdFViUD.js";import"./integration-icon-BpZ3OsA4.js";import"./use-navigate-to-agent-BNMv1Neu.js";import"./use-connection-CyHDjrsh.js";import"./use-mcp-prompts-CmUaiuB7.js";import"./form-Bxj0TUqV.js";import"./select-DlsRm0pM.js";import"./drawer-D4XkXj4V.js";import"./collection-search-EReXMo3F.js";import"./tabs-DoKlXPZO.js";import"./toggle-group-DCz7F7cJ.js";import"./sortable.esm-JwRAHi44.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-uZjILvOr.js";import"./use-registry-connections-CJhKWnft.js";import"./useInfiniteQuery-CkJOjicq.js";import"./use-infinite-scroll-4IJEWhiu.js";import"./extract-connection-data-Ws_H4ap3.js";import"./card-RkuQTlVn.js";import"./collection-tabs-C3OblNuX.js";import"./badge-C3IXjCX0.js";import"./textarea-BjequYD7.js";import"./connection-form-helpers-DV9ppnRP.js";import"./authenticate-and-persist-oauth-B1-SzA6A.js";import"./mcp-oauth-BGRbdqPD.js";import"./useSuspenseInfiniteQuery-n6ZCdGbO.js";import"./connect-desktop-dialog-DuJwJvdQ.js";import"./decopilot-CxoZlpZn.js";import"./checkbox-yMsno3zH.js";import"./skeleton-DpU2T6Js.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CAKwpEKX.js";import"./popover-Bo_sL62z.js";import"./command-BsaV9rjm.js";import"./index-NjN7v_96.js";import"./dropdown-menu-D2HxaMPU.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DaofAwGt.js";import"./empty-state-DA37X_xl.js";import"./toolbar-DMerIIuJ.js";import"./preview-dialog-B9gUDoJJ.js";import"./index-CprKTf1O.js";import"./use-mcp-tools-D715CcxL.js";import"./use-capability-DLjX445R.js";import"./shell-route-loading-P7c6nIb-.js";import"./index-bmV9L0o4.js";import"./alert-dialog-Cz6L6NXK.js";import"./switch-CzdCn_lr.js";import"./use-debounced-autosave-C-eVH4yR.js";import"./index-BFqTOqSJ.js";import"./sidebar-DoXfrWOj.js";import"./search-input-H6T5GrKJ.js";import"./github-repo-picker-nQicPdJf.js";import"./use-secrets-CxFfyxif.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-C9q5ISiT.js";import"./automation-runs-CFBKS4y-.js";import"./table-CLXzS61A.js";import"./use-members-DIDnJkLY.js";import"./use-org-auth-client-DtHGY2-t.js";import"./task-status-DPcnbZIP.js";import"./use-automations-CauJKNE9.js";import"./use-file-configs-BG_rDJRo.js";import"./monaco-editor-Cqq2xAH1.js";import"./select-model-jVluH6Ea.js";import"./automation-list-row-BYkbwrNr.js";function Yi(it){const t=st.c(87),{orgSlug:l,virtualMcpId:p,branch:a,blockKey:z,block:G,decofile:H,meta:O,onManagePosts:Q}=it;let F;t[0]!==a||t[1]!==l||t[2]!==p?(F={orgSlug:l,virtualMcpId:p,branch:a},t[0]=a,t[1]=l,t[2]=p,t[3]=F):F=t[3];const m=at(F);let U;t[4]!==G?(U=nt(G,"categories"),t[4]=G,t[5]=U):U=t[5];const ot=U;let A;t[6]!==z||t[7]!==m?(A=o=>{m.mutate({blockKey:z,data:ft(z,"categories",o)})},t[6]=z,t[7]=m,t[8]=A):A=t[8];const[i,V]=dt(ot,A);let D;t[9]!==i||t[10]!==V?(D=(o,rt)=>V({...i,[o]:rt}),t[9]=i,t[10]=V,t[11]=D):D=t[11];const r=D;let s,L;t[12]!==i.slug||t[13]!==H?(s=M(i.slug),L=s?ct(H).filter(o=>o.categorySlugs.includes(s)).length:0,t[12]=i.slug,t[13]=H,t[14]=s,t[15]=L):(s=t[14],L=t[15]);const R=L;let n;t[16]!==i.name?(n=M(i.name)||"Untitled category",t[16]=i.name,t[17]=n):n=t[17];let c;t[18]!==n?(c=e.jsx("span",{className:"truncate text-sm font-medium",children:n}),t[18]=n,t[19]=c):c=t[19];let f;t[20]!==m.isError||t[21]!==m.isPending?(f=e.jsx(ut,{isPending:m.isPending,isError:m.isError}),t[20]=m.isError,t[21]=m.isPending,t[22]=f):f=t[22];let d;t[23]!==c||t[24]!==f?(d=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,f]}),t[23]=c,t[24]=f,t[25]=d):d=t[25];let g;t[26]!==i.name?(g=M(i.name),t[26]=i.name,t[27]=g):g=t[27];let u;t[28]!==r?(u=o=>r("name",o),t[28]=r,t[29]=u):u=t[29];let x;t[30]!==g||t[31]!==u?(x=e.jsx(gt,{value:g,onChange:u,placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t[30]=g,t[31]=u,t[32]=x):x=t[32];let T;t[33]===Symbol.for("react.memo_cache_sentinel")?(T=e.jsx(et,{htmlFor:"category-slug",children:"Slug"}),t[33]=T):T=t[33];let h;t[34]!==i.slug?(h=M(i.slug),t[34]=i.slug,t[35]=h):h=t[35];let y;t[36]!==r?(y=o=>r("slug",o.target.value),t[36]=r,t[37]=y):y=t[37];let j;t[38]!==h||t[39]!==y?(j=e.jsxs("div",{className:"mt-4 space-y-2",children:[T,e.jsx(tt,{id:"category-slug",value:h,onChange:y,placeholder:"my-category",className:"h-10"})]}),t[38]=h,t[39]=y,t[40]=j):j=t[40];let $;t[41]===Symbol.for("react.memo_cache_sentinel")?($=e.jsx(et,{htmlFor:"category-description",children:"Description"}),t[41]=$):$=t[41];let b;t[42]!==i.description?(b=M(i.description),t[42]=i.description,t[43]=b):b=t[43];let v;t[44]!==r?(v=o=>r("description",o.target.value),t[44]=r,t[45]=v):v=t[45];let N;t[46]!==b||t[47]!==v?(N=e.jsxs("div",{className:"mt-4 space-y-2",children:[$,e.jsx(tt,{id:"category-description",value:b,onChange:v,placeholder:"Short description for this category",className:"h-10"})]}),t[46]=b,t[47]=v,t[48]=N):N=t[48];let J;t[49]===Symbol.for("react.memo_cache_sentinel")?(J=e.jsx(pt,{size:16,className:"shrink-0 text-muted-foreground"}),t[49]=J):J=t[49];const X=R===1?"post":"posts";let S;t[50]!==R||t[51]!==X?(S=e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[J,e.jsxs("span",{className:"text-sm",children:[R," ",X," in this category"]})]}),t[50]=R,t[51]=X,t[52]=S):S=t[52];const Y=!s,Z=s?"Jump to the posts list filtered by this category":"Set a slug to manage this category's posts";let B;t[53]!==Q||t[54]!==s?(B=()=>Q(s),t[53]=Q,t[54]=s,t[55]=B):B=t[55];let K;t[56]===Symbol.for("react.memo_cache_sentinel")?(K=e.jsx(lt,{size:14}),t[56]=K):K=t[56];let k;t[57]!==Y||t[58]!==Z||t[59]!==B?(k=e.jsxs(mt,{type:"button",variant:"outline",size:"sm",disabled:Y,title:Z,onClick:B,children:["Manage posts",K]}),t[57]=Y,t[58]=Z,t[59]=B,t[60]=k):k=t[60];let _;t[61]!==S||t[62]!==k?(_=e.jsxs("div",{className:"mt-6 flex items-center justify-between gap-3 rounded-lg border bg-muted/30 px-4 py-3",children:[S,k]}),t[61]=S,t[62]=k,t[63]=_):_=t[63];let W;t[64]===Symbol.for("react.memo_cache_sentinel")?(W=e.jsx("div",{className:"mt-6 border-t"}),t[64]=W):W=t[64];let C;t[65]!==i.sections?(C=xt(i.sections),t[65]=i.sections,t[66]=C):C=t[66];let P;t[67]!==r?(P=o=>r("sections",o),t[67]=r,t[68]=P):P=t[68];let E;t[69]!==O||t[70]!==C||t[71]!==P?(E=e.jsx(ht,{value:C,onChange:P,meta:O,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."}),t[69]=O,t[70]=C,t[71]=P,t[72]=E):E=t[72];let w;t[73]!==x||t[74]!==j||t[75]!==N||t[76]!==_||t[77]!==E?(w=e.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-3xl px-8 py-8",children:[x,j,N,_,W,E]})}),t[73]=x,t[74]=j,t[75]=N,t[76]=_,t[77]=E,t[78]=w):w=t[78];let I;t[79]!==w||t[80]!==d?(I=e.jsxs("div",{className:"flex h-full flex-col",children:[d,w]}),t[79]=w,t[80]=d,t[81]=I):I=t[81];let q;return t[82]!==a||t[83]!==l||t[84]!==I||t[85]!==p?(q=e.jsx(yt,{orgSlug:l,virtualMcpId:p,branch:a,children:I}),t[82]=a,t[83]=l,t[84]=I,t[85]=p,t[86]=q):q=t[86],q}export{Yi as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as y,j as t,B as F,i as X,z as Ge,C as se,E as Pe,r as T,w as ie,G as Qe,l as V,bf as Ye,u as Xe,y as G,t as Ze,e as ae,b1 as ke}from"./index-BoDi6OBc.js";import{E as Ee}from"./empty-state-DA37X_xl.js";import{u as et,a as Ae}from"./use-collections-D4X4_zKE.js";import{u as ce}from"./use-mcp-client-DuJQA2rV.js";import{F as ne,a as tt,b as de,d as me}from"./form-Bxj0TUqV.js";import{I as ue}from"./input-DJV4VNka.js";import{T as re}from"./textarea-BjequYD7.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-ktUKbMYA.js";import{ag as rt,x as it,a5 as at,ah as ct,a1 as dt,ai as mt,M as be}from"./agent-icon-BHjJxJmC.js";import{g as ut,M as xt,a as Ne}from"./types-BV8aIt26.js";import{A as pt,a as ft,b as ht}from"./alert-BQLAuYif.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-DlsRm0pM.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-qf4kMmAF.js";import{i as jt}from"./AlertCircle-C0MMJCns.js";import{s as bt}from"./Stars02-CbFOXGiR.js";import{a as Nt}from"./Eye-bN0xnD-o.js";import{i as vt}from"./Play-VLn5ww3u.js";import{i as St}from"./ChevronRight-CWp0460U.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-bmV9L0o4.js";import{a as Oe,u as Re}from"./use-connection-CyHDjrsh.js";import{a as It}from"./use-mcp-tools-D715CcxL.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-BpZ3OsA4.js";import{f as Tt,h as Pt}from"./chat-context-D45ePksk.js";import{b as kt}from"./shell-layout-BFU4WLoP.js";import{M as Et}from"./monaco-editor-Cqq2xAH1.js";import{n as At}from"./XCircle-D9qm_1Ut.js";import"./auth-C19hiZia.js";import"./label-7phVZ6ZM.js";import"./index-BFqTOqSJ.js";import"./sidebar-DoXfrWOj.js";import"./LayoutLeft-D2ad_kHx.js";import"./sheet-BDdFViUD.js";import"./X-Dqpx-r1T.js";import"./ZoomOut-wqR_bKeR.js";import"./Key01-DAsg8mdj.js";import"./extract-connection-data-Ws_H4ap3.js";import"./use-registry-connections-CJhKWnft.js";import"./use-organization-settings-nc8QZXyP.js";import"./studio-tools-Lqif47iD.js";import"./Plus-BmqFkgYT.js";import"./index-DzHbeUkj.js";import"./index-NjN7v_96.js";import"./popover-Bo_sL62z.js";import"./use-virtual-mcp-BdsGMQZL.js";import"./ChevronUp-B0iQd-AD.js";import"./SearchMd-rJiOFJwK.js";import"./Users03-BhaYLgGW.js";import"./use-create-virtual-mcp-CEKhGxvf.js";import"./use-navigate-to-agent-BNMv1Neu.js";import"./Tool01-BXc8J6xZ.js";import"./SwitchHorizontal01-dm0C0Tjx.js";import"./Settings02-DG5mJ_xI.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./ZapSquare-CL6VANDT.js";import"./CheckCircle-B40vdc2l.js";import"./ChevronDown-QQWh1U0r.js";import"./ChevronLeft-CRDrddT9.js";import"./DotsVertical-BBNwX5J5.js";import"./Globe01-DTi3Gxq3.js";import"./FilterLines-DttJL6KD.js";import"./Star01-DPkaqbS_.js";import"./Globe04-n0f96BbD.js";import"./HardDrive-D5-uOHw9.js";import"./LinkExternal01-D6izDWZT.js";import"./Monitor01-CaUMTT8S.js";import"./Sun-D9AuRcRz.js";import"./Palette-ceW3H3uT.js";import"./Shield01-C7ZT-QsW.js";import"./Stars01-BM2OfAMq.js";import"./Trash01-D1DmT9Mr.js";import"./Upload01-BpkBrNfw.js";import"./User01-DhqtO0lv.js";import"./Users01-DScwWUp0.js";import"./XClose-BvKJTTlt.js";import"./Zap-C6SkRgFu.js";import"./mcp-oauth-BGRbdqPD.js";import"./badge-C3IXjCX0.js";import"./hooks-C9iWb2N3.js";import"./decopilot-sse-pool-BH11VGHE.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-DuFfPCpZ.js";import"./tab-id-BptcWVWa.js";import"./avatar-Bbvs8iIt.js";import"./dialog-CHU--T7-.js";import"./required-auth-layout-BolsfPYi.js";import"./use-org-sso-BzsvKCfF.js";import"./index-CprKTf1O.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Dt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),D=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[De,Le]=T.useState(!1);O&&!De&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(D,d),onTeardown:()=>A?.clearAppContext(D),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let D;s[24]!==k?(D=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=D):D=s[25];let _;s[26]!==U||s[27]!==D||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,D]})}),s[26]=U,s[27]=D,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function _n(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{_n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as I,r as O,l as ve,j as s,B as Y,i as Ce,K as U,k as oe,m as Ue,a as Ne,u as Ae,b as Ie,n as $e,d as Te,o as Ee,Q as De,E as Me,p as Se,L as Ke}from"./index-BoDi6OBc.js";import{A as qe}from"./auth-entry-DGjXLiVY.js";import{A}from"./auth-split-layout-Dmg3NIiT.js";import{O as _e}from"./organization-choice-3XngO70I.js";import{f as He}from"./tab-id-BptcWVWa.js";import{I as Fe}from"./input-DJV4VNka.js";import{u as be,W as Re,S as Oe,g as Be,C as Qe}from"./use-mcp-client-DuJQA2rV.js";import{i as we}from"./XCircle-D9qm_1Ut.js";import{I as We}from"./integration-icon-BpZ3OsA4.js";import{i as ke}from"./CheckCircle-B40vdc2l.js";import{g as Ge,c as Ye,e as Ve}from"./extract-connection-data-Ws_H4ap3.js";import{a as Ze}from"./authenticate-and-persist-oauth-B1-SzA6A.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-Bbvs8iIt.js";import"./User01-DhqtO0lv.js";import"./auth-C19hiZia.js";import"./agent-icon-BHjJxJmC.js";import"./AlertCircle-C0MMJCns.js";import"./Tool01-BXc8J6xZ.js";import"./SwitchHorizontal01-dm0C0Tjx.js";import"./Settings02-DG5mJ_xI.js";import"./ArrowUpRight-gVE5kRlQ.js";import"./ZapSquare-CL6VANDT.js";import"./Users03-BhaYLgGW.js";import"./ChevronUp-B0iQd-AD.js";import"./ChevronDown-QQWh1U0r.js";import"./ChevronLeft-CRDrddT9.js";import"./ChevronRight-CWp0460U.js";import"./DotsVertical-BBNwX5J5.js";import"./Stars02-CbFOXGiR.js";import"./Eye-bN0xnD-o.js";import"./ZoomOut-wqR_bKeR.js";import"./Globe01-DTi3Gxq3.js";import"./FilterLines-DttJL6KD.js";import"./Star01-DPkaqbS_.js";import"./Globe04-n0f96BbD.js";import"./HardDrive-D5-uOHw9.js";import"./Key01-DAsg8mdj.js";import"./LayoutLeft-D2ad_kHx.js";import"./LinkExternal01-D6izDWZT.js";import"./Monitor01-CaUMTT8S.js";import"./Sun-D9AuRcRz.js";import"./Palette-ceW3H3uT.js";import"./Play-VLn5ww3u.js";import"./Plus-BmqFkgYT.js";import"./SearchMd-rJiOFJwK.js";import"./Shield01-C7ZT-QsW.js";import"./Stars01-BM2OfAMq.js";import"./Trash01-D1DmT9Mr.js";import"./Upload01-BpkBrNfw.js";import"./Users01-DScwWUp0.js";import"./XClose-BvKJTTlt.js";import"./X-Dqpx-r1T.js";import"./Zap-C6SkRgFu.js";import"./mcp-oauth-BGRbdqPD.js";const Je=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Xe=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,et=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,tt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function he(i){const e=i.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=Je.test(e),n=Xe.test(e),o=et.test(e);if(t&&!n&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=n?e:`https://${e}`;let l;try{l=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=l.hostname.split(".");return r.length<2||r.some(d=>!d||!tt.test(d))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function xe(i){const e=I.c(14),{children:t,className:n,wrapperClassName:o}=i,[c,l]=O.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=x=>{if(!x)return;const y=()=>{const a=x.scrollHeight-x.scrollTop-x.clientHeight<8;l(a)};y(),x.addEventListener("scroll",y,{passive:!0});const C=new ResizeObserver(y);C.observe(x);for(const a of Array.from(x.children))C.observe(a);return()=>{x.removeEventListener("scroll",y),C.disconnect()}},e[0]=r):r=e[0];const d=r;let m;e[1]!==o?(m=ve("relative",o),e[1]=o,e[2]=m):m=e[2];let g;e[3]!==t||e[4]!==n?(g=s.jsx("div",{ref:d,className:n,children:t}),e[3]=t,e[4]=n,e[5]=g):g=e[5];const u=c?"opacity-0":"opacity-100";let p;e[6]!==u?(p=ve("pointer-events-none absolute inset-x-0 -bottom-px h-[213px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[2px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",u),e[6]=u,e[7]=p):p=e[7];let h;e[8]!==p?(h=s.jsx("div",{"aria-hidden":!0,className:p}),e[8]=p,e[9]=h):h=e[9];let f;return e[10]!==m||e[11]!==g||e[12]!==h?(f=s.jsxs("div",{className:m,children:[g,h]}),e[10]=m,e[11]=g,e[12]=h,e[13]=f):f=e[13],f}function nt(){const i=I.c(3);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-12 shrink-0 animate-pulse rounded-lg bg-muted/60"}),s.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),i[1]=t):t=i[1];let n;return i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),i[2]=n):n=i[2],n}function ye(i){const e=I.c(3),{children:t}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ke,{size:14,className:"shrink-0 text-blue-500"}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsxs("div",{className:"flex items-center gap-2 p-1",children:[n,s.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function st(i){const e=I.c(33),{card:t,connecting:n,disabled:o,onConnect:c}=i;let l;e[0]!==t.icon||e[1]!==t.title?(l=s.jsx(We,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-2"}),e[0]=t.icon,e[1]=t.title,e[2]=l):l=e[2];let r;e[3]!==t.title?(r=s.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[3]=t.title,e[4]=r):r=e[4];let d;e[5]!==t.satisfied||e[6]!==t.title||e[7]!==n||e[8]!==o||e[9]!==c?(d=t.satisfied?s.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[s.jsx(ke,{size:16})," Connected"]}):s.jsx(Y,{type:"button",variant:"outline",size:"sm",disabled:o||n,onClick:c,"aria-label":`Connect ${t.title}`,children:n?s.jsx(Ce,{size:16,className:"animate-spin"}):"Connect"}),e[5]=t.satisfied,e[6]=t.title,e[7]=n,e[8]=o,e[9]=c,e[10]=d):d=e[10];let m;e[11]!==l||e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[l,r,d]}),e[11]=l,e[12]=r,e[13]=d,e[14]=m):m=e[14];let g;e[15]!==t.checks?(g=t.checks!==null&&s.jsxs(ye,{children:["+ ",t.checks," checks"]}),e[15]=t.checks,e[16]=g):g=e[16];let u;e[17]!==t.headline?(u=t.headline&&s.jsx(ye,{children:t.headline}),e[17]=t.headline,e[18]=u):u=e[18];let p;e[19]!==t.bullets?(p=t.bullets.map(it),e[19]=t.bullets,e[20]=p):p=e[20];let h;e[21]!==t.candidateConnectionId||e[22]!==t.satisfied||e[23]!==t.title?(h=!t.satisfied&&t.candidateConnectionId&&s.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",t.title]}),e[21]=t.candidateConnectionId,e[22]=t.satisfied,e[23]=t.title,e[24]=h):h=e[24];let f;e[25]!==g||e[26]!==u||e[27]!==p||e[28]!==h?(f=s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[g,u,p,h]}),e[25]=g,e[26]=u,e[27]=p,e[28]=h,e[29]=f):f=e[29];let x;return e[30]!==m||e[31]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[m,f]}),e[30]=m,e[31]=f,e[32]=x):x=e[32],x}function it(i){return s.jsx(ye,{children:i},i)}const je={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function ot(i){const e=i.properties;if(!e)return[];const t=[];for(const[n,o]of Object.entries(e)){const r=o?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:n,bindingType:r})}return t}function rt(i,e){const t=[];if(i.length&&t.push({field:["id"],operator:"in",value:i}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function D(i){const e=i;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??i}function lt(i,e,t,n){return{...i??{},[e]:{__type:t,value:n}}}function at(i,e,t){const n=i.filter(o=>o.app_name===e||!!t&&o.app_id===t);return n.length===0?null:(n.sort((o,c)=>{const l=r=>r.status==="active"?0:1;return l(o)!==l(c)?l(o)-l(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),n[0].id)}function ct(i){return i.server?.icons?.[0]?.src??Ge(i.server?.repository)??null}function dt(i,e){const t=i._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||i.title||i.server?.title||i.server?.name||e}function mt(i){const e=[];for(const t of i.requirements){const n=i.curated[t.bindingType],o=n?i.itemsById[n.registryAppId]:i.itemsByName[t.bindingType];if(!o)continue;const l=!!i.configurationState?.[t.fieldKey]?.value;e.push({fieldKey:t.fieldKey,bindingType:t.bindingType,registryItem:o,title:dt(o,t.bindingType),icon:ct(o),headline:n?.headline??o._meta?.["mcp.mesh"]?.short_description??null,checks:n?.checks??null,bullets:n?.bullets??[],satisfied:l,candidateConnectionId:l?null:at(i.connections,t.bindingType,n?.registryAppId)})}return e}function ut(i){const e=I.c(25),{selfClient:t,org:n,cdConnectionId:o}=i;let c;e[0]!==o||e[1]!==n.id||e[2]!==n.slug?(c={connectionId:o,orgId:n.id,orgSlug:n.slug},e[0]=o,e[1]=n.id,e[2]=n.slug,e[3]=c):c=e[3];const l=be(c);let r;e[4]!==o||e[5]!==n.id?(r=U.commerceDiscoveryCompanionSchema(n.id,o),e[4]=o,e[5]=n.id,e[6]=r):r=e[6];let d;e[7]!==l?(d=async()=>{const v=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return D(v)},e[7]=l,e[8]=d):d=e[8];let m;e[9]!==r||e[10]!==d?(m={queryKey:r,queryFn:d},e[9]=r,e[10]=d,e[11]=m):m=e[11];const g=oe(m),u=ot(g.data?.stateSchema??{properties:{}}),p=u.map(xt),h=u.map(ht).filter(gt),f=u.filter(pt).map(ft),x=[...h,...f].sort().join(",");let y;e[12]!==o||e[13]!==n.id?(y=U.commerceDiscoveryConnection(n.id,o),e[12]=o,e[13]=n.id,e[14]=y):y=e[14];let C;e[15]!==o||e[16]!==t?(C=async()=>{const v=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return D(v)},e[15]=o,e[16]=t,e[17]=C):C=e[17];let a;e[18]!==y||e[19]!==C?(a={queryKey:y,queryFn:C},e[18]=y,e[19]=C,e[20]=a):a=e[20];const b=oe(a),j=oe({queryKey:U.commerceDiscoveryCompanionConnections(n.id),enabled:u.length>0,queryFn:async()=>{const v=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:[{field:["app_name"],operator:"in",value:p},{field:["app_id"],operator:"in",value:h}]},limit:1e3}});return D(v)}}),_=oe({queryKey:U.commerceDiscoveryCompanionRegistry(n.id,x),enabled:u.length>0,queryFn:async()=>{const v=rt(h,f),M=await Ye(Re.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...v?{where:v}:{},limit:1e3});return D(M)}}),E={},T={};for(const v of _.data?.items??[])E[v.id]=v,v.server?.name&&(T[v.server.name]=v);const R=mt({requirements:u,itemsById:E,itemsByName:T,connections:j.data?.items??[],configurationState:b.data?.item?.configuration_state??null,curated:je}),N=g.isPending||b.isPending||u.length>0&&(j.isPending||_.isPending),P=g.error??b.error??j.error??_.error??null;let z;return e[21]!==R||e[22]!==P||e[23]!==N?(z={cards:R,isLoading:N,error:P},e[21]=R,e[22]=P,e[23]=N,e[24]=z):z=e[24],z}function ft(i){return i.bindingType}function pt(i){return!je[i.bindingType]}function gt(i){return!!i}function ht(i){return je[i.bindingType]?.registryAppId}function xt(i){return i.bindingType}function yt({selfClient:i,org:e,userId:t,cdConnectionId:n}){const o=Ue(),[c,l]=O.useState(null),[r,d]=O.useState(null),m=async(u,p)=>{const h=await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:u,data:p}});return D(h)};async function g(u){l(u.fieldKey),d(null);try{let p=u.candidateConnectionId;if(!p){const a=Ve(u.registryItem,e.id,t,{remoteIndex:0}),b=a.connection_type==="STDIO",j=!!a.connection_url,_=b&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!j&&!_){d(`${u.title} cannot be connected: no connection method available`);return}const E=await i.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:a}});p=D(E).item.id}const h=p,f=await Ze({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:a=>m(h,{connection_token:a}).then(()=>{})});if(!f.ok){d(`Couldn't sign in to ${u.title}: ${f.error}`);return}const x=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),y=D(x).item?.configuration_state??null,C=lt(y,u.fieldKey,u.bindingType,h);await m(n,{configuration_state:C}),await o.invalidateQueries({queryKey:U.commerceDiscoveryConnection(e.id,n)}),await o.invalidateQueries({queryKey:U.commerceDiscoveryCompanionConnections(e.id)})}catch(p){d(p instanceof Error?p.message:String(p))}finally{l(null)}}return{connect:g,connectingFieldKey:c,error:r}}function Ct(i){const e=I.c(30),{org:t,cdConnectionId:n,reportDisabled:o,onOpenReport:c}=i,{data:l}=Ne.useSession(),r=l?.user?.id??"";let d;e[0]!==t.id||e[1]!==t.slug?(d={connectionId:Oe,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=d):d=e[2];const m=be(d);let g;e[3]!==n||e[4]!==t||e[5]!==m?(g={selfClient:m,org:t,cdConnectionId:n},e[3]=n,e[4]=t,e[5]=m,e[6]=g):g=e[6];const{cards:u,isLoading:p,error:h}=ut(g);let f;e[7]!==n||e[8]!==t||e[9]!==m||e[10]!==r?(f={selfClient:m,org:t,userId:r,cdConnectionId:n},e[7]=n,e[8]=t,e[9]=m,e[10]=r,e[11]=f):f=e[11];const{connect:x,connectingFieldKey:y,error:C}=yt(f);let a;e[12]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(we,{size:16}),e[12]=a):a=e[12];let b;e[13]!==c||e[14]!==o?(b=s.jsxs(Y,{type:"button",size:"xl",className:"w-full",onClick:c,disabled:o,children:["See full report",a]}),e[13]=c,e[14]=o,e[15]=b):b=e[15];const j=b;if(!p&&!h&&u.length===0){let N;return e[16]!==j?(N=s.jsx("div",{className:"flex min-h-0 flex-1 flex-col justify-end gap-10 md:grid md:flex-none",children:j}),e[16]=j,e[17]=N):N=e[17],N}const _=y!==null;let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),s.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),e[18]=E):E=e[18];let T;e[19]!==_||e[20]!==u||e[21]!==x||e[22]!==C||e[23]!==y||e[24]!==h||e[25]!==p?(T=h?s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[s.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?s.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[0,1,2].map(bt)}):s.jsx(xe,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[45vh] md:flex-none",children:s.jsxs("div",{className:"grid gap-4",children:[C&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C}),u.map(N=>s.jsx(st,{card:N,connecting:y===N.fieldKey,disabled:_&&y!==N.fieldKey,onConnect:()=>{x(N)}},N.fieldKey))]})}),e[19]=_,e[20]=u,e[21]=x,e[22]=C,e[23]=y,e[24]=h,e[25]=p,e[26]=T):T=e[26];let R;return e[27]!==j||e[28]!==T?(R=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none",children:[E,T,j]}),e[27]=j,e[28]=T,e[29]=R):R=e[29],R}function bt(i){return s.jsx(nt,{},i)}function ze(i){const e=I.c(10),{host:t}=i,n=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,c,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=c,e[2]=l):(o=e[0],c=e[1],l=e[2]);let r;e[3]!==n?(r=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=r):r=e[4];let d;e[5]!==t?(d=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=s.jsxs("div",{className:"flex items-center gap-3",children:[o,c,l,r,d]}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Pn(){const i=I.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vt,{}),i[0]=e):e=i[0],e}const Le=O.createContext(null),Pe=()=>O.useContext(Le);function jt(i){if(!i)return null;const e=he(i);return e.ok?new URL(e.value).hostname:null}function vt(){const i=I.c(9);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},i[0]=e):e=i[0];const t=Ae(e),{org:n,siteUrl:o}=t;let c;i[1]!==o?(c=jt(o),i[1]=o,i[2]=c):c=i[2];const l=c;let r;i[3]!==n||i[4]!==o?(r=s.jsx(St,{requestedOrgSlug:n,siteUrl:o}),i[3]=n,i[4]=o,i[5]=r):r=i[5];let d;return i[6]!==l||i[7]!==r?(d=s.jsx(Le.Provider,{value:l,children:r}),i[6]=l,i[7]=r,i[8]=d):d=i[8],d}function St(i){const e=I.c(8),{requestedOrgSlug:t,siteUrl:n}=i,{data:o,isPending:c}=Ne.useSession(),l=Pe();if(c){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(A,{children:s.jsx(V,{label:"Preparing commerce onboarding..."})}),e[0]=d):d=e[0],d}if(!o){const d=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==l?(m=l?s.jsx(ze,{host:l}):void 0,e[1]=l,e[2]=m):m=e[2];let g;return e[3]!==m?(g=s.jsx(A,{children:s.jsx(qe,{callbackUrl:d,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:m})}),e[3]=m,e[4]=g):g=e[4],g}let r;return e[5]!==t||e[6]!==n?(r=s.jsx(_t,{requestedOrgSlug:t,siteUrl:n}),e[5]=t,e[6]=n,e[7]=r):r=e[7],r}function _t(i){const e=I.c(40),{requestedOrgSlug:t,siteUrl:n}=i,o=Ie(),c=$e(),[l,r]=O.useState(null),[d,m]=O.useState(null),g=c.data?.map(It)??[];let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={mutationFn:Nt,retry:!1,onSuccess:a=>{m(a)}},e[0]=u):u=e[0];const p=Te(u);if(c.isPending){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(A,{children:s.jsx(V,{label:"Preparing commerce onboarding..."})}),e[1]=a):a=e[1],a}if(c.error){let a;return e[2]!==c?(a=s.jsx(le,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=a):a=e[3],a}const h=t?g.find(a=>a.slug===t):null;if(h){let a;return e[4]!==h||e[5]!==n?(a=s.jsx(re,{org:h,initialSiteUrl:n}),e[4]=h,e[5]=n,e[6]=a):a=e[6],a}if(t){let a;return e[7]!==c?(a=s.jsx(le,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=a):a=e[8],a}if(l){let a;return e[9]!==l||e[10]!==n?(a=s.jsx(re,{org:l,initialSiteUrl:n}),e[9]=l,e[10]=n,e[11]=a):a=e[11],a}if(g.length===1&&g[0]){let a;return e[12]!==g[0]||e[13]!==n?(a=s.jsx(re,{org:g[0],initialSiteUrl:n}),e[12]=g[0],e[13]=n,e[14]=a):a=e[14],a}if(g.length>1){let a;e[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=a):a=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=_=>r(_),e[16]=b):b=e[16];let j;return e[17]!==g?(j=s.jsx(A,{children:s.jsxs("div",{className:"grid gap-10",children:[a,s.jsx(xe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(_e,{organizations:g,selectLabel:"Continue",onSelected:b})})]})}),e[17]=g,e[18]=j):j=e[18],j}if(!d){let a;e[19]!==p?(a=()=>{p.reset(),p.mutate()},e[19]=p,e[20]=a):a=e[20];let b;return e[21]!==p||e[22]!==a?(b=s.jsx(Tt,{mutation:p,onRetry:a}),e[21]=p,e[22]=a,e[23]=b):b=e[23],b}const f=d;if(f?.success&&(f.status==="created"||f.status==="joined"||f.status==="already_has_organization")&&f.organization){let a;return e[24]!==f.organization||e[25]!==n?(a=s.jsx(re,{org:f.organization,initialSiteUrl:n}),e[24]=f.organization,e[25]=n,e[26]=a):a=e[26],a}if(f?.status==="ambiguous"&&f.organizations&&f.organizations.length>0){let a;e[27]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=a):a=e[27];const b=f.domain??void 0;let j;e[28]!==o||e[29]!==n?(j=(E,T)=>{Ee(),r({...E,slug:T}),o({to:"/commerce-onboarding",search:{org:T,siteUrl:n}})},e[28]=o,e[29]=n,e[30]=j):j=e[30];let _;return e[31]!==f.organizations||e[32]!==b||e[33]!==j?(_=s.jsx(A,{children:s.jsxs("div",{className:"grid gap-10",children:[a,s.jsx(xe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(_e,{organizations:f.organizations,domain:b,onJoined:j})})]})}),e[31]=f.organizations,e[32]=b,e[33]=j,e[34]=_):_=e[34],_}const x=f?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==p?(y=()=>{m(null),p.reset()},e[35]=p,e[36]=y):y=e[36];let C;return e[37]!==x||e[38]!==y?(C=s.jsx(le,{title:"Commerce onboarding needs support",description:x,actionLabel:"Try again",onRetry:y}),e[37]=x,e[38]=y,e[39]=C):C=e[39],C}async function Nt(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Ee(),e}function It(i){return{id:i.id,name:i.name,slug:i.slug,logo:i.logo??null}}function Tt(i){const e=I.c(7),{mutation:t,onRetry:n}=i,o=O.useRef(!1);let c;e[0]!==t?(c=m=>{!m||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=c):c=e[1];const l=c;if(t.error){let m;return e[2]!==n?(m=s.jsx(le,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:n}),e[2]=n,e[3]=m):m=e[3],m}let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(V,{label:"Preparing your commerce workspace..."}),e[4]=r):r=e[4];let d;return e[5]!==l?(d=s.jsx(A,{children:s.jsx("div",{ref:l,children:r})}),e[5]=l,e[6]=d):d=e[6],d}function $(i){const e=I.c(8),{title:t,description:n}=i,o=Pe();let c;e[0]!==o?(c=o?s.jsx(ze,{host:o}):s.jsxs("div",{children:[s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=c):c=e[1];let l;e[2]!==n||e[3]!==t?(l=(t||n)&&s.jsxs("div",{className:"space-y-2",children:[t&&s.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),n&&s.jsx("p",{className:"text-base text-muted-foreground leading-6",children:n})]}),e[2]=n,e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==c||e[6]!==l?(r=s.jsxs("div",{className:"grid gap-10",children:[c,l]}),e[5]=c,e[6]=l,e[7]=r):r=e[7],r}function V(i){const e=I.c(3),{label:t}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ce,{size:14,className:"animate-spin text-muted-foreground"}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsxs("div",{className:"flex items-center gap-2 py-4",role:"status","aria-live":"polite",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function le(i){const e=I.c(9),{title:t,description:n,actionLabel:o,onRetry:c}=i;let l;e[0]!==n||e[1]!==t?(l=s.jsx($,{title:t,description:n}),e[0]=n,e[1]=t,e[2]=l):l=e[2];let r;e[3]!==o||e[4]!==c?(r=s.jsx(Y,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5];let d;return e[6]!==l||e[7]!==r?(d=s.jsx(A,{children:s.jsxs("div",{className:"grid gap-10",children:[l,r]})}),e[6]=l,e[7]=r,e[8]=d):d=e[8],d}function Et(i){return i.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function pe(i){const e=i;if(e.isError)throw new Error(Et(e));return e.structuredContent??i}function re(i){const e=I.c(3),{org:t,initialSiteUrl:n}=i;let o;return e[0]!==n||e[1]!==t?(o=s.jsx(A,{children:s.jsx(De,{children:c=>{const{reset:l}=c;return s.jsx(Me,{fallback:r=>{const{error:d,resetError:m}=r;return s.jsx(Rt,{orgName:t.name,message:d instanceof Error?d.message:"We could not check Commerce Discovery setup.",onRetry:()=>{l(),m()}})},children:s.jsx(O.Suspense,{fallback:s.jsx(V,{label:"Connecting workspace..."}),children:s.jsx(Ot,{org:t,initialSiteUrl:n},`${t.id}:${n??""}`)})})}})}),e[0]=n,e[1]=t,e[2]=o):o=e[2],o}function Rt(i){const e=I.c(10),{orgName:t,message:n,onRetry:o}=i,c=`Commerce setup will continue for ${t}.`;let l;e[0]!==c?(l=s.jsx($,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=l):l=e[1];let r;e[2]!==n?(r=s.jsx(ae,{message:n}),e[2]=n,e[3]=r):r=e[3];let d;e[4]!==o?(d=s.jsx(Y,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=d):d=e[5];let m;return e[6]!==l||e[7]!==r||e[8]!==d?(m=s.jsxs("div",{className:"grid gap-10",children:[l,r,d]}),e[6]=l,e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Ot(i){const e=I.c(83),{org:t,initialSiteUrl:n}=i,o=Ie();let c;e[0]!==t.id||e[1]!==t.slug?(c={connectionId:Oe,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const l=be(c),[r,d]=O.useState(n??""),[m,g]=O.useState(null),[u,p]=O.useState(null),h=O.useRef(!1),f=Re.COMMERCE_DISCOVERY(t.id),x=Be(t.id),y=U.commerceDiscoveryConnection(t.id,f);let C;e[3]!==f||e[4]!==l?(C=async()=>{const S=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:f}});return pe(S)},e[3]=f,e[4]=l,e[5]=C):C=e[5];let a;e[6]!==y||e[7]!==C?(a={queryKey:y,queryFn:C,retry:!1},e[6]=y,e[7]=C,e[8]=a):a=e[8];const b=Se(a),j=U.commerceDiscoveryVirtualMcp(t.id,x);let _;e[9]!==l||e[10]!==x?(_=async()=>{const S=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return pe(S)},e[9]=l,e[10]=x,e[11]=_):_=e[11];let E;e[12]!==j||e[13]!==_?(E={queryKey:j,queryFn:_,retry:!1},e[12]=j,e[13]=_,e[14]=E):E=e[14];const T=Se(E);let R;e[15]!==l?(R=async S=>{const k=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:S}});return pe(k)},e[15]=l,e[16]=R):R=e[16];let N;e[17]!==b||e[18]!==T?(N=S=>{g(S),p(null),b.refetch(),T.refetch()},e[17]=b,e[18]=T,e[19]=N):N=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=S=>{p(S instanceof Error?S.message:"Commerce Discovery setup failed.")},e[20]=P):P=e[20];let z;e[21]!==R||e[22]!==N?(z={mutationFn:R,retry:!1,onSuccess:N,onError:P},e[21]=R,e[22]=N,e[23]=z):z=e[23];const v=Te(z),M=!!b.data.item&&!!T.data.item;let Z;e[24]!==v?(Z=S=>{const k=he(S);if(!k.ok){p(k.error);return}p(null),v.mutate(k.value)},e[24]=v,e[25]=Z):Z=e[25];const K=Z;let J;e[26]!==n||e[27]!==K||e[28]!==M?(J=S=>{!S||h.current||M||!n||(h.current=!0,K(n))},e[26]=n,e[27]=K,e[28]=M,e[29]=J):J=e[29];const ce=J;let X;e[30]!==K||e[31]!==r?(X=S=>{S.preventDefault(),K(r)},e[30]=K,e[31]=r,e[32]=X):X=e[32];const L=X;let ee;e[33]!==f||e[34]!==m?.reportApp||e[35]!==x?(ee=m?.reportApp??{connectionId:f,virtualMcpId:x,toolName:Qe},e[33]=f,e[34]=m?.reportApp,e[35]=x,e[36]=ee):ee=e[36];const w=ee;let te;e[37]!==o||e[38]!==t.slug||e[39]!==w.connectionId||e[40]!==w.toolName||e[41]!==w.virtualMcpId?(te=()=>{localStorage.setItem(Ke.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:w.virtualMcpId,main:He(w.connectionId,w.toolName),chat:0}})},e[37]=o,e[38]=t.slug,e[39]=w.connectionId,e[40]=w.toolName,e[41]=w.virtualMcpId,e[42]=te):te=e[42];const de=te;if(M){let S;return e[43]!==de||e[44]!==t||e[45]!==w?(S=s.jsx(wt,{org:t,reportApp:w,onOpenReport:de}),e[43]=de,e[44]=t,e[45]=w,e[46]=S):S=e[46],S}if(n){let S;e[47]!==n?(S=he(n),e[47]=n,e[48]=S):S=e[48];const k=S;if(!k.ok){const fe=`Commerce setup will continue for ${t.name}.`;let Q;e[49]!==fe?(Q=s.jsx($,{title:"Commerce diagnostics",description:fe}),e[49]=fe,e[50]=Q):Q=e[50];let W;e[51]!==k.error?(W=s.jsx(ae,{message:k.error}),e[51]=k.error,e[52]=W):W=e[52];let G;e[53]!==L||e[54]!==u||e[55]!==v.isPending||e[56]!==r?(G=s.jsx(ge,{siteUrl:r,error:u,isSubmitting:v.isPending,onSiteUrlChange:d,onSubmit:L}),e[53]=L,e[54]=u,e[55]=v.isPending,e[56]=r,e[57]=G):G=e[57];let ie;return e[58]!==Q||e[59]!==W||e[60]!==G?(ie=s.jsxs("div",{className:"grid gap-10",children:[Q,W,G]}),e[58]=Q,e[59]=W,e[60]=G,e[61]=ie):ie=e[61],ie}const ue=`Commerce Discovery is being prepared for ${k.value}.`;let F;e[62]!==ue?(F=s.jsx($,{title:"Commerce diagnostics",description:ue}),e[62]=ue,e[63]=F):F=e[63];let B;e[64]!==L||e[65]!==u||e[66]!==v||e[67]!==r?(B=u?s.jsxs(s.Fragment,{children:[s.jsx(ae,{message:u}),s.jsx(ge,{siteUrl:r,error:null,isSubmitting:v.isPending,onSiteUrlChange:d,onSubmit:L})]}):s.jsx(V,{label:"Setting up Commerce Discovery..."}),e[64]=L,e[65]=u,e[66]=v,e[67]=r,e[68]=B):B=e[68];let se;return e[69]!==F||e[70]!==B||e[71]!==ce?(se=s.jsxs("div",{ref:ce,className:"grid gap-10",children:[F,B]}),e[69]=F,e[70]=B,e[71]=ce,e[72]=se):se=e[72],se}const me=`Commerce setup will continue for ${t.name}.`;let q;e[73]!==me?(q=s.jsx($,{title:"Commerce diagnostics",description:me}),e[73]=me,e[74]=q):q=e[74];let H;e[75]!==L||e[76]!==u||e[77]!==v.isPending||e[78]!==r?(H=s.jsx(ge,{siteUrl:r,error:u,isSubmitting:v.isPending,onSiteUrlChange:d,onSubmit:L}),e[75]=L,e[76]=u,e[77]=v.isPending,e[78]=r,e[79]=H):H=e[79];let ne;return e[80]!==q||e[81]!==H?(ne=s.jsxs("div",{className:"grid gap-10",children:[q,H]}),e[80]=q,e[81]=H,e[82]=ne):ne=e[82],ne}function ge(i){const e=I.c(22),{siteUrl:t,error:n,isSubmitting:o,onSiteUrlChange:c,onSubmit:l}=i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=r):r=e[0];let d;e[1]!==c?(d=y=>c(y.target.value),e[1]=c,e[2]=d):d=e[2];const m=!!n;let g;e[3]!==o||e[4]!==t||e[5]!==d||e[6]!==m?(g=s.jsx(Fe,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:d,placeholder:"https://example.com","aria-invalid":m,disabled:o}),e[3]=o,e[4]=t,e[5]=d,e[6]=m,e[7]=g):g=e[7];let u;e[8]!==n?(u=n?s.jsx(ae,{message:n}):null,e[8]=n,e[9]=u):u=e[9];let p;e[10]!==g||e[11]!==u?(p=s.jsxs("div",{className:"grid gap-2",children:[r,g,u]}),e[10]=g,e[11]=u,e[12]=p):p=e[12];let h;e[13]!==o?(h=o?s.jsxs(s.Fragment,{children:[s.jsx(Ce,{size:14,className:"animate-spin"}),"Setting up"]}):s.jsxs(s.Fragment,{children:["Continue",s.jsx(we,{size:16})]}),e[13]=o,e[14]=h):h=e[14];let f;e[15]!==o||e[16]!==h?(f=s.jsx(Y,{type:"submit",size:"xl",className:"w-full",disabled:o,children:h}),e[15]=o,e[16]=h,e[17]=f):f=e[17];let x;return e[18]!==l||e[19]!==p||e[20]!==f?(x=s.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[p,f]}),e[18]=l,e[19]=p,e[20]=f,e[21]=x):x=e[21],x}function wt(i){const e=I.c(6),{org:t,reportApp:n,onOpenReport:o}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{}),e[0]=c):c=e[0];const l=!n.virtualMcpId;let r;return e[1]!==o||e[2]!==t||e[3]!==n.connectionId||e[4]!==l?(r=s.jsxs("div",{className:"flex h-[calc(100dvh-3rem)] flex-col gap-10 md:grid md:h-auto",children:[c,s.jsx(Ct,{org:t,cdConnectionId:n.connectionId,reportDisabled:l,onOpenReport:o})]}),e[1]=o,e[2]=t,e[3]=n.connectionId,e[4]=l,e[5]=r):r=e[5],r}function ae(i){const e=I.c(2),{message:t}=i;let n;return e[0]!==t?(n=s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=n):n=e[1],n}export{Pn as default};
|