decocms 2.316.3 → 2.318.0
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-CIhNxTTl.js → AlertCircle-D7In04VZ.js} +1 -1
- package/dist/client/assets/{Archive-DOUYQc8s.js → Archive-DaxWSUle.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-B1LOVgdw.js → ArrowNarrowLeft-I0Rr4fru.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BXCPGKW0.js → ArrowUpRight-Cl4DoJ1w.js} +1 -1
- package/dist/client/assets/{Check-CV-PYcTx.js → Check-nv67ec3-.js} +1 -1
- package/dist/client/assets/{CheckCircle-DSnO-ZRF.js → CheckCircle-ByasFo1p.js} +1 -1
- package/dist/client/assets/{ChevronDown-d1XZuPx_.js → ChevronDown-Brvsr3Fl.js} +1 -1
- package/dist/client/assets/{ChevronRight-OA6RE0bm.js → ChevronRight-PLlU1t0W.js} +1 -1
- package/dist/client/assets/{ChevronUp-BPXArXn4.js → ChevronUp-VDqvRLBN.js} +1 -1
- package/dist/client/assets/{Container-D2TENyxw.js → Container-DTioRpeZ.js} +1 -1
- package/dist/client/assets/{DotsVertical-CkjufnVc.js → DotsVertical-DSgmYETN.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CdHsorDG.js → LayoutLeft-CG8cspKX.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C_Dp-9up.js → LinkExternal01-FKIQuNsM.js} +1 -1
- package/dist/client/assets/{Lock01-DbAsRqsB.js → Lock01-XwPtPsiy.js} +1 -1
- package/dist/client/assets/{Palette-TGj5HRZ0.js → Palette-DGf3gs0h.js} +1 -1
- package/dist/client/assets/{Play-Bqd6KoLL.js → Play-BUgAN2i6.js} +1 -1
- package/dist/client/assets/{Plus-DU1c_qIh.js → Plus-Bk1OvOXE.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-D_ZQRj8n.js → RefreshCcw01-CeTSzQsT.js} +1 -1
- package/dist/client/assets/{SearchMd-D2HCX03E.js → SearchMd-Bo6RzH5Q.js} +1 -1
- package/dist/client/assets/{Settings02-DvgEzqo-.js → Settings02-uL3uu5-7.js} +1 -1
- package/dist/client/assets/{Shield01-Bam4M-YR.js → Shield01-OH6-JWjw.js} +1 -1
- package/dist/client/assets/{Star01-eRHoMpoz.js → Star01-_us4XpQn.js} +1 -1
- package/dist/client/assets/{Sun-CK-d8u_d.js → Sun-Zv-PWUwn.js} +1 -1
- package/dist/client/assets/{Tool01-DXA_DwTO.js → Tool01-DUGZCBMz.js} +1 -1
- package/dist/client/assets/{Trash01-C98MAtHO.js → Trash01-AR9qKMZU.js} +1 -1
- package/dist/client/assets/{User01-Ci3O3rgG.js → User01-3xBsy6wV.js} +1 -1
- package/dist/client/assets/{Users03-BE87UJzh.js → Users03-B0r4bSLn.js} +1 -1
- package/dist/client/assets/{X-C8gNxXPZ.js → X-DDQYEU6o.js} +1 -1
- package/dist/client/assets/{XCircle-DcF4hahE.js → XCircle-B14ynTvz.js} +1 -1
- package/dist/client/assets/{XClose-DM_WC7Hv.js → XClose-DwaprZxL.js} +1 -1
- package/dist/client/assets/{Zap-BtcijgPp.js → Zap-EburzyyI.js} +1 -1
- package/dist/client/assets/{ZapSquare-ugGzur7h.js → ZapSquare-DgAVTy7i.js} +1 -1
- package/dist/client/assets/{accordion-eVPt3AxV.js → accordion-CNGIXlRh.js} +1 -1
- package/dist/client/assets/{agent-icon-BaSFWyhf.js → agent-icon-CDOpQPVP.js} +1 -1
- package/dist/client/assets/{agents-list-Bs-Qg8TC.js → agents-list-Bie-B6KO.js} +1 -1
- package/dist/client/assets/{ai-providers-goX3mYeT.js → ai-providers-sx9fCpX9.js} +1 -1
- package/dist/client/assets/{alert-dialog-B28bzmjR.js → alert-dialog-DzUiFLm5.js} +1 -1
- package/dist/client/assets/{auth-catchall-D8AsZk2D.js → auth-catchall-Db6wnMxY.js} +1 -1
- package/dist/client/assets/{automation-list-row-Cw-nvI9t.js → automation-list-row-DA67TUpG.js} +1 -1
- package/dist/client/assets/{automations-CIogEm_v.js → automations-D5gbOL8y.js} +1 -1
- package/dist/client/assets/{avatar-BccIYZD6.js → avatar-JFkuXk7Y.js} +1 -1
- package/dist/client/assets/{badge-B7UYPtu8.js → badge-D0TDvkU5.js} +1 -1
- package/dist/client/assets/{brand-context-GjgBMUq2.js → brand-context-VXYVmQXI.js} +1 -1
- package/dist/client/assets/{card-e_SApZv-.js → card-NxdWcP2Y.js} +1 -1
- package/dist/client/assets/{chat-context-BGitM-1g.js → chat-context-BpeMEIll.js} +1 -1
- package/dist/client/assets/{checkbox-BwDKjjzH.js → checkbox-q_vRqr9W.js} +1 -1
- package/dist/client/assets/{collection-detail-CWgaM8qe.js → collection-detail-C0n6W9bV.js} +1 -1
- package/dist/client/assets/{collection-display-button-C5UVbYH9.js → collection-display-button-BDkguG0j.js} +1 -1
- package/dist/client/assets/{collection-search-BSC882az.js → collection-search-B_PTLHi8.js} +1 -1
- package/dist/client/assets/{collection-search-CXkehpMy.js → collection-search-CMNBGaQC.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DBwS-ncE.js → collection-table-wrapper-CCajoTAy.js} +1 -1
- package/dist/client/assets/{collection-tabs-BIBHPtug.js → collection-tabs-CAm-q3uz.js} +1 -1
- package/dist/client/assets/{collections-CgxUTBvp.js → collections-CreMYLs8.js} +1 -1
- package/dist/client/assets/{command-DTQGiHmi.js → command-B9OPYg11.js} +1 -1
- package/dist/client/assets/{connection-card-BrngMsBW.js → connection-card-C06IRcu3.js} +1 -1
- package/dist/client/assets/{connection-detail-CCeKFmMl.js → connection-detail-z9x5FbvM.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DlHOUpQU.js → connection-form-helpers-n0-EInK6.js} +1 -1
- package/dist/client/assets/{connections-BZs9OYYi.js → connections-CH6W6L6i.js} +1 -1
- package/dist/client/assets/{constants-aoAzOZlb.js → constants-B0L3jJTH.js} +1 -1
- package/dist/client/assets/{constants-CiNOCN3_.js → constants-fVwC9Czh.js} +1 -1
- package/dist/client/assets/{dialog-D9JDljl1.js → dialog-qtKrSwKA.js} +1 -1
- package/dist/client/assets/{domain-settings-b037kHqN.js → domain-settings-P92TIE-X.js} +1 -1
- package/dist/client/assets/{drawer-CPYyZD60.js → drawer-B0OHUPPF.js} +1 -1
- package/dist/client/assets/{dropdown-menu-v2GBEFa6.js → dropdown-menu-BnaZE7Qd.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DmLmlikq.js → dynamic-plugin-layout-BLT1-t7U.js} +1 -1
- package/dist/client/assets/{empty-state-Qo0QLKm5.js → empty-state-BCr9v4T1.js} +1 -1
- package/dist/client/assets/{empty-state-DzxY5CBA.js → empty-state-Bd4cGUaH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C2xJ0Fj_.js → extract-connection-data-D7Vkjtul.js} +1 -1
- package/dist/client/assets/{features-_6JkrMwd.js → features-BMjb9wKO.js} +1 -1
- package/dist/client/assets/{form-B4UBGEp5.js → form-dz7U0CZK.js} +1 -1
- package/dist/client/assets/{general-BHYjmLRM.js → general-jiXD2EYY.js} +1 -1
- package/dist/client/assets/index-B1sAFND8.js +1 -0
- package/dist/client/assets/{index-cnKKVRZj.js → index-BK7vZkwz.js} +1 -1
- package/dist/client/assets/index-BMBxMDI7.js +1 -0
- package/dist/client/assets/index-BOaGE1aK.js +1 -0
- package/dist/client/assets/{index-C45moMcG.js → index-BTxYkYBr.js} +1 -1
- package/dist/client/assets/{index-B85sFotX.js → index-CB6J7z90.js} +1 -1
- package/dist/client/assets/{index--m7BENdv.js → index-CHYuwbgr.js} +1 -1
- package/dist/client/assets/{index-DoCu980b.js → index-CtMy8ETw.js} +1 -1
- package/dist/client/assets/{index-CNmK2UE6.js → index-DTLkaJxe.js} +1 -1
- package/dist/client/assets/{index-yZgZglUT.js → index-DrMvBZMW.js} +1 -1
- package/dist/client/assets/index-DtJ8d1aI.css +1 -0
- package/dist/client/assets/{index-DTJ_e6nL.js → index-KBbmKsy_.js} +1 -1
- package/dist/client/assets/{index-Ciepzli1.js → index-OK75u_aS.js} +9 -9
- package/dist/client/assets/{index-CsB6QrBB.js → index-dmkCn37I.js} +2 -2
- package/dist/client/assets/{index-DXRwI8-Q.js → index-jo98Roqy.js} +1 -1
- package/dist/client/assets/index-xstkyz4B.js +547 -0
- package/dist/client/assets/{index-D379-Ra5.js → index-y8RdJ-mt.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-C-liTxtI.js → infiniteQueryObserver-BGrXNOzy.js} +1 -1
- package/dist/client/assets/{input-C-eXOMYP.js → input-C0h7cNmt.js} +1 -1
- package/dist/client/assets/{integration-icon-Ckowj_b4.js → integration-icon-PH7vkQ9v.js} +1 -1
- package/dist/client/assets/{label-C3Wj5fRJ.js → label-C5ENUwLS.js} +1 -1
- package/dist/client/assets/{layout-DyhaKtIo.js → layout-BamLP3Zj.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-B7oEpItL.js → lean-canvas-recruit-modal-CZMvychF.js} +1 -1
- package/dist/client/assets/{login-BfSyXKzY.js → login-uG1nFl44.js} +1 -1
- package/dist/client/assets/{members-2l-bN7R0.js → members-fSWoT1uJ.js} +1 -1
- package/dist/client/assets/{monaco-editor-2DI4BCuN.js → monaco-editor-eJWlN-2G.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-O0i0E0sX.js → monitoring-stats-row-CYIwSwNt.js} +1 -1
- package/dist/client/assets/{oauth-callback-FXnsziuV.js → oauth-callback-DIrOvKws.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B_mMMBGP.js → oauth-callback-ai-provider-CNRYQgK6.js} +1 -1
- package/dist/client/assets/{onboarding-C3R9iT7_.js → onboarding-BBHY-5YM.js} +1 -1
- package/dist/client/assets/{org-layout-C5vsvaCJ.js → org-layout-D7UrUDGp.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-TVmKREDe.js → org-plugin-layout-DqfPxjfL.js} +1 -1
- package/dist/client/assets/{pair-C-p-DbTv.js → pair-BJSIhyuY.js} +2 -2
- package/dist/client/assets/{plugin-empty-state-DsUYr3t-.js → plugin-empty-state-BP62tfBa.js} +1 -1
- package/dist/client/assets/{plugin-header-92zfiruf.js → plugin-header-BPz_4aBZ.js} +1 -1
- package/dist/client/assets/{plugin-layout-Ci2Gezpo.js → plugin-layout-BvUSBgIT.js} +1 -1
- package/dist/client/assets/{popover-DaEdoMLv.js → popover-9waMMdOC.js} +1 -1
- package/dist/client/assets/{profile-C64u-o9k.js → profile-BW02PQou.js} +1 -1
- package/dist/client/assets/{project-app-view-__Y1p7Pu.js → project-app-view-kQIX2VaC.js} +1 -1
- package/dist/client/assets/registry-BohcIySS.js +2 -0
- package/dist/client/assets/{registry-layout-BA3b7Khm.js → registry-layout-C0qSEWQT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CKWnvSJk.js → required-auth-layout-BVmXc_2r.js} +1 -1
- package/dist/client/assets/{reset-password-BqmAkVAO.js → reset-password-B1_rk5lV.js} +1 -1
- package/dist/client/assets/{roles-99Si_WzF.js → roles-D5G81cT_.js} +1 -1
- package/dist/client/assets/{scroll-area-BMqRsz1X.js → scroll-area-xE7hc-8l.js} +1 -1
- package/dist/client/assets/{search-input-DsCiCzet.js → search-input-C1skYPKA.js} +1 -1
- package/dist/client/assets/{select-B7los4LB.js → select-BjC54T39.js} +1 -1
- package/dist/client/assets/{select-model-CC6Vrb5m.js → select-model-CLZn_-xL.js} +1 -1
- package/dist/client/assets/{settings-layout-nfV08EHo.js → settings-layout-BhnclKCP.js} +1 -1
- package/dist/client/assets/{settings-section-CkhTzM-S.js → settings-section-CijJZPn7.js} +1 -1
- package/dist/client/assets/{shell-layout-kk9CghF9.js → shell-layout-DU81GX4X.js} +1 -1
- package/dist/client/assets/{sidebar-YQQk47mU.js → sidebar-sY4KII-w.js} +1 -1
- package/dist/client/assets/{skeleton-DyIf1f58.js → skeleton-De5l7OL1.js} +1 -1
- package/dist/client/assets/{spinner-Cx3i9jg1.js → spinner-CsMegR0e.js} +1 -1
- package/dist/client/assets/{sso-BdnItz6L.js → sso-CrRO0aCM.js} +1 -1
- package/dist/client/assets/{store-BkZwsjod.js → store-CJkx6fS3.js} +1 -1
- package/dist/client/assets/store-registry-DoOjurxP.js +2 -0
- package/dist/client/assets/{switch-Ba58imnw.js → switch-Dg8MplKB.js} +1 -1
- package/dist/client/assets/{table-BR31N60P.js → table-CcD56_bf.js} +1 -1
- package/dist/client/assets/{tabs-DgJzKZHT.js → tabs-Bun7zdDt.js} +1 -1
- package/dist/client/assets/{task-status-BAiKcdqG.js → task-status-n57TCkuM.js} +1 -1
- package/dist/client/assets/{textarea-CT2Jghcd.js → textarea-Da3AWsK6.js} +1 -1
- package/dist/client/assets/{toggle-group-BwCswIiA.js → toggle-group-DDewxrST.js} +1 -1
- package/dist/client/assets/{tools-list-Dkz550hJ.js → tools-list-ufT0EENN.js} +1 -1
- package/dist/client/assets/{tooltip-v9goNoMa.js → tooltip-DHpEGVi8.js} +1 -1
- package/dist/client/assets/{types-D30V4GBK.js → types-BrFLFb5i.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DuJ557zy.js → use-ai-providers-Cf9shvYI.js} +1 -1
- package/dist/client/assets/{use-collections-CfoSjDkZ.js → use-collections-XDqst4E_.js} +1 -1
- package/dist/client/assets/{use-connection-CL8Sz4aB.js → use-connection-BCPpnVMX.js} +1 -1
- package/dist/client/assets/{use-copy-9B_lKCQP.js → use-copy-BNSIRmV_.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B4YkhF26.js → use-create-virtual-mcp-DdlYO5qT.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CnKA4yL_.js → use-debounced-autosave-BnUZVD_o.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CKsjNSwH.js → use-decopilot-events-DTwuBO8M.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CdrzrkWw.js → use-delete-connection-B1f9N3vg.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BYU0Szfl.js → use-infinite-scroll-ByL07kWP.js} +1 -1
- package/dist/client/assets/{use-list-state-BV6nWWeI.js → use-list-state-D1Op5rZf.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C0h3zeNG.js → use-mcp-tools-a-ZvbrGo.js} +1 -1
- package/dist/client/assets/{use-members-Bc88CE0J.js → use-members-BGu0mh45.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D3pu_YG_.js → use-navigate-to-agent-DjWaqrlh.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DKocDk2P.js → use-org-auth-client-B7YA_80Y.js} +1 -1
- package/dist/client/assets/{use-org-sso-Cow3Y2YN.js → use-org-sso-CWD9kAdD.js} +1 -1
- package/dist/client/assets/{use-organization-roles-B-MXbHky.js → use-organization-roles-BQMmdy5c.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BtgJutO3.js → use-organization-settings-C2ni1vuh.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CGJfCg9t.js → use-registry-connections-DeY5Qm5r.js} +1 -1
- package/dist/client/assets/{use-status-sounds-IPRVjHSk.js → use-status-sounds-CBWZKYGa.js} +1 -1
- package/dist/client/assets/{use-tasks-LPt7s23P.js → use-tasks-DZibCf5w.js} +1 -1
- package/dist/client/assets/{use-view-mode-NK71s2Nx.js → use-view-mode-C21WimLS.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CcbuH5vn.js → use-virtual-mcp-BVVlTr3L.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B4rOzvqQ.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DVCwsKmm.js +1 -0
- package/dist/client/assets/{user-CHg0uxVs.js → user-B1UpgZbT.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Ck5p4f38.js → view-mode-toggle-CY3mqueQ.js} +1 -1
- package/dist/client/assets/{workflow-DBHhsoUK.js → workflow-D4BXnu1J.js} +1 -1
- package/dist/client/assets/workflow-detail-CCg_qRjv.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
- package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
- package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
- package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
- package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
- package/dist/server/node_modules/{xtend → pg}/LICENSE +7 -6
- package/dist/server/node_modules/pg/README.md +95 -0
- package/dist/server/node_modules/pg/esm/index.mjs +20 -0
- package/dist/server/node_modules/pg/lib/client.js +743 -0
- package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
- package/dist/server/node_modules/pg/lib/connection.js +221 -0
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
- package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
- package/dist/server/node_modules/pg/lib/defaults.js +91 -0
- package/dist/server/node_modules/pg/lib/index.js +73 -0
- package/dist/server/node_modules/pg/lib/native/client.js +323 -0
- package/dist/server/node_modules/pg/lib/native/index.js +2 -0
- package/dist/server/node_modules/pg/lib/native/query.js +165 -0
- package/dist/server/node_modules/pg/lib/query.js +252 -0
- package/dist/server/node_modules/pg/lib/result.js +109 -0
- package/dist/server/node_modules/pg/lib/stream.js +83 -0
- package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
- package/dist/server/node_modules/pg/lib/utils.js +217 -0
- package/dist/server/node_modules/pg/package.json +76 -0
- package/dist/server/node_modules/slice-ansi/index.d.ts +19 -0
- package/dist/server/node_modules/slice-ansi/index.js +260 -0
- package/dist/server/node_modules/{ansi-styles → slice-ansi}/license +1 -0
- package/dist/server/node_modules/slice-ansi/package.json +59 -0
- package/dist/server/node_modules/slice-ansi/readme.md +54 -0
- package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +752 -0
- package/package.json +1 -1
- package/dist/client/assets/index-9VIcQuRp.js +0 -1
- package/dist/client/assets/index-BJOFaTKm.js +0 -1
- package/dist/client/assets/index-Bo94M6wo.css +0 -1
- package/dist/client/assets/index-D5NG6paH.js +0 -547
- package/dist/client/assets/index-DW1EySXD.js +0 -1
- package/dist/client/assets/registry-LJpFNvAF.js +0 -2
- package/dist/client/assets/store-registry-Dr7mJzaG.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BIRZrmWs.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bq4CZEUT.js +0 -1
- package/dist/client/assets/workflow-detail-BIpbk5VT.js +0 -1
- package/dist/server/node_modules/ansi-regex/index.d.ts +0 -33
- package/dist/server/node_modules/ansi-regex/index.js +0 -14
- package/dist/server/node_modules/ansi-regex/package.json +0 -61
- package/dist/server/node_modules/ansi-regex/readme.md +0 -66
- package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
- package/dist/server/node_modules/ansi-styles/index.js +0 -223
- package/dist/server/node_modules/ansi-styles/package.json +0 -54
- package/dist/server/node_modules/ansi-styles/readme.md +0 -173
- package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/dist/server/node_modules/emoji-regex/README.md +0 -107
- package/dist/server/node_modules/emoji-regex/index.d.ts +0 -3
- package/dist/server/node_modules/emoji-regex/index.js +0 -4
- package/dist/server/node_modules/emoji-regex/index.mjs +0 -4
- package/dist/server/node_modules/emoji-regex/package.json +0 -45
- package/dist/server/node_modules/environment/index.d.ts +0 -74
- package/dist/server/node_modules/environment/index.js +0 -47
- package/dist/server/node_modules/environment/license +0 -9
- package/dist/server/node_modules/environment/package.json +0 -74
- package/dist/server/node_modules/environment/readme.md +0 -94
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +0 -18
- package/dist/server/node_modules/escape-string-regexp/index.js +0 -11
- package/dist/server/node_modules/escape-string-regexp/license +0 -9
- package/dist/server/node_modules/escape-string-regexp/package.json +0 -43
- package/dist/server/node_modules/escape-string-regexp/readme.md +0 -29
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +0 -12
- package/dist/server/node_modules/is-fullwidth-code-point/license +0 -9
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +0 -53
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +0 -31
- package/dist/server/node_modules/is-unicode-supported/index.d.ts +0 -12
- package/dist/server/node_modules/is-unicode-supported/index.js +0 -21
- package/dist/server/node_modules/is-unicode-supported/license +0 -9
- package/dist/server/node_modules/is-unicode-supported/package.json +0 -47
- package/dist/server/node_modules/is-unicode-supported/readme.md +0 -35
- package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
- package/dist/server/node_modules/mimic-fn/index.js +0 -13
- package/dist/server/node_modules/mimic-fn/license +0 -9
- package/dist/server/node_modules/mimic-fn/package.json +0 -42
- package/dist/server/node_modules/mimic-fn/readme.md +0 -69
- package/dist/server/node_modules/onetime/index.d.ts +0 -64
- package/dist/server/node_modules/onetime/index.js +0 -44
- package/dist/server/node_modules/onetime/license +0 -9
- package/dist/server/node_modules/onetime/package.json +0 -43
- package/dist/server/node_modules/onetime/readme.md +0 -94
- package/dist/server/node_modules/pg-int8/LICENSE +0 -13
- package/dist/server/node_modules/pg-int8/README.md +0 -16
- package/dist/server/node_modules/pg-int8/index.js +0 -100
- package/dist/server/node_modules/pg-int8/package.json +0 -24
- package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
- package/dist/server/node_modules/postgres-array/index.js +0 -97
- package/dist/server/node_modules/postgres-array/license +0 -21
- package/dist/server/node_modules/postgres-array/package.json +0 -35
- package/dist/server/node_modules/postgres-array/readme.md +0 -43
- package/dist/server/node_modules/postgres-bytea/index.js +0 -33
- package/dist/server/node_modules/postgres-bytea/license +0 -21
- package/dist/server/node_modules/postgres-bytea/package.json +0 -34
- package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
- package/dist/server/node_modules/postgres-date/index.js +0 -116
- package/dist/server/node_modules/postgres-date/license +0 -21
- package/dist/server/node_modules/postgres-date/package.json +0 -33
- package/dist/server/node_modules/postgres-date/readme.md +0 -49
- package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
- package/dist/server/node_modules/postgres-interval/index.js +0 -125
- package/dist/server/node_modules/postgres-interval/license +0 -21
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
- package/dist/server/node_modules/restore-cursor/index.d.ts +0 -11
- package/dist/server/node_modules/restore-cursor/index.js +0 -11
- package/dist/server/node_modules/restore-cursor/license +0 -9
- package/dist/server/node_modules/restore-cursor/package.json +0 -55
- package/dist/server/node_modules/restore-cursor/readme.md +0 -31
- package/dist/server/node_modules/split2/LICENSE +0 -13
- package/dist/server/node_modules/split2/README.md +0 -85
- package/dist/server/node_modules/split2/bench.js +0 -27
- package/dist/server/node_modules/split2/index.js +0 -141
- package/dist/server/node_modules/split2/package.json +0 -39
- package/dist/server/node_modules/split2/test.js +0 -409
- package/dist/server/node_modules/string-width/index.d.ts +0 -39
- package/dist/server/node_modules/string-width/index.js +0 -82
- package/dist/server/node_modules/string-width/license +0 -9
- package/dist/server/node_modules/string-width/package.json +0 -64
- package/dist/server/node_modules/string-width/readme.md +0 -66
- package/dist/server/node_modules/xtend/.jshintrc +0 -30
- package/dist/server/node_modules/xtend/README.md +0 -32
- package/dist/server/node_modules/xtend/immutable.js +0 -19
- package/dist/server/node_modules/xtend/mutable.js +0 -17
- package/dist/server/node_modules/xtend/package.json +0 -55
- package/dist/server/node_modules/xtend/test.js +0 -103
- /package/dist/server/node_modules/{ansi-regex → get-east-asian-width}/license +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as b,s as k,o as E,bL as P,j as i,X as K,aF as _,K as S,x as q}from"./index-
|
|
1
|
+
import{e as b,s as k,o as E,bL as P,j as i,X as K,aF as _,K as S,x as q}from"./index-dmkCn37I.js";import{P as x}from"./index-CHYuwbgr.js";import{d as F}from"./use-organization-settings-C2ni1vuh.js";import{S as I}from"./switch-Dg8MplKB.js";import{n as Q}from"./Container-DTioRpeZ.js";import{b as R,S as w,a as z,d as N}from"./settings-section-CijJZPn7.js";import"./sidebar-sY4KII-w.js";import"./LayoutLeft-CG8cspKX.js";import"./tooltip-DHpEGVi8.js";import"./X-DDQYEU6o.js";import"./constants-fVwC9Czh.js";import"./card-NxdWcP2Y.js";import"./ArrowUpRight-Cl4DoJ1w.js";function T(){const e=b.c(17),{org:t,project:s}=k(),o=E();let u;e[0]!==s.enabledPlugins?(u=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=u):u=e[1];const c=u,l=F();let m;e[2]!==t||e[3]!==s.slug||e[4]!==o?(m=()=>{o.invalidateQueries({queryKey:S.project(t.id,s.slug)}),o.invalidateQueries({queryKey:S.projects(t.id)}),o.invalidateQueries({predicate:n=>{const r=n.queryKey;return r[1]===t.id&&r[3]==="collection"&&r[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=o,e[5]=m):m=e[5];const j=m;let g;e[6]!==j||e[7]!==l||e[8]!==c?(g=(n,r)=>{const d=new Set(c);r?d.add(n):d.delete(n),l.mutate({enabled_plugins:Array.from(d)},{onSuccess:j,onError:D})},e[6]=j,e[7]=l,e[8]=c,e[9]=g):g=e[9];const p=g,y=A,C=$;if(P.length===0){let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=n):n=e[10],n}let a;e[11]!==p||e[12]!==l||e[13]!==c?(a=P.map(n=>{const r=y(n.id),d=C(n.id),h=c.includes(n.id);return i.jsx(R,{title:r?.label??n.id,description:d??void 0,icon:i.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:r?.icon??i.jsx(Q,{size:14})}),onClick:()=>!l.isPending&&p(n.id,!h),action:i.jsx(I,{checked:h,onCheckedChange:v=>p(n.id,v),disabled:l.isPending,onClick:U})},n.id)}),e[11]=p,e[12]=l,e[13]=c,e[14]=a):a=e[14];let f;return e[15]!==a?(f=i.jsx(w,{children:i.jsx(z,{children:a})}),e[15]=a,e[16]=f):f=e[16],f}function U(e){return e.stopPropagation()}function $(e){return P.find(s=>s.id===e)?.description??null}function A(e){const t=K.find(o=>o.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=_.find(o=>o.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function D(e){q.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function L(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(x,{children:i.jsx(x.Content,{children:i.jsx(x.Body,{children:i.jsxs(N,{children:[i.jsx(x.Title,{children:"Plugins"}),i.jsx(T,{})]})})})}),e[0]=t):t=e[0],t}function ne(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(L,{}),e[0]=t):t=e[0],t}export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bV as C,e as f,j as c,C as b,r as d,c as p,aX as j,bW as v,bX as h}from"./index-
|
|
1
|
+
import{bV as C,e as f,j as c,C as b,r as d,c as p,aX as j,bW as v,bX as h}from"./index-dmkCn37I.js";import{L as N}from"./label-C5ENUwLS.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(b,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as ae,s as re,o as ce,z as fe,D as xe,a as de,t as W,x as M,K as Y,j as s,C as se,H as pe,J as X,e as F,r as K,B as H,c as he,M as je,R as ne}from"./index-CsB6QrBB.js";import{P as U}from"./index--m7BENdv.js";import{u as ve}from"./use-org-auth-client-DKocDk2P.js";import{u as be}from"./use-debounced-autosave-CnKA4yL_.js";import{A as ye}from"./avatar-BccIYZD6.js";import{I as me}from"./input-C-eXOMYP.js";import{S as Z,a as J,b as Q,c as Se,d as Ce}from"./settings-section-CkhTzM-S.js";import{D as Ne}from"./domain-settings-b037kHqN.js";import{u as _e,a as oe,D as De,c as ze,S as Ae,v as we,K as Pe,P as Oe,d as Ee,C as Ie,s as ke,b as Te,e as Fe}from"./collection-search-BSC882az.js";import{W as te,i as Le,S as Re,u as $e}from"./constants-CiNOCN3_.js";import{b as ue}from"./use-virtual-mcp-CcbuH5vn.js";import{b as Me,P as Ke,a as qe}from"./popover-DaEdoMLv.js";import{S as Be}from"./skeleton-DyIf1f58.js";import{y as He}from"./agent-icon-BaSFWyhf.js";import{s as Ve}from"./Plus-DU1c_qIh.js";import{a as ge}from"./Users03-BE87UJzh.js";import{i as Ge}from"./X-C8gNxXPZ.js";import{I as ee}from"./integration-icon-Ckowj_b4.js";import{u as Ue,c as Qe}from"./use-organization-settings-BtgJutO3.js";import{c as We,b as Ye,d as Ze,f as Je,e as Xe,g as et,a as tt,A as st}from"./alert-dialog-B28bzmjR.js";import"./sidebar-YQQk47mU.js";import"./LayoutLeft-CdHsorDG.js";import"./tooltip-v9goNoMa.js";import"./User01-Ci3O3rgG.js";import"./card-e_SApZv-.js";import"./ArrowUpRight-BXCPGKW0.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-Ba58imnw.js";import"./SearchMd-D2HCX03E.js";import"./use-collections-CfoSjDkZ.js";import"./AlertCircle-CIhNxTTl.js";import"./Tool01-DXA_DwTO.js";import"./Archive-DOUYQc8s.js";import"./XClose-DM_WC7Hv.js";import"./RefreshCcw01-D_ZQRj8n.js";import"./ArrowNarrowLeft-B1LOVgdw.js";import"./XCircle-DcF4hahE.js";import"./ZapSquare-ugGzur7h.js";import"./CheckCircle-DSnO-ZRF.js";import"./Check-CV-PYcTx.js";import"./ChevronDown-d1XZuPx_.js";import"./ChevronRight-OA6RE0bm.js";import"./ChevronUp-BPXArXn4.js";import"./DotsVertical-CkjufnVc.js";import"./Container-D2TENyxw.js";import"./Star01-eRHoMpoz.js";import"./Palette-TGj5HRZ0.js";import"./LinkExternal01-C_Dp-9up.js";import"./Lock01-DbAsRqsB.js";import"./Sun-CK-d8u_d.js";import"./Play-Bqd6KoLL.js";import"./Settings02-DvgEzqo-.js";import"./Shield01-Bam4M-YR.js";import"./Trash01-C98MAtHO.js";import"./Zap-BtcijgPp.js";const nt=pe({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:X().optional()});function ot(t){const e=F.c(13),{value:r,onChange:l,name:a,disabled:u}=t,n=K.useRef(null);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>n.current?.click(),e[0]=S):S=e[0];const g=S;let C;e[1]!==l?(C=P=>{const p=P.target.files?.[0];if(!p)return;if(p.size>2097152){M.error("Image must be smaller than 2MB");return}const h=new FileReader;h.onerror=it,h.onloadend=()=>{h.result&&l(h.result),n.current&&(n.current.value="")},h.readAsDataURL(p)},e[1]=l,e[2]=C):C=e[2];const o=C;let i;e[3]!==u||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:u}),e[3]=u,e[4]=o,e[5]=i):i=e[5];const d=r||void 0,m=a??"?";let f;e[6]!==d||e[7]!==m?(f=s.jsx(ye,{url:d,fallback:m,shape:"square",size:"base"}),e[6]=d,e[7]=m,e[8]=f):f=e[8];let x;return e[9]!==u||e[10]!==i||e[11]!==f?(x=s.jsxs("button",{type:"button",onClick:g,disabled:u,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,f]}),e[9]=u,e[10]=i,e[11]=f,e[12]=x):x=e[12],x}function it(){return M.error("Failed to read image")}function lt(){const t=ae(),{org:e}=re(),r=ve(),l=ce(),a=fe({resolver:xe(nt),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=de({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const d=await r.organization.update({data:i});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:(o,i)=>{W("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:Y.organizations()}),l.invalidateQueries({queryKey:Y.activeOrganization(e.slug)}),M.success("Organization updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{W("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),M.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:S}=be({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const d=a.getValues(),m=a.control._defaultValues;a.reset(d,{keepValues:!0});try{await u.mutateAsync(d)}catch{a.reset(m,{keepValues:!0})}}}),g=a.formState.errors,C=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(Z,{children:s.jsxs(J,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(ot,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),S()},name:a.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:a.control,name:"name",render:({field:o})=>s.jsx(me,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),S()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[C&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:C}),s.jsx(se,{control:a.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:i=>{const d=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",d,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),S()}})})]})}),(g.name||g.slug||g.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[g.name&&s.jsx("p",{className:"text-xs text-destructive",children:g.name.message}),g.slug&&s.jsx("p",{className:"text-xs text-destructive",children:g.slug.message}),g.logo&&s.jsx("p",{className:"text-xs text-destructive",children:g.logo.message})]})]})})}const ie=["site-editor","site-diagnostics","ai-image","ai-research"],le=8;function at(t,e,r){const l=e.find(u=>u.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const a=r.find(u=>u.id===t);return a?{id:t,title:a.title,icon:a.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function rt(t){const e=F.c(39),{agent:r,onRemove:l}=t;let a;e[0]!==r.id?(a={id:r.id},e[0]=r.id,e[1]=a):a=e[1];const{attributes:u,listeners:n,setNodeRef:S,transform:g,transition:C,isDragging:o}=Ee(a);let i;e[2]!==g?(i=Ie.Transform.toString(g),e[2]=g,e[3]=i):i=e[3];const d=o?.5:void 0,m=o?100:void 0;let f;e[4]!==i||e[5]!==d||e[6]!==m||e[7]!==C?(f={transform:i,transition:C,opacity:d,zIndex:m},e[4]=i,e[5]=d,e[6]=m,e[7]=C,e[8]=f):f=e[8];const x=f,P=o&&"shadow-lg";let p;e[9]!==P?(p=he("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",P),e[9]=P,e[10]=p):p=e[10];const h=`Drag to reorder ${r.title}`;let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(He,{size:14}),e[11]=z):z=e[11];let E;e[12]!==u||e[13]!==n||e[14]!==h?(E=s.jsx("button",{type:"button",...u,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":h,children:z}),e[12]=u,e[13]=n,e[14]=h,e[15]=E):E=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ge,{size:14}),e[16]=v):v=e[16];let N;e[17]!==r.icon||e[18]!==r.title?(N=s.jsx(ee,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:v}),e[17]=r.icon,e[18]=r.title,e[19]=N):N=e[19];let b;e[20]!==r.title?(b=s.jsx("span",{className:"text-sm text-foreground truncate",children:r.title}),e[20]=r.title,e[21]=b):b=e[21];const _=r.kind==="template"?"Template":r.kind==="custom"?"Custom agent":"Unavailable";let j;e[22]!==_?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=j):j=e[23];let D;e[24]!==b||e[25]!==j?(D=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[b,j]}),e[24]=b,e[25]=j,e[26]=D):D=e[26];const w=`Remove ${r.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ge,{size:14}),e[27]=A):A=e[27];let y;e[28]!==l||e[29]!==w?(y=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":w,children:A}),e[28]=l,e[29]=w,e[30]=y):y=e[30];let O;return e[31]!==S||e[32]!==x||e[33]!==E||e[34]!==N||e[35]!==D||e[36]!==y||e[37]!==p?(O=s.jsxs("div",{ref:S,style:x,className:p,children:[E,N,D,y]}),e[31]=S,e[32]=x,e[33]=E,e[34]=N,e[35]=D,e[36]=y,e[37]=p,e[38]=O):O=e[38],O}function ct(t){const e=F.c(48),{selectedIds:r,onAdd:l}=t,[a,u]=K.useState(!1),[n,S]=K.useState(""),g=ue();let C;e[0]!==r?(C=new Set(r),e[0]=r,e[1]=C):C=e[1];const o=C;let i,d,m,f,x,P,p,h,z,E,v,N,b;if(e[2]!==g||e[3]!==l||e[4]!==a||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=te.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let y;e[20]!==o?(y=c=>c.id!==null&&!Le(c.id)&&!o.has(c.id),e[20]=o,e[21]=y):y=e[21],m=g.filter(y).filter(c=>!n||c.title.toLowerCase().includes(A));let O;e[22]!==l?(O=c=>{l(c),u(!1),S("")},e[22]=l,e[23]=O):O=e[23];const I=O;d=Me,N=a,b=u,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ke,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],i=qe,z="w-[320px] p-0 overflow-hidden",E="start",e[25]!==n?(v=s.jsx(Fe,{value:n,onChange:S,placeholder:"Search agents..."}),e[25]=n,e[26]=v):v=e[26],P="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",p=f.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),f.map(c=>s.jsxs("button",{type:"button",onClick:()=>I(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ee,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),h=m.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),m.map(c=>s.jsxs("button",{type:"button",onClick:()=>I(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ee,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ge,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=g,e[3]=l,e[4]=a,e[5]=n,e[6]=o,e[7]=i,e[8]=d,e[9]=m,e[10]=f,e[11]=x,e[12]=P,e[13]=p,e[14]=h,e[15]=z,e[16]=E,e[17]=v,e[18]=N,e[19]=b}else i=e[7],d=e[8],m=e[9],f=e[10],x=e[11],P=e[12],p=e[13],h=e[14],z=e[15],E=e[16],v=e[17],N=e[18],b=e[19];let _;e[27]!==m||e[28]!==f.length||e[29]!==n?(_=f.length===0&&m.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=m,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let j;e[31]!==_||e[32]!==P||e[33]!==p||e[34]!==h?(j=s.jsxs("div",{className:P,children:[p,h,_]}),e[31]=_,e[32]=P,e[33]=p,e[34]=h,e[35]=j):j=e[35];let D;e[36]!==i||e[37]!==j||e[38]!==z||e[39]!==E||e[40]!==v?(D=s.jsxs(i,{className:z,align:E,children:[v,j]}),e[36]=i,e[37]=j,e[38]=z,e[39]=E,e[40]=v,e[41]=D):D=e[41];let w;return e[42]!==d||e[43]!==x||e[44]!==D||e[45]!==N||e[46]!==b?(w=s.jsxs(d,{open:N,onOpenChange:b,children:[x,D]}),e[42]=d,e[43]=x,e[44]=D,e[45]=N,e[46]=b,e[47]=w):w=e[47],w}function dt(){const t=F.c(61),e=Ue(),r=ue(),l=Qe();let a;t[0]!==e?.ids?(a=e?.ids??[...ie],t[0]=e?.ids,t[1]=a):a=t[1];const u=a,[n,S]=K.useState(u);let g;t[2]!==n||t[3]!==u?(g=n.length!==u.length||n.some((k,T)=>k!==u[T]),t[2]=n,t[3]=u,t[4]=g):g=t[4];const C=g;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:ke},t[6]=i):i=t[6];const d=_e(oe(Oe,o),oe(Pe,i));let m;t[7]!==n?(m=k=>{const{active:T,over:R}=k;if(!R||T.id===R.id)return;const $=n.indexOf(T.id),G=n.indexOf(R.id);$===-1||G===-1||S(Te([...n],$,G))},t[7]=n,t[8]=m):m=t[8];const f=m;let x;t[9]!==n?(x=k=>{n.includes(k)||S([...n,k])},t[9]=n,t[10]=x):x=t[10];const P=x;let p;t[11]!==n?(p=k=>{S(n.filter(T=>T!==k))},t[11]=n,t[12]=p):p=t[12];const h=p;let z;t[13]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{S([...ie])},t[13]=z):z=t[13];const E=z;let v;t[14]!==n||t[15]!==l?(v=()=>{l.mutate({ids:n},{onSuccess:()=>{W("default_home_agents_updated",{count:n.length,template_count:n.filter(ut).length}),M.success("Default home agents updated")},onError:mt})},t[14]=n,t[15]=l,t[16]=v):v=t[16];const N=v;let b,_,j,D,w,A,y;if(t[17]!==r||t[18]!==n||t[19]!==f||t[20]!==h||t[21]!==d||t[22]!==l.isPending){let k;t[30]!==r?(k=$=>at($,te,r),t[30]=r,t[31]=k):k=t[31];const T=n.map(k);j=Math.max(0,n.length-le),_=Z,w="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(je,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:E,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],b=J,y="px-5 py-5 flex flex-col gap-3",D=T.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(De,{sensors:d,collisionDetection:ze,onDragEnd:f,children:s.jsx(Ae,{items:n,strategy:we,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:T.map(($,G)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[G===le&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(rt,{agent:$,onRemove:()=>h($.id)})]},$.id))})})}),t[17]=r,t[18]=n,t[19]=f,t[20]=h,t[21]=d,t[22]=l.isPending,t[23]=b,t[24]=_,t[25]=j,t[26]=D,t[27]=w,t[28]=A,t[29]=y}else b=t[23],_=t[24],j=t[25],D=t[26],w=t[27],A=t[28],y=t[29];let O;t[35]!==n||t[36]!==P?(O=s.jsx(ct,{selectedIds:n,onAdd:P}),t[35]=n,t[36]=P,t[37]=O):O=t[37];let I;t[38]!==j?(I=j>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[j," agent",j===1?"":"s"," won't fit on the home view"]}),t[38]=j,t[39]=I):I=t[39];let c;t[40]!==O||t[41]!==I?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[O,I]}),t[40]=O,t[41]=I,t[42]=c):c=t[42];let L;t[43]!==D||t[44]!==c||t[45]!==y?(L=s.jsxs("div",{className:y,children:[D,c]}),t[43]=D,t[44]=c,t[45]=y,t[46]=L):L=t[46];let q;t[47]!==N||t[48]!==u||t[49]!==C||t[50]!==l.isPending?(q=C&&s.jsxs(Se,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>S(u),disabled:l.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:N,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=N,t[48]=u,t[49]=C,t[50]=l.isPending,t[51]=q):q=t[51];let B;t[52]!==b||t[53]!==L||t[54]!==q?(B=s.jsxs(b,{children:[L,q]}),t[52]=b,t[53]=L,t[54]=q,t[55]=B):B=t[55];let V;return t[56]!==_||t[57]!==w||t[58]!==A||t[59]!==B?(V=s.jsx(_,{title:w,actions:A,children:B}),t[56]=_,t[57]=w,t[58]=A,t[59]=B,t[60]=V):V=t[60],V}function mt(t){M.error(t instanceof Error?t.message:"Failed to update default home agents")}function ut(t){return te.some(e=>e.id===t)}function gt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{title:"Default home agents",children:s.jsx(J,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(ft)})})}),t[0]=e):e=t[0],e}function ft(t,e){return s.jsx(Be,{className:"h-12 w-full rounded-lg"},e)}function xt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(K.Suspense,{fallback:s.jsx(gt,{}),children:s.jsx(dt,{})}),t[0]=e):e=t[0],e}function pt(){const t=F.c(47),{org:e}=re(),r=ae(),l=ce(),[a,u]=K.useState(!1),[n,S]=K.useState("");let g;t[0]!==e.id||t[1]!==e.slug?(g={connectionId:Re,orgSlug:e.slug,orgId:e.id},t[0]=e.id,t[1]=e.slug,t[2]=g):g=t[2];const C=$e(g);let o;t[3]!==e.id||t[4]!==C?(o=async()=>{const I=await C.callTool({name:"ORGANIZATION_DELETE",arguments:{id:e.id}});if(I.isError){const c=I.content,L=Array.isArray(c)&&c[0]?.type==="text"&&typeof c[0].text=="string"?c[0].text:"Failed to delete organization";throw new Error(L)}},t[3]=e.id,t[4]=C,t[5]=o):o=t[5];let i;t[6]!==r||t[7]!==e.id||t[8]!==e.slug||t[9]!==l?(i=()=>{W("organization_deleted",{organization_id:e.id}),localStorage.getItem(ne.lastOrgSlug())===e.slug&&localStorage.removeItem(ne.lastOrgSlug()),l.removeQueries({queryKey:Y.activeOrganization(e.slug)}),l.invalidateQueries({queryKey:Y.organizations()}),M.success("Organization deleted"),r({to:"/"})},t[6]=r,t[7]=e.id,t[8]=e.slug,t[9]=l,t[10]=i):i=t[10];let d;t[11]!==o||t[12]!==i?(d={mutationFn:o,onSuccess:i,onError:ht},t[11]=o,t[12]=i,t[13]=d):d=t[13];const m=de(d);let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),t[14]=f):f=t[14];let x;t[15]!==m.isPending?(x=s.jsx(Z,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:s.jsx(J,{className:"border-destructive/40",children:s.jsx(Q,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:s.jsx(H,{variant:"destructive",size:"sm",onClick:f,disabled:m.isPending,children:"Delete"})})})}),t[15]=m.isPending,t[16]=x):x=t[16];let P;t[17]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{u(I),I||S("")},t[17]=P):P=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(We,{children:"Delete Organization?"}),t[18]=p):p=t[18];let h;t[19]!==e.name?(h=s.jsxs("p",{children:["This will permanently delete all data associated with"," ",s.jsx("span",{className:"font-medium text-foreground",children:e.name}),". This action cannot be undone."]}),t[19]=e.name,t[20]=h):h=t[20];let z;t[21]!==e.name?(z=s.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",s.jsx("span",{className:"font-medium text-foreground",children:e.name})," ","to confirm:"]}),t[21]=e.name,t[22]=z):z=t[22];let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E=I=>S(I.target.value),t[23]=E):E=t[23];let v;t[24]!==n||t[25]!==e.name?(v=s.jsx(me,{value:n,onChange:E,placeholder:e.name,autoFocus:!0}),t[24]=n,t[25]=e.name,t[26]=v):v=t[26];let N;t[27]!==v||t[28]!==h||t[29]!==z?(N=s.jsxs(Ye,{children:[p,s.jsx(Ze,{asChild:!0,children:s.jsxs("div",{children:[h,z,v]})})]}),t[27]=v,t[28]=h,t[29]=z,t[30]=N):N=t[30];let b;t[31]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Je,{children:"Cancel"}),t[31]=b):b=t[31];let _;t[32]!==m?(_=()=>m.mutate(),t[32]=m,t[33]=_):_=t[33];const j=n!==e.name||m.isPending,D=m.isPending?"Deleting…":"Delete organization";let w;t[34]!==_||t[35]!==j||t[36]!==D?(w=s.jsxs(Xe,{children:[b,s.jsx(et,{onClick:_,disabled:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:D})]}),t[34]=_,t[35]=j,t[36]=D,t[37]=w):w=t[37];let A;t[38]!==N||t[39]!==w?(A=s.jsxs(tt,{children:[N,w]}),t[38]=N,t[39]=w,t[40]=A):A=t[40];let y;t[41]!==a||t[42]!==A?(y=s.jsx(st,{open:a,onOpenChange:P,children:A}),t[41]=a,t[42]=A,t[43]=y):y=t[43];let O;return t[44]!==y||t[45]!==x?(O=s.jsxs(s.Fragment,{children:[x,y]}),t[44]=y,t[45]=x,t[46]=O):O=t[46],O}function ht(t){M.error(t instanceof Error?t.message:"Failed to delete organization")}function jt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(U,{children:s.jsx(U.Content,{children:s.jsx(U.Body,{children:s.jsxs(Ce,{children:[s.jsx(U.Title,{children:"Organization"}),s.jsx(lt,{}),s.jsx(Ne,{}),s.jsx(xt,{}),s.jsx(pt,{})]})})})}),t[0]=e):e=t[0],e}function bs(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(jt,{}),t[0]=e):e=t[0],e}export{bs as default};
|
|
1
|
+
import{f as ae,s as re,o as ce,z as fe,D as xe,a as de,t as W,x as M,K as Y,j as s,C as se,H as pe,J as X,e as F,r as K,B as H,c as he,M as je,R as ne}from"./index-dmkCn37I.js";import{P as U}from"./index-CHYuwbgr.js";import{u as ve}from"./use-org-auth-client-B7YA_80Y.js";import{u as be}from"./use-debounced-autosave-BnUZVD_o.js";import{A as ye}from"./avatar-JFkuXk7Y.js";import{I as me}from"./input-C0h7cNmt.js";import{S as Z,a as J,b as Q,c as Se,d as Ce}from"./settings-section-CijJZPn7.js";import{D as Ne}from"./domain-settings-P92TIE-X.js";import{u as _e,a as oe,D as De,c as ze,S as Ae,v as we,K as Pe,P as Oe,d as Ee,C as Ie,s as ke,b as Te,e as Fe}from"./collection-search-B_PTLHi8.js";import{W as te,i as Le,S as Re,u as $e}from"./constants-fVwC9Czh.js";import{b as ue}from"./use-virtual-mcp-BVVlTr3L.js";import{b as Me,P as Ke,a as qe}from"./popover-9waMMdOC.js";import{S as Be}from"./skeleton-De5l7OL1.js";import{y as He}from"./agent-icon-CDOpQPVP.js";import{s as Ve}from"./Plus-Bk1OvOXE.js";import{a as ge}from"./Users03-B0r4bSLn.js";import{i as Ge}from"./X-DDQYEU6o.js";import{I as ee}from"./integration-icon-PH7vkQ9v.js";import{u as Ue,c as Qe}from"./use-organization-settings-C2ni1vuh.js";import{c as We,b as Ye,d as Ze,f as Je,e as Xe,g as et,a as tt,A as st}from"./alert-dialog-DzUiFLm5.js";import"./sidebar-sY4KII-w.js";import"./LayoutLeft-CG8cspKX.js";import"./tooltip-DHpEGVi8.js";import"./User01-3xBsy6wV.js";import"./card-NxdWcP2Y.js";import"./ArrowUpRight-Cl4DoJ1w.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-Dg8MplKB.js";import"./SearchMd-Bo6RzH5Q.js";import"./use-collections-XDqst4E_.js";import"./AlertCircle-D7In04VZ.js";import"./Tool01-DUGZCBMz.js";import"./Archive-DaxWSUle.js";import"./XClose-DwaprZxL.js";import"./RefreshCcw01-CeTSzQsT.js";import"./ArrowNarrowLeft-I0Rr4fru.js";import"./XCircle-B14ynTvz.js";import"./ZapSquare-DgAVTy7i.js";import"./CheckCircle-ByasFo1p.js";import"./Check-nv67ec3-.js";import"./ChevronDown-Brvsr3Fl.js";import"./ChevronRight-PLlU1t0W.js";import"./ChevronUp-VDqvRLBN.js";import"./DotsVertical-DSgmYETN.js";import"./Container-DTioRpeZ.js";import"./Star01-_us4XpQn.js";import"./Palette-DGf3gs0h.js";import"./LinkExternal01-FKIQuNsM.js";import"./Lock01-XwPtPsiy.js";import"./Sun-Zv-PWUwn.js";import"./Play-BUgAN2i6.js";import"./Settings02-uL3uu5-7.js";import"./Shield01-OH6-JWjw.js";import"./Trash01-AR9qKMZU.js";import"./Zap-EburzyyI.js";const nt=pe({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:X().optional()});function ot(t){const e=F.c(13),{value:r,onChange:l,name:a,disabled:u}=t,n=K.useRef(null);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>n.current?.click(),e[0]=S):S=e[0];const g=S;let C;e[1]!==l?(C=P=>{const p=P.target.files?.[0];if(!p)return;if(p.size>2097152){M.error("Image must be smaller than 2MB");return}const h=new FileReader;h.onerror=it,h.onloadend=()=>{h.result&&l(h.result),n.current&&(n.current.value="")},h.readAsDataURL(p)},e[1]=l,e[2]=C):C=e[2];const o=C;let i;e[3]!==u||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:u}),e[3]=u,e[4]=o,e[5]=i):i=e[5];const d=r||void 0,m=a??"?";let f;e[6]!==d||e[7]!==m?(f=s.jsx(ye,{url:d,fallback:m,shape:"square",size:"base"}),e[6]=d,e[7]=m,e[8]=f):f=e[8];let x;return e[9]!==u||e[10]!==i||e[11]!==f?(x=s.jsxs("button",{type:"button",onClick:g,disabled:u,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,f]}),e[9]=u,e[10]=i,e[11]=f,e[12]=x):x=e[12],x}function it(){return M.error("Failed to read image")}function lt(){const t=ae(),{org:e}=re(),r=ve(),l=ce(),a=fe({resolver:xe(nt),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=de({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const d=await r.organization.update({data:i});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:(o,i)=>{W("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:Y.organizations()}),l.invalidateQueries({queryKey:Y.activeOrganization(e.slug)}),M.success("Organization updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{W("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),M.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:S}=be({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const d=a.getValues(),m=a.control._defaultValues;a.reset(d,{keepValues:!0});try{await u.mutateAsync(d)}catch{a.reset(m,{keepValues:!0})}}}),g=a.formState.errors,C=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(Z,{children:s.jsxs(J,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(ot,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),S()},name:a.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:a.control,name:"name",render:({field:o})=>s.jsx(me,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),S()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[C&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:C}),s.jsx(se,{control:a.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:i=>{const d=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",d,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),S()}})})]})}),(g.name||g.slug||g.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[g.name&&s.jsx("p",{className:"text-xs text-destructive",children:g.name.message}),g.slug&&s.jsx("p",{className:"text-xs text-destructive",children:g.slug.message}),g.logo&&s.jsx("p",{className:"text-xs text-destructive",children:g.logo.message})]})]})})}const ie=["site-editor","site-diagnostics","ai-image","ai-research"],le=8;function at(t,e,r){const l=e.find(u=>u.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const a=r.find(u=>u.id===t);return a?{id:t,title:a.title,icon:a.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function rt(t){const e=F.c(39),{agent:r,onRemove:l}=t;let a;e[0]!==r.id?(a={id:r.id},e[0]=r.id,e[1]=a):a=e[1];const{attributes:u,listeners:n,setNodeRef:S,transform:g,transition:C,isDragging:o}=Ee(a);let i;e[2]!==g?(i=Ie.Transform.toString(g),e[2]=g,e[3]=i):i=e[3];const d=o?.5:void 0,m=o?100:void 0;let f;e[4]!==i||e[5]!==d||e[6]!==m||e[7]!==C?(f={transform:i,transition:C,opacity:d,zIndex:m},e[4]=i,e[5]=d,e[6]=m,e[7]=C,e[8]=f):f=e[8];const x=f,P=o&&"shadow-lg";let p;e[9]!==P?(p=he("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",P),e[9]=P,e[10]=p):p=e[10];const h=`Drag to reorder ${r.title}`;let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(He,{size:14}),e[11]=z):z=e[11];let E;e[12]!==u||e[13]!==n||e[14]!==h?(E=s.jsx("button",{type:"button",...u,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":h,children:z}),e[12]=u,e[13]=n,e[14]=h,e[15]=E):E=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ge,{size:14}),e[16]=v):v=e[16];let N;e[17]!==r.icon||e[18]!==r.title?(N=s.jsx(ee,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:v}),e[17]=r.icon,e[18]=r.title,e[19]=N):N=e[19];let b;e[20]!==r.title?(b=s.jsx("span",{className:"text-sm text-foreground truncate",children:r.title}),e[20]=r.title,e[21]=b):b=e[21];const _=r.kind==="template"?"Template":r.kind==="custom"?"Custom agent":"Unavailable";let j;e[22]!==_?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=j):j=e[23];let D;e[24]!==b||e[25]!==j?(D=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[b,j]}),e[24]=b,e[25]=j,e[26]=D):D=e[26];const w=`Remove ${r.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ge,{size:14}),e[27]=A):A=e[27];let y;e[28]!==l||e[29]!==w?(y=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":w,children:A}),e[28]=l,e[29]=w,e[30]=y):y=e[30];let O;return e[31]!==S||e[32]!==x||e[33]!==E||e[34]!==N||e[35]!==D||e[36]!==y||e[37]!==p?(O=s.jsxs("div",{ref:S,style:x,className:p,children:[E,N,D,y]}),e[31]=S,e[32]=x,e[33]=E,e[34]=N,e[35]=D,e[36]=y,e[37]=p,e[38]=O):O=e[38],O}function ct(t){const e=F.c(48),{selectedIds:r,onAdd:l}=t,[a,u]=K.useState(!1),[n,S]=K.useState(""),g=ue();let C;e[0]!==r?(C=new Set(r),e[0]=r,e[1]=C):C=e[1];const o=C;let i,d,m,f,x,P,p,h,z,E,v,N,b;if(e[2]!==g||e[3]!==l||e[4]!==a||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=te.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let y;e[20]!==o?(y=c=>c.id!==null&&!Le(c.id)&&!o.has(c.id),e[20]=o,e[21]=y):y=e[21],m=g.filter(y).filter(c=>!n||c.title.toLowerCase().includes(A));let O;e[22]!==l?(O=c=>{l(c),u(!1),S("")},e[22]=l,e[23]=O):O=e[23];const I=O;d=Me,N=a,b=u,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ke,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],i=qe,z="w-[320px] p-0 overflow-hidden",E="start",e[25]!==n?(v=s.jsx(Fe,{value:n,onChange:S,placeholder:"Search agents..."}),e[25]=n,e[26]=v):v=e[26],P="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",p=f.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),f.map(c=>s.jsxs("button",{type:"button",onClick:()=>I(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ee,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),h=m.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),m.map(c=>s.jsxs("button",{type:"button",onClick:()=>I(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ee,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ge,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=g,e[3]=l,e[4]=a,e[5]=n,e[6]=o,e[7]=i,e[8]=d,e[9]=m,e[10]=f,e[11]=x,e[12]=P,e[13]=p,e[14]=h,e[15]=z,e[16]=E,e[17]=v,e[18]=N,e[19]=b}else i=e[7],d=e[8],m=e[9],f=e[10],x=e[11],P=e[12],p=e[13],h=e[14],z=e[15],E=e[16],v=e[17],N=e[18],b=e[19];let _;e[27]!==m||e[28]!==f.length||e[29]!==n?(_=f.length===0&&m.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=m,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let j;e[31]!==_||e[32]!==P||e[33]!==p||e[34]!==h?(j=s.jsxs("div",{className:P,children:[p,h,_]}),e[31]=_,e[32]=P,e[33]=p,e[34]=h,e[35]=j):j=e[35];let D;e[36]!==i||e[37]!==j||e[38]!==z||e[39]!==E||e[40]!==v?(D=s.jsxs(i,{className:z,align:E,children:[v,j]}),e[36]=i,e[37]=j,e[38]=z,e[39]=E,e[40]=v,e[41]=D):D=e[41];let w;return e[42]!==d||e[43]!==x||e[44]!==D||e[45]!==N||e[46]!==b?(w=s.jsxs(d,{open:N,onOpenChange:b,children:[x,D]}),e[42]=d,e[43]=x,e[44]=D,e[45]=N,e[46]=b,e[47]=w):w=e[47],w}function dt(){const t=F.c(61),e=Ue(),r=ue(),l=Qe();let a;t[0]!==e?.ids?(a=e?.ids??[...ie],t[0]=e?.ids,t[1]=a):a=t[1];const u=a,[n,S]=K.useState(u);let g;t[2]!==n||t[3]!==u?(g=n.length!==u.length||n.some((k,T)=>k!==u[T]),t[2]=n,t[3]=u,t[4]=g):g=t[4];const C=g;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:ke},t[6]=i):i=t[6];const d=_e(oe(Oe,o),oe(Pe,i));let m;t[7]!==n?(m=k=>{const{active:T,over:R}=k;if(!R||T.id===R.id)return;const $=n.indexOf(T.id),G=n.indexOf(R.id);$===-1||G===-1||S(Te([...n],$,G))},t[7]=n,t[8]=m):m=t[8];const f=m;let x;t[9]!==n?(x=k=>{n.includes(k)||S([...n,k])},t[9]=n,t[10]=x):x=t[10];const P=x;let p;t[11]!==n?(p=k=>{S(n.filter(T=>T!==k))},t[11]=n,t[12]=p):p=t[12];const h=p;let z;t[13]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{S([...ie])},t[13]=z):z=t[13];const E=z;let v;t[14]!==n||t[15]!==l?(v=()=>{l.mutate({ids:n},{onSuccess:()=>{W("default_home_agents_updated",{count:n.length,template_count:n.filter(ut).length}),M.success("Default home agents updated")},onError:mt})},t[14]=n,t[15]=l,t[16]=v):v=t[16];const N=v;let b,_,j,D,w,A,y;if(t[17]!==r||t[18]!==n||t[19]!==f||t[20]!==h||t[21]!==d||t[22]!==l.isPending){let k;t[30]!==r?(k=$=>at($,te,r),t[30]=r,t[31]=k):k=t[31];const T=n.map(k);j=Math.max(0,n.length-le),_=Z,w="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(je,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:E,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],b=J,y="px-5 py-5 flex flex-col gap-3",D=T.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(De,{sensors:d,collisionDetection:ze,onDragEnd:f,children:s.jsx(Ae,{items:n,strategy:we,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:T.map(($,G)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[G===le&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(rt,{agent:$,onRemove:()=>h($.id)})]},$.id))})})}),t[17]=r,t[18]=n,t[19]=f,t[20]=h,t[21]=d,t[22]=l.isPending,t[23]=b,t[24]=_,t[25]=j,t[26]=D,t[27]=w,t[28]=A,t[29]=y}else b=t[23],_=t[24],j=t[25],D=t[26],w=t[27],A=t[28],y=t[29];let O;t[35]!==n||t[36]!==P?(O=s.jsx(ct,{selectedIds:n,onAdd:P}),t[35]=n,t[36]=P,t[37]=O):O=t[37];let I;t[38]!==j?(I=j>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[j," agent",j===1?"":"s"," won't fit on the home view"]}),t[38]=j,t[39]=I):I=t[39];let c;t[40]!==O||t[41]!==I?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[O,I]}),t[40]=O,t[41]=I,t[42]=c):c=t[42];let L;t[43]!==D||t[44]!==c||t[45]!==y?(L=s.jsxs("div",{className:y,children:[D,c]}),t[43]=D,t[44]=c,t[45]=y,t[46]=L):L=t[46];let q;t[47]!==N||t[48]!==u||t[49]!==C||t[50]!==l.isPending?(q=C&&s.jsxs(Se,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>S(u),disabled:l.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:N,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=N,t[48]=u,t[49]=C,t[50]=l.isPending,t[51]=q):q=t[51];let B;t[52]!==b||t[53]!==L||t[54]!==q?(B=s.jsxs(b,{children:[L,q]}),t[52]=b,t[53]=L,t[54]=q,t[55]=B):B=t[55];let V;return t[56]!==_||t[57]!==w||t[58]!==A||t[59]!==B?(V=s.jsx(_,{title:w,actions:A,children:B}),t[56]=_,t[57]=w,t[58]=A,t[59]=B,t[60]=V):V=t[60],V}function mt(t){M.error(t instanceof Error?t.message:"Failed to update default home agents")}function ut(t){return te.some(e=>e.id===t)}function gt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{title:"Default home agents",children:s.jsx(J,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(ft)})})}),t[0]=e):e=t[0],e}function ft(t,e){return s.jsx(Be,{className:"h-12 w-full rounded-lg"},e)}function xt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(K.Suspense,{fallback:s.jsx(gt,{}),children:s.jsx(dt,{})}),t[0]=e):e=t[0],e}function pt(){const t=F.c(47),{org:e}=re(),r=ae(),l=ce(),[a,u]=K.useState(!1),[n,S]=K.useState("");let g;t[0]!==e.id||t[1]!==e.slug?(g={connectionId:Re,orgSlug:e.slug,orgId:e.id},t[0]=e.id,t[1]=e.slug,t[2]=g):g=t[2];const C=$e(g);let o;t[3]!==e.id||t[4]!==C?(o=async()=>{const I=await C.callTool({name:"ORGANIZATION_DELETE",arguments:{id:e.id}});if(I.isError){const c=I.content,L=Array.isArray(c)&&c[0]?.type==="text"&&typeof c[0].text=="string"?c[0].text:"Failed to delete organization";throw new Error(L)}},t[3]=e.id,t[4]=C,t[5]=o):o=t[5];let i;t[6]!==r||t[7]!==e.id||t[8]!==e.slug||t[9]!==l?(i=()=>{W("organization_deleted",{organization_id:e.id}),localStorage.getItem(ne.lastOrgSlug())===e.slug&&localStorage.removeItem(ne.lastOrgSlug()),l.removeQueries({queryKey:Y.activeOrganization(e.slug)}),l.invalidateQueries({queryKey:Y.organizations()}),M.success("Organization deleted"),r({to:"/"})},t[6]=r,t[7]=e.id,t[8]=e.slug,t[9]=l,t[10]=i):i=t[10];let d;t[11]!==o||t[12]!==i?(d={mutationFn:o,onSuccess:i,onError:ht},t[11]=o,t[12]=i,t[13]=d):d=t[13];const m=de(d);let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),t[14]=f):f=t[14];let x;t[15]!==m.isPending?(x=s.jsx(Z,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:s.jsx(J,{className:"border-destructive/40",children:s.jsx(Q,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:s.jsx(H,{variant:"destructive",size:"sm",onClick:f,disabled:m.isPending,children:"Delete"})})})}),t[15]=m.isPending,t[16]=x):x=t[16];let P;t[17]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{u(I),I||S("")},t[17]=P):P=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(We,{children:"Delete Organization?"}),t[18]=p):p=t[18];let h;t[19]!==e.name?(h=s.jsxs("p",{children:["This will permanently delete all data associated with"," ",s.jsx("span",{className:"font-medium text-foreground",children:e.name}),". This action cannot be undone."]}),t[19]=e.name,t[20]=h):h=t[20];let z;t[21]!==e.name?(z=s.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",s.jsx("span",{className:"font-medium text-foreground",children:e.name})," ","to confirm:"]}),t[21]=e.name,t[22]=z):z=t[22];let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E=I=>S(I.target.value),t[23]=E):E=t[23];let v;t[24]!==n||t[25]!==e.name?(v=s.jsx(me,{value:n,onChange:E,placeholder:e.name,autoFocus:!0}),t[24]=n,t[25]=e.name,t[26]=v):v=t[26];let N;t[27]!==v||t[28]!==h||t[29]!==z?(N=s.jsxs(Ye,{children:[p,s.jsx(Ze,{asChild:!0,children:s.jsxs("div",{children:[h,z,v]})})]}),t[27]=v,t[28]=h,t[29]=z,t[30]=N):N=t[30];let b;t[31]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Je,{children:"Cancel"}),t[31]=b):b=t[31];let _;t[32]!==m?(_=()=>m.mutate(),t[32]=m,t[33]=_):_=t[33];const j=n!==e.name||m.isPending,D=m.isPending?"Deleting…":"Delete organization";let w;t[34]!==_||t[35]!==j||t[36]!==D?(w=s.jsxs(Xe,{children:[b,s.jsx(et,{onClick:_,disabled:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:D})]}),t[34]=_,t[35]=j,t[36]=D,t[37]=w):w=t[37];let A;t[38]!==N||t[39]!==w?(A=s.jsxs(tt,{children:[N,w]}),t[38]=N,t[39]=w,t[40]=A):A=t[40];let y;t[41]!==a||t[42]!==A?(y=s.jsx(st,{open:a,onOpenChange:P,children:A}),t[41]=a,t[42]=A,t[43]=y):y=t[43];let O;return t[44]!==y||t[45]!==x?(O=s.jsxs(s.Fragment,{children:[x,y]}),t[44]=y,t[45]=x,t[46]=O):O=t[46],O}function ht(t){M.error(t instanceof Error?t.message:"Failed to delete organization")}function jt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(U,{children:s.jsx(U.Content,{children:s.jsx(U.Body,{children:s.jsxs(Ce,{children:[s.jsx(U.Title,{children:"Organization"}),s.jsx(lt,{}),s.jsx(Ne,{}),s.jsx(xt,{}),s.jsx(pt,{})]})})})}),t[0]=e):e=t[0],e}function bs(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(jt,{}),t[0]=e):e=t[0],e}export{bs as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as f,j as t,r as h,g as S,O as u,l as _}from"./index-dmkCn37I.js";import{S as g,a as v,b as y,u as k,c as N,d as T,e as w}from"./sidebar-sY4KII-w.js";import{u as C}from"./tooltip-DHpEGVi8.js";import{n as P}from"./ZapSquare-DgAVTy7i.js";import{T as j,S as O,a as M}from"./index-BOaGE1aK.js";import{C as R}from"./chat-context-BpeMEIll.js";import{u as $,T as I,a as n}from"./index-xstkyz4B.js";import"./LayoutLeft-CG8cspKX.js";import"./X-DDQYEU6o.js";import"./agent-icon-CDOpQPVP.js";import"./AlertCircle-D7In04VZ.js";import"./Tool01-DUGZCBMz.js";import"./Archive-DaxWSUle.js";import"./XClose-DwaprZxL.js";import"./RefreshCcw01-CeTSzQsT.js";import"./ArrowNarrowLeft-I0Rr4fru.js";import"./XCircle-B14ynTvz.js";import"./ArrowUpRight-Cl4DoJ1w.js";import"./Users03-B0r4bSLn.js";import"./CheckCircle-ByasFo1p.js";import"./Check-nv67ec3-.js";import"./ChevronDown-Brvsr3Fl.js";import"./ChevronRight-PLlU1t0W.js";import"./ChevronUp-VDqvRLBN.js";import"./DotsVertical-DSgmYETN.js";import"./Container-DTioRpeZ.js";import"./Star01-_us4XpQn.js";import"./Palette-DGf3gs0h.js";import"./SearchMd-Bo6RzH5Q.js";import"./LinkExternal01-FKIQuNsM.js";import"./Lock01-XwPtPsiy.js";import"./Sun-Zv-PWUwn.js";import"./Play-BUgAN2i6.js";import"./Plus-Bk1OvOXE.js";import"./Settings02-uL3uu5-7.js";import"./Shield01-OH6-JWjw.js";import"./Trash01-AR9qKMZU.js";import"./User01-3xBsy6wV.js";import"./Zap-EburzyyI.js";import"./shell-layout-DU81GX4X.js";import"./dialog-qtKrSwKA.js";import"./required-auth-layout-BVmXc_2r.js";import"./use-tasks-DZibCf5w.js";import"./use-collections-XDqst4E_.js";import"./constants-fVwC9Czh.js";import"./use-organization-settings-C2ni1vuh.js";import"./use-org-sso-CWD9kAdD.js";import"./pair-BJSIhyuY.js";import"./index-CB6J7z90.js";import"./use-copy-BNSIRmV_.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-BrFLFb5i.js";import"./integration-icon-PH7vkQ9v.js";import"./use-virtual-mcp-BVVlTr3L.js";import"./skeleton-De5l7OL1.js";import"./popover-9waMMdOC.js";import"./drawer-B0OHUPPF.js";import"./avatar-JFkuXk7Y.js";import"./alert-dialog-DzUiFLm5.js";import"./form-dz7U0CZK.js";import"./label-C5ENUwLS.js";import"./input-C0h7cNmt.js";import"./spinner-CsMegR0e.js";import"./index-jo98Roqy.js";import"./use-mcp-tools-a-ZvbrGo.js";import"./use-ai-providers-Cf9shvYI.js";import"./collection-search-B_PTLHi8.js";import"./use-navigate-to-agent-DjWaqrlh.js";import"./use-create-virtual-mcp-DdlYO5qT.js";import"./lean-canvas-recruit-modal-CZMvychF.js";import"./collection-search-CMNBGaQC.js";import"./checkbox-q_vRqr9W.js";import"./use-connection-BCPpnVMX.js";import"./extract-connection-data-D7Vkjtul.js";import"./constants-B0L3jJTH.js";import"./collections-CreMYLs8.js";import"./empty-state-BCr9v4T1.js";import"./use-decopilot-events-DTwuBO8M.js";import"./create-sse-subscription-CxkOgzKf.js";import"./dropdown-menu-BnaZE7Qd.js";import"./task-status-n57TCkuM.js";import"./switch-Dg8MplKB.js";import"./tabs-Bun7zdDt.js";import"./select-BjC54T39.js";import"./toggle-group-DDewxrST.js";import"./select-model-CLZn_-xL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CijJZPn7.js";import"./card-NxdWcP2Y.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./index-KBbmKsy_.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C06IRcu3.js";import"./use-registry-connections-DeY5Qm5r.js";import"./useInfiniteQuery-B4rOzvqQ.js";import"./infiniteQueryObserver-BGrXNOzy.js";import"./collection-tabs-CAm-q3uz.js";import"./badge-D0TDvkU5.js";import"./textarea-Da3AWsK6.js";import"./connection-form-helpers-n0-EInK6.js";import"./use-infinite-scroll-ByL07kWP.js";import"./useSuspenseInfiniteQuery-DVCwsKmm.js";const z=280;function L(){const e=f.c(2),{tasksOpen:r}=$();if(!r)return null;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={width:`${z}px`},e[0]=o):o=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("aside",{className:"shrink-0 h-full bg-sidebar pb-1",style:o,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden card-shadow",children:t.jsx(j,{})})})}),e[1]=i):i=e[1],i}function E(){const e=f.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(h.Suspense,{fallback:null,children:t.jsx(L,{})}),e[0]=r):r=e[0],r}function b(){const e=f.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(_,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=r):r=e[0],r}function F(){const e=f.c(18),{setOpenMobile:r,openMobile:o}=k();let i;e[0]!==r?(i=()=>r(!0),e[0]=r,e[1]=i):i=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(P,{size:20}),e[2]=p):p=e[2];let s;e[3]!==i?(s=t.jsx("div",{className:"shrink-0 flex items-center px-2 h-12 bg-background border-b border-border",children:t.jsx("button",{type:"button",onClick:i,className:"flex size-8 shrink-0 items-center justify-center rounded-md text-foreground/60 hover:bg-accent hover:text-foreground transition-colors","aria-label":"Open menu",children:p})}),e[3]=i,e[4]=s):s=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(N,{className:"sr-only",children:"Navigation"}),e[5]=m):m=e[5];let l;e[6]!==r?(l=t.jsx("div",{className:"w-14 shrink-0 bg-sidebar flex flex-col items-center border-r border-border overflow-y-auto group/sidebar","data-state":"collapsed",children:t.jsx(M,{onClose:()=>r(!1)})}),e[6]=r,e[7]=l):l=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:t.jsx(j,{})}),e[8]=a):a=e[8];let c;e[9]!==l?(c=t.jsxs(T,{side:"left",hideCloseButton:!0,className:"w-[calc(100vw-3rem)] sm:max-w-md! p-0",children:[m,t.jsxs("div",{className:"flex h-full",children:[l,a]})]}),e[9]=l,e[10]=c):c=e[10];let d;e[11]!==o||e[12]!==r||e[13]!==c?(d=t.jsx(w,{open:o,onOpenChange:r,children:c}),e[11]=o,e[12]=r,e[13]=c,e[14]=d):d=e[14];let x;return e[15]!==s||e[16]!==d?(x=t.jsxs(t.Fragment,{children:[s,d]}),e[15]=s,e[16]=d,e[17]=x):x=e[17],x}function zt(){const e=f.c(7),r=C();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const p=!!S(o).taskId;let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={"--sidebar-width-icon":"3.5rem"},e[1]=s):s=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(O,{}),e[2]=m):m=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={background:"transparent",containerType:"inline-size"},e[3]=l):l=e[3];let a;return e[4]!==p||e[5]!==r?(a=t.jsx(g,{defaultOpen:!1,children:t.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:t.jsxs(v,{className:"flex-1 bg-sidebar",style:s,children:[m,t.jsx(y,{className:"flex flex-col",style:l,children:t.jsx(R,{children:t.jsx(I,{children:r?t.jsxs(t.Fragment,{children:[!p&&t.jsx(F,{}),t.jsx(h.Suspense,{fallback:t.jsx(b,{}),children:t.jsx(u,{})})]}):t.jsxs(n,{children:[t.jsxs(n.Header,{children:[t.jsxs(n.LeftColumn,{children:[t.jsx(n.Nav,{}),t.jsx(n.TogglesSlot,{})]}),t.jsx(n.CenterSlot,{}),t.jsxs(n.RightColumn,{children:[t.jsx(n.TabsSlot,{}),t.jsx(n.RightSlot,{})]})]}),t.jsxs("div",{className:"flex-1 min-h-0 flex flex-row",children:[t.jsx(E,{}),t.jsx(h.Suspense,{fallback:t.jsx(b,{}),children:t.jsx(u,{})})]})]})})})})]})})}),e[4]=p,e[5]=r,e[6]=a):a=e[6],a}export{zt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{co as Fe,bm as Os,J as oe,I as ge,aZ as ti,bR as _i,aJ as Ie,bk as mt,a_ as qe,ap as mr,cp as rn,H as _e,cq as Ii,cr as ws,cs as ec,bP as tc,ct as ia,cu as nc,cv as rc,cw as ic,cx as fn,cy as Tr,cz as xs,bK as sa,bC as sc,aI as ze,bQ as oc,aH as On,ba as Ci,cA as ac,r as N,j as w,cB as oa,cC as lc}from"./index-CsB6QrBB.js";import{f as cc,h as uc,n as fc,j as dc,C as hc,A as pc}from"./constants-CiNOCN3_.js";import{B as Ti,c as Pi}from"./collections-CgxUTBvp.js";import{R as Es}from"./index-CNmK2UE6.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=qe(n):typeof n=="number"?e.number=qe(n):typeof n=="boolean"?e.boolean=qe(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return qe(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([qe(n),qe(r),...i.map(s=>qe(s))])}return t==="boolean"?mt([qe(!0),qe(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Cc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Tc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Tn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Tn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Tn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Tn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},qc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Vc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Tn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Tn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Cc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Tc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new qc,new Vc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Ce,Et,kt,Qn,ur,wn,qt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Ce),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,qt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,qt,void 0),G(this,Ce)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Ce,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Ce)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,qt)&&clearTimeout(G(this,qt)),G(this,Ce)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Ce,this.CLOSED),he(this,ct,void 0))}}Ce=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,qt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Ce,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Ce)!==this.CLOSED&&he(this,Ce,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,qt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Tr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Cs=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Ts=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Cs(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Cs(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Ts(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Ts(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
|
|
1
|
+
import{co as Fe,bm as Os,J as oe,I as ge,aZ as ti,bR as _i,aJ as Ie,bk as mt,a_ as qe,ap as mr,cp as rn,H as _e,cq as Ii,cr as ws,cs as ec,bP as tc,ct as ia,cu as nc,cv as rc,cw as ic,cx as fn,cy as Tr,cz as xs,bK as sa,bC as sc,aI as ze,bQ as oc,aH as On,ba as Ci,cA as ac,r as N,j as w,cB as oa,cC as lc}from"./index-dmkCn37I.js";import{f as cc,h as uc,n as fc,j as dc,C as hc,A as pc}from"./constants-fVwC9Czh.js";import{B as Ti,c as Pi}from"./collections-CreMYLs8.js";import{R as Es}from"./index-DTLkaJxe.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=qe(n):typeof n=="number"?e.number=qe(n):typeof n=="boolean"?e.boolean=qe(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return qe(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([qe(n),qe(r),...i.map(s=>qe(s))])}return t==="boolean"?mt([qe(!0),qe(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Cc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Tc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Tn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Tn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Tn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Tn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},qc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Vc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Tn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Tn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Cc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Tc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new qc,new Vc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Ce,Et,kt,Qn,ur,wn,qt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Ce),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,qt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,qt,void 0),G(this,Ce)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Ce,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Ce)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,qt)&&clearTimeout(G(this,qt)),G(this,Ce)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Ce,this.CLOSED),he(this,ct,void 0))}}Ce=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,qt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Ce,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Ce)!==this.CLOSED&&he(this,Ce,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,qt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Tr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Cs=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Ts=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Cs(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Cs(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Ts(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Ts(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
|
|
2
2
|
The stepInput is the resolved value of the references in the input field. Example:
|
|
3
3
|
{
|
|
4
4
|
"input": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as D,j as i,r as B,s as me,P as Se,f as je,c as se,t as ne,b as ke,K as we,n as Ie}from"./index-dmkCn37I.js";import{u as _e,T as Ae,a as Oe,b as Te}from"./tooltip-DHpEGVi8.js";import{y as Ee}from"./agent-icon-CDOpQPVP.js";import{h as De,j as Me,k as Pe,i as Re,b as $e,C as q,a as Le,u as ze}from"./index-xstkyz4B.js";import{I as ye}from"./integration-icon-PH7vkQ9v.js";import{S as ue}from"./skeleton-De5l7OL1.js";import{W as H,i as ve}from"./constants-fVwC9Czh.js";import{b as Be}from"./use-virtual-mcp-BVVlTr3L.js";import{u as Fe}from"./use-organization-settings-C2ni1vuh.js";import{i as He}from"./ChevronRight-PLlU1t0W.js";import{s as Ge}from"./Plus-Bk1OvOXE.js";import{a as Ke}from"./Users03-B0r4bSLn.js";import{I as ce,S as Ue,L as Ve,b as We}from"./lean-canvas-recruit-modal-CZMvychF.js";import{u as qe}from"./use-create-virtual-mcp-DdlYO5qT.js";import{N as Ye}from"./select-model-CLZn_-xL.js";import{u as Je}from"./use-ai-providers-Cf9shvYI.js";import{d as Qe}from"./XCircle-B14ynTvz.js";import"./AlertCircle-D7In04VZ.js";import"./Tool01-DUGZCBMz.js";import"./Archive-DaxWSUle.js";import"./XClose-DwaprZxL.js";import"./RefreshCcw01-CeTSzQsT.js";import"./ArrowNarrowLeft-I0Rr4fru.js";import"./ArrowUpRight-Cl4DoJ1w.js";import"./ZapSquare-DgAVTy7i.js";import"./CheckCircle-ByasFo1p.js";import"./Check-nv67ec3-.js";import"./ChevronDown-Brvsr3Fl.js";import"./ChevronUp-VDqvRLBN.js";import"./DotsVertical-DSgmYETN.js";import"./Container-DTioRpeZ.js";import"./Star01-_us4XpQn.js";import"./Palette-DGf3gs0h.js";import"./SearchMd-Bo6RzH5Q.js";import"./LayoutLeft-CG8cspKX.js";import"./LinkExternal01-FKIQuNsM.js";import"./Lock01-XwPtPsiy.js";import"./Sun-Zv-PWUwn.js";import"./Play-BUgAN2i6.js";import"./Settings02-uL3uu5-7.js";import"./Shield01-OH6-JWjw.js";import"./Trash01-AR9qKMZU.js";import"./User01-3xBsy6wV.js";import"./X-DDQYEU6o.js";import"./Zap-EburzyyI.js";import"./dialog-qtKrSwKA.js";import"./switch-Dg8MplKB.js";import"./input-C0h7cNmt.js";import"./use-connection-BCPpnVMX.js";import"./use-collections-XDqst4E_.js";import"./use-navigate-to-agent-DjWaqrlh.js";import"./chat-context-BpeMEIll.js";import"./use-decopilot-events-DTwuBO8M.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-DZibCf5w.js";import"./drawer-B0OHUPPF.js";import"./shell-layout-DU81GX4X.js";import"./required-auth-layout-BVmXc_2r.js";import"./use-org-sso-CWD9kAdD.js";import"./pair-BJSIhyuY.js";import"./index-CB6J7z90.js";import"./use-copy-BNSIRmV_.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-BrFLFb5i.js";import"./spinner-CsMegR0e.js";import"./collection-search-CMNBGaQC.js";import"./tabs-Bun7zdDt.js";import"./form-dz7U0CZK.js";import"./label-C5ENUwLS.js";import"./select-BjC54T39.js";import"./toggle-group-DDewxrST.js";import"./dropdown-menu-BnaZE7Qd.js";import"./index-KBbmKsy_.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C06IRcu3.js";import"./use-registry-connections-DeY5Qm5r.js";import"./useInfiniteQuery-B4rOzvqQ.js";import"./infiniteQueryObserver-BGrXNOzy.js";import"./extract-connection-data-D7Vkjtul.js";import"./constants-B0L3jJTH.js";import"./collections-CreMYLs8.js";import"./card-NxdWcP2Y.js";import"./collection-tabs-CAm-q3uz.js";import"./badge-D0TDvkU5.js";import"./textarea-Da3AWsK6.js";import"./connection-form-helpers-n0-EInK6.js";import"./use-infinite-scroll-ByL07kWP.js";import"./useSuspenseInfiniteQuery-DVCwsKmm.js";import"./checkbox-q_vRqr9W.js";import"./use-mcp-tools-a-ZvbrGo.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-JFkuXk7Y.js";import"./settings-section-CijJZPn7.js";import"./unwrap-tool-result-BYXdCQMg.js";function Xe(e){try{const t=localStorage.getItem(`mesh:chat:recent-agents:${e}`);return t?JSON.parse(t):[]}catch{return[]}}const Ze=8;function xe(e){const t=D.c(21),{agent:s,onSpecialClick:r,tracking:n}=e,{org:l}=me(),a=je();let o;t[0]!==s.id||t[1]!==s.title||t[2]!==a||t[3]!==r||t[4]!==l||t[5]!==n.action||t[6]!==n.template_id||t[7]!==n.tile_kind?(o=()=>{if(ne("home_agent_tile_clicked",{template_id:n.template_id,agent_id:s.id,agent_title:s.title,tile_kind:n.tile_kind,action:n.action}),r)r();else{const I=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:l.slug,taskId:I},search:{virtualmcpid:s.id}})}},t[0]=s.id,t[1]=s.title,t[2]=a,t[3]=r,t[4]=l,t[5]=n.action,t[6]=n.template_id,t[7]=n.tile_kind,t[8]=o):o=t[8];const m=o;let g;t[9]===Symbol.for("react.memo_cache_sentinel")?(g=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),t[9]=g):g=t[9];const b=`Select agent ${s.title}`;let M;t[10]===Symbol.for("react.memo_cache_sentinel")?(M=i.jsx(Ke,{size:24}),t[10]=M):M=t[10];let j;t[11]!==s.icon||t[12]!==s.title?(j=i.jsx(ye,{icon:s.icon,name:s.title,size:"md",fallbackIcon:M,className:"transition-transform group-hover:scale-110"}),t[11]=s.icon,t[12]=s.title,t[13]=j):j=t[13];let f;t[14]!==s.title?(f=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight line-clamp-2 break-words w-full",children:s.title}),t[14]=s.title,t[15]=f):f=t[15];let k;return t[16]!==m||t[17]!==b||t[18]!==j||t[19]!==f?(k=i.jsxs("button",{type:"button",onClick:m,className:g,"aria-label":b,children:[j,f]}),t[16]=m,t[17]=b,t[18]=j,t[19]=f,t[20]=k):k=t[20],k}function et(){const e=D.c(8),t=je(),{org:s}=me();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),e[0]=r):r=e[0];let n;e[1]!==t||e[2]!==s.slug?(n=()=>{ne("home_see_all_agents_clicked"),t({to:"/$org/settings/agents",params:{org:s.slug}})},e[1]=t,e[2]=s.slug,e[3]=n):n=e[3];let l,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-xl bg-accent flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(He,{size:20,className:"text-foreground"})}),a=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"See all"}),e[4]=l,e[5]=a):(l=e[4],a=e[5]);let o;return e[6]!==n?(o=i.jsxs("button",{type:"button",className:r,"aria-label":"See all agents",onClick:n,children:[l,a]}),e[6]=n,e[7]=o):o=e[7],o}function tt(){const e=D.c(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={navigateOnCreate:!0},e[0]=t):t=e[0];const{createVirtualMCP:s,isCreating:r}=qe(t);let n;e[1]!==s?(n=()=>{ne("home_create_agent_clicked"),s()},e[1]=s,e[2]=n):n=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group","disabled:opacity-50 disabled:cursor-not-allowed"),e[3]=l):l=e[3];let a,o;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"size-12 rounded-xl bg-background border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(Ge,{size:20,className:"text-muted-foreground"})}),o=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"Create agent"}),e[4]=a,e[5]=o):(a=e[4],o=e[5]);let m;return e[6]!==r||e[7]!==n?(m=i.jsxs("button",{type:"button",onClick:n,disabled:r,className:l,"aria-label":"Create agent",children:[a,o]}),e[6]=r,e[7]=n,e[8]=m):m=e[8],m}function ie(e,t,s){return e.find(r=>r.id!==null&&(r.metadata?.type===t||r.title===s))}function it(){const e=D.c(52),t=Be(),{locator:s,org:r}=me(),n=Fe(),[l,a]=B.useState(!1),[o,m]=B.useState(!1),[g,b]=B.useState(!1),[M,j]=B.useState(!1),[f,k]=B.useState(!1),[I,L]=B.useState(!1),[P,z]=B.useState(!1),[R]=Se(),$=De(r.slug);let p,h,u,x,_,y,A,d;if(e[0]!==s||e[1]!==$||e[2]!==n||e[3]!==R||e[4]!==t){const re=H.find(ut),Y=H.find(pt),J=H.find(ft),Q=H.find(dt),Z=H.find(mt),de=H.find(ct),le=H.find(at);u=ie(t,Y.id,Y.title),p=ie(t,J.id,J.title),h=ie(t,Q.id,Q.title),x=ie(t,Z.id,Z.title);const fe=c=>{if(c===re.id)return{key:c,kind:"template-recruit",templateId:"site-editor",agent:re,onClick:"import-deco"};if(c===Y.id)return u?{key:u.id,kind:"existing",templateId:"site-diagnostics",agent:u}:{key:c,kind:"template-recruit",templateId:"site-diagnostics",agent:Y,onClick:"diagnostics"};if(c===J.id)return p?{key:p.id,kind:"existing",templateId:"ai-image",agent:p}:{key:c,kind:"template-recruit",templateId:"ai-image",agent:J,onClick:"ai-image"};if(c===Z.id)return x?{key:x.id,kind:"existing",templateId:"lean-canvas",agent:x}:{key:c,kind:"template-recruit",templateId:"lean-canvas",agent:Z,onClick:"lean-canvas"};if(c===de.id)return{key:c,kind:"template-recruit",templateId:"studio-pack",agent:de,onClick:"studio-pack"};if(c===le.id)return R.experimental_vibecode?{key:c,kind:"template-recruit",templateId:"self-healing-storefront",agent:le,onClick:"self-healing"}:null;if(c===Q.id)return h?{key:h.id,kind:"existing",templateId:"ai-research",agent:h}:{key:c,kind:"template-recruit",templateId:"ai-research",agent:Q,onClick:"ai-research"};const F=t.find(V=>V.id!==null&&V.id===c&&!ve(V.id));return F?{key:F.id,kind:"existing",templateId:null,agent:F}:null};let ee;if(n?.ids)ee=n.ids.map(fe).filter(ot).slice(0,Ze);else{const F=[re.id,le.id,Y.id,J.id,Q.id].map(fe).filter(lt),V=Xe(s),Ce=t.filter(rt).filter(W=>W.id!==u?.id&&W.id!==p?.id&&W.id!==h?.id).sort((W,pe)=>{const oe=V.indexOf(W.id),ae=V.indexOf(pe.id);return oe!==-1&&ae!==-1?oe-ae:oe!==-1?-1:ae!==-1?1:new Date(pe.updated_at).getTime()-new Date(W.updated_at).getTime()}).slice(0,4).map(nt);ee=[...F,...Ce]}_=ee.some(st);let te;e[13]!==$?(te=c=>{if(c.kind==="template-recruit"){const F={"import-deco":()=>a(!0),diagnostics:()=>m(!0),"ai-image":()=>b(!0),"ai-research":()=>j(!0),"lean-canvas":()=>k(!0),"studio-pack":()=>L(!0),"self-healing":()=>z(!0)}[c.onClick];return i.jsx(xe,{agent:c.agent,onSpecialClick:F,tracking:{template_id:c.templateId,tile_kind:"template",action:"open_modal"}},c.key)}return i.jsx(xe,{agent:c.agent,onSpecialClick:()=>$(c.agent.id),tracking:{template_id:c.templateId,tile_kind:c.templateId?"existing":"recent",action:"navigate"}},c.key)},e[13]=$,e[14]=te):te=e[14];const Ne=te;d="w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",y="flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",A=ee.map(Ne),e[0]=s,e[1]=$,e[2]=n,e[3]=R,e[4]=t,e[5]=p,e[6]=h,e[7]=u,e[8]=x,e[9]=_,e[10]=y,e[11]=A,e[12]=d}else p=e[5],h=e[6],u=e[7],x=e[8],_=e[9],y=e[10],A=e[11],d=e[12];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(tt,{}),e[15]=O):O=e[15];let v;e[16]!==_?(v=_&&i.jsx(et,{}),e[16]=_,e[17]=v):v=e[17];let N;e[18]!==y||e[19]!==A||e[20]!==v?(N=i.jsxs("div",{className:y,children:[A,O,v]}),e[18]=y,e[19]=A,e[20]=v,e[21]=N):N=e[21];let T;e[22]!==d||e[23]!==N?(T=i.jsx("div",{className:d,children:N}),e[22]=d,e[23]=N,e[24]=T):T=e[24];let C;e[25]!==l?(C=i.jsx(ce,{open:l,onOpenChange:a}),e[25]=l,e[26]=C):C=e[26];let S;e[27]!==o||e[28]!==u?(S=i.jsx(Ue,{open:o,onOpenChange:m,existingAgent:u}),e[27]=o,e[28]=u,e[29]=S):S=e[29];let w;e[30]!==g||e[31]!==p?(w=i.jsx(Me,{open:g,onOpenChange:b,existingAgent:p}),e[30]=g,e[31]=p,e[32]=w):w=e[32];let E;e[33]!==M||e[34]!==h?(E=i.jsx(Pe,{open:M,onOpenChange:j,existingAgent:h}),e[33]=M,e[34]=h,e[35]=E):E=e[35];let G;e[36]!==x||e[37]!==f?(G=i.jsx(Ve,{open:f,onOpenChange:k,existingAgent:x}),e[36]=x,e[37]=f,e[38]=G):G=e[38];let K;e[39]!==I?(K=i.jsx(We,{open:I,onOpenChange:L}),e[39]=I,e[40]=K):K=e[40];let U;e[41]!==P?(U=i.jsx(Re,{open:P,onOpenChange:z}),e[41]=P,e[42]=U):U=e[42];let X;return e[43]!==E||e[44]!==G||e[45]!==K||e[46]!==U||e[47]!==T||e[48]!==C||e[49]!==S||e[50]!==w?(X=i.jsxs(i.Fragment,{children:[T,C,S,w,E,G,K,U]}),e[43]=E,e[44]=G,e[45]=K,e[46]=U,e[47]=T,e[48]=C,e[49]=S,e[50]=w,e[51]=X):X=e[51],X}function st(e){return e.kind==="existing"&&e.templateId===null}function nt(e){return{key:e.id,kind:"existing",templateId:null,agent:e}}function rt(e){return e.id!==null&&!ve(e.id)}function lt(e){return e!==null}function ot(e){return e!==null}function at(e){return e.id==="self-healing-storefront"}function ct(e){return e.id==="studio-pack"}function mt(e){return e.id==="lean-canvas"}function dt(e){return e.id==="ai-research"}function ft(e){return e.id==="ai-image"}function pt(e){return e.id==="site-diagnostics"}function ut(e){return e.id==="site-editor"}function xt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",children:i.jsx("div",{className:"flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",children:Array.from({length:7}).map(gt)})}),e[0]=t):t=e[0],t}function gt(e,t){return i.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 w-[100px] shrink-0",children:[i.jsx(ue,{className:"size-12 rounded-xl shrink-0"}),i.jsx(ue,{className:"h-3 sm:h-4 w-full"})]},t)}function ge(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(B.Suspense,{fallback:i.jsx(xt,{}),children:i.jsx(it,{})}),e[0]=t):t=e[0],t}const ht=["radial-gradient(ellipse 25% 220% at -5% 120%, rgba(165,149,255,0.35) 0%, transparent 100%)","radial-gradient(ellipse 25% 220% at 105% -20%, rgba(208,236,26,0.32) 0%, transparent 100%)"].join(", "),bt="/decotexture.svg";function he(e){const t=D.c(7),{onClick:s}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={backgroundImage:ht},t[0]=r):r=t[0];let n,l;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("div",{className:"relative shrink-0 p-1.5 bg-[var(--brand-green-light)] rounded-lg border border-border",children:i.jsx(ye,{icon:"/logos/deco%20logo.svg",name:"deco.cx",size:"xs",className:"border-0 rounded-none bg-transparent"})}),l=i.jsx("p",{className:"flex-1 relative text-sm font-medium text-foreground leading-none whitespace-nowrap",children:"Import your deco.cx site"}),t[1]=n,t[2]=l):(n=t[1],l=t[2]);let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("img",{src:bt,alt:"","aria-hidden":!0,className:"absolute pointer-events-none",style:{width:"274.5px",height:"272.25px",left:"calc(50% + 145.5px)",top:"calc(50% + 40px)",transform:"translate(-50%, -50%)"}}),t[3]=a):a=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"relative bg-background flex items-center justify-center size-8 rounded-md shrink-0",children:i.jsx(Qe,{size:16,className:"text-foreground transition-transform group-hover:translate-x-0.5"})}),t[4]=o):o=t[4];let m;return t[5]!==s?(m=i.jsxs("button",{type:"button",onClick:s,className:"w-full relative flex items-center gap-4 px-4 py-4 rounded-lg border border-border bg-background overflow-hidden transition-colors text-left cursor-pointer group",style:r,children:[n,l,a,o]}),t[5]=s,t[6]=m):m=t[6],m}function jt(){const e=D.c(5),{data:t}=ke.useSession();let s;e[0]!==t?.user?.email?(s=we.decoProfile(t?.user?.email),e[0]=t?.user?.email,e[1]=s):s=e[1];const r=!!t?.user?.email;let n;e[2]!==s||e[3]!==r?(n={queryKey:s,queryFn:kt,enabled:r,staleTime:3e5},e[2]=s,e[3]=r,e[4]=n):n=e[4];const{data:l}=Ie(n);return l?.isDecoUser??!1}async function kt(){const e=await fetch("/api/deco-sites/profile");return e.ok?e.json():{isDecoUser:!1}}function be(){const e=D.c(52),{data:t}=ke.useSession(),[s,r]=B.useState(!1),n=jt(),l=_e(),a=Je(),{hasDecoKey:o,isZeroBalance:m,isInitialFreeCredit:g,balanceDollars:b,hasOnlyDecoProvider:M}=$e();if(a.length===0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"flex-1 flex items-center justify-center px-4 py-10",children:i.jsx(Ye,{})}),e[0]=d):d=e[0],d}let j;e[1]!==t?.user?.name?(j=t?.user?.name?.split(" ")[0]||"there",e[1]=t?.user?.name,e[2]=j):j=e[2];const f=j,k=o&&g&&b!=null,I=o&&m&&M;if(l){let d;e[3]!==b||e[4]!==k?(d=k&&i.jsx("div",{className:"mb-4",children:i.jsx(q.CreditsEyebrow,{balanceDollars:b})}),e[3]=b,e[4]=k,e[5]=d):d=e[5];let O;e[6]!==I?(O=I&&i.jsx("div",{className:"mb-4",children:i.jsx(q.NoCreditsEyebrow,{})}),e[6]=I,e[7]=O):O=e[7];let v;e[8]!==f?(v=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",f,"?"]}),e[8]=f,e[9]=v):v=e[9];let N;e[10]!==d||e[11]!==O||e[12]!==v?(N=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[d,O,v]}),e[10]=d,e[11]=O,e[12]=v,e[13]=N):N=e[13];let T;e[14]===Symbol.for("react.memo_cache_sentinel")?(T=i.jsxs("div",{className:"w-full flex flex-col gap-4 pb-4",children:[i.jsx(ge,{}),i.jsx(q.Input,{showConnectionsBanner:!0})]}),e[14]=T):T=e[14];let C;e[15]!==n?(C=n&&i.jsx("div",{className:"w-full",children:i.jsx(he,{onClick:()=>r(!0)})}),e[15]=n,e[16]=C):C=e[16];let S;e[17]!==N||e[18]!==C?(S=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-4",children:[N,T,C]}),e[17]=N,e[18]=C,e[19]=S):S=e[19];let w;e[20]!==s?(w=i.jsx(ce,{open:s,onOpenChange:r}),e[20]=s,e[21]=w):w=e[21];let E;return e[22]!==S||e[23]!==w?(E=i.jsxs(i.Fragment,{children:[S,w]}),e[22]=S,e[23]=w,e[24]=E):E=e[24],E}let L;e[25]!==b||e[26]!==k?(L=k&&i.jsx("div",{className:"mb-4",children:i.jsx(q.CreditsEyebrow,{balanceDollars:b})}),e[25]=b,e[26]=k,e[27]=L):L=e[27];let P;e[28]!==I?(P=I&&i.jsx("div",{className:"mb-4",children:i.jsx(q.NoCreditsEyebrow,{})}),e[28]=I,e[29]=P):P=e[29];let z;e[30]!==f?(z=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",f,"?"]}),e[30]=f,e[31]=z):z=e[31];let R;e[32]!==L||e[33]!==P||e[34]!==z?(R=i.jsxs("div",{className:"text-center mb-10",children:[L,P,z]}),e[32]=L,e[33]=P,e[34]=z,e[35]=R):R=e[35];let $;e[36]===Symbol.for("react.memo_cache_sentinel")?($=i.jsx("div",{className:"w-full",children:i.jsx(q.Input,{showConnectionsBanner:!0})}),e[36]=$):$=e[36];let p;e[37]!==R?(p=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[R,$]}),e[37]=R,e[38]=p):p=e[38];let h;e[39]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx("div",{className:"w-full mt-10 mx-auto",children:i.jsx(ge,{})}),e[39]=h):h=e[39];let u;e[40]!==p?(u=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[p,h]}),e[40]=p,e[41]=u):u=e[41];let x;e[42]!==n?(x=n&&i.jsx("div",{className:"absolute bottom-6 left-0 right-0 px-10",children:i.jsx("div",{className:"w-full max-w-[500px] mx-auto",children:i.jsx(he,{onClick:()=>r(!0)})})}),e[42]=n,e[43]=x):x=e[43];let _;e[44]!==u||e[45]!==x?(_=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-10",children:[u,x]}),e[44]=u,e[45]=x,e[46]=_):_=e[46];let y;e[47]!==s?(y=i.jsx(ce,{open:s,onOpenChange:r}),e[47]=s,e[48]=y):y=e[48];let A;return e[49]!==_||e[50]!==y?(A=i.jsxs(i.Fragment,{children:[_,y]}),e[49]=_,e[50]=y,e[51]=A):A=e[51],A}const _t="flex size-7 shrink-0 items-center justify-center rounded-md transition-colors",yt="bg-sidebar-accent text-sidebar-foreground",vt="text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";function Nt(){const e=D.c(13),{tasksOpen:t,toggleTasks:s}=ze();let r;e[0]!==t||e[1]!==s?(r=()=>{ne("home_toolbar_toggled",{button:"tasks",next_state:t?"closed":"open"}),s()},e[0]=t,e[1]=s,e[2]=r):r=e[2];const n=t?yt:vt;let l;e[3]!==n?(l=se(_t,n),e[3]=n,e[4]=l):l=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ee,{size:16}),e[5]=a):a=e[5];let o;e[6]!==r||e[7]!==l||e[8]!==t?(o=i.jsx(Ae,{asChild:!0,children:i.jsx("button",{type:"button",onClick:r,"aria-pressed":t,className:l,children:a})}),e[6]=r,e[7]=l,e[8]=t,e[9]=o):o=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Oe,{side:"bottom",children:"Tasks"}),e[10]=m):m=e[10];let g;return e[11]!==o?(g=i.jsxs(Te,{delayDuration:300,children:[o,m]}),e[11]=o,e[12]=g):g=e[12],g}function ps(){const e=D.c(3);if(_e()){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(be,{})}),e[0]=n):n=e[0],n}let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Le.Toggles,{children:i.jsx(Nt,{})}),e[1]=s):s=e[1];let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs(i.Fragment,{children:[s,i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(be,{})})})})]}),e[2]=r):r=e[2],r}export{ps as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as R,s as he,f as Se,U as St,g as et,d as Ct,W as xs,X as ps,Y as hs,j as s,Z as gs,c as J,t as se,r as S,$ as Nt,a0 as kt,H as bs,J as js,D as vs,z as _s,a as ys,B as Qe,b as _e,a1 as Ss,P as wt,x as be,a2 as Cs,a3 as Ns,o as Be,a4 as ks,a5 as ws,a6 as Is,a7 as Ms,a8 as Oe,a9 as As,aa as $s,ab as Os,ac as zs,ad as It,ae as Ps,af as Ts,ag as Rs,ah as Es,ai as Ds,aj as Ls,ak as Fs,al as Us,am as Gs,an as Bs,ao as Hs,L as Vs,E as tt,K as Mt}from"./index-dmkCn37I.js";import{p as Ks,g as Ws,C as qs,D as lt,E as rt,F as Qs,G as at,H as Ys,A as $e,j as Xs,I as Js,J as Zs}from"./agent-icon-CDOpQPVP.js";import{i as en}from"./LayoutLeft-CG8cspKX.js";import{u as At,r as tn}from"./shell-layout-DU81GX4X.js";import{f as sn,g as nn}from"./pair-BJSIhyuY.js";import{f as Pe,g as Te,h as pe,u as He,i as xe,j as le,k as $t,l as Ot,m as on,n as zt,o as Pt}from"./sidebar-sY4KII-w.js";import{S as Ue}from"./skeleton-De5l7OL1.js";import{b as st,P as nt,a as ot}from"./popover-9waMMdOC.js";import{b as Tt,a as Rt,D as Et}from"./drawer-B0OHUPPF.js";import{A as ct}from"./avatar-JFkuXk7Y.js";import{u as Dt,T as Ye,a as Xe,c as dt,b as Je}from"./tooltip-DHpEGVi8.js";import{i as Lt}from"./Check-nv67ec3-.js";import{c as ut,a as ln,e as rn}from"./XCircle-B14ynTvz.js";import{i as an,b as cn}from"./ZapSquare-DgAVTy7i.js";import{n as dn,a as un,i as mn}from"./Sun-Zv-PWUwn.js";import{s as Ge}from"./Plus-Bk1OvOXE.js";import{a as Ve}from"./Settings02-uL3uu5-7.js";import{i as fn}from"./Shield01-OH6-JWjw.js";import{a as Ft}from"./Users03-B0r4bSLn.js";import{f as xn,a as pn,b as hn,c as gn,d as bn,e as jn,A as vn}from"./alert-dialog-DzUiFLm5.js";import{F as _n,a as yn,b as Sn,c as Cn,d as Nn,e as kn,f as wn}from"./form-dz7U0CZK.js";import{I as In}from"./input-C0h7cNmt.js";import{S as Mn}from"./spinner-CsMegR0e.js";import"./index-jo98Roqy.js";import{s as An}from"./XClose-DwaprZxL.js";import{S as Ut,u as Gt,W as ze,i as $n,b as On}from"./constants-fVwC9Czh.js";import{u as zn}from"./use-mcp-tools-a-ZvbrGo.js";import{u as Pn}from"./use-ai-providers-Cf9shvYI.js";import{A as Tn,h as Rn,i as En,j as Dn,k as Ln,C as Fn}from"./index-xstkyz4B.js";import{u as Un,a as mt,K as Gn,P as Bn,S as Hn,v as Vn,D as Kn,c as Wn,s as qn,b as Qn,d as Yn,C as Xn,e as Jn}from"./collection-search-B_PTLHi8.js";import{i as ft}from"./X-DDQYEU6o.js";import{b as Bt,u as Ht}from"./use-virtual-mcp-BVVlTr3L.js";import{u as Vt,a as Zn}from"./use-navigate-to-agent-DjWaqrlh.js";import{u as eo}from"./use-create-virtual-mcp-DdlYO5qT.js";import{I as to,a as so,S as no,L as oo,b as io,G as lo}from"./lean-canvas-recruit-modal-CZMvychF.js";import{u as ro}from"./use-tasks-DZibCf5w.js";import{E as ao}from"./empty-state-BCr9v4T1.js";import{e as xt,f as co}from"./chat-context-BpeMEIll.js";import{u as uo}from"./use-decopilot-events-DTwuBO8M.js";import{g as Kt,a as pt,b as ht,h as gt,D as bt}from"./dropdown-menu-BnaZE7Qd.js";import{i as mo}from"./Archive-DaxWSUle.js";import{i as fo}from"./Zap-EburzyyI.js";import{g as xo}from"./task-status-n57TCkuM.js";function Wt(){const t=R.c(77),{org:e}=he(),n=Se(),o=St(),{setTasksOpen:i,openTab:l}=At(),r=e.slug,a=he().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=et(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=Ct(d),x=o.location.pathname;let f;t[2]!==a.enabledPlugins?(f=a.enabledPlugins??[],t[2]=a.enabledPlugins,t[3]=f):f=t[3];const p=f;let C;t[4]!==a.ui?(C=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=C):C=t[5];const $=C;let g,N,h,y;if(t[6]!==a.id||t[7]!==p||t[8]!==n||t[9]!==r||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let _;t[17]!==p?(_=X=>p.includes(X.pluginId),t[17]=p,t[18]=_):_=t[18];const K=xs.filter(_),W=m.virtualmcpid??a.id;N=!!m.virtualmcpid;const G=u.taskId??"",Y=u.pluginId;let ee;t[19]!==Y?(ee=X=>Y===X,t[19]=Y,t[20]=ee):ee=t[20],g=ee;let Z;t[21]!==G||t[22]!==n||t[23]!==r||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();n({to:"/$org/$taskId/$pluginId",params:{org:r,taskId:oe,pluginId:X},search:re=>({...re,virtualmcpid:W})})},t[21]=G,t[22]=n,t[23]=r,t[24]=W,t[25]=Z):Z=t[25],h=Z;let ne;t[26]!==g||t[27]!==h?(ne=X=>({key:X.pluginId,label:X.label,icon:X.icon,isActive:g(X.pluginId),onClick:()=>h(X.pluginId)}),t[26]=g,t[27]=h,t[28]=ne):ne=t[28],y=K.map(ne),t[6]=a.id,t[7]=p,t[8]=n,t[9]=r,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=N,t[15]=h,t[16]=y}else g=t[13],N=t[14],h=t[15],y=t[16];const j=y;let b;if(t[29]!==p||t[30]!==g||t[31]!==h){let _;t[33]!==p?(_=G=>p.includes(G.pluginId),t[33]=p,t[34]=_):_=t[34];const K=ps.filter(_);let W;t[35]!==g||t[36]!==h?(W=G=>({type:"group",group:{id:`${G.pluginId}-${G.id}`,label:G.label,items:G.items.map((Y,ee)=>({key:`${G.pluginId}-${G.id}-${ee}`,label:Y.label,icon:Y.icon,isActive:g(G.pluginId),onClick:()=>h(G.pluginId)})),defaultExpanded:G.defaultExpanded??!0}}),t[35]=g,t[36]=h,t[37]=W):W=t[37],b=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=b}else b=t[32];const v=b;let I;if(t[38]!==l||t[39]!==$){let _;t[41]!==l?(_=K=>{const W=Ks(K.icon),G=W.type==="icon"?Ws(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?s.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?s.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):s.jsx(en,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>l(sn(K.connectionId,K.toolName))}},t[41]=l,t[42]=_):_=t[42],I=$.map(_),t[38]=l,t[39]=$,t[40]=I}else I=t[40];const F=I;let O;t[43]!==F?(O=F.length>0?{type:"group",group:{id:"apps",label:"Apps",items:F,defaultExpanded:!0}}:null,t[43]=F,t[44]=O):O=t[44];const z=O;let E;t[45]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(qs,{className:"size-4!"}),t[45]=E):E=t[45];const P=x===`/${r}`||x===`/${r}/`;let k;t[46]!==n||t[47]!==r||t[48]!==i?(k=()=>{i(!1),n({to:"/$org",params:{org:r}})},t[46]=n,t[47]=r,t[48]=i,t[49]=k):k=t[49];let w;t[50]!==k||t[51]!==P?(w={key:"home",label:"Home",icon:E,isActive:P,onClick:k},t[50]=k,t[51]=P,t[52]=w):w=t[52];const M=w;let D;t[53]!==p?(D=p.includes(hs),t[53]=p,t[54]=D):D=t[54];const A=D;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(gs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==r||t[57]!==x?(U=x.startsWith(`/${r}/settings/workflows`),t[56]=r,t[57]=x,t[58]=U):U=t[58];let L;t[59]!==n||t[60]!==r?(L=()=>n({to:"/$org/settings/workflows",params:{org:r}}),t[59]=n,t[60]=r,t[61]=L):L=t[61];let H;t[62]!==U||t[63]!==L?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:L},t[62]=U,t[63]=L,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==M||t[66]!==N||t[67]!==A||t[68]!==V){const _=[M];N&&A&&_.push(V),q={type:"items",items:_},t[65]=M,t[66]=N,t[67]=A,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==z||t[71]!==v||t[72]!==j||t[73]!==q){if(Q=[q],j.length>0){let _;t[75]!==j?(_={type:"items",items:j},t[75]=j,t[76]=_):_=t[76],Q.push(_)}v.length>0&&Q.push(...v),z&&Q.push(z),t[70]=z,t[71]=v,t[72]=j,t[73]=q,t[74]=Q}else Q=t[74];return Q}function qt(t){const e=R.c(3),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let i;return e[1]!==n?(i=s.jsxs(Pe,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,s.jsx(Te,{children:s.jsx(pe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function po(){const t=R.c(7),n=Nt().logo??kt,o=typeof n=="string"?n:n.light,i=typeof n=="string"?n:n.dark;let l;t[0]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=l):l=t[1];let r;t[2]!==i?(r=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==l||t[5]!==r?(a=s.jsx(zt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:s.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[l,r]})}),t[4]=l,t[5]=r,t[6]=a):a=t[6],a}function Qt(t){const e=R.c(15),{item:n}=t,{isMobile:o,setOpenMobile:i}=He();let l;e[0]!==o||e[1]!==n||e[2]!==i?(l=()=>{se("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:o}),n.onClick?.(),o&&i(!1)},e[0]=o,e[1]=n,e[2]=i,e[3]=l):l=e[3];const r=l,a=n.key,c=n.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==r||e[7]!==n.icon||e[8]!==n.isActive||e[9]!==n.label?(d=s.jsx(xe,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"bg-muted/75",children:n.icon}),e[6]=r,e[7]=n.icon,e[8]=n.isActive,e[9]=n.label,e[10]=d):d=e[10];let m;return e[11]!==n.key||e[12]!==u||e[13]!==d?(m=s.jsx(le,{className:u,children:d},a),e[11]=n.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function ho(t){const e=R.c(12),{section:n}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx($t,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;e[2]!==n.group.items?(l=n.group.items.map(bo),e[2]=n.group.items,e[3]=l):l=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==l?(r=s.jsx(qt,{label:o,defaultExpanded:i,children:l}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=l,e[7]=r):r=e[7],r}case"items":{let o;e[8]!==n.items?(o=n.items.map(go),e[8]=n.items,e[9]=o):o=e[9];let i;return e[10]!==o?(i=s.jsx(Pe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=i):i=e[11],i}}}function go(t){return s.jsx(Qt,{item:t},t.key)}function bo(t){return s.jsx(Qt,{item:t},t.key)}function jo(t){const e=R.c(14),{sections:n,header:o,footer:i,additionalContent:l,variant:r,contentClassName:a}=t,c=r===void 0?"sidebar":r;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(po,{})}),e[0]=u):u=e[0];let d;e[1]!==a?(d=J("flex flex-col flex-1 px-2 py-2 gap-0",a),e[1]=a,e[2]=d):d=e[2];let m;e[3]!==n?(m=n.map(vo),e[3]=n,e[4]=m):m=e[4];let x;e[5]!==l||e[6]!==d||e[7]!==m?(x=s.jsxs(Ot,{className:d,children:[m,l]}),e[5]=l,e[6]=d,e[7]=m,e[8]=x):x=e[8];let f;return e[9]!==i||e[10]!==o||e[11]!==x||e[12]!==c?(f=s.jsxs(on,{variant:c,children:[u,o,x,i]}),e[9]=i,e[10]=o,e[11]=x,e[12]=c,e[13]=f):f=e[13],f}function vo(t,e){return s.jsx(ho,{section:t},e)}function Yt(t){const e=R.c(2);let n;return e[0]!==t?(n=s.jsx(jo,{...t}),e[0]=t,e[1]=n):n=e[1],n}Yt.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Ue,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function _o(){const t=R.c(7),n=Nt().logo??kt,o=typeof n=="string"?n:n.light,i=typeof n=="string"?n:n.dark;let l;t[0]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=l):l=t[1];let r;t[2]!==i?(r=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==l||t[5]!==r?(a=s.jsx(zt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:s.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[l,r]})}),t[4]=l,t[5]=r,t[6]=a):a=t[6],a}function jt(t){const e=R.c(15),{item:n,onClose:o}=t,i=n.isActive&&"z-10";let l;e[0]!==i?(l=J(i),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==o?(r=()=>{n.onClick?.(),o()},e[2]=n,e[3]=o,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-8",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.isActive||e[8]!==n.label||e[9]!==r||e[10]!==a?(c=s.jsx(xe,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"bg-muted/75",children:a}),e[7]=n.isActive,e[8]=n.label,e[9]=r,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==l||e[13]!==c?(u=s.jsx(le,{className:l,children:c}),e[12]=l,e[13]=c,e[14]=u):u=e[14],u}function yo(t){const e=R.c(18),{section:n,onClose:o}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($t,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,l=n.group.defaultExpanded;let r;if(e[2]!==o||e[3]!==n.group.items){let c;e[5]!==o?(c=u=>s.jsx(jt,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],r=n.group.items.map(c),e[2]=o,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(qt,{label:i,defaultExpanded:l,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==o||e[12]!==n.items){let r;e[14]!==o?(r=a=>s.jsx(jt,{item:a,onClose:o},a.key),e[14]=o,e[15]=r):r=e[15],i=n.items.map(r),e[11]=o,e[12]=n.items,e[13]=i}else i=e[13];let l;return e[16]!==i?(l=s.jsx(Pe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=l):l=e[17],l}}}function So(t){const e=R.c(12),{sections:n,onClose:o,footer:i,additionalContent:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(_o,{})}),e[0]=r):r=e[0];let a;if(e[1]!==o||e[2]!==n){let d;e[4]!==o?(d=(m,x)=>s.jsx(yo,{section:m,onClose:o},x),e[4]=o,e[5]=d):d=e[5],a=n.map(d),e[1]=o,e[2]=n,e[3]=a}else a=e[3];let c;e[6]!==l||e[7]!==a?(c=s.jsxs(Ot,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,l]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==i||e[10]!==c?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[r,c,i]}),e[9]=i,e[10]=c,e[11]=u):u=e[11],u}function Xt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Co=bs({name:js().min(2,"Organization name is required")});function No(t){const e=R.c(41),{open:n,onOpenChange:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:vs(Co),defaultValues:{name:""}},e[0]=i):i=e[0];const l=_s(i);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={mutationFn:wo,onSuccess:ko},e[1]=r):r=e[1];const a=ys(r),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(hn,{children:[s.jsx(gn,{children:"Create a new organization"}),s.jsx(bn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==l){let v;e[6]!==a?(v=I=>a.mutateAsync(I),e[6]=a,e[7]=v):v=e[7],d=l.handleSubmit(v),e[3]=a,e[4]=l,e[5]=d}else d=e[5];let m;e[8]!==l.formState.isSubmitting?(m=v=>{const{field:I}=v;return s.jsxs(Sn,{children:[s.jsx(Cn,{children:"Organization Name"}),s.jsx(Nn,{children:s.jsx(In,{...I,placeholder:"Acme Inc.",disabled:l.formState.isSubmitting})}),s.jsx(kn,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",Xt(I.value)]})]}),s.jsx(wn,{})]})},e[8]=l.formState.isSubmitting,e[9]=m):m=e[9];let x;e[10]!==l.control||e[11]!==m?(x=s.jsx(_n,{control:l.control,name:"name",render:m}),e[10]=l.control,e[11]=m,e[12]=x):x=e[12];let f;e[13]!==c?(f=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a.reset(),l.reset()},e[15]=a,e[16]=l,e[17]=p):p=e[17];let C;e[18]!==l.formState.isSubmitting||e[19]!==p?(C=s.jsx(xn,{disabled:l.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=l.formState.isSubmitting,e[19]=p,e[20]=C):C=e[20];const $=!l.formState.isValid||l.formState.isSubmitting;let g;e[21]!==l.formState.isSubmitting?(g=l.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Mn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=l.formState.isSubmitting,e[22]=g):g=e[22];let N;e[23]!==$||e[24]!==g?(N=s.jsx(Qe,{type:"submit",variant:"default",disabled:$,children:g}),e[23]=$,e[24]=g,e[25]=N):N=e[25];let h;e[26]!==N||e[27]!==C?(h=s.jsxs(jn,{children:[C,N]}),e[26]=N,e[27]=C,e[28]=h):h=e[28];let y;e[29]!==h||e[30]!==d||e[31]!==x||e[32]!==f?(y=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[x,f,h]}),e[29]=h,e[30]=d,e[31]=x,e[32]=f,e[33]=y):y=e[33];let j;e[34]!==l||e[35]!==y?(j=s.jsxs(pn,{children:[u,s.jsx(yn,{...l,children:y})]}),e[34]=l,e[35]=y,e[36]=j):j=e[36];let b;return e[37]!==o||e[38]!==n||e[39]!==j?(b=s.jsx(vn,{open:n,onOpenChange:o,children:j}),e[37]=o,e[38]=n,e[39]=j,e[40]=b):b=e[40],b}function ko(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function wo(t){const e=Xt(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await _e.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const o=n?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function Ze(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Io(t){const e=R.c(13),{org:n,size:o}=t,i=o===void 0?"sm":o,l=i==="xs"?"size-5":"size-6",r=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==l?(a=J(l,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ze(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let u;e[5]!==n.logo||e[6]!==n.name||e[7]!==r?(u=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:J("font-semibold leading-none",r),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=r,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=s.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function Le(t){const e=R.c(22),{item:n,onClose:o}=t;if(n.href){const c=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let d;e[0]!==n.icon?(d=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=d):d=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let x;return e[4]!==n.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(x=s.jsxs("a",{href:n.href,target:c,rel:u,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:o,children:[d,m]}),e[4]=n.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=x):x=e[10],x}let i;e[11]!==n||e[12]!==o?(i=()=>{n.onClick?.(),o()},e[11]=n,e[12]=o,e[13]=i):i=e[13];let l;e[14]!==n.icon?(l=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=l):l=e[15];let r;e[16]!==n.label?(r=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=r):r=e[17];let a;return e[18]!==i||e[19]!==l||e[20]!==r?(a=s.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[l,r]}),e[18]=i,e[19]=l,e[20]=r,e[21]=a):a=e[21],a}function vt(t){const e=R.c(16),{sortedOrgs:n,orgParam:o,onSelectOrg:i,onCreateOrg:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=r):r=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ge,{size:16}),e[1]=a):a=e[1];let c;e[2]!==l?(c=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[r,s.jsx("button",{type:"button",onClick:l,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:a})]}),e[2]=l,e[3]=c):c=e[3];let u;if(e[4]!==i||e[5]!==o||e[6]!==n){let x;e[8]!==i||e[9]!==o?(x=f=>s.jsxs("button",{type:"button",onClick:()=>i(f.slug),className:J("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",f.slug===o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Io,{org:f,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:f.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.slug})]}),f.slug===o&&s.jsx(Lt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},f.id),e[8]=i,e[9]=o,e[10]=x):x=e[10],u=n.map(x),e[4]=i,e[5]=o,e[6]=n,e[7]=u}else u=e[7];let d;e[11]!==u?(d=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=s.jsxs(s.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function _t(t){const e=R.c(142),{user:n,userImage:o,menuItems:i,signOutItem:l,themeOptions:r,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x,close:f,isMobile:p}=t;if(p){const G=n?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=s.jsx(ct,{url:o,fallback:G,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=G,e[1]=o,e[2]=Y):Y=e[2];const ee=n?.name??"User";let Z;e[3]!==ee?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=n?.email;let X;e[5]!==ne?(X=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=X):X=e[6];let oe;e[7]!==Z||e[8]!==X?(oe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let re;e[10]!==n?(re=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Oo)},e[10]=n,e[11]=re):re=e[11];let ye;e[12]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(ut,{size:14}),e[12]=ye):ye=e[12];let ae;e[13]!==re?(ae=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ye})}),e[13]=re,e[14]=ae):ae=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let ve;e[16]!==ae?(ve=s.jsx(dt,{delayDuration:300,children:s.jsxs(Je,{children:[ae,je]})}),e[16]=ae,e[17]=ve):ve=e[17];let ie;e[18]!==ve||e[19]!==Y||e[20]!==oe?(ie=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,ve]}),e[18]=ve,e[19]=Y,e[20]=oe,e[21]=ie):ie=e[21];let ce;e[22]!==x||e[23]!==m||e[24]!==d||e[25]!==u?(ce=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(vt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[22]=x,e[23]=m,e[24]=d,e[25]=u,e[26]=ce):ce=e[26];let de;if(e[27]!==f||e[28]!==i){let ge;e[30]!==f?(ge=De=>s.jsx(Le,{item:De,onClose:f},De.key),e[30]=f,e[31]=ge):ge=e[31],de=i.map(ge),e[27]=f,e[28]=i,e[29]=de}else de=e[29];let ue;e[32]!==f||e[33]!==l?(ue=s.jsx(Le,{item:l,onClose:f}),e[32]=f,e[33]=l,e[34]=ue):ue=e[34];let me;e[35]!==de||e[36]!==ue?(me=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[de,ue]}),e[35]=de,e[36]=ue,e[37]=me):me=e[37];let fe;e[38]!==ce||e[39]!==me?(fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ce,me]}),e[38]=ce,e[39]=me,e[40]=fe):fe=e[40];let T;if(e[41]!==a.theme||e[42]!==c||e[43]!==r){let ge;e[45]!==a.theme||e[46]!==c?(ge=De=>{const{value:qe,icon:us,label:ms}=De;return s.jsx("button",{type:"button","aria-label":ms,onClick:()=>c(fs=>({...fs,theme:qe})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===qe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:us},qe)},e[45]=a.theme,e[46]=c,e[47]=ge):ge=e[47],T=r.map(ge),e[41]=a.theme,e[42]=c,e[43]=r,e[44]=T}else T=e[44];let Ce;e[48]!==T?(Ce=s.jsx("div",{className:"flex items-center gap-0.5",children:T}),e[48]=T,e[49]=Ce):Ce=e[49];const Ke=a.enableSounds?"Disable sounds":"Enable sounds";let Ne;e[50]!==c?(Ne=()=>c($o),e[50]=c,e[51]=Ne):Ne=e[51];const We=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ke;e[52]!==We?(ke=J("size-8 rounded-md flex items-center justify-center transition-colors",We),e[52]=We,e[53]=ke):ke=e[53];let we;e[54]!==a.enableSounds?(we=a.enableSounds?s.jsx(lt,{size:14}):s.jsx(rt,{size:14}),e[54]=a.enableSounds,e[55]=we):we=e[55];let Ie;e[56]!==Ke||e[57]!==Ne||e[58]!==ke||e[59]!==we?(Ie=s.jsx("button",{type:"button","aria-label":Ke,onClick:Ne,className:ke,children:we}),e[56]=Ke,e[57]=Ne,e[58]=ke,e[59]=we,e[60]=Ie):Ie=e[60];let Re;e[61]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.318.0"]}),e[61]=Re):Re=e[61];let Me;e[62]!==Ie?(Me=s.jsxs("div",{className:"flex items-center gap-2",children:[Ie,Re]}),e[62]=Ie,e[63]=Me):Me=e[63];let Ae;e[64]!==Ce||e[65]!==Me?(Ae=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ce,Me]}),e[64]=Ce,e[65]=Me,e[66]=Ae):Ae=e[66];let Ee;return e[67]!==ie||e[68]!==fe||e[69]!==Ae?(Ee=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[ie,fe,Ae]}),e[67]=ie,e[68]=fe,e[69]=Ae,e[70]=Ee):Ee=e[70],Ee}const C=n?.name??"U";let $;e[71]!==C||e[72]!==o?($=s.jsx(ct,{url:o,fallback:C,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=C,e[72]=o,e[73]=$):$=e[73];const g=n?.name??"User";let N;e[74]!==g?(N=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=N):N=e[75];const h=n?.email;let y;e[76]!==h?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=y):y=e[77];let j;e[78]!==N||e[79]!==y?(j=s.jsxs("div",{className:"flex-1 min-w-0",children:[N,y]}),e[78]=N,e[79]=y,e[80]=j):j=e[80];let b;e[81]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ao)},e[81]=n,e[82]=b):b=e[82];let v;e[83]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{size:14}),e[83]=v):v=e[83];let I;e[84]!==b?(I=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[84]=b,e[85]=I):I=e[85];let F;e[86]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=F):F=e[86];let O;e[87]!==I?(O=s.jsx(dt,{delayDuration:300,children:s.jsxs(Je,{children:[I,F]})}),e[87]=I,e[88]=O):O=e[88];let z;e[89]!==O||e[90]!==$||e[91]!==j?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[$,j,O]}),e[89]=O,e[90]=$,e[91]=j,e[92]=z):z=e[92];let E;if(e[93]!==f||e[94]!==i){let G;e[96]!==f?(G=Y=>s.jsx(Le,{item:Y,onClose:f},Y.key),e[96]=f,e[97]=G):G=e[97],E=i.map(G),e[93]=f,e[94]=i,e[95]=E}else E=e[95];let P;e[98]!==f||e[99]!==l?(P=s.jsx(Le,{item:l,onClose:f}),e[98]=f,e[99]=l,e[100]=P):P=e[100];let k;e[101]!==E||e[102]!==P?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[E,P]}),e[101]=E,e[102]=P,e[103]=k):k=e[103];let w;if(e[104]!==a.theme||e[105]!==c||e[106]!==r){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(X=>({...X,theme:ee})),className:J("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ee?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},ee)},e[108]=a.theme,e[109]=c,e[110]=G):G=e[110],w=r.map(G),e[104]=a.theme,e[105]=c,e[106]=r,e[107]=w}else w=e[107];let M;e[111]!==w?(M=s.jsx("div",{className:"flex items-center gap-0.5",children:w}),e[111]=w,e[112]=M):M=e[112];const D=a.enableSounds?"Disable sounds":"Enable sounds";let A;e[113]!==c?(A=()=>c(Mo),e[113]=c,e[114]=A):A=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let U;e[115]!==B?(U=J("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=U):U=e[116];let L;e[117]!==a.enableSounds?(L=a.enableSounds?s.jsx(lt,{size:14}):s.jsx(rt,{size:14}),e[117]=a.enableSounds,e[118]=L):L=e[118];let H;e[119]!==D||e[120]!==A||e[121]!==U||e[122]!==L?(H=s.jsx("button",{type:"button","aria-label":D,onClick:A,className:U,children:L}),e[119]=D,e[120]=A,e[121]=U,e[122]=L,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.318.0"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=s.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==M||e[128]!==q?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[M,q]}),e[127]=M,e[128]=q,e[129]=Q):Q=e[129];let _;e[130]!==z||e[131]!==k||e[132]!==Q?(_=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,k,Q]}),e[130]=z,e[131]=k,e[132]=Q,e[133]=_):_=e[133];let K;e[134]!==x||e[135]!==m||e[136]!==d||e[137]!==u?(K=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(vt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[134]=x,e[135]=m,e[136]=d,e[137]=u,e[138]=K):K=e[138];let W;return e[139]!==_||e[140]!==K?(W=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[_,K]}),e[139]=_,e[140]=K,e[141]=W):W=e[141],W}function Mo(t){return{...t,enableSounds:!t.enableSounds}}function Ao(){be.success("User ID copied")}function $o(t){return{...t,enableSounds:!t.enableSounds}}function Oo(){be.success("User ID copied")}function Jt(){const t=R.c(50),{data:e}=_e.useSession(),{data:n}=_e.useListOrganizations(),o=Se();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const r=Ss(i)?.params.org,[a,c]=wt(),u=Dt(),[d,m]=S.useState(!1),[x,f]=S.useState(!1),p=e?.user,C=p?.image;let $;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==r||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==C){const h=n?.find(W=>W.slug===r);let y;if(t[11]!==r||t[12]!==n){let W;t[14]!==r?(W=(G,Y)=>G.slug===r?-1:Y.slug===r?1:G.name.localeCompare(Y.name),t[14]=r,t[15]=W):W=t[15],y=[...n??[]].sort(W),t[11]=r,t[12]=n,t[13]=y}else y=t[13];const j=y;let b;t[16]!==o?(b=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=b):b=t[17];const v=b;let I;t[18]===Symbol.for("react.memo_cache_sentinel")?(I=()=>m(!1),t[18]=I):I=t[18];const F=I;let O;t[19]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ve,{size:16}),t[19]=O):O=t[19];let z;t[20]!==o||t[21]!==r?(z={key:"preferences",label:"Preferences",icon:O,onClick:()=>{o({to:"/$org/settings/profile",params:{org:r??""}})}},t[20]=o,t[21]=r,t[22]=z):z=t[22];let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E={key:"terms",label:"Terms of Use",icon:s.jsx(Qs,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=E):E=t[23];let P;t[24]===Symbol.for("react.memo_cache_sentinel")?(P={key:"privacy",label:"Privacy Policy",icon:s.jsx(fn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=P):P=t[24];let k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k={key:"github",label:"decocms/studio",icon:s.jsx(Cs,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=k):k=t[25];let w;t[26]===Symbol.for("react.memo_cache_sentinel")?(w={key:"community",label:"Community",icon:s.jsx(Ft,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=w):w=t[26];let M;t[27]===Symbol.for("react.memo_cache_sentinel")?(M={key:"homepage",label:"Homepage",icon:s.jsx(ln,{size:16}),href:"https://decocms.com",external:!0},t[27]=M):M=t[27];let D;t[28]!==z?(D=[z,E,P,k,w,M],t[28]=z,t[29]=D):D=t[29];const A=D;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:s.jsx(an,{size:16}),onClick:Po},t[30]=B):B=t[30];const U=B;let L;t[31]===Symbol.for("react.memo_cache_sentinel")?(L={value:"light",icon:s.jsx(dn,{size:14}),label:"Light theme"},t[31]=L):L=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:s.jsx(un,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[L,H,{value:"system",icon:s.jsx(mn,{size:14}),label:"System theme"}],t[33]=V):V=t[33];const q=V;let Q;t[34]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(!1),f(!0)},t[34]=Q):Q=t[34];let _;t[35]!==v||t[36]!==u||t[37]!==A||t[38]!==r||t[39]!==a||t[40]!==c||t[41]!==j||t[42]!==p||t[43]!==C?(_={user:p,userImage:C,menuItems:A,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:j,orgParam:r,onSelectOrg:v,onCreateOrg:Q,close:F,isMobile:u},t[35]=v,t[36]=u,t[37]=A,t[38]=r,t[39]=a,t[40]=c,t[41]=j,t[42]=p,t[43]=C,t[44]=_):_=t[44];const K=_;$=u?s.jsxs(Tt,{open:d,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:Ze(h?.name??""),children:h?.logo?s.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(Rt,{className:"h-[80dvh] p-0",children:[s.jsx(Et,{className:"sr-only",children:"Account"}),s.jsx(_t,{...K})]})]}):s.jsxs(st,{open:d,onOpenChange:m,children:[s.jsx(nt,{asChild:!0,children:s.jsx(xe,{tooltip:h?.name??"Account",className:"rounded-md",children:s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:Ze(h?.name??""),children:h?.logo?s.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),s.jsx(ot,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:zo,children:s.jsx(_t,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=r,t[5]=n,t[6]=a,t[7]=c,t[8]=p,t[9]=C,t[10]=$}else $=t[10];let g;t[45]!==x?(g=s.jsx(No,{open:x,onOpenChange:f}),t[45]=x,t[46]=g):g=t[46];let N;return t[47]!==$||t[48]!==g?(N=s.jsxs(s.Fragment,{children:[$,g]}),t[47]=$,t[48]=g,t[49]=N):N=t[49],N}function zo(t){return t.preventDefault()}function Po(){se("signed_out",{source:"account_popover"}),_e.signOut()}function To({invitation:t}){const[e,n]=S.useState(!1),[o,i]=S.useState(!1),l=Be(),r=async()=>{n(!0);try{const c=await _e.organization.acceptInvitation({invitationId:t.id});if(c.error)be.error(c.error.message),n(!1);else{const u=await _e.organization.getFullOrganization({query:{organizationId:t.organizationId}});be.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{be.error("Failed to accept invitation"),n(!1)}},a=async()=>{i(!0);try{const c=await _e.organization.rejectInvitation({invitationId:t.id});c.error?(be.error(c.error.message),i(!1)):(be.success("Invitation declined"),l.invalidateQueries())}catch{be.error("Failed to decline invitation"),i(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:r,disabled:e||o,"aria-label":"Accept invitation",children:s.jsx(Lt,{size:14})}),s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:s.jsx(An,{size:14})})]})]})}function Ro(){const t=S.useContext(Ns),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Eo extends S.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Do(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Lo(){const t=R.c(20),e=Se(),{org:n}=he();let o;t[0]!==n.id||t[1]!==n.slug?(o={connectionId:Ut,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=o):o=t[2];const i=Gt(o);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l={providerId:"deco"},t[3]=l):l=t[3];let r;t[4]!==i?(r={client:i,toolName:"AI_PROVIDER_CREDITS",toolArguments:l,staleTime:6e4,select:Fo},t[4]=i,t[5]=r):r=t[5];const{data:a,isPending:c,isError:u}=zn(r),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const x=m;let f;t[10]!==d?(f=J(d!=null&&Do(d)),t[10]=d,t[11]=f):f=t[11];let p;t[12]!==e||t[13]!==n.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[12]=e,t[13]=n.slug,t[14]=p):p=t[14];let C;t[15]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ys,{size:24}),t[15]=C):C=t[15];let $;return t[16]!==f||t[17]!==p||t[18]!==x?($=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:x,className:f,onClick:p,children:C})})}),t[16]=f,t[17]=p,t[18]=x,t[19]=$):$=t[19],$}function Fo(t){return t.structuredContent}function Uo(){const t=R.c(1);if(!Pn().some(Go))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Lo,{}),t[0]=o):o=t[0],o}function Go(t){return t.providerId==="deco"}function Bo(){const t=R.c(3),[e,n]=S.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(cn,{size:24})})})}),t[0]=o):o=t[0];let i;return t[1]!==e?(i=s.jsxs(s.Fragment,{children:[o,s.jsx(Tn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=i):i=t[2],i}function Ho(){const t=R.c(11),e=Ro();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(at,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e.length?(o=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e.length,t[2]=o):o=t[2];let i;t[3]!==o?(i=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(nt,{asChild:!0,children:s.jsxs(xe,{tooltip:"Inbox",className:"relative",children:[n,o]})})})}),t[3]=o,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[5]=l):l=t[5];let r;t[6]!==e?(r=s.jsxs(ot,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:[l,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(at,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Vo)})]}),t[6]=e,t[7]=r):r=t[7];let a;return t[8]!==i||t[9]!==r?(a=s.jsxs(st,{children:[i,r]}),t[8]=i,t[9]=r,t[10]=a):a=t[10],a}function Vo(t){return s.jsx(To,{invitation:t},t.id)}function Ko(){const t=R.c(6),e=Se(),{org:n}=he();let o;t[0]!==e||t[1]!==n.slug?(o=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=o):o=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ve,{size:24}),t[3]=i):i=t[3];let l;return t[4]!==o?(l=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:"Settings",onClick:o,children:i})})}),t[4]=o,t[5]=l):l=t[5],l}function Wo(){const t=R.c(5);let e,n,o,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Eo,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(Uo,{})})}),n=s.jsx(Bo,{}),o=s.jsx(Ho,{}),i=s.jsx(Ko,{}),t[0]=e,t[1]=n,t[2]=o,t[3]=i):(e=t[0],n=t[1],o=t[2],i=t[3]);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(Pt,{className:"px-2 pb-3 gap-1",children:[e,n,o,i,s.jsx(pe,{children:s.jsx(le,{children:s.jsx(Jt,{})})})]}),t[4]=l):l=t[4],l}function qo(){const t=R.c(10),e=Se(),{org:n}=he(),{setOpenMobile:o}=He();let i;t[0]!==e||t[1]!==n.slug||t[2]!==o?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),o(!1)},t[0]=e,t[1]=n.slug,t[2]=o,t[3]=i):i=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ve,{}),t[4]=l):l=t[4];let r;t[5]!==i?(r=s.jsx(le,{children:s.jsx(xe,{tooltip:"Settings",onClick:i,children:l})}),t[5]=i,t[6]=r):r=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(le,{children:s.jsx(Jt,{})}),t[7]=a):a=t[7];let c;return t[8]!==r?(c=s.jsx(Pt,{children:s.jsxs(pe,{children:[r,a]})}),t[8]=r,t[9]=c):c=t[9],c}var it="ContextMenu",[Qo]=Ps(it,[It]),te=It(),[Yo,Zt]=Qo(it),es=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:o,dir:i,modal:l=!0}=t,[r,a]=S.useState(!1),c=te(e),u=ks(o),d=S.useCallback(m=>{a(m),u(m)},[u]);return s.jsx(Yo,{scope:e,open:r,onOpenChange:d,modal:l,children:s.jsx(ws,{...c,dir:i,open:r,onOpenChange:d,modal:l,children:n})})};es.displayName=it;var ts="ContextMenuTrigger",ss=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:o=!1,...i}=t,l=Zt(ts,n),r=te(n),a=S.useRef({x:0,y:0}),c=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=S.useRef(0),d=S.useCallback(()=>window.clearTimeout(u.current),[]),m=x=>{a.current={x:x.clientX,y:x.clientY},l.onOpenChange(!0)};return S.useEffect(()=>d,[d]),S.useEffect(()=>{o&&d()},[o,d]),s.jsxs(s.Fragment,{children:[s.jsx(Is,{...r,virtualRef:c}),s.jsx(Ms.span,{"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,x=>{d(),m(x),x.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,Fe(x=>{d(),u.current=window.setTimeout(()=>m(x),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,Fe(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,Fe(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,Fe(d))})]})});ss.displayName=ts;var Xo="ContextMenuPortal",ns=t=>{const{__scopeContextMenu:e,...n}=t,o=te(e);return s.jsx(As,{...o,...n})};ns.displayName=Xo;var os="ContextMenuContent",is=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=Zt(os,n),l=te(n),r=S.useRef(!1);return s.jsx($s,{...l,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&r.current&&a.preventDefault(),r.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!i.modal&&(r.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});is.displayName=os;var Jo="ContextMenuGroup",Zo=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ts,{...i,...o,ref:e})});Zo.displayName=Jo;var ei="ContextMenuLabel",ti=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Rs,{...i,...o,ref:e})});ti.displayName=ei;var si="ContextMenuItem",ls=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Os,{...i,...o,ref:e})});ls.displayName=si;var ni="ContextMenuCheckboxItem",oi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Es,{...i,...o,ref:e})});oi.displayName=ni;var ii="ContextMenuRadioGroup",li=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ds,{...i,...o,ref:e})});li.displayName=ii;var ri="ContextMenuRadioItem",ai=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ls,{...i,...o,ref:e})});ai.displayName=ri;var ci="ContextMenuItemIndicator",di=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Fs,{...i,...o,ref:e})});di.displayName=ci;var ui="ContextMenuSeparator",rs=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(zs,{...i,...o,ref:e})});rs.displayName=ui;var mi="ContextMenuArrow",fi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Us,{...i,...o,ref:e})});fi.displayName=mi;var xi="ContextMenuSubTrigger",pi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Gs,{...i,...o,ref:e})});pi.displayName=xi;var hi="ContextMenuSubContent",gi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Bs,{...i,...o,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gi.displayName=hi;function Fe(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var bi=es,ji=ss,vi=ns,_i=is,yi=ls,Si=rs;function Ci(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=s.jsx(bi,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=o):o=e[3],o}function Ni(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=s.jsx(ji,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function ki(t){const e=R.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]!==n?(i=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==i?(l=s.jsx(vi,{children:s.jsx(_i,{"data-slot":"context-menu-content",className:i,...o})}),e[5]=o,e[6]=i,e[7]=l):l=e[7],l}function yt(t){const e=R.c(12);let n,o,i,l;e[0]!==t?({className:n,inset:o,variant:l,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=i,e[4]=l):(n=e[1],o=e[2],i=e[3],l=e[4]);const r=l===void 0?"default":l;let a;e[5]!==n?(a=J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==i||e[9]!==a||e[10]!==r?(c=s.jsx(yi,{"data-slot":"context-menu-item","data-inset":o,"data-variant":r,className:a,...i}),e[7]=o,e[8]=i,e[9]=a,e[10]=r,e[11]=c):c=e[11],c}function wi(t){const e=R.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]!==n?(i=J("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==i?(l=s.jsx(Si,{"data-slot":"context-menu-separator",className:i,...o}),e[5]=o,e[6]=i,e[7]=l):l=e[7],l}function Ii(t){const e=Se(),n=Be(),o=ro(),{locator:i}=he(),l=et({strict:!1}),r=Ct({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===r.virtualmcpid?tn(n,i,l.taskId??""):null;try{await o.create.mutateAsync({id:c,virtual_mcp_id:a,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:a}})}}function Mi({agent:t,org:e,onUnpin:n,isDragging:o}){const i=Se(),{isMobile:l,setOpenMobile:r}=He(),a=Rn(e),u=St({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=S.useState(null),x=S.useRef(null),f=S.useRef(null),p=S.useRef(!1);p.current=!!o,o&&(d||f.current)&&(f.current&&(clearTimeout(f.current),f.current=null),d&&m(null));const C=h=>{if(p.current)return;const y=h.currentTarget.getBoundingClientRect();f.current=setTimeout(()=>{p.current||m(y)},550)},$=h=>{f.current&&(clearTimeout(f.current),f.current=null),!(x.current&&h.relatedTarget instanceof Node&&x.current.contains(h.relatedTarget))&&m(null)},g=d?Math.round(d.height*.9):0,N=d?d.width+g:0;return s.jsx(Ci,{children:s.jsxs(le,{className:J(d&&"z-[55]"),children:[s.jsx(Ni,{asChild:!0,children:s.jsx(xe,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{l&&r(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:C,onMouseLeave:$,children:s.jsx($e,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),s.jsxs(ki,{children:[s.jsxs(yt,{onClick:()=>{const h=crypto.randomUUID();i({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[s.jsx(Ve,{size:14}),"Settings"]}),s.jsx(wi,{}),s.jsxs(yt,{onClick:()=>{n(),u&&i({to:"/$org",params:{org:e}})},className:"",children:[s.jsx(ft,{size:14}),"Unpin"]})]}),d&&Hs.createPortal(s.jsx("button",{ref:x,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),n(),i({to:"/$org",params:{org:e}})},className:J("flex items-center justify-center","bg-sidebar-accent text-muted-foreground","rounded-xl cursor-pointer","animate-in fade-in-0 slide-in-from-right-2","duration-150 [animation-timing-function:cubic-bezier(0.165,0.84,0.44,1)]","hover:text-foreground transition-colors"),style:{position:"fixed",top:d.top,left:d.left,height:d.height,width:N,paddingLeft:d.width,zIndex:50,boxShadow:"inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0 0 0.5px hsla(0, 0%, 0%, 0.12)"},children:s.jsx(ft,{size:14})}),document.body)]})})}function Ai(t){const e=R.c(18);let n;e[0]!==t.agent.id?(n={id:t.agent.id},e[0]=t.agent.id,e[1]=n):n=e[1];const{attributes:o,listeners:i,setNodeRef:l,transform:r,transition:a,isDragging:c}=Yn(n);let u;e[2]!==r?(u=Xn.Transform.toString(r?{...r,x:0}:null),e[2]=r,e[3]=u):u=e[3];const d=c?.5:void 0,m=c?100:void 0;let x;e[4]!==u||e[5]!==d||e[6]!==m||e[7]!==a?(x={transform:u,transition:a,opacity:d,zIndex:m},e[4]=u,e[5]=d,e[6]=m,e[7]=a,e[8]=x):x=e[8];const f=x;let p;e[9]!==c||e[10]!==t?(p=s.jsx(Mi,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let C;return e[12]!==o||e[13]!==i||e[14]!==l||e[15]!==f||e[16]!==p?(C=s.jsx("div",{ref:l,style:f,...o,...i,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=i,e[14]=l,e[15]=f,e[16]=p,e[17]=C):C=e[17],C}function $i(t){const e=R.c(9),{agent:n,onClick:o}=t;let i;e[0]!==n.icon||e[1]!==n.title?(i=s.jsx($e,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==i||e[7]!==l?(r=s.jsxs("button",{type:"button",onClick:o,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[i,l]}),e[5]=o,e[6]=i,e[7]=l,e[8]=r):r=e[8],r}function Oi(t){const e=R.c(80),{onClose:n,onOpenImportDeco:o,onOpenGithubImport:i,onOpenSelfHealing:l,onOpenDiagnosticsModal:r,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,x]=S.useState(""),f=Bt(),{org:p}=he();let C;e[0]!==f?(C=f.filter(Fi).map(Li),e[0]=f,e[1]=C):C=e[1];const $=C,{pin:g,isPinned:N}=Vt(p.id,$);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:y,isCreating:j}=eo(h),[b]=wt(),v=Ii(p.slug),I=Zn();let F,O,z,E,P,k,w,M;if(e[3]!==f||e[4]!==y||e[5]!==j||e[6]!==N||e[7]!==I||e[8]!==v||e[9]!==n||e[10]!==u||e[11]!==d||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==l||e[17]!==c||e[18]!==g||e[19]!==b.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();M=f.filter(Di).filter(T=>!m||T.title.toLowerCase().includes(V));let q;e[29]!==f?(q=f.some(Ei),e[29]=f,e[30]=q):q=e[30];const Q=q;F=ze.filter(T=>(!m||T.title.toLowerCase().includes(V))&&!(T.id==="studio-pack"&&Q)&&!(T.id==="self-healing-storefront"&&!b.experimental_vibecode));let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=ze.find(Ri),e[31]=_):_=e[31];const K=_,W=K?f.find(T=>T.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Ti),e[32]=G):G=e[32];const Y=G,ee=Y?f.find(T=>T.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Pi),e[33]=Z):Z=e[33];const ne=Z,X=ne?f.find(T=>T.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(zi),e[34]=oe):oe=e[34];const re=oe,ye=re?f.find(T=>T.metadata?.type===re.id):void 0;let ae;e[35]!==N||e[36]!==v||e[37]!==n||e[38]!==g?(ae=T=>{N(T.id)||g(T.id),n(),x(""),v(T.id)},e[35]=N,e[36]=v,e[37]=n,e[38]=g,e[39]=ae):ae=e[39];const je=ae,ve=T=>{n(),x(""),T==="self-healing-storefront"?l():T==="site-editor"?o():T==="site-diagnostics"?W?I(W.id):r():T==="lean-canvas"?ee?I(ee.id):a():T==="ai-image"?X?I(X.id):u():T==="ai-research"?ye?I(ye.id):d():T==="studio-pack"?c():v(T)};k="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(w=s.jsx(Jn,{value:m,onChange:x,placeholder:"Search agents..."}),e[40]=m,e[41]=w):w=e[41],O="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[42]=z):z=e[42];let ie;e[43]!==y||e[44]!==n?(ie=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await y(),n()},e[43]=y,e[44]=n,e[45]=ie):ie=e[45];let ce,de;e[46]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ge,{size:16,className:"text-muted-foreground"})}),de=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=ce,e[47]=de):(ce=e[46],de=e[47]);let ue;e[48]!==j||e[49]!==ie?(ue=s.jsxs("button",{type:"button",disabled:j,onClick:ie,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[ce,de]}),e[48]=j,e[49]=ie,e[50]=ue):ue=e[50];let me;e[51]!==n||e[52]!==i||e[53]!==b.experimental_vibecode?(me=b.experimental_vibecode&&s.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),i(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(lo,{className:"size-5 text-muted-foreground"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=n,e[52]=i,e[53]=b.experimental_vibecode,e[54]=me):me=e[54];let fe;e[55]!==je?(fe=T=>s.jsx($i,{agent:T,onClick:()=>je(T)},T.id),e[55]=je,e[56]=fe):fe=e[56],E=s.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[ue,me,M.map(fe)]}),P=F.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-1 pt-4 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),s.jsx("div",{className:"grid grid-cols-3 gap-1",children:F.map(T=>s.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:T.id,template_title:T.title}),ve(T.id)},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx($e,{icon:T.icon,name:T.title,size:"md",className:"transition-transform group-hover:scale-105"}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:T.title})]},T.id))})]}),e[3]=f,e[4]=y,e[5]=j,e[6]=N,e[7]=I,e[8]=v,e[9]=n,e[10]=u,e[11]=d,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=l,e[17]=c,e[18]=g,e[19]=b.experimental_vibecode,e[20]=m,e[21]=F,e[22]=O,e[23]=z,e[24]=E,e[25]=P,e[26]=k,e[27]=w,e[28]=M}else F=e[21],O=e[22],z=e[23],E=e[24],P=e[25],k=e[26],w=e[27],M=e[28];let D;e[57]!==F||e[58]!==j||e[59]!==m||e[60]!==M.length?(D=M.length===0&&F.length===0&&!j&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:m?"No agents found":"No agents yet"}),e[57]=F,e[58]=j,e[59]=m,e[60]=M.length,e[61]=D):D=e[61];let A;e[62]!==O||e[63]!==z||e[64]!==E||e[65]!==P||e[66]!==D?(A=s.jsxs("div",{className:O,children:[z,E,P,D]}),e[62]=O,e[63]=z,e[64]=E,e[65]=P,e[66]=D,e[67]=A):A=e[67];let B;e[68]!==p.slug?(B={org:p.slug},e[68]=p.slug,e[69]=B):B=e[69];let U;e[70]!==n?(U=()=>n(),e[70]=n,e[71]=U):U=e[71];let L;e[72]!==B||e[73]!==U?(L=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Vs,{to:"/$org/settings/agents",params:B,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[72]=B,e[73]=U,e[74]=L):L=e[74];let H;return e[75]!==A||e[76]!==L||e[77]!==k||e[78]!==w?(H=s.jsxs("div",{className:k,children:[w,A,L]}),e[75]=A,e[76]=L,e[77]=k,e[78]=w,e[79]=H):H=e[79],H}function zi(t){return t.id==="ai-research"}function Pi(t){return t.id==="ai-image"}function Ti(t){return t.id==="lean-canvas"}function Ri(t){return t.id==="site-diagnostics"}function Ei(t){return On(t.id)}function Di(t){return!$n(t.id)}function Li(t){return t.id}function Fi(t){return t.pinned}function Ui(){const t=R.c(36),[e,n]=S.useState(!1),[o,i]=S.useState(!1),[l,r]=S.useState(!1),[a,c]=S.useState(!1),[u,d]=S.useState(!1),[m,x]=S.useState(!1),[f,p]=S.useState(!1),[C,$]=S.useState(!1),[g,N]=S.useState(!1),h=Dt(),{setOpenMobile:y}=He();let j;t[0]!==h||t[1]!==y?(j=()=>{n(!1),h&&y(!1)},t[0]=h,t[1]=y,t[2]=j):j=t[2];const b=j;let v;t[3]!==b||t[4]!==e?(v=e&&s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ue,{className:"h-4 w-24"})}),children:s.jsx(Oi,{onClose:b,onOpenImportDeco:()=>i(!0),onOpenGithubImport:()=>{r(!0),b()},onOpenSelfHealing:()=>{c(!0),b()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>x(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>$(!0),onOpenAiResearchModal:()=>N(!0)})}),t[3]=b,t[4]=e,t[5]=v):v=t[5];const I=v;let F;t[6]!==h||t[7]!==e||t[8]!==I?(F=h?s.jsxs(s.Fragment,{children:[s.jsx(le,{children:s.jsx(xe,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},children:s.jsx(Ge,{className:"!opacity-100"})})}),s.jsx(Tt,{open:e,onOpenChange:n,direction:"bottom",children:s.jsxs(Rt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Et,{className:"sr-only",children:"Browse agents"}),I]})})]}):s.jsxs(st,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),n(B)},children:[s.jsx(le,{children:s.jsx(nt,{asChild:!0,children:s.jsx(xe,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:s.jsx(Ge,{className:"!opacity-100"})})})}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:I})]}),t[6]=h,t[7]=e,t[8]=I,t[9]=F):F=t[9];let O;t[10]!==o?(O=s.jsx(to,{open:o,onOpenChange:i}),t[10]=o,t[11]=O):O=t[11];let z;t[12]!==l?(z=s.jsx(so,{open:l,onOpenChange:r}),t[12]=l,t[13]=z):z=t[13];let E;t[14]!==a?(E=s.jsx(En,{open:a,onOpenChange:c}),t[14]=a,t[15]=E):E=t[15];let P;t[16]!==u?(P=s.jsx(no,{open:u,onOpenChange:d}),t[16]=u,t[17]=P):P=t[17];let k;t[18]!==m?(k=s.jsx(oo,{open:m,onOpenChange:x}),t[18]=m,t[19]=k):k=t[19];let w;t[20]!==f?(w=s.jsx(io,{open:f,onOpenChange:p}),t[20]=f,t[21]=w):w=t[21];let M;t[22]!==C?(M=s.jsx(Dn,{open:C,onOpenChange:$}),t[22]=C,t[23]=M):M=t[23];let D;t[24]!==g?(D=s.jsx(Ln,{open:g,onOpenChange:N}),t[24]=g,t[25]=D):D=t[25];let A;return t[26]!==D||t[27]!==F||t[28]!==O||t[29]!==z||t[30]!==E||t[31]!==P||t[32]!==k||t[33]!==w||t[34]!==M?(A=s.jsxs(s.Fragment,{children:[F,O,z,E,P,k,w,M,D]}),t[26]=D,t[27]=F,t[28]=O,t[29]=z,t[30]=E,t[31]=P,t[32]=k,t[33]=w,t[34]=M,t[35]=A):A=t[35],A}function Gi(){const t=R.c(34),e=Bt(),{org:n}=he();let o;t[0]!==e?(o=e.filter(Ki).map(Vi),t[0]=e,t[1]=o):o=t[1];const i=o,{pinnedIds:l,unpin:r,reorder:a}=Vt(n.id,i),c=new Map(e.map(Hi)),u=l.map(A=>c.get(A)).filter(Bi);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:5}},t[2]=d):d=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m={coordinateGetter:qn},t[3]=m):m=t[3];const x=Un(mt(Bn,d),mt(Gn,m));let f;t[4]!==l||t[5]!==a?(f=A=>{const{active:B,over:U}=A;if(!U||B.id===U.id)return;const L=l.indexOf(B.id),H=l.indexOf(U.id);L===-1||H===-1||a(Qn([...l],L,H))},t[4]=l,t[5]=a,t[6]=f):f=t[6];const p=f,C=Pe,$="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const N=Te,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",y=pe,j="gap-2";let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ui,{}),t[8]=b):b=t[8];const v=Kn,I=Wn,F=Hn,O=Vn;let z;t[9]!==n.slug||t[10]!==r?(z=A=>s.jsx(Ai,{agent:A,org:n.slug,onUnpin:()=>r(A.id)},A.id),t[9]=n.slug,t[10]=r,t[11]=z):z=t[11];const E=u.map(z);let P;t[12]!==F||t[13]!==l||t[14]!==O||t[15]!==E?(P=s.jsx(F,{items:l,strategy:O,children:E}),t[12]=F,t[13]=l,t[14]=O,t[15]=E,t[16]=P):P=t[16];let k;t[17]!==v||t[18]!==p||t[19]!==x||t[20]!==P||t[21]!==I?(k=s.jsx(v,{sensors:x,collisionDetection:I,onDragEnd:p,children:P}),t[17]=v,t[18]=p,t[19]=x,t[20]=P,t[21]=I,t[22]=k):k=t[22];let w;t[23]!==y||t[24]!==k||t[25]!==b?(w=s.jsxs(y,{className:j,children:[b,k]}),t[23]=y,t[24]=k,t[25]=b,t[26]=w):w=t[26];let M;t[27]!==N||t[28]!==w?(M=s.jsx(N,{className:h,children:w}),t[27]=N,t[28]=w,t[29]=M):M=t[29];let D;return t[30]!==C||t[31]!==M||t[32]!==g?(D=s.jsxs(C,{className:$,children:[g,M]}),t[30]=C,t[31]=M,t[32]=g,t[33]=D):D=t[33],D}function Bi(t){return!!t}function Hi(t){return[t.id,t]}function Vi(t){return t.id}function Ki(t){return t.pinned}function as(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(S.Suspense,{fallback:s.jsx(Pe,{className:"py-0 px-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-2",children:s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Ue,{className:"h-4 w-4 rounded"}),s.jsx(Ue,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(Gi,{})}),t[0]=e):e=t[0],e}function Xl(){const t=R.c(4),e=Wt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Wo,{}),t[0]=n):n=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(tt,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(as,{})})}),t[1]=o):o=t[1];let i;return t[2]!==e?(i=s.jsx(Yt,{sections:e,footer:n,additionalContent:o}),t[2]=e,t[3]=i):i=t[3],i}function Jl(t){const e=R.c(5),{onClose:n}=t,o=Wt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qo,{}),e[0]=i):i=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(tt,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(as,{})})}),e[1]=l):l=e[1];let r;return e[2]!==n||e[3]!==o?(r=s.jsx(So,{sections:o,onClose:n,footer:i,additionalContent:l}),e[2]=n,e[3]=o,e[4]=r):r=e[4],r}function Wi(){const t=R.c(6),{org:e,locator:n}=he(),o=Be();let i;t[0]!==n||t[1]!==o?(i=()=>{o.invalidateQueries({queryKey:Mt.tasksPrefix(n)})},t[0]=n,t[1]=o,t[2]=i):i=t[2];let l;t[3]!==e.slug||t[4]!==i?(l={orgSlug:e.slug,onTaskStatus:i},t[3]=e.slug,t[4]=i,t[5]=l):l=t[5],uo(l)}function qi(t){const e=R.c(8),{virtualMcpId:n,size:o,showAutomationBadge:i}=t,l=o===void 0?"sm":o;let r;e[0]!==l||e[1]!==n?(r=n?s.jsx(Qi,{virtualMcpId:n,size:l}):s.jsx($e,{icon:null,name:"?",size:l}),e[0]=l,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(fo,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let c;return e[5]!==r||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[r,a]}),e[5]=r,e[6]=a,e[7]=c):c=e[7],c}function Qi(t){const e=R.c(6),{virtualMcpId:n,size:o}=t,i=Ht(n);if(!i){let a;return e[0]!==o?(a=s.jsx($e,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const l=i.icon??null;let r;return e[2]!==i.title||e[3]!==o||e[4]!==l?(r=s.jsx($e,{icon:l,name:i.title,size:o}),e[2]=i.title,e[3]=o,e[4]=l,e[5]=r):r=e[5],r}function Yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function Xi(t){const e=R.c(47),{task:n,isActive:o,onClick:i,onArchive:l,showAutomationBadge:r}=t,a=xo(n.status),c=a.icon,u=Ht(n.virtual_mcp_id);let d;e[0]!==u?(d=Yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,x=S.useRef(null);let f;e[2]!==o?(f=()=>{if(!o)return;const V=x.current;V&&(V.focus({preventScroll:!0}),V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}))},e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o||e[5]!==n.id?(p=[o,n.id],e[4]=o,e[5]=n.id,e[6]=p):p=e[6],S.useEffect(f,p);const C="button",$=0;let g;e[7]!==i?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),i())},e[7]=i,e[8]=g):g=e[8];const N=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==N?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[9]=N,e[10]=h):h=e[10];let y;e[11]!==r||e[12]!==n.virtual_mcp_id?(y=s.jsx(qi,{virtualMcpId:n.virtual_mcp_id,size:"xs",showAutomationBadge:r}),e[11]=r,e[12]=n.virtual_mcp_id,e[13]=y):y=e[13];const j=n.title||"Untitled task";let b;e[14]!==j?(b=s.jsx("div",{className:"text-sm text-foreground truncate",children:j}),e[14]=j,e[15]=b):b=e[15];let v;e[16]!==m||e[17]!==n.branch||e[18]!==n.updated_at?(v=n.updated_at&&s.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[n.branch?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):m?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:nn(new Date(n.updated_at))})]}),e[16]=m,e[17]=n.branch,e[18]=n.updated_at,e[19]=v):v=e[19];let I;e[20]!==b||e[21]!==v?(I=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,v]}),e[20]=b,e[21]=v,e[22]=I):I=e[22];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",O="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",z=a.label,E=14,P=J(a.iconClassName,n.status==="in_progress"&&"animate-spin");let k;e[23]!==c||e[24]!==P?(k=s.jsx(c,{size:E,className:P}),e[23]=c,e[24]=P,e[25]=k):k=e[25];let w;e[26]!==a||e[27]!==k?(w=s.jsx("span",{className:O,"aria-label":z,children:k}),e[26]=a,e[27]=k,e[28]=w):w=e[28];let M;e[29]!==l?(M=V=>{V.stopPropagation(),l()},e[29]=l,e[30]=M):M=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(mo,{size:14}),e[31]=D):D=e[31];let A;e[32]!==M?(A=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:M,className:"[grid-area:slot] invisible group-hover/row:visible flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted",children:D})}),e[32]=M,e[33]=A):A=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Xe,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==A?(U=s.jsxs(Je,{children:[A,B]}),e[35]=A,e[36]=U):U=e[36];let L;e[37]!==w||e[38]!==U?(L=s.jsxs("div",{className:F,children:[w,U]}),e[37]=w,e[38]=U,e[39]=L):L=e[39];let H;return e[40]!==i||e[41]!==I||e[42]!==L||e[43]!==g||e[44]!==h||e[45]!==y?(H=s.jsxs("div",{ref:x,role:C,tabIndex:$,onClick:i,onKeyDown:g,className:h,children:[y,I,L]}),e[40]=i,e[41]=I,e[42]=L,e[43]=g,e[44]=h,e[45]=y,e[46]=H):H=e[46],H}const cs={all:"All tasks",manual:"Chats",automation:"Automation"},ds={all:"All members",mine:"Mine only"};function Ji(t){const e=R.c(59),{title:n,tasks:o,activeTaskId:i,onSelect:l,onArchive:r,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[x,f]=S.useState("all"),[p,C]=S.useState("mine");let $;e[0]!==m||e[1]!==p||e[2]!==o?($=p==="mine"&&m?o.filter(_=>_.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=$):$=e[3];const g=$;let N;e[4]!==x||e[5]!==g?(N=x==="automation"?g.filter(sl):x==="manual"?g.filter(tl):g,e[4]=x,e[5]=g,e[6]=N):N=e[6];const h=N;let y;e[7]!==n?(y=s.jsx("span",{children:n}),e[7]=n,e[8]=y):y=e[8];let j;e[9]!==p?(j=s.jsx(pt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Filter by member",className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:p==="mine"?s.jsx(Js,{size:16}):s.jsx(Ft,{size:16})})}),e[9]=p,e[10]=j):j=e[10];let b;e[11]!==p?(b=_=>{const K=_;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),C(K)},e[11]=p,e[12]=b):b=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=Object.keys(ds),e[13]=v):v=e[13];let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=v.map(el),e[14]=I):I=e[14];let F;e[15]!==p||e[16]!==b?(F=s.jsx(ht,{align:"end",children:s.jsx(gt,{value:p,onValueChange:b,children:I})}),e[15]=p,e[16]=b,e[17]=F):F=e[17];let O;e[18]!==j||e[19]!==F?(O=s.jsxs(bt,{children:[j,F]}),e[18]=j,e[19]=F,e[20]=O):O=e[20];const z=x!=="all"&&"text-purple-500";let E;e[21]!==z?(E=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",z),e[21]=z,e[22]=E):E=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(rn,{size:16}),e[23]=P):P=e[23];let k;e[24]!==E?(k=s.jsx(pt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Filter tasks",className:E,children:P})}),e[24]=E,e[25]=k):k=e[25];let w;e[26]!==x?(w=_=>{const K=_;K!==x&&se("tasks_panel_filter_changed",{to_value:K}),f(K)},e[26]=x,e[27]=w):w=e[27];let M;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=Object.keys(cs),e[28]=M):M=e[28];let D;e[29]===Symbol.for("react.memo_cache_sentinel")?(D=M.map(Zi),e[29]=D):D=e[29];let A;e[30]!==x||e[31]!==w?(A=s.jsx(ht,{align:"end",children:s.jsx(gt,{value:x,onValueChange:w,children:D})}),e[30]=x,e[31]=w,e[32]=A):A=e[32];let B;e[33]!==k||e[34]!==A?(B=s.jsxs(bt,{children:[k,A]}),e[33]=k,e[34]=A,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==n?(U=c&&a&&s.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${n.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:s.jsx(Xs,{size:16})}),e[36]=a,e[37]=c,e[38]=n,e[39]=U):U=e[39];let L;e[40]!==B||e[41]!==U||e[42]!==O?(L=s.jsxs("div",{className:"flex items-center gap-0.5",children:[O,B,U]}),e[40]=B,e[41]=U,e[42]=O,e[43]=L):L=e[43];let H;e[44]!==L||e[45]!==y?(H=s.jsxs("div",{className:"shrink-0 pl-2 pr-1.5 h-7 flex items-center justify-between text-xs font-medium text-muted-foreground mb-1",children:[y,L]}),e[44]=L,e[45]=y,e[46]=H):H=e[46];let V;e[47]!==i||e[48]!==d||e[49]!==r||e[50]!==l||e[51]!==u||e[52]!==h?(V=h.length===0&&d?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(_=>s.jsx(Xi,{task:_,isActive:i===_.id,onClick:()=>{i!==_.id&&se("tasks_panel_task_clicked",{thread_id:_.id,virtual_mcp_id:_.virtual_mcp_id??null,from_automation:!!_.fromAutomation}),l(_)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:_.id,virtual_mcp_id:_.virtual_mcp_id??null}),r(_)},showAutomationBadge:u||_.fromAutomation},_.id)),e[47]=i,e[48]=d,e[49]=r,e[50]=l,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5",children:V}),e[54]=V,e[55]=q):q=e[55];let Q;return e[56]!==H||e[57]!==q?(Q=s.jsxs("div",{className:"flex flex-col h-full min-h-0 mt-1",children:[H,q]}),e[56]=H,e[57]=q,e[58]=Q):Q=e[58],Q}function Zi(t){return s.jsx(Kt,{value:t,children:cs[t]},t)}function el(t){return s.jsx(Kt,{value:t,children:ds[t]},t)}function tl(t){return!t.fromAutomation}function sl(t){return t.fromAutomation}function nl(){const t=R.c(23);Wi();const{data:e}=_e.useSession(),n=e?.user?.id;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={owner:"me",status:"open",hasTrigger:!1},t[0]=o):o=t[0];const{tasks:i}=xt(o);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open",hasTrigger:!0},t[1]=l):l=t[1];const{tasks:r}=xt(l),{setTaskId:a,createNewTask:c}=At();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=et(u),{locator:m,org:x}=he(),f=Be();let p;t[3]!==x.id||t[4]!==x.slug?(p={connectionId:Ut,orgId:x.id,orgSlug:x.slug},t[3]=x.id,t[4]=x.slug,t[5]=p):p=t[5];const C=Gt(p),$=d.taskId??null;let g;t[6]!==r||t[7]!==i?(g=[...i,...r.map(il)].sort(ol),t[6]=r,t[7]=i,t[8]=g):g=t[8];const N=g;let h;t[9]!==C||t[10]!==m||t[11]!==f?(h=async v=>{try{await co(C,v.id,{hidden:!0}),f.invalidateQueries({queryKey:Mt.tasksPrefix(m)})}catch(I){const O=I;be.error(`Failed to archive task: ${O.message}`)}},t[9]=C,t[10]=m,t[11]=f,t[12]=h):h=t[12];const y=h;if(N.length===0){let v;return t[13]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"h-full flex items-center justify-center p-4",children:s.jsx(ao,{image:s.jsx(Zs,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[13]=v):v=t[13],v}let j;t[14]!==a?(j=v=>a(v.id,v.virtual_mcp_id),t[14]=a,t[15]=j):j=t[15];let b;return t[16]!==$||t[17]!==N||t[18]!==c||t[19]!==n||t[20]!==y||t[21]!==j?(b=s.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:s.jsx(Ji,{title:"Tasks",tasks:N,activeTaskId:$,onSelect:j,onArchive:y,onNew:c,showNewButton:!0,currentUserId:n})}),t[16]=$,t[17]=N,t[18]=c,t[19]=n,t[20]=y,t[21]=j,t[22]=b):b=t[22],b}function ol(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function il(t){return{...t,fromAutomation:!0}}function ll(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(rl)}),t[0]=e):e=t[0],e}function rl(t,e){return s.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Zl(){const t=R.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fn.Skeleton,{}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(tt,{fallback:e,children:s.jsx(S.Suspense,{fallback:s.jsx(ll,{}),children:s.jsx(nl,{})})}),t[1]=n):n=t[1],n}export{Xl as S,Zl as T,Jl as a,Yi as g};
|