decocms 3.89.0 → 3.89.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BMCh3ayd.js → AlertCircle-flSoo6uw.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CwVMUp5O.js → ArrowUpRight-BeOMO89N.js} +1 -1
- package/dist/client/assets/{CheckCircle-BP2lb3AX.js → CheckCircle-B9ekAAw-.js} +1 -1
- package/dist/client/assets/{ChevronDown-CkcGr2qp.js → ChevronDown-BWfuTI7r.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Cgw9JZYG.js → ChevronLeft-BNcg18cx.js} +1 -1
- package/dist/client/assets/{ChevronRight-DYe9AFXl.js → ChevronRight-ChYOVgWd.js} +1 -1
- package/dist/client/assets/{ChevronUp-CiXD4kQk.js → ChevronUp-BhWz3ylT.js} +1 -1
- package/dist/client/assets/{DotsVertical-Z_h1bSB3.js → DotsVertical-C0YWb9xq.js} +1 -1
- package/dist/client/assets/{Eye-B92Ff4dY.js → Eye-DWTUBTZ_.js} +1 -1
- package/dist/client/assets/{FilterLines-CMHeCbJ1.js → FilterLines-Djqj6uj_.js} +1 -1
- package/dist/client/assets/{Form-GDlYmtQN.js → Form-Czxo_N56.js} +1 -1
- package/dist/client/assets/{Globe01-MZlo2_34.js → Globe01-BgRW2EiE.js} +1 -1
- package/dist/client/assets/{Globe04-BPWbnzx0.js → Globe04-XITcP2mp.js} +1 -1
- package/dist/client/assets/{HardDrive-D8FSpDtM.js → HardDrive-DS3VxDtU.js} +1 -1
- package/dist/client/assets/{Key01-CZVV-ceU.js → Key01-DX7L8s0Z.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CuTI_WR9.js → LayoutLeft-BqtFvEWV.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DekFjc9P.js → LinkExternal01-Cf-6A1_h.js} +1 -1
- package/dist/client/assets/{Monitor01-BxGhRsUq.js → Monitor01-CZ30bS8J.js} +1 -1
- package/dist/client/assets/{Palette-BDlA8RUr.js → Palette-Dy2dQgqx.js} +1 -1
- package/dist/client/assets/{Play-BGGUeSDd.js → Play-DvFnuZIO.js} +1 -1
- package/dist/client/assets/{Plus-CQOl41pg.js → Plus-jFajoMCA.js} +1 -1
- package/dist/client/assets/{SearchMd-Da504yGV.js → SearchMd-uzKFlzQB.js} +1 -1
- package/dist/client/assets/{Settings02-ozrzAwut.js → Settings02-47eDNk4K.js} +1 -1
- package/dist/client/assets/{Shield01-CYPtC_lA.js → Shield01-BgRa80OR.js} +1 -1
- package/dist/client/assets/{Star01-BoZIiKCL.js → Star01-BrkbxV-A.js} +1 -1
- package/dist/client/assets/{Stars01-BJuGXG_N.js → Stars01-Daq_eW6a.js} +1 -1
- package/dist/client/assets/{Stars02-C4CXFnp9.js → Stars02-DlImJz_z.js} +1 -1
- package/dist/client/assets/{Sun-2eUdoD8j.js → Sun-9FxiCes3.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DXdcIz27.js → SwitchHorizontal01-CB5mOBIf.js} +1 -1
- package/dist/client/assets/{Tool01-WsqNh4er.js → Tool01-rx0lKYM8.js} +1 -1
- package/dist/client/assets/{Trash01-z6De146C.js → Trash01-DI7qV1ow.js} +1 -1
- package/dist/client/assets/{Upload01-C4sYhZ0M.js → Upload01-Boqk1hvA.js} +1 -1
- package/dist/client/assets/{User01-Cvp121NC.js → User01-B3UbdHmL.js} +1 -1
- package/dist/client/assets/{Users01-DcrlsWI1.js → Users01-BUyczaeV.js} +1 -1
- package/dist/client/assets/{Users03-CJuVy8Iz.js → Users03-gvBLUtvG.js} +1 -1
- package/dist/client/assets/{X-DgKWdqZ1.js → X-B-cRV-7d.js} +1 -1
- package/dist/client/assets/{XCircle-DFBcUexW.js → XCircle-CkhBWURn.js} +1 -1
- package/dist/client/assets/{XClose-BKWXOZkj.js → XClose-Doj89HqF.js} +1 -1
- package/dist/client/assets/{Zap-Cxu6aoRs.js → Zap-BCqTHl-x.js} +1 -1
- package/dist/client/assets/{ZapSquare-DOK7F1oe.js → ZapSquare-DdgE8vy-.js} +1 -1
- package/dist/client/assets/{ZoomOut-ryBmf3S4.js → ZoomOut-BdBjpsIq.js} +1 -1
- package/dist/client/assets/{access-gate-DvuwS2Bs.js → access-gate-BXDE0rsJ.js} +1 -1
- package/dist/client/assets/{add-section-modal-CEyStjwy.js → add-section-modal-7a6BUncs.js} +1 -1
- package/dist/client/assets/{agent-icon-pz8iT5cD.js → agent-icon-C6bJxQ04.js} +1 -1
- package/dist/client/assets/agents-list-sjsqj6Ot.js +1 -0
- package/dist/client/assets/ai-providers-6xIkfdtm.js +1 -0
- package/dist/client/assets/{alert-BwNlkWBE.js → alert-C81LnOX9.js} +1 -1
- package/dist/client/assets/{alert-dialog-CkCCiKt9.js → alert-dialog-HmiP05XU.js} +1 -1
- package/dist/client/assets/app-editor-k7Nl_uKp.js +1 -0
- package/dist/client/assets/{auth-xlfJjVrK.js → auth-B9Q1UUsp.js} +1 -1
- package/dist/client/assets/{auth-catchall-HTDRVC4_.js → auth-catchall-ClOrr_P8.js} +1 -1
- package/dist/client/assets/{auth-entry-BNYZmdvo.js → auth-entry-B7DIloAw.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DuCP9Fwl.js → auth-split-layout-dWTaQKch.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DPn6Vk96.js → authenticate-and-persist-oauth-xCkDryiA.js} +1 -1
- package/dist/client/assets/{automation-list-row-CCZ8TAPg.js → automation-list-row-CLUMzxuG.js} +1 -1
- package/dist/client/assets/{automation-runs-DBQv8Uvp.js → automation-runs-DxPUfxy1.js} +1 -1
- package/dist/client/assets/automations-TTHh4EuE.js +1 -0
- package/dist/client/assets/{avatar-Bh53txVX.js → avatar-oAcdiJ9v.js} +1 -1
- package/dist/client/assets/{badge-CdirlPdy.js → badge-CpKEkIGn.js} +1 -1
- package/dist/client/assets/{block-document-D978uGtK.js → block-document-BVHsyU-9.js} +1 -1
- package/dist/client/assets/brand-context-CwjLKTtp.js +1 -0
- package/dist/client/assets/buckets-CM0nkgpJ.js +1 -0
- package/dist/client/assets/{capability-load-error-DgQyDsKl.js → capability-load-error-CG-hWPTN.js} +1 -1
- package/dist/client/assets/{card-D_tApM0k.js → card-BIwENur_.js} +1 -1
- package/dist/client/assets/category-editor-Bx9oTK3B.js +1 -0
- package/dist/client/assets/{chat-context-Dz9rhizY.js → chat-context-DN0_9Gee.js} +1 -1
- package/dist/client/assets/{checkbox-OtNKSART.js → checkbox-Bi39v4Qa.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BsGnTz93.js → cli-auth-success-pdfiwdy1.js} +1 -1
- package/dist/client/assets/collection-detail-BcWtgoUr.js +1 -0
- package/dist/client/assets/{collection-display-button-BgYBCk8T.js → collection-display-button-Bzf7YHNy.js} +1 -1
- package/dist/client/assets/{collection-search-JfLpXbmD.js → collection-search-DbQr2iji.js} +1 -1
- package/dist/client/assets/{collection-tabs-B5YA_dM5.js → collection-tabs-D77_So6e.js} +1 -1
- package/dist/client/assets/command-DyJgh8wP.js +1 -0
- package/dist/client/assets/commerce-onboarding-CJHzpHob.js +1 -0
- package/dist/client/assets/connect-desktop-dialog-ByWaevjw.js +1 -0
- package/dist/client/assets/{connection-card--7NnoNLM.js → connection-card-DehsL0Sf.js} +1 -1
- package/dist/client/assets/connection-detail-CCaFPgvC.js +1 -0
- package/dist/client/assets/{connection-form-helpers-BW7AB-E3.js → connection-form-helpers-CASdXQaW.js} +1 -1
- package/dist/client/assets/connections-DZYmLj7X.js +1 -0
- package/dist/client/assets/{context-menu-3RQyDKF5.js → context-menu-Bt-E5y3C.js} +1 -1
- package/dist/client/assets/{decopilot-CiHv6XGE.js → decopilot-BXlT8NLf.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DXv2T192.js → decopilot-sse-pool-CKTJhrtc.js} +1 -1
- package/dist/client/assets/{dialog-BFjL_my-.js → dialog-BLvz2lK8.js} +1 -1
- package/dist/client/assets/{domain-settings-CuN5wwNc.js → domain-settings-ed9WclHg.js} +1 -1
- package/dist/client/assets/{drawer-DZMXZPMN.js → drawer-C4RJ4_GY.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B1DaP6vk.js → dropdown-menu-CRyIPZil.js} +1 -1
- package/dist/client/assets/{empty-state-Lmcbk0Zv.js → empty-state-CmZpGujH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bau_aQvM.js → extract-connection-data-iACc8UZO.js} +1 -1
- package/dist/client/assets/file-explorer-BveBp463.js +2 -0
- package/dist/client/assets/{file-type-icon-CWgZWEkL.js → file-type-icon-Db262N7w.js} +1 -1
- package/dist/client/assets/{files-C6shWZY2.js → files-BwDocccC.js} +1 -1
- package/dist/client/assets/{form-B6Nf7hvD.js → form-CPJbrMq5.js} +1 -1
- package/dist/client/assets/general-FW5Wth3b.js +1 -0
- package/dist/client/assets/{github-repo-picker-CThHTj5h.js → github-repo-picker-Db_ehY6e.js} +1 -1
- package/dist/client/assets/{hooks-CFfc1t5D.js → hooks-chgqRyLj.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DnC_H8Us.js → import-from-deco-dialog-Nrpq_g30.js} +1 -1
- package/dist/client/assets/{index-C2QgbLxn.js → index-1ECwD4fs.js} +12 -12
- package/dist/client/assets/{index-CjtDPqlj.js → index-4GXqE9fp.js} +2 -2
- package/dist/client/assets/{index-CurNB2HG.js → index-BkSIY6JJ.js} +3 -3
- package/dist/client/assets/index-D5RW_4sI.js +1 -0
- package/dist/client/assets/{index-BVXtRunj.js → index-D7a1JQHt.js} +2 -2
- package/dist/client/assets/{index-ovnDLwrg.js → index-DAWoaMpc.js} +1 -1
- package/dist/client/assets/{index-BDyN-RAN.js → index-DAmj773w.js} +1 -1
- package/dist/client/assets/{index-BK0DpA7w.js → index-DC36sAC_.js} +2 -2
- package/dist/client/assets/{index-ZANilAX7.js → index-DFNABgCe.js} +1 -1
- package/dist/client/assets/index-DoculpR5.js +1 -0
- package/dist/client/assets/{index-C0_iRWcE.js → index-K-17SMjl.js} +1 -1
- package/dist/client/assets/{index-C_XJPG8Z.js → index-QdluHxPe.js} +1 -1
- package/dist/client/assets/{index-qZ5-LmpP.js → index-RkQpccOp.js} +1 -1
- package/dist/client/assets/index-UgEhsCuR.js +1 -0
- package/dist/client/assets/{index-BzszuDGF.css → index-rS_HhTdz.css} +1 -1
- package/dist/client/assets/{index-redirect-Cc9Y9Kn-.js → index-redirect-DO0D1qdv.js} +1 -1
- package/dist/client/assets/{input-RRjvrcUF.js → input-jkT1z5r1.js} +1 -1
- package/dist/client/assets/{integration-icon-Dpj2NSXY.js → integration-icon-CZDEviNI.js} +1 -1
- package/dist/client/assets/{label-DrXdAtn0.js → label-CETsHBZ0.js} +1 -1
- package/dist/client/assets/{login-CdGM36BM.js → login-eY2xl_Qt.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B5dnAc7V.js → mcp-oauth-BIBzZgcE.js} +1 -1
- package/dist/client/assets/{members-C-wG0rnC.js → members-BAHTTEXJ.js} +2 -2
- package/dist/client/assets/{monaco-editor-zMbhl8rq.js → monaco-editor-tVsx1Jkl.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BnDnFbz0.js → monitoring-stats-row-CivwdnUP.js} +1 -1
- package/dist/client/assets/{oauth-callback-Dkf89E49.js → oauth-callback-BnrL3BsC.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BzTdkWaI.js → oauth-callback-ai-provider-D3_UsvKg.js} +1 -1
- package/dist/client/assets/{onboarding-CK9ke2oh.js → onboarding-Cde-ZfY9.js} +1 -1
- package/dist/client/assets/{org-install-CyaR-8_i.js → org-install-Cri2HTyv.js} +1 -1
- package/dist/client/assets/{org-layout-BDwAg4pd.js → org-layout-DH1oGgfN.js} +1 -1
- package/dist/client/assets/{organization-choice-BcGxKG4I.js → organization-choice-BZIXFBHd.js} +1 -1
- package/dist/client/assets/{page-seo-form-CvCtyrxH.js → page-seo-form-DCgyqE3q.js} +1 -1
- package/dist/client/assets/page-seo-sheet-o3dCAhA-.js +1 -0
- package/dist/client/assets/{popover-D7BamlkK.js → popover-1pFpRX6s.js} +1 -1
- package/dist/client/assets/post-editor-CWr-_gb_.js +1 -0
- package/dist/client/assets/{preview-dialog-C9Rx0Dtg.js → preview-dialog-DRmrGWbh.js} +1 -1
- package/dist/client/assets/{primitives-BmW50XTY.js → primitives-C06Pn9p4.js} +1 -1
- package/dist/client/assets/profile-62y90jm_.js +1 -0
- package/dist/client/assets/project-app-view-BeZFUwcQ.js +1 -0
- package/dist/client/assets/record-editor-BsdzrkRD.js +1 -0
- package/dist/client/assets/registry-DpNbpkzg.js +2 -0
- package/dist/client/assets/{registry-layout-D86NULga.js → registry-layout-Dww7dssY.js} +2 -2
- package/dist/client/assets/{require-capability-CBJ6cwe3.js → require-capability-BC8YsasG.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Be__d9RH.js → required-auth-layout-DjRtF3m8.js} +1 -1
- package/dist/client/assets/{reset-password-CFeeThio.js → reset-password-DNWeSy4_.js} +1 -1
- package/dist/client/assets/roles-Cyz3Z1vr.js +1 -0
- package/dist/client/assets/{save-status-C9pT75mA.js → save-status-BsQDaUlP.js} +1 -1
- package/dist/client/assets/{scroll-area-CbWYdgRA.js → scroll-area-D51A_KQ5.js} +1 -1
- package/dist/client/assets/{search-input-CeqwXCv0.js → search-input-CEqRaXj6.js} +1 -1
- package/dist/client/assets/secrets-C6bKEzDN.js +1 -0
- package/dist/client/assets/{sections-editor-uxePiNCk.js → sections-editor-331tz7B6.js} +2 -2
- package/dist/client/assets/{select-BePf1IJF.js → select-Ct-_FhWe.js} +1 -1
- package/dist/client/assets/select-model-DJ7vH3M2.js +1 -0
- package/dist/client/assets/seo-editor-Ad8X__jc.js +1 -0
- package/dist/client/assets/settings-layout-CSyEHpma.js +1 -0
- package/dist/client/assets/{settings-section-ELYurXQx.js → settings-section-D6f1v8Lb.js} +1 -1
- package/dist/client/assets/{sheet-Djk8ol5s.js → sheet-CUfjkNRy.js} +1 -1
- package/dist/client/assets/{shell-controls-CqOBDieU.js → shell-controls-C6FYdYnB.js} +1 -1
- package/dist/client/assets/{shell-layout-BkVrkYmb.js → shell-layout-CR4YIb2n.js} +1 -1
- package/dist/client/assets/{shell-route-loading-gKBpXu2h.js → shell-route-loading-fK7OWXny.js} +1 -1
- package/dist/client/assets/sidebar-C45GjVmp.js +1 -0
- package/dist/client/assets/{skeleton-DrM35KBr.js → skeleton-h95MLET_.js} +1 -1
- package/dist/client/assets/{sortable.esm-BN6bAoSL.js → sortable.esm-CbeYFn14.js} +2 -2
- package/dist/client/assets/sso-DGooE6a8.js +1 -0
- package/dist/client/assets/store-O5BcQA2t.js +1 -0
- package/dist/client/assets/store-registry-BPQHh-y5.js +2 -0
- package/dist/client/assets/{studio-tools-BvQ8Bli1.js → studio-tools-BgUSKeCY.js} +1 -1
- package/dist/client/assets/{switch-dEe0am9a.js → switch-Cf_WUos9.js} +1 -1
- package/dist/client/assets/{table-D_zHkpnq.js → table-tHeeUiY0.js} +1 -1
- package/dist/client/assets/{tabs-DOJ7e6Z7.js → tabs-CNnqe_sK.js} +1 -1
- package/dist/client/assets/{task-status-DLHF9SZS.js → task-status-DzLkYYrk.js} +1 -1
- package/dist/client/assets/{textarea-C7j7_npp.js → textarea-BzYVaGJ0.js} +1 -1
- package/dist/client/assets/{toggle-group-CSO_yZKm.js → toggle-group-BE1kDwdz.js} +1 -1
- package/dist/client/assets/{toolbar-D9CfLhAB.js → toolbar-D5FkjLVB.js} +1 -1
- package/dist/client/assets/{tools-list-DC6csFT2.js → tools-list-BKN97Z6h.js} +1 -1
- package/dist/client/assets/tooltip-CAEDbADy.js +1 -0
- package/dist/client/assets/{types-CDn4NSje.js → types-Dw2dcWcn.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D-XhQ6_q.js → use-ai-providers-BcLob6tS.js} +1 -1
- package/dist/client/assets/{use-automations-BllXXW29.js → use-automations-CfP4AmpB.js} +1 -1
- package/dist/client/assets/{use-capability-DfdnXTfH.js → use-capability-CbeJheXW.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DmUrmEeM.js → use-clock-tick-DHvuEFIJ.js} +1 -1
- package/dist/client/assets/{use-collections-w44ZyJ1t.js → use-collections-yHRKnSEt.js} +1 -1
- package/dist/client/assets/{use-connection-Cvfufzsw.js → use-connection-BPcAXa47.js} +1 -1
- package/dist/client/assets/{use-copy-BWQBaWRC.js → use-copy-DOTEBoID.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CGofqNOQ.js → use-create-virtual-mcp-C88JBuQM.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CaTQp8tz.js → use-debounced-autosave-BnfFXRc0.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CNA7qawq.js → use-delete-connection-D1yU7B0G.js} +1 -1
- package/dist/client/assets/{use-file-configs-Bg9S5WW4.js → use-file-configs-C8z3zSDD.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BlkXRVRw.js → use-infinite-scroll-V4l3DQJD.js} +1 -1
- package/dist/client/assets/{use-join-requests-ByqDno7o.js → use-join-requests-Duz0LeuZ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BbOUwA1H.js → use-mcp-client-DYpZuPPA.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Y5le4syR.js → use-mcp-prompts-BxOgLeZF.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-xGr1pN0n.js → use-mcp-tools-xhV-ENX5.js} +1 -1
- package/dist/client/assets/{use-members-blURElyD.js → use-members-CJKZdynB.js} +1 -1
- package/dist/client/assets/use-mobile-CPyq18pe.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-CidcWwFC.js → use-navigate-to-agent-Bhu6dr_a.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-oMz0ubhe.js → use-org-auth-client-Tiq6Yt9b.js} +1 -1
- package/dist/client/assets/{use-org-sso-CIoYIaj1.js → use-org-sso-DGBv3Hvc.js} +1 -1
- package/dist/client/assets/{use-organization-roles-tA96x-8d.js → use-organization-roles-1exN43Rd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B5L78CqV.js → use-organization-settings-DFnXSR7Z.js} +1 -1
- package/dist/client/assets/{use-registry-connections-3CHe_VwJ.js → use-registry-connections-Czx1u2H6.js} +1 -1
- package/dist/client/assets/{use-secrets-DlUSWVTu.js → use-secrets-DqgJI3yC.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bbu_XWuO.js → use-status-sounds-DRhhwMt0.js} +1 -1
- package/dist/client/assets/use-view-mode-BB9Jcv_5.js +1 -0
- package/dist/client/assets/{use-virtual-mcp-CLJ6qnG1.js → use-virtual-mcp-DnY7c9gE.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DlRMWoIP.js +1 -0
- package/dist/client/assets/{useQueries-BqFctUi9.js → useQueries-D96G2W1b.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BjlxN-DZ.js +1 -0
- package/dist/client/assets/variant-calendar-BlIkgRxn.js +1 -0
- package/dist/client/assets/{view-mode-toggle-CIiu6iGh.js → view-mode-toggle-ncGR_sPB.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agents-list-C2TIIavL.js +0 -1
- package/dist/client/assets/ai-providers-bb2flxno.js +0 -1
- package/dist/client/assets/app-editor-mcTFLJlr.js +0 -1
- package/dist/client/assets/automations-D1p0mjNs.js +0 -1
- package/dist/client/assets/brand-context-Ds48Bazs.js +0 -1
- package/dist/client/assets/buckets-C6_Hhy5c.js +0 -1
- package/dist/client/assets/category-editor-DMZmSuPk.js +0 -1
- package/dist/client/assets/collection-detail-8pBdQXs6.js +0 -1
- package/dist/client/assets/command-iFNWkWs6.js +0 -1
- package/dist/client/assets/commerce-onboarding-CjPSY7Rg.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-BxJ3X8re.js +0 -1
- package/dist/client/assets/connection-detail-Bak6_MXj.js +0 -1
- package/dist/client/assets/connections-MxbhAMWj.js +0 -1
- package/dist/client/assets/file-explorer-CdToudqs.js +0 -2
- package/dist/client/assets/general-BRjdlS0B.js +0 -1
- package/dist/client/assets/index-BtmyrH9L.js +0 -1
- package/dist/client/assets/index-DqUFDG_W.js +0 -1
- package/dist/client/assets/index-EwbYDv-_.js +0 -1
- package/dist/client/assets/page-seo-sheet-lBchETUb.js +0 -1
- package/dist/client/assets/post-editor-CJXGoikN.js +0 -1
- package/dist/client/assets/profile-CzQbXboe.js +0 -1
- package/dist/client/assets/project-app-view-CMzykg6f.js +0 -1
- package/dist/client/assets/record-editor-B__3b7h2.js +0 -1
- package/dist/client/assets/registry-DpRLil7D.js +0 -2
- package/dist/client/assets/roles-P1-HY2OT.js +0 -1
- package/dist/client/assets/secrets-EVcWk0yc.js +0 -1
- package/dist/client/assets/select-model-CgXZFBIr.js +0 -1
- package/dist/client/assets/seo-editor-BpqPSu1k.js +0 -1
- package/dist/client/assets/settings-layout-ljEOwxAc.js +0 -1
- package/dist/client/assets/sidebar-DLCPSSnc.js +0 -1
- package/dist/client/assets/sso-By4pryNN.js +0 -1
- package/dist/client/assets/store-BSz8T3hr.js +0 -1
- package/dist/client/assets/store-registry-mttn5AI8.js +0 -2
- package/dist/client/assets/tooltip-CUlMaf5E.js +0 -1
- package/dist/client/assets/use-view-mode-Dff0V9fY.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BAIT4yxs.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DpmGs3CS.js +0 -1
- package/dist/client/assets/variant-calendar-CUrfAk6h.js +0 -1
|
@@ -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-CurNB2HG.js";import{t as Xe}from"./ChevronDown-CkcGr2qp.js";import{i as He}from"./ChevronRight-DYe9AFXl.js";import{s as qe,t as Me}from"./Star01-BoZIiKCL.js";import{n as Ve}from"./LinkExternal01-DekFjc9P.js";import{s as Re}from"./Plus-CQOl41pg.js";import{s as Ge}from"./Trash01-z6De146C.js";import{i as Qe}from"./Zap-Cxu6aoRs.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-CkCCiKt9.js";import{I as ue}from"./input-RRjvrcUF.js";import{T as lt}from"./textarea-C7j7_npp.js";import{P as Ne}from"./index-qZ5-LmpP.js";import{u as $e}from"./studio-tools-BvQ8Bli1.js";import{u as ot}from"./use-debounced-autosave-CaTQp8tz.js";import{R as rt}from"./require-capability-CBJ6cwe3.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./tooltip-CUlMaf5E.js";import"./sheet-Djk8ol5s.js";import"./X-DgKWdqZ1.js";import"./use-capability-DfdnXTfH.js";import"./access-gate-DvuwS2Bs.js";import"./capability-load-error-DgQyDsKl.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-CurNB2HG.js";import{i as J}from"./AlertCircle-BMCh3ayd.js";import{i as O}from"./HardDrive-D8FSpDtM.js";import{s as L}from"./Plus-CQOl41pg.js";import{s as Q}from"./Trash01-z6De146C.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-CkCCiKt9.js";import{d as ne,c as le,D as ae,a as oe,b as ce,e as de}from"./dialog-BFjL_my-.js";import{I as N}from"./input-RRjvrcUF.js";import{L as C}from"./label-DrXdAtn0.js";import{d as me,b as ue,c as fe,S as pe,a as q}from"./select-BePf1IJF.js";import{S as xe}from"./switch-dEe0am9a.js";import{S as he}from"./skeleton-DrM35KBr.js";import{T as ge}from"./textarea-C7j7_npp.js";import{P}from"./index-qZ5-LmpP.js";import{c as je}from"./settings-section-ELYurXQx.js";import{u as ye,b as be,c as ve}from"./use-file-configs-Bg9S5WW4.js";import{R as Se}from"./require-capability-CBJ6cwe3.js";import"./X-DgKWdqZ1.js";import"./index-BdQq_4o_.js";import"./tooltip-CUlMaf5E.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronDown-CkcGr2qp.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./sheet-Djk8ol5s.js";import"./card-D_tApM0k.js";import"./ArrowUpRight-CwVMUp5O.js";import"./studio-tools-BvQ8Bli1.js";import"./use-capability-DfdnXTfH.js";import"./access-gate-DvuwS2Bs.js";import"./capability-load-error-DgQyDsKl.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 ot(){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{ot as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,r as k,l as Q,j as t,B as U,i as V,t as T}from"./index-CurNB2HG.js";import{i as X}from"./XCircle-DFBcUexW.js";import{ay as Y,U as I}from"./agent-icon-pz8iT5cD.js";import{n as Z}from"./LinkExternal01-DekFjc9P.js";import{f as _,a as K,b as tt,c as et,d as ot,e as st,A as rt,g as it}from"./alert-dialog-CkCCiKt9.js";import{I as L}from"./input-RRjvrcUF.js";import{L as M}from"./label-DrXdAtn0.js";import{as as at,at as nt,aB as mt,au as R,aw as lt,aC as pt}from"./index-C2QgbLxn.js";import{d as ct,c as dt,B as ut,a as gt}from"./block-document-D978uGtK.js";import{u as xt,s as v,E as ft}from"./primitives-BmW50XTY.js";import{S as ht}from"./save-status-C9pT75mA.js";import{t as yt}from"./ChevronDown-CkcGr2qp.js";import{f as jt,h as vt,e as bt}from"./scroll-area-CbWYdgRA.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./Users03-CJuVy8Iz.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronLeft-Cgw9JZYG.js";import"./ChevronRight-DYe9AFXl.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Eye-B92Ff4dY.js";import"./ZoomOut-ryBmf3S4.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LayoutLeft-CuTI_WR9.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Plus-CQOl41pg.js";import"./SearchMd-Da504yGV.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./X-DgKWdqZ1.js";import"./Zap-Cxu6aoRs.js";import"./index-BVXtRunj.js";import"./chat-context-Dz9rhizY.js";import"./hooks-CFfc1t5D.js";import"./use-mcp-client-BbOUwA1H.js";import"./auth-xlfJjVrK.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CLJ6qnG1.js";import"./use-collections-w44ZyJ1t.js";import"./use-ai-providers-D-XhQ6_q.js";import"./studio-tools-BvQ8Bli1.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-B5L78CqV.js";import"./tooltip-CUlMaf5E.js";import"./dialog-BFjL_my-.js";import"./drawer-DZMXZPMN.js";import"./collection-search-JfLpXbmD.js";import"./use-mcp-prompts-Y5le4syR.js";import"./shell-layout-BkVrkYmb.js";import"./avatar-Bh53txVX.js";import"./required-auth-layout-Be__d9RH.js";import"./use-org-sso-CIoYIaj1.js";import"./form-B6Nf7hvD.js";import"./select-BePf1IJF.js";import"./index-BdQq_4o_.js";import"./tabs-DOJ7e6Z7.js";import"./toggle-group-CSO_yZKm.js";import"./sortable.esm-BN6bAoSL.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card--7NnoNLM.js";import"./use-registry-connections-3CHe_VwJ.js";import"./use-connection-Cvfufzsw.js";import"./useInfiniteQuery-BAIT4yxs.js";import"./use-infinite-scroll-BlkXRVRw.js";import"./extract-connection-data-Bau_aQvM.js";import"./card-D_tApM0k.js";import"./integration-icon-Dpj2NSXY.js";import"./collection-tabs-B5YA_dM5.js";import"./badge-CdirlPdy.js";import"./textarea-C7j7_npp.js";import"./connection-form-helpers-BW7AB-E3.js";import"./authenticate-and-persist-oauth-DPn6Vk96.js";import"./mcp-oauth-B5dnAc7V.js";import"./useSuspenseInfiniteQuery-DpmGs3CS.js";import"./connect-desktop-dialog-BxJ3X8re.js";import"./decopilot-CiHv6XGE.js";import"./checkbox-OtNKSART.js";import"./skeleton-DrM35KBr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ELYurXQx.js";import"./popover-D7BamlkK.js";import"./command-iFNWkWs6.js";import"./index-BDyN-RAN.js";import"./dropdown-menu-B1DaP6vk.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bbu_XWuO.js";import"./empty-state-Lmcbk0Zv.js";import"./toolbar-D9CfLhAB.js";import"./preview-dialog-C9Rx0Dtg.js";import"./index-ZANilAX7.js";import"./file-type-icon-CWgZWEkL.js";import"./use-mcp-tools-xGr1pN0n.js";import"./types-CDn4NSje.js";import"./use-capability-DfdnXTfH.js";import"./shell-route-loading-gKBpXu2h.js";import"./tools-list-DC6csFT2.js";import"./switch-dEe0am9a.js";import"./use-debounced-autosave-CaTQp8tz.js";import"./index-qZ5-LmpP.js";import"./sidebar-DLCPSSnc.js";import"./sheet-Djk8ol5s.js";import"./search-input-CeqwXCv0.js";import"./github-repo-picker-CThHTj5h.js";import"./use-navigate-to-agent-CidcWwFC.js";import"./use-secrets-DlUSWVTu.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-CIiu6iGh.js";import"./index-ovnDLwrg.js";import"./automation-runs-DBQv8Uvp.js";import"./table-D_zHkpnq.js";import"./use-members-blURElyD.js";import"./use-org-auth-client-oMz0ubhe.js";import"./task-status-DLHF9SZS.js";import"./use-automations-BllXXW29.js";import"./use-file-configs-Bg9S5WW4.js";import"./monaco-editor-zMbhl8rq.js";import"./select-model-CgXZFBIr.js";import"./automation-list-row-CCZ8TAPg.js";import"./use-clock-tick-DmUrmEeM.js";import"./use-copy-BWQBaWRC.js";import"./content-blocks-o63cs2vh.js";function Ct(b){const e=q.c(18),{icon:f,title:m,defaultOpen:C,children:u}=b,B=C===void 0?!1:C,[h,D]=k.useState(B);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let r;e[2]!==m?(r=t.jsx("span",{className:"flex-1 text-left",children:m}),e[2]=m,e[3]=r):r=e[3];const y=h&&"rotate-180";let s;e[4]!==y?(s=Q("transition-transform",y),e[4]=y,e[5]=s):s=e[5];let p;e[6]!==s?(p=t.jsx(yt,{size:15,className:s}),e[6]=s,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==r||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,r,p]})}),e[8]=l,e[9]=r,e[10]=p,e[11]=c):c=e[11];let i;e[12]!==u?(i=t.jsx(vt,{className:"px-2 pt-4",children:u}),e[12]=u,e[13]=i):i=e[13];let g;return e[14]!==h||e[15]!==c||e[16]!==i?(g=t.jsxs(bt,{open:h,onOpenChange:D,className:"mt-4",children:[c,i]}),e[14]=h,e[15]=c,e[16]=i,e[17]=g):g=e[17],g}function is({orgSlug:b,virtualMcpId:e,branch:f,blockKey:m,block:C,decofile:u,meta:B,onManagePosts:h,onOpenPost:D,previewBaseUrl:l}){const r=at({orgSlug:b,virtualMcpId:e,branch:f}),y=nt(C,"categories"),[s,p,c]=xt(y,o=>{r.mutate({blockKey:m,data:R(m,"categories",o)})}),i=(o,S)=>p({...s,[o]:S}),g=ct({decofile:u,category:s,previewBaseUrl:l}),a=v(s.slug),[A,j]=k.useState(a),[n,N]=k.useState(null),[w,$]=k.useState(!1),z=a?mt(u).filter(o=>o.categorySlugs.includes(a)):[],d=z.length,G=o=>i("slug",o),H=async(o,S)=>{const W=v(s.name);$(!0);try{let x=0;for(const{key:P,payload:O}of lt(u,"posts")){const F=pt(O,o,{name:W,slug:S});F!==O&&(await r.mutateAsync({blockKey:P,data:R(P,"posts",F)}),x+=1)}const E={...s,slug:S};await r.mutateAsync({blockKey:m,data:R(m,"categories",E)}),c(E),T.success(x>0?`Renamed slug and updated ${x} ${x===1?"post":"posts"}`:"Renamed slug"),N(null)}catch(x){j(o),N(null),T.error(x instanceof Error?x.message:"Rename failed")}finally{$(!1)}},J=()=>{const o=A.trim();if(o===a){A!==o&&j(o);return}if(!o){j(a);return}if(d===0){G(o);return}N({oldSlug:a,newSlug:o,count:d})};return t.jsxs(dt,{orgSlug:b,virtualMcpId:e,branch:f,children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(s.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(ht,{isPending:r.isPending,isError:r.isError}),g&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(g,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(s.name),onChange:o=>i("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:A,onChange:o=>j(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(s.description),onChange:o=>i("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Ct,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(s.sections),onChange:o=>i("sections",o),meta:B,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(I,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[d," ",d===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?d===0?"Go to the posts list to add posts to this category":"Jump to the posts list filtered by this category":"Set a slug to manage this category's posts",onClick:()=>h(d===0?"":a),children:[d===0?"Add posts":"Manage posts",t.jsx(X,{size:14})]})]}),d>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(I,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!n,onOpenChange:o=>{o||w||(j(a),N(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:n?`Changing the slug from "${n.oldSlug}" to "${n.newSlug}" will update ${n.count} ${n.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(st,{children:[t.jsx(rt,{disabled:w,children:"Cancel"}),t.jsx(it,{onClick:o=>{o.preventDefault(),n&&H(n.oldSlug,n.newSlug)},disabled:w,children:w?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{is 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-CurNB2HG.js";import{E as Ee}from"./empty-state-Lmcbk0Zv.js";import{u as et,a as Ae}from"./use-collections-w44ZyJ1t.js";import{u as ce}from"./use-mcp-client-BbOUwA1H.js";import{F as ne,a as tt,b as de,d as me}from"./form-B6Nf7hvD.js";import{I as ue}from"./input-RRjvrcUF.js";import{T as re}from"./textarea-C7j7_npp.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-EwbYDv-_.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-pz8iT5cD.js";import{g as ut,M as xt,a as Ne}from"./types-CDn4NSje.js";import{A as pt,a as ft,b as ht}from"./alert-BwNlkWBE.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-BePf1IJF.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-CUlMaf5E.js";import{i as jt}from"./AlertCircle-BMCh3ayd.js";import{s as bt}from"./Stars02-C4CXFnp9.js";import{a as Nt}from"./Eye-B92Ff4dY.js";import{i as vt}from"./Play-BGGUeSDd.js";import{i as St}from"./ChevronRight-DYe9AFXl.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-DC6csFT2.js";import{a as Oe,u as Re}from"./use-connection-Cvfufzsw.js";import{a as It}from"./use-mcp-tools-xGr1pN0n.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-Dpj2NSXY.js";import{f as Tt,h as Pt}from"./chat-context-Dz9rhizY.js";import{b as kt}from"./shell-layout-BkVrkYmb.js";import{M as Et}from"./monaco-editor-zMbhl8rq.js";import{n as At}from"./XCircle-DFBcUexW.js";import"./auth-xlfJjVrK.js";import"./label-DrXdAtn0.js";import"./index-qZ5-LmpP.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./sheet-Djk8ol5s.js";import"./X-DgKWdqZ1.js";import"./ZoomOut-ryBmf3S4.js";import"./Key01-CZVV-ceU.js";import"./extract-connection-data-Bau_aQvM.js";import"./use-registry-connections-3CHe_VwJ.js";import"./use-organization-settings-B5L78CqV.js";import"./studio-tools-BvQ8Bli1.js";import"./Plus-CQOl41pg.js";import"./Form-GDlYmtQN.js";import"./index-C_XJPG8Z.js";import"./index-ovnDLwrg.js";import"./index-BdQq_4o_.js";import"./index-BDyN-RAN.js";import"./popover-D7BamlkK.js";import"./use-virtual-mcp-CLJ6qnG1.js";import"./ChevronUp-CiXD4kQk.js";import"./SearchMd-Da504yGV.js";import"./Users03-CJuVy8Iz.js";import"./use-create-virtual-mcp-CGofqNOQ.js";import"./use-navigate-to-agent-CidcWwFC.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./DotsVertical-Z_h1bSB3.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./Zap-Cxu6aoRs.js";import"./mcp-oauth-B5dnAc7V.js";import"./badge-CdirlPdy.js";import"./hooks-CFfc1t5D.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-D-XhQ6_q.js";import"./tab-id-BptcWVWa.js";import"./avatar-Bh53txVX.js";import"./dialog-BFjL_my-.js";import"./required-auth-layout-Be__d9RH.js";import"./use-org-sso-CIoYIaj1.js";import"./index-ZANilAX7.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 Dn(){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{Dn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,l as i,j as n}from"./index-CurNB2HG.js";import{_ as m}from"./index-BDyN-RAN.js";import{d as k,a as N,b as j,D as b,c as w}from"./dialog-BFjL_my-.js";import{i as y}from"./SearchMd-Da504yGV.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as N,r as A,l as se,j as i,B as te,i as me,m as Re,K as Z,k as le,d as Se,a as ve,u as We,b as ze,n as Ve,o as Le,Q as Ge,E as Ye,p as we,L as Ze}from"./index-CurNB2HG.js";import{A as Je}from"./auth-entry-BNYZmdvo.js";import{A as J}from"./auth-split-layout-DuCP9Fwl.js";import{O as ke}from"./organization-choice-BcGxKG4I.js";import{f as Xe}from"./tab-id-BptcWVWa.js";import{I as et}from"./input-RRjvrcUF.js";import{u as pe,W as Pe,S as $e,g as tt,C as nt}from"./use-mcp-client-BbOUwA1H.js";import{i as Ue}from"./XCircle-DFBcUexW.js";import{I as st}from"./integration-icon-Dpj2NSXY.js";import{v as Te,F as it}from"./Form-GDlYmtQN.js";import"./index-C_XJPG8Z.js";import{i as Ae}from"./CheckCircle-BP2lb3AX.js";import{i as ot}from"./ZoomOut-ryBmf3S4.js";import{g as rt,c as lt,e as at}from"./extract-connection-data-Bau_aQvM.js";import{u as ct}from"./useQueries-BqFctUi9.js";import{a as dt}from"./authenticate-and-persist-oauth-DPn6Vk96.js";import{i as Me}from"./ArrowUpRight-CwVMUp5O.js";import{s as De}from"./User01-Cvp121NC.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-Bh53txVX.js";import"./auth-xlfJjVrK.js";import"./agent-icon-pz8iT5cD.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./ZapSquare-DOK7F1oe.js";import"./Users03-CJuVy8Iz.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./ChevronRight-DYe9AFXl.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Eye-B92Ff4dY.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LayoutLeft-CuTI_WR9.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Plus-CQOl41pg.js";import"./SearchMd-Da504yGV.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./X-DgKWdqZ1.js";import"./Zap-Cxu6aoRs.js";import"./index-ovnDLwrg.js";import"./index-BdQq_4o_.js";import"./index-BDyN-RAN.js";import"./mcp-oauth-B5dnAc7V.js";const ut=/^[a-zA-Z][a-zA-Z\d+.-]*:/,mt=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,ft=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,gt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function be(n){const e=n.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=ut.test(e),s=mt.test(e),o=ft.test(e);if(t&&!s&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=s?e:`https://${e}`;let l;try{l=new URL(a)}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(c=>!c||!gt.test(c))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function je(n){const e=N.c(14),{children:t,className:s,wrapperClassName:o}=n,[a,l]=A.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=x=>{if(!x)return;const j=()=>{const d=x.scrollHeight-x.scrollTop-x.clientHeight<8;l(d)};j(),x.addEventListener("scroll",j,{passive:!0});const b=new ResizeObserver(j);b.observe(x);for(const d of Array.from(x.children))b.observe(d);return()=>{x.removeEventListener("scroll",j),b.disconnect()}},e[0]=r):r=e[0];const c=r;let u;e[1]!==o?(u=se("relative",o),e[1]=o,e[2]=u):u=e[2];let m;e[3]!==t||e[4]!==s?(m=i.jsx("div",{ref:c,className:s,children:t}),e[3]=t,e[4]=s,e[5]=m):m=e[5];const f=a?"opacity-0":"opacity-100";let g;e[6]!==f?(g=se("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=g):g=e[7];let h;e[8]!==g?(h=i.jsx("div",{"aria-hidden":!0,className:g}),e[8]=g,e[9]=h):h=e[9];let p;return e[10]!==u||e[11]!==m||e[12]!==h?(p=i.jsxs("div",{className:u,children:[m,h]}),e[10]=u,e[11]=m,e[12]=h,e[13]=p):p=e[13],p}function pt(n){const e=n.properties;if(!e)return[];const t=[];for(const[s,o]of Object.entries(e)){const r=o?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:s,bindingType:r})}return t}function ht(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function ee(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function xt(n,e,t,s){return{...n??{},[e]:{__type:t,value:s}}}function fe(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(fe):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&fe(t)):!1}function Ke(n){return fe(n)}function yt(n){return n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function bt(n){return fe(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function jt(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const s=bt(t);return s?[{key:e,label:yt(e),value:s}]:[]}):[]}function Ct(n,e,t){const s=n.filter(o=>o.app_name===e||!!t&&o.app_id===t);return s.length===0?null:(s.sort((o,a)=>{const l=r=>r.status==="active"?0:1;return l(o)!==l(a)?l(o)-l(a):(a.updated_at??"").localeCompare(o.updated_at??"")}),s[0].id)}function St(n){return n.server?.icons?.[0]?.src??rt(n.server?.repository)??null}function vt(n,e){const t=n._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function _t(n){const e=[],t=new Map(n.connections.map(s=>[s.id,s]));for(const s of n.requirements){const o=n.curated[s.bindingType],a=o?n.itemsById[o.registryAppId]:n.itemsByName[s.bindingType];if(!a)continue;const l=n.configurationState?.[s.fieldKey]?.value,r=l?t.get(l):void 0,c=l&&r?l:null,u=c?n.connectionReadiness?.[c]!==!1:!1,m=!!c&&u;e.push({fieldKey:s.fieldKey,bindingType:s.bindingType,registryItem:a,title:vt(a,s.bindingType),icon:St(a),headline:o?.headline??a._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:m,candidateConnectionId:m?null:c||Ct(n.connections,s.bindingType,o?.registryAppId),linkedConnectionId:c,configurationState:r?.configuration_state??null})}return e}function Nt(){const n=N.c(3);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),i.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),i.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"p-1",children:i.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),n[1]=t):t=n[1];let s;return n[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,i.jsx("div",{className:"p-1",children:i.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),n[2]=s):s=n[2],s}function Ce(n){const e=N.c(3),{children:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Ae,{size:14,className:"shrink-0 text-blue-500"}),e[0]=s):s=e[0];let o;return e[1]!==t?(o=i.jsxs("div",{className:"flex items-center gap-2 p-1",children:[s,i.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function It(n){const e=N.c(46),{card:t,connecting:s,disabled:o,onConnect:a,org:l,selfClient:r}=n,c=t.linkedConnectionId;let u;e[0]!==t.configurationState?(u=jt(t.configurationState),e[0]=t.configurationState,e[1]=u):u=e[1];const m=u;let f;e[2]!==t.configurationState||e[3]!==t.satisfied?(f=t.satisfied&&!Ke(t.configurationState),e[2]=t.configurationState,e[3]=t.satisfied,e[4]=f):f=e[4];const[g,h]=A.useState(f);let p;e[5]!==t.icon||e[6]!==t.title?(p=i.jsx(st,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1.5"}),e[5]=t.icon,e[6]=t.title,e[7]=p):p=e[7];let x;e[8]!==t.title?(x=i.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[8]=t.title,e[9]=x):x=e[9];let j;e[10]!==t.satisfied||e[11]!==t.title||e[12]!==s||e[13]!==o||e[14]!==a?(j=t.satisfied?i.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[i.jsx(Ae,{size:16})," Connected"]}):i.jsx(te,{type:"button",variant:"outline",size:"sm",disabled:o||s,onClick:a,"aria-label":`Connect ${t.title}`,children:s?i.jsx(me,{size:16,className:"animate-spin"}):"Connect"}),e[10]=t.satisfied,e[11]=t.title,e[12]=s,e[13]=o,e[14]=a,e[15]=j):j=e[15];let b;e[16]!==p||e[17]!==x||e[18]!==j?(b=i.jsxs("div",{className:"flex items-center gap-2",children:[p,x,j]}),e[16]=p,e[17]=x,e[18]=j,e[19]=b):b=e[19];let d;e[20]!==t.checks?(d=t.checks!==null&&i.jsxs(Ce,{children:["+ ",t.checks," checks"]}),e[20]=t.checks,e[21]=d):d=e[21];let y;e[22]!==t.headline?(y=t.headline&&i.jsx(Ce,{children:t.headline}),e[22]=t.headline,e[23]=y):y=e[23];let S;e[24]!==t.bullets?(S=t.bullets.map(Et),e[24]=t.bullets,e[25]=S):S=e[25];let v;e[26]!==t.candidateConnectionId||e[27]!==t.satisfied||e[28]!==t.title?(v=!t.satisfied&&t.candidateConnectionId&&i.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",t.title]}),e[26]=t.candidateConnectionId,e[27]=t.satisfied,e[28]=t.title,e[29]=v):v=e[29];let T;e[30]!==v||e[31]!==d||e[32]!==y||e[33]!==S?(T=i.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[d,y,S,v]}),e[30]=v,e[31]=d,e[32]=y,e[33]=S,e[34]=T):T=e[34];let I;e[35]!==t||e[36]!==g||e[37]!==c||e[38]!==l||e[39]!==m||e[40]!==r?(I=t.satisfied&&c&&i.jsx(Rt,{card:t,org:l,selfClient:r,connectionId:c,savedConfigEntries:m,isEditing:g,onEdit:()=>h(!0),onCancel:()=>h(!1),onSaved:()=>h(!1)}),e[35]=t,e[36]=g,e[37]=c,e[38]=l,e[39]=m,e[40]=r,e[41]=I):I=e[41];let R;return e[42]!==T||e[43]!==I||e[44]!==b?(R=i.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[b,T,I]}),e[42]=T,e[43]=I,e[44]=b,e[45]=R):R=e[45],R}function Et(n){return i.jsx(Ce,{children:n},n)}function wt(n){const e=n?.properties;return!!e&&typeof e=="object"&&Object.keys(e).length>0}function kt(n){return/(token|secret|password|appKey|key)$/i.test(n)}function Tt(n,e){return kt(n)?"••••••••":e}function Ot(n){const e=N.c(9),{id:t,label:s,description:o,children:a}=n;if(t.includes("__type")||t.includes("__binding"))return null;let l;e[0]!==t||e[1]!==s?(l=s&&i.jsx("label",{className:"text-sm font-medium text-foreground",htmlFor:t,children:s}),e[0]=t,e[1]=s,e[2]=l):l=e[2];let r;e[3]!==o?(r=o&&i.jsx("div",{className:"text-xs leading-4 text-muted-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let c;return e[5]!==a||e[6]!==l||e[7]!==r?(c=i.jsxs("div",{className:"grid gap-1.5",children:[l,a,r]}),e[5]=a,e[6]=l,e[7]=r,e[8]=c):c=e[8],c}function Rt(n){const e=N.c(71),{card:t,org:s,selfClient:o,connectionId:a,savedConfigEntries:l,isEditing:r,onEdit:c,onCancel:u,onSaved:m}=n,f=Re();let g;e[0]!==a||e[1]!==s.id||e[2]!==s.slug?(g={connectionId:a,orgId:s.id,orgSlug:s.slug},e[0]=a,e[1]=s.id,e[2]=s.slug,e[3]=g):g=e[3];const h=pe(g);let p;e[4]!==t.configurationState?(p=t.configurationState??{},e[4]=t.configurationState,e[5]=p):p=e[5];const[x,j]=A.useState(p),[b,d]=A.useState(null);let y;e[6]!==a||e[7]!==s.id?(y=Z.commerceDiscoveryCompanionConnectionSchema(s.id,a),e[6]=a,e[7]=s.id,e[8]=y):y=e[8];let S;e[9]!==h?(S=async()=>{const k=await h.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ee(k)},e[9]=h,e[10]=S):S=e[10];let v;e[11]!==y||e[12]!==S?(v={queryKey:y,queryFn:S,retry:!1},e[11]=y,e[12]=S,e[13]=v):v=e[13];const T=le(v);let I;e[14]!==a||e[15]!==o?(I=async k=>{const _=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:a,data:{configuration_state:k}}});return ee(_)},e[14]=a,e[15]=o,e[16]=I):I=e[16];let R;e[17]!==m||e[18]!==s.id||e[19]!==f?(R=async()=>{d(null),await f.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnections(s.id)}),m()},e[17]=m,e[18]=s.id,e[19]=f,e[20]=R):R=e[20];let H;e[21]!==I||e[22]!==R?(H={mutationFn:I,onSuccess:R},e[21]=I,e[22]=R,e[23]=H):H=e[23];const E=Se(H),$=T.data?.stateSchema,L=wt($)&&(r||l.length>0);if(T.isPending){let k;return e[24]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-3 text-sm text-muted-foreground",children:[i.jsx(me,{size:14,className:"animate-spin"}),"Loading configuration..."]}),e[24]=k):k=e[24],k}if(T.error||!L||!$)return null;if(!r&&l.length>0){let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[25]=k):k=e[25];let _;e[26]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(ot,{size:14}),e[26]=_):_=e[26];let O;e[27]!==c?(O=i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[k,i.jsxs(te,{type:"button",variant:"ghost",size:"sm",onClick:c,children:[_,"Edit"]})]}),e[27]=c,e[28]=O):O=e[28];let X;e[29]!==l?(X=l.map(zt),e[29]=l,e[30]=X):X=e[30];let W;e[31]!==X?(W=i.jsx("dl",{className:"grid gap-2",children:X}),e[31]=X,e[32]=W):W=e[32];let Y;return e[33]!==O||e[34]!==W?(Y=i.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[O,W]}),e[33]=O,e[34]=W,e[35]=Y):Y=e[35],Y}let U;e[36]!==x||e[37]!==E||e[38]!==$?(U=()=>{if(!Ke(x)){d("Enter at least one configuration value.");return}const k=Te.validateFormData(x,$);if(k.errors.length>0){d(k.errors[0]?.stack??"Invalid configuration.");return}d(null),E.mutate(x)},e[36]=x,e[37]=E,e[38]=$,e[39]=U):U=e[39];const Q=U;let M;e[40]!==t.title?(M=i.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Configure ",t.title]}),e[40]=t.title,e[41]=M):M=e[41];const G=`${a}:configuration`;let F;e[42]===Symbol.for("react.memo_cache_sentinel")?(F=k=>j(k.formData??{}),e[42]=F):F=e[42];let V,P;e[43]===Symbol.for("react.memo_cache_sentinel")?(V={FieldTemplate:Ot},P=i.jsx(i.Fragment,{}),e[43]=V,e[44]=P):(V=e[43],P=e[44]);let D;e[45]!==x||e[46]!==$||e[47]!==G?(D=i.jsx(it,{schema:$,validator:Te,formData:x,onChange:F,liveValidate:!1,showErrorList:!1,templates:V,children:P},G),e[45]=x,e[46]=$,e[47]=G,e[48]=D):D=e[48];let w;e[49]!==E.error||e[50]!==b?(w=(b||E.error)&&i.jsx("p",{role:"alert",className:"text-sm text-destructive",children:b??(E.error instanceof Error?E.error.message:"Could not save configuration.")}),e[49]=E.error,e[50]=b,e[51]=w):w=e[51];let K;e[52]!==t.configurationState||e[53]!==u||e[54]!==E.isPending||e[55]!==l.length?(K=l.length>0&&i.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j(t.configurationState??{}),d(null),u()},disabled:E.isPending,children:"Cancel"}),e[52]=t.configurationState,e[53]=u,e[54]=E.isPending,e[55]=l.length,e[56]=K):K=e[56];let B;e[57]!==E.isPending?(B=E.isPending?i.jsxs(i.Fragment,{children:[i.jsx(me,{size:14,className:"animate-spin"}),"Saving"]}):"Save",e[57]=E.isPending,e[58]=B):B=e[58];let q;e[59]!==Q||e[60]!==E.isPending||e[61]!==B?(q=i.jsx(te,{type:"button",size:"sm",onClick:Q,disabled:E.isPending,children:B}),e[59]=Q,e[60]=E.isPending,e[61]=B,e[62]=q):q=e[62];let C;e[63]!==K||e[64]!==q?(C=i.jsxs("div",{className:"flex justify-end gap-2",children:[K,q]}),e[63]=K,e[64]=q,e[65]=C):C=e[65];let z;return e[66]!==M||e[67]!==D||e[68]!==w||e[69]!==C?(z=i.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[M,D,w,C]}),e[66]=M,e[67]=D,e[68]=w,e[69]=C,e[70]=z):z=e[70],z}function zt(n){return i.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[i.jsx("dt",{className:"text-muted-foreground",children:n.label}),i.jsx("dd",{className:"truncate text-foreground",children:Tt(n.key,n.value)})]},n.key)}const _e={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 Lt(n){const e=N.c(39),{selfClient:t,org:s,cdConnectionId:o}=n;let a;e[0]!==o||e[1]!==s.id||e[2]!==s.slug?(a={connectionId:o,orgId:s.id,orgSlug:s.slug},e[0]=o,e[1]=s.id,e[2]=s.slug,e[3]=a):a=e[3];const l=pe(a);let r;e[4]!==o||e[5]!==s.id?(r=Z.commerceDiscoveryCompanionSchema(s.id,o),e[4]=o,e[5]=s.id,e[6]=r):r=e[6];let c;e[7]!==l?(c=async()=>{const C=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ee(C)},e[7]=l,e[8]=c):c=e[8];let u;e[9]!==r||e[10]!==c?(u={queryKey:r,queryFn:c},e[9]=r,e[10]=c,e[11]=u):u=e[11];const m=le(u),f=pt(m.data?.stateSchema??{properties:{}}),g=f.map(qt),h=f.map(Kt).filter(Dt),p=f.filter(Mt).map(At),x=[...h,...p].sort().join(",");let j;e[12]!==o||e[13]!==s.id?(j=Z.commerceDiscoveryConnection(s.id,o),e[12]=o,e[13]=s.id,e[14]=j):j=e[14];let b;e[15]!==o||e[16]!==t?(b=async()=>{const C=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return ee(C)},e[15]=o,e[16]=t,e[17]=b):b=e[17];let d;e[18]!==j||e[19]!==b?(d={queryKey:j,queryFn:b},e[18]=j,e[19]=b,e[20]=d):d=e[20];const y=le(d),S=y.data?.item?.configuration_state??null;let v;e[21]!==S?(v=C=>S?.[C.fieldKey]?.value,e[21]=S,e[22]=v):v=e[22];const T=f.map(v).filter(Ut),I=le({queryKey:Z.commerceDiscoveryCompanionConnections(s.id),enabled:f.length>0,queryFn:async()=>{const C=[{field:["app_name"],operator:"in",value:g},{field:["app_id"],operator:"in",value:h}];T.length>0&&C.push({field:["id"],operator:"in",value:T});const z=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:C},limit:1e3}});return ee(z)}}),R=I.data?.items??[],H=new Set(T),E=R.filter(C=>H.has(C.id)),$=E.filter($t);let L;e[23]!==s.id||e[24]!==s.slug?(L=C=>({queryKey:Z.commerceDiscoveryCompanionOAuthStatus(s.id,C.id),queryFn:async()=>{const z=await fetch(`/api/${encodeURIComponent(s.slug)}/connections/${encodeURIComponent(C.id)}/oauth-token/status`,{credentials:"include"});return z.ok?{hasToken:(await z.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=s.id,e[24]=s.slug,e[25]=L):L=e[25];const U=ct({queries:$.map(L)});let Q;e[26]!==U?(Q=(C,z)=>[C.id,U[z]?.data?.hasToken===!0],e[26]=U,e[27]=Q):Q=e[27];const M=new Map($.map(Q)),G={};for(const C of E)G[C.id]=!C.oauth_config||!!C.connection_token||M.get(C.id)===!0;const F=le({queryKey:Z.commerceDiscoveryCompanionRegistry(s.id,x),enabled:f.length>0,queryFn:async()=>{const C=ht(h,p),z=await lt(Pe.REGISTRY(s.id),s.id,s.slug,"COLLECTION_REGISTRY_APP_LIST",{...C?{where:C}:{},limit:1e3});return ee(z)}}),V={},P={};for(const C of F.data?.items??[])V[C.id]=C,C.server?.name&&(P[C.server.name]=C);const D=_t({requirements:f,itemsById:V,itemsByName:P,connections:R,connectionReadiness:G,configurationState:S,curated:_e});let w;e[28]!==y||e[29]!==I||e[30]!==U||e[31]!==F||e[32]!==f||e[33]!==m.isPending?(w=m.isPending||y.isPending||f.length>0&&(I.isPending||F.isPending||U.some(Pt)),e[28]=y,e[29]=I,e[30]=U,e[31]=F,e[32]=f,e[33]=m.isPending,e[34]=w):w=e[34];const K=w,B=m.error??y.error??I.error??F.error??null;let q;return e[35]!==D||e[36]!==B||e[37]!==K?(q={cards:D,isLoading:K,error:B},e[35]=D,e[36]=B,e[37]=K,e[38]=q):q=e[38],q}function Pt(n){return n.isPending}function $t(n){return n.oauth_config&&!n.connection_token}function Ut(n){return typeof n=="string"&&n.length>0}function At(n){return n.bindingType}function Mt(n){return!_e[n.bindingType]}function Dt(n){return!!n}function Kt(n){return _e[n.bindingType]?.registryAppId}function qt(n){return n.bindingType}function Ft({selfClient:n,org:e,userId:t,cdConnectionId:s}){const o=Re(),[a,l]=A.useState(null),[r,c]=A.useState(null),u=async(f,g)=>{const h=await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:f,data:g}});return ee(h)};async function m(f){l(f.fieldKey),c(null);try{let g=f.candidateConnectionId;if(!g){const d=at(f.registryItem,e.id,t,{remoteIndex:0}),y=d.connection_type==="STDIO",S=!!d.connection_url,v=y&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!S&&!v){c(`${f.title} cannot be connected: no connection method available`);return}const T=await n.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:d}});g=ee(T).item.id}const h=g,p=await dt({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:d=>u(h,{connection_token:d}).then(()=>{})});if(!p.ok){c(`Couldn't sign in to ${f.title}: ${p.error}`);return}const x=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),j=ee(x).item?.configuration_state??null,b=xt(j,f.fieldKey,f.bindingType,h);await u(s,{configuration_state:b}),await o.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,s)}),await o.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnections(e.id)})}catch(g){c(g instanceof Error?g.message:String(g))}finally{l(null)}}return{connect:m,connectingFieldKey:a,error:r}}function Bt(n){const e=N.c(23),{org:t,cdConnectionId:s}=n,{data:o}=ve.useSession(),a=o?.user?.id??"";let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:$e,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const r=pe(l);let c;e[3]!==s||e[4]!==t||e[5]!==r?(c={selfClient:r,org:t,cdConnectionId:s},e[3]=s,e[4]=t,e[5]=r,e[6]=c):c=e[6];const{cards:u,isLoading:m,error:f}=Lt(c);let g;e[7]!==s||e[8]!==t||e[9]!==r||e[10]!==a?(g={selfClient:r,org:t,userId:a,cdConnectionId:s},e[7]=s,e[8]=t,e[9]=r,e[10]=a,e[11]=g):g=e[11];const{connect:h,connectingFieldKey:p,error:x}=Ft(g);if(!m&&!f&&u.length===0)return null;const j=p!==null;let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsxs("div",{className:"grid gap-1.5",children:[i.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),i.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),e[12]=b):b=e[12];let d;return e[13]!==j||e[14]!==u||e[15]!==h||e[16]!==x||e[17]!==p||e[18]!==f||e[19]!==m||e[20]!==t||e[21]!==r?(d=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:block md:flex-none",children:[b,f?i.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):m?i.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Ht)}):i.jsx(je,{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:i.jsxs("div",{className:"grid gap-4",children:[x&&i.jsx("p",{role:"alert",className:"text-sm text-destructive",children:x}),u.map(y=>i.jsx(It,{card:y,connecting:p===y.fieldKey,disabled:j&&p!==y.fieldKey,org:t,selfClient:r,onConnect:()=>{h(y)}},y.fieldKey))]})})]}),e[13]=j,e[14]=u,e[15]=h,e[16]=x,e[17]=p,e[18]=f,e[19]=m,e[20]=t,e[21]=r,e[22]=d):d=e[22],d}function Ht(n){return i.jsx(Nt,{},n)}const Ne="https://decocms-tanstack.deco-cx.workers.dev/agendar",Qt="Rather have us walk you through it?",Wt="Book a 20-minute call and we'll run the diagnostic with you, live.";function Vt({siteUrl:n,email:e}){const t=new URL(Ne);return n&&t.searchParams.set("siteUrl",n),e&&t.searchParams.set("email",e),t.toString()}function Gt(n){const e=N.c(9),{href:t,size:s,className:o}=n,a=t===void 0?Ne:t,l=s===void 0?"lg":s;let r;e[0]!==o?(r=se("w-full",o),e[0]=o,e[1]=r):r=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Me,{size:16}),e[2]=c):c=e[2];let u;e[3]!==a?(u=i.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",c]}),e[3]=a,e[4]=u):u=e[4];let m;return e[5]!==l||e[6]!==r||e[7]!==u?(m=i.jsx(te,{asChild:!0,variant:"outline",size:l,className:r,children:u}),e[5]=l,e[6]=r,e[7]=u,e[8]=m):m=e[8],m}function Oe(n){const e=N.c(2),{children:t}=n;let s;return e[0]!==t?(s=i.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:t}),e[0]=t,e[1]=s):s=e[1],s}function Yt(){const n=N.c(4);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Oe,{children:i.jsx(De,{size:20,className:"text-muted-foreground"})}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:i.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),n[1]=t):t=n[1];let s;n[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),n[2]=s):s=n[2];let o;return n[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,t,i.jsxs("div",{className:"relative",children:[s,i.jsxs(Oe,{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),n[3]=o):o=n[3],o}function Zt(n){const e=N.c(4),{href:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Yt,{}),e[0]=s):s=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs("div",{className:"grid gap-2",children:[i.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Qt}),i.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Wt})]}),e[1]=o):o=e[1];let a;return e[2]!==t?(a=i.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:i.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[s,o,i.jsx(Gt,{href:t,size:"xl"})]})}),e[2]=t,e[3]=a):a=e[3],a}function Jt(n){const e=N.c(8),{className:t,href:s}=n,o=s===void 0?Ne:s;let a;e[0]!==t?(a=se("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[0]=t,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:i.jsx(De,{size:20})}),e[2]=l):l=e[2];let r,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[i.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),i.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),c=i.jsx(Me,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=r,e[4]=c):(r=e[3],c=e[4]);let u;return e[5]!==o||e[6]!==a?(u=i.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:a,children:[l,r,c]}),e[5]=o,e[6]=a,e[7]=u):u=e[7],u}function qe(n){const e=N.c(10),{host:t}=n,s=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=i.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=a,e[2]=l):(o=e[0],a=e[1],l=e[2]);let r;e[3]!==s?(r=i.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:i.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=r):r=e[4];let c;e[5]!==t?(c=i.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=c):c=e[6];let u;return e[7]!==r||e[8]!==c?(u=i.jsxs("div",{className:"flex items-center gap-3",children:[o,a,l,r,c]}),e[7]=r,e[8]=c,e[9]=u):u=e[9],u}function Fe(n){const e=N.c(16),{label:t,iconSize:s,className:o,iconClassName:a,labelClassName:l}=n,r=s===void 0?14:s;let c;e[0]!==o?(c=se("inline-flex items-center gap-2",o),e[0]=o,e[1]=c):c=e[1];let u;e[2]!==a?(u=se("shrink-0 animate-spin",a),e[2]=a,e[3]=u):u=e[3];let m;e[4]!==r||e[5]!==u?(m=i.jsx(me,{size:r,className:u}),e[4]=r,e[5]=u,e[6]=m):m=e[6];let f;e[7]!==l?(f=se("text-sm",l),e[7]=l,e[8]=f):f=e[8];let g;e[9]!==t||e[10]!==f?(g=i.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=g):g=e[11];let h;return e[12]!==c||e[13]!==m||e[14]!==g?(h=i.jsxs("span",{className:c,children:[m,g]}),e[12]=c,e[13]=m,e[14]=g,e[15]=h):h=e[15],h}const Xt={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function Be(n){return Xt[n]}function Ie(n){const e=N.c(2),{variant:t}=n;let s;return e[0]!==t?(s=i.jsx(J,{children:i.jsx(Ee,{variant:t})}),e[0]=t,e[1]=s):s=e[1],s}function Ee(n){const e=N.c(4),{variant:t}=n;let s;e[0]!==t?(s=Be(t),e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=i.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:i.jsx(Fe,{label:s,className:"text-muted-foreground"})}),e[2]=s,e[3]=o):o=e[3],o}function en(){const n=N.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Fe,{label:Be("button")}),n[0]=e):e=n[0],e}function Cs(){const n=N.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(nn,{}),n[0]=e):e=n[0],e}const He=A.createContext(null),Qe=()=>A.useContext(He);function tn(n){if(!n)return null;const e=be(n);return e.ok?new URL(e.value).hostname:null}function nn(){const n=N.c(9);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},n[0]=e):e=n[0];const t=We(e),{org:s,siteUrl:o}=t;let a;n[1]!==o?(a=tn(o),n[1]=o,n[2]=a):a=n[2];const l=a;let r;n[3]!==s||n[4]!==o?(r=i.jsx(sn,{requestedOrgSlug:s,siteUrl:o}),n[3]=s,n[4]=o,n[5]=r):r=n[5];let c;return n[6]!==l||n[7]!==r?(c=i.jsx(He.Provider,{value:l,children:r}),n[6]=l,n[7]=r,n[8]=c):c=n[8],c}function sn(n){const e=N.c(8),{requestedOrgSlug:t,siteUrl:s}=n,{data:o,isPending:a}=ve.useSession(),l=Qe();if(a){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Ie,{variant:"route"}),e[0]=c):c=e[0],c}if(!o){const c=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==l?(u=l?i.jsx(qe,{host:l}):void 0,e[1]=l,e[2]=u):u=e[2];let m;return e[3]!==u?(m=i.jsx(J,{children:i.jsx(Je,{callbackUrl:c,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:u})}),e[3]=u,e[4]=m):m=e[4],m}let r;return e[5]!==t||e[6]!==s?(r=i.jsx(on,{requestedOrgSlug:t,siteUrl:s}),e[5]=t,e[6]=s,e[7]=r):r=e[7],r}function on(n){const e=N.c(40),{requestedOrgSlug:t,siteUrl:s}=n,o=ze(),a=Ve(),[l,r]=A.useState(null),[c,u]=A.useState(null),m=a.data?.map(ln)??[];let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={mutationFn:rn,retry:!1,onSuccess:d=>{u(d)}},e[0]=f):f=e[0];const g=Se(f);if(a.isPending){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ie,{variant:"route"}),e[1]=d):d=e[1],d}if(a.error){let d;return e[2]!==a?(d=i.jsx(ue,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[2]=a,e[3]=d):d=e[3],d}const h=t?m.find(d=>d.slug===t):null;if(h){let d;return e[4]!==h||e[5]!==s?(d=i.jsx(de,{org:h,initialSiteUrl:s}),e[4]=h,e[5]=s,e[6]=d):d=e[6],d}if(t){let d;return e[7]!==a?(d=i.jsx(ue,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[7]=a,e[8]=d):d=e[8],d}if(l){let d;return e[9]!==l||e[10]!==s?(d=i.jsx(de,{org:l,initialSiteUrl:s}),e[9]=l,e[10]=s,e[11]=d):d=e[11],d}if(m.length===1&&m[0]){let d;return e[12]!==m[0]||e[13]!==s?(d=i.jsx(de,{org:m[0],initialSiteUrl:s}),e[12]=m[0],e[13]=s,e[14]=d):d=e[14],d}if(m.length>1){let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ne,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=d):d=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=v=>r(v),e[16]=y):y=e[16];let S;return e[17]!==m?(S=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[d,i.jsx(je,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(ke,{organizations:m,selectLabel:"Continue",onSelected:y})})]})}),e[17]=m,e[18]=S):S=e[18],S}if(!c){let d;e[19]!==g?(d=()=>{g.reset(),g.mutate()},e[19]=g,e[20]=d):d=e[20];let y;return e[21]!==g||e[22]!==d?(y=i.jsx(an,{mutation:g,onRetry:d}),e[21]=g,e[22]=d,e[23]=y):y=e[23],y}const p=c;if(p?.success&&(p.status==="created"||p.status==="joined"||p.status==="already_has_organization")&&p.organization){let d;return e[24]!==p.organization||e[25]!==s?(d=i.jsx(de,{org:p.organization,initialSiteUrl:s}),e[24]=p.organization,e[25]=s,e[26]=d):d=e[26],d}if(p?.status==="ambiguous"&&p.organizations&&p.organizations.length>0){let d;e[27]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ne,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=d):d=e[27];const y=p.domain??void 0;let S;e[28]!==o||e[29]!==s?(S=(T,I)=>{Le(),r({...T,slug:I}),o({to:"/commerce-onboarding",search:{org:I,siteUrl:s}})},e[28]=o,e[29]=s,e[30]=S):S=e[30];let v;return e[31]!==p.organizations||e[32]!==y||e[33]!==S?(v=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[d,i.jsx(je,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(ke,{organizations:p.organizations,domain:y,onJoined:S})})]})}),e[31]=p.organizations,e[32]=y,e[33]=S,e[34]=v):v=e[34],v}const x=p?.error??"We could not determine a commerce organization for this account.";let j;e[35]!==g?(j=()=>{u(null),g.reset()},e[35]=g,e[36]=j):j=e[36];let b;return e[37]!==x||e[38]!==j?(b=i.jsx(ue,{title:"Commerce onboarding needs support",description:x,actionLabel:"Try again",onRetry:j}),e[37]=x,e[38]=j,e[39]=b):b=e[39],b}async function rn(){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&&Le(),e}function ln(n){return{id:n.id,name:n.name,slug:n.slug,logo:n.logo??null}}function an(n){const e=N.c(7),{mutation:t,onRetry:s}=n,o=A.useRef(!1);let a;e[0]!==t?(a=u=>{!u||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=a):a=e[1];const l=a;if(t.error){let u;return e[2]!==s?(u=i.jsx(ue,{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:s}),e[2]=s,e[3]=u):u=e[3],u}let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Ee,{variant:"workspace"}),e[4]=r):r=e[4];let c;return e[5]!==l?(c=i.jsx(J,{children:i.jsx("div",{ref:l,children:r})}),e[5]=l,e[6]=c):c=e[6],c}function ne(n){const e=N.c(8),{title:t,description:s}=n,o=Qe();let a;e[0]!==o?(a=o?i.jsx(qe,{host:o}):i.jsxs("div",{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=a):a=e[1];let l;e[2]!==s||e[3]!==t?(l=(t||s)&&i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),s&&i.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=i.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function ue(n){const e=N.c(9),{title:t,description:s,actionLabel:o,onRetry:a}=n;let l;e[0]!==s||e[1]!==t?(l=i.jsx(ne,{title:t,description:s}),e[0]=s,e[1]=t,e[2]=l):l=e[2];let r;e[3]!==o||e[4]!==a?(r=i.jsx(te,{type:"button",size:"xl",className:"w-full",onClick:a,children:o}),e[3]=o,e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==l||e[7]!==r?(c=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[l,r]})}),e[6]=l,e[7]=r,e[8]=c):c=e[8],c}function cn(n){return n.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function xe(n){const e=n;if(e.isError)throw new Error(cn(e));return e.structuredContent??n}function de(n){const e=N.c(3),{org:t,initialSiteUrl:s}=n;let o;return e[0]!==s||e[1]!==t?(o=i.jsx(Ge,{children:a=>{const{reset:l}=a;return i.jsx(Ye,{fallback:r=>{const{error:c,resetError:u}=r;return i.jsx(J,{children:i.jsx(dn,{orgName:t.name,message:c instanceof Error?c.message:"We could not check Commerce Discovery setup.",onRetry:()=>{l(),u()}})})},children:i.jsx(A.Suspense,{fallback:i.jsx(Ie,{variant:"connect"}),children:i.jsx(un,{org:t,initialSiteUrl:s},`${t.id}:${s??""}`)})})}}),e[0]=s,e[1]=t,e[2]=o):o=e[2],o}function dn(n){const e=N.c(10),{orgName:t,message:s,onRetry:o}=n,a=`Commerce setup will continue for ${t}.`;let l;e[0]!==a?(l=i.jsx(ne,{title:"Commerce diagnostics",description:a}),e[0]=a,e[1]=l):l=e[1];let r;e[2]!==s?(r=i.jsx(ge,{message:s}),e[2]=s,e[3]=r):r=e[3];let c;e[4]!==o?(c=i.jsx(te,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=c):c=e[5];let u;return e[6]!==l||e[7]!==r||e[8]!==c?(u=i.jsxs("div",{className:"grid gap-10",children:[l,r,c]}),e[6]=l,e[7]=r,e[8]=c,e[9]=u):u=e[9],u}function un(n){const e=N.c(84),{org:t,initialSiteUrl:s}=n,o=ze();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:$e,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const l=pe(a),[r,c]=A.useState(s??""),[u,m]=A.useState(null),[f,g]=A.useState(null),h=A.useRef(!1),p=Pe.COMMERCE_DISCOVERY(t.id),x=tt(t.id),j=Z.commerceDiscoveryConnection(t.id,p);let b;e[3]!==p||e[4]!==l?(b=async()=>{const _=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(_)},e[3]=p,e[4]=l,e[5]=b):b=e[5];let d;e[6]!==j||e[7]!==b?(d={queryKey:j,queryFn:b,retry:!1},e[6]=j,e[7]=b,e[8]=d):d=e[8];const y=we(d),S=Z.commerceDiscoveryVirtualMcp(t.id,x);let v;e[9]!==l||e[10]!==x?(v=async()=>{const _=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return xe(_)},e[9]=l,e[10]=x,e[11]=v):v=e[11];let T;e[12]!==S||e[13]!==v?(T={queryKey:S,queryFn:v,retry:!1},e[12]=S,e[13]=v,e[14]=T):T=e[14];const I=we(T);let R;e[15]!==l?(R=async _=>{const O=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:_}});return xe(O)},e[15]=l,e[16]=R):R=e[16];let H;e[17]!==y||e[18]!==I?(H=_=>{m(_),g(null),y.refetch(),I.refetch()},e[17]=y,e[18]=I,e[19]=H):H=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=_=>{g(_ instanceof Error?_.message:"Commerce Discovery setup failed.")},e[20]=E):E=e[20];let $;e[21]!==R||e[22]!==H?($={mutationFn:R,retry:!1,onSuccess:H,onError:E},e[21]=R,e[22]=H,e[23]=$):$=e[23];const L=Se($),U=!!y.data.item&&!!I.data.item;let Q;e[24]!==L?(Q=_=>{const O=be(_);if(!O.ok){g(O.error);return}g(null),L.mutate(O.value)},e[24]=L,e[25]=Q):Q=e[25];const M=Q;let G;e[26]!==s||e[27]!==M||e[28]!==U?(G=_=>{!_||h.current||U||!s||(h.current=!0,M(s))},e[26]=s,e[27]=M,e[28]=U,e[29]=G):G=e[29];const F=G;let V;e[30]!==M||e[31]!==r?(V=_=>{_.preventDefault(),M(r)},e[30]=M,e[31]=r,e[32]=V):V=e[32];const P=V;let D;e[33]!==p||e[34]!==u?.reportApp||e[35]!==x?(D=u?.reportApp??{connectionId:p,virtualMcpId:x,toolName:nt},e[33]=p,e[34]=u?.reportApp,e[35]=x,e[36]=D):D=e[36];const w=D;let K;e[37]!==o||e[38]!==t.slug||e[39]!==w.connectionId||e[40]!==w.toolName||e[41]!==w.virtualMcpId?(K=()=>{localStorage.setItem(Ze.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:w.virtualMcpId,main:Xe(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]=K):K=e[42];const B=K;if(U){const _=s??r;let O;return e[43]!==B||e[44]!==t||e[45]!==w||e[46]!==_?(O=i.jsx(mn,{org:t,reportApp:w,onOpenReport:B,siteUrl:_}),e[43]=B,e[44]=t,e[45]=w,e[46]=_,e[47]=O):O=e[47],O}if(s){let _;e[48]!==s?(_=be(s),e[48]=s,e[49]=_):_=e[49];const O=_;if(!O.ok){const he=`Commerce setup will continue for ${t.name}.`;let ie;e[50]!==he?(ie=i.jsx(ne,{title:"Commerce diagnostics",description:he}),e[50]=he,e[51]=ie):ie=e[51];let oe;e[52]!==O.error?(oe=i.jsx(ge,{message:O.error}),e[52]=O.error,e[53]=oe):oe=e[53];let re;e[54]!==P||e[55]!==f||e[56]!==L.isPending||e[57]!==r?(re=i.jsx(ye,{siteUrl:r,error:f,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P}),e[54]=P,e[55]=f,e[56]=L.isPending,e[57]=r,e[58]=re):re=e[58];let ce;return e[59]!==ie||e[60]!==oe||e[61]!==re?(ce=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[ie,oe,re]})}),e[59]=ie,e[60]=oe,e[61]=re,e[62]=ce):ce=e[62],ce}const X=`Commerce Discovery is being prepared for ${O.value}.`;let W;e[63]!==X?(W=i.jsx(ne,{title:"Commerce diagnostics",description:X}),e[63]=X,e[64]=W):W=e[64];let Y;e[65]!==P||e[66]!==f||e[67]!==L||e[68]!==r?(Y=f?i.jsxs(i.Fragment,{children:[i.jsx(ge,{message:f}),i.jsx(ye,{siteUrl:r,error:null,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P})]}):i.jsx(Ee,{variant:"setup"}),e[65]=P,e[66]=f,e[67]=L,e[68]=r,e[69]=Y):Y=e[69];let ae;return e[70]!==W||e[71]!==Y||e[72]!==F?(ae=i.jsx(J,{children:i.jsxs("div",{ref:F,className:"grid gap-10",children:[W,Y]})}),e[70]=W,e[71]=Y,e[72]=F,e[73]=ae):ae=e[73],ae}const q=`Commerce setup will continue for ${t.name}.`;let C;e[74]!==q?(C=i.jsx(ne,{title:"Commerce diagnostics",description:q}),e[74]=q,e[75]=C):C=e[75];let z;e[76]!==P||e[77]!==f||e[78]!==L.isPending||e[79]!==r?(z=i.jsx(ye,{siteUrl:r,error:f,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P}),e[76]=P,e[77]=f,e[78]=L.isPending,e[79]=r,e[80]=z):z=e[80];let k;return e[81]!==C||e[82]!==z?(k=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[C,z]})}),e[81]=C,e[82]=z,e[83]=k):k=e[83],k}function ye(n){const e=N.c(22),{siteUrl:t,error:s,isSubmitting:o,onSiteUrlChange:a,onSubmit:l}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=r):r=e[0];let c;e[1]!==a?(c=j=>a(j.target.value),e[1]=a,e[2]=c):c=e[2];const u=!!s;let m;e[3]!==o||e[4]!==t||e[5]!==c||e[6]!==u?(m=i.jsx(et,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:c,placeholder:"https://example.com","aria-invalid":u,disabled:o}),e[3]=o,e[4]=t,e[5]=c,e[6]=u,e[7]=m):m=e[7];let f;e[8]!==s?(f=s?i.jsx(ge,{message:s}):null,e[8]=s,e[9]=f):f=e[9];let g;e[10]!==m||e[11]!==f?(g=i.jsxs("div",{className:"grid gap-2",children:[r,m,f]}),e[10]=m,e[11]=f,e[12]=g):g=e[12];let h;e[13]!==o?(h=o?i.jsx(en,{}):i.jsxs(i.Fragment,{children:["Continue",i.jsx(Ue,{size:16})]}),e[13]=o,e[14]=h):h=e[14];let p;e[15]!==o||e[16]!==h?(p=i.jsx(te,{type:"submit",size:"xl",className:"w-full",disabled:o,children:h}),e[15]=o,e[16]=h,e[17]=p):p=e[17];let x;return e[18]!==l||e[19]!==g||e[20]!==p?(x=i.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[g,p]}),e[18]=l,e[19]=g,e[20]=p,e[21]=x):x=e[21],x}function mn(n){const e=N.c(24),{org:t,reportApp:s,onOpenReport:o,siteUrl:a}=n,{data:l}=ve.useSession(),r=l?.user?.email;let c;e[0]!==a||e[1]!==r?(c=Vt({siteUrl:a,email:r}),e[0]=a,e[1]=r,e[2]=c):c=e[2];const u=c;let m;e[3]!==u?(m=i.jsx(Zt,{href:u}),e[3]=u,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(ne,{}),e[5]=f):f=e[5];let g;e[6]!==t||e[7]!==s.connectionId?(g=i.jsx(Bt,{org:t,cdConnectionId:s.connectionId}),e[6]=t,e[7]=s.connectionId,e[8]=g):g=e[8];let h;e[9]!==u?(h=i.jsx(Jt,{className:"md:hidden",href:u}),e[9]=u,e[10]=h):h=e[10];const p=!s.virtualMcpId;let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(Ue,{size:18}),e[11]=x):x=e[11];let j;e[12]!==o||e[13]!==p?(j=i.jsxs(te,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",x]}),e[12]=o,e[13]=p,e[14]=j):j=e[14];let b;e[15]!==h||e[16]!==j?(b=i.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[h,j]}),e[15]=h,e[16]=j,e[17]=b):b=e[17];let d;e[18]!==b||e[19]!==g?(d=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:block",children:[f,g,b]}),e[18]=b,e[19]=g,e[20]=d):d=e[20];let y;return e[21]!==d||e[22]!==m?(y=i.jsx(J,{align:"fill",visual:m,children:d}),e[21]=d,e[22]=m,e[23]=y):y=e[23],y}function ge(n){const e=N.c(2),{message:t}=n;let s;return e[0]!==t?(s=i.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=s):s=e[1],s}export{Cs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as b,w as N,K as k,k as z,j as s,r as M,B as T,l as v}from"./index-CurNB2HG.js";import{a as I,b as S,D,c as E,d as R}from"./dialog-BFjL_my-.js";import{S as _}from"./chat-context-Dz9rhizY.js";import{i as $}from"./ChevronUp-CiXD4kQk.js";import{a as A}from"./Eye-B92Ff4dY.js";import{u as B}from"./studio-tools-BvQ8Bli1.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=N(),l=B();let o;i[0]!==e.id?(o=k.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",w=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return w.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(D,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:w.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(E,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(R,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as fe,aE as Ie,b6 as Ae,C as le,aC as De,c as P,j as t,i as ge,B as V,r as q,l as je,w as J,p as $e,K as ne,b as Y,aa as ce,q as Pe,b7 as Oe,E as ze,e as Me,b8 as Ee,m as Ve,G as Ue,F as Fe,t as X,b9 as Re}from"./index-CurNB2HG.js";import{a as Le}from"./extract-connection-data-Bau_aQvM.js";import{E as ve}from"./empty-state-Lmcbk0Zv.js";import{E as Be,c as He,r as Ge,b as We,d as Xe}from"./connection-form-helpers-BW7AB-E3.js";import{c as qe,S as Ke,V as Qe}from"./index-EwbYDv-_.js";import{u as be,T as Je}from"./tools-list-DC6csFT2.js";import{u as Ye}from"./use-members-blURElyD.js";import{A as Ze}from"./avatar-Bh53txVX.js";import{a as Ne,b as ye,u as et}from"./use-connection-Cvfufzsw.js";import{u as _e}from"./use-mcp-client-BbOUwA1H.js";import{a as tt}from"./use-mcp-tools-xGr1pN0n.js";import{a as st}from"./use-mcp-prompts-Y5le4syR.js";import{i as nt,a as ot}from"./mcp-oauth-B5dnAc7V.js";import{I as oe}from"./integration-icon-Dpj2NSXY.js";import{s as it}from"./Plus-CQOl41pg.js";import{z as at,C as rt,ag as lt,a5 as ct}from"./agent-icon-pz8iT5cD.js";import{a as Ce,s as dt}from"./Settings02-ozrzAwut.js";import{s as ae}from"./Trash01-z6De146C.js";import{d as mt,c as ut,b as xt,S as pt,a as ht}from"./sheet-Djk8ol5s.js";import{F as L,b as B,c as H,d as E,f as G,e as ft,a as gt}from"./form-B6Nf7hvD.js";import{I as W}from"./input-RRjvrcUF.js";import{u as jt,D as vt}from"./use-delete-connection-CNA7qawq.js";import{c as bt,C as Nt,B as yt,a as _t,b as Ct,d as St,e as wt}from"./monitoring-stats-row-BnDnFbz0.js";import{u as kt}from"./studio-tools-BvQ8Bli1.js";import{u as Tt}from"./use-virtual-mcp-CLJ6qnG1.js";import{i as Se}from"./ChevronRight-DYe9AFXl.js";import{a as we}from"./Users03-CJuVy8Iz.js";import{T as ee,a as It,b as te,c as At}from"./tabs-DOJ7e6Z7.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as Dt}from"./ZapSquare-DOK7F1oe.js";import{c as $t}from"./Tool01-WsqNh4er.js";import{g as re,M as Pt}from"./types-CDn4NSje.js";import{C as Ot}from"./collection-search-JfLpXbmD.js";import{C as zt}from"./card-D_tApM0k.js";import{B as Mt}from"./badge-CdirlPdy.js";import{D as Et,a as Vt,b as Ut,c as de}from"./dropdown-menu-B1DaP6vk.js";import{d as me,b as ue,c as xe,S as pe,a as R}from"./select-BePf1IJF.js";import{i as Ft}from"./CheckCircle-BP2lb3AX.js";import{t as Rt}from"./ChevronDown-CkcGr2qp.js";import{n as Lt}from"./XCircle-DFBcUexW.js";import{s as se}from"./Star01-BoZIiKCL.js";import{s as Bt}from"./XClose-BKWXOZkj.js";import"./index-qZ5-LmpP.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./tooltip-CUlMaf5E.js";import"./ZoomOut-ryBmf3S4.js";import"./Key01-CZVV-ceU.js";import"./auth-xlfJjVrK.js";import"./use-registry-connections-3CHe_VwJ.js";import"./use-organization-settings-B5L78CqV.js";import"./Form-GDlYmtQN.js";import"./index-C_XJPG8Z.js";import"./index-ovnDLwrg.js";import"./index-BdQq_4o_.js";import"./index-BDyN-RAN.js";import"./popover-D7BamlkK.js";import"./ChevronUp-CiXD4kQk.js";import"./SearchMd-Da504yGV.js";import"./use-create-virtual-mcp-CGofqNOQ.js";import"./use-navigate-to-agent-CidcWwFC.js";import"./Eye-B92Ff4dY.js";import"./use-org-auth-client-oMz0ubhe.js";import"./User01-Cvp121NC.js";import"./use-collections-w44ZyJ1t.js";import"./AlertCircle-BMCh3ayd.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ChevronLeft-Cgw9JZYG.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Upload01-C4sYhZ0M.js";import"./Users01-DcrlsWI1.js";import"./X-DgKWdqZ1.js";import"./Zap-Cxu6aoRs.js";import"./label-DrXdAtn0.js";import"./alert-dialog-CkCCiKt9.js";const Ht=fe({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Gt=[{name:"MCP_CONFIGURATION",inputSchema:fe({}),outputSchema:Ht}];function Wt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const l=be(c),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",d=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let f;e[2]!==d?(f=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=f):f=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==a?(S=()=>a(n),e[24]=n,e[25]=a,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let h;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(h=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=h):h=e[40];let w;return e[41]!==h||e[42]!==f||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:f,children:[g,j,h]}),e[41]=h,e[42]=f,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Xt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ce,{size:13}),e[8]=c):c=e[8];let l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:c})}),e[9]=i,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function qt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:c,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==c||e[6]!==p?(d=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=c,e[6]=p,e[7]=d):d=e[7];let f;e[8]!==x||e[9]!==d?(f=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=f):f=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(q.Suspense,{fallback:t.jsx(Xt,{instance:N,onConfigure:a}),children:t.jsx(Wt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==f||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,v]}),e[24]=f,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(1),{connectionId:n,orgId:a,timeframe:r}=s,o=kt(),i=Qt(r),{data:c}=$e({queryKey:ne.connectionActivity(n,r,a),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:i.startDate.toISOString(),endDate:i.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(c?.logs??[],i),u=l.data,x=l.totalCalls>0;let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=p):p=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),p]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Nt,{config:Jt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(Ct,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Zt(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ss(s){const e=P.c(13),{connectionId:n}=s,[a,r]=q.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let c;e[1]!==a?(c=Kt.map(d=>t.jsx("button",{type:"button",onClick:()=>r(d.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.label},d.value)),e[1]=a,e[2]=c):c=e[2];let l;e[3]!==c?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ts,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==a?(x=t.jsx(q.Suspense,{fallback:u,children:t.jsx(Yt,{connectionId:n,orgId:o.id,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=a,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==c||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,l,u]}),e[11]=o,e[12]=c,e[13]=l,e[14]=x):x=e[14],x}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=c=>t.jsx(ns,{virtualMcp:c,org:a},c.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let l;return e[4]!==a.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const l=_e(c),u=Ne(a);let x;e[4]!==u||e[5]!==a?(x=u?ke(u):a,e[4]=u,e[5]=a,e[6]=x):x=e[6];const p=x,[d,f]=q.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==d||e[12]!==n){const S=(n??[]).filter(rs),y=d.toLowerCase().trim(),I=y?S.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=C):C=e[21],e[22]!==d?(j=t.jsx(Ot,{value:d,onChange:f,placeholder:"Search apps...",onKeyDown:C}),e[22]=d,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(h=>{const w=re(h._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=d,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const l=c;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),d=Ne(o??"");let f;e[4]!==d||e[5]!==o?(f=d?ke(d):o,e[4]=d,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let h;e[29]!==C?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=h):h=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let z;e[36]!==l?(z=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=z):z=e[37];let O;e[38]!==z?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[38]=z,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(cs):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let M;e[42]!==A?(M=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=M):M=e[43];let U;return e[44]!==k||e[45]!==h||e[46]!==w||e[47]!==O||e[48]!==M?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,h,w,O,M]})}),e[44]=k,e[45]=h,e[46]=w,e[47]=O,e[48]=M,e[49]=U):U=e[49],U}function cs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ds(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ms(s){return re(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=i):i=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),i=ce({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const d=new URL(i);return d.hostname==="api.githubcopilot.com"&&d.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(B,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(G,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(W,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(G,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(Be,{value:d.value??[],onChange:d.onChange})}),t.jsx(G,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),"Authenticated via OAuth",t.jsx(Rt,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:a,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&d.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>d.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Bt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(W,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ft,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(G,{})]})})]})}function ps(s){return s.command==="npx"}function hs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function fs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Re(s.connection_headers)){const a=s.connection_headers,r=Ge(a.envVars);if(ps(a)){const i=hs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=fs(a);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=We(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:c}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),d=jt({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=q.useState(null),[v,b]=q.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=f??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=qe(k,Gt),h=Ue({resolver:Fe(He),values:he(f??s)}),w=h.formState.isDirty,z=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=gs(D),F=f?.id??e;await x.update.mutateAsync({id:F,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){X.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:D}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:D}})}else await x.update.mutateAsync({id:m,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),X.success("Authentication successful")},M=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const $=await m.text();X.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),X.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),X.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...d}),t.jsx(mt,{open:f!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ut,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(xt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(pt,{className:"text-base",children:f?.title??s.title}),t.jsx(ht,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(gt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:h.control,name:"title",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Name"}),t.jsx(E,{children:t.jsx(W,{...m})}),t.jsx(G,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(E,{children:t.jsx(W,{...m,value:m.value||""})}),t.jsx(G,{})]})})]}),t.jsx(xs,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:f??s,form:h,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=f??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:c,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>d.requestDelete(m),onToggleStatus:async(m,D)=>{try{await x.update.mutateAsync({id:m.id,data:{status:D}}),X.success(D==="active"?"Connection enabled":"Connection disabled")}catch{X.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=c[0]??s,D=m.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,F=`${D} (${$})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await nt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=Me(a),{org:i}=J(),c=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",d=p||null;let f;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(f={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=f):f=s[7];const g=_e(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(Ss):(x?.tools??[]).map(Cs);e:{if(u.length<=1){j=A;break e}const M=new Set,U=[],m=ys;for(const D of u){const $=D.id===p?A:m(D.tools);for(const F of $)M.has(F.name)||(M.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const C=k;let h;s[23]!==I?.resources?(h=I?.resources??[],s[23]=I?.resources,s[24]=h):h=s[24];let w;s[25]!==h?(w=h.map(bs),s[25]=h,s[26]=w):w=s[26];const z=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==c.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==z||s[37]!==u?(O=t.jsx(js,{org:o,connection:x,connectionId:p,isUpdating:c.update.isPending,tools:N,prompts:C,resources:z,siblings:u}),s[30]=c.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=z,s[37]=u,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function lo(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{lo as default};
|