decocms 2.294.0 → 2.294.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BefAeM6u.js → AlertCircle-CQWovvD2.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-ctHZC7IK.js → ArrowNarrowLeft-CqWU9oxx.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Dw5rxpDu.js → ArrowUpRight-DvqijCIt.js} +1 -1
- package/dist/client/assets/{CheckCircle-3lbo4DOp.js → CheckCircle-RomNW015.js} +1 -1
- package/dist/client/assets/{ChevronDown-BMsVDJMd.js → ChevronDown-9Jxith6v.js} +1 -1
- package/dist/client/assets/{ChevronRight-DNaFnNR_.js → ChevronRight-Dtz86WKJ.js} +1 -1
- package/dist/client/assets/{ChevronUp-Ba2YtjVA.js → ChevronUp-CaQ8hxxg.js} +1 -1
- package/dist/client/assets/{Container-BbxUmzld.js → Container-C5OROtJe.js} +1 -1
- package/dist/client/assets/{DotsVertical-q5wudUQb.js → DotsVertical-BgPLp_Gk.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B-rWZEWZ.js → LinkExternal01-CYMJiIFP.js} +1 -1
- package/dist/client/assets/{Lock01-Bdpg3Hx_.js → Lock01-DnPqyt7e.js} +1 -1
- package/dist/client/assets/{Palette-CSbP1WU6.js → Palette-CWoH1X_q.js} +1 -1
- package/dist/client/assets/{Play-BwE8tx_2.js → Play-DqvL3G5s.js} +1 -1
- package/dist/client/assets/{Plus-B1zoIOQx.js → Plus-Ddba0lt_.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DhQjzDQL.js → RefreshCcw01-DMai8dtt.js} +1 -1
- package/dist/client/assets/{SearchMd-tlcXyQa_.js → SearchMd-Wd5u0rRU.js} +1 -1
- package/dist/client/assets/{Settings02-NVTdZYn8.js → Settings02-BIbJ38lS.js} +1 -1
- package/dist/client/assets/{Shield01-Cczh_kLJ.js → Shield01-CiT3cZOy.js} +1 -1
- package/dist/client/assets/{Star01-Cl5wO8v8.js → Star01-B-4f8EI8.js} +1 -1
- package/dist/client/assets/{Sun-MpjnKSLA.js → Sun-_Pck-FJM.js} +1 -1
- package/dist/client/assets/{Tool01-CWU0CUYW.js → Tool01-BfFn2Oyx.js} +1 -1
- package/dist/client/assets/{Trash01-CGGNK3g-.js → Trash01-Dgd5Vw7S.js} +1 -1
- package/dist/client/assets/{User01-BwcffllD.js → User01-oXiwFzHp.js} +1 -1
- package/dist/client/assets/{Users03-BNN6AS-n.js → Users03-BM4OMOrZ.js} +1 -1
- package/dist/client/assets/{X-XvFOaH_0.js → X-CRK0a94F.js} +1 -1
- package/dist/client/assets/{XCircle-CBqb98Hh.js → XCircle-Cb6HyAsm.js} +1 -1
- package/dist/client/assets/{XClose-CeINnhme.js → XClose-gZr4qGf9.js} +1 -1
- package/dist/client/assets/{Zap-CDrmsf2C.js → Zap-DLJMG7tg.js} +1 -1
- package/dist/client/assets/{ZapSquare-Ri9lH1zf.js → ZapSquare-BblOxMfA.js} +1 -1
- package/dist/client/assets/{accordion-Bgtbenzk.js → accordion-DxXcr0LG.js} +1 -1
- package/dist/client/assets/{agent-icon-DdfLWWFz.js → agent-icon-yYRj-0lJ.js} +1 -1
- package/dist/client/assets/{agents-list-D5T_UiBJ.js → agents-list-FSl3TY72.js} +1 -1
- package/dist/client/assets/ai-providers-eMV2jJWz.js +1 -0
- package/dist/client/assets/{alert-dialog-BY7wdwxM.js → alert-dialog-4PMn5MEd.js} +1 -1
- package/dist/client/assets/{auth-catchall-BH50jO75.js → auth-catchall-BAX9ql07.js} +1 -1
- package/dist/client/assets/{automation-list-row-oLTHyBn9.js → automation-list-row-D0jJ-VOB.js} +1 -1
- package/dist/client/assets/{automations-C9eitePX.js → automations-BL3H9zCv.js} +1 -1
- package/dist/client/assets/{avatar-DRNf61dD.js → avatar-BBsS3gKf.js} +1 -1
- package/dist/client/assets/{badge-BJnKVqQg.js → badge-EwYkSrNU.js} +1 -1
- package/dist/client/assets/{brand-context-C2A7oRcl.js → brand-context-BSR4Xu33.js} +1 -1
- package/dist/client/assets/{card-Dp6Lilh-.js → card-Da8kkDcf.js} +1 -1
- package/dist/client/assets/{chat-context-JfnWgmWL.js → chat-context-Day9b1dU.js} +1 -1
- package/dist/client/assets/{checkbox-CouoIES-.js → checkbox-BTjBq0PR.js} +1 -1
- package/dist/client/assets/{collection-detail-C5Yymb--.js → collection-detail-1Ybv52WN.js} +1 -1
- package/dist/client/assets/{collection-display-button-wfEJKL5y.js → collection-display-button-BIbnppbU.js} +1 -1
- package/dist/client/assets/{collection-search-x3WxKP2U.js → collection-search-50UpqUDY.js} +1 -1
- package/dist/client/assets/{collection-search-3JVNad_3.js → collection-search-DiGSdKFX.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DEzISF1y.js → collection-table-wrapper-K7myIred.js} +1 -1
- package/dist/client/assets/{collection-tabs-CavPMc70.js → collection-tabs-Dg60mpZc.js} +1 -1
- package/dist/client/assets/{collections-BcyYFQx1.js → collections-D3uyismv.js} +1 -1
- package/dist/client/assets/{command-_hKyE0nf.js → command-CpdycvMY.js} +1 -1
- package/dist/client/assets/{connection-card-P5qNgs6D.js → connection-card-CjJMOpOi.js} +1 -1
- package/dist/client/assets/connection-detail-DxSavRey.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DjWTdW-u.js → connection-form-helpers-DG70qtHe.js} +1 -1
- package/dist/client/assets/{connections-BzamEAWo.js → connections-DSGczNjm.js} +1 -1
- package/dist/client/assets/{constants-DZTSQSyU.js → constants-CHMUOnBA.js} +1 -1
- package/dist/client/assets/{constants-DWChG_gh.js → constants-DoKzupGF.js} +1 -1
- package/dist/client/assets/{dialog-U3vhhaTY.js → dialog-CLKO8eiC.js} +1 -1
- package/dist/client/assets/{domain-settings-Df_AVfSP.js → domain-settings-nusKZpFJ.js} +1 -1
- package/dist/client/assets/{drawer-CHErHUts.js → drawer-0laKdMkc.js} +1 -1
- package/dist/client/assets/{dropdown-menu-LTGIQdd2.js → dropdown-menu-C6nHRZ2x.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DQr-qgoI.js → dynamic-plugin-layout-CSPf8__W.js} +1 -1
- package/dist/client/assets/{empty-state-BsHUWcel.js → empty-state-BzDFSsXq.js} +1 -1
- package/dist/client/assets/{empty-state-BFgJp7mt.js → empty-state-vECJlBES.js} +1 -1
- package/dist/client/assets/{extract-connection-data-oVTIsFY5.js → extract-connection-data-BQaFyw9j.js} +1 -1
- package/dist/client/assets/{features--2Py51uQ.js → features-CSTJcrQu.js} +1 -1
- package/dist/client/assets/{form-D9KcIdYm.js → form-4fwiytJp.js} +1 -1
- package/dist/client/assets/general-W97mtxcC.js +1 -0
- package/dist/client/assets/{index-DDe7jF1Q.js → index-0IF7sjd1.js} +1 -1
- package/dist/client/assets/index-2lpt-nMb.js +1 -0
- package/dist/client/assets/{index-BVI1Podc.js → index-B5kxSh6_.js} +1 -1
- package/dist/client/assets/{index-BC2QV0vV.js → index-BVABOQyU.js} +3 -3
- package/dist/client/assets/{index-BY4tnJ8n.js → index-BayHbTyS.js} +1 -1
- package/dist/client/assets/{index-BKYuq1nk.js → index-BdDZPhkl.js} +1 -1
- package/dist/client/assets/{index-Ck21eYLb.js → index-BjVS_mPm.js} +1 -1
- package/dist/client/assets/{index-Bn0n2Tn5.js → index-ChG_GYbX.js} +2 -2
- package/dist/client/assets/{index-XYnQWjlr.js → index-DCNPBqJL.js} +2 -2
- package/dist/client/assets/{index-DlTZXAh7.js → index-DNkdomFO.js} +1 -1
- package/dist/client/assets/{index-BjIWAww2.js → index-DnI3Jcb3.js} +1 -1
- package/dist/client/assets/{index-DSeLALm0.js → index-Dw08Q_qj.js} +1 -1
- package/dist/client/assets/index-VzlCgk2d.js +1 -0
- package/dist/client/assets/{index-DAG4cu8y.js → index-_zHnBa5f.js} +1 -1
- package/dist/client/assets/{index-BMWhZkJH.js → index-lXmRmMe3.js} +1 -1
- package/dist/client/assets/{index-CRq27LIF.js → index-rCj8jF9g.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BuP6-BnP.js → infiniteQueryObserver-BkQFPIb1.js} +1 -1
- package/dist/client/assets/{input-C0cHvFsP.js → input-cSChLxlO.js} +1 -1
- package/dist/client/assets/{integration-icon-Db7fTukH.js → integration-icon-BeqPJGem.js} +1 -1
- package/dist/client/assets/{label-C-b-mt3k.js → label-qFek-Hzr.js} +1 -1
- package/dist/client/assets/{layout-DVOt2okr.js → layout-DyNIFXA1.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-Bu0aNy4u.js → lean-canvas-recruit-modal-CmsrBNbt.js} +1 -1
- package/dist/client/assets/{login-gnnJy4hU.js → login-fxkA0YmB.js} +1 -1
- package/dist/client/assets/members-CezvkHQT.js +3 -0
- package/dist/client/assets/{monaco-editor-DxUxs9LV.js → monaco-editor-BY9ngL3n.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CeOh5u1r.js → monitoring-stats-row-C87wH1cE.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cj2vHTqt.js → oauth-callback-CkAo5fto.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C82hMcEJ.js → oauth-callback-ai-provider-CVNg6NIE.js} +1 -1
- package/dist/client/assets/{onboarding-B4IxAukM.js → onboarding-DGklDi6-.js} +1 -1
- package/dist/client/assets/{org-layout-3WdeVqpU.js → org-layout-JfVHDBF4.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-mdTwEf0P.js → org-plugin-layout-nchD6z6X.js} +1 -1
- package/dist/client/assets/{pair-Bcvdi-3H.js → pair-7_poUBO_.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CDuOKPoQ.js → plugin-empty-state-BoHwceCP.js} +1 -1
- package/dist/client/assets/{plugin-header-Bl_jJCpR.js → plugin-header-B7x435yF.js} +1 -1
- package/dist/client/assets/{plugin-layout-BaKtqBSh.js → plugin-layout-lMPEsmyE.js} +1 -1
- package/dist/client/assets/{popover-9zp4cKfF.js → popover-CXTQ1pZp.js} +1 -1
- package/dist/client/assets/{profile-Byy_H5s-.js → profile-B7Sm0x87.js} +1 -1
- package/dist/client/assets/{project-app-view-D8t5BK_c.js → project-app-view-CCFwwwFL.js} +1 -1
- package/dist/client/assets/registry-CGoPlkDA.js +2 -0
- package/dist/client/assets/{registry-layout-BR-KKTEl.js → registry-layout-C90BJ6Rq.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DPKy79PP.js → required-auth-layout-HSIIJt__.js} +1 -1
- package/dist/client/assets/{reset-password-DfZzTSNp.js → reset-password-C4MrTg2U.js} +1 -1
- package/dist/client/assets/roles-Cxh0Bdz-.js +1 -0
- package/dist/client/assets/{scroll-area-CTWKzmcY.js → scroll-area-DBp5wOIC.js} +1 -1
- package/dist/client/assets/{search-input-Bkbw9XvQ.js → search-input-ZAyrquFx.js} +1 -1
- package/dist/client/assets/{select-rt68l1g_.js → select-CeexIfr3.js} +1 -1
- package/dist/client/assets/{select-model-CQYug9E9.js → select-model-DTMG5QxV.js} +1 -1
- package/dist/client/assets/{settings-layout-BTinptVV.js → settings-layout-vPJQ-S1Z.js} +1 -1
- package/dist/client/assets/{settings-section-BIiOcEee.js → settings-section-BnMkp9Ky.js} +1 -1
- package/dist/client/assets/{shell-layout-ti4P0o8w.js → shell-layout-u2G0LiBx.js} +1 -1
- package/dist/client/assets/{skeleton-DQqcYIUR.js → skeleton-C5xkidPH.js} +1 -1
- package/dist/client/assets/{sso-DtEJ6K21.js → sso--dNq6AVx.js} +1 -1
- package/dist/client/assets/{store-BlkOQMDv.js → store-X7XjGNJQ.js} +1 -1
- package/dist/client/assets/store-registry-Chj3l7GJ.js +2 -0
- package/dist/client/assets/{switch-Dd-fbXw9.js → switch-CO8ELkEz.js} +1 -1
- package/dist/client/assets/{table-UGp85pBs.js → table-BFGAzwxV.js} +1 -1
- package/dist/client/assets/{tabs-Bajmp5LL.js → tabs-DKutPh-7.js} +1 -1
- package/dist/client/assets/{task-status-D2ZncahY.js → task-status-B_agjVRL.js} +1 -1
- package/dist/client/assets/{textarea-Ds8u2czk.js → textarea-DsA14nCU.js} +1 -1
- package/dist/client/assets/{toggle-group-CrNuUyQT.js → toggle-group-C1gRrQ9h.js} +1 -1
- package/dist/client/assets/{tools-list-C9sZCS-d.js → tools-list-BFfWcpMA.js} +1 -1
- package/dist/client/assets/{tooltip-CkzGOY_H.js → tooltip-D6U_mOrV.js} +1 -1
- package/dist/client/assets/{types-BQS1EcA_.js → types-CdaeT_-k.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D8PM532H.js → use-ai-providers-CLMcGum-.js} +1 -1
- package/dist/client/assets/{use-collections-s48OQ83y.js → use-collections-B3Xa3dKk.js} +1 -1
- package/dist/client/assets/{use-connection-Q2SEpogi.js → use-connection-UQYyaO6_.js} +1 -1
- package/dist/client/assets/{use-copy-CBB3IfKo.js → use-copy-DnJa5Wna.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C25QZ7ga.js → use-create-virtual-mcp-JDziG09i.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-2jo7Z1ub.js → use-decopilot-events-BEXgeJT0.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Cerb12qV.js → use-delete-connection-HjSBghMT.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DhiqUieY.js → use-infinite-scroll-pE0yY5YF.js} +1 -1
- package/dist/client/assets/{use-list-state-BLzfpMTR.js → use-list-state-qucbexq7.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CODd7jbk.js → use-mcp-tools-10Xveav6.js} +1 -1
- package/dist/client/assets/use-members-DYi4jSpk.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-BIpRywxJ.js → use-navigate-to-agent-DjzouovW.js} +1 -1
- package/dist/client/assets/use-org-auth-client-C5VSPyTf.js +1 -0
- package/dist/client/assets/{use-org-sso-B_zJ7IWb.js → use-org-sso-B4kcBKk_.js} +1 -1
- package/dist/client/assets/use-organization-roles-CqY2IBkE.js +1 -0
- package/dist/client/assets/{use-organization-settings-69gOseUx.js → use-organization-settings-DL07J8Vx.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C4iFJ600.js → use-registry-connections-HO8ZDwQn.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BJSeHGsn.js → use-status-sounds-Dzd2wfFW.js} +1 -1
- package/dist/client/assets/{use-tasks-Q8L8ocme.js → use-tasks-DMNq5MhB.js} +1 -1
- package/dist/client/assets/{use-view-mode-lvgEn118.js → use-view-mode-BjcxKjKE.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BYV6DlKB.js → use-virtual-mcp-DZEy75YH.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Co9WNPPX.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BbwxgHZr.js +1 -0
- package/dist/client/assets/{user-B6WmZaTV.js → user-BlRUTTNb.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DVYpzTeC.js → view-mode-toggle-RGExIMou.js} +1 -1
- package/dist/client/assets/{workflow-CJZscJ90.js → workflow-C1SElIVm.js} +1 -1
- package/dist/client/assets/workflow-detail-BR_Ju77C.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- 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/strip-ansi/index.d.ts +15 -0
- package/dist/server/node_modules/strip-ansi/index.js +19 -0
- package/dist/server/node_modules/{mimic-fn → strip-ansi}/license +1 -1
- package/dist/server/node_modules/{ansi-styles → strip-ansi}/package.json +17 -12
- package/dist/server/node_modules/strip-ansi/readme.md +37 -0
- package/dist/server/server.js +249 -249
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-Cyq2bO_1.js +0 -1
- package/dist/client/assets/connection-detail-C7YX5R9g.js +0 -1
- package/dist/client/assets/general-B3-bdB-A.js +0 -1
- package/dist/client/assets/index-CT5IWILX.js +0 -1
- package/dist/client/assets/index-DLLxA9VA.js +0 -1
- package/dist/client/assets/members-DvR6XPbA.js +0 -3
- package/dist/client/assets/registry-twLci_qW.js +0 -2
- package/dist/client/assets/roles-BX09eeZ2.js +0 -1
- package/dist/client/assets/store-registry-CfXgf26T.js +0 -2
- package/dist/client/assets/use-members-CYdKPSkq.js +0 -1
- package/dist/client/assets/use-organization-roles-9gBEeLeI.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BkNuxXHJ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CMhS0p47.js +0 -1
- package/dist/client/assets/workflow-detail-DyTvPAnr.js +0 -1
- 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/readme.md +0 -173
- 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/package.json +0 -42
- package/dist/server/node_modules/mimic-fn/readme.md +0 -69
- 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/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/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-styles → get-east-asian-width}/license +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as t,j as i}from"./index-Bn0n2Tn5.js";import{O as m}from"./select-model-CQYug9E9.js";import"./checkbox-CouoIES-.js";import"./ChevronDown-BMsVDJMd.js";import"./input-C0cHvFsP.js";import"./dialog-U3vhhaTY.js";import"./X-XvFOaH_0.js";import"./drawer-CHErHUts.js";import"./tooltip-CkzGOY_H.js";import"./select-rt68l1g_.js";import"./ChevronUp-Ba2YtjVA.js";import"./skeleton-DQqcYIUR.js";import"./Tool01-CWU0CUYW.js";import"./RefreshCcw01-DhQjzDQL.js";import"./SearchMd-tlcXyQa_.js";import"./Settings02-NVTdZYn8.js";import"./use-ai-providers-D8PM532H.js";import"./constants-DWChG_gh.js";import"./chat-context-JfnWgmWL.js";import"./use-virtual-mcp-BYV6DlKB.js";import"./use-collections-s48OQ83y.js";import"./use-decopilot-events-2jo7Z1ub.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-Q8L8ocme.js";import"./use-organization-settings-69gOseUx.js";import"./ai-providers-logos-D6a8kmGH.js";import"./Zap-CDrmsf2C.js";import"./AlertCircle-BefAeM6u.js";import"./CheckCircle-3lbo4DOp.js";import"./Trash01-CGGNK3g-.js";import"./index-BY4tnJ8n.js";import"./settings-section-BIiOcEee.js";import"./card-Dp6Lilh-.js";import"./ArrowUpRight-Dw5rxpDu.js";import"./switch-Dd-fbXw9.js";import"./toggle-group-CrNuUyQT.js";import"./avatar-DRNf61dD.js";import"./User01-BwcffllD.js";import"./alert-dialog-BY7wdwxM.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./unwrap-tool-result-BYXdCQMg.js";function T(){const o=t.c(1);let r;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(m,{}),o[0]=r):r=o[0],r}export{T as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as he,aI as Te,aJ as Ie,J as le,aK as Ae,e as $,j as t,l as ge,B,r as X,c as je,s as te,w as De,K as oe,f as Q,aL as ce,u as $e,aM as Pe,E as Oe,g as Me,o as ze,z as Ve,C as Ee,G as Ue,aN as Fe,x as q,F as Le}from"./index-Bn0n2Tn5.js";import{g as Re}from"./constants-DZTSQSyU.js";import{E as ve}from"./empty-state-BFgJp7mt.js";import{E as He,c as Be,r as Ge,b as We,d as Xe}from"./connection-form-helpers-DjWTdW-u.js";import{c as Ke,S as qe}from"./index-BVI1Podc.js";import{u as be,T as Qe}from"./tools-list-C9sZCS-d.js";import{u as Je}from"./use-members-CYdKPSkq.js";import{A as Ye}from"./avatar-DRNf61dD.js";import{a as Ne,b as ye,u as Ze}from"./use-connection-Q2SEpogi.js";import{u as ie,S as et}from"./constants-DWChG_gh.js";import{b as tt}from"./use-mcp-tools-CODd7jbk.js";import{g as ae,M as st,a as nt}from"./types-BQS1EcA_.js";import{T as Y,b as ot,c as Z,a as it,d as at}from"./tabs-Bajmp5LL.js";import{I as se}from"./integration-icon-Db7fTukH.js";import{s as rt}from"./Plus-B1zoIOQx.js";import{a as _e}from"./Settings02-NVTdZYn8.js";import{s as re}from"./Trash01-CGGNK3g-.js";import{e as lt,d as ct,r as dt,c as mt,s as ut}from"./index-BY4tnJ8n.js";import{F as U,b as F,c as R,d as V,f as H,e as xt,a as pt}from"./form-D9KcIdYm.js";import{I as W}from"./input-C0cHvFsP.js";import{u as ft,D as ht}from"./use-delete-connection-Cerb12qV.js";import{V as gt}from"./layout-DVOt2okr.js";import{c as jt,C as vt,B as bt,a as Nt,b as yt,d as _t,e as Ct}from"./monitoring-stats-row-CeOh5u1r.js";import{b as St}from"./use-virtual-mcp-BYV6DlKB.js";import{i as Ce}from"./ChevronRight-DNaFnNR_.js";import{a as Se}from"./Users03-BNN6AS-n.js";import{g as we}from"./connection-slug-eyAPH6o3.js";import{c as wt}from"./ZapSquare-Ri9lH1zf.js";import{T as kt,a as Tt}from"./agent-icon-DdfLWWFz.js";import{b as It}from"./Tool01-CWU0CUYW.js";import{C as At}from"./collection-search-3JVNad_3.js";import{C as Dt}from"./card-Dp6Lilh-.js";import{B as $t}from"./badge-BJnKVqQg.js";import{D as Pt,a as Ot,b as Mt,c as de}from"./dropdown-menu-LTGIQdd2.js";import{S as me,a as ue,b as xe,c as pe,d as E}from"./select-rt68l1g_.js";import{i as zt}from"./CheckCircle-3lbo4DOp.js";import{t as Vt}from"./ChevronDown-BMsVDJMd.js";import{n as Et}from"./Container-BbxUmzld.js";import{s as ee}from"./Star01-Cl5wO8v8.js";import{a as Ut}from"./RefreshCcw01-DhQjzDQL.js";import{s as Ft}from"./XClose-CeINnhme.js";import"./collections-BcyYFQx1.js";import"./SearchMd-tlcXyQa_.js";import"./index-CRq27LIF.js";import"./index-DDe7jF1Q.js";import"./extract-connection-data-oVTIsFY5.js";import"./use-registry-connections-C4iFJ600.js";import"./use-organization-settings-69gOseUx.js";import"./index-BMWhZkJH.js";import"./popover-9zp4cKfF.js";import"./tooltip-CkzGOY_H.js";import"./use-create-virtual-mcp-C25QZ7ga.js";import"./use-navigate-to-agent-BIpRywxJ.js";import"./User01-BwcffllD.js";import"./use-collections-s48OQ83y.js";import"./X-XvFOaH_0.js";import"./label-C-b-mt3k.js";import"./alert-dialog-BY7wdwxM.js";import"./AlertCircle-BefAeM6u.js";import"./ArrowNarrowLeft-ctHZC7IK.js";import"./XCircle-CBqb98Hh.js";import"./ArrowUpRight-Dw5rxpDu.js";import"./ChevronUp-Ba2YtjVA.js";import"./DotsVertical-q5wudUQb.js";import"./Palette-CSbP1WU6.js";import"./LinkExternal01-B-rWZEWZ.js";import"./Lock01-Bdpg3Hx_.js";import"./Sun-MpjnKSLA.js";import"./Play-BwE8tx_2.js";import"./Shield01-Cczh_kLJ.js";import"./Zap-CDrmsf2C.js";const Lt=he({scopes:Ae(le()).describe("List of scopes available"),stateSchema:Te(le(),Ie()).describe("JSON Schema (draft-07) defining the state structure")}),Rt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Lt}];function Ht(s){const e=$.c(39),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const d=be(c),l=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,u=l?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let a;e[4]!==n.icon||e[5]!==n.title?(a=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a):a=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let h;e[9]!==l?(h=l&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=l,e[10]=h):h=e[10];let b;e[11]!==f||e[12]!==h?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,h]}),e[11]=f,e[12]=h,e[13]=b):b=e[13];let j;e[14]!==n||e[15]!==l||e[16]!==r?(j=l&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[14]=n,e[15]=l,e[16]=r,e[17]=j):j=e[17];let v;e[18]!==n||e[19]!==i?(v=()=>i(n),e[18]=n,e[19]=i,e[20]=v):v=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(_e,{size:13}),e[21]=S):S=e[21];let I;e[22]!==v?(I=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:v,title:"Configure",children:S}),e[22]=v,e[23]=I):I=e[23];let N;e[24]!==n||e[25]!==o?(N=()=>o(n),e[24]=n,e[25]=o,e[26]=N):N=e[26];let w;e[27]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(re,{size:13}),e[27]=w):w=e[27];let k;e[28]!==N?(k=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:N,title:"Delete",children:w}),e[28]=N,e[29]=k):k=e[29];let _;e[30]!==I||e[31]!==k||e[32]!==j?(_=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,I,k]}),e[30]=I,e[31]=k,e[32]=j,e[33]=_):_=e[33];let T;return e[34]!==_||e[35]!==p||e[36]!==a||e[37]!==b?(T=t.jsxs("div",{className:p,children:[a,b,_]}),e[34]=_,e[35]=p,e[36]=a,e[37]=b,e[38]=T):T=e[38],T}function Bt(s){const e=$.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let c;e[5]!==n||e[6]!==i?(c=()=>i(n),e[5]=n,e[6]=i,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:13}),e[8]=d):d=e[8];let m;e[9]!==c?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:c,title:"Configure",children:d})}),e[9]=c,e[10]=m):m=e[10];let l;return e[11]!==r||e[12]!==o||e[13]!==m?(l=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,m]}),e[11]=r,e[12]=o,e[13]=m,e[14]=l):l=e[14],l}function Gt(s){const e=$.c(25),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onAdd:c,isAdding:d}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let l;e[0]!==m?(l=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=l):l=e[1];let u;e[2]!==d?(u=d?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=d,e[3]=u):u=e[3];let p;e[4]!==d||e[5]!==c||e[6]!==u?(p=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:d,children:[u,"Add instance"]}),e[4]=d,e[5]=c,e[6]=u,e[7]=p):p=e[7];let a;e[8]!==l||e[9]!==p?(a=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[l,p]}),e[8]=l,e[9]=p,e[10]=a):a=e[10];let f;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o){let j;e[16]!==r||e[17]!==i||e[18]!==o?(j=v=>t.jsx(X.Suspense,{fallback:t.jsx(Bt,{instance:v,onConfigure:i}),children:t.jsx(Ht,{instance:v,onConfigure:i,onAuthenticate:r,onDelete:o})},v.id),e[16]=r,e[17]=i,e[18]=o,e[19]=j):j=e[19],f=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let h;e[20]!==f?(h=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=h):h=e[21];let b;return e[22]!==a||e[23]!==h?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,h]}),e[22]=a,e[23]=h,e[24]=b):b=e[24],b}const Wt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Xt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function qt(s){const e=$.c(3),{connectionId:n,orgId:i,timeframe:r}=s;let o;e[0]!==i?(o={connectionId:et,orgId:i},e[0]=i,e[1]=o):o=e[1];const c=ie(o),d=Xt(r),{data:m}=De({queryKey:oe.connectionActivity(n,r,i),queryFn:async()=>{const f=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:d.startDate.toISOString(),endDate:d.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return f.structuredContent??f},staleTime:3e5}),l=jt(m?.logs??[],d),u=l.data,p=l.totalCalls>0;let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=a):a=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),a]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(vt,{config:Kt,className:"h-16 w-full",children:t.jsxs(bt,{data:u,barCategoryGap:"4%",children:[t.jsx(Nt,{content:t.jsx(yt,{labelFormatter:Jt}),cursor:{fill:"var(--muted)"}}),t.jsx(_t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Qt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Qt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Jt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Yt(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function Zt(s){const e=$.c(13),{connectionId:n}=s,[i,r]=X.useState("14d"),{org:o}=te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let d;e[1]!==i?(d=Wt.map(a=>t.jsx("button",{type:"button",onClick:()=>r(a.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value)),e[1]=i,e[2]=d):d=e[2];let m;e[3]!==d?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=m):m=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{}),e[5]=l):l=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==i?(u=t.jsx(X.Suspense,{fallback:l,children:t.jsx(qt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==m||e[11]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=p):p=e[12],p}function es(s){const e=$.c(15),{virtualMcp:n,org:i}=s,r=Q();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:16}),e[4]=c):c=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:c}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=l):l=e[10];let u;return e[11]!==o||e[12]!==d||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,m,l]}),e[11]=o,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function ts(s){const e=$.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let c;e[3]!==i?(c=d=>t.jsx(es,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=c):c=e[4],r=n.map(c),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function ss(s){const e=$.c(7),{connection:n}=s,{org:i}=te();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=St(r);if(!(o.length>0)){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(t.Fragment,{}),e[2]=l):l=e[2],l}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ts,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function ns(s){const e=$.c(30),{tools:n,connectionId:i,org:r}=s,o=Q(),{org:c}=te();let d;e[0]!==i||e[1]!==c.id?(d={connectionId:i,orgId:c.id},e[0]=i,e[1]=c.id,e[2]=d):d=e[2];const m=ie(d),l=Ne(i);let u;e[3]!==l||e[4]!==i?(u=l?we(l):i,e[3]=l,e[4]=i,e[5]=u):u=e[5];const p=u,[a,f]=X.useState("");let h,b,j,v;if(e[6]!==p||e[7]!==m||e[8]!==o||e[9]!==r||e[10]!==a||e[11]!==n){const N=(n??[]).filter(os),w=a.toLowerCase().trim(),k=w?N.filter(g=>g.name.toLowerCase().includes(w)||g.description&&g.description.toLowerCase().includes(w)):N;let _;e[16]!==p||e[17]!==o||e[18]!==r?(_=g=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[16]=p,e[17]=o,e[18]=r,e[19]=_):_=e[19];const T=_;j="flex flex-col h-full overflow-hidden";let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=g=>{g.key==="Escape"&&(f(""),g.target.blur())},e[20]=y):y=e[20],e[21]!==a?(v=t.jsx(At,{value:a,onChange:f,placeholder:"Search apps...",onKeyDown:y}),e[21]=a,e[22]=v):v=e[22],h="flex-1 overflow-auto p-5",b=k.length===0?t.jsx(ve,{image:null,title:a?"No apps found":"No apps available",description:a?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:k.map(g=>{const P=ae(g._meta);return t.jsxs(Dt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>T(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(st,{resourceURI:P,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(Qe,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[6]=p,e[7]=m,e[8]=o,e[9]=r,e[10]=a,e[11]=n,e[12]=h,e[13]=b,e[14]=j,e[15]=v}else h=e[12],b=e[13],j=e[14],v=e[15];let S;e[23]!==h||e[24]!==b?(S=t.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=S):S=e[25];let I;return e[26]!==j||e[27]!==v||e[28]!==S?(I=t.jsxs("div",{className:j,children:[v,S]}),e[26]=j,e[27]=v,e[28]=S,e[29]=I):I=e[29],I}function os(s){return!!ae(s._meta)}function ke(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ne(s){const e=$.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function is(s){const e=$.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:c}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const m=d;let l;e[2]!==r?(l=r===void 0?[]:r,e[2]=r,e[3]=l):l=e[3];const u=l,p=Q(),a=Ne(o??"");let f;e[4]!==a||e[5]!==o?(f=a?we(a):o,e[4]=a,e[5]=o,e[6]=f):f=e[6];const h=f;let b;e[7]!==h||e[8]!==o||e[9]!==p||e[10]!==c?(b=function(A){!o||!c||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:c,appSlug:h,collectionName:"tools",itemId:encodeURIComponent(A)}})},e[7]=h,e[8]=o,e[9]=p,e[10]=c,e[11]=b):b=e[11];const j=b;let v;e[12]!==o||e[13]!==c||e[14]!==n?(v=o&&c&&n.some(ls),e[12]=o,e[13]=c,e[14]=n,e[15]=v):v=e[15];const S=v;if(n.length+m.length+u.length===0){let C;return e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=C):C=e[16],C}let N;e[17]!==n.length?(N=t.jsxs(Y,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=N):N=e[18];let w;e[19]!==S?(w=S&&t.jsx(Y,{value:"apps",variant:"underline",children:"UI"}),e[19]=S,e[20]=w):w=e[20];let k,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Y,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(Y,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=_):(k=e[21],_=e[22]);let T;e[23]!==N||e[24]!==w?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(ot,{variant:"underline",className:"gap-1",children:[N,w,k,_]})}),e[23]=N,e[24]=w,e[25]=T):T=e[25];let y;e[26]!==j||e[27]!==n?(y=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>j(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(It,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ke(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(ne,{label:"tools"}),e[26]=j,e[27]=n,e[28]=y):y=e[28];let g;e[29]!==y?(g=t.jsx(Z,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:y})}),e[29]=y,e[30]=g):g=e[30];let P;e[31]!==o||e[32]!==S||e[33]!==c||e[34]!==n?(P=S&&t.jsx(Z,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ns,{tools:n,connectionId:o,org:c})}),e[31]=o,e[32]=S,e[33]=c,e[34]=n,e[35]=P):P=e[35];let M;e[36]!==m?(M=m.length>0?m.map(rs):t.jsx(ne,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(Z,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let D;e[40]!==u?(D=u.length>0?u.map(as):t.jsx(ne,{label:"resources"}),e[40]=u,e[41]=D):D=e[41];let z;e[42]!==D?(z=t.jsx(Z,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:D})}),e[42]=D,e[43]=z):z=e[43];let x;return e[44]!==T||e[45]!==g||e[46]!==P||e[47]!==O||e[48]!==z?(x=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(it,{defaultValue:"tools",variant:"underline",children:[T,g,P,O,z]})}),e[44]=T,e[45]=g,e[46]=P,e[47]=O,e[48]=z,e[49]=x):x=e[49],x}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function rs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(wt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ke(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ls(s){return ae(s._meta)}function cs(s){const e=$.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(se,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let c;e[3]!==r?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let m;e[7]!==c||e[8]!==d?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,d]}),e[7]=c,e[8]=d,e[9]=m):m=e[9];let l;return e[10]!==o||e[11]!==m?(l=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=l):l=e[12],l}function ds({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),c=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=$e(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const a=new URL(c);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=d||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Pe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Se,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:s.control,name:"ui_type",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ee,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:"HTTP"}),t.jsx(E,{value:"SSE",children:"SSE"}),t.jsx(E,{value:"Websocket",children:"Websocket"}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:"NPX Package"}),t.jsx(E,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(U,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(F,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(E,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(E,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Et,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(E,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(H,{})]})}),o==="NPX"&&t.jsx(U,{control:s.control,name:"npx_package",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(H,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(U,{control:s.control,name:"stdio_command",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(W,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(H,{})]})}),t.jsx(U,{control:s.control,name:"stdio_args",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(H,{})]})})]}),t.jsx(U,{control:s.control,name:"stdio_cwd",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(H,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(U,{control:s.control,name:"env_vars",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(He,{value:a.value??[],onChange:a.onChange})}),t.jsx(H,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(U,{control:s.control,name:"connection_token",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Pt,{children:[t.jsx(Ot,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs($t,{variant:"success",className:"gap-1.5",children:[t.jsx(zt,{size:12}),"Authenticated via OAuth",t.jsx(Vt,{size:12})]})})}),t.jsxs(Mt,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(Ut,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ft,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(xt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(H,{})]})})]})}function ms(s){return s.command==="npx"}function us(s){return s.args?.find(e=>!e.startsWith("-"))??""}function xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=Ge(i.envVars);if(ms(i)){const c=us(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=xs(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function ps(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=We(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function fs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:c,siblings:d}){const m=Q({from:"/$org/settings/connections/$appSlug"}),l=ze(),u=ye(),p=ft({onSuccess:()=>{d.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[a,f]=X.useState(null),[h,b]=X.useState(!1),j=be({connectionId:e}),{data:v}=Je(),S=v?.data?.members??[],I=a??s,N=S.find(x=>x.userId===I.created_by),k=s?.connection_type==="VIRTUAL"||j.isAuthenticated,_={...s,tools:r},T=Ke(_,Rt),y=Ve({resolver:Ee(Be),values:fe(a??s)}),g=y.formState.isDirty,P=async()=>{if(!await y.trigger())return;const C=y.getValues(),A=ps(C),G=a?.id??e;await u.update.mutateAsync({id:G,data:A}),y.reset(C)},M=()=>{y.reset(fe(a??s))},O=async x=>{const{token:C,tokenInfo:A,error:G}=await Le({connectionId:x,scope:"offline_access"});if(G||!C){q.error(`Authentication failed: ${G}`);return}if(A)try{const K=await fetch(`/api/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:A.accessToken,refreshToken:A.refreshToken,expiresIn:A.expiresIn,scope:A.scope,clientId:A.clientId,clientSecret:A.clientSecret,tokenEndpoint:A.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await u.update.mutateAsync({id:x,data:{connection_token:C}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(J){console.warn("Failed to refresh connection tools after OAuth:",J)}}catch(K){console.error("Error saving OAuth token:",K),await u.update.mutateAsync({id:x,data:{connection_token:C}})}else await u.update.mutateAsync({id:x,data:{connection_token:C}});const L=new URL(`/mcp/${x}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(L.href,null)}),q.success("Authentication successful")},D=()=>O(s.id),z=async()=>{try{const x=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const A=await x.text();q.error(`Failed to remove OAuth: ${A}`);return}const C=new URL(`/mcp/${s.id}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(C.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ht,{...p}),t.jsx(lt,{open:a!==null,onOpenChange:x=>{x||f(null)},children:t.jsxs(ct,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(dt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(mt,{className:"text-base",children:a?.title??s.title}),t.jsx(ut,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ye,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(pt,{...y,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(U,{control:y.control,name:"title",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Name"}),t.jsx(V,{children:t.jsx(W,{...x})}),t.jsx(H,{})]})}),t.jsx(U,{control:y.control,name:"description",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Description"}),t.jsx(V,{children:t.jsx(W,{...x,value:x.value||""})}),t.jsx(H,{})]})})]}),t.jsx(ds,{form:y,connection:a??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:D,onRemoveOAuth:z}),t.jsx(qe,{connection:a??s,form:y,hasMcpBinding:T,isMCPAuthenticated:k,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:D,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:P,disabled:!g||i,className:"flex-1",children:i?"Saving…":"Save changes"}),g&&t.jsx(B,{variant:"outline",onClick:M,children:"Undo"}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=a??s;f(null),p.requestDelete(x)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},a?.id??s.id)]})}),t.jsx(gt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(cs,{connection:s,displayTitle:(()=>{const x=d[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(Zt,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:d,onConfigure:x=>f(x),onAuthenticate:x=>O(x.id),onDelete:x=>p.requestDelete(x),isAdding:h,onAdd:async()=>{b(!0);try{const x=d[0]??s,C=x.title.replace(/\s*\(\d+\)\s*$/,""),A=d.length+1,G=`${C} (${A})`,L=Re("conn");await u.create.mutateAsync({id:L,title:G,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/mcp/${L}`,window.location.origin),J=await Ue({url:K.href,token:null});J.supportsOAuth&&!J.isAuthenticated&&await O(L)}finally{b(!1)}}}),t.jsx(ss,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(is,{tools:r,prompts:o,resources:c,connectionId:e,org:n})})]})})]})})]})}function hs(){const s=$.c(38);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Q(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=Me(i),{org:c}=te(),d=ye();let m;s[2]!==r?(m={slug:r},s[2]=r,s[3]=m):m=s[3];const l=Ze(m),u=l[0]??null,p=u?.id??"",a=p||null;let f;s[4]!==c.id||s[5]!==a?(f={connectionId:a,orgId:c.id},s[4]=c.id,s[5]=a,s[6]=f):f=s[6];const h=ie(f);let b;s[7]!==h?(b={client:h},s[7]=h,s[8]=b):b=s[8];const{data:j}=tt(b);let v;if(s[9]!==u?.tools||s[10]!==p||s[11]!==l||s[12]!==j){const D=j?j.tools.map(ys):(u?.tools??[]).map(Ns);e:{if(l.length<=1){v=D;break e}const z=new Set,x=[],C=vs;for(const A of l){const G=A.id===p?D:C(A.tools);for(const L of G)z.has(L.name)||(z.add(L.name),x.push(L))}v=x.length>0?x:D}s[9]=u?.tools,s[10]=p,s[11]=l,s[12]=j,s[13]=v}else v=s[13];const S=v;let I;s[14]!==h?(I={client:h},s[14]=h,s[15]=I):I=s[15];const{data:N}=at(I);let w;s[16]!==h?(w={client:h},s[16]=h,s[17]=w):w=s[17];const{data:k}=nt(w);let _;s[18]!==N?.prompts?(_=N?.prompts??[],s[18]=N?.prompts,s[19]=_):_=s[19];let T;s[20]!==_?(T=_.map(js),s[20]=_,s[21]=T):T=s[21];const y=T;let g;s[22]!==k?.resources?(g=k?.resources??[],s[22]=k?.resources,s[23]=g):g=s[23];let P;s[24]!==g?(P=g.map(gs),s[24]=g,s[25]=P):P=s[25];const M=P;if(!u){let D;return s[26]!==n||s[27]!==o?(D=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(B,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[26]=n,s[27]=o,s[28]=D):D=s[28],D}let O;return s[29]!==d.update.isPending||s[30]!==S||s[31]!==u||s[32]!==p||s[33]!==o||s[34]!==y||s[35]!==M||s[36]!==l?(O=t.jsx(fs,{org:o,connection:u,connectionId:p,isUpdating:d.update.isPending,tools:S,prompts:y,resources:M,siblings:l}),s[29]=d.update.isPending,s[30]=S,s[31]=u,s[32]=p,s[33]=o,s[34]=y,s[35]=M,s[36]=l,s[37]=O):O=s[37],O}function gs(s){return{name:s.name,description:s.description,uri:s.uri}}function js(s){return{name:s.name,description:s.description}}function vs(s){return(s??[]).map(bs)}function bs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Oe,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(hs,{})})}),s[0]=e):e=s[0],e}function Rn(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_s,{}),s[0]=e):e=s[0],e}export{Rn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as re,s as ce,o as de,r as U,z as me,C as ue,a as fe,t as Y,x as q,K as te,b as ge,j as s,B as K,H as xe,J as W,e as L,c as pe,M as he}from"./index-Bn0n2Tn5.js";import{P as V}from"./index-BY4tnJ8n.js";import{A as be}from"./avatar-DRNf61dD.js";import{I as je}from"./input-C0cHvFsP.js";import{S as X,a as Z,b as Q,c as ie,d as ve}from"./settings-section-BIiOcEee.js";import{D as Se}from"./domain-settings-Df_AVfSP.js";import{u as ye,a as se,D as Ne,c as Ce,S as we,v as _e,K as ze,P as De,d as Pe,C as ke,s as Ae,b as Ie,e as Ee}from"./collection-search-x3WxKP2U.js";import{W as ee,i as Te}from"./constants-DWChG_gh.js";import{b as le}from"./use-virtual-mcp-BYV6DlKB.js";import{b as Oe,P as Re,a as Fe}from"./popover-9zp4cKfF.js";import{S as Le}from"./skeleton-DQqcYIUR.js";import{z as $e}from"./agent-icon-DdfLWWFz.js";import{s as Me}from"./Plus-B1zoIOQx.js";import{a as ae}from"./Users03-BNN6AS-n.js";import{i as He}from"./X-XvFOaH_0.js";import{I as J}from"./integration-icon-Db7fTukH.js";import{u as Ke,c as Ue}from"./use-organization-settings-69gOseUx.js";import"./tooltip-CkzGOY_H.js";import"./User01-BwcffllD.js";import"./card-Dp6Lilh-.js";import"./ArrowUpRight-Dw5rxpDu.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-Dd-fbXw9.js";import"./SearchMd-tlcXyQa_.js";import"./use-collections-s48OQ83y.js";import"./AlertCircle-BefAeM6u.js";import"./Tool01-CWU0CUYW.js";import"./XClose-CeINnhme.js";import"./RefreshCcw01-DhQjzDQL.js";import"./ArrowNarrowLeft-ctHZC7IK.js";import"./XCircle-CBqb98Hh.js";import"./ZapSquare-Ri9lH1zf.js";import"./CheckCircle-3lbo4DOp.js";import"./ChevronDown-BMsVDJMd.js";import"./ChevronRight-DNaFnNR_.js";import"./ChevronUp-Ba2YtjVA.js";import"./DotsVertical-q5wudUQb.js";import"./Container-BbxUmzld.js";import"./Star01-Cl5wO8v8.js";import"./Palette-CSbP1WU6.js";import"./LinkExternal01-B-rWZEWZ.js";import"./Lock01-Bdpg3Hx_.js";import"./Sun-MpjnKSLA.js";import"./Play-BwE8tx_2.js";import"./Settings02-NVTdZYn8.js";import"./Shield01-Cczh_kLJ.js";import"./Trash01-CGGNK3g-.js";import"./Zap-CDrmsf2C.js";const qe=xe({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().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:W().optional()});function Be(t){const e=L.c(13),{value:a,onChange:i,name:f,disabled:l}=t,n=U.useRef(null);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>n.current?.click(),e[0]=S):S=e[0];const _=S;let c;e[1]!==i?(c=z=>{const p=z.target.files?.[0];if(!p)return;if(p.size>2097152){q.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=Ge,b.onloadend=()=>{b.result&&i(b.result),n.current&&(n.current.value="")},b.readAsDataURL(p)},e[1]=i,e[2]=c):c=e[2];const g=c;let o;e[3]!==l||e[4]!==g?(o=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:g,className:"hidden",disabled:l}),e[3]=l,e[4]=g,e[5]=o):o=e[5];const u=a||void 0,d=f??"?";let m;e[6]!==u||e[7]!==d?(m=s.jsx(be,{url:u,fallback:d,shape:"square",size:"base"}),e[6]=u,e[7]=d,e[8]=m):m=e[8];let x;return e[9]!==l||e[10]!==o||e[11]!==m?(x=s.jsxs("button",{type:"button",onClick:_,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,m]}),e[9]=l,e[10]=o,e[11]=m,e[12]=x):x=e[12],x}function Ge(){return q.error("Failed to read image")}function Ve(){const t=re(),{org:e}=ce(),a=de(),[i,f]=U.useState(!1),l=me({resolver:ue(qe),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),n=fe({mutationFn:async o=>{const u={name:o.name,slug:o.slug};o.logo&&(u.logo=o.logo);const d=await ge.organization.update({organizationId:e.id,data:u});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:o=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(l.formState.dirtyFields)}),a.invalidateQueries({queryKey:te.organizations()}),a.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),q.success("Organization settings updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:o=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(l.formState.dirtyFields),error:o instanceof Error?o.message:String(o)}),q.error(o instanceof Error?o.message:"Failed to update organization")},onSettled:()=>{f(!1)}}),S=o=>{f(!0),n.mutate(o)},_=l.formState.isDirty,c=l.formState.errors,g=typeof window<"u"?`${window.location.host}/`:"";return s.jsx("form",{onSubmit:l.handleSubmit(S),className:"flex flex-col gap-3",children:s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Be,{value:l.watch("logo"),onChange:o=>l.setValue("logo",o??"",{shouldDirty:!0}),name:l.watch("name"),disabled:i})}),s.jsx(Q,{title:"Name",action:s.jsx(je,{id:"org-name",...l.register("name"),placeholder:"Organization name",disabled:i,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:[g&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:g}),s.jsx("input",{id:"org-slug",...l.register("slug"),placeholder:"my-organization",disabled:i,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:o=>{const u=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");l.setValue("slug",u,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}})]})}),(c.name||c.slug||c.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&s.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&s.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&s.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]}),_&&s.jsxs(ie,{children:[s.jsx(K,{type:"button",variant:"outline",size:"sm",onClick:()=>l.reset(),disabled:i,children:"Cancel"}),s.jsx(K,{type:"submit",disabled:i,size:"sm",children:i?"Saving…":"Save"})]})]})})})}const ne=["site-editor","site-diagnostics","ai-image","ai-research"],oe=8;function We(t,e,a){const i=e.find(l=>l.id===t);if(i)return{id:i.id,title:i.title,icon:i.icon,kind:"template"};const f=a.find(l=>l.id===t);return f?{id:t,title:f.title,icon:f.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function Qe(t){const e=L.c(39),{agent:a,onRemove:i}=t;let f;e[0]!==a.id?(f={id:a.id},e[0]=a.id,e[1]=f):f=e[1];const{attributes:l,listeners:n,setNodeRef:S,transform:_,transition:c,isDragging:g}=Pe(f);let o;e[2]!==_?(o=ke.Transform.toString(_),e[2]=_,e[3]=o):o=e[3];const u=g?.5:void 0,d=g?100:void 0;let m;e[4]!==o||e[5]!==u||e[6]!==d||e[7]!==c?(m={transform:o,transition:c,opacity:u,zIndex:d},e[4]=o,e[5]=u,e[6]=d,e[7]=c,e[8]=m):m=e[8];const x=m,z=g&&"shadow-lg";let p;e[9]!==z?(p=pe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=p):p=e[10];const b=`Drag to reorder ${a.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx($e,{size:14}),e[11]=D):D=e[11];let A;e[12]!==l||e[13]!==n||e[14]!==b?(A=s.jsx("button",{type:"button",...l,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":b,children:D}),e[12]=l,e[13]=n,e[14]=b,e[15]=A):A=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ae,{size:14}),e[16]=y):y=e[16];let C;e[17]!==a.icon||e[18]!==a.title?(C=s.jsx(J,{icon:a.icon,name:a.title,size:"xs",fallbackIcon:y}),e[17]=a.icon,e[18]=a.title,e[19]=C):C=e[19];let j;e[20]!==a.title?(j=s.jsx("span",{className:"text-sm text-foreground truncate",children:a.title}),e[20]=a.title,e[21]=j):j=e[21];const w=a.kind==="template"?"Template":a.kind==="custom"?"Custom agent":"Unavailable";let h;e[22]!==w?(h=s.jsx("span",{className:"text-xs text-muted-foreground",children:w}),e[22]=w,e[23]=h):h=e[23];let v;e[24]!==j||e[25]!==h?(v=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[j,h]}),e[24]=j,e[25]=h,e[26]=v):v=e[26];const I=`Remove ${a.title}`;let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(He,{size:14}),e[27]=P):P=e[27];let N;e[28]!==i||e[29]!==I?(N=s.jsx("button",{type:"button",onClick:i,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:P}),e[28]=i,e[29]=I,e[30]=N):N=e[30];let k;return e[31]!==S||e[32]!==x||e[33]!==A||e[34]!==C||e[35]!==v||e[36]!==N||e[37]!==p?(k=s.jsxs("div",{ref:S,style:x,className:p,children:[A,C,v,N]}),e[31]=S,e[32]=x,e[33]=A,e[34]=C,e[35]=v,e[36]=N,e[37]=p,e[38]=k):k=e[38],k}function Ye(t){const e=L.c(48),{selectedIds:a,onAdd:i}=t,[f,l]=U.useState(!1),[n,S]=U.useState(""),_=le();let c;e[0]!==a?(c=new Set(a),e[0]=a,e[1]=c):c=e[1];const g=c;let o,u,d,m,x,z,p,b,D,A,y,C,j;if(e[2]!==_||e[3]!==i||e[4]!==f||e[5]!==n||e[6]!==g){const P=n.toLowerCase();m=ee.filter(r=>!g.has(r.id)&&(!n||r.title.toLowerCase().includes(P)));let N;e[20]!==g?(N=r=>r.id!==null&&!Te(r.id)&&!g.has(r.id),e[20]=g,e[21]=N):N=e[21],d=_.filter(N).filter(r=>!n||r.title.toLowerCase().includes(P));let k;e[22]!==i?(k=r=>{i(r),l(!1),S("")},e[22]=i,e[23]=k):k=e[23];const T=k;u=Oe,C=f,j=l,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Re,{asChild:!0,children:s.jsxs(K,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Me,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],o=Fe,D="w-[320px] p-0 overflow-hidden",A="start",e[25]!==n?(y=s.jsx(Ee,{value:n,onChange:S,placeholder:"Search agents..."}),e[25]=n,e[26]=y):y=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",p=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:"Templates"}),m.map(r=>s.jsxs("button",{type:"button",onClick:()=>T(r.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:r.icon,name:r.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:r.title})]},r.id))]}),b=d.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"}),d.map(r=>s.jsxs("button",{type:"button",onClick:()=>T(r.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:r.title})]},r.id))]}),e[2]=_,e[3]=i,e[4]=f,e[5]=n,e[6]=g,e[7]=o,e[8]=u,e[9]=d,e[10]=m,e[11]=x,e[12]=z,e[13]=p,e[14]=b,e[15]=D,e[16]=A,e[17]=y,e[18]=C,e[19]=j}else o=e[7],u=e[8],d=e[9],m=e[10],x=e[11],z=e[12],p=e[13],b=e[14],D=e[15],A=e[16],y=e[17],C=e[18],j=e[19];let w;e[27]!==d||e[28]!==m.length||e[29]!==n?(w=m.length===0&&d.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]=d,e[28]=m.length,e[29]=n,e[30]=w):w=e[30];let h;e[31]!==w||e[32]!==z||e[33]!==p||e[34]!==b?(h=s.jsxs("div",{className:z,children:[p,b,w]}),e[31]=w,e[32]=z,e[33]=p,e[34]=b,e[35]=h):h=e[35];let v;e[36]!==o||e[37]!==h||e[38]!==D||e[39]!==A||e[40]!==y?(v=s.jsxs(o,{className:D,align:A,children:[y,h]}),e[36]=o,e[37]=h,e[38]=D,e[39]=A,e[40]=y,e[41]=v):v=e[41];let I;return e[42]!==u||e[43]!==x||e[44]!==v||e[45]!==C||e[46]!==j?(I=s.jsxs(u,{open:C,onOpenChange:j,children:[x,v]}),e[42]=u,e[43]=x,e[44]=v,e[45]=C,e[46]=j,e[47]=I):I=e[47],I}function Je(){const t=L.c(61),e=Ke(),a=le(),i=Ue();let f;t[0]!==e?.ids?(f=e?.ids??[...ne],t[0]=e?.ids,t[1]=f):f=t[1];const l=f,[n,S]=U.useState(l);let _;t[2]!==n||t[3]!==l?(_=n.length!==l.length||n.some((E,O)=>E!==l[O]),t[2]=n,t[3]=l,t[4]=_):_=t[4];const c=_;let g;t[5]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:5}},t[5]=g):g=t[5];let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Ae},t[6]=o):o=t[6];const u=ye(se(De,g),se(ze,o));let d;t[7]!==n?(d=E=>{const{active:O,over:R}=E;if(!R||O.id===R.id)return;const F=n.indexOf(O.id),G=n.indexOf(R.id);F===-1||G===-1||S(Ie([...n],F,G))},t[7]=n,t[8]=d):d=t[8];const m=d;let x;t[9]!==n?(x=E=>{n.includes(E)||S([...n,E])},t[9]=n,t[10]=x):x=t[10];const z=x;let p;t[11]!==n?(p=E=>{S(n.filter(O=>O!==E))},t[11]=n,t[12]=p):p=t[12];const b=p;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{S([...ne])},t[13]=D):D=t[13];const A=D;let y;t[14]!==n||t[15]!==i?(y=()=>{i.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(Ze).length}),q.success("Default home agents updated")},onError:Xe})},t[14]=n,t[15]=i,t[16]=y):y=t[16];const C=y;let j,w,h,v,I,P,N;if(t[17]!==a||t[18]!==n||t[19]!==m||t[20]!==b||t[21]!==u||t[22]!==i.isPending){let E;t[30]!==a?(E=F=>We(F,ee,a),t[30]=a,t[31]=E):E=t[31];const O=n.map(E);h=Math.max(0,n.length-oe),w=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(he,{size:14}),t[32]=R):R=t[32],t[33]!==i.isPending?(P=s.jsxs(K,{type:"button",variant:"ghost",size:"sm",onClick:A,disabled:i.isPending,children:[R,"Reset defaults"]}),t[33]=i.isPending,t[34]=P):P=t[34],j=Z,N="px-5 py-5 flex flex-col gap-3",v=O.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(Ne,{sensors:u,collisionDetection:Ce,onDragEnd:m,children:s.jsx(we,{items:n,strategy:_e,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:O.map((F,G)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[G===oe&&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(Qe,{agent:F,onRemove:()=>b(F.id)})]},F.id))})})}),t[17]=a,t[18]=n,t[19]=m,t[20]=b,t[21]=u,t[22]=i.isPending,t[23]=j,t[24]=w,t[25]=h,t[26]=v,t[27]=I,t[28]=P,t[29]=N}else j=t[23],w=t[24],h=t[25],v=t[26],I=t[27],P=t[28],N=t[29];let k;t[35]!==n||t[36]!==z?(k=s.jsx(Ye,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=k):k=t[37];let T;t[38]!==h?(T=h>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[h," agent",h===1?"":"s"," won't fit on the home view"]}),t[38]=h,t[39]=T):T=t[39];let r;t[40]!==k||t[41]!==T?(r=s.jsxs("div",{className:"flex items-center justify-between",children:[k,T]}),t[40]=k,t[41]=T,t[42]=r):r=t[42];let $;t[43]!==v||t[44]!==r||t[45]!==N?($=s.jsxs("div",{className:N,children:[v,r]}),t[43]=v,t[44]=r,t[45]=N,t[46]=$):$=t[46];let M;t[47]!==C||t[48]!==l||t[49]!==c||t[50]!==i.isPending?(M=c&&s.jsxs(ie,{children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>S(l),disabled:i.isPending,children:"Cancel"}),s.jsx(K,{type:"button",onClick:C,disabled:i.isPending,children:i.isPending?"Saving…":"Save"})]}),t[47]=C,t[48]=l,t[49]=c,t[50]=i.isPending,t[51]=M):M=t[51];let H;t[52]!==j||t[53]!==$||t[54]!==M?(H=s.jsxs(j,{children:[$,M]}),t[52]=j,t[53]=$,t[54]=M,t[55]=H):H=t[55];let B;return t[56]!==w||t[57]!==I||t[58]!==P||t[59]!==H?(B=s.jsx(w,{title:I,actions:P,children:H}),t[56]=w,t[57]=I,t[58]=P,t[59]=H,t[60]=B):B=t[60],B}function Xe(t){q.error(t instanceof Error?t.message:"Failed to update default home agents")}function Ze(t){return ee.some(e=>e.id===t)}function et(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{title:"Default home agents",children:s.jsx(Z,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(tt)})})}),t[0]=e):e=t[0],e}function tt(t,e){return s.jsx(Le,{className:"h-12 w-full rounded-lg"},e)}function st(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(U.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(Je,{})}),t[0]=e):e=t[0],e}function nt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(V.Content,{children:s.jsx(V.Body,{children:s.jsxs(ve,{children:[s.jsx(V.Title,{children:"Organization"}),s.jsx(Ve,{}),s.jsx(Se,{}),s.jsx(st,{})]})})})}),t[0]=e):e=t[0],e}function Xt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nt,{}),t[0]=e):e=t[0],e}export{Xt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as C,s as pe,f as ve,U as It,g as We,d as qe,W as ys,X as _s,Y as Ss,j as n,Z as Cs,c as J,t as se,r as b,$ as Mt,a0 as $t,H as Ns,J as ks,C as ws,z as Is,a as Ms,B as et,b as Se,a1 as $s,P as Tt,x as je,a2 as Ts,a3 as As,o as Re,a4 as Ps,a5 as Os,a6 as zs,a7 as Rs,a8 as Oe,a9 as Es,aa as Ds,ab as Ls,ac as Fs,ad as At,ae as Us,af as Gs,ag as Bs,ah as Hs,ai as Vs,aj as Ks,ak as Ws,al as qs,am as Qs,an as Ys,ao as Ee,L as Xs,E as it,K as Pt}from"./index-Bn0n2Tn5.js";import{p as Js,g as Zs,D as en,E as mt,F as ft,G as tn,H as xt,I as sn,A as Pe,J as nn,k as on,K as rn,L as ln}from"./agent-icon-DdfLWWFz.js";import{i as an,f as De,g as Le,h as ge,u as Qe,j as he,k as ie,l as Ot,m as zt,n as cn,o as Rt,p as Et}from"./index-BY4tnJ8n.js";import{u as Dt,r as Lt}from"./shell-layout-ti4P0o8w.js";import{f as dn,g as un,h as mn}from"./pair-Bcvdi-3H.js";import{S as Ve}from"./skeleton-DQqcYIUR.js";import{b as lt,P as at,a as ct}from"./popover-9zp4cKfF.js";import{b as Ft,a as Ut,D as Gt}from"./drawer-CHErHUts.js";import{A as pt}from"./avatar-DRNf61dD.js";import{u as Bt,a as tt,b as st,c as ht,T as nt}from"./tooltip-CkzGOY_H.js";import{i as Ht}from"./ChevronDown-BMsVDJMd.js";import{c as gt,a as fn,e as xn}from"./XCircle-CBqb98Hh.js";import{i as pn,b as hn,n as gn}from"./ZapSquare-Ri9lH1zf.js";import{n as bn,a as jn,i as vn}from"./Sun-MpjnKSLA.js";import{s as Ke}from"./Plus-B1zoIOQx.js";import{a as Ye}from"./Settings02-NVTdZYn8.js";import{i as yn}from"./Shield01-Cczh_kLJ.js";import{a as Vt}from"./Users03-BNN6AS-n.js";import{f as _n,a as Sn,b as Cn,c as Nn,d as kn,e as wn,A as In}from"./alert-dialog-BY7wdwxM.js";import{F as Mn,a as $n,b as Tn,c as An,d as Pn,e as On,f as zn}from"./form-D9KcIdYm.js";import{I as Rn}from"./input-C0cHvFsP.js";import{S as En}from"./index-Ck21eYLb.js";import"./index-BjIWAww2.js";import{s as Dn}from"./XClose-CeINnhme.js";import{S as Kt,u as Wt,W as ze,i as Ln,b as Fn}from"./constants-DWChG_gh.js";import{u as Un}from"./use-mcp-tools-CODd7jbk.js";import{u as Gn}from"./use-ai-providers-D8PM532H.js";import{A as Bn,b as Hn,S as Vn,c as Kn,d as Wn,C as qn}from"./index-DAG4cu8y.js";import{u as Qn,a as bt,K as Yn,P as Xn,S as Jn,v as Zn,D as eo,c as to,s as so,b as no,d as oo,C as ro,e as io}from"./collection-search-x3WxKP2U.js";import{i as jt}from"./X-XvFOaH_0.js";import{b as qt,u as Qt}from"./use-virtual-mcp-BYV6DlKB.js";import{u as Yt,a as lo}from"./use-navigate-to-agent-BIpRywxJ.js";import{u as ao}from"./use-create-virtual-mcp-C25QZ7ga.js";import{I as co,a as uo,S as mo,L as fo,b as xo,G as po}from"./lean-canvas-recruit-modal-Bu0aNy4u.js";import{u as Xt}from"./use-tasks-Q8L8ocme.js";import{e as ot,f as ho}from"./chat-context-JfnWgmWL.js";import{i as go}from"./ChevronRight-DNaFnNR_.js";import{E as bo}from"./empty-state-BFgJp7mt.js";import{u as jo}from"./use-decopilot-events-2jo7Z1ub.js";import{g as Jt,a as vt,b as yt,h as _t,D as St}from"./dropdown-menu-LTGIQdd2.js";import{i as vo}from"./Zap-CDrmsf2C.js";import{g as yo}from"./task-status-D2ZncahY.js";function Zt(){const t=C.c(77),{org:e}=pe(),s=ve(),o=It(),{setTasksOpen:r,openTab:i}=Dt(),l=e.slug,a=pe().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=We(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=qe(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 j;t[4]!==a.ui?(j=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=j):j=t[5];const I=j;let g,k,h,S;if(t[6]!==a.id||t[7]!==p||t[8]!==s||t[9]!==l||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let N;t[17]!==p?(N=X=>p.includes(X.pluginId),t[17]=p,t[18]=N):N=t[18];const K=ys.filter(N),W=m.virtualmcpid??a.id;k=!!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]!==s||t[23]!==l||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();s({to:"/$org/$taskId/$pluginId",params:{org:l,taskId:oe,pluginId:X},search:ae=>({...ae,virtualmcpid:W})})},t[21]=G,t[22]=s,t[23]=l,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],S=K.map(ne),t[6]=a.id,t[7]=p,t[8]=s,t[9]=l,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=k,t[15]=h,t[16]=S}else g=t[13],k=t[14],h=t[15],S=t[16];const y=S;let v;if(t[29]!==p||t[30]!==g||t[31]!==h){let N;t[33]!==p?(N=G=>p.includes(G.pluginId),t[33]=p,t[34]=N):N=t[34];const K=_s.filter(N);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],v=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=v}else v=t[32];const _=v;let M;if(t[38]!==i||t[39]!==I){let N;t[41]!==i?(N=K=>{const W=Js(K.icon),G=W.type==="icon"?Zs(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?n.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?n.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):n.jsx(an,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>i(dn(K.connectionId,K.toolName))}},t[41]=i,t[42]=N):N=t[42],M=I.map(N),t[38]=i,t[39]=I,t[40]=M}else M=t[40];const D=M;let w;t[43]!==D?(w=D.length>0?{type:"group",group:{id:"apps",label:"Apps",items:D,defaultExpanded:!0}}:null,t[43]=D,t[44]=w):w=t[44];const $=w;let O;t[45]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(en,{className:"size-4!"}),t[45]=O):O=t[45];const T=x===`/${l}`||x===`/${l}/`;let A;t[46]!==s||t[47]!==l||t[48]!==r?(A=()=>{r(!1),s({to:"/$org",params:{org:l}})},t[46]=s,t[47]=l,t[48]=r,t[49]=A):A=t[49];let P;t[50]!==A||t[51]!==T?(P={key:"home",label:"Home",icon:O,isActive:T,onClick:A},t[50]=A,t[51]=T,t[52]=P):P=t[52];const z=P;let L;t[53]!==p?(L=p.includes(Ss),t[53]=p,t[54]=L):L=t[54];const R=L;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(Cs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==l||t[57]!==x?(U=x.startsWith(`/${l}/settings/workflows`),t[56]=l,t[57]=x,t[58]=U):U=t[58];let F;t[59]!==s||t[60]!==l?(F=()=>s({to:"/$org/settings/workflows",params:{org:l}}),t[59]=s,t[60]=l,t[61]=F):F=t[61];let H;t[62]!==U||t[63]!==F?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:F},t[62]=U,t[63]=F,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==z||t[66]!==k||t[67]!==R||t[68]!==V){const N=[z];k&&R&&N.push(V),q={type:"items",items:N},t[65]=z,t[66]=k,t[67]=R,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==$||t[71]!==_||t[72]!==y||t[73]!==q){if(Q=[q],y.length>0){let N;t[75]!==y?(N={type:"items",items:y},t[75]=y,t[76]=N):N=t[76],Q.push(N)}_.length>0&&Q.push(..._),$&&Q.push($),t[70]=$,t[71]=_,t[72]=y,t[73]=q,t[74]=Q}else Q=t[74];return Q}function es(t){const e=C.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex h-6 items-center",children:n.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let r;return e[1]!==s?(r=n.jsxs(De,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,n.jsx(Le,{children:n.jsx(ge,{className:"gap-0.5",children:s})})]}),e[1]=s,e[2]=r):r=e[2],r}function _o(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function ts(t){const e=C.c(15),{item:s}=t,{isMobile:o,setOpenMobile:r}=Qe();let i;e[0]!==o||e[1]!==s||e[2]!==r?(i=()=>{se("nav_item_clicked",{nav_key:s.key,nav_label:s.label,is_active:!!s.isActive,is_mobile:o}),s.onClick?.(),o&&r(!1)},e[0]=o,e[1]=s,e[2]=r,e[3]=i):i=e[3];const l=i,a=s.key,c=s.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==l||e[7]!==s.icon||e[8]!==s.isActive||e[9]!==s.label?(d=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:s.icon}),e[6]=l,e[7]=s.icon,e[8]=s.isActive,e[9]=s.label,e[10]=d):d=e[10];let m;return e[11]!==s.key||e[12]!==u||e[13]!==d?(m=n.jsx(ie,{className:u,children:d},a),e[11]=s.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function So(t){const e=C.c(12),{section:s}=t;switch(s.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ot,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=s.group.label,r=s.group.defaultExpanded;let i;e[2]!==s.group.items?(i=s.group.items.map(No),e[2]=s.group.items,e[3]=i):i=e[3];let l;return e[4]!==s.group.defaultExpanded||e[5]!==s.group.label||e[6]!==i?(l=n.jsx(es,{label:o,defaultExpanded:r,children:i}),e[4]=s.group.defaultExpanded,e[5]=s.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let o;e[8]!==s.items?(o=s.items.map(Co),e[8]=s.items,e[9]=o):o=e[9];let r;return e[10]!==o?(r=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=r):r=e[11],r}}}function Co(t){return n.jsx(ts,{item:t},t.key)}function No(t){return n.jsx(ts,{item:t},t.key)}function ko(t){const e=C.c(14),{sections:s,header:o,footer:r,additionalContent:i,variant:l,contentClassName:a}=t,c=l===void 0?"sidebar":l;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(_o,{})}),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]!==s?(m=s.map(wo),e[3]=s,e[4]=m):m=e[4];let x;e[5]!==i||e[6]!==d||e[7]!==m?(x=n.jsxs(zt,{className:d,children:[m,i]}),e[5]=i,e[6]=d,e[7]=m,e[8]=x):x=e[8];let f;return e[9]!==r||e[10]!==o||e[11]!==x||e[12]!==c?(f=n.jsxs(cn,{variant:c,children:[u,o,x,r]}),e[9]=r,e[10]=o,e[11]=x,e[12]=c,e[13]=f):f=e[13],f}function wo(t,e){return n.jsx(So,{section:t},e)}function ss(t){const e=C.c(2);let s;return e[0]!==t?(s=n.jsx(ko,{...t}),e[0]=t,e[1]=s):s=e[1],s}ss.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Ve,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Io(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function Ct(t){const e=C.c(15),{item:s,onClose:o}=t,r=s.isActive&&"z-10";let i;e[0]!==r?(i=J(r),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==o?(l=()=>{s.onClick?.(),o()},e[2]=s,e[3]=o,e[4]=l):l=e[4];let a;e[5]!==s.icon?(a=n.jsx("span",{className:"[&>svg]:size-8",children:s.icon}),e[5]=s.icon,e[6]=a):a=e[6];let c;e[7]!==s.isActive||e[8]!==s.label||e[9]!==l||e[10]!==a?(c=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:a}),e[7]=s.isActive,e[8]=s.label,e[9]=l,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==i||e[13]!==c?(u=n.jsx(ie,{className:i,children:c}),e[12]=i,e[13]=c,e[14]=u):u=e[14],u}function Mo(t){const e=C.c(18),{section:s,onClose:o}=t;switch(s.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ot,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=s.group.label,i=s.group.defaultExpanded;let l;if(e[2]!==o||e[3]!==s.group.items){let c;e[5]!==o?(c=u=>n.jsx(Ct,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],l=s.group.items.map(c),e[2]=o,e[3]=s.group.items,e[4]=l}else l=e[4];let a;return e[7]!==s.group.defaultExpanded||e[8]!==s.group.label||e[9]!==l?(a=n.jsx(es,{label:r,defaultExpanded:i,children:l}),e[7]=s.group.defaultExpanded,e[8]=s.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==o||e[12]!==s.items){let l;e[14]!==o?(l=a=>n.jsx(Ct,{item:a,onClose:o},a.key),e[14]=o,e[15]=l):l=e[15],r=s.items.map(l),e[11]=o,e[12]=s.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}}}function $o(t){const e=C.c(12),{sections:s,onClose:o,footer:r,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(Io,{})}),e[0]=l):l=e[0];let a;if(e[1]!==o||e[2]!==s){let d;e[4]!==o?(d=(m,x)=>n.jsx(Mo,{section:m,onClose:o},x),e[4]=o,e[5]=d):d=e[5],a=s.map(d),e[1]=o,e[2]=s,e[3]=a}else a=e[3];let c;e[6]!==i||e[7]!==a?(c=n.jsxs(zt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,i]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==r||e[10]!==c?(u=n.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[l,c,r]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function ns(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const To=Ns({name:ks().min(2,"Organization name is required")});function Ao(t){const e=C.c(41),{open:s,onOpenChange:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:ws(To),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Is(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Oo,onSuccess:Po},e[1]=l):l=e[1];const a=Ms(l),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=n.jsxs(Cn,{children:[n.jsx(Nn,{children:"Create a new organization"}),n.jsx(kn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==i){let _;e[6]!==a?(_=M=>a.mutateAsync(M),e[6]=a,e[7]=_):_=e[7],d=i.handleSubmit(_),e[3]=a,e[4]=i,e[5]=d}else d=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:M}=_;return n.jsxs(Tn,{children:[n.jsx(An,{children:"Organization Name"}),n.jsx(Pn,{children:n.jsx(Rn,{...M,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),n.jsx(On,{children:"The name of your company or organization"}),M.value&&n.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",n.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ns(M.value)]})]}),n.jsx(zn,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let x;e[10]!==i.control||e[11]!==m?(x=n.jsx(Mn,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=x):x=e[12];let f;e[13]!==c?(f=c&&n.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]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let j;e[18]!==i.formState.isSubmitting||e[19]!==p?(j=n.jsx(_n,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=j):j=e[20];const I=!i.formState.isValid||i.formState.isSubmitting;let g;e[21]!==i.formState.isSubmitting?(g=i.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(En,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=g):g=e[22];let k;e[23]!==I||e[24]!==g?(k=n.jsx(et,{type:"submit",variant:"default",disabled:I,children:g}),e[23]=I,e[24]=g,e[25]=k):k=e[25];let h;e[26]!==k||e[27]!==j?(h=n.jsxs(wn,{children:[j,k]}),e[26]=k,e[27]=j,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==d||e[31]!==x||e[32]!==f?(S=n.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]=S):S=e[33];let y;e[34]!==i||e[35]!==S?(y=n.jsxs(Sn,{children:[u,n.jsx($n,{...i,children:S})]}),e[34]=i,e[35]=S,e[36]=y):y=e[36];let v;return e[37]!==o||e[38]!==s||e[39]!==y?(v=n.jsx(In,{open:s,onOpenChange:o,children:y}),e[37]=o,e[38]=s,e[39]=y,e[40]=v):v=e[40],v}function Po(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Oo(t){const e=ns(t.name);if(!e)throw new Error("Organization slug is invalid");const s=await Se.organization.create({name:t.name,slug:e});if(s?.error)throw new Error(s.error.message||"Failed to create organization");const o=s?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function rt(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function zo(t){const e=C.c(13),{org:s,size:o}=t,r=o===void 0?"sm":o,i=r==="xs"?"size-5":"size-6",l=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=J(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:rt(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?n.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:J("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=n.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 Be(t){const e=C.c(22),{item:s,onClose:o}=t;if(s.href){const c=s.external?"_blank":void 0,u=s.external?"noopener noreferrer":void 0;let d;e[0]!==s.icon?(d=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[0]=s.icon,e[1]=d):d=e[1];let m;e[2]!==s.label?(m=n.jsx("span",{className:"flex-1",children:s.label}),e[2]=s.label,e[3]=m):m=e[3];let x;return e[4]!==s.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(x=n.jsxs("a",{href:s.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]=s.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=x):x=e[10],x}let r;e[11]!==s||e[12]!==o?(r=()=>{s.onClick?.(),o()},e[11]=s,e[12]=o,e[13]=r):r=e[13];let i;e[14]!==s.icon?(i=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[14]=s.icon,e[15]=i):i=e[15];let l;e[16]!==s.label?(l=n.jsx("span",{className:"flex-1",children:s.label}),e[16]=s.label,e[17]=l):l=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==l?(a=n.jsxs("button",{type:"button",onClick:r,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:[i,l]}),e[18]=r,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Nt(t){const e=C.c(16),{sortedOrgs:s,orgParam:o,onSelectOrg:r,onCreateOrg:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ke,{size:16}),e[1]=a):a=e[1];let c;e[2]!==i?(c=n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[l,n.jsx("button",{type:"button",onClick:i,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]=i,e[3]=c):c=e[3];let u;if(e[4]!==r||e[5]!==o||e[6]!==s){let x;e[8]!==r||e[9]!==o?(x=f=>n.jsxs("button",{type:"button",onClick:()=>r(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:[n.jsx(zo,{org:f,size:"sm"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:f.name}),n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.slug})]}),f.slug===o&&n.jsx(Ht,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},f.id),e[8]=r,e[9]=o,e[10]=x):x=e[10],u=s.map(x),e[4]=r,e[5]=o,e[6]=s,e[7]=u}else u=e[7];let d;e[11]!==u?(d=n.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=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function kt(t){const e=C.c(142),{user:s,userImage:o,menuItems:r,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x,close:f,isMobile:p}=t;if(p){const G=s?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=n.jsx(pt,{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=s?.name??"User";let Z;e[3]!==ee?(Z=n.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=s?.email;let X;e[5]!==ne?(X=n.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=n.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let ae;e[10]!==s?(ae=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Lo)},e[10]=s,e[11]=ae):ae=e[11];let Ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ne=n.jsx(gt,{size:14}),e[12]=Ne):Ne=e[12];let ce;e[13]!==ae?(ce=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:ae,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ne})}),e[13]=ae,e[14]=ce):ce=e[14];let ye;e[15]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ye):ye=e[15];let _e;e[16]!==ce?(_e=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[ce,ye]})}),e[16]=ce,e[17]=_e):_e=e[17];let re;e[18]!==_e||e[19]!==Y||e[20]!==oe?(re=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,_e]}),e[18]=_e,e[19]=Y,e[20]=oe,e[21]=re):re=e[21];let de;e[22]!==x||e[23]!==m||e[24]!==d||e[25]!==u?(de=n.jsx("div",{className:"border-b border-border pb-2",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[22]=x,e[23]=m,e[24]=d,e[25]=u,e[26]=de):de=e[26];let ue;if(e[27]!==f||e[28]!==r){let be;e[30]!==f?(be=Ge=>n.jsx(Be,{item:Ge,onClose:f},Ge.key),e[30]=f,e[31]=be):be=e[31],ue=r.map(be),e[27]=f,e[28]=r,e[29]=ue}else ue=e[29];let me;e[32]!==f||e[33]!==i?(me=n.jsx(Be,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=me):me=e[34];let fe;e[35]!==ue||e[36]!==me?(fe=n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ue,me]}),e[35]=ue,e[36]=me,e[37]=fe):fe=e[37];let xe;e[38]!==de||e[39]!==fe?(xe=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[de,fe]}),e[38]=de,e[39]=fe,e[40]=xe):xe=e[40];let E;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let be;e[45]!==a.theme||e[46]!==c?(be=Ge=>{const{value:Ze,icon:bs,label:js}=Ge;return n.jsx("button",{type:"button","aria-label":js,onClick:()=>c(vs=>({...vs,theme:Ze})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ze?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:bs},Ze)},e[45]=a.theme,e[46]=c,e[47]=be):be=e[47],E=l.map(be),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=E}else E=e[44];let ke;e[48]!==E?(ke=n.jsx("div",{className:"flex items-center gap-0.5",children:E}),e[48]=E,e[49]=ke):ke=e[49];const Xe=a.enableSounds?"Disable sounds":"Enable sounds";let we;e[50]!==c?(we=()=>c(Do),e[50]=c,e[51]=we):we=e[51];const Je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ie;e[52]!==Je?(Ie=J("size-8 rounded-md flex items-center justify-center transition-colors",Je),e[52]=Je,e[53]=Ie):Ie=e[53];let Me;e[54]!==a.enableSounds?(Me=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[54]=a.enableSounds,e[55]=Me):Me=e[55];let $e;e[56]!==Xe||e[57]!==we||e[58]!==Ie||e[59]!==Me?($e=n.jsx("button",{type:"button","aria-label":Xe,onClick:we,className:Ie,children:Me}),e[56]=Xe,e[57]=we,e[58]=Ie,e[59]=Me,e[60]=$e):$e=e[60];let Fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.294.0"]}),e[61]=Fe):Fe=e[61];let Te;e[62]!==$e?(Te=n.jsxs("div",{className:"flex items-center gap-2",children:[$e,Fe]}),e[62]=$e,e[63]=Te):Te=e[63];let Ae;e[64]!==ke||e[65]!==Te?(Ae=n.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ke,Te]}),e[64]=ke,e[65]=Te,e[66]=Ae):Ae=e[66];let Ue;return e[67]!==re||e[68]!==xe||e[69]!==Ae?(Ue=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[re,xe,Ae]}),e[67]=re,e[68]=xe,e[69]=Ae,e[70]=Ue):Ue=e[70],Ue}const j=s?.name??"U";let I;e[71]!==j||e[72]!==o?(I=n.jsx(pt,{url:o,fallback:j,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=j,e[72]=o,e[73]=I):I=e[73];const g=s?.name??"User";let k;e[74]!==g?(k=n.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=k):k=e[75];const h=s?.email;let S;e[76]!==h?(S=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=S):S=e[77];let y;e[78]!==k||e[79]!==S?(y=n.jsxs("div",{className:"flex-1 min-w-0",children:[k,S]}),e[78]=k,e[79]=S,e[80]=y):y=e[80];let v;e[81]!==s?(v=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Eo)},e[81]=s,e[82]=v):v=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(gt,{size:14}),e[83]=_):_=e[83];let M;e[84]!==v?(M=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=v,e[85]=M):M=e[85];let D;e[86]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=D):D=e[86];let w;e[87]!==M?(w=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[M,D]})}),e[87]=M,e[88]=w):w=e[88];let $;e[89]!==w||e[90]!==I||e[91]!==y?($=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[I,y,w]}),e[89]=w,e[90]=I,e[91]=y,e[92]=$):$=e[92];let O;if(e[93]!==f||e[94]!==r){let G;e[96]!==f?(G=Y=>n.jsx(Be,{item:Y,onClose:f},Y.key),e[96]=f,e[97]=G):G=e[97],O=r.map(G),e[93]=f,e[94]=r,e[95]=O}else O=e[95];let T;e[98]!==f||e[99]!==i?(T=n.jsx(Be,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=T):T=e[100];let A;e[101]!==O||e[102]!==T?(A=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[O,T]}),e[101]=O,e[102]=T,e[103]=A):A=e[103];let P;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return n.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],P=l.map(G),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=P}else P=e[107];let z;e[111]!==P?(z=n.jsx("div",{className:"flex items-center gap-0.5",children:P}),e[111]=P,e[112]=z):z=e[112];const L=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ro),e[113]=c,e[114]=R):R=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 F;e[117]!==a.enableSounds?(F=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[117]=a.enableSounds,e[118]=F):F=e[118];let H;e[119]!==L||e[120]!==R||e[121]!==U||e[122]!==F?(H=n.jsx("button",{type:"button","aria-label":L,onClick:R,className:U,children:F}),e[119]=L,e[120]=R,e[121]=U,e[122]=F,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.294.0"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=n.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==z||e[128]!==q?(Q=n.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,q]}),e[127]=z,e[128]=q,e[129]=Q):Q=e[129];let N;e[130]!==$||e[131]!==A||e[132]!==Q?(N=n.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[$,A,Q]}),e[130]=$,e[131]=A,e[132]=Q,e[133]=N):N=e[133];let K;e[134]!==x||e[135]!==m||e[136]!==d||e[137]!==u?(K=n.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:n.jsx(Nt,{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]!==N||e[140]!==K?(W=n.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[N,K]}),e[139]=N,e[140]=K,e[141]=W):W=e[141],W}function Ro(t){return{...t,enableSounds:!t.enableSounds}}function Eo(){je.success("User ID copied")}function Do(t){return{...t,enableSounds:!t.enableSounds}}function Lo(){je.success("User ID copied")}function os(){const t=C.c(50),{data:e}=Se.useSession(),{data:s}=Se.useListOrganizations(),o=ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const l=$s(r)?.params.org,[a,c]=Tt(),u=Bt(),[d,m]=b.useState(!1),[x,f]=b.useState(!1),p=e?.user,j=p?.image;let I;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==l||t[5]!==s||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==j){const h=s?.find(W=>W.slug===l);let S;if(t[11]!==l||t[12]!==s){let W;t[14]!==l?(W=(G,Y)=>G.slug===l?-1:Y.slug===l?1:G.name.localeCompare(Y.name),t[14]=l,t[15]=W):W=t[15],S=[...s??[]].sort(W),t[11]=l,t[12]=s,t[13]=S}else S=t[13];const y=S;let v;t[16]!==o?(v=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=v):v=t[17];const _=v;let M;t[18]===Symbol.for("react.memo_cache_sentinel")?(M=()=>m(!1),t[18]=M):M=t[18];const D=M;let w;t[19]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Ye,{size:16}),t[19]=w):w=t[19];let $;t[20]!==o||t[21]!==l?($={key:"preferences",label:"Preferences",icon:w,onClick:()=>{o({to:"/$org/settings/profile",params:{org:l??""}})}},t[20]=o,t[21]=l,t[22]=$):$=t[22];let O;t[23]===Symbol.for("react.memo_cache_sentinel")?(O={key:"terms",label:"Terms of Use",icon:n.jsx(tn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=O):O=t[23];let T;t[24]===Symbol.for("react.memo_cache_sentinel")?(T={key:"privacy",label:"Privacy Policy",icon:n.jsx(yn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=T):T=t[24];let A;t[25]===Symbol.for("react.memo_cache_sentinel")?(A={key:"github",label:"decocms/studio",icon:n.jsx(Ts,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=A):A=t[25];let P;t[26]===Symbol.for("react.memo_cache_sentinel")?(P={key:"community",label:"Community",icon:n.jsx(Vt,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=P):P=t[26];let z;t[27]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:n.jsx(fn,{size:16}),href:"https://decocms.com",external:!0},t[27]=z):z=t[27];let L;t[28]!==$?(L=[$,O,T,A,P,z],t[28]=$,t[29]=L):L=t[29];const R=L;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:n.jsx(pn,{size:16}),onClick:Uo},t[30]=B):B=t[30];const U=B;let F;t[31]===Symbol.for("react.memo_cache_sentinel")?(F={value:"light",icon:n.jsx(bn,{size:14}),label:"Light theme"},t[31]=F):F=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:n.jsx(jn,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[F,H,{value:"system",icon:n.jsx(vn,{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 N;t[35]!==_||t[36]!==u||t[37]!==R||t[38]!==l||t[39]!==a||t[40]!==c||t[41]!==y||t[42]!==p||t[43]!==j?(N={user:p,userImage:j,menuItems:R,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:y,orgParam:l,onSelectOrg:_,onCreateOrg:Q,close:D,isMobile:u},t[35]=_,t[36]=u,t[37]=R,t[38]=l,t[39]=a,t[40]=c,t[41]=y,t[42]=p,t[43]=j,t[44]=N):N=t[44];const K=N;I=u?n.jsxs(Ft,{open:d,onOpenChange:m,direction:"bottom",children:[n.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:[n.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:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),n.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),n.jsxs(Ut,{className:"h-[80dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Account"}),n.jsx(kt,{...K})]})]}):n.jsxs(lt,{open:d,onOpenChange:m,children:[n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:h?.name??"Account",className:"rounded-md",children:n.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:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),n.jsx(ct,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Fo,children:n.jsx(kt,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=l,t[5]=s,t[6]=a,t[7]=c,t[8]=p,t[9]=j,t[10]=I}else I=t[10];let g;t[45]!==x?(g=n.jsx(Ao,{open:x,onOpenChange:f}),t[45]=x,t[46]=g):g=t[46];let k;return t[47]!==I||t[48]!==g?(k=n.jsxs(n.Fragment,{children:[I,g]}),t[47]=I,t[48]=g,t[49]=k):k=t[49],k}function Fo(t){return t.preventDefault()}function Uo(){se("signed_out",{source:"account_popover"}),Se.signOut()}function Go({invitation:t}){const[e,s]=b.useState(!1),[o,r]=b.useState(!1),i=Re(),l=async()=>{s(!0);try{const c=await Se.organization.acceptInvitation({invitationId:t.id});if(c.error)je.error(c.error.message),s(!1);else{const u=await Se.organization.setActive({organizationId:t.organizationId});je.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{je.error("Failed to accept invitation"),s(!1)}},a=async()=>{r(!0);try{const c=await Se.organization.rejectInvitation({invitationId:t.id});c.error?(je.error(c.error.message),r(!1)):(je.success("Invitation declined"),i.invalidateQueries())}catch{je.error("Failed to decline invitation"),r(!1)}};return n.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:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),n.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||o,"aria-label":"Accept invitation",children:n.jsx(Ht,{size:14})}),n.jsx(et,{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:n.jsx(Dn,{size:14})})]})]})}function Bo(){const t=b.useContext(As),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Ho extends b.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function Vo(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ko(){const t=C.c(19),e=ve(),{org:s}=pe();let o;t[0]!==s.id?(o={connectionId:Kt,orgId:s.id},t[0]=s.id,t[1]=o):o=t[1];const r=Wt(o);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[2]=i):i=t[2];let l;t[3]!==r?(l={client:r,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:Wo},t[3]=r,t[4]=l):l=t[4];const{data:a,isPending:c,isError:u}=Un(l),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[5]!==d||t[6]!==u||t[7]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[5]=d,t[6]=u,t[7]=c,t[8]=m):m=t[8];const x=m;let f;t[9]!==d?(f=J(d!=null&&Vo(d)),t[9]=d,t[10]=f):f=t[10];let p;t[11]!==e||t[12]!==s.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[11]=e,t[12]=s.slug,t[13]=p):p=t[13];let j;t[14]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(sn,{size:24}),t[14]=j):j=t[14];let I;return t[15]!==f||t[16]!==p||t[17]!==x?(I=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:x,className:f,onClick:p,children:j})})}),t[15]=f,t[16]=p,t[17]=x,t[18]=I):I=t[18],I}function Wo(t){return t.structuredContent}function qo(){const t=C.c(1);if(!Gn().some(Qo))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ko,{}),t[0]=o):o=t[0],o}function Qo(t){return t.providerId==="deco"}function Yo(){const t=C.c(3),[e,s]=b.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),s(!0)},children:n.jsx(hn,{size:24})})})}),t[0]=o):o=t[0];let r;return t[1]!==e?(r=n.jsxs(n.Fragment,{children:[o,n.jsx(Bn,{mode:"browse",open:e,onOpenChange:s,defaultTab:"all"})]}),t[1]=e,t[2]=r):r=t[2],r}function Xo(){const t=C.c(11),e=Bo();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(xt,{size:24}),t[0]=s):s=t[0];let o;t[1]!==e.length?(o=e.length>0&&n.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 r;t[3]!==o?(r=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsxs(he,{tooltip:"Inbox",className:"relative",children:[s,o]})})})}),t[3]=o,t[4]=r):r=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:n.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[5]=i):i=t[5];let l;t[6]!==e?(l=n.jsxs(ct,{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:[i,e.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[n.jsx(xt,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):n.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Jo)})]}),t[6]=e,t[7]=l):l=t[7];let a;return t[8]!==r||t[9]!==l?(a=n.jsxs(lt,{children:[r,l]}),t[8]=r,t[9]=l,t[10]=a):a=t[10],a}function Jo(t){return n.jsx(Go,{invitation:t},t.id)}function Zo(){const t=C.c(6),e=ve(),{org:s}=pe();let o;t[0]!==e||t[1]!==s.slug?(o=()=>e({to:"/$org/settings",params:{org:s.slug}}),t[0]=e,t[1]=s.slug,t[2]=o):o=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ye,{size:24}),t[3]=r):r=t[3];let i;return t[4]!==o?(i=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:o,children:r})})}),t[4]=o,t[5]=i):i=t[5],i}function er(){const t=C.c(5);let e,s,o,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ho,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(qo,{})})}),s=n.jsx(Yo,{}),o=n.jsx(Xo,{}),r=n.jsx(Zo,{}),t[0]=e,t[1]=s,t[2]=o,t[3]=r):(e=t[0],s=t[1],o=t[2],r=t[3]);let i;return t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs(Et,{className:"px-2 pb-3 gap-1",children:[e,s,o,r,n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(os,{})})})]}),t[4]=i):i=t[4],i}function tr(){const t=C.c(10),e=ve(),{org:s}=pe(),{setOpenMobile:o}=Qe();let r;t[0]!==e||t[1]!==s.slug||t[2]!==o?(r=()=>{e({to:"/$org/settings",params:{org:s.slug}}),o(!1)},t[0]=e,t[1]=s.slug,t[2]=o,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ye,{}),t[4]=i):i=t[4];let l;t[5]!==r?(l=n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:r,children:i})}),t[5]=r,t[6]=l):l=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ie,{children:n.jsx(os,{})}),t[7]=a):a=t[7];let c;return t[8]!==l?(c=n.jsx(Et,{children:n.jsxs(ge,{children:[l,a]})}),t[8]=l,t[9]=c):c=t[9],c}var dt="ContextMenu",[sr]=Us(dt,[At]),te=At(),[nr,rs]=sr(dt),is=t=>{const{__scopeContextMenu:e,children:s,onOpenChange:o,dir:r,modal:i=!0}=t,[l,a]=b.useState(!1),c=te(e),u=Ps(o),d=b.useCallback(m=>{a(m),u(m)},[u]);return n.jsx(nr,{scope:e,open:l,onOpenChange:d,modal:i,children:n.jsx(Os,{...c,dir:r,open:l,onOpenChange:d,modal:i,children:s})})};is.displayName=dt;var ls="ContextMenuTrigger",as=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,disabled:o=!1,...r}=t,i=rs(ls,s),l=te(s),a=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=b.useRef(0),d=b.useCallback(()=>window.clearTimeout(u.current),[]),m=x=>{a.current={x:x.clientX,y:x.clientY},i.onOpenChange(!0)};return b.useEffect(()=>d,[d]),b.useEffect(()=>{o&&d()},[o,d]),n.jsxs(n.Fragment,{children:[n.jsx(zs,{...l,virtualRef:c}),n.jsx(Rs.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...r,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,He(x=>{d(),u.current=window.setTimeout(()=>m(x),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,He(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,He(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,He(d))})]})});as.displayName=ls;var or="ContextMenuPortal",cs=t=>{const{__scopeContextMenu:e,...s}=t,o=te(e);return n.jsx(Es,{...o,...s})};cs.displayName=or;var ds="ContextMenuContent",us=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=rs(ds,s),i=te(s),l=b.useRef(!1);return n.jsx(Ds,{...i,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&l.current&&a.preventDefault(),l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!r.modal&&(l.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)"}})});us.displayName=ds;var rr="ContextMenuGroup",ir=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Gs,{...r,...o,ref:e})});ir.displayName=rr;var lr="ContextMenuLabel",ar=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Bs,{...r,...o,ref:e})});ar.displayName=lr;var cr="ContextMenuItem",ms=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ls,{...r,...o,ref:e})});ms.displayName=cr;var dr="ContextMenuCheckboxItem",ur=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Hs,{...r,...o,ref:e})});ur.displayName=dr;var mr="ContextMenuRadioGroup",fr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Vs,{...r,...o,ref:e})});fr.displayName=mr;var xr="ContextMenuRadioItem",pr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ks,{...r,...o,ref:e})});pr.displayName=xr;var hr="ContextMenuItemIndicator",gr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ws,{...r,...o,ref:e})});gr.displayName=hr;var br="ContextMenuSeparator",fs=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Fs,{...r,...o,ref:e})});fs.displayName=br;var jr="ContextMenuArrow",vr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(qs,{...r,...o,ref:e})});vr.displayName=jr;var yr="ContextMenuSubTrigger",_r=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Qs,{...r,...o,ref:e})});_r.displayName=yr;var Sr="ContextMenuSubContent",Cr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ys,{...r,...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)"}})});Cr.displayName=Sr;function He(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Nr=is,kr=as,wr=cs,Ir=us,Mr=ms,$r=fs;function Tr(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(Nr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=o):o=e[3],o}function Ar(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(kr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=o):o=e[3],o}function Pr(t){const e=C.c(8);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]);let r;e[3]!==s?(r=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",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx(wr,{children:n.jsx(Ir,{"data-slot":"context-menu-content",className:r,...o})}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function wt(t){const e=C.c(12);let s,o,r,i;e[0]!==t?({className:s,inset:o,variant:i,...r}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=r,e[4]=i):(s=e[1],o=e[2],r=e[3],i=e[4]);const l=i===void 0?"default":i;let a;e[5]!==s?(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",s),e[5]=s,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==r||e[9]!==a||e[10]!==l?(c=n.jsx(Mr,{"data-slot":"context-menu-item","data-inset":o,"data-variant":l,className:a,...r}),e[7]=o,e[8]=r,e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function Or(t){const e=C.c(8);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]);let r;e[3]!==s?(r=J("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx($r,{"data-slot":"context-menu-separator",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function zr(t){const e=ve(),s=Re(),o=Xt(),{locator:r}=pe(),i=We({strict:!1}),l=qe({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===l.virtualmcpid?Lt(s,r,i.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 Rr({agent:t,org:e,onUnpin:s,isDragging:o}){const r=ve(),{isMobile:i,setOpenMobile:l}=Qe(),a=Hn(e),u=It({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=b.useState(null),x=b.useRef(null),f=b.useRef(null),p=b.useRef(!1);p.current=!!o,o&&(d||f.current)&&(f.current&&(clearTimeout(f.current),f.current=null),d&&m(null));const j=h=>{if(p.current)return;const S=h.currentTarget.getBoundingClientRect();f.current=setTimeout(()=>{p.current||m(S)},550)},I=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,k=d?d.width+g:0;return n.jsx(Tr,{children:n.jsxs(ie,{className:J(d&&"z-[55]"),children:[n.jsx(Ar,{asChild:!0,children:n.jsx(he,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{i&&l(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:j,onMouseLeave:I,children:n.jsx(Pe,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),n.jsxs(Pr,{children:[n.jsxs(wt,{onClick:()=>{const h=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[n.jsx(Ye,{size:14}),"Settings"]}),n.jsx(Or,{}),n.jsxs(wt,{onClick:()=>{s(),u&&r({to:"/$org",params:{org:e}})},className:"",children:[n.jsx(jt,{size:14}),"Unpin"]})]}),d&&Ee.createPortal(n.jsx("button",{ref:x,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),s(),r({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:k,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:n.jsx(jt,{size:14})}),document.body)]})})}function Er(t){const e=C.c(18);let s;e[0]!==t.agent.id?(s={id:t.agent.id},e[0]=t.agent.id,e[1]=s):s=e[1];const{attributes:o,listeners:r,setNodeRef:i,transform:l,transition:a,isDragging:c}=oo(s);let u;e[2]!==l?(u=ro.Transform.toString(l?{...l,x:0}:null),e[2]=l,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=n.jsx(Rr,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let j;return e[12]!==o||e[13]!==r||e[14]!==i||e[15]!==f||e[16]!==p?(j=n.jsx("div",{ref:i,style:f,...o,...r,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=r,e[14]=i,e[15]=f,e[16]=p,e[17]=j):j=e[17],j}function Dr(t){const e=C.c(9),{agent:s,onClick:o}=t;let r;e[0]!==s.icon||e[1]!==s.title?(r=n.jsx(Pe,{icon:s.icon,name:s.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=s.icon,e[1]=s.title,e[2]=r):r=e[2];let i;e[3]!==s.title?(i=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:s.title}),e[3]=s.title,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==r||e[7]!==i?(l=n.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:[r,i]}),e[5]=o,e[6]=r,e[7]=i,e[8]=l):l=e[8],l}function Lr(t){const e=C.c(80),{onClose:s,onOpenImportDeco:o,onOpenGithubImport:r,onOpenSelfHealing:i,onOpenDiagnosticsModal:l,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,x]=b.useState(""),f=qt(),{org:p}=pe();let j;e[0]!==f?(j=f.filter(Wr).map(Kr),e[0]=f,e[1]=j):j=e[1];const I=j,{pin:g,isPinned:k}=Yt(p.id,I);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:S,isCreating:y}=ao(h),[v]=Tt(),_=zr(p.slug),M=lo();let D,w,$,O,T,A,P,z;if(e[3]!==f||e[4]!==S||e[5]!==y||e[6]!==k||e[7]!==M||e[8]!==_||e[9]!==s||e[10]!==u||e[11]!==d||e[12]!==l||e[13]!==r||e[14]!==o||e[15]!==a||e[16]!==i||e[17]!==c||e[18]!==g||e[19]!==v.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();z=f.filter(Vr).filter(E=>!m||E.title.toLowerCase().includes(V));let q;e[29]!==f?(q=f.some(Hr),e[29]=f,e[30]=q):q=e[30];const Q=q;D=ze.filter(E=>(!m||E.title.toLowerCase().includes(V))&&!(E.id==="studio-pack"&&Q)&&!(E.id==="self-healing-storefront"&&!v.experimental_vibecode));let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=ze.find(Br),e[31]=N):N=e[31];const K=N,W=K?f.find(E=>E.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Gr),e[32]=G):G=e[32];const Y=G,ee=Y?f.find(E=>E.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Ur),e[33]=Z):Z=e[33];const ne=Z,X=ne?f.find(E=>E.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(Fr),e[34]=oe):oe=e[34];const ae=oe,Ne=ae?f.find(E=>E.metadata?.type===ae.id):void 0;let ce;e[35]!==k||e[36]!==_||e[37]!==s||e[38]!==g?(ce=E=>{k(E.id)||g(E.id),s(),x(""),_(E.id)},e[35]=k,e[36]=_,e[37]=s,e[38]=g,e[39]=ce):ce=e[39];const ye=ce,_e=E=>{s(),x(""),E==="self-healing-storefront"?i():E==="site-editor"?o():E==="site-diagnostics"?W?M(W.id):l():E==="lean-canvas"?ee?M(ee.id):a():E==="ai-image"?X?M(X.id):u():E==="ai-research"?Ne?M(Ne.id):d():E==="studio-pack"?c():_(E)};A="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(P=n.jsx(io,{value:m,onChange:x,placeholder:"Search agents..."}),e[40]=m,e[41]=P):P=e[41],w="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx("div",{className:"px-1 pt-3 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[42]=$):$=e[42];let re;e[43]!==S||e[44]!==s?(re=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await S(),s()},e[43]=S,e[44]=s,e[45]=re):re=e[45];let de,ue;e[46]===Symbol.for("react.memo_cache_sentinel")?(de=n.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:n.jsx(Ke,{size:16,className:"text-muted-foreground"})}),ue=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=de,e[47]=ue):(de=e[46],ue=e[47]);let me;e[48]!==y||e[49]!==re?(me=n.jsxs("button",{type:"button",disabled:y,onClick:re,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:[de,ue]}),e[48]=y,e[49]=re,e[50]=me):me=e[50];let fe;e[51]!==s||e[52]!==r||e[53]!==v.experimental_vibecode?(fe=v.experimental_vibecode&&n.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),r(),s()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[n.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:n.jsx(po,{className:"size-5 text-muted-foreground"})}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=s,e[52]=r,e[53]=v.experimental_vibecode,e[54]=fe):fe=e[54];let xe;e[55]!==ye?(xe=E=>n.jsx(Dr,{agent:E,onClick:()=>ye(E)},E.id),e[55]=ye,e[56]=xe):xe=e[56],O=n.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[me,fe,z.map(xe)]}),T=D.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-1 pt-4 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),n.jsx("div",{className:"grid grid-cols-3 gap-1",children:D.map(E=>n.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:E.id,template_title:E.title}),_e(E.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:[n.jsx(Pe,{icon:E.icon,name:E.title,size:"md",className:"transition-transform group-hover:scale-105"}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:E.title})]},E.id))})]}),e[3]=f,e[4]=S,e[5]=y,e[6]=k,e[7]=M,e[8]=_,e[9]=s,e[10]=u,e[11]=d,e[12]=l,e[13]=r,e[14]=o,e[15]=a,e[16]=i,e[17]=c,e[18]=g,e[19]=v.experimental_vibecode,e[20]=m,e[21]=D,e[22]=w,e[23]=$,e[24]=O,e[25]=T,e[26]=A,e[27]=P,e[28]=z}else D=e[21],w=e[22],$=e[23],O=e[24],T=e[25],A=e[26],P=e[27],z=e[28];let L;e[57]!==D||e[58]!==y||e[59]!==m||e[60]!==z.length?(L=z.length===0&&D.length===0&&!y&&n.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]=D,e[58]=y,e[59]=m,e[60]=z.length,e[61]=L):L=e[61];let R;e[62]!==w||e[63]!==$||e[64]!==O||e[65]!==T||e[66]!==L?(R=n.jsxs("div",{className:w,children:[$,O,T,L]}),e[62]=w,e[63]=$,e[64]=O,e[65]=T,e[66]=L,e[67]=R):R=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]!==s?(U=()=>s(),e[70]=s,e[71]=U):U=e[71];let F;e[72]!==B||e[73]!==U?(F=n.jsx("div",{className:"border-t border-border px-3 py-2.5",children:n.jsx(Xs,{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]=F):F=e[74];let H;return e[75]!==R||e[76]!==F||e[77]!==A||e[78]!==P?(H=n.jsxs("div",{className:A,children:[P,R,F]}),e[75]=R,e[76]=F,e[77]=A,e[78]=P,e[79]=H):H=e[79],H}function Fr(t){return t.id==="ai-research"}function Ur(t){return t.id==="ai-image"}function Gr(t){return t.id==="lean-canvas"}function Br(t){return t.id==="site-diagnostics"}function Hr(t){return Fn(t.id)}function Vr(t){return!Ln(t.id)}function Kr(t){return t.id}function Wr(t){return t.pinned}function qr(){const t=C.c(36),[e,s]=b.useState(!1),[o,r]=b.useState(!1),[i,l]=b.useState(!1),[a,c]=b.useState(!1),[u,d]=b.useState(!1),[m,x]=b.useState(!1),[f,p]=b.useState(!1),[j,I]=b.useState(!1),[g,k]=b.useState(!1),h=Bt(),{setOpenMobile:S}=Qe();let y;t[0]!==h||t[1]!==S?(y=()=>{s(!1),h&&S(!1)},t[0]=h,t[1]=S,t[2]=y):y=t[2];const v=y;let _;t[3]!==v||t[4]!==e?(_=e&&n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Ve,{className:"h-4 w-24"})}),children:n.jsx(Lr,{onClose:v,onOpenImportDeco:()=>r(!0),onOpenGithubImport:()=>{l(!0),v()},onOpenSelfHealing:()=>{c(!0),v()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>x(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>I(!0),onOpenAiResearchModal:()=>k(!0)})}),t[3]=v,t[4]=e,t[5]=_):_=t[5];const M=_;let D;t[6]!==h||t[7]!==e||t[8]!==M?(D=h?n.jsxs(n.Fragment,{children:[n.jsx(ie,{children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},children:n.jsx(Ke,{className:"!opacity-100"})})}),n.jsx(Ft,{open:e,onOpenChange:s,direction:"bottom",children:n.jsxs(Ut,{className:"max-h-[85dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Browse agents"}),M]})})]}):n.jsxs(lt,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),s(B)},children:[n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:n.jsx(Ke,{className:"!opacity-100"})})})}),n.jsx(ct,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:M})]}),t[6]=h,t[7]=e,t[8]=M,t[9]=D):D=t[9];let w;t[10]!==o?(w=n.jsx(co,{open:o,onOpenChange:r}),t[10]=o,t[11]=w):w=t[11];let $;t[12]!==i?($=n.jsx(uo,{open:i,onOpenChange:l}),t[12]=i,t[13]=$):$=t[13];let O;t[14]!==a?(O=n.jsx(Vn,{open:a,onOpenChange:c}),t[14]=a,t[15]=O):O=t[15];let T;t[16]!==u?(T=n.jsx(mo,{open:u,onOpenChange:d}),t[16]=u,t[17]=T):T=t[17];let A;t[18]!==m?(A=n.jsx(fo,{open:m,onOpenChange:x}),t[18]=m,t[19]=A):A=t[19];let P;t[20]!==f?(P=n.jsx(xo,{open:f,onOpenChange:p}),t[20]=f,t[21]=P):P=t[21];let z;t[22]!==j?(z=n.jsx(Kn,{open:j,onOpenChange:I}),t[22]=j,t[23]=z):z=t[23];let L;t[24]!==g?(L=n.jsx(Wn,{open:g,onOpenChange:k}),t[24]=g,t[25]=L):L=t[25];let R;return t[26]!==L||t[27]!==D||t[28]!==w||t[29]!==$||t[30]!==O||t[31]!==T||t[32]!==A||t[33]!==P||t[34]!==z?(R=n.jsxs(n.Fragment,{children:[D,w,$,O,T,A,P,z,L]}),t[26]=L,t[27]=D,t[28]=w,t[29]=$,t[30]=O,t[31]=T,t[32]=A,t[33]=P,t[34]=z,t[35]=R):R=t[35],R}function Qr(){const t=C.c(34),e=qt(),{org:s}=pe();let o;t[0]!==e?(o=e.filter(Zr).map(Jr),t[0]=e,t[1]=o):o=t[1];const r=o,{pinnedIds:i,unpin:l,reorder:a}=Yt(s.id,r),c=new Map(e.map(Xr)),u=i.map(R=>c.get(R)).filter(Yr);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:so},t[3]=m):m=t[3];const x=Qn(bt(Xn,d),bt(Yn,m));let f;t[4]!==i||t[5]!==a?(f=R=>{const{active:B,over:U}=R;if(!U||B.id===U.id)return;const F=i.indexOf(B.id),H=i.indexOf(U.id);F===-1||H===-1||a(no([...i],F,H))},t[4]=i,t[5]=a,t[6]=f):f=t[6];const p=f,j=De,I="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const k=Le,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",S=ge,y="gap-2";let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(qr,{}),t[8]=v):v=t[8];const _=eo,M=to,D=Jn,w=Zn;let $;t[9]!==s.slug||t[10]!==l?($=R=>n.jsx(Er,{agent:R,org:s.slug,onUnpin:()=>l(R.id)},R.id),t[9]=s.slug,t[10]=l,t[11]=$):$=t[11];const O=u.map($);let T;t[12]!==D||t[13]!==i||t[14]!==w||t[15]!==O?(T=n.jsx(D,{items:i,strategy:w,children:O}),t[12]=D,t[13]=i,t[14]=w,t[15]=O,t[16]=T):T=t[16];let A;t[17]!==_||t[18]!==p||t[19]!==x||t[20]!==T||t[21]!==M?(A=n.jsx(_,{sensors:x,collisionDetection:M,onDragEnd:p,children:T}),t[17]=_,t[18]=p,t[19]=x,t[20]=T,t[21]=M,t[22]=A):A=t[22];let P;t[23]!==S||t[24]!==A||t[25]!==v?(P=n.jsxs(S,{className:y,children:[v,A]}),t[23]=S,t[24]=A,t[25]=v,t[26]=P):P=t[26];let z;t[27]!==k||t[28]!==P?(z=n.jsx(k,{className:h,children:P}),t[27]=k,t[28]=P,t[29]=z):z=t[29];let L;return t[30]!==j||t[31]!==z||t[32]!==g?(L=n.jsxs(j,{className:I,children:[g,z]}),t[30]=j,t[31]=z,t[32]=g,t[33]=L):L=t[33],L}function Yr(t){return!!t}function Xr(t){return[t.id,t]}function Jr(t){return t.id}function Zr(t){return t.pinned}function xs(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(b.Suspense,{fallback:n.jsx(De,{className:"py-0 px-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-2",children:n.jsx(ie,{children:n.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[n.jsx(Ve,{className:"h-4 w-4 rounded"}),n.jsx(Ve,{className:"h-4 flex-1"})]})})})})}),children:n.jsx(Qr,{})}),t[0]=e):e=t[0],e}function yl(){const t=C.c(4),e=Zt();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(er,{}),t[0]=s):s=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),t[1]=o):o=t[1];let r;return t[2]!==e?(r=n.jsx(ss,{sections:e,footer:s,additionalContent:o}),t[2]=e,t[3]=r):r=t[3],r}function _l(t){const e=C.c(5),{onClose:s}=t,o=Zt();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(tr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx($o,{sections:o,onClose:s,footer:r,additionalContent:i}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function ei(t,e){return t===1?!0:t===0?!1:e}function ti(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",o=t.mainParamPresent?t.mainParamValue!=="0":!s,r=s?!0:t.entityMetadata?.chatDefaultOpen??!1;return{mainOpen:o,chatOpen:r}}function Sl(t,e){return t&&e?{chat:45,main:55}:t&&!e?{chat:100,main:0}:!t&&e?{chat:0,main:100}:{chat:0,main:0}}function si(t,e){return t===1?!0:t===0?!1:e}function Cl(t,e){const s=ve(),o=qe({strict:!1}),r=We({strict:!1}),i=Re(),l=Xt(),{locator:a}=pe(),{virtualMcpId:c,orgSlug:u,isAgentRoute:d}=e,m=ti({entityMetadata:t,mainParamPresent:o.main!==void 0,mainParamValue:o.main}),x=si(o.chat,m.chatOpen),f=m.mainOpen,p=b.useRef(crypto.randomUUID()),j=r.taskId??p.current,I="/$org/$taskId",g=w=>({org:u,taskId:w}),k=d?{virtualmcpid:c}:{},h=(w,$)=>{s({to:I,params:g(j),search:O=>({...O,...w}),replace:$?.replace??!1})},S=(w,$)=>{s({to:I,params:g(w),search:O=>{const T={};return $?T.virtualmcpid=$:d&&(T.virtualmcpid=c),O.tasks&&(T.tasks=O.tasks),T}})},y=()=>{f?h({main:"0"},{replace:!0}):h({main:un(t)},{replace:!0})},v=()=>{h({chat:x?0:1},{replace:!0})},_=()=>{x||h({chat:1},{replace:!0})},M=async()=>{const w=crypto.randomUUID(),$=Lt(i,a,j);try{await l.create.mutateAsync({id:w,virtual_mcp_id:c,...$?{branch:$}:{}})}catch{}s({to:I,params:g(w),search:O=>{const T={...k,chat:1};return O.tasks&&(T.tasks=O.tasks),T}})},D=w=>{h({main:w},{replace:!0})};return{taskId:j,mainOpen:f,chatOpen:x,mainParam:o.main,setTaskId:S,toggleMain:y,toggleChat:v,openChat:_,createNewTask:M,openTab:D}}const ut=b.createContext(null);function Nl(t){const e=C.c(15),{children:s}=t,o=ve();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=qe(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open"},e[1]=l):l=e[1];const{tasks:a}=ot(l);let c;e[2]!==i.tasks||e[3]!==a.length?(c=()=>ei(i.tasks,a.length>0),e[2]=i.tasks,e[3]=a.length,e[4]=c):c=e[4];const[u,d]=b.useState(c);let m,x;e[5]!==o||e[6]!==u?(m=()=>{o({search:(g=>({...g,tasks:u?1:0})),replace:!0})},x=[u,o],e[5]=o,e[6]=u,e[7]=m,e[8]=x):(m=e[7],x=e[8]),b.useEffect(m,x);let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=()=>d(ni),e[9]=f):f=e[9];const p=f;let j;e[10]!==u?(j={tasksOpen:u,toggleTasks:p},e[10]=u,e[11]=j):j=e[11];let I;return e[12]!==s||e[13]!==j?(I=n.jsx(ut.Provider,{value:j,children:s}),e[12]=s,e[13]=j,e[14]=I):I=e[14],I}function ni(t){return!t}function kl(){const t=b.useContext(ut);if(!t)throw new Error("useTasksPanelState must be used inside <TasksPanelStateProvider>");return t}function wl(){return b.useContext(ut)}const ps=b.createContext(null);function Ce(){const t=b.use(ps);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function le(t){const e=C.c(10),{children:s}=t,[o,r]=b.useState(null),[i,l]=b.useState(null),[a,c]=b.useState(null),[u,d]=b.useState(null);let m;e[0]!==a||e[1]!==u||e[2]!==i||e[3]!==o?(m={togglesEl:o,setTogglesEl:r,tabsEl:i,setTabsEl:l,centerEl:a,setCenterEl:c,rightEl:u,setRightEl:d},e[0]=a,e[1]=u,e[2]=i,e[3]=o,e[4]=m):m=e[4];let x;e[5]!==s?(x=n.jsx("div",{className:"flex flex-col h-full min-h-0",children:s}),e[5]=s,e[6]=x):x=e[6];let f;return e[7]!==m||e[8]!==x?(f=n.jsx(ps,{value:m,children:x}),e[7]=m,e[8]=x,e[9]=f):f=e[9],f}function oi(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"shrink-0 grid grid-cols-3 items-center pl-1 pr-2 pt-0.25 h-12",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ri(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ii(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=o):o=e[1],o}function li(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("button",{type:"button",onClick:ci,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:n.jsx(gn,{size:16})}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs(n.Fragment,{children:[e,n.jsx("button",{type:"button",onClick:ai,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:n.jsx(go,{size:16})})]}),t[1]=s):s=t[1],s}function ai(){return window.history.forward()}function ci(){return window.history.back()}function di(){const t=C.c(2),{setCenterEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function ui(t){const e=C.c(3),{children:s}=t,{centerEl:o}=Ce();if(!o)return null;let r;return e[0]!==o||e[1]!==s?(r=Ee.createPortal(s,o),e[0]=o,e[1]=s,e[2]=r):r=e[2],r}function mi(){const t=C.c(2),{setTabsEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"shrink-0 flex items-center overflow-x-auto"}),t[0]=e,t[1]=s):s=t[1],s}function fi(t){const e=C.c(3),{children:s}=t,{tabsEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function xi(){const t=C.c(2),{setTogglesEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center gap-0.5 shrink-0 ml-0.5"}),t[0]=e,t[1]=s):s=t[1],s}function pi(t){const e=C.c(3),{children:s}=t,{togglesEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function hi(){const t=C.c(2),{setRightEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}function gi(t){const e=C.c(3),{children:s}=t,{rightEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}le.Header=oi;le.LeftColumn=ri;le.RightColumn=ii;le.Nav=li;le.CenterSlot=di;le.Center=ui;le.TabsSlot=mi;le.Tabs=fi;le.TogglesSlot=xi;le.Toggles=pi;le.RightSlot=hi;le.Right=gi;function bi(){const t=C.c(6),{org:e,locator:s}=pe(),o=Re();let r;t[0]!==s||t[1]!==o?(r=()=>{o.invalidateQueries({queryKey:Pt.tasksPrefix(s)})},t[0]=s,t[1]=o,t[2]=r):r=t[2];let i;t[3]!==e.id||t[4]!==r?(i={orgId:e.id,onTaskStatus:r},t[3]=e.id,t[4]=r,t[5]=i):i=t[5],jo(i)}function ji(t){const e=C.c(8),{virtualMcpId:s,size:o,showAutomationBadge:r}=t,i=o===void 0?"sm":o;let l;e[0]!==i||e[1]!==s?(l=s?n.jsx(vi,{virtualMcpId:s,size:i}):n.jsx(Pe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;e[3]!==r?(a=r&&n.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:n.jsx(vo,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=n.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function vi(t){const e=C.c(6),{virtualMcpId:s,size:o}=t,r=Qt(s);if(!r){let a;return e[0]!==o?(a=n.jsx(Pe,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const i=r.icon??null;let l;return e[2]!==r.title||e[3]!==o||e[4]!==i?(l=n.jsx(Pe,{icon:i,name:r.title,size:o}),e[2]=r.title,e[3]=o,e[4]=i,e[5]=l):l=e[5],l}function yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function _i(t){const e=C.c(47),{task:s,isActive:o,onClick:r,onArchive:i,showAutomationBadge:l}=t,a=yo(s.status),c=a.icon,u=Qt(s.virtual_mcp_id);let d;e[0]!==u?(d=yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,x=b.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]!==s.id?(p=[o,s.id],e[4]=o,e[5]=s.id,e[6]=p):p=e[6],b.useEffect(f,p);const j="button",I=0;let g;e[7]!==r?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),r())},e[7]=r,e[8]=g):g=e[8];const k=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==k?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors",k),e[9]=k,e[10]=h):h=e[10];let S;e[11]!==l||e[12]!==s.virtual_mcp_id?(S=n.jsx(ji,{virtualMcpId:s.virtual_mcp_id,size:"xs",showAutomationBadge:l}),e[11]=l,e[12]=s.virtual_mcp_id,e[13]=S):S=e[13];const y=s.title||"Untitled task";let v;e[14]!==y?(v=n.jsx("div",{className:"text-sm text-foreground truncate",children:y}),e[14]=y,e[15]=v):v=e[15];let _;e[16]!==m||e[17]!==s.branch||e[18]!==s.updated_at?(_=s.updated_at&&n.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[s.branch?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):m?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:mn(new Date(s.updated_at))})]}),e[16]=m,e[17]=s.branch,e[18]=s.updated_at,e[19]=_):_=e[19];let M;e[20]!==v||e[21]!==_?(M=n.jsxs("div",{className:"flex-1 min-w-0",children:[v,_]}),e[20]=v,e[21]=_,e[22]=M):M=e[22];const D="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",w="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",$=a.label,O=14,T=J(a.iconClassName,s.status==="in_progress"&&"animate-spin");let A;e[23]!==c||e[24]!==T?(A=n.jsx(c,{size:O,className:T}),e[23]=c,e[24]=T,e[25]=A):A=e[25];let P;e[26]!==a||e[27]!==A?(P=n.jsx("span",{className:w,"aria-label":$,children:A}),e[26]=a,e[27]=A,e[28]=P):P=e[28];let z;e[29]!==i?(z=V=>{V.stopPropagation(),i()},e[29]=i,e[30]=z):z=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(nn,{size:14}),e[31]=L):L=e[31];let R;e[32]!==z?(R=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Archive task",onClick:z,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:L})}),e[32]=z,e[33]=R):R=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(st,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==R?(U=n.jsxs(nt,{children:[R,B]}),e[35]=R,e[36]=U):U=e[36];let F;e[37]!==P||e[38]!==U?(F=n.jsxs("div",{className:D,children:[P,U]}),e[37]=P,e[38]=U,e[39]=F):F=e[39];let H;return e[40]!==r||e[41]!==M||e[42]!==F||e[43]!==g||e[44]!==h||e[45]!==S?(H=n.jsxs("div",{ref:x,role:j,tabIndex:I,onClick:r,onKeyDown:g,className:h,children:[S,M,F]}),e[40]=r,e[41]=M,e[42]=F,e[43]=g,e[44]=h,e[45]=S,e[46]=H):H=e[46],H}const hs={all:"All tasks",manual:"Chats",automation:"Automation"},gs={all:"All members",mine:"Mine only"};function Si(t){const e=C.c(59),{title:s,tasks:o,activeTaskId:r,onSelect:i,onArchive:l,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[x,f]=b.useState("all"),[p,j]=b.useState("mine");let I;e[0]!==m||e[1]!==p||e[2]!==o?(I=p==="mine"&&m?o.filter(N=>N.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=I):I=e[3];const g=I;let k;e[4]!==x||e[5]!==g?(k=x==="automation"?g.filter(wi):x==="manual"?g.filter(ki):g,e[4]=x,e[5]=g,e[6]=k):k=e[6];const h=k;let S;e[7]!==s?(S=n.jsx("span",{children:s}),e[7]=s,e[8]=S):S=e[8];let y;e[9]!==p?(y=n.jsx(vt,{asChild:!0,children:n.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"?n.jsx(rn,{size:16}):n.jsx(Vt,{size:16})})}),e[9]=p,e[10]=y):y=e[10];let v;e[11]!==p?(v=N=>{const K=N;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),j(K)},e[11]=p,e[12]=v):v=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=Object.keys(gs),e[13]=_):_=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=_.map(Ni),e[14]=M):M=e[14];let D;e[15]!==p||e[16]!==v?(D=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:p,onValueChange:v,children:M})}),e[15]=p,e[16]=v,e[17]=D):D=e[17];let w;e[18]!==y||e[19]!==D?(w=n.jsxs(St,{children:[y,D]}),e[18]=y,e[19]=D,e[20]=w):w=e[20];const $=x!=="all"&&"text-purple-500";let O;e[21]!==$?(O=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",$),e[21]=$,e[22]=O):O=e[22];let T;e[23]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(xn,{size:16}),e[23]=T):T=e[23];let A;e[24]!==O?(A=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter tasks",className:O,children:T})}),e[24]=O,e[25]=A):A=e[25];let P;e[26]!==x?(P=N=>{const K=N;K!==x&&se("tasks_panel_filter_changed",{to_value:K}),f(K)},e[26]=x,e[27]=P):P=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=Object.keys(hs),e[28]=z):z=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=z.map(Ci),e[29]=L):L=e[29];let R;e[30]!==x||e[31]!==P?(R=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:x,onValueChange:P,children:L})}),e[30]=x,e[31]=P,e[32]=R):R=e[32];let B;e[33]!==A||e[34]!==R?(B=n.jsxs(St,{children:[A,R]}),e[33]=A,e[34]=R,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==s?(U=c&&a&&n.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${s.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:n.jsx(on,{size:16})}),e[36]=a,e[37]=c,e[38]=s,e[39]=U):U=e[39];let F;e[40]!==B||e[41]!==U||e[42]!==w?(F=n.jsxs("div",{className:"flex items-center gap-0.5",children:[w,B,U]}),e[40]=B,e[41]=U,e[42]=w,e[43]=F):F=e[43];let H;e[44]!==F||e[45]!==S?(H=n.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:[S,F]}),e[44]=F,e[45]=S,e[46]=H):H=e[46];let V;e[47]!==r||e[48]!==d||e[49]!==l||e[50]!==i||e[51]!==u||e[52]!==h?(V=h.length===0&&d?n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(N=>n.jsx(_i,{task:N,isActive:r===N.id,onClick:()=>{r!==N.id&&se("tasks_panel_task_clicked",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null,from_automation:!!N.fromAutomation}),i(N)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null}),l(N)},showAutomationBadge:u||N.fromAutomation},N.id)),e[47]=r,e[48]=d,e[49]=l,e[50]=i,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=n.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=n.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 Ci(t){return n.jsx(Jt,{value:t,children:hs[t]},t)}function Ni(t){return n.jsx(Jt,{value:t,children:gs[t]},t)}function ki(t){return!t.fromAutomation}function wi(t){return t.fromAutomation}function Ii(){const t=C.c(22);bi();const{data:e}=Se.useSession(),s=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:r}=ot(o);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={owner:"all",status:"open",hasTrigger:!0},t[1]=i):i=t[1];const{tasks:l}=ot(i),{setTaskId:a,createNewTask:c}=Dt();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=We(u),{locator:m,org:x}=pe(),f=Re();let p;t[3]!==x.id?(p={connectionId:Kt,orgId:x.id},t[3]=x.id,t[4]=p):p=t[4];const j=Wt(p),I=d.taskId??null;let g;t[5]!==l||t[6]!==r?(g=[...r,...l.map($i)].sort(Mi),t[5]=l,t[6]=r,t[7]=g):g=t[7];const k=g;let h;t[8]!==j||t[9]!==m||t[10]!==f?(h=async _=>{try{await ho(j,_.id,{hidden:!0}),f.invalidateQueries({queryKey:Pt.tasksPrefix(m)})}catch(M){const w=M;je.error(`Failed to archive task: ${w.message}`)}},t[8]=j,t[9]=m,t[10]=f,t[11]=h):h=t[11];const S=h;if(k.length===0){let _;return t[12]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("div",{className:"h-full flex items-center justify-center p-4",children:n.jsx(bo,{image:n.jsx(ln,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[12]=_):_=t[12],_}let y;t[13]!==a?(y=_=>a(_.id,_.virtual_mcp_id),t[13]=a,t[14]=y):y=t[14];let v;return t[15]!==I||t[16]!==k||t[17]!==c||t[18]!==s||t[19]!==S||t[20]!==y?(v=n.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:n.jsx(Si,{title:"Tasks",tasks:k,activeTaskId:I,onSelect:y,onArchive:S,onNew:c,showNewButton:!0,currentUserId:s})}),t[15]=I,t[16]=k,t[17]=c,t[18]=s,t[19]=S,t[20]=y,t[21]=v):v=t[21],v}function Mi(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function $i(t){return{...t,fromAutomation:!0}}function Ti(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(Ai)}),t[0]=e):e=t[0],e}function Ai(t,e){return n.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Il(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(qn.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(it,{fallback:e,children:n.jsx(b.Suspense,{fallback:n.jsx(Ti,{}),children:n.jsx(Ii,{})})}),t[1]=s):s=t[1],s}export{yl as S,Il as T,Nl as a,le as b,Sl as c,wl as d,Cl as e,_l as f,yi as g,kl as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as n,j as r,r as d,g as h,O as f,l as u}from"./index-Bn0n2Tn5.js";import{S as j,a as b,b as S}from"./index-BY4tnJ8n.js";import{u as _}from"./tooltip-CkzGOY_H.js";import{u as k,T as y,a as T,b as i,S as g}from"./index-CT5IWILX.js";import{C as v}from"./chat-context-JfnWgmWL.js";import"./X-XvFOaH_0.js";import"./agent-icon-DdfLWWFz.js";import"./AlertCircle-BefAeM6u.js";import"./Tool01-CWU0CUYW.js";import"./XClose-CeINnhme.js";import"./RefreshCcw01-DhQjzDQL.js";import"./ArrowNarrowLeft-ctHZC7IK.js";import"./XCircle-CBqb98Hh.js";import"./ArrowUpRight-Dw5rxpDu.js";import"./ZapSquare-Ri9lH1zf.js";import"./Users03-BNN6AS-n.js";import"./CheckCircle-3lbo4DOp.js";import"./ChevronDown-BMsVDJMd.js";import"./ChevronRight-DNaFnNR_.js";import"./ChevronUp-Ba2YtjVA.js";import"./DotsVertical-q5wudUQb.js";import"./Container-BbxUmzld.js";import"./Star01-Cl5wO8v8.js";import"./Palette-CSbP1WU6.js";import"./SearchMd-tlcXyQa_.js";import"./LinkExternal01-B-rWZEWZ.js";import"./Lock01-Bdpg3Hx_.js";import"./Sun-MpjnKSLA.js";import"./Play-BwE8tx_2.js";import"./Plus-B1zoIOQx.js";import"./Settings02-NVTdZYn8.js";import"./Shield01-Cczh_kLJ.js";import"./Trash01-CGGNK3g-.js";import"./User01-BwcffllD.js";import"./Zap-CDrmsf2C.js";import"./shell-layout-ti4P0o8w.js";import"./dialog-U3vhhaTY.js";import"./required-auth-layout-DPKy79PP.js";import"./use-tasks-Q8L8ocme.js";import"./use-collections-s48OQ83y.js";import"./constants-DWChG_gh.js";import"./use-organization-settings-69gOseUx.js";import"./use-org-sso-B_zJ7IWb.js";import"./pair-Bcvdi-3H.js";import"./index-Ck21eYLb.js";import"./use-copy-CBB3IfKo.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-BQS1EcA_.js";import"./integration-icon-Db7fTukH.js";import"./use-virtual-mcp-BYV6DlKB.js";import"./skeleton-DQqcYIUR.js";import"./popover-9zp4cKfF.js";import"./drawer-CHErHUts.js";import"./avatar-DRNf61dD.js";import"./alert-dialog-BY7wdwxM.js";import"./form-D9KcIdYm.js";import"./label-C-b-mt3k.js";import"./input-C0cHvFsP.js";import"./index-BjIWAww2.js";import"./use-mcp-tools-CODd7jbk.js";import"./use-ai-providers-D8PM532H.js";import"./index-DAG4cu8y.js";import"./switch-Dd-fbXw9.js";import"./use-connection-Q2SEpogi.js";import"./lean-canvas-recruit-modal-Bu0aNy4u.js";import"./use-navigate-to-agent-BIpRywxJ.js";import"./collection-search-3JVNad_3.js";import"./checkbox-CouoIES-.js";import"./extract-connection-data-oVTIsFY5.js";import"./constants-DZTSQSyU.js";import"./collections-BcyYFQx1.js";import"./tabs-Bajmp5LL.js";import"./dropdown-menu-LTGIQdd2.js";import"./select-rt68l1g_.js";import"./toggle-group-CrNuUyQT.js";import"./select-model-CQYug9E9.js";import"./ai-providers-logos-D6a8kmGH.js";import"./settings-section-BIiOcEee.js";import"./card-Dp6Lilh-.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./index-BKYuq1nk.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-P5qNgs6D.js";import"./use-registry-connections-C4iFJ600.js";import"./useInfiniteQuery-BkNuxXHJ.js";import"./infiniteQueryObserver-BuP6-BnP.js";import"./collection-tabs-CavPMc70.js";import"./badge-BJnKVqQg.js";import"./textarea-Ds8u2czk.js";import"./connection-form-helpers-DjWTdW-u.js";import"./use-infinite-scroll-DhiqUieY.js";import"./useSuspenseInfiniteQuery-CMhS0p47.js";import"./collection-search-x3WxKP2U.js";import"./use-create-virtual-mcp-C25QZ7ga.js";import"./empty-state-BFgJp7mt.js";import"./use-decopilot-events-2jo7Z1ub.js";import"./create-sse-subscription-CxkOgzKf.js";import"./task-status-D2ZncahY.js";const N=280;function P(){const t=n.c(2),{tasksOpen:e}=k();if(!e)return null;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={width:`${N}px`},t[0]=o):o=t[0];let m;return t[1]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx("aside",{className:"shrink-0 h-full bg-sidebar pb-1",style:o,children:r.jsx("div",{className:"h-full p-0.5 pt-0.25",children:r.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden card-shadow",children:r.jsx(y,{})})})}),t[1]=m):m=t[1],m}function C(){const t=n.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(d.Suspense,{fallback:null,children:r.jsx(P,{})}),t[0]=e):e=t[0],e}function x(){const t=n.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"flex-1 flex items-center justify-center",children:r.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}function yr(){const t=n.c(7),e=_();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const c=!!h(o).taskId;let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={"--sidebar-width-icon":"3.5rem"},t[1]=s):s=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx(g,{}),t[2]=l):l=t[2];let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p={background:"transparent",containerType:"inline-size"},t[3]=p):p=t[3];let a;return t[4]!==c||t[5]!==e?(a=r.jsx(j,{defaultOpen:!1,children:r.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:r.jsxs(b,{className:"flex-1 bg-sidebar",style:s,children:[l,r.jsx(S,{className:"flex flex-col",style:p,children:r.jsx(v,{children:r.jsx(T,{children:e?r.jsx(d.Suspense,{fallback:r.jsx(x,{}),children:r.jsx(f,{})}):r.jsxs(i,{children:[r.jsxs(i.Header,{children:[r.jsxs(i.LeftColumn,{children:[r.jsx(i.Nav,{}),r.jsx(i.TogglesSlot,{})]}),r.jsx(i.CenterSlot,{}),r.jsxs(i.RightColumn,{children:[r.jsx(i.TabsSlot,{}),r.jsx(i.RightSlot,{})]})]}),r.jsxs("div",{className:"flex-1 min-h-0 flex flex-row",children:[c&&r.jsx(C,{}),r.jsx(d.Suspense,{fallback:r.jsx(x,{}),children:r.jsx(f,{})})]})]})})})})]})})}),t[4]=c,t[5]=e,t[6]=a):a=t[6],a}export{yr as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{J as It,r as re,s as fe,o as Re,b as xe,z as Mt,a as pe,t as ue,x as U,K as ne,j as s,B as Ie,e as W,w as At,n as bt,c as Pe,l as Ge,E as _t}from"./index-Bn0n2Tn5.js";import{C as Et}from"./collection-display-button-wfEJKL5y.js";import{S as Pt}from"./search-input-Bkbw9XvQ.js";import{P as Te}from"./index-BY4tnJ8n.js";import{C as Rt}from"./collection-table-wrapper-DEzISF1y.js";import{E as Ve}from"./empty-state-BFgJp7mt.js";import{b as zt,h as $t,a as Dt,c as kt,d as Ft,D as Lt}from"./dialog-U3vhhaTY.js";import{a as Ot,F as et,b as tt,c as qt,d as st,f as nt}from"./form-D9KcIdYm.js";import{S as Je,a as He,b as We,c as Ye,d as Ze}from"./select-rt68l1g_.js";import{T as Bt}from"./textarea-Ds8u2czk.js";import{u as jt}from"./use-organization-roles-9gBEeLeI.js";import{u as Kt}from"./use-members-CYdKPSkq.js";import{S as ze,u as $e}from"./constants-DWChG_gh.js";import{a as Vt,b as Qt,c as Ut,T as Gt}from"./tooltip-CkzGOY_H.js";import{a as it,e as at,g as lt,b as ot,c as rt,d as ct,f as mt,A as dt}from"./alert-dialog-BY7wdwxM.js";import{A as Oe}from"./avatar-DRNf61dD.js";import{B as Be}from"./badge-BJnKVqQg.js";import{C as ut}from"./card-Dp6Lilh-.js";import{D as vt,a as Ct,b as yt,e as Jt,d as Ht,f as Wt,c as Xe,i as Yt}from"./dropdown-menu-LTGIQdd2.js";import{i as St}from"./DotsVertical-q5wudUQb.js";import{a as Zt}from"./SearchMd-tlcXyQa_.js";import{i as Xt}from"./Shield01-Cczh_kLJ.js";import{s as wt,a as es}from"./XClose-CeINnhme.js";import{s as ts}from"./Trash01-CGGNK3g-.js";import{C as ft}from"./checkbox-CouoIES-.js";import{a as Qe,b as Ue,c as ht,C as ss,e as ns,f as is,d as as}from"./command-_hKyE0nf.js";import{a as ls,b as os,P as rs}from"./popover-9zp4cKfF.js";import{t as cs}from"./ChevronDown-BMsVDJMd.js";import{s as ms}from"./Plus-B1zoIOQx.js";import"./view-mode-toggle-DVYpzTeC.js";import"./X-XvFOaH_0.js";import"./table-UGp85pBs.js";import"./label-C-b-mt3k.js";import"./ChevronUp-Ba2YtjVA.js";import"./User01-BwcffllD.js";import"./ChevronRight-DNaFnNR_.js";import"./index-BMWhZkJH.js";const ds=It().email("Invalid email address");function us(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function fs({trigger:t}){const[e,n]=re.useState(!1),{locator:i}=fe(),r=Re(),{data:a}=xe.useSession(),o=a?.user?.email,{roles:l,isLoading:u}=jt(),f=l.filter(p=>p.role!=="owner"),m=Mt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),S=m.watch("emailsText"),g=m.watch("role"),b=us(S).filter(p=>{const c=ds.safeParse(p).success,x=!o||p!==o.toLowerCase();return c&&x}),T=pe({mutationFn:async({emails:p,role:c})=>{if(!c)throw new Error("Please select a role");const x=await Promise.allSettled(p.map(async E=>{const w=await xe.organization.inviteMember({email:E,role:c});if(w.error)throw new Error(w.error.message);return w.data})),C=x.filter(E=>E.status==="rejected");if(C.length>0)throw new Error(`Failed to invite ${C.length} member${C.length>1?"s":""}`);return x},onSuccess:(p,{emails:c,role:x})=>{ue("member_invited",{count:c.length,role:x}),r.invalidateQueries({queryKey:ne.members(i)}),r.invalidateQueries({queryKey:ne.invitations(i)}),U.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),m.reset({emailsText:"",role:"user"}),n(!1)},onError:(p,{emails:c,role:x})=>{ue("member_invite_failed",{count:c.length,role:x,error:p instanceof Error?p.message:String(p)}),U.error(p instanceof Error?p.message:"Failed to invite members")}}),y=p=>{if(b.length===0){U.error("Please enter at least one valid email address");return}if(!p.role){U.error("Please select a role");return}T.mutate({emails:b,role:p.role})},M=b.length>0&&!!g;return s.jsxs(zt,{open:e,onOpenChange:n,children:[s.jsx($t,{asChild:!0,children:t}),s.jsxs(Dt,{className:"sm:max-w-lg",children:[s.jsx(kt,{children:s.jsx(Ft,{children:"Invite members"})}),s.jsx(Ot,{...m,children:s.jsxs("form",{onSubmit:m.handleSubmit(y),className:"space-y-4",children:[s.jsx(et,{control:m.control,name:"emailsText",render:({field:p})=>s.jsxs(tt,{children:[s.jsx(qt,{children:"Email addresses"}),s.jsx(st,{children:s.jsx(Bt,{...p,disabled:T.isPending,placeholder:`Enter email addresses separated by commas or new lines
|
|
2
|
-
e.g. user1@example.com, user2@example.com
|
|
3
|
-
or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(nt,{})]})}),s.jsx(et,{control:m.control,name:"role",render:({field:p})=>s.jsxs(tt,{children:[s.jsx(st,{children:s.jsxs(Je,{value:p.value,onValueChange:p.onChange,disabled:T.isPending||u,children:[s.jsx(He,{className:"w-full",children:s.jsx(We,{placeholder:"Select a role"})}),s.jsx(Ye,{children:f.map(c=>{const x=[];return c.isBuiltin||(c.allowsAllStaticPermissions?x.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&x.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?x.push("All connections"):c.connectionCount&&c.connectionCount>0&&x.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?x.push("all tools"):c.toolCount&&c.toolCount>0&&x.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsx(Ze,{value:c.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&x.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:x.join(", ")})]})},c.role)})})]})}),s.jsx(nt,{})]})}),s.jsxs(Lt,{children:[s.jsx(Ie,{variant:"outline",onClick:()=>{m.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:T.isPending,children:"Cancel"}),s.jsx(Ie,{type:"submit",disabled:T.isPending||!M,children:T.isPending?"Inviting...":`Invite ${b.length||0} Member${b.length!==1?"s":""}`})]})]})})]})]})}function hs(){const t=W.c(9),{org:e,locator:n}=fe();let i;t[0]!==e.id?(i={connectionId:ze,orgId:e.id},t[0]=e.id,t[1]=i):i=t[1];const r=$e(i);let a;t[2]!==n?(a=ne.invitations(n),t[2]=n,t[3]=a):a=t[3];let o;t[4]!==r?(o=async()=>{const u=await r.callTool({name:"ORGANIZATION_GET",arguments:{}});return(u.structuredContent??u)?.invitations??[]},t[4]=r,t[5]=o):o=t[5];let l;return t[6]!==a||t[7]!==o?(l={queryKey:a,queryFn:o},t[6]=a,t[7]=o,t[8]=l):l=t[8],At(l)}function gs(){const t=W.c(5),{locator:e}=fe(),n=Re();let i;t[0]!==e||t[1]!==n?(i={mutationFn:xs,onSuccess:()=>{n.invalidateQueries({queryKey:ne.invitations(e)}),U.success("Invitation cancelled")},onError:ps},t[0]=e,t[1]=n,t[2]=i):i=t[2];const r=pe(i);let a;return t[3]!==r?(a={cancel:r},t[3]=r,t[4]=a):a=t[4],a}function ps(t){U.error(t instanceof Error?t.message:"Failed to cancel invitation")}async function xs(t){const e=await xe.organization.cancelInvitation({invitationId:t});if(e?.error)throw new Error(e.error.message);return e.data}function bs(){const t=W.c(9),{org:e,locator:n}=fe();let i;t[0]!==e.id?(i={connectionId:ze,orgId:e.id},t[0]=e.id,t[1]=i):i=t[1];const r=$e(i);let a;t[2]!==n?(a=ne.tags(n),t[2]=n,t[3]=a):a=t[3];let o;t[4]!==r?(o=async()=>{const u=await r.callTool({name:"TAGS_LIST",arguments:{}});return(u.structuredContent??u).tags},t[4]=r,t[5]=o):o=t[5];let l;return t[6]!==a||t[7]!==o?(l={queryKey:a,queryFn:o,staleTime:3e4},t[6]=a,t[7]=o,t[8]=l):l=t[8],bt(l)}function js(){const t=W.c(10),e=Re(),{org:n,locator:i}=fe();let r;t[0]!==n.id?(r={connectionId:ze,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const a=$e(r);let o;t[2]!==a?(o=async f=>{const m=await a.callTool({name:"TAGS_CREATE",arguments:{name:f}});return(m.structuredContent??m).tag},t[2]=a,t[3]=o):o=t[3];let l;t[4]!==i||t[5]!==e?(l=()=>{e.invalidateQueries({queryKey:ne.tags(i)})},t[4]=i,t[5]=e,t[6]=l):l=t[6];let u;return t[7]!==o||t[8]!==l?(u={mutationFn:o,onSuccess:l,onError:vs},t[7]=o,t[8]=l,t[9]=u):u=t[9],pe(u)}function vs(t){U.error(t instanceof Error?t.message:"Failed to create tag")}function Cs(t){const e=W.c(12),{org:n,locator:i}=fe();let r;e[0]!==n.id?(r={connectionId:ze,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const a=$e(r);let o;e[2]!==i||e[3]!==t?(o=ne.memberTags(i,t),e[2]=i,e[3]=t,e[4]=o):o=e[4];let l;e[5]!==a||e[6]!==t?(l=async()=>{const m=await a.callTool({name:"MEMBER_TAGS_GET",arguments:{memberId:t}});return(m.structuredContent??m).tags},e[5]=a,e[6]=t,e[7]=l):l=e[7];const u=!!t;let f;return e[8]!==o||e[9]!==l||e[10]!==u?(f={queryKey:o,queryFn:l,staleTime:3e4,enabled:u},e[8]=o,e[9]=l,e[10]=u,e[11]=f):f=e[11],bt(f)}function ys(){const t=W.c(10),e=Re(),{org:n,locator:i}=fe();let r;t[0]!==n.id?(r={connectionId:ze,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const a=$e(r);let o;t[2]!==a?(o=async f=>{const{memberId:m,tagIds:S}=f,g=await a.callTool({name:"MEMBER_TAGS_SET",arguments:{memberId:m,tagIds:S}});return g.structuredContent??g},t[2]=a,t[3]=o):o=t[3];let l;t[4]!==i||t[5]!==e?(l=(f,m)=>{e.invalidateQueries({queryKey:ne.memberTags(i,m.memberId)})},t[4]=i,t[5]=e,t[6]=l):l=t[6];let u;return t[7]!==o||t[8]!==l?(u={mutationFn:o,onSuccess:l,onError:Ss},t[7]=o,t[8]=l,t[9]=u):u=t[9],pe(u)}function Ss(t){U.error(t instanceof Error?t.message:"Failed to update member tags")}function Nt(t){const e=W.c(44),{memberId:n,className:i,disabled:r,placeholder:a,maxDisplay:o}=t,l=r===void 0?!1:r,u=a===void 0?"Add tags...":a,f=o===void 0?2:o,[m,S]=re.useState(!1),[g,$]=re.useState(""),{data:b,isLoading:T}=bs(),y=b===void 0?[]:b,{data:M,isLoading:p}=Cs(n),c=M===void 0?[]:M,x=js(),C=ys(),E=T||p,w=c.map(Ns);let A;e[0]!==g?(A=v=>v.name.toLowerCase().includes(g.toLowerCase()),e[0]=g,e[1]=A):A=e[1];const P=y.filter(A);let _;e[2]!==g?(_=v=>v.name.toLowerCase()===g.toLowerCase(),e[2]=g,e[3]=_):_=e[3];const R=y.find(_),z=g.trim()&&!R,L=async v=>{const ge=w.includes(v.id)?w.filter(_e=>_e!==v.id):[...w,v.id];await C.mutateAsync({memberId:n,tagIds:ge})},I=async()=>{if(!g.trim())return;const v=await x.mutateAsync(g.trim());await C.mutateAsync({memberId:n,tagIds:[...w,v.id]}),$("")},d=async v=>{const te=w.filter(ge=>ge!==v);await C.mutateAsync({memberId:n,tagIds:te})},N=x.isPending||C.isPending,q=os;let k;e[4]!==m?(k=()=>S(!m),e[4]=m,e[5]=k):k=e[5];let D;e[6]!==i?(D=Pe("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",i),e[6]=i,e[7]=D):D=e[7];const V=l||E,O=E?s.jsx(Ge,{size:14,className:"animate-spin text-muted-foreground"}):c.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[c.slice(0,f).map(ws),c.length>f&&s.jsxs(Be,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",c.length-f]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:u});let B;e[8]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(cs,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=B):B=e[8];let K;e[9]!==V||e[10]!==O||e[11]!==k||e[12]!==D?(K=s.jsx(rs,{asChild:!0,children:s.jsxs(Ie,{variant:"ghost",size:"sm",onClick:k,className:D,disabled:V,children:[O,B]})}),e[9]=V,e[10]=O,e[11]=k,e[12]=D,e[13]=K):K=e[13];const Q=ls,G="w-56 p-0",ce="start";let J;e[14]===Symbol.for("react.memo_cache_sentinel")?(J=()=>S(!1),e[14]=J):J=e[14];const Me=is,Ae=!1;let ie;e[15]!==g?(ie=s.jsx(as,{placeholder:"Search or create...",value:g,onValueChange:$,className:"h-9"}),e[15]=g,e[16]=ie):ie=e[16];const he=ns,me=c.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Qe,{heading:"Selected",children:c.map(v=>s.jsx(Ue,{onSelect:()=>L(v),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ft,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:v.name})]}),s.jsx("button",{onClick:te=>{te.stopPropagation(),d(v.id)},className:"opacity-50 hover:opacity-100",disabled:N,children:s.jsx(wt,{size:14})})]})},v.id))}),s.jsx(ht,{})]}),de=Qe,be="Available",ae=P.length===0&&!z&&s.jsx(ss,{children:"No tags found."}),le=P.filter(v=>!w.includes(v.id)).map(v=>s.jsx(Ue,{onSelect:()=>L(v),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ft,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:v.name})]})},v.id));let H;e[17]!==de||e[18]!==ae||e[19]!==le?(H=s.jsxs(de,{heading:be,children:[ae,le]}),e[17]=de,e[18]=ae,e[19]=le,e[20]=H):H=e[20];let oe;e[21]!==I||e[22]!==N||e[23]!==g||e[24]!==z?(oe=z&&s.jsxs(s.Fragment,{children:[s.jsx(ht,{}),s.jsx(Qe,{children:s.jsx(Ue,{onSelect:I,className:"cursor-pointer",disabled:N,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[N?s.jsx(Ge,{size:14,className:"animate-spin"}):s.jsx(ms,{size:14}),s.jsxs("span",{children:['Create "',g.trim(),'"']})]})})})]}),e[21]=I,e[22]=N,e[23]=g,e[24]=z,e[25]=oe):oe=e[25];let Y;e[26]!==he||e[27]!==me||e[28]!==H||e[29]!==oe?(Y=s.jsxs(he,{children:[me,H,oe]}),e[26]=he,e[27]=me,e[28]=H,e[29]=oe,e[30]=Y):Y=e[30];let Z;e[31]!==Me||e[32]!==ie||e[33]!==Y?(Z=s.jsxs(Me,{shouldFilter:Ae,children:[ie,Y]}),e[31]=Me,e[32]=ie,e[33]=Y,e[34]=Z):Z=e[34];let X;e[35]!==Q||e[36]!==J||e[37]!==Z?(X=s.jsx(Q,{className:G,align:ce,onEscapeKeyDown:J,children:Z}),e[35]=Q,e[36]=J,e[37]=Z,e[38]=X):X=e[38];let ee;return e[39]!==q||e[40]!==m||e[41]!==K||e[42]!==X?(ee=s.jsxs(q,{open:m,onOpenChange:S,children:[K,X]}),e[39]=q,e[40]=m,e[41]=K,e[42]=X,e[43]=ee):ee=e[43],ee}function ws(t){return s.jsx(Be,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Ns(t){return t.id}const gt=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],Ts={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function qe(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Is(t){const e=new Map;for(const[n,i]of Object.entries(Ts))e.set(n,i);for(let n=0;n<t.length;n++){const i=t[n];i&&!e.has(i.role)&&e.set(i.role,gt[n%gt.length]??"bg-neutral-400")}return e}function Ms(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Le(t){const e=W.c(79),{role:n,memberId:i,isOwner:r,roleColorMap:a,selectableRoles:o,onRoleChange:l,size:u,className:f}=t,m=u===void 0?"xs":u;let S,g,$,b,T,y,M,p,c,x,C;if(e[0]!==f||e[1]!==r||e[2]!==i||e[3]!==l||e[4]!==n||e[5]!==a||e[6]!==o||e[7]!==m){C=Symbol.for("react.early_return_sentinel");e:{const I=a.get(n)??"bg-neutral-400";if(r){let d;e[19]!==i||e[20]!==l?(d=G=>l(i,G),e[19]=i,e[20]=l,e[21]=d):d=e[21];let N;e[22]!==n?(N=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=N):N=e[23];const q=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:Pe("size-2 rounded-full shrink-0",I)}),N]});let k;e[24]!==q?(k=s.jsx(We,{children:q}),e[24]=q,e[25]=k):k=e[25];let D;e[26]!==f||e[27]!==m||e[28]!==k?(D=s.jsx(He,{size:m,className:f,children:k}),e[26]=f,e[27]=m,e[28]=k,e[29]=D):D=e[29];let V;if(e[30]!==a||e[31]!==o){let G;e[33]!==a?(G=ce=>{const J=a.get(ce.role)??"bg-neutral-400";return s.jsx(Ze,{value:ce.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:Pe("size-3 rounded-full",J)}),s.jsx("span",{className:"capitalize",children:ce.label})]})},ce.role)},e[33]=a,e[34]=G):G=e[34],V=o.map(G),e[30]=a,e[31]=o,e[32]=V}else V=e[32];let O;e[35]!==V?(O=s.jsx(Ye,{children:V}),e[35]=V,e[36]=O):O=e[36];let B;e[37]!==r||e[38]!==n||e[39]!==d||e[40]!==D||e[41]!==O?(B=s.jsx(Vt,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(Je,{value:n,onValueChange:d,disabled:r,children:[D,O]})})}),e[37]=r,e[38]=n,e[39]=d,e[40]=D,e[41]=O,e[42]=B):B=e[42];let K;e[43]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Qt,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=K):K=e[43];let Q;e[44]!==B?(Q=s.jsx(Ut,{children:s.jsxs(Gt,{children:[B,K]})}),e[44]=B,e[45]=Q):Q=e[45],C=Q;break e}$=Je,p=n,e[46]!==i||e[47]!==l?(c=d=>l(i,d),e[46]=i,e[47]=l,e[48]=c):c=e[48],x=r,g=He,y=m,M=f,S=We,T="flex items-center gap-2 min-w-0",b=Pe("size-2 rounded-full shrink-0",I)}e[0]=f,e[1]=r,e[2]=i,e[3]=l,e[4]=n,e[5]=a,e[6]=o,e[7]=m,e[8]=S,e[9]=g,e[10]=$,e[11]=b,e[12]=T,e[13]=y,e[14]=M,e[15]=p,e[16]=c,e[17]=x,e[18]=C}else S=e[8],g=e[9],$=e[10],b=e[11],T=e[12],y=e[13],M=e[14],p=e[15],c=e[16],x=e[17],C=e[18];if(C!==Symbol.for("react.early_return_sentinel"))return C;let E;e[49]!==b?(E=s.jsx("div",{className:b}),e[49]=b,e[50]=E):E=e[50];let w;e[51]!==n?(w=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let A;e[53]!==E||e[54]!==w||e[55]!==T?(A=s.jsxs("div",{className:T,children:[E,w]}),e[53]=E,e[54]=w,e[55]=T,e[56]=A):A=e[56];let P;e[57]!==S||e[58]!==A?(P=s.jsx(S,{children:A}),e[57]=S,e[58]=A,e[59]=P):P=e[59];let _;e[60]!==g||e[61]!==P||e[62]!==y||e[63]!==M?(_=s.jsx(g,{size:y,className:M,children:P}),e[60]=g,e[61]=P,e[62]=y,e[63]=M,e[64]=_):_=e[64];let R;if(e[65]!==a||e[66]!==o){let I;e[68]!==a?(I=d=>{const N=a.get(d.role)??"bg-neutral-400";return s.jsx(Ze,{value:d.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:Pe("size-3 rounded-full",N)}),s.jsx("span",{className:"capitalize",children:d.label})]})},d.role)},e[68]=a,e[69]=I):I=e[69],R=o.map(I),e[65]=a,e[66]=o,e[67]=R}else R=e[67];let z;e[70]!==R?(z=s.jsx(Ye,{children:R}),e[70]=R,e[71]=z):z=e[71];let L;return e[72]!==$||e[73]!==_||e[74]!==z||e[75]!==p||e[76]!==c||e[77]!==x?(L=s.jsxs($,{value:p,onValueChange:c,disabled:x,children:[_,z]}),e[72]=$,e[73]=_,e[74]=z,e[75]=p,e[76]=c,e[77]=x,e[78]=L):L=e[78],L}function pt(t){const e=W.c(51),{member:n,roles:i,onChangeRole:r,onRemove:a,isUpdating:o}=t,l=o===void 0?!1:o,u=n.role==="owner";let f,m,S,g,$,b,T,y,M;if(e[0]!==u||e[1]!==l||e[2]!==n.id||e[3]!==n.role||e[4]!==r||e[5]!==i){let _;e[15]!==n.role?(_=d=>d.role!==n.role&&d.role!=="owner",e[15]=n.role,e[16]=_):_=e[16];const R=i.filter(_);g=vt;let z;e[17]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(St,{size:20}),e[17]=z):z=e[17],e[18]!==u?(M=s.jsx(Ct,{asChild:!0,children:s.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:u,onClick:_s,children:z})}),e[18]=u,e[19]=M):M=e[19],S=yt,T="end",y=As,m=Jt;let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(es,{size:16}),e[20]=L):L=e[20],e[21]!==l?(b=s.jsxs(Ht,{disabled:l,children:[L,"Change Role"]}),e[21]=l,e[22]=b):b=e[22],f=Wt;let I;e[23]!==l||e[24]!==n.id||e[25]!==r?(I=d=>{const N=[];return d.isBuiltin||(d.allowsAllStaticPermissions?N.push("Full org access"):d.staticPermissionCount&&d.staticPermissionCount>0&&N.push(`${d.staticPermissionCount} org perm${d.staticPermissionCount!==1?"s":""}`),d.allowsAllConnections?N.push("All connections"):d.connectionCount&&d.connectionCount>0&&N.push(`${d.connectionCount} connection${d.connectionCount!==1?"s":""}`),(d.connectionCount!==0||d.allowsAllConnections)&&(d.allowsAllTools?N.push("all tools"):d.toolCount&&d.toolCount>0&&N.push(`${d.toolCount} tool${d.toolCount!==1?"s":""}`))),s.jsxs(Xe,{onClick:q=>{q.stopPropagation(),r(n.id,d.role)},disabled:l,children:[d.isBuiltin?s.jsx(Xt,{size:16}):s.jsx(Zt,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:d.label}),!d.isBuiltin&&N.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:N.join(", ")})]})]},d.role)},e[23]=l,e[24]=n.id,e[25]=r,e[26]=I):I=e[26],$=R.map(I),e[0]=u,e[1]=l,e[2]=n.id,e[3]=n.role,e[4]=r,e[5]=i,e[6]=f,e[7]=m,e[8]=S,e[9]=g,e[10]=$,e[11]=b,e[12]=T,e[13]=y,e[14]=M}else f=e[6],m=e[7],S=e[8],g=e[9],$=e[10],b=e[11],T=e[12],y=e[13],M=e[14];let p;e[27]!==f||e[28]!==$?(p=s.jsx(f,{children:$}),e[27]=f,e[28]=$,e[29]=p):p=e[29];let c;e[30]!==m||e[31]!==b||e[32]!==p?(c=s.jsxs(m,{children:[b,p]}),e[30]=m,e[31]=b,e[32]=p,e[33]=c):c=e[33];let x;e[34]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Yt,{}),e[34]=x):x=e[34];let C;e[35]!==n.id||e[36]!==a?(C=_=>{_.stopPropagation(),a(n.id)},e[35]=n.id,e[36]=a,e[37]=C):C=e[37];let E;e[38]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ts,{size:16}),e[38]=E):E=e[38];let w;e[39]!==C?(w=s.jsxs(Xe,{variant:"destructive",onClick:C,children:[E,"Remove Member"]}),e[39]=C,e[40]=w):w=e[40];let A;e[41]!==S||e[42]!==w||e[43]!==T||e[44]!==y||e[45]!==c?(A=s.jsxs(S,{align:T,onClick:y,children:[c,x,w]}),e[41]=S,e[42]=w,e[43]=T,e[44]=y,e[45]=c,e[46]=A):A=e[46];let P;return e[47]!==g||e[48]!==A||e[49]!==M?(P=s.jsxs(g,{children:[M,A]}),e[47]=g,e[48]=A,e[49]=M,e[50]=P):P=e[50],P}function As(t){return t.stopPropagation()}function _s(t){return t.stopPropagation()}function xt(t){const e=W.c(8),{invitationId:n,onCancel:i,isCancelling:r}=t,a=r===void 0?!1:r;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ct,{asChild:!0,children:s.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ps,children:s.jsx(St,{size:20})})}),e[0]=o):o=e[0];let l;e[1]!==n||e[2]!==i?(l=m=>{m.stopPropagation(),i(n)},e[1]=n,e[2]=i,e[3]=l):l=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(wt,{size:16}),e[4]=u):u=e[4];let f;return e[5]!==a||e[6]!==l?(f=s.jsxs(vt,{children:[o,s.jsx(yt,{align:"end",onClick:Es,children:s.jsxs(Xe,{variant:"destructive",onClick:l,disabled:a,children:[u,"Cancel Invitation"]})})]}),e[5]=a,e[6]=l,e[7]=f):f=e[7],f}function Es(t){return t.stopPropagation()}function Ps(t){return t.stopPropagation()}function Rs(){const t=W.c(86),{data:e}=Kt(),{data:n}=hs(),i=gs(),r=Re(),{locator:a}=fe(),[o,l]=re.useState(null),[u,f]=re.useState(null),[m,S]=re.useState(""),[g,$]=re.useState("table"),[b,T]=re.useState("member"),[y,M]=re.useState("asc"),p=e?.data?.members;let c;t[0]!==b?(c=h=>{b===h?M(Gs):(T(h),M("asc"))},t[0]=b,t[1]=c):c=t[1];const x=c;let C=p??[],E=n??[];if(m){const h=m.toLowerCase();C=C.filter(j=>j.user?.name?.toLowerCase().includes(h)||j.user?.email?.toLowerCase().includes(h)||j.role?.toLowerCase().includes(h)),E=E.filter(j=>j.email?.toLowerCase().includes(h)||j.role?.toLowerCase().includes(h))}if(b&&y){let h;t[2]!==y||t[3]!==b?(h=(j,F)=>{let se,Ee;e:switch(b){case"member":{se=j.user?.name||"",Ee=F.user?.name||"";break e}case"role":{se=j.role||"",Ee=F.role||"";break e}case"joined":{se=j.createdAt?typeof j.createdAt=="string"?j.createdAt:j.createdAt.toISOString():"",Ee=F.createdAt?typeof F.createdAt=="string"?F.createdAt:F.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?se.localeCompare(Ee):Ee.localeCompare(se)},t[2]=y,t[3]=b,t[4]=h):h=t[4],C=[...C].sort(h)}const w=C;let A;t[5]!==a||t[6]!==r?(A={mutationFn:Us,onSuccess:()=>{ue("member_removed"),r.invalidateQueries({queryKey:ne.members(a)}),U.success("Member has been removed from the organization"),l(null)},onError:Qs},t[5]=a,t[6]=r,t[7]=A):A=t[7];const P=pe(A);let _;t[8]!==a||t[9]!==r?(_={mutationFn:Vs,onSuccess:(h,j)=>{ue("member_role_updated",{new_role:j.role}),r.invalidateQueries({queryKey:ne.members(a)}),U.success("Member's role has been updated")},onError:Ks},t[8]=a,t[9]=r,t[10]=_):_=t[10];const R=pe(_);let z;t[11]!==a||t[12]!==r?(z={mutationFn:Bs,onSuccess:(h,j)=>{ue("invitation_role_updated",{new_role:j.role}),r.invalidateQueries({queryKey:ne.invitations(a)}),U.success("Invitation role has been updated")},onError:qs},t[11]=a,t[12]=r,t[13]=z):z=t[13];const L=pe(z),{roles:I,customRoles:d}=jt();let N;t[14]!==d?(N=Is(d),t[14]=d,t[15]=N):N=t[15];const q=N;let k;t[16]!==I?(k=I.filter(Os),t[16]=I,t[17]=k):k=t[17];const D=k;let V;t[18]===Symbol.for("react.memo_cache_sentinel")?(V={id:"member",header:"Member",render:Ls,cellClassName:"flex-1 min-w-0",sortable:!0},t[18]=V):V=t[18];let O;t[19]!==q||t[20]!==D||t[21]!==L||t[22]!==R?(O={id:"role",header:"Role",render:h=>h.type==="member"?s.jsx(Le,{role:h.data.role,memberId:h.data.id,isOwner:h.data.role==="owner",roleColorMap:q,selectableRoles:D,onRoleChange:(j,F)=>R.mutate({memberId:j,role:F}),className:"w-36"}):s.jsx(Le,{role:h.data.role,memberId:h.data.id,isOwner:!1,roleColorMap:q,selectableRoles:D,onRoleChange:(j,F)=>L.mutate({invitationId:j,role:F,email:h.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[19]=q,t[20]=D,t[21]=L,t[22]=R,t[23]=O):O=t[23];let B,K;t[24]===Symbol.for("react.memo_cache_sentinel")?(B={id:"tags",header:"Tags",render:Fs,cellClassName:"w-40 shrink-0"},K={id:"joined",header:"Joined",render:ks,cellClassName:"w-48 shrink-0",sortable:!0},t[24]=B,t[25]=K):(B=t[24],K=t[25]);let Q;t[26]!==i.cancel.isPending||t[27]!==I||t[28]!==R?(Q={id:"actions",header:"",render:h=>h.type==="member"?s.jsx(pt,{member:h.data,roles:I,onChangeRole:(j,F)=>R.mutate({memberId:j,role:F}),onRemove:l,isUpdating:R.isPending}):s.jsx(xt,{invitationId:h.data.id,onCancel:f,isCancelling:i.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[26]=i.cancel.isPending,t[27]=I,t[28]=R,t[29]=Q):Q=t[29];let G;t[30]!==Q||t[31]!==O?(G=[V,O,B,K,Q],t[30]=Q,t[31]=O,t[32]=G):G=t[32];const ce=G;let J;t[33]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(fs,{trigger:s.jsx(Ie,{children:"Invite Member"})})}),t[33]=J):J=t[33];const Me=J,Ae=[...w.map(Ds),...E.filter($s).map(zs)],ie=Te,he=!!u;let me;t[34]===Symbol.for("react.memo_cache_sentinel")?(me=()=>f(null),t[34]=me):me=t[34];let de;t[35]===Symbol.for("react.memo_cache_sentinel")?(de=s.jsxs(ot,{children:[s.jsx(rt,{children:"Cancel Invitation"}),s.jsx(ct,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[35]=de):de=t[35];let be;t[36]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(mt,{children:"Keep Invitation"}),t[36]=be):be=t[36];let ae;t[37]!==i.cancel||t[38]!==u?(ae=()=>{u&&(i.cancel.mutate(u),f(null))},t[37]=i.cancel,t[38]=u,t[39]=ae):ae=t[39];let le;t[40]!==i.cancel.isPending||t[41]!==ae?(le=s.jsxs(it,{children:[de,s.jsxs(at,{children:[be,s.jsx(lt,{onClick:ae,disabled:i.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[40]=i.cancel.isPending,t[41]=ae,t[42]=le):le=t[42];let H;t[43]!==he||t[44]!==le?(H=s.jsx(dt,{open:he,onOpenChange:me,children:le}),t[43]=he,t[44]=le,t[45]=H):H=t[45];const oe=!!o;let Y;t[46]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>l(null),t[46]=Y):Y=t[46];let Z;t[47]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs(ot,{children:[s.jsx(rt,{children:"Remove Member"}),s.jsx(ct,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[47]=Z):Z=t[47];let X;t[48]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(mt,{children:"Cancel"}),t[48]=X):X=t[48];let ee;t[49]!==o||t[50]!==P?(ee=()=>o&&P.mutate(o),t[49]=o,t[50]=P,t[51]=ee):ee=t[51];let v;t[52]!==P.isPending||t[53]!==ee?(v=s.jsxs(it,{children:[Z,s.jsxs(at,{children:[X,s.jsx(lt,{onClick:ee,disabled:P.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[52]=P.isPending,t[53]=ee,t[54]=v):v=t[54];let te;t[55]!==oe||t[56]!==v?(te=s.jsx(dt,{open:oe,onOpenChange:Y,children:v}),t[55]=oe,t[56]=v,t[57]=te):te=t[57];const ge=Te,_e=Te,Tt="flex flex-col gap-6";let je;t[58]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Te.Title,{children:"Members"}),t[58]=je):je=t[58];let De;t[59]===Symbol.for("react.memo_cache_sentinel")?(De=h=>{h.key==="Escape"&&(S(""),h.target.blur())},t[59]=De):De=t[59];let ve;t[60]!==m?(ve=s.jsx(Pt,{value:m,onChange:S,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:De}),t[60]=m,t[61]=ve):ve=t[61];let ke;t[62]===Symbol.for("react.memo_cache_sentinel")?(ke=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[62]=ke):ke=t[62];let Ce;t[63]!==x||t[64]!==y||t[65]!==b||t[66]!==g?(Ce=s.jsx(Et,{viewMode:g,onViewModeChange:$,sortKey:b,sortDirection:y,onSort:x,sortOptions:ke}),t[63]=x,t[64]=y,t[65]=b,t[66]=g,t[67]=Ce):Ce=t[67];let ye;t[68]!==ve||t[69]!==Ce?(ye=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[ve,Ce]}),Me]}),t[68]=ve,t[69]=Ce,t[70]=ye):ye=t[70];const Ke=g==="cards"?s.jsx("div",{children:Ae.length===0?s.jsx(Ve,{title:"No members found",description:m?`No members match "${m}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:Ae.map(h=>{if(h.type==="invitation")return s.jsxs(ut,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(xt,{invitationId:h.data.id,onCancel:f,isCancelling:i.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Oe,{fallback:qe(h.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Be,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Le,{role:h.data.role,memberId:h.data.id,isOwner:!1,roleColorMap:q,selectableRoles:D,onRoleChange:(F,se)=>L.mutate({invitationId:F,role:se,email:h.data.email}),className:"w-fit"})]})]})]},`inv-${h.data.id}`);const j=h.data;return s.jsxs(ut,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(pt,{member:j,roles:I,onChangeRole:(F,se)=>R.mutate({memberId:F,role:se}),onRemove:l,isUpdating:R.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Oe,{url:j.user?.image??void 0,fallback:qe(j.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:j.user?.email}),s.jsx(Le,{role:j.role,memberId:j.id,isOwner:j.role==="owner",roleColorMap:q,selectableRoles:D,onRoleChange:(F,se)=>R.mutate({memberId:F,role:se}),className:"w-fit"}),s.jsx(Nt,{memberId:j.id,maxDisplay:3})]})]})]},j.id)})})}):s.jsx(Rt,{columns:ce,data:Ae,isLoading:!1,sortKey:b,sortDirection:y,onSort:x,emptyState:m?s.jsx(Ve,{title:"No members found",description:`No members match "${m}"`}):s.jsx(Ve,{title:"No members found",description:"Invite members to get started."})});let Se;t[71]!==je||t[72]!==ye||t[73]!==Ke?(Se=s.jsxs("div",{className:Tt,children:[je,ye,Ke]}),t[71]=je,t[72]=ye,t[73]=Ke,t[74]=Se):Se=t[74];let we;t[75]!==_e.Body||t[76]!==Se?(we=s.jsx(_e.Body,{children:Se}),t[75]=_e.Body,t[76]=Se,t[77]=we):we=t[77];let Ne;t[78]!==ge.Content||t[79]!==we?(Ne=s.jsx(ge.Content,{children:we}),t[78]=ge.Content,t[79]=we,t[80]=Ne):Ne=t[80];let Fe;return t[81]!==ie||t[82]!==H||t[83]!==te||t[84]!==Ne?(Fe=s.jsxs(ie,{children:[H,te,Ne]}),t[81]=ie,t[82]=H,t[83]=te,t[84]=Ne,t[85]=Fe):Fe=t[85],Fe}function zs(t){return{type:"invitation",data:t}}function $s(t){return t.status==="pending"}function Ds(t){return{type:"member",data:t}}function ks(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ms(t.data.createdAt):"N/A"}):s.jsx(Be,{variant:"outline",children:"Pending"})}function Fs(t){return t.type==="member"?s.jsx(Nt,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Ls(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Oe,{url:t.data.user?.image??void 0,fallback:qe(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Oe,{fallback:qe(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Os(t){return t.role!=="owner"}function qs(t,e){ue("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),U.error(t instanceof Error?t.message:"Failed to update invitation role")}async function Bs(t){const{invitationId:e,role:n,email:i}=t,r=await xe.organization.cancelInvitation({invitationId:e});if(r?.error)throw new Error(r.error.message);const a=await xe.organization.inviteMember({email:i,role:n});if(a?.error)throw new Error(a.error.message)}function Ks(t,e){ue("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),U.error(t instanceof Error?t.message:"Failed to update role")}async function Vs(t){const{memberId:e,role:n}=t,i=await xe.organization.updateMemberRole({memberId:e,role:[n]});if(i?.error)throw new Error(i.error.message)}function Qs(t){ue("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),U.error(t instanceof Error?t.message:"Failed to remove member")}async function Us(t){const e=await xe.organization.removeMember({memberIdOrEmail:t});if(e?.error)throw new Error(e.error.message)}function Gs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Pn(){const t=W.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(_t,{fallback:e,children:s.jsx(re.Suspense,{fallback:s.jsx(Te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ge,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Rs,{})})}),t[1]=n):n=t[1],n}export{Pn as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BR-KKTEl.js","assets/index-Bn0n2Tn5.js","assets/index-CICJCo3v.css","assets/ArrowNarrowLeft-ctHZC7IK.js","assets/CheckCircle-3lbo4DOp.js","assets/Container-BbxUmzld.js","assets/Settings02-NVTdZYn8.js","assets/XCircle-CBqb98Hh.js","assets/constants-DWChG_gh.js","assets/useInfiniteQuery-BkNuxXHJ.js","assets/infiniteQueryObserver-BuP6-BnP.js","assets/badge-BJnKVqQg.js","assets/input-C0cHvFsP.js","assets/dropdown-menu-LTGIQdd2.js","assets/ChevronDown-BMsVDJMd.js","assets/ChevronRight-DNaFnNR_.js","assets/DotsVertical-q5wudUQb.js","assets/table-UGp85pBs.js","assets/toggle-group-CrNuUyQT.js","assets/use-view-mode-lvgEn118.js","assets/tooltip-CkzGOY_H.js","assets/SearchMd-tlcXyQa_.js","assets/dialog-U3vhhaTY.js","assets/X-XvFOaH_0.js","assets/AlertCircle-BefAeM6u.js","assets/alert-dialog-BY7wdwxM.js","assets/card-Dp6Lilh-.js","assets/Trash01-CGGNK3g-.js","assets/label-C-b-mt3k.js","assets/select-rt68l1g_.js","assets/ChevronUp-Ba2YtjVA.js","assets/switch-Dd-fbXw9.js","assets/textarea-Ds8u2czk.js","assets/RefreshCcw01-DhQjzDQL.js","assets/checkbox-CouoIES-.js","assets/LinkExternal01-B-rWZEWZ.js","assets/use-copy-CBB3IfKo.js","assets/Plus-B1zoIOQx.js","assets/Play-BwE8tx_2.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{e as a,j as t,r,l as i,_ as o}from"./index-Bn0n2Tn5.js";const n=r.lazy(()=>o(()=>import("./registry-layout-BR-KKTEl.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38])));function c(){const s=a.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(r.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(i,{size:20,className:"animate-spin text-muted-foreground"})}),children:t.jsx(n,{})}),s[0]=e):e=s[0],e}export{c as default};
|