decocms 4.574.1 → 4.574.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-JDirc_BX.js → AlertCircle-Dsv0Pm7s.js} +1 -1
- package/dist/client/assets/{AreaChart-DpzgqwWZ.js → AreaChart-95ER28GX.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BENlvNHb.js → ArrowLeft-DC6oDquu.js} +1 -1
- package/dist/client/assets/{ArrowUp-hVHjHInb.js → ArrowUp-Bzd2Ao8X.js} +1 -1
- package/dist/client/assets/{CartesianChart-ClHLbDW5.js → CartesianChart-Di9WWG1m.js} +1 -1
- package/dist/client/assets/{CategoricalChart-oDBSn1QJ.js → CategoricalChart-MTqEhHpE.js} +1 -1
- package/dist/client/assets/{CheckCircle-BMxSQJ5-.js → CheckCircle-KwhMDKnL.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DDGUPocS.js → ChevronSelectorVertical-BLvA03ay.js} +1 -1
- package/dist/client/assets/{ChevronUp-DYc8wyky.js → ChevronUp-Y1FAoMvo.js} +1 -1
- package/dist/client/assets/{CreditCard01-EEU_sSyq.js → CreditCard01-CQULtRjU.js} +1 -1
- package/dist/client/assets/{Globe04-CdHKMOso.js → Globe04-rzoBWb4k.js} +1 -1
- package/dist/client/assets/{Key01-EDnnJ_Gd.js → Key01-Bb5nsuN9.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DhH3TW3t.js → LinkBroken01-BVPolLms.js} +1 -1
- package/dist/client/assets/{Minus-XOOEmvqX.js → Minus-D6gZIhdS.js} +1 -1
- package/dist/client/assets/{Monitor01-D3lVwo0x.js → Monitor01-DZ-eNTiS.js} +1 -1
- package/dist/client/assets/{Play-DQ3lppN9.js → Play-_1vdxnt7.js} +1 -1
- package/dist/client/assets/{Plus-BHZhJmPA.js → Plus-D2mU8Z2n.js} +1 -1
- package/dist/client/assets/ReferenceLine-BCQS5W1q.js +1 -0
- package/dist/client/assets/{SearchMd-MlMwcObI.js → SearchMd-C9gFyKp3.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-sa0ohOEa.js → ShoppingBag01-B9vYetgm.js} +1 -1
- package/dist/client/assets/{Sun-pw3SuSDm.js → Sun-iCrIMYKz.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DovJE4RJ.js → SwitchHorizontal01-DaQ0HYDj.js} +1 -1
- package/dist/client/assets/{Tool01-D5n93WAy.js → Tool01-CccYPLip.js} +1 -1
- package/dist/client/assets/{Tooltip-CO7rmQDW.js → Tooltip-CkoKLPSM.js} +1 -1
- package/dist/client/assets/{Trash01-C0pW3Nzn.js → Trash01-D_C1VqRW.js} +1 -1
- package/dist/client/assets/{Upload01-CEfXDErB.js → Upload01-BZ-jVH9c.js} +1 -1
- package/dist/client/assets/{UserSquare-CUiDUhHX.js → UserSquare-C9oDVw7K.js} +1 -1
- package/dist/client/assets/{Users01-pCKb7aTW.js → Users01-OVHBqKY2.js} +1 -1
- package/dist/client/assets/{XClose-__KXghgf.js → XClose-Da3uoLbc.js} +1 -1
- package/dist/client/assets/{Zap-CyJKtBha.js → Zap-DiAA9TDt.js} +1 -1
- package/dist/client/assets/{access-gate-5u0FcWOM.js → access-gate-CvU5rNDs.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-10mnkwZu.js → add-connection-dialog-Bqm-kjDm.js} +1 -1
- package/dist/client/assets/agent-app-IUm2KpOg.js +1 -0
- package/dist/client/assets/agent-assets-Bmtr4HF2.js +1 -0
- package/dist/client/assets/{agent-automation-acvouPfy.js → agent-automation-C6civuP9.js} +3 -3
- package/dist/client/assets/agent-automations-C6CY4grg.js +1 -0
- package/dist/client/assets/agent-calendar-YxSaCaoL.js +1 -0
- package/dist/client/assets/{agent-capabilities-DuBCD3m1.js → agent-capabilities-C_Lwc_1S.js} +1 -1
- package/dist/client/assets/agent-connect-sources-1U261aQC.js +1 -0
- package/dist/client/assets/agent-deck-C-UqR39d.js +1 -0
- package/dist/client/assets/agent-e2e-Dql2lNy5.js +1 -0
- package/dist/client/assets/agent-experiments-BsakXkAT.js +1 -0
- package/dist/client/assets/agent-file-D77xFc1M.js +1 -0
- package/dist/client/assets/agent-hosting-DLt4n1PP.js +1 -0
- package/dist/client/assets/{agent-icon-Y_Y2D-pt.js → agent-icon-fpNscOF6.js} +1 -1
- package/dist/client/assets/agent-library-7De1njyb.js +1 -0
- package/dist/client/assets/agent-library-file-D1B9oEMJ.js +1 -0
- package/dist/client/assets/agent-overview-CDZkDDXd.js +1 -0
- package/dist/client/assets/agent-releases-CG7qGUka.js +2 -0
- package/dist/client/assets/agent-settings-CxavGzlw.js +1 -0
- package/dist/client/assets/{agent-site-editor-CJvHfyNv.js → agent-site-editor-CnI16zyl.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-CWXYLbKh.js +2 -0
- package/dist/client/assets/agent-site-editor-content-Beagub1U.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-BYJqSKvW.js +1 -0
- package/dist/client/assets/agent-view-CyHHS-97.js +1 -0
- package/dist/client/assets/{agent-view-guard-BbWQWaBo.js → agent-view-guard-BZmhkikC.js} +1 -1
- package/dist/client/assets/ai-providers-CLGdcvZQ.js +1 -0
- package/dist/client/assets/{alert-DmFTgsze.js → alert-DAw-__lY.js} +1 -1
- package/dist/client/assets/{analytics-sections-aDtwBOme.js → analytics-sections-DrzSo9a2.js} +1 -1
- package/dist/client/assets/{api-keys-CVVAX4Yr.js → api-keys-CfXSAJt6.js} +1 -1
- package/dist/client/assets/api-keys-DVRf3Hvj.js +1 -0
- package/dist/client/assets/app-editor-B1ZDazOl.js +1 -0
- package/dist/client/assets/{asset-utils-C4NdP_pE.js → asset-utils-B40iBSyV.js} +1 -1
- package/dist/client/assets/{auth-Bh4_Y1Kc.js → auth-YdxCJvaF.js} +1 -1
- package/dist/client/assets/{auth-catchall-Be7BZYR0.js → auth-catchall-BtKIWVeb.js} +1 -1
- package/dist/client/assets/auth-entry-BWEVf3TW.js +1 -0
- package/dist/client/assets/{auth-split-layout-CtNY2lz5.js → auth-split-layout-zPoWOH18.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DppRl8su.js → authenticate-and-persist-oauth-DfBwldFd.js} +1 -1
- package/dist/client/assets/{automation-list-row-C4OZs3iQ.js → automation-list-row-BRtY1m0_.js} +1 -1
- package/dist/client/assets/automation-runs-B5ZMOQnQ.js +1 -0
- package/dist/client/assets/automations-CVIWSKb4.js +1 -0
- package/dist/client/assets/{autosend-Dts_wRXC.js → autosend-DFTTUav1.js} +1 -1
- package/dist/client/assets/backoff-CrEUbyZT.js +1 -0
- package/dist/client/assets/{badge-CyMXYtjo.js → badge-DVtxjBdD.js} +1 -1
- package/dist/client/assets/{block-document-CoEX88Lb.js → block-document-DP3zwvIZ.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DHMHrydZ.js → blocks-preview-workspace-context-CdC5NkHg.js} +1 -1
- package/dist/client/assets/blocks-tab-states-_rbufLt5.js +1 -0
- package/dist/client/assets/{blog-schema-DL7YysBi.js → blog-schema-CPvfhGuY.js} +1 -1
- package/dist/client/assets/{buckets-8Ipt1QPH.js → buckets-CCBSdGb8.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CMFnJqyQ.js → build-improve-prompt-doc-9_1xFJrp.js} +1 -1
- package/dist/client/assets/{calendar-DJXEBE1i.js → calendar-ke1Ak3Bz.js} +1 -1
- package/dist/client/assets/{capability-load-error-CiSG_MLz.js → capability-load-error-DqZ2bjfY.js} +1 -1
- package/dist/client/assets/category-editor-CyGTDdXW.js +1 -0
- package/dist/client/assets/{chart-Bbcth4C6.js → chart-Ds4Pjzvz.js} +1 -1
- package/dist/client/assets/{chat-context-DrYmTpG0.js → chat-context-B2EDKfd0.js} +6 -6
- package/dist/client/assets/{chat-draft-B1q585AK.js → chat-draft-Cnwq9hv5.js} +1 -1
- package/dist/client/assets/{checkbox-U6ASBfOz.js → checkbox-BhpA9Zt5.js} +1 -1
- package/dist/client/assets/{choose-editor-CStvYPQI.js → choose-editor-B_GNzjsr.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CIlf0DYb.js → cli-auth-success-Q64N46VB.js} +1 -1
- package/dist/client/assets/{client-icons-BlkrzoAd.js → client-icons-CZasH4i0.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CpYk69qY.js +1 -0
- package/dist/client/assets/cms-store-drafts-CzBlkLn7.js +1 -0
- package/dist/client/assets/{collapsible-Cm_LlHdT.js → collapsible-6K3nmqYF.js} +1 -1
- package/dist/client/assets/collection-detail-D6UJgDkz.js +1 -0
- package/dist/client/assets/{collection-display-button-DSXrghYE.js → collection-display-button-2dgErWqj.js} +1 -1
- package/dist/client/assets/{collection-search-CrfF1go0.js → collection-search-0yFYtboh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BDabkJu0.js → collection-table-wrapper-CfYO1W9r.js} +1 -1
- package/dist/client/assets/{collection-tabs-CXJFRxjE.js → collection-tabs-B_dqQpZz.js} +1 -1
- package/dist/client/assets/{combobox-BnA_xOFh.js → combobox-DXIGIOUU.js} +1 -1
- package/dist/client/assets/{command-COt4WQ5b.js → command-Qn4l80Q0.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BX6NWvx_.js → companion-mcps-section-DlKI0NIv.js} +1 -1
- package/dist/client/assets/{config-CZ7Pg3zP.js → config-CCuT0uDx.js} +1 -1
- package/dist/client/assets/{connect-Bubb97Ox.js → connect-D-ehpKrE.js} +3 -3
- package/dist/client/assets/{connect-layout-Co9op_vf.js → connect-layout-BpafQvyr.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Cc0Mr5Dc.js → connect-source-dialog-D-ZZcunb.js} +1 -1
- package/dist/client/assets/{connection-CwG18GXt.js → connection-MdFsEog3.js} +1 -1
- package/dist/client/assets/{connection-card-71syl7a3.js → connection-card-CqP5nP-l.js} +1 -1
- package/dist/client/assets/connection-detail-0H8YGOD_.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Ds89P2qw.js → connection-form-helpers-D6t-A2OG.js} +1 -1
- package/dist/client/assets/{connection-slug-rYoZb8Oi.js → connection-slug-CXZXa0Pm.js} +1 -1
- package/dist/client/assets/connections-CCgX0Mn1.js +1 -0
- package/dist/client/assets/content-tab-D-2gB1id.js +25 -0
- package/dist/client/assets/context-CX2ucy08.js +1 -0
- package/dist/client/assets/{context-menu-jXHTZA3P.js → context-menu-Chf64Vse.js} +1 -1
- package/dist/client/assets/{context-shell-8kNAse1h.js → context-shell-DdzUU76d.js} +3 -3
- package/dist/client/assets/{core.esm-cCmn5UHs.js → core.esm-B8dY25VW.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Du7hzcY_.js → create-organization-dialog-D0CBCM81.js} +1 -1
- package/dist/client/assets/{device-hint-4OpoSDFU.js → device-hint-BS_JePIJ.js} +1 -1
- package/dist/client/assets/discover-Q3RTxZJc.js +1 -0
- package/dist/client/assets/{domain-settings--b7nhlCg.js → domain-settings-CEBgufdo.js} +1 -1
- package/dist/client/assets/{drawer-CtPWRLqi.js → drawer-ByMrQGCj.js} +1 -1
- package/dist/client/assets/{editor-TKi-Jvto.js → editor-DbiHNhC6.js} +1 -1
- package/dist/client/assets/{editor-classes-Bv3PWDJP.js → editor-classes-BRpqmI9G.js} +1 -1
- package/dist/client/assets/{empty-state-Cgh7_fO1.js → empty-state-1M1xIReA.js} +1 -1
- package/dist/client/assets/{empty-state-DQ9zfSjj.js → empty-state-B2Xx-qz8.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-DuEE4yY0.js → experiments-tab-choice-BfWXh4-6.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Cx40NvMQ.js → extract-connection-data-c-FfSGKP.js} +1 -1
- package/dist/client/assets/{feature-gate-C9ZxgBZe.js → feature-gate-7QGuZ_p6.js} +1 -1
- package/dist/client/assets/{feature-paywall-DK0yyspA.js → feature-paywall-wC8Tk38N.js} +1 -1
- package/dist/client/assets/file-explorer-By8BSXLx.js +2 -0
- package/dist/client/assets/{file-preview-DrfMTr-z.js → file-preview-D07TFZkO.js} +1 -1
- package/dist/client/assets/{file-share-button-Sja5jda2.js → file-share-button-BdFb2LyH.js} +1 -1
- package/dist/client/assets/{file-type-icon-CuR7GKVO.js → file-type-icon-CfqErjlt.js} +1 -1
- package/dist/client/assets/{folder-icon-clC9OBor.js → folder-icon-CnYX4FK9.js} +1 -1
- package/dist/client/assets/{form-DVHd2PmG.js → form-Bc9t1169.js} +1 -1
- package/dist/client/assets/{general-5mCEumRT.js → general-BVPcfnq3.js} +1 -1
- package/dist/client/assets/{github-icon-Tj2vKr0A.js → github-icon-BiTVYb1o.js} +1 -1
- package/dist/client/assets/home-eLi6OoUj.js +1 -0
- package/dist/client/assets/{home-overview-3QBovB5F.js → home-overview-BUsdsaOd.js} +1 -1
- package/dist/client/assets/hosted-reconcile-BT0WLx4L.js +1 -0
- package/dist/client/assets/{icon-button-DVB6vEll.js → icon-button-CSoRzxTc.js} +1 -1
- package/dist/client/assets/{index-CuXG6U4v.js → index-B0d5IX7p.js} +1 -1
- package/dist/client/assets/{index-mlqqyBRE.js → index-B2ATqkba.js} +1 -1
- package/dist/client/assets/{index-C9UzjfpE.js → index-B3GwxC-v.js} +1 -1
- package/dist/client/assets/{index-CK23_6lH.js → index-BPidavr8.js} +2 -2
- package/dist/client/assets/index-BXwlvRia.js +1 -0
- package/dist/client/assets/{index-BQvrkQ8K.js → index-CGixVPRT.js} +1 -1
- package/dist/client/assets/{index-CT6x-ixs.js → index-CO7mElbh.js} +1 -1
- package/dist/client/assets/{index-BdxdoIZK.js → index-CQBW64pa.js} +1 -1
- package/dist/client/assets/{index-aAdwJpKX.js → index-CqK_0oof.js} +1 -1
- package/dist/client/assets/index-CwOTOkx0.js +4 -0
- package/dist/client/assets/{index-DeidDxsb.js → index-CyFvlIli.js} +1 -1
- package/dist/client/assets/{index-BswXowEw.js → index-D32ePzu5.js} +1 -1
- package/dist/client/assets/{index-CX5-w0f2.js → index-DB_N5huE.js} +2 -2
- package/dist/client/assets/index-DZ-V47-f.js +1 -0
- package/dist/client/assets/{index-DU4OpQEQ.js → index-OfhDS9IV.js} +1 -1
- package/dist/client/assets/{index-Bm1K3DQC.js → index-TS-yYM5l.js} +60 -62
- package/dist/client/assets/{index-redirect-BUbGzHU7.js → index-redirect-DjmOPNwc.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BNCHN17F.js → infiniteQueryObserver-WKs1x3sX.js} +1 -1
- package/dist/client/assets/{infra-billing-BfA1aIoB.js → infra-billing-CFNDWf4P.js} +1 -1
- package/dist/client/assets/{input-CYGCgpQ0.js → input-CdXEPNdQ.js} +1 -1
- package/dist/client/assets/{input-FxN5JtJx.js → input-DyBvRhWH.js} +4 -4
- package/dist/client/assets/{integration-icon-DTmGScIa.js → integration-icon-C1m4mYos.js} +1 -1
- package/dist/client/assets/{jira-icon-LR0u-FDE.js → jira-icon-CMYyaK6V.js} +1 -1
- package/dist/client/assets/{label-BQN74rUh.js → label-m0qEFNz_.js} +1 -1
- package/dist/client/assets/{layout-CCsQB7LG.js → layout-BX8RFi7-.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DWIUyVc4.js → legacy-admin-welcome-dialog-DN17L0bp.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DD97hkrm.js → legacy-agents-deep-BcXalumx.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CxB3kSgS.js → legacy-main-redirect-BCzdn0gq.js} +1 -1
- package/dist/client/assets/library-DcxuVcYO.js +1 -0
- package/dist/client/assets/{library-tab-D_ZcLCG5.js → library-tab-BULbmul7.js} +3 -3
- package/dist/client/assets/login-DuBqEvlt.js +1 -0
- package/dist/client/assets/{markdown-BiwQrQ3v.js → markdown-BhvgGYnB.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BoUlGL1W.js → mcp-app-renderer-BqfGxyCp.js} +2 -2
- package/dist/client/assets/{mcp-oauth-CeW0VHOL.js → mcp-oauth-CMSqwlrD.js} +1 -1
- package/dist/client/assets/{mcp-oauth-969YqM-_.js → mcp-oauth-e50-7TO3.js} +1 -1
- package/dist/client/assets/{members-DtkDG4lT.js → members-PID9JnSj.js} +1 -1
- package/dist/client/assets/{memory-WISgV3Bs.js → memory-DmcNjOPo.js} +2 -2
- package/dist/client/assets/{mock-board-EGy4fTE1.js → mock-board-B978Fi_L.js} +3 -3
- package/dist/client/assets/{monaco-editor-P5VfXFj7.js → monaco-editor-QEAl_YP0.js} +1 -1
- package/dist/client/assets/{monitoring-BX8fYoyN.js → monitoring-CG9_f7tP.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-BKtm_vGS.js → monitoring-stats-row-DkmRJOMv.js} +1 -1
- package/dist/client/assets/{multi-select-C-ivHGUC.js → multi-select-CCT7Bz1w.js} +1 -1
- package/dist/client/assets/mustache-BFCk1BQA.js +4 -0
- package/dist/client/assets/{named-rule-view-DL0ULoIx.js → named-rule-view-DVMS0joL.js} +1 -1
- package/dist/client/assets/{new-project-dialog-Bqd8DZyr.js → new-project-dialog-D_RX0j41.js} +1 -1
- package/dist/client/assets/{oauth-callback-ldJD55b_.js → oauth-callback-DbUe0i-L.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BSjdlkmN.js → oauth-callback-ai-provider-B2RZlSqp.js} +1 -1
- package/dist/client/assets/oauth-consent-YLARk84v.js +1 -0
- package/dist/client/assets/{onboarding-UUqABCLm.js → onboarding-DPtycHlA.js} +1 -1
- package/dist/client/assets/openai-conversation-C_8JqtFQ.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-DuRn9Y08.js → optimistic-project-sidebar-views-CBY386aw.js} +1 -1
- package/dist/client/assets/{order-monitor-day-CUJyEmQo.js → order-monitor-day-Zfh7Djae.js} +1 -1
- package/dist/client/assets/{organization-choice-DX6NhuKr.js → organization-choice-BViy1VJZ.js} +1 -1
- package/dist/client/assets/{orgs-DNB5pAN5.js → orgs-DgJWnYOv.js} +1 -1
- package/dist/client/assets/{own-accounts-section-DA3rnsqj.js → own-accounts-section-PwhGIEcx.js} +1 -1
- package/dist/client/assets/{pair-CKUN8Ieo.js → pair-CMFzBcLY.js} +7 -7
- package/dist/client/assets/parse-sections-QRK0oKJq.js +20 -0
- package/dist/client/assets/{plan-ladder-I5kD48rz.js → plan-ladder-B6NZgvyc.js} +1 -1
- package/dist/client/assets/plan-mQ3ovGAw.js +1 -0
- package/dist/client/assets/{plan-usage-card-C_GukaUZ.js → plan-usage-card-DlHRL8yC.js} +2 -2
- package/dist/client/assets/{popover-Dh3TtwDo.js → popover-C8mcckmD.js} +1 -1
- package/dist/client/assets/post-calendar-C3cuisYq.js +1 -0
- package/dist/client/assets/post-editor-uAKG4LOK.js +2 -0
- package/dist/client/assets/{preview-content-D5dxxmRk.js → preview-content-DRPWOt_Y.js} +1 -1
- package/dist/client/assets/{preview-dialog-ChQFEC_i.js → preview-dialog-BMcYcLLg.js} +1 -1
- package/dist/client/assets/{preview-panel-6f4Q5Yyo.js → preview-panel-CwmwTZP_.js} +1 -1
- package/dist/client/assets/preview-tab-BFBvaAOI.js +551 -0
- package/dist/client/assets/{product-picker-dialog-Bn32xknc.js → product-picker-dialog-C9EfVu8K.js} +1 -1
- package/dist/client/assets/{profile-DQfBMC1r.js → profile-fN54emCr.js} +1 -1
- package/dist/client/assets/project-app-view-CvgHwWqj.js +1 -0
- package/dist/client/assets/{project-apps-CUvGGhyU.js → project-apps-DmwQAngc.js} +1 -1
- package/dist/client/assets/{project-icon-Cx2a7lKG.js → project-icon-7Ukip0ow.js} +1 -1
- package/dist/client/assets/{project-index-FRlpuXZ4.js → project-index-OpjM2-1A.js} +1 -1
- package/dist/client/assets/project-reports-S-u-m-ku.js +1 -0
- package/dist/client/assets/project-tasks-DGVgztix.js +1 -0
- package/dist/client/assets/projects-BAI422dC.js +1 -0
- package/dist/client/assets/{projects-empty-state-RwaHaNAD.js → projects-empty-state-DF0H_C2x.js} +1 -1
- package/dist/client/assets/{prompts-0DQ3tgPf.js → prompts-DcHb5gpa.js} +1 -1
- package/dist/client/assets/record-editor-BeJ8zVUP.js +1 -0
- package/dist/client/assets/redirect-editor-CC7-nKfT.js +1 -0
- package/dist/client/assets/{reports-BEOlITGh.js → reports-SBiZlPun.js} +2 -2
- package/dist/client/assets/reports-onboarding-D1I0HeLn.js +1 -0
- package/dist/client/assets/reports-rQeWRtoE.js +1 -0
- package/dist/client/assets/reports-tab-7FbE26yX.js +2 -0
- package/dist/client/assets/repositories-D2zAp7y8.js +1 -0
- package/dist/client/assets/{repositories-D7rvENWr.js → repositories-DDgRn0D8.js} +1 -1
- package/dist/client/assets/{repository-binding-BUEX4lc5.js → repository-binding-CR1iQGNu.js} +1 -1
- package/dist/client/assets/{repository-picker-mdt05v0y.js → repository-picker-JI0-E7UT.js} +1 -1
- package/dist/client/assets/{require-capability-QLRMJQu8.js → require-capability-BAmRubpC.js} +1 -1
- package/dist/client/assets/{required-auth-layout-L5uobjCB.js → required-auth-layout-BbY_gAQy.js} +1 -1
- package/dist/client/assets/{reset-password-Dkd3Ncw9.js → reset-password-umkV6OxE.js} +1 -1
- package/dist/client/assets/{resizable-DTll1yV_.js → resizable-2meo0Add.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-B2Zyymzr.js → resolve-tab-icon-BGKUhiW_.js} +1 -1
- package/dist/client/assets/review-settings-BdG8I4Qi.js +1 -0
- package/dist/client/assets/{role-color-B6vHBlZ3.js → role-color-Dkb8qNks.js} +1 -1
- package/dist/client/assets/{roles-l4Fwhlxm.js → roles-DD-esArE.js} +1 -1
- package/dist/client/assets/route-B8RNcjxF.js +1 -0
- package/dist/client/assets/route-BKPxA69M.js +1 -0
- package/dist/client/assets/route-elVtkb_Z.js +1 -0
- package/dist/client/assets/sandbox-lifecycle-context-SakLBaZg.js +1 -0
- package/dist/client/assets/{schema-BUMYDfBQ.js → schema-B2Ckyd85.js} +1 -1
- package/dist/client/assets/{schema-CyJEITX6.js → schema-D-flJgcm.js} +1 -1
- package/dist/client/assets/{scroll-area-CXm8-cku.js → scroll-area-CrLKF3Ch.js} +1 -1
- package/dist/client/assets/{search-input-CZ0rurdO.js → search-input-DqhPHff2.js} +1 -1
- package/dist/client/assets/{search-toggle-BsrckUfs.js → search-toggle-BBmFL4F1.js} +1 -1
- package/dist/client/assets/{secret-picker-Befw6gF8.js → secret-picker-DBQ4JaQs.js} +1 -1
- package/dist/client/assets/{secrets-DZjzVDff.js → secrets-DbRrxggV.js} +1 -1
- package/dist/client/assets/{section-array-field-WCaR_SKZ.js → section-array-field-DzEUxPRk.js} +1 -1
- package/dist/client/assets/{sections-CN3XzQEo.js → sections-D6lSA2Zp.js} +1 -1
- package/dist/client/assets/sections-editor-DInCqzkh.js +1 -0
- package/dist/client/assets/{select-Ce9OTxeg.js → select-DGwP5KHQ.js} +1 -1
- package/dist/client/assets/{select-model-rpugs4qN.js → select-model-LsdEU85-.js} +1 -1
- package/dist/client/assets/seo-editor-5_XGXw95.js +1 -0
- package/dist/client/assets/{separator-25fGJM6A.js → separator-2qO-0nZt.js} +1 -1
- package/dist/client/assets/settings-tab-CD2MUqmv.js +1 -0
- package/dist/client/assets/{sheet-CX7jm_if.js → sheet-0biUdMLD.js} +1 -1
- package/dist/client/assets/{shell-layout-DS0Ie03r.js → shell-layout-C5K2Cgqa.js} +1 -1
- package/dist/client/assets/{site-draft-actions-DZryCQJo.js → site-draft-actions-B3gpIf2V.js} +1 -1
- package/dist/client/assets/site-draft-view-BWibSxun.js +1 -0
- package/dist/client/assets/site-editor-DLaMMu_L.js +1 -0
- package/dist/client/assets/site-editor-toast-DxR_7rv8.js +1 -0
- package/dist/client/assets/skills-BJ8hUTnS.js +1 -0
- package/dist/client/assets/{slider-DAP3M4g0.js → slider-0BqB-02T.js} +1 -1
- package/dist/client/assets/{sortable.esm-BWLtdg41.js → sortable.esm-DfgMVOGD.js} +1 -1
- package/dist/client/assets/{sso-CBSK2hBa.js → sso-BzFw-dKc.js} +1 -1
- package/dist/client/assets/{suggestion-D3mu_Xk3.js → suggestion-DwjoXezV.js} +2 -2
- package/dist/client/assets/{super-agent-icon-B-NqGats.js → super-agent-icon-z7OwHCEd.js} +1 -1
- package/dist/client/assets/{switch-5zR0_RyT.js → switch-Vjviqk0W.js} +1 -1
- package/dist/client/assets/{synced-repos-CKVdc7QA.js → synced-repos-DbHVOBGV.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-tV1b5yjJ.js → tab-icon-glyph-XyhrgWLR.js} +1 -1
- package/dist/client/assets/{table-CZbeUf_X.js → table-D0Wi7PXW.js} +1 -1
- package/dist/client/assets/{tabs-D8DBFsJ6.js → tabs-DQ-fyTC8.js} +1 -1
- package/dist/client/assets/{task-board-CmZ-3pYa.js → task-board-wWkdzdVu.js} +1 -1
- package/dist/client/assets/{task-route-ohp4Cwjz.js → task-route-BtpV6Buo.js} +1 -1
- package/dist/client/assets/{task-status-CwNwAqHk.js → task-status-Dn75e5kc.js} +1 -1
- package/dist/client/assets/taskboard-analytics-8JJwdVpJ.js +1 -0
- package/dist/client/assets/{tasks-DxAmGFRX.js → tasks-4GoWL_dW.js} +3 -3
- package/dist/client/assets/tasks-CZU6jCer.js +1 -0
- package/dist/client/assets/{textarea-BNrj1CIV.js → textarea-Bhjzhlg4.js} +1 -1
- package/dist/client/assets/thread-analytics-BAnm8m0s.js +1 -0
- package/dist/client/assets/{thread-intent-C_sXnvWO.js → thread-intent-DTnB4CRZ.js} +4 -4
- package/dist/client/assets/thread-route-DwPTQCEG.js +1 -0
- package/dist/client/assets/{thread-route-C4AshLS2.js → thread-route-DzALEmAD.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-tV8G2x4y.js → thread-sheet-body-Yz0im8t7.js} +1 -1
- package/dist/client/assets/{time-range-picker--yg_KuCO.js → time-range-picker-aTlkPNIq.js} +1 -1
- package/dist/client/assets/{toggle-group-D4APjUwC.js → toggle-group-B-3sGcOE.js} +1 -1
- package/dist/client/assets/{tool-namespace-sf3dpjw4.js → tool-namespace-VH0Buyl6.js} +1 -1
- package/dist/client/assets/{tool-set-selector-CBkMfKhT.js → tool-set-selector-DSVQWzPb.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-kyI973z_.js → toolbar-icon-button-ObvTZQXe.js} +1 -1
- package/dist/client/assets/{tooltip-D0Aro8zv.js → tooltip-DmKkpA5B.js} +1 -1
- package/dist/client/assets/{tooltipContext-CI284Wq3.js → tooltipContext-0-zN8M2u.js} +1 -1
- package/dist/client/assets/{track-DFZVIiLp.js → track-CXbHCkc-.js} +1 -1
- package/dist/client/assets/{types-1fP0kZ0m.js → types-C0QCIIin.js} +6 -6
- package/dist/client/assets/{url-slug-DTpv_sm0.js → url-slug-CuKki8F5.js} +1 -1
- package/dist/client/assets/{usage-stats-CXQ9FoWO.js → usage-stats-BLfmHFkq.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BCXggb0b.js → use-ai-providers-CRaK_JyK.js} +1 -1
- package/dist/client/assets/use-apply-named-rule-CtfpAmZq.js +1 -0
- package/dist/client/assets/use-ask-in-chat-Pb7sjY65.js +1 -0
- package/dist/client/assets/{use-automations-DxfaOtys.js → use-automations-CEHifMG2.js} +1 -1
- package/dist/client/assets/{use-autosave-DiZxq1F5.js → use-autosave-DlV5iCiV.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-CaFw5qe2.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-DCbtnqWd.js → use-chat-layout-state-CMz9hnFO.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-DBCI1z7k.js → use-cms-publish-actions-C9vJqM_c.js} +4 -4
- package/dist/client/assets/{use-connect-companion--SDSQ7TK.js → use-connect-companion-eNuilyDe.js} +1 -1
- package/dist/client/assets/use-connection-Bn20mDtq.js +1 -0
- package/dist/client/assets/use-content-sync-CJa8ir96.js +1 -0
- package/dist/client/assets/{use-copy-fJBOhwQv.js → use-copy-DKdhQNUM.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-UVVfd2fe.js → use-date-fns-locale-BDYV4XK1.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CcJrNQv9.js → use-debounced-autosave-t5GiXTFe.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BsCdYGvU.js → use-debounced-value-DWZxrww8.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Dw1Zq3DU.js → use-deco-credits-Z-japzkY.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DSC6YnSZ.js → use-decopilot-events-BYdNs8bH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BtzLw5Mh.js → use-delete-connection-BQbnqJMz.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-hI6GNxTJ.js → use-deployment-admin-BT6mljlI.js} +1 -1
- package/dist/client/assets/{use-entitlements-q4zqHldY.js → use-entitlements-DzFd30Kk.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-Dz36xQ9l.js +1 -0
- package/dist/client/assets/{use-file-configs-DGBf9XU8.js → use-file-configs-C_HqsFXW.js} +1 -1
- package/dist/client/assets/{use-id-selection-CJeGPaiA.js → use-id-selection-BEG3_dI0.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-cS-t8Kt0.js → use-inbox-feed-DLkSEGfn.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DbrSLbYQ.js → use-infinite-scroll-Chl8X7E8.js} +1 -1
- package/dist/client/assets/{use-join-requests-l6ugTnm0.js → use-join-requests-BuQsiKHH.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-CC9AQiRW.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-DNGtFPYZ.js → use-mcp-auth-status-CKOvUjsu.js} +1 -1
- package/dist/client/assets/{use-mcp-client-WgWOA1hL.js → use-mcp-client-WQDNFsc_.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-bAmVEPg_.js → use-mcp-prompts-LhMG3Pij.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BIB4FISj.js → use-mcp-tools-F4vSg6Cr.js} +1 -1
- package/dist/client/assets/{use-mobile-BDHJ5g4G.js → use-mobile-DVyEfslF.js} +1 -1
- package/dist/client/assets/use-move-blocks-C_vBd64S.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-BJdqgQKH.js → use-navigate-to-agent-BZizGtaP.js} +1 -1
- package/dist/client/assets/{use-org-fs-Du2G3PF4.js → use-org-fs-mR8sTNyP.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CUbaI7hL.js → use-org-repo-syncs-LYGPgfu7.js} +1 -1
- package/dist/client/assets/{use-org-sso-BqLBrHG0.js → use-org-sso-B-Qul1Io.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CiRL-ND2.js → use-organization-settings-CZhHULzA.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-CpBcMOzg.js → use-project-native-view-presence-DbbXYpJY.js} +1 -1
- package/dist/client/assets/{use-project-scope-BkidtyNv.js → use-project-scope-DTrxFs6w.js} +1 -1
- package/dist/client/assets/{use-recent-apps-BHprhf_5.js → use-recent-apps-BPKgIDRu.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CLVn3MVk.js → use-reports-diagnostic-B8YcWp1M.js} +1 -1
- package/dist/client/assets/use-sandbox-events-Cq2mfnM6.js +2 -0
- package/dist/client/assets/{use-secrets-blVuAHm2.js → use-secrets-BokO0-gN.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Fd7YfHr6.js → use-section-preview-base-C3QCAjZQ.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-SkR6IFg9.js → use-sidebar-collapsed-DNtMGrde.js} +1 -1
- package/dist/client/assets/{use-tags-y0sDD-Gd.js → use-tags-BZilAw5O.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics--M1ga7ad.js → use-task-board-analytics-CadDLlJH.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DFXBTSz0.js → use-task-board-events-BO-7EKNy.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CNVxgnEG.js → use-task-board-item-prs-ER-6njOZ.js} +1 -1
- package/dist/client/assets/{use-task-board-items-CNR2hq29.js → use-task-board-items-CpAskmIM.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-CY0qH8TO.js → use-task-board-prompts-DQqx__yW.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BAgQZZyc.js → use-task-metadata-DaTAtFWS.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-C4WTlJbf.js → use-thread-outputs-DQ6xHxgF.js} +1 -1
- package/dist/client/assets/{use-voice-input-CelDzfp5.js → use-voice-input-C19j6O14.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-K_IsCntR.js +1 -0
- package/dist/client/assets/{useQueries-BH3au6Bf.js → useQueries-DvUG5EVg.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BxxeKR03.js +1 -0
- package/dist/client/assets/{users-Bnea6Y3M.js → users-BgTfExah.js} +1 -1
- package/dist/client/assets/{utils-8mUwv_Ld.js → utils-ChC83HK9.js} +1 -1
- package/dist/client/assets/{variant-calendar-BvpRFRX6.js → variant-calendar-LRu1zblU.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Bna1heSd.js → variant-matcher-override-D1mQo9MQ.js} +1 -1
- package/dist/client/assets/{view-header-CYkLhMn3.js → view-header-ConmBWWI.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CfQIOHDY.js → virtual-mcp-BkTVgFTu.js} +1 -1
- package/dist/client/assets/watch-sse-pool-pETEkNEY.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/ReferenceLine-ClCgVjRG.js +0 -1
- package/dist/client/assets/agent-app-DdBuGJK2.js +0 -1
- package/dist/client/assets/agent-assets-C3IeAW1B.js +0 -1
- package/dist/client/assets/agent-automations-D0NXC_6r.js +0 -1
- package/dist/client/assets/agent-calendar-BOtDL5wE.js +0 -1
- package/dist/client/assets/agent-connect-sources-a50GCyKV.js +0 -1
- package/dist/client/assets/agent-deck-OGgkBkIO.js +0 -1
- package/dist/client/assets/agent-e2e-BIYV3C1W.js +0 -1
- package/dist/client/assets/agent-experiments-DcDMdMaW.js +0 -1
- package/dist/client/assets/agent-file-BkEsRI8m.js +0 -1
- package/dist/client/assets/agent-hosting-CaYpr3GJ.js +0 -1
- package/dist/client/assets/agent-library--BMPxGd9.js +0 -1
- package/dist/client/assets/agent-library-file-_vX06T41.js +0 -1
- package/dist/client/assets/agent-overview-D74SB75d.js +0 -1
- package/dist/client/assets/agent-releases-B3ihZIQn.js +0 -2
- package/dist/client/assets/agent-settings-nSX8psll.js +0 -1
- package/dist/client/assets/agent-site-editor-code-hU9FQE4u.js +0 -2
- package/dist/client/assets/agent-site-editor-content-DTRDfZ6d.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-zxTAZW7-.js +0 -1
- package/dist/client/assets/agent-view-BHr6uCB4.js +0 -1
- package/dist/client/assets/ai-providers-BWLZYJlr.js +0 -1
- package/dist/client/assets/api-keys-DQZBigkX.js +0 -1
- package/dist/client/assets/app-editor-miZ_XprR.js +0 -1
- package/dist/client/assets/auth-entry-BVPXWLe3.js +0 -1
- package/dist/client/assets/automation-runs-CnJ5cVfz.js +0 -1
- package/dist/client/assets/automations-CTrZyCJH.js +0 -1
- package/dist/client/assets/blocks-tab-states-Dedoi43j.js +0 -1
- package/dist/client/assets/category-editor-D2AAL1sO.js +0 -1
- package/dist/client/assets/cms-settings-editor-CvyPaB8P.js +0 -1
- package/dist/client/assets/cms-store-drafts-BxSsz4kW.js +0 -1
- package/dist/client/assets/collection-detail-XmdxNV-2.js +0 -1
- package/dist/client/assets/connection-detail-CDwQfSDO.js +0 -1
- package/dist/client/assets/connections-DRfQlA6E.js +0 -1
- package/dist/client/assets/content-tab-CsKhgP-1.js +0 -25
- package/dist/client/assets/context-DC5XiDXT.js +0 -1
- package/dist/client/assets/discover-C_ji7DIb.js +0 -1
- package/dist/client/assets/file-explorer-DdXpHyf2.js +0 -2
- package/dist/client/assets/home-qRxdFYCq.js +0 -1
- package/dist/client/assets/hosted-reconcile-DVhqOXEf.js +0 -1
- package/dist/client/assets/index-BomXABHH.js +0 -4
- package/dist/client/assets/index-CWJov9JR.js +0 -1
- package/dist/client/assets/index-CvZuGBnK.js +0 -1
- package/dist/client/assets/library-1cj6yrAd.js +0 -1
- package/dist/client/assets/login-BMHrPCue.js +0 -1
- package/dist/client/assets/mustache-Dky3CPha.js +0 -4
- package/dist/client/assets/oauth-consent-DIuym-vW.js +0 -1
- package/dist/client/assets/openai-conversation-BqSCxp3u.js +0 -3
- package/dist/client/assets/parse-sections-B7udX6Q3.js +0 -20
- package/dist/client/assets/plan-D2GzfM6v.js +0 -1
- package/dist/client/assets/post-calendar-Ci2Ls6m8.js +0 -1
- package/dist/client/assets/post-editor-DmPdxQfI.js +0 -2
- package/dist/client/assets/preview-tab-DNewpfvP.js +0 -551
- package/dist/client/assets/project-app-view-UUbUguKi.js +0 -1
- package/dist/client/assets/project-reports-Bx0n9tHU.js +0 -1
- package/dist/client/assets/project-tasks-CMCbN_AC.js +0 -1
- package/dist/client/assets/projects-DAB5tzLY.js +0 -1
- package/dist/client/assets/record-editor-43ke-tWv.js +0 -1
- package/dist/client/assets/redirect-editor-D_h26Q_F.js +0 -1
- package/dist/client/assets/reports-CP9Hb1Gh.js +0 -1
- package/dist/client/assets/reports-onboarding-DHSkaogY.js +0 -1
- package/dist/client/assets/reports-tab-CftmyHYx.js +0 -2
- package/dist/client/assets/repositories-BzfxqBWi.js +0 -1
- package/dist/client/assets/review-settings-7WUisQRH.js +0 -1
- package/dist/client/assets/route-CrtRl_aj.js +0 -1
- package/dist/client/assets/route-DStyEO0f.js +0 -1
- package/dist/client/assets/route-ItnObgTw.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-6658FNhj.js +0 -1
- package/dist/client/assets/sections-editor-BnPN3p47.js +0 -1
- package/dist/client/assets/seo-editor-334ImWU2.js +0 -1
- package/dist/client/assets/settings-tab-DCh5Ul7G.js +0 -1
- package/dist/client/assets/site-draft-view-DQTaKqUY.js +0 -1
- package/dist/client/assets/site-editor-4zkxaogV.js +0 -1
- package/dist/client/assets/site-editor-toast-CRsx3bHf.js +0 -1
- package/dist/client/assets/skills-I-Yj8qR2.js +0 -1
- package/dist/client/assets/taskboard-analytics-DGRgeO3t.js +0 -1
- package/dist/client/assets/tasks-DqNpLYyB.js +0 -1
- package/dist/client/assets/thread-analytics-DsWQnd7G.js +0 -1
- package/dist/client/assets/thread-route-oy9R75fs.js +0 -1
- package/dist/client/assets/use-apply-named-rule-BLra67_a.js +0 -1
- package/dist/client/assets/use-ask-in-chat-BGPRlKfS.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-Al0tYlYk.js +0 -1
- package/dist/client/assets/use-connection-D3dXxxHo.js +0 -1
- package/dist/client/assets/use-content-sync-Bqyh9W67.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-s7AmJx8I.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-CO4jdgC_.js +0 -1
- package/dist/client/assets/use-move-blocks-DfWxYCvW.js +0 -1
- package/dist/client/assets/use-sandbox-events-C1Ie1sWJ.js +0 -2
- package/dist/client/assets/useInfiniteQuery-B7UWNEWx.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-TfssA_Zz.js +0 -1
- package/dist/client/assets/watch-sse-pool-ECs_hZYZ.js +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{gS as Ae,gT as Ze,ho as xn,hp as ks,c as U,b as Z,r as H,j as t,B as ee,h as nt,m as ve,_ as Ms,X as _s,Z as Vs,Y as Je,ap as Gt,an as qt,ao as Ht,t as le,R as Xe,a5 as Ee,a6 as Ts,hq as gn,v as it,D as at,y as $t,L as At,I as Ne,F as vn,ai as bn,ah as jn,g7 as $e,as as Ds,g6 as Me,gQ as Oe,ak as ft,d as pt,i as Ps,K as Et,hr as yn,hs as wn,ht as Sn,$ as Ct,c7 as be,hu as we,n as Ke,P as Nn,u as Cn,bx as lt,q as Ft,e as Os,fQ as kn,ac as Mn,x as ht,aT as Is,w as xt,av as _n,dd as Vn,E as _e,bB as Tn,a as Dn,hv as zt,hw as Pn,b3 as On,ag as In,aE as $n,aD as An,by as En,a8 as Fn,hn as zn,aN as Rn,aM as Ln,aJ as Un,aH as Bn,aI as Yn,aL as Wn,aK as Kn,bj as Gn,aS as qn}from"./index-Bm1K3DQC.js";import{g as Hn}from"./extract-connection-data-Cx40NvMQ.js";import{b as Qn}from"./chat-context-DrYmTpG0.js";import{U as Xn,b as Jn}from"./build-improve-prompt-doc-CMFnJqyQ.js";import{E as Zn}from"./empty-state-DQ9zfSjj.js";import{g as ei}from"./shell-layout-DS0Ie03r.js";import{g as gt,n as ti,a as Qt,e as si,u as ni,f as ii}from"./use-date-fns-locale-UVVfd2fe.js";import{a as ai}from"./mcp-oauth-969YqM-_.js";import{T as ut}from"./textarea-BNrj1CIV.js";import{c as Ve,T as Te,a as De}from"./tooltip-D0Aro8zv.js";import{a as Rt,b as $s,u as li}from"./use-connection-D3dXxxHo.js";import{u as As,g as Es,c as ri,i as oi}from"./repository-binding-BUEX4lc5.js";import{i as Xt}from"./mcp-oauth-CeW0VHOL.js";import{bs as ci,m as Fs,bt as di,bu as ui,aW as mi,aB as fi,aF as pi,bv as hi,bw as zs,bx as Rs,by as xi,an as gi,bz as vi,bA as kt,bB as Jt,A as Zt,L as bi,bC as ji,bD as yi,h as Ls,D as es,k as wi,j as Si,az as Ni,n as Ci,v as ki,u as Mi,r as _i,q as Vi,g as Us,e as vt,aR as Ti,ab as Di,O as Pi}from"./agent-icon-Y_Y2D-pt.js";import{s as ze}from"./Plus-BHZhJmPA.js";import{t as dt,a as Oi,b as Ii}from"./Tool01-D5n93WAy.js";import{s as bt}from"./Trash01-C0pW3Nzn.js";import{u as ts}from"./use-debounced-autosave-CcJrNQv9.js";import{A as $i}from"./add-connection-dialog-10mnkwZu.js";import{i as Dt}from"./SearchMd-MlMwcObI.js";import{F as ss}from"./file-type-icon-CuR7GKVO.js";import{k as Ai,l as Ei,p as Fi,q as zi}from"./use-org-fs-Du2G3PF4.js";import{C as Ri}from"./collection-tabs-CXJFRxjE.js";import{T as Bs,u as Ys}from"./use-mcp-auth-status-DNGtFPYZ.js";import{I as jt}from"./integration-icon-DTmGScIa.js";import{C as Li}from"./checkbox-U6ASBfOz.js";import{u as yt}from"./use-mcp-client-WgWOA1hL.js";import{a as Ws}from"./use-mcp-tools-BIB4FISj.js";import{u as Ui}from"./use-mcp-prompts-bAmVEPg_.js";import{g as Bi}from"./connection-slug-rYoZb8Oi.js";import{c as Pe,b as Re,a as Le,d as Ue,S as Be}from"./select-Ce9OTxeg.js";import{s as Ks}from"./XClose-__KXghgf.js";import{t as Pt}from"./utils-CVEq3hMx.js";import{S as rt}from"./switch-5zR0_RyT.js";import{a as Gs,b as qs,P as Hs}from"./popover-Dh3TtwDo.js";import{S as Yi}from"./scroll-area-CXm8-cku.js";import{i as Wi}from"./Upload01-CEfXDErB.js";import{a as Ki}from"./SwitchHorizontal01-DovJE4RJ.js";import{i as Gi}from"./Monitor01-D3lVwo0x.js";import{g as qi}from"./types-1fP0kZ0m.js";import{a as Qs,c as Hi}from"./agent-capabilities-DuBCD3m1.js";import{a as Qi}from"./autosend-Dts_wRXC.js";import{u as Xi,g as Ot,o as ns,r as It,p as Ji,h as Zi,a as ea,i as is,t as ta,j as sa,k as na,b as ia}from"./use-project-native-view-presence-CpBcMOzg.js";import{a as Xs,u as aa,i as la,o as ra,r as as,p as oa,w as ca,b as ls}from"./optimistic-project-sidebar-views-DuRn9Y08.js";import{a as da,P as ua,i as ma}from"./sections-CN3XzQEo.js";import{i as Lt}from"./Key01-EDnnJ_Gd.js";import{u as fa}from"./use-copy-fJBOhwQv.js";import{L as Se}from"./label-BQN74rUh.js";import{h as pa}from"./roles-DW32thi2.js";import{b as ha,u as xa}from"./use-blocks-v8-project-Al0tYlYk.js";import{s as Js,l as ga,v as Zs,r as va}from"./thread-intent-C_sXnvWO.js";import{V as ba,E as wt,R as rs,r as en,C as ja,w as ya}from"./virtual-mcp-CfQIOHDY.js";import{b as wa,a as Sa,D as Na}from"./drawer-CtPWRLqi.js";import{u as Ca}from"./use-mobile-BDHJ5g4G.js";import{d as St}from"./delay-CnY5UFtP.js";import{b as ka}from"./sandbox-url-D3mC8qhT.js";import{S as Ma,a as _a,b as Va}from"./secret-picker-Befw6gF8.js";import{u as Ta,a as Da}from"./use-secrets-blVuAHm2.js";import{o as os}from"./omit-server-managed-metadata-L5IhjRZB.js";import{G as Pa}from"./github-icon-Tj2vKr0A.js";import{R as Oa}from"./repository-picker-mdt05v0y.js";import{n as cs}from"./app-preview-url-9Od4s8Sz.js";import{a as Ia}from"./use-organization-settings-CiRL-ND2.js";import{r as $a}from"./serial-task-queue-CGOeQgpr.js";function st(a,e){const s=gt(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=Ae(a,e?.in),l=i.getDay(),d=(l<n?7:0)+l-n;return i.setDate(i.getDate()-d),i.setHours(0,0,0,0),i}function mt(a,e){return st(a,{...e,weekStartsOn:1})}function tn(a,e){const s=Ae(a,e?.in),n=s.getFullYear(),i=Ze(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=mt(i),d=Ze(s,0);d.setFullYear(n,0,4),d.setHours(0,0,0,0);const r=mt(d);return s.getTime()>=l.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function ds(a,e){const s=Ae(a,e?.in);return s.setHours(0,0,0,0),s}function Aa(a,e,s){const[n,i]=ti(s?.in,a,e),l=ds(n),d=ds(i),r=+l-Qt(l),f=+d-Qt(d);return Math.round((r-f)/xn)}function Ea(a,e){const s=tn(a,e),n=Ze(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function Fa(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function za(a){return!(!Fa(a)&&typeof a!="number"||isNaN(+Ae(a)))}function Ra(a,e){const s=Ae(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function La(a,e){const s=Ae(a,e?.in);return Aa(s,Ra(s))+1}function Ua(a,e){const s=Ae(a,e?.in),n=+mt(s)-+Ea(s);return Math.round(n/ks)+1}function sn(a,e){const s=Ae(a,e?.in),n=s.getFullYear(),i=gt(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=Ze(e?.in||a,0);d.setFullYear(n+1,0,l),d.setHours(0,0,0,0);const r=st(d,e),f=Ze(e?.in||a,0);f.setFullYear(n,0,l),f.setHours(0,0,0,0);const o=st(f,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Ba(a,e){const s=gt(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=sn(a,e),l=Ze(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),st(l,e)}function Ya(a,e){const s=Ae(a,e?.in),n=+st(s,e)-+Ba(s,e);return Math.round(n/ks)+1}function re(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const Fe={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(a,e){return re(a.getDate(),e.length)},a(a,e){const s=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(a,e){return re(a.getHours()%12||12,e.length)},H(a,e){return re(a.getHours(),e.length)},m(a,e){return re(a.getMinutes(),e.length)},s(a,e){return re(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},Qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},us={G:function(a,e,s){const n=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Fe.y(a,e)},Y:function(a,e,s,n){const i=sn(a,n),l=i>0?i:1-i;if(e==="YY"){const d=l%100;return re(d,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):re(l,e.length)},R:function(a,e){const s=tn(a);return re(s,e.length)},u:function(a,e){const s=a.getFullYear();return re(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return Fe.M(a,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(a,e,s){const n=a.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(a,e,s,n){const i=Ya(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(a,e,s){const n=Ua(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):Fe.d(a,e)},D:function(a,e,s){const n=La(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(a,e,s){const n=a.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return re(l,2);case"eo":return s.ordinalNumber(l,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return re(l,e.length);case"co":return s.ordinalNumber(l,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,s){const n=a.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(a,e,s){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,s){const n=a.getHours();let i;switch(n===12?i=Qe.noon:n===0?i=Qe.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,s){const n=a.getHours();let i;switch(n>=17?i=Qe.evening:n>=12?i=Qe.afternoon:n>=4?i=Qe.morning:i=Qe.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Fe.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):Fe.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):Fe.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):Fe.s(a,e)},S:function(a,e){return Fe.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return fs(n);case"XXXX":case"XX":return We(n);default:return We(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return fs(n);case"xxxx":case"xx":return We(n);default:return We(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ms(n,":");default:return"GMT"+We(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ms(n,":");default:return"GMT"+We(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return re(n,e.length)},T:function(a,e,s){return re(+a,e.length)}};function ms(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+re(l,2)}function fs(a,e){return a%60===0?(a>0?"-":"+")+re(Math.abs(a)/60,2):We(a,e)}function We(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=re(Math.trunc(n/60),2),l=re(n%60,2);return s+i+e+l}const ps=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},nn=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Wa=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return ps(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",ps(n,e)).replace("{{time}}",nn(i,e))},Ka={p:nn,P:Wa},Ga=/^D+$/,qa=/^Y+$/,Ha=["D","DD","YY","YYYY"];function Qa(a){return Ga.test(a)}function Xa(a){return qa.test(a)}function Ja(a,e,s){const n=Za(a,e,s);if(console.warn(n),Ha.includes(a))throw new RangeError(n)}function Za(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const el=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sl=/^'([^]*?)'?$/,nl=/''/g,il=/[a-zA-Z]/;function al(a,e,s){const n=gt(),i=s?.locale??n.locale??si,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,d=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Ae(a,s?.in);if(!za(r))throw new RangeError("Invalid time value");let f=e.match(tl).map(p=>{const u=p[0];if(u==="p"||u==="P"){const m=Ka[u];return m(p,i.formatLong)}return p}).join("").match(el).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const u=p[0];if(u==="'")return{isToken:!1,value:ll(p)};if(us[u])return{isToken:!0,value:p};if(u.match(il))throw new RangeError("Format string contains an unescaped latin alphabet character `"+u+"`");return{isToken:!1,value:p}});i.localize.preprocessor&&(f=i.localize.preprocessor(r,f));const o={firstWeekContainsDate:l,weekStartsOn:d,locale:i};return f.map(p=>{if(!p.isToken)return p.value;const u=p.value;(!s?.useAdditionalWeekYearTokens&&Xa(u)||!s?.useAdditionalDayOfYearTokens&&Qa(u))&&Ja(u,e,String(a));const m=us[u[0]];return m(r,u,i.localize,o)}).join("")}function ll(a){const e=a.match(sl);return e?e[1].replace(nl,"'"):a}const an=25*1024*1024,Mt="home",_t="knowledge";function hs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Ye(a){return a.split("/").pop()??a}function rl(a){const e=U.c(64),{form:s}=a,n=Z(),{upload:i}=Ai(Mt),l=Ei(),d=H.useRef(null),[r,f]=H.useState(!1),[o,p]=H.useState(""),[u,m]=H.useState(!1);let h;e[0]!==r?(h={enabled:r},e[0]=r,e[1]=h):h=e[1];const{data:c}=Fi(60,h),x=c===void 0?[]:c;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:v}=zi(g),j=v===void 0?[]:v;let y;e[4]!==s?(y=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=y):y=e[5];const[b,w]=H.useState(y);let S;e[6]!==s?(S=O=>{w(O),s.setValue("metadata.knowledge",O,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const N=S;let C;e[8]!==l||e[9]!==b||e[10]!==N||e[11]!==n||e[12]!==i?(C=async O=>{if(!O||O.length===0)return;const J=Array.from(O),ye=J.filter(pl),pe=J.filter(fl);if(pe.length>0&&le.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:pe.map(ml).join(", ")})}),ye.length!==0){try{await i.mutateAsync({dir:_t,files:ye})}catch(D){const oe=D;le.error(oe instanceof Error?oe.message:n("virtualMcp.filesSection.failedUploadFile"));return}N([...b,...ye.map(D=>({id:crypto.randomUUID(),name:D.name,volume:Mt,path:`${_t}/${D.name}`,url:l(Mt,`${_t}/${D.name}`),contentType:D.type||null,size:D.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=N,e[11]=n,e[12]=i,e[13]=C):C=e[13];const M=C;let T;e[14]!==l||e[15]!==b||e[16]!==N?(T=O=>{b.some(J=>J.volume===O.volume&&J.path===O.path)||(N([...b,{id:crypto.randomUUID(),name:Ye(O.path),volume:O.volume,path:O.path,url:l(O.volume,O.path),contentType:null,size:O.size??null,addedAt:new Date().toISOString()}]),f(!1))},e[14]=l,e[15]=b,e[16]=N,e[17]=T):T=e[17];const V=T;let _;e[18]!==l||e[19]!==b||e[20]!==N?(_=O=>{b.some(J=>J.volume===O.volume&&J.path===O.path)||(N([...b,{id:crypto.randomUUID(),name:Ye(O.path),kind:"skill",volume:O.volume,path:O.path,url:l(O.volume,O.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),f(!1))},e[18]=l,e[19]=b,e[20]=N,e[21]=_):_=e[21];const E=_;let P;e[22]!==b||e[23]!==N?(P=O=>{N(b.filter(J=>J.id!==O))},e[22]=b,e[23]=N,e[24]=P):P=e[24];const A=P;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=O=>{f(O),O&&p("")},e[25]=I):I=e[25];const K=I;let Q;e[26]!==b?(Q=new Set(b.map(ul)),e[26]=b,e[27]=Q):Q=e[27];const R=Q,F=o.toLowerCase();let Y;e[28]!==R?(Y=O=>!R.has(`${O.volume}/${O.path}`),e[28]=R,e[29]=Y):Y=e[29];const z=x.filter(dl).filter(Y).filter(O=>Ye(O.path).toLowerCase().includes(F)).slice(0,5);let L;e[30]!==R?(L=O=>!R.has(`${O.volume}/${O.path}`),e[30]=R,e[31]=L):L=e[31];const W=j.filter(L).filter(O=>Ye(O.path).toLowerCase().includes(F)).slice(0,5),G=O=>t.jsxs(Ms,{open:r,onOpenChange:K,children:[t.jsx(_s,{asChild:!0,children:O}),t.jsxs(Vs,{align:"end",className:"w-56",children:[t.jsxs(Je,{onSelect:()=>{d.current?.click()},children:[t.jsx(ci,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Gt,{children:[t.jsxs(qt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Fs,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Ht,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:J=>p(J.target.value),onKeyDown:cl,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:z.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):z.map(J=>t.jsxs(Je,{onSelect:()=>V(J),children:[t.jsx(ss,{filename:Ye(J.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ye(J.path)}),J.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:hs(J.size)})]},`${J.volume}/${J.path}`))})]})]}),t.jsxs(Gt,{children:[t.jsxs(qt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(dt,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Ht,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:J=>p(J.target.value),onKeyDown:ol,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:W.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):W.map(J=>t.jsxs(Je,{onSelect:()=>E(J),children:[t.jsx(dt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ye(J.path)})]},`${J.volume}/${J.path}`))})]})]})]})]}),se="flex flex-col gap-3";let te;e[32]!==n?(te=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=te):te=e[33];let k;e[34]!==te?(k=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:te}),e[34]=te,e[35]=k):k=e[35];let $;e[36]!==n?($=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=$):$=e[37];let q;e[38]!==$?(q=t.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=q):q=e[39];let B;e[40]!==k||e[41]!==q?(B=t.jsxs("div",{className:"flex flex-col gap-1",children:[k,q]}),e[40]=k,e[41]=q,e[42]=B):B=e[42];const X=b.length>0&&G(t.jsxs(ee,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(nt,{size:"xs"}):t.jsx(ze,{size:14}),n("virtualMcp.filesSection.add")]}));let ae;e[43]!==B||e[44]!==X?(ae=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[B,X]}),e[43]=B,e[44]=X,e[45]=ae):ae=e[45];let je;e[46]!==M?(je=t.jsx("input",{ref:d,type:"file",multiple:!0,className:"hidden",onChange:O=>{M(O.target.files),O.target.value=""}}),e[46]=M,e[47]=je):je=e[47];let ie,ce;e[48]===Symbol.for("react.memo_cache_sentinel")?(ie=O=>{O.preventDefault(),m(!0)},ce=()=>m(!1),e[48]=ie,e[49]=ce):(ie=e[48],ce=e[49]);let ue;e[50]!==M?(ue=O=>{O.preventDefault(),O.stopPropagation(),m(!1),M(O.dataTransfer.files)},e[50]=M,e[51]=ue):ue=e[51];const ge=u&&"outline outline-2 outline-dashed outline-primary";let de;e[52]!==ge?(de=ve("flex flex-col gap-2 rounded-lg",ge),e[52]=ge,e[53]=de):de=e[53];const he=b.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(ze,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(O=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[O.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(dt,{size:16})}):t.jsx(ss,{filename:O.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:O.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:O.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):O.size!=null?hs(O.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>A(O.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:O.name}),children:t.jsx(bt,{size:16})})]},O.id));let me;e[54]!==ie||e[55]!==ce||e[56]!==ue||e[57]!==de||e[58]!==he?(me=t.jsx("div",{onDragOver:ie,onDragLeave:ce,onDrop:ue,className:de,children:he}),e[54]=ie,e[55]=ce,e[56]=ue,e[57]=de,e[58]=he,e[59]=me):me=e[59];let fe;return e[60]!==ae||e[61]!==je||e[62]!==me?(fe=t.jsxs("section",{className:se,children:[ae,je,me]}),e[60]=ae,e[61]=je,e[62]=me,e[63]=fe):fe=e[63],fe}function ol(a){return a.stopPropagation()}function cl(a){return a.stopPropagation()}function dl(a){return a.kind!=="dir"}function ul(a){return`${a.volume}/${a.path}`}function ml(a){return a.name}function fl(a){return a.size>an}function pl(a){return a.size<=an}function tt(){const a=U.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(nt,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function ct(a,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ts,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function ln(a){const e=U.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,d=l?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-accent";let f;e[0]!==d||e[1]!==r?(f=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",d,r),e[0]=d,e[1]=r,e[2]=f):f=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let p;e[5]!==s.tags?(p=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=p):p=e[6];let u;e[7]!==o||e[8]!==p?(u=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,p]}),e[7]=o,e[8]=p,e[9]=u):u=e[9];let m;e[10]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=m):m=e[11];let h;e[12]!==u||e[13]!==m?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[u,m]}),e[12]=u,e[13]=m,e[14]=h):h=e[14];let c;e[15]!==l||e[16]!==n||e[17]!==i?(c=t.jsx(Li,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=n,e[17]=i,e[18]=c):c=e[18];let x;return e[19]!==f||e[20]!==h||e[21]!==c?(x=t.jsxs("label",{className:f,children:[h,c]}),e[19]=f,e[20]=h,e[21]=c,e[22]=x):x=e[22],x}function hl(a){const e=U.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:d}=a,r=Z();let f;e[0]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=f):f=e[1];let o;e[2]!==f?(o={id:"tools",label:f},e[2]=f,e[3]=o):o=e[3];let p;e[4]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=p):p=e[5];let u;e[6]!==p?(u={id:"active",label:p},e[6]=p,e[7]=u):u=e[7];let m;e[8]!==r?(m=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=m):m=e[9];let h;e[10]!==m?(h={id:"resources",label:m},e[10]=m,e[11]=h):h=e[11];let c;e[12]!==r?(c=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=c):c=e[13];let x;e[14]!==c?(x={id:"prompts",label:c},e[14]=c,e[15]=x):x=e[15];let g;e[16]!==o||e[17]!==u||e[18]!==h||e[19]!==x?(g=[o,u,h,x],e[16]=o,e[17]=u,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=w=>n(w),e[21]=n,e[22]=v):v=e[22];let j;e[23]!==s||e[24]!==v||e[25]!==g?(j=t.jsx(Ri,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=j):j=e[26];let y;e[27]!==d||e[28]!==l||e[29]!==i||e[30]!==r?(y=i&&t.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=d,e[28]=l,e[29]=i,e[30]=r,e[31]=y):y=e[31];let b;return e[32]!==j||e[33]!==y?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[j,y]}),e[32]=j,e[33]=y,e[34]=b):b=e[34],b}function Ut(a){const e=U.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:d}=a;let r,f,o;if(e[0]!==d||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const u=s.map(xl);if(s.length===0){let m;e[8]!==l?(m=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=m):m=e[9],o=m;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",f=s.map(m=>t.jsx(ln,{item:m,isSelected:n===null||n?.includes(m.id),onToggle:()=>i(m.id,u),disabled:d},m.id))}e[0]=d,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=f,e[7]=o}else r=e[5],f=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let p;return e[10]!==r||e[11]!==f?(p=t.jsx("div",{className:r,children:f}),e[10]=r,e[11]=f,e[12]=p):p=e[12],p}function xl(a){return a.id}function gl(a){const e=U.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=Z(),{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ws(o),u=p.tools;let m,h,c;if(e[6]!==p.tools||e[7]!==i||e[8]!==l||e[9]!==n){c=Symbol.for("react.early_return_sentinel");e:{const g=u.map(bl);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const y=p.tools.filter(v).map(vl);if(y.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let w;e[17]!==b?(w=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=w):w=e[18],c=w;break e}m="flex-1 overflow-auto px-4 py-3 space-y-1",h=y.map(b=>t.jsx(ln,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=p.tools,e[7]=i,e[8]=l,e[9]=n,e[10]=m,e[11]=h,e[12]=c}else m=e[10],h=e[11],c=e[12];if(c!==Symbol.for("react.early_return_sentinel"))return c;let x;return e[19]!==m||e[20]!==h?(x=t.jsx("div",{className:m,children:h}),e[19]=m,e[20]=h,e[21]=x):x=e[21],x}function vl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Bs,{annotations:a.annotations,_meta:a._meta})}}function bl(a){return a.name}function jl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ws(o);let u;e[6]!==p.tools?(u=p.tools.map(yl),e[6]=p.tools,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function yl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Bs,{annotations:a.annotations,_meta:a._meta})}}function wl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=gn(o);let u;e[6]!==p.resources?(u=p.resources.map(Sl),e[6]=p.resources,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function Sl(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function Nl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ui(o);let u;e[6]!==p.prompts?(u=p.prompts.map(Cl),e[6]=p.prompts,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function Cl(a){return{id:a.name,name:a.name,description:a.description}}function kl(a){const e=U.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:d,toggleResource:r,togglePrompt:f,toggleAllTools:o,toggleAllResources:p,toggleAllPrompts:u,onTabChange:m}=a,h=Z(),c=l[i],x=n==="tools"?c?.tools===null:n==="resources"?c?.resources===null:n==="prompts"?c?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==u||e[3]!==p||e[4]!==o?(v=()=>{n==="tools"?o(i):n==="resources"?p(i):n==="prompts"&&u(i)},e[0]=n,e[1]=i,e[2]=u,e[3]=p,e[4]=o,e[5]=v):v=e[5];const j=v;let y;e[6]!==s.icon||e[7]!==s.title?(y=t.jsx(jt,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=y):y=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let w;e[11]!==s.description?(w=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=w):w=e[12];let S;e[13]!==b||e[14]!==w?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,w]}),e[13]=b,e[14]=w,e[15]=S):S=e[15];let N;e[16]!==y||e[17]!==S?(N=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[y,S]})}),e[16]=y,e[17]=S,e[18]=N):N=e[18];let C;e[19]!==n||e[20]!==j||e[21]!==x||e[22]!==m||e[23]!==g?(C=t.jsx(hl,{activeTab:n,onTabChange:m,showSelectAll:g,isAllSelected:x,handleSelectAll:j}),e[19]=n,e[20]=j,e[21]=x,e[22]=m,e[23]=g,e[24]=C):C=e[24];let M;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==d?(M=n==="active"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(gl,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(A,I)=>d(i,A,I)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=d,e[30]=M):M=e[30];let T;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==d?(T=n==="tools"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(jl,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(A,I)=>d(i,A,I)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=d,e[36]=T):T=e[36];let V;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==r?(V=n==="resources"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(wl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(A,I)=>r(i,A,I)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=r,e[42]=V):V=e[42];let _;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==f?(_=n==="prompts"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(Nl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(A,I)=>f(i,A,I)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=f,e[48]=_):_=e[48];let E;e[49]!==V||e[50]!==_||e[51]!==M||e[52]!==T?(E=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[M,T,V,_]}),e[49]=V,e[50]=_,e[51]=M,e[52]=T,e[53]=E):E=e[53];let P;return e[54]!==E||e[55]!==N||e[56]!==C?(P=t.jsxs(t.Fragment,{children:[N,C,E]}),e[54]=E,e[55]=N,e[56]=C,e[57]=P):P=e[57],P}function Ml(a){const e=U.c(7),{onClose:s}=a,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let d;return e[4]!==i||e[5]!==l?(d=t.jsx($t,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(ee,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=d):d=e[6],d}function _l(a){const e=U.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=Z();let d;e[0]!==s?(d={connectionId:s},e[0]=s,e[1]=d):d=e[1];const r=Ys(d);if(r.supportsOAuth&&!r.isAuthenticated){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(di,{size:22,className:"text-muted-foreground"})}),e[2]=p):p=e[2];let u;e[3]!==l?(u=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=u):u=e[4];let m;e[5]!==u?(m=t.jsx("p",{className:"text-sm font-medium",children:u}),e[5]=u,e[6]=m):m=e[6];let h;e[7]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=h):h=e[8];let c;e[9]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=c):c=e[10];let x;e[11]!==m||e[12]!==c?(x=t.jsxs("div",{className:"space-y-1",children:[m,c]}),e[11]=m,e[12]=c,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==l?(g=n&&t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[p,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function Vl(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function xs(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function gs(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function Tl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function Dl(a){const e=U.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:d,onAuthenticate:r}=a;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={activeTab:"tools"},e[0]=f):f=e[0];const[o,p]=H.useReducer(Tl,f),u=Rt(i??"");let m;e[1]!==d?(m=d??[],e[1]=d,e[2]=m):m=e[2];let h;e[3]!==m?(h=Vl(m),e[3]=m,e[4]=h):h=e[4];const c=h;let x;e[5]!==l||e[6]!==c?(x=(z,L,W,G)=>{const se=c[z]?.[L];let te;se===null?te=G.filter(k=>k!==W):se?.includes(W)?te=se.filter(k=>k!==W):(te=[...se??[],W],te.length===G.length&&(te=null)),l.setValue("connections",xs(gs(c,z,L,te)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=c,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==c?(v=(z,L)=>{const G=c[z]?.[L]===null?[]:null;l.setValue("connections",xs(gs(c,z,L,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=c,e[10]=v):v=e[10];const j=v;let y;e[11]!==g?(y=(z,L,W)=>g(z,"tools",L,W),e[11]=g,e[12]=y):y=e[12];const b=y;let w;e[13]!==g?(w=(z,L,W)=>g(z,"resources",L,W),e[13]=g,e[14]=w):w=e[14];const S=w;let N;e[15]!==g?(N=(z,L,W)=>g(z,"prompts",L,W),e[15]=g,e[16]=N):N=e[16];const C=N;let M;e[17]!==j?(M=z=>j(z,"tools"),e[17]=j,e[18]=M):M=e[18];const T=M;let V;e[19]!==j?(V=z=>j(z,"resources"),e[19]=j,e[20]=V):V=e[20];const _=V;let E;e[21]!==j?(E=z=>j(z,"prompts"),e[21]=j,e[22]=E):E=e[22];const P=E;if(!i||!u)return null;let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(tt,{}),e[23]=A):A=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=z=>p({type:"SET_ACTIVE_TAB",payload:z}),e[24]=I):I=e[24];let K;e[25]!==u||e[26]!==o.activeTab||e[27]!==c||e[28]!==i||e[29]!==P||e[30]!==_||e[31]!==T||e[32]!==C||e[33]!==S||e[34]!==b?(K=t.jsx(kl,{currentConnection:u,activeTab:o.activeTab,selectedId:i,formData:c,toggleTool:b,toggleResource:S,togglePrompt:C,toggleAllTools:T,toggleAllResources:_,toggleAllPrompts:P,onTabChange:I},i),e[25]=u,e[26]=o.activeTab,e[27]=c,e[28]=i,e[29]=P,e[30]=_,e[31]=T,e[32]=C,e[33]=S,e[34]=b,e[35]=K):K=e[35];let Q;e[36]!==r||e[37]!==i||e[38]!==K?(Q=t.jsx(H.Suspense,{fallback:A,children:t.jsx(_l,{connectionId:i,onAuthenticate:r,children:K})}),e[36]=r,e[37]=i,e[38]=K,e[39]=Q):Q=e[39];let R;e[40]!==n?(R=t.jsx(Ml,{onClose:n}),e[40]=n,e[41]=R):R=e[41];let F;e[42]!==Q||e[43]!==R?(F=t.jsxs(it,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[Q,R]}),e[42]=Q,e[43]=R,e[44]=F):F=e[44];let Y;return e[45]!==n||e[46]!==s||e[47]!==F?(Y=t.jsx(at,{open:s,onOpenChange:n,children:F}),e[45]=n,e[46]=s,e[47]=F,e[48]=Y):Y=e[48],Y}const vs="__new_instance__";function Pl(a){const e=U.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:d,onSwitchInstance:r,onNewInstance:f}=a,o=Rt(s),{org:p}=Ee();if(!o){let g;return e[0]!==l?(g=t.jsx(Al,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let u;e[2]!==o?(u=Bi(o),e[2]=o,e[3]=u):u=e[3];const m=u;let h;e[4]!==s?(h=t.jsx($l,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==d||e[14]!==f||e[15]!==i||e[16]!==l||e[17]!==r||e[18]!==p.slug||e[19]!==m||e[20]!==n?(c=t.jsx(Il,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:m,orgSlug:p.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:d,onSwitchInstance:r,onNewInstance:f}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=d,e[14]=f,e[15]=i,e[16]=l,e[17]=r,e[18]=p.slug,e[19]=m,e[20]=n,e[21]=c):c=e[21];let x;return e[22]!==h||e[23]!==c?(x=t.jsx(H.Suspense,{fallback:h,children:c}),e[22]=h,e[23]=c,e[24]=x):x=e[24],x}function Ol(a){const e=U.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:d}=a,r=Z();let f;e[0]!==s?(f={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=f):f=e[1];const o=li(f);if(o.length<=1&&!d)return null;let p;e[2]!==n||e[3]!==d||e[4]!==l?(p=g=>{g===vs?d?.():l(n,g)},e[2]=n,e[3]=d,e[4]=l,e[5]=p):p=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Re,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Le,{})}),e[6]=u):u=e[6];let m;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(Pe,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],m=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=m}else m=e[10];let h;e[14]!==d||e[15]!==r?(h=d&&t.jsxs(Pe,{value:vs,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=d,e[15]=r,e[16]=h):h=e[16];let c;e[17]!==m||e[18]!==h?(c=t.jsxs(Ue,{children:[m,h]}),e[17]=m,e[18]=h,e[19]=c):c=e[19];let x;return e[20]!==n||e[21]!==p||e[22]!==c?(x=t.jsxs(Be,{value:n,onValueChange:p,children:[u,c]}),e[20]=n,e[21]=p,e[22]=c,e[23]=x):x=e[23],x}function Il({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:d,orgSlug:r,appName:f,usedConnectionIds:o,onOpenSettings:p,onRemove:u,onAuthenticate:m,onSwitchInstance:h,onNewInstance:c}){const x=Ys({connectionId:a}),g=$s(),j=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,y=l!=="active",b=Z(),w=async S=>{try{await g.update.mutateAsync({id:a,data:{status:S}}),le.success(b(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{le.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("surface overflow-hidden transition-colors",(j||y)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(At,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:d},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors",children:[t.jsx(jt,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),j?t.jsx(ee,{variant:"outline",size:"sm",className:"shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),m(a)},children:b("virtualMcp.connectionItem.authorize")}):y?t.jsxs(ee,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),w("active")},children:[t.jsx(ui,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(Oi,{size:16})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[f&&t.jsx(Ol,{appName:f,connectionId:a,usedConnectionIds:o,onSwitchInstance:h,onNewInstance:c}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",onClick:p,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(mi,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!y&&t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>w("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(fi,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",onClick:u,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Ks,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function $l(a){const e=U.c(17),{connection_id:s}=a,n=Rt(s);if(!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(rn,{}),e[0]=u):u=e[0],u}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(jt,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let d;e[6]!==n.description?(d=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=d):d=e[7];let r;e[8]!==l||e[9]!==d?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,d]}),e[8]=l,e[9]=d,e[10]=r):r=e[10];let f;e[11]!==i||e[12]!==r?(f=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=f):f=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let p;return e[15]!==f?(p=t.jsxs("div",{className:"surface overflow-hidden",children:[f,o]}),e[15]=f,e[16]=p):p=e[16],p}function Al(a){const e=U.c(20),{onRemove:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==n?(d=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=d):d=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ks,{size:13}),e[6]=r):r=e[6];let f;e[7]!==s||e[8]!==d?(f=t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":d,children:r})}),e[7]=s,e[8]=d,e[9]=f):f=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let p;e[12]!==o?(p=t.jsx(De,{side:"bottom",children:o}),e[12]=o,e[13]=p):p=e[13];let u;e[14]!==f||e[15]!==p?(u=t.jsxs(Ve,{delayDuration:0,children:[f,p]}),e[14]=f,e[15]=p,e[16]=u):u=e[16];let m;return e[17]!==l||e[18]!==u?(m=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,u]}),e[17]=l,e[18]=u,e[19]=m):m=e[19],m}function rn(){const a=U.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=n):n=a[2],n}function on(a){const e=U.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:d,className:r,avatarClassName:f,showHoverOverlay:o,disabled:p}=a,u=d===void 0?"lg":d,m=o===void 0?!0:o,h=p===void 0?!1:p,c=Z(),[x,g]=H.useState(!1),[v,j]=H.useState("icons"),[y,b]=H.useState(""),[w,S]=H.useState("blue");let N;e[0]!==s?(N=pi(s),e[0]=s,e[1]=N):N=e[1];const C=N,M=C.type==="icon"||C.type==="url"&&C.color?C.color:w;let T;e[2]!==n||e[3]!==M?(T=pe=>{n(kt(pe,M))},e[2]=n,e[3]=M,e[4]=T):T=e[4];const V=T;let _;e[5]!==n||e[6]!==i||e[7]!==C.name||e[8]!==C.type||e[9]!==C.url?(_=pe=>{S(pe),i?.(pe),C.type==="icon"?n(kt(C.name,pe)):C.type==="url"&&n(Jt(C.url,pe))},e[5]=n,e[6]=i,e[7]=C.name,e[8]=C.type,e[9]=C.url,e[10]=_):_=e[10];const E=_;let P;e[11]!==n||e[12]!==M?(P=pe=>{n(Jt(pe,M)),g(!1)},e[11]=n,e[12]=M,e[13]=P):P=e[13];const A=P;let I;e[14]!==n||e[15]!==M?(I=()=>{const pe=zs(),D=pe[Math.floor(Math.random()*pe.length)];n(kt(D,M))},e[14]=n,e[15]=M,e[16]=I):I=e[16];const K=I,Q=h?!1:x;let R;e[17]!==c?(R=c("common.iconPicker.changeIcon"),e[17]=c,e[18]=R):R=e[18];const F=h?"cursor-default opacity-50":"cursor-pointer";let Y;e[19]!==r||e[20]!==u||e[21]!==F?(Y=ve("relative group overflow-hidden",F,hi(u),r),e[19]=r,e[20]=u,e[21]=F,e[22]=Y):Y=e[22];let z;e[23]!==f||e[24]!==l||e[25]!==u||e[26]!==s?(z=t.jsx(Zt,{icon:s,name:l,size:u,className:f}),e[23]=f,e[24]=l,e[25]=u,e[26]=s,e[27]=z):z=e[27];let L;e[28]!==h||e[29]!==m?(L=m&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(bi,{size:16,className:"text-white"})}),e[28]=h,e[29]=m,e[30]=L):L=e[30];let W;e[31]!==h||e[32]!==R||e[33]!==Y||e[34]!==z||e[35]!==L?(W=t.jsx(Gs,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":R,disabled:h,className:Y,children:[z,L]})}),e[31]=h,e[32]=R,e[33]=Y,e[34]=z,e[35]=L,e[36]=W):W=e[36];let G;e[37]!==l||e[38]!==s?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Zt,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=G):G=e[39];let se;e[40]!==v?(se=pe=>{if(pe.key!=="ArrowLeft"&&pe.key!=="ArrowRight")return;pe.preventDefault();const D=v==="icons"?"upload":"icons";j(D),document.getElementById(`icon-picker-tab-${D}`)?.focus()},e[40]=v,e[41]=se):se=e[41];const te=v==="icons",k=v==="icons"?0:-1;let $;e[42]===Symbol.for("react.memo_cache_sentinel")?($=()=>j("icons"),e[42]=$):$=e[42];const q=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let B;e[43]!==q?(B=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",q),e[43]=q,e[44]=B):B=e[44];let X;e[45]!==c?(X=c("common.iconPicker.iconsTab"),e[45]=c,e[46]=X):X=e[46];let ae;e[47]!==te||e[48]!==k||e[49]!==B||e[50]!==X?(ae=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":te,"aria-controls":"icon-picker-panel-icons",tabIndex:k,onClick:$,className:B,children:X}),e[47]=te,e[48]=k,e[49]=B,e[50]=X,e[51]=ae):ae=e[51];const je=v==="upload",ie=v==="upload"?0:-1;let ce;e[52]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>j("upload"),e[52]=ce):ce=e[52];const ue=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ge;e[53]!==ue?(ge=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ue),e[53]=ue,e[54]=ge):ge=e[54];let de;e[55]!==c?(de=c("common.iconPicker.uploadTab"),e[55]=c,e[56]=de):de=e[56];let he;e[57]!==je||e[58]!==ie||e[59]!==ge||e[60]!==de?(he=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":je,"aria-controls":"icon-picker-panel-upload",tabIndex:ie,onClick:ce,className:ge,children:de}),e[57]=je,e[58]=ie,e[59]=ge,e[60]=de,e[61]=he):he=e[61];let me;e[62]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("div",{className:"flex-1"}),e[62]=me):me=e[62];let fe;e[63]!==se||e[64]!==ae||e[65]!==he?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:se,children:[ae,he,me]}),e[63]=se,e[64]=ae,e[65]=he,e[66]=fe):fe=e[66];let O;e[67]!==E||e[68]!==K||e[69]!==V||e[70]!==A||e[71]!==C.name||e[72]!==C.type||e[73]!==y||e[74]!==M||e[75]!==v?(O=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Rl,{search:y,onSearchChange:b,selectedColor:M,onColorChange:E,onSelectIcon:V,onRandom:K,currentIconName:C.type==="icon"?C.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Ll,{onUpload:A})}),e[67]=E,e[68]=K,e[69]=V,e[70]=A,e[71]=C.name,e[72]=C.type,e[73]=y,e[74]=M,e[75]=v,e[76]=O):O=e[76];let J;e[77]!==G||e[78]!==fe||e[79]!==O?(J=t.jsx(qs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:El,children:t.jsxs("div",{className:"flex flex-col",children:[G,fe,O]})}),e[77]=G,e[78]=fe,e[79]=O,e[80]=J):J=e[80];let ye;return e[81]!==W||e[82]!==J||e[83]!==Q?(ye=t.jsxs(Hs,{open:Q,onOpenChange:g,children:[W,J]}),e[81]=W,e[82]=J,e[83]=Q,e[84]=ye):ye=e[84],ye}function El(a){return a.preventDefault()}function Fl(a){const e=U.c(33),{selectedColor:s,onColorChange:n}=a,i=Z(),[l,d]=H.useState(!1);let r,f,o,p,u,m,h;if(e[0]!==l||e[1]!==s){const w=Rs(s);f=Hs,m=l,h=d,r=Gs,u=!0,o="button",p=ve("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",w.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=r,e[3]=f,e[4]=o,e[5]=p,e[6]=u,e[7]=m,e[8]=h}else r=e[2],f=e[3],o=e[4],p=e[5],u=e[6],m=e[7],h=e[8];let c;e[9]!==i?(c=i("common.iconPicker.changeColor"),e[9]=i,e[10]=c):c=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==o||e[14]!==p||e[15]!==c||e[16]!==x?(g=t.jsx("button",{type:o,className:p,title:c,"aria-label":x}),e[13]=o,e[14]=p,e[15]=c,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==r||e[19]!==u||e[20]!==g?(v=t.jsx(r,{asChild:u,children:g}),e[18]=r,e[19]=u,e[20]=g,e[21]=v):v=e[21];let j;e[22]!==n||e[23]!==s?(j=yi.map(w=>t.jsx("button",{type:"button",onClick:()=>{n(w.name),d(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",w.dot,s===w.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:w.name,"aria-label":w.name},w.name)),e[22]=n,e[23]=s,e[24]=j):j=e[24];let y;e[25]!==j?(y=t.jsx(qs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:zl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:j})}),e[25]=j,e[26]=y):y=e[26];let b;return e[27]!==f||e[28]!==y||e[29]!==m||e[30]!==h||e[31]!==v?(b=t.jsxs(f,{open:m,onOpenChange:h,children:[v,y]}),e[27]=f,e[28]=y,e[29]=m,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function zl(a){return a.preventDefault()}function Rl(a){const e=U.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:d,onRandom:r,currentIconName:f}=a,o=Z();let p,u,m,h,c,x,g;if(e[0]!==f||e[1]!==l||e[2]!==r||e[3]!==n||e[4]!==d||e[5]!==s||e[6]!==i||e[7]!==o){const w=zs(),S=Rs(i);u=xi(w,s),x="flex flex-col";let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Dt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=N):N=e[15];let C;e[16]!==n?(C=I=>n(I.target.value),e[16]=n,e[17]=C):C=e[17];let M;e[18]!==o?(M=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=M):M=e[19];let T;e[20]!==s||e[21]!==C||e[22]!==M?(T=t.jsxs("div",{className:"relative flex-1",children:[N,t.jsx(Ne,{value:s,onChange:C,placeholder:M,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=C,e[22]=M,e[23]=T):T=e[23];let V;e[24]!==o?(V=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=V):V=e[25];let _;e[26]!==o?(_=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=_):_=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ji,{className:"size-3.5 text-muted-foreground"}),e[28]=E):E=e[28];let P;e[29]!==r||e[30]!==V||e[31]!==_?(P=t.jsx(ee,{type:"button",variant:"outline",size:"icon",onClick:r,className:"shrink-0",title:V,"aria-label":_,children:E}),e[29]=r,e[30]=V,e[31]=_,e[32]=P):P=e[32];let A;e[33]!==l||e[34]!==i?(A=t.jsx(Fl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=A):A=e[35],e[36]!==P||e[37]!==A||e[38]!==T?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[T,P,A]}),e[36]=P,e[37]=A,e[38]=T,e[39]=g):g=e[39],p=Yi,c="h-56",m="grid grid-cols-9 gap-0.5 px-2 pb-2",h=u.map(I=>{const K=gi(I);return K?t.jsx("button",{type:"button",onClick:()=>d(I),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",f===I?ve(S.bg,S.text):ve(S.text,"hover:bg-accent")),title:I,"aria-label":vi(I),children:t.jsx(K,{size:18})},I):null}),e[0]=f,e[1]=l,e[2]=r,e[3]=n,e[4]=d,e[5]=s,e[6]=i,e[7]=o,e[8]=p,e[9]=u,e[10]=m,e[11]=h,e[12]=c,e[13]=x,e[14]=g}else p=e[8],u=e[9],m=e[10],h=e[11],c=e[12],x=e[13],g=e[14];let v;e[40]!==m||e[41]!==h?(v=t.jsx("div",{className:m,children:h}),e[40]=m,e[41]=h,e[42]=v):v=e[42];let j;e[43]!==u.length||e[44]!==o?(j=u.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=u.length,e[44]=o,e[45]=j):j=e[45];let y;e[46]!==p||e[47]!==c||e[48]!==v||e[49]!==j?(y=t.jsxs(p,{className:c,children:[v,j]}),e[46]=p,e[47]=c,e[48]=v,e[49]=j,e[50]=y):y=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==y?(b=t.jsxs("div",{className:x,children:[g,y]}),e[51]=x,e[52]=g,e[53]=y,e[54]=b):b=e[54],b}function Ll(a){const e=U.c(46),{onUpload:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==s||e[1]!==n?(l=P=>{const A=P.target.files?.[0];if(!A)return;if(A.size>2097152){le.error(n("common.iconPicker.imageTooLarge")),P.target.value="";return}const I=new FileReader;I.onerror=()=>{le.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&s(I.result),i.current&&(i.current.value="")},I.readAsDataURL(A)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const d=l,[r,f]=H.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const P=r.trim();P&&(s(P),f(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const p=o;let u;e[6]!==d?(u=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:d}),e[6]=d,e[7]=u):u=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=()=>i.current?.click(),e[8]=m):m=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Wi,{size:20}),e[9]=h):h=e[9];let c;e[10]!==n?(c=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=c):c=e[11];let x;e[12]!==c?(x=t.jsxs("button",{type:"button",onClick:m,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:c})]}),e[12]=c,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=j):j=e[18];let y;e[19]!==v?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[v,j]}),e[19]=v,e[20]=y):y=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=P=>f(P.target.value),e[21]=b):b=e[21];let w;e[22]!==n?(w=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=w):w=e[23];let S;e[24]!==p?(S=P=>{P.key==="Enter"&&(P.preventDefault(),p())},e[24]=p,e[25]=S):S=e[25];let N;e[26]!==r||e[27]!==w||e[28]!==S?(N=t.jsx(Ne,{value:r,onChange:b,placeholder:w,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=r,e[27]=w,e[28]=S,e[29]=N):N=e[29];let C;e[30]!==r?(C=r.trim(),e[30]=r,e[31]=C):C=e[31];const M=!C;let T;e[32]!==n?(T=n("common.iconPicker.apply"),e[32]=n,e[33]=T):T=e[33];let V;e[34]!==p||e[35]!==M||e[36]!==T?(V=t.jsx(ee,{variant:"outline",className:"shrink-0",onClick:p,disabled:M,children:T}),e[34]=p,e[35]=M,e[36]=T,e[37]=V):V=e[37];let _;e[38]!==N||e[39]!==V?(_=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,V]}),e[38]=N,e[39]=V,e[40]=_):_=e[40];let E;return e[41]!==y||e[42]!==_||e[43]!==u||e[44]!==x?(E=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[u,x,y,_]}),e[41]=y,e[42]=_,e[43]=u,e[44]=x,e[45]=E):E=e[45],E}function Ul(a){const e=U.c(14),{viewId:s}=a;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ls,{size:16}),e[0]=i):i=e[0],i}if(s==="context"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Fs,{size:16}),e[1]=i):i=e[1],i}if(s==="monitor"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(wi,{size:16}),e[2]=i):i=e[2],i}if(s==="plan"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Si,{size:16}),e[3]=i):i=e[3],i}if(s==="reports"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ni,{size:16}),e[4]=i):i=e[4],i}if(s==="board"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ci,{size:16}),e[5]=i):i=e[5],i}if(s==="site-editor"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Gi,{size:16}),e[6]=i):i=e[6],i}if(s==="assets"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ii,{size:16}),e[7]=i):i=e[7],i}if(s==="releases"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ki,{size:16}),e[8]=i):i=e[8],i}if(s==="hosting"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(bn,{size:16}),e[9]=i):i=e[9],i}if(s==="e2e"){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Mi,{size:16}),e[10]=i):i=e[10],i}if(s==="calendar"){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_i,{size:16}),e[11]=i):i=e[11],i}if(s==="experiments"){let i;return e[12]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Vi,{size:16}),e[12]=i):i=e[12],i}let n;return e[13]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Us,{size:16}),e[13]=n):n=e[13],n}function cn(a){const e=U.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:d}=a,r=Z(),f=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==f?(o=ve("size-7",f),e[0]=f,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==r?(p=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=p):p=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(es,{size:16}),e[5]=u):u=e[5];let m;e[6]!==l||e[7]!==s||e[8]!==o||e[9]!==p?(m=t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon",className:o,"aria-label":p,"aria-pressed":s,onClick:l,children:u})}),e[6]=l,e[7]=s,e[8]=o,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==s||e[12]!==r?(h=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=h):h=e[13];let c;e[14]!==h?(c=t.jsx(De,{side:"top",children:h}),e[14]=h,e[15]=c):c=e[15];let x;e[16]!==m||e[17]!==c?(x=t.jsxs(Ve,{delayDuration:0,children:[m,c]}),e[16]=m,e[17]=c,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ki,{size:16}),e[21]=v):v=e[21];let j;e[22]!==g?(j=t.jsx(_s,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=j):j=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(vn,{size:14}),e[24]=y):y=e[24];let b;e[25]!==r?(b=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=b):b=e[26];let w;e[27]!==i||e[28]!==b?(w=t.jsxs(Je,{onClick:i,children:[y,b]}),e[27]=i,e[28]=b,e[29]=w):w=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(es,{size:14}),e[30]=S):S=e[30];let N;e[31]!==s||e[32]!==r?(N=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=N):N=e[33];let C;e[34]!==l||e[35]!==N?(C=t.jsxs(Je,{onClick:l,children:[S,N]}),e[34]=l,e[35]=N,e[36]=C):C=e[36];let M;e[37]!==n||e[38]!==d||e[39]!==r?(M=n&&t.jsxs(Je,{onClick:d,children:[t.jsx(Ls,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=d,e[39]=r,e[40]=M):M=e[40];let T;e[41]!==w||e[42]!==C||e[43]!==M?(T=t.jsxs(Vs,{align:"end",children:[w,C,M]}),e[41]=w,e[42]=C,e[43]=M,e[44]=T):T=e[44];let V;e[45]!==j||e[46]!==T?(V=t.jsxs(Ms,{children:[j,T]}),e[45]=j,e[46]=T,e[47]=V):V=e[47];let _;return e[48]!==V||e[49]!==x?(_=t.jsxs("div",{className:"flex items-center gap-1",children:[x,V]}),e[48]=V,e[49]=x,e[50]=_):_=e[50],_}const bs=a=>a.stopPropagation();function Bl(a){const e=U.c(8),{icon:s,title:n}=a;let i;e[0]!==s||e[1]!==n?(i=t.jsx(jt,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let d;return e[5]!==i||e[6]!==l?(d=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=d):d=e[7],d}function Yl(a){const e=U.c(42),{views:s,viewId:n}=a;let i;e[0]!==n||e[1]!==s?(i=s.pinned(n),e[0]=n,e[1]=s,e[2]=i):i=e[2];const l=i;let d;e[3]!==n?(d=t.jsx(Ul,{viewId:n}),e[3]=n,e[4]=d):d=e[4];const r=s.labels[n];let f;e[5]!==n||e[6]!==s?(f=()=>s.openView(n),e[5]=n,e[6]=s,e[7]=f):f=e[7];let o;e[8]!==l||e[9]!==n||e[10]!==s?(o=l&&s.canBeMainView(n)&&!s.isMainView(n),e[8]=l,e[9]=n,e[10]=s,e[11]=o):o=e[11];let p;e[12]!==n||e[13]!==s?(p=()=>s.openView(n),e[12]=n,e[13]=s,e[14]=p):p=e[14];let u;e[15]!==l||e[16]!==n||e[17]!==s?(u=()=>s.togglePin(n,!l),e[15]=l,e[16]=n,e[17]=s,e[18]=u):u=e[18];let m;e[19]!==n||e[20]!==s?(m=()=>s.setMainView(n),e[19]=n,e[20]=s,e[21]=m):m=e[21];let h;e[22]!==l||e[23]!==o||e[24]!==p||e[25]!==u||e[26]!==m?(h=t.jsx(cn,{pinned:l,canSetMainView:o,onOpen:p,onTogglePin:u,onSetMainView:m}),e[22]=l,e[23]=o,e[24]=p,e[25]=u,e[26]=m,e[27]=h):h=e[27];let c;e[28]!==n||e[29]!==s?(c=()=>s.openView(n),e[28]=n,e[29]=s,e[30]=c):c=e[30];let x;e[31]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ds,{size:16}),e[31]=x):x=e[31];let g;e[32]!==c?(g=t.jsx("span",{onClick:c,className:"flex cursor-pointer items-center text-muted-foreground",children:x}),e[32]=c,e[33]=g):g=e[33];let v;e[34]!==g||e[35]!==h?(v=t.jsxs("div",{className:"flex items-center gap-1",children:[h,g]}),e[34]=g,e[35]=h,e[36]=v):v=e[36];let j;return e[37]!==v||e[38]!==d||e[39]!==r||e[40]!==f?(j=t.jsx($e,{icon:d,title:r,onClick:f,action:v}),e[37]=v,e[38]=d,e[39]=r,e[40]=f,e[41]=j):j=e[41],j}function Wl(a){const e=U.c(75),{views:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let d;e[4]!==n?(d=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=d):d=e[5];const r=s.noMainView?"none":"set",f=s.noMainView?void 0:s.defaultMainView,o=s.setMainView;let p;e[6]!==n?(p=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=p):p=e[7];let u;e[8]!==n?(u=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=u):u=e[9];let m;e[10]!==u?(m=t.jsx(Le,{placeholder:u}),e[10]=u,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=t.jsx(Re,{"aria-label":p,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let c;e[15]!==s.defaultMainOptions?(c=s.defaultMainOptions.map(Kl),e[15]=s.defaultMainOptions,e[16]=c):c=e[16];let x;e[17]!==c?(x=t.jsx(Ue,{children:c}),e[17]=c,e[18]=x):x=e[18];let g;e[19]!==h||e[20]!==x||e[21]!==r||e[22]!==f||e[23]!==s.setMainView?(g=t.jsxs(Be,{value:f,onValueChange:o,children:[h,x]},r),e[19]=h,e[20]=x,e[21]=r,e[22]=f,e[23]=s.setMainView,e[24]=g):g=e[24];let v;e[25]!==g||e[26]!==l||e[27]!==d?(v=t.jsx($e,{title:l,description:d,action:g}),e[25]=g,e[26]=l,e[27]=d,e[28]=v):v=e[28];let j;e[29]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[29]=n,e[30]=j):j=e[30];let y;e[31]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[31]=n,e[32]=y):y=e[32];let b;e[33]!==n?(b=n("virtualMcp.layoutTabContent.showChat"),e[33]=n,e[34]=b):b=e[34];const w=s.noMainView?!0:s.chatDefaultOpen;let S;e[35]!==b||e[36]!==w||e[37]!==s.noMainView||e[38]!==s.setChatDefaultOpen?(S=t.jsx(Te,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(rt,{"aria-label":b,checked:w,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[35]=b,e[36]=w,e[37]=s.noMainView,e[38]=s.setChatDefaultOpen,e[39]=S):S=e[39];let N;e[40]!==n||e[41]!==s.noMainView?(N=s.noMainView&&t.jsx(De,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[40]=n,e[41]=s.noMainView,e[42]=N):N=e[42];let C;e[43]!==S||e[44]!==N?(C=t.jsxs(Ve,{delayDuration:0,children:[S,N]}),e[43]=S,e[44]=N,e[45]=C):C=e[45];let M;e[46]!==j||e[47]!==y||e[48]!==C?(M=t.jsx($e,{title:j,description:y,action:C}),e[46]=j,e[47]=y,e[48]=C,e[49]=M):M=e[49];let T;e[50]!==v||e[51]!==M?(T=t.jsxs(Me,{children:[v,M]}),e[50]=v,e[51]=M,e[52]=T):T=e[52];let V;e[53]!==i||e[54]!==T?(V=t.jsx(Oe,{title:i,children:T}),e[53]=i,e[54]=T,e[55]=V):V=e[55];let _;e[56]!==n?(_=n("virtualMcp.settings.views.sidebar"),e[56]=n,e[57]=_):_=e[57];let E;e[58]!==s.navViews||e[59]!==s.projectViews?(E=[...s.navViews,...s.projectViews],e[58]=s.navViews,e[59]=s.projectViews,e[60]=E):E=e[60];let P;e[61]!==E||e[62]!==s?(P=E.map(R=>t.jsx(Yl,{views:s,viewId:R},R)),e[61]=E,e[62]=s,e[63]=P):P=e[63];let A;e[64]!==s?(A=s.connectionsData.flatMap(R=>[t.jsx(Bl,{icon:R.icon,title:R.title},`${R.id}:header`),...R.uiTools.map(F=>{const Y=s.pinnedAppViews.find(G=>G.connectionId===R.id&&G.toolName===F.name),z=!!Y,L=jn(R.id,F.name),W=`ext-apps:${R.id}:${F.name}`;return t.jsx($e,{onClick:()=>s.openView(L),icon:z?t.jsx("span",{onClick:bs,children:t.jsx(on,{value:Y.icon??null,name:Y.label||F.name,size:"xs",showHoverOverlay:!1,onChange:G=>s.setAppViewIcon(R.id,F.name,G)})}):t.jsx(Us,{size:16}),title:z?t.jsx("span",{onClick:bs,children:t.jsx(Ne,{value:Y.label,onChange:G=>s.setAppViewLabel(R.id,F.name,G.target.value),onBlur:s.commitAppViewLabel,"aria-label":F.title??Pt(F.name),className:"h-7 w-full max-w-52 text-sm"})}):F.title??Pt(F.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(cn,{pinned:z,canSetMainView:z&&!s.isMainView(W),onOpen:()=>s.openView(L),onTogglePin:()=>s.toggleAppViewPin(R.id,F.name),onSetMainView:()=>s.setMainView(W)}),t.jsx("span",{onClick:()=>s.openView(L),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Ds,{size:16})})]})},`${R.id}:${F.name}`)})]),e[64]=s,e[65]=A):A=e[65];let I;e[66]!==P||e[67]!==A?(I=t.jsxs(Me,{children:[P,A]}),e[66]=P,e[67]=A,e[68]=I):I=e[68];let K;e[69]!==_||e[70]!==I?(K=t.jsx(Oe,{title:_,children:I}),e[69]=_,e[70]=I,e[71]=K):K=e[71];let Q;return e[72]!==V||e[73]!==K?(Q=t.jsxs(t.Fragment,{children:[V,K]}),e[72]=V,e[73]=K,e[74]=Q):Q=e[74],Q}function Kl(a){return t.jsx(Pe,{value:a.value,children:a.label},a.value)}const dn="site-editor",un={context:Ct.library,monitor:Ct.monitoring,plan:Ct.plan};function js(a){return Object.hasOwn(un,a)}const Gl=new Set([dn,"content"]);function ql({virtualMcpId:a,form:e,flushAndSave:s}){const n=Z(),i=ft(),{openPanel:l}=Qi(),d=pt(),{org:r}=Ee(),f=As(a),o=Xi(f),p=Xs(a),u=aa(a),m=(f?.connections??[]).map(k=>k.connection_id).sort(),{data:h}=Ps({queryKey:Et.projectConnectionDetails(a,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async $=>{try{const{item:q}=await i.call("COLLECTION_CONNECTIONS_GET",{id:$}),B=(q?.tools??[]).flatMap(X=>{const ae=qi(X._meta);return ae?[{name:X.name,title:X.title,description:X.description,resourceUri:ae}]:[]});return{fetchOk:!0,id:$,title:q?.title??$,icon:q?.icon??null,uiTools:B}}catch{return{fetchOk:!1,id:$,title:$,icon:null,uiTools:[]}}}))}),c=(h??[]).filter(k=>k.uiTools.length>0),x=new Set([...yn,...wn]),g=e.watch("metadata.ui.pinnedViews")??[],v=e.watch("metadata.ui.layout")??null,j=v?.defaultMainView??null,y=v?.chatDefaultOpen??!1,b=o.presence.calendar,w=e.watch("metadata.sidebarViewsSeen"),S=Ot(It({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:v}}),e.watch("metadata.sidebarViewsVersion"),ns(w,b)),N=u??(f?Ot(It(f.metadata),f.metadata.sidebarViewsVersion,ns(f.metadata.sidebarViewsSeen,b)):S),C=(()=>{if(!j||j.type==="chat")return"";const k=Sn(j.type);return k==="instructions"||k==="connections"||k==="layout"?"settings":Gl.has(k)?dn:x.has(k)?k:`${k}:${j.id??""}:${j.toolName??""}`})(),M=C==="",T=k=>{const[$,q,B]=k.split(":");return $?x.has($)?{type:$}:$==="ext-apps"&&q?{type:"ext-apps",id:q,toolName:B||void 0}:null:null},V=k=>{e.setValue("metadata.ui.pinnedViews",k,{shouldDirty:!0})},_=k=>{e.setValue("metadata.ui.layout",{...v,...k},{shouldDirty:!0})},E=H.useRef(!1);if(h&&h.length>0&&!E.current){E.current=!0;const k=new Set((h??[]).filter(X=>X.fetchOk).map(X=>X.id)),$=new Set(c.flatMap(X=>X.uiTools.map(ae=>`${X.id}:${ae.name}`))),q=new Set(m),B=g.filter(X=>q.has(X.connectionId)&&(!k.has(X.connectionId)||$.has(`${X.connectionId}:${X.toolName}`)));B.length!==g.length&&(V(B),j?.type==="ext-apps"&&!B.some(X=>X.connectionId===j.id&&X.toolName===j.toolName)&&_({defaultMainView:{type:"settings"}}))}const P=(k,$)=>{if(g.some(B=>B.connectionId===k&&B.toolName===$)){const B=g.filter(ae=>!(ae.connectionId===k&&ae.toolName===$));V(B);const X=`ext-apps:${k}:${$}`;C===X&&_({defaultMainView:{type:"settings"}})}else{const B=c.find(X=>X.id===k)?.uiTools.find(X=>X.name===$)?.title;V([...g,{connectionId:k,toolName:$,label:B??Pt($),icon:null}])}s()},A=(k,$,q)=>{V(g.map(B=>B.connectionId===k&&B.toolName===$?{...B,label:q}:B))},I=()=>{s()},K=(k,$,q)=>{V(g.map(B=>B.connectionId===k&&B.toolName===$?{...B,icon:q}:B)),s()},Q=k=>{_({defaultMainView:T(k)}),s()},R=(k,$)=>{const q=ta(N,k,$,1);e.setValue("metadata.sidebarViews",q,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsSeen",sa(f?.metadata.sidebarViewsSeen??w,b),{shouldDirty:!0}),p.stage(q,N);const B=na(j,k,$);B!==j&&_({defaultMainView:B})},F=Qs(f?.metadata),Y=Ji(F,o.presence),z=Zi(Y),L=ea(N,Y,1),W={overview:n("sidebar.navDestinations.overview"),context:n("sidebar.navDestinations.context"),monitor:n("sidebar.navDestinations.monitor"),plan:n("sidebar.navDestinations.plan"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.spineTasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),automations:n("virtualMcp.layoutTabContent.automations"),calendar:n("common.mainPanelTabs.calendar"),experiments:n("common.mainPanelTabs.experiments")},G=[{value:"overview",label:n("sidebar.navDestinations.overview")}];for(const k of L)k!=="automations"&&k!=="overview"&&(js(k)||G.push({value:k,label:W[k]}));for(const k of g)G.push({value:`ext-apps:${k.connectionId}:${k.toolName}`,label:k.label||k.toolName});L.includes("automations")&&G.push({value:"automations",label:W.automations}),G.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")});const se=k=>{if(js(k)){d({to:un[k],params:{org:r.slug,agentId:a}});return}l(k,{virtualmcpid:a})},te=new Set(is);return{navViews:is,projectViews:z.filter(k=>!te.has(k)),labels:W,pinned:k=>N.includes(k),isMainView:k=>C===k,canBeMainView:k=>G.some($=>$.value===k),defaultMainView:C,defaultMainOptions:G,noMainView:M,chatDefaultOpen:y,connectionsData:c,pinnedAppViews:g,openView:se,togglePin:(k,$)=>R(k,$),setMainView:Q,setChatDefaultOpen:k=>{_({chatDefaultOpen:k}),s()},toggleAppViewPin:P,setAppViewIcon:K,setAppViewLabel:A,commitAppViewLabel:I}}function Hl(a){const e=U.c(55),{form:s,onCommit:n}=a,i=Z(),l=H.useId();let d;e[0]!==i?(d=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=d):d=e[1];let r;e[2]!==d?(r=t.jsx("p",{className:"text-sm font-medium",children:d}),e[2]=d,e[3]=r):r=e[3];let f;e[4]!==i?(f=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=f):f=e[5];let o;e[6]!==f?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=o):o=e[7];let p;e[8]!==r||e[9]!==o?(p=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,e[10]=p):p=e[10];let u;e[11]!==s||e[12]!==n||e[13]!==i?(u=V=>{const{field:_}=V;return t.jsx("div",{className:"justify-self-start",children:t.jsx(on,{value:_.value??null,onChange:E=>{_.onChange(E),n()},onColorChange:E=>{s.setValue("metadata.ui.themeColor",E,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=u):u=e[14];let m;e[15]!==s.control||e[16]!==u?(m=t.jsx(be,{name:"icon",control:s.control,render:u}),e[15]=s.control,e[16]=u,e[17]=m):m=e[17];let h;e[18]!==p||e[19]!==m?(h=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[p,m]}),e[18]=p,e[19]=m,e[20]=h):h=e[20];const c=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==c?(g=t.jsx("label",{htmlFor:c,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=c,e[25]=g):g=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==i?(v=V=>{const{field:_}=V;return t.jsx(Ne,{..._,id:`${l}-name`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=n,e[28]=i,e[29]=v):v=e[29];let j;e[30]!==s.control||e[31]!==v?(j=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=j):j=e[32];let y;e[33]!==g||e[34]!==j?(y=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,j]}),e[33]=g,e[34]=j,e[35]=y):y=e[35];const b=`${l}-description`;let w;e[36]!==i?(w=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=w):w=e[37];let S;e[38]!==b||e[39]!==w?(S=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:w}),e[38]=b,e[39]=w,e[40]=S):S=e[40];let N;e[41]!==l||e[42]!==n||e[43]!==i?(N=V=>{const{field:_}=V;return t.jsx(ut,{..._,id:`${l}-description`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=N):N=e[44];let C;e[45]!==s.control||e[46]!==N?(C=t.jsx(be,{name:"description",control:s.control,render:N}),e[45]=s.control,e[46]=N,e[47]=C):C=e[47];let M;e[48]!==S||e[49]!==C?(M=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[S,C]}),e[48]=S,e[49]=C,e[50]=M):M=e[50];let T;return e[51]!==y||e[52]!==M||e[53]!==h?(T=t.jsxs(Me,{children:[h,y,M]}),e[51]=y,e[52]=M,e[53]=h,e[54]=T):T=e[54],T}function Ql(a){const e=U.c(8),{section:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=da.map(r=>{const{titleKey:f}=ua[r];return t.jsx(Ke.Tab,{active:s===r,asChild:!0,children:t.jsx(At,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:n(f)})},r)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let d;if(e[5]!==i||e[6]!==l){const r=t.jsx(Ke.Tabs,{"aria-label":i,children:l});d=t.jsx(Nn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=l,e[7]=d}else d=e[7];return d}function Xl(){const a=U.c(8),e=pt();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=Cn(s);let i;a[1]!==n?(i=ma(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=r=>e({to:".",search:f=>({...f,section:r??void 0})}),a[3]=e,a[4]=l):l=a[4];let d;return a[5]!==i||a[6]!==l?(d={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=d):d=a[7],d}function mn(a){const e=U.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:d,className:r,copiedClassName:f}=a,o=l===void 0?"ghost":l,p=d===void 0?"icon-sm":d,{handleCopy:u,copied:m}=fa();let h;e[0]!==u||e[1]!==s?(h=()=>{u(s).catch(Jl)},e[0]=u,e[1]=s,e[2]=h):h=e[2];const c=m&&f;let x;e[3]!==r||e[4]!==c?(x=ve(r,c),e[3]=r,e[4]=c,e[5]=x):x=e[5];let g;e[6]!==m?(g=m?t.jsx(lt,{className:"text-success"}):t.jsx(vt,{}),e[6]=m,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==p||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==o?(v=t.jsx(ee,{type:"button",variant:o,size:p,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=p,e[10]=h,e[11]=x,e[12]=g,e[13]=o,e[14]=v):v=e[14];const j=m?i:"";let y;e[15]!==j?(y=t.jsx("span",{className:"sr-only","aria-live":"polite",children:j}),e[15]=j,e[16]=y):y=e[16];let b;return e[17]!==v||e[18]!==y?(b=t.jsxs(t.Fragment,{children:[v,y]}),e[17]=v,e[18]=y,e[19]=b):b=e[19],b}function Jl(){}function Zl(a){const e=U.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:d}=a;let r;e[0]!==d?(r=ve("relative h-fit",d),e[0]=d,e[1]=r):r=e[1];let f;e[2]!==s||e[3]!==n?(f=t.jsx(Ne,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=f):f=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=ve("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==i||e[8]!==n?(p=t.jsx(mn,{value:n,label:i,copiedLabel:l,className:o,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=p):p=e[9];let u;return e[10]!==r||e[11]!==f||e[12]!==p?(u=t.jsxs("div",{className:r,children:[f,p]}),e[10]=r,e[11]=f,e[12]=p,e[13]=u):u=e[13],u}async function ys(a){const e=await a.json().catch(()=>({}));if(!a.ok)throw new Error(e.error??`HTTP ${a.status}`);return e}function er(a){const e=U.c(108),{orgSlug:s,virtualMcpId:n,site:i}=a,l=Z(),d=Ft();let r;e[0]!==i?(r=kn(i,"site-tokens"),e[0]=i,e[1]=r):r=e[1];const f=r;let o;e[2]!==s||e[3]!==n?(o=Et.hostedSiteTokens(s,n),e[2]=s,e[3]=n,e[4]=o):o=e[4];const p=o,[u,m]=H.useState(null),h=H.useId();let c;e[5]!==f?(c=async()=>ys(await fetch(f)),e[5]=f,e[6]=c):c=e[6];let x;e[7]!==p||e[8]!==c?(x={queryKey:p,queryFn:c},e[7]=p,e[8]=c,e[9]=x):x=e[9];const g=Ps(x);let v;e[10]!==f?(v=async()=>ys(await fetch(f,{method:"POST"})),e[10]=f,e[11]=v):v=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=J=>{const{token:ye}=J;return m(ye)},e[12]=j):j=e[12];let y;e[13]!==p||e[14]!==d?(y=()=>d.invalidateQueries({queryKey:p}),e[13]=p,e[14]=d,e[15]=y):y=e[15];let b;e[16]!==v||e[17]!==y?(b={mutationFn:v,onSuccess:j,onError:tr,onSettled:y},e[16]=v,e[17]=y,e[18]=b):b=e[18];const w=Os(b);let S;e[19]!==g.data?.tokens?(S=g.data?.tokens??[],e[19]=g.data?.tokens,e[20]=S):S=e[20];const N=S,C=g.data?.site;let M;e[21]!==l?(M=l("siteTokens.title"),e[21]=l,e[22]=M):M=e[22];let T;e[23]!==l?(T=l("siteTokens.description"),e[23]=l,e[24]=T):T=e[24];let V;e[25]!==l?(V=l("siteTokens.siteId"),e[25]=l,e[26]=V):V=e[26];let _;e[27]!==h||e[28]!==V?(_=t.jsx("label",{htmlFor:h,className:"text-sm font-medium",children:V}),e[27]=h,e[28]=V,e[29]=_):_=e[29];let E;e[30]!==l?(E=l("siteTokens.siteIdDescription"),e[30]=l,e[31]=E):E=e[31];let P;e[32]!==E?(P=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:E}),e[32]=E,e[33]=P):P=e[33];let A;e[34]!==C||e[35]!==h||e[36]!==l?(A=C?t.jsx(Zl,{id:h,value:C,copyLabel:l("siteTokens.copySiteId"),copiedLabel:l("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[34]=C,e[35]=h,e[36]=l,e[37]=A):A=e[37];const I=!g.data||w.isPending;let K;e[38]!==w?(K=()=>w.mutate(),e[38]=w,e[39]=K):K=e[39];let Q;e[40]!==w.isPending?(Q=w.isPending?t.jsx(nt,{className:"size-3.5"}):t.jsx(ze,{size:14}),e[40]=w.isPending,e[41]=Q):Q=e[41];let R;e[42]!==l?(R=l("siteTokens.issue"),e[42]=l,e[43]=R):R=e[43];let F;e[44]!==I||e[45]!==K||e[46]!==Q||e[47]!==R?(F=t.jsxs(ee,{type:"button",size:"sm",className:"shrink-0",disabled:I,onClick:K,children:[Q,R]}),e[44]=I,e[45]=K,e[46]=Q,e[47]=R,e[48]=F):F=e[48];let Y;e[49]!==A||e[50]!==F?(Y=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[A,F]}),e[49]=A,e[50]=F,e[51]=Y):Y=e[51];let z;e[52]!==_||e[53]!==P||e[54]!==Y?(z=t.jsxs(we,{className:"group",children:[_,P,Y]}),e[52]=_,e[53]=P,e[54]=Y,e[55]=z):z=e[55];let L;e[56]!==g.error||e[57]!==g.isError?(L=g.isError?t.jsx(we,{children:t.jsx("p",{className:"text-xs text-destructive",children:g.error.message})}):null,e[56]=g.error,e[57]=g.isError,e[58]=L):L=e[58];let W;if(e[59]!==l||e[60]!==N){let J;e[62]!==l?(J=ye=>t.jsx(we,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(Lt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:ye.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:l("siteTokens.issuedAgo",{when:Mn(new Date(ye.iat*1e3))})})]})]})},ye.kid),e[62]=l,e[63]=J):J=e[63],W=N.map(J),e[59]=l,e[60]=N,e[61]=W}else W=e[61];let G;e[64]!==z||e[65]!==L||e[66]!==W?(G=t.jsxs(Me,{children:[z,L,W]}),e[64]=z,e[65]=L,e[66]=W,e[67]=G):G=e[67];const se=u!==null;let te;e[68]===Symbol.for("react.memo_cache_sentinel")?(te=J=>!J&&m(null),e[68]=te):te=e[68];let k;e[69]!==l?(k=l("siteTokens.createdTitle"),e[69]=l,e[70]=k):k=e[70];let $;e[71]!==k?($=t.jsx(ht,{children:k}),e[71]=k,e[72]=$):$=e[72];let q;e[73]!==l?(q=l("siteTokens.createdDescription"),e[73]=l,e[74]=q):q=e[74];let B;e[75]!==q?(B=t.jsx(Is,{children:q}),e[75]=q,e[76]=B):B=e[76];let X;e[77]!==$||e[78]!==B?(X=t.jsxs(xt,{children:[$,B]}),e[77]=$,e[78]=B,e[79]=X):X=e[79];let ae;e[80]!==l?(ae=l("siteTokens.createdTitle"),e[80]=l,e[81]=ae):ae=e[81];const je=u??"";let ie;e[82]!==ae||e[83]!==je?(ie=t.jsx(Ne,{readOnly:!0,"aria-label":ae,value:je,className:"font-mono text-xs"}),e[82]=ae,e[83]=je,e[84]=ie):ie=e[84];let ce;e[85]!==u||e[86]!==l?(ce=u?t.jsx(mn,{value:u,label:l("siteTokens.copy"),copiedLabel:l("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[85]=u,e[86]=l,e[87]=ce):ce=e[87];let ue;e[88]!==ie||e[89]!==ce?(ue=t.jsxs("div",{className:"flex items-center gap-2",children:[ie,ce]}),e[88]=ie,e[89]=ce,e[90]=ue):ue=e[90];let ge;e[91]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>m(null),e[91]=ge):ge=e[91];let de;e[92]!==l?(de=l("siteTokens.done"),e[92]=l,e[93]=de):de=e[93];let he;e[94]!==de?(he=t.jsx($t,{children:t.jsx(ee,{onClick:ge,children:de})}),e[94]=de,e[95]=he):he=e[95];let me;e[96]!==X||e[97]!==ue||e[98]!==he?(me=t.jsxs(it,{className:"sm:max-w-lg",children:[X,ue,he]}),e[96]=X,e[97]=ue,e[98]=he,e[99]=me):me=e[99];let fe;e[100]!==se||e[101]!==me?(fe=t.jsx(at,{open:se,onOpenChange:te,children:me}),e[100]=se,e[101]=me,e[102]=fe):fe=e[102];let O;return e[103]!==M||e[104]!==T||e[105]!==G||e[106]!==fe?(O=t.jsxs(Oe,{title:M,description:T,children:[G,fe]}),e[103]=M,e[104]=T,e[105]=G,e[106]=fe,e[107]=O):O=e[107],O}function tr(a){return le.error(a.message)}function sr(a){const e=U.c(31),{virtualMcp:s}=a,n=Z(),{org:i}=Ee(),{roleSlug:l}=_n();let d;e[0]!==s?(d=ha(s),e[0]=s,e[1]=d):d=e[1];const r=d,f=ft(),o=Ft();let p;e[2]!==f||e[3]!==s?(p=N=>f.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:s.id,data:{blocksV8:N}}),e[2]=f,e[3]=s,e[4]=p):p=e[4];let u;e[5]!==i||e[6]!==o?(u=()=>Vn(o,i.id),e[5]=i,e[6]=o,e[7]=u):u=e[7];let m;e[8]!==p||e[9]!==u?(m={mutationFn:p,onError:nr,onSettled:u},e[8]=p,e[9]=u,e[10]=m):m=e[10];const h=Os(m);if(!pa(l))return null;const c=h.isPending?h.variables:r;let x;e[11]!==n?(x=n("virtualMcp.settings.blocksV8Site.label"),e[11]=n,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Se,{htmlFor:"blocks-v8-site",className:"font-normal text-foreground",children:x}),e[13]=x,e[14]=g):g=e[14];let v;e[15]!==n?(v=n("virtualMcp.settings.blocksV8Site.description"),e[15]=n,e[16]=v):v=e[16];let j;e[17]!==v?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=j):j=e[18];let y;e[19]!==g||e[20]!==j?(y=t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[g,j]}),e[19]=g,e[20]=j,e[21]=y):y=e[21];let b;e[22]!==h?(b=N=>h.mutate(N),e[22]=h,e[23]=b):b=e[23];let w;e[24]!==c||e[25]!==b||e[26]!==h.isPending?(w=t.jsx(rt,{id:"blocks-v8-site",className:"shrink-0",checked:c,disabled:h.isPending,onCheckedChange:b}),e[24]=c,e[25]=b,e[26]=h.isPending,e[27]=w):w=e[27];let S;return e[28]!==w||e[29]!==y?(S=t.jsx(Oe,{children:t.jsx(Me,{children:t.jsx(we,{children:t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[y,w]})})})}),e[28]=w,e[29]=y,e[30]=S):S=e[30],S}function nr(a){return le.error(a.message)}function ir(a){const e=U.c(8),{control:s,previewServerUrl:n}=a,i=Z();let l;e[0]!==n?(l=Js(n),e[0]=n,e[1]=l):l=e[1];const d=!!l;let r;e[2]!==d||e[3]!==i?(r=o=>{const{field:p}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(d?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(rt,{id:"fast-preview",className:"shrink-0",checked:!!p.value&&d,disabled:!d,onCheckedChange:u=>p.onChange(u)})]})},e[2]=d,e[3]=i,e[4]=r):r=e[4];let f;return e[5]!==s||e[6]!==r?(f=t.jsx(be,{control:s,name:"metadata.fastPreview",render:r}),e[5]=s,e[6]=r,e[7]=f):f=e[7],f}function ar(a){const e=U.c(5),{control:s,fastPreview:n}=a,i=Z();if(!n)return null;let l;e[0]!==i?(l=r=>{const{field:f}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(rt,{id:"fast-preview-in-place",className:"shrink-0",checked:!!f.value,onCheckedChange:o=>f.onChange(o)})]})},e[0]=i,e[1]=l):l=e[1];let d;return e[2]!==s||e[3]!==l?(d=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=d):d=e[4],d}function lr(a){const e=U.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=Z();let d;e[0]!==l?(d=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=d):d=e[1];let r;e[2]!==d?(r=t.jsx(Se,{htmlFor:"preview-server-url",children:d}),e[2]=d,e[3]=r):r=e[3];let f;e[4]!==l?(f=c=>{const{field:x}=c,g=x.value??"";return t.jsx(Ne,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(ga(g)),x.onBlur()}})},e[4]=l,e[5]=f):f=e[5];let o;e[6]!==s||e[7]!==f?(o=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:f}),e[6]=s,e[7]=f,e[8]=o):o=e[8];const p=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let u;e[9]!==l||e[10]!==p?(u=l(p),e[9]=l,e[10]=p,e[11]=u):u=e[11];let m;e[12]!==u?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:u}),e[12]=u,e[13]=m):m=e[13];let h;return e[14]!==r||e[15]!==o||e[16]!==m?(h=t.jsxs("div",{className:"space-y-2",children:[r,o,m]}),e[14]=r,e[15]=o,e[16]=m,e[17]=h):h=e[17],h}function rr(a){const e=U.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,d=Z(),r=n||!!l;let f;e[0]!==s||e[1]!==n?(f=t.jsx(we,{children:t.jsx(lr,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=f):f=e[2];let o;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==d?(o=n?!Js(i)&&t.jsx(we,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:d("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(we,{children:t.jsx(ir,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=d,e[7]=o):o=e[7];let p;e[8]!==s||e[9]!==r?(p=r&&t.jsx(we,{children:t.jsx(ar,{control:s,fastPreview:r})}),e[8]=s,e[9]=r,e[10]=p):p=e[10];let u;return e[11]!==f||e[12]!==o||e[13]!==p?(u=t.jsxs(t.Fragment,{children:[f,o,p]}),e[11]=f,e[12]=o,e[13]=p,e[14]=u):u=e[14],u}const Vt={tools:null,resources:null,prompts:null},or=ba.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function cr(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function fn(a){return{"x-studio-client":a,"x-mesh-client":a}}function dr(a){const e=U.c(15),{url:s,agentId:n}=a,i=Z(),[l,d]=H.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{_e("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),d(!0),le.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await St(2e3),d(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const f=r;let o;e[4]!==l?(o=l?t.jsx(lt,{size:20,className:"text-success"}):t.jsx(vt,{size:20}),e[4]=l,e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==i?(p=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=p):p=e[8];let u;e[9]!==p?(u=t.jsx("span",{className:"text-xs font-medium",children:p}),e[9]=p,e[10]=u):u=e[10];let m;return e[11]!==f||e[12]!==o||e[13]!==u?(m=t.jsxs(ee,{type:"button",variant:"outline",onClick:f,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,u]}),e[11]=f,e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function ur(a){const e=U.c(13),{url:s,serverName:n,agentId:i}=a,l=Z();let d;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(d=()=>{_e("agent_connect_action",{agent_id:i,action:"install_cursor"});const m=Zs(n),h={type:"http",url:s,headers:fn("Cursor")},c=cr(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(c)}`;window.open(x,"_blank"),le.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=d):d=e[4];const r=d;let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=f):f=e[5];let o;e[6]!==l?(o=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=o):o=e[7];let p;e[8]!==o?(p=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=p):p=e[9];let u;return e[10]!==r||e[11]!==p?(u=t.jsxs(ee,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,p]}),e[10]=r,e[11]=p,e[12]=u):u=e[12],u}function mr(a){const e=U.c(16),{url:s,serverName:n,agentId:i}=a,l=Z(),[d,r]=H.useState(!1);let f;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(f=async()=>{_e("agent_connect_action",{agent_id:i,action:"install_claude_code"});const c=Zs(n),x={type:"http",url:s,headers:fn("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${c}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),r(!0),le.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await St(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=f):f=e[4];const o=f;let p;e[5]!==d?(p=d?t.jsx(lt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=d,e[6]=p):p=e[6];let u;e[7]!==d||e[8]!==l?(u=l(d?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=d,e[8]=l,e[9]=u):u=e[9];let m;e[10]!==u?(m=t.jsx("span",{className:"text-xs font-medium",children:u}),e[10]=u,e[11]=m):m=e[11];let h;return e[12]!==o||e[13]!==p||e[14]!==m?(h=t.jsxs(ee,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,m]}),e[12]=o,e[13]=p,e[14]=m,e[15]=h):h=e[15],h}const fr=720*60*60;function pr({virtualMcp:a}){const e=Z(),s=ft(),[n,i]=H.useState(null),[l,d]=H.useState(!1),[r,f]=H.useState(!1),o=a.id,p=a.title||`agent-${o.slice(0,8)}`,u=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,m=async()=>{d(!0);try{const{key:c}=await s.call("API_KEY_CREATE",{name:`typegen-${p}`,permissions:{[o]:["*"]},expiresIn:fr});if(!c)throw new Error("No key in response");i(c),_e("agent_typegen_key_generated",{agent_id:o})}catch{_e("agent_typegen_key_failed",{agent_id:o}),le.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{d(!1)}},h=async()=>{_e("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(u),f(!0),le.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await St(2e3),f(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:m,disabled:l,children:[l?t.jsx(nt,{className:"size-3.5"}):t.jsx(Lt,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:u}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:r?t.jsx(lt,{size:12,className:"text-success"}):t.jsx(vt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(hr,{apiKey:n,agentId:o})]})}function hr(a){const e=U.c(21),{apiKey:s,agentId:n}=a,[i,l]=H.useState(!1),d=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",f=`STUDIO_BASE_URL=${d}`,o=`${r}
|
|
2
|
-
${f}`;let p;e[0]!==n||e[1]!==s||e[2]!==o?(p=async()=>{_e("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(o),l(!0),await St(2e3),l(!1)},e[0]=n,e[1]=s,e[2]=o,e[3]=p):p=e[3];const u=p,m=!s;let h;e[4]!==m?(h=ve({"opacity-50":m}),e[4]=m,e[5]=h):h=e[5];let c;e[6]!==r||e[7]!==h?(c=t.jsx("span",{className:h,children:r}),e[6]=r,e[7]=h,e[8]=c):c=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:f}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let v;e[11]!==c?(v=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[c,x,g]}),e[11]=c,e[12]=v):v=e[12];let j;e[13]!==i?(j=i?t.jsx(lt,{size:12,className:"text-success"}):t.jsx(vt,{size:12}),e[13]=i,e[14]=j):j=e[14];let y;e[15]!==u||e[16]!==j?(y=t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:u,children:j}),e[15]=u,e[16]=j,e[17]=y):y=e[17];let b;return e[18]!==v||e[19]!==y?(b=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[v,y]})}),e[18]=v,e[19]=y,e[20]=b):b=e[20],b}function xr(a){const e=U.c(3),{virtualMcp:s}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(H.Suspense,{fallback:n,children:t.jsx(pr,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function gr(a){const e=U.c(45),{open:s,onOpenChange:n,virtualMcp:i}=a,l=Z(),{org:d}=Ee(),r=`/api/${d.slug}/mcp/virtual-mcp/${i.id}`;let f;e[0]!==r?(f=new URL(r,window.location.origin),e[0]=r,e[1]=f):f=e[1];const o=f;let p;e[2]!==i.id||e[3]!==i.title?(p=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=p):p=e[4];const u=p,m=Ca();let h;e[5]!==i.id||e[6]!==o.href?(h=t.jsx(dr,{url:o.href,agentId:i.id}),e[5]=i.id,e[6]=o.href,e[7]=h):h=e[7];let c,x;e[8]!==u||e[9]!==i.id||e[10]!==o.href?(c=t.jsx(ur,{url:o.href,serverName:u,agentId:i.id}),x=t.jsx(mr,{url:o.href,serverName:u,agentId:i.id}),e[8]=u,e[9]=i.id,e[10]=o.href,e[11]=c,e[12]=x):(c=e[11],x=e[12]);let g;e[13]!==h||e[14]!==c||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[h,c,x]})}),e[13]=h,e[14]=c,e[15]=x,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"border-t border-border"}),e[17]=v):v=e[17];let j;e[18]!==i?(j=t.jsx(xr,{virtualMcp:i}),e[18]=i,e[19]=j):j=e[19];let y;e[20]!==g||e[21]!==j?(y=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v,j]}),e[20]=g,e[21]=j,e[22]=y):y=e[22];const b=y;if(m){let M;e[23]!==l?(M=l("virtualMcp.virtualMcpShareModal.connect"),e[23]=l,e[24]=M):M=e[24];let T;e[25]!==M?(T=t.jsx(wa,{className:"mt-4 mb-4 text-base font-semibold",children:M}),e[25]=M,e[26]=T):T=e[26];let V;e[27]!==b||e[28]!==T?(V=t.jsx(Sa,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[T,b]})}),e[27]=b,e[28]=T,e[29]=V):V=e[29];let _;return e[30]!==n||e[31]!==s||e[32]!==V?(_=t.jsx(Na,{open:s,onOpenChange:n,children:V}),e[30]=n,e[31]=s,e[32]=V,e[33]=_):_=e[33],_}let w;e[34]!==l?(w=l("virtualMcp.virtualMcpShareModal.connect"),e[34]=l,e[35]=w):w=e[35];let S;e[36]!==w?(S=t.jsx(xt,{children:t.jsx(ht,{children:w})}),e[36]=w,e[37]=S):S=e[37];let N;e[38]!==b||e[39]!==S?(N=t.jsxs(it,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[S,b]}),e[38]=b,e[39]=S,e[40]=N):N=e[40];let C;return e[41]!==n||e[42]!==s||e[43]!==N?(C=t.jsx(at,{open:s,onOpenChange:n,children:N}),e[41]=n,e[42]=s,e[43]=N,e[44]=C):C=e[44],C}const vr=/^[A-Za-z_][A-Za-z0-9_]*$/;function br(a){const e={},s=a.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const l=i.indexOf("=");if(l<0)throw new Error(`Line ${n+1}: missing '='`);const d=i.slice(0,l).trim();if(!vr.test(d))throw new Error(`Line ${n+1}: invalid key "${d}"`);let r=i.slice(l+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[d]=r}return e}function jr(a){const e=U.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}=a,r=Z();let f;e[0]!==r?(f=r("sandbox.envVarsField.title"),e[0]=r,e[1]=f):f=e[1];let o;e[2]!==f?(o=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(Se,{className:"font-normal text-foreground",children:f})}),e[2]=f,e[3]=o):o=e[3];let p;e[4]!==r?(p=r("sandbox.envVarsField.description"),e[4]=r,e[5]=p):p=e[5];let u;e[6]!==p?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=u):u=e[7];let m;e[8]!==s||e[9]!==n||e[10]!==l||e[11]!==d||e[12]!==i?(m=t.jsx(yr,{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}),e[8]=s,e[9]=n,e[10]=l,e[11]=d,e[12]=i,e[13]=m):m=e[13];let h;e[14]!==r?(h=j=>{const{error:y}=j;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:y?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=h):h=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Tn,{className:"h-9 w-full"}),e[16]=c):c=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(H.Suspense,{fallback:c,children:t.jsx(Sr,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=x):x=e[19];let g;e[20]!==h||e[21]!==x?(g=t.jsx(Xe,{fallback:h,children:x}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let v;return e[23]!==o||e[24]!==u||e[25]!==m||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[o,u,m,g]}),e[23]=o,e[24]=u,e[25]=m,e[26]=g,e[27]=v):v=e[27],v}function yr(a){const e=U.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}=a,r=Z(),o=Dn.useSession().data?.user?.id,p="metadata.runtime.env";let u;e[0]!==n?(u=()=>JSON.stringify(ws(n.getValues(p))),e[0]=n,e[1]=u):u=e[1];const[m,h]=H.useState(u);let c;e[2]!==s?(c={control:s,name:p},e[2]=s,e[3]=c):c=e[3];const x=zt(c);let g;e[4]!==x?(g=JSON.stringify(ws(x)),e[4]=x,e[5]=g):g=e[5];const v=g,j=v!==m;let y;e[6]!==d||e[7]!==o?(y=o?Object.keys(d?.[o]??{}):[],e[6]=d,e[7]=o,e[8]=y):y=e[8];const b=y,w=b.length>0,[S,N]=H.useState(!1);if(!j||!w)return null;let C;e[9]!==v||e[10]!==l||e[11]!==r||e[12]!==b||e[13]!==i?(C=async()=>{N(!0);const K=await Promise.allSettled(b.map(async R=>{const F=ka({orgSlug:l,virtualMcpId:i,branch:R,threadId:null},"setup/start",{force:"1"}),Y=await fetch(F,{method:"POST"});if(!Y.ok){const z=await Y.text().catch(()=>Y.statusText);throw new Error(z||Y.statusText)}}));N(!1);const Q=K.filter(wr).length;Q===0?(h(v),le.success(b.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:b.length}))):le.error(r("sandbox.envVarsField.restartFailed",{failed:Q,total:b.length}))},e[9]=v,e[10]=l,e[11]=r,e[12]=b,e[13]=i,e[14]=C):C=e[14];const M=C;let T;e[15]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Ts,{className:"size-3.5 shrink-0"}),e[15]=T):T=e[15];let V;e[16]!==r?(V=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=V):V=e[17];let _;e[18]!==V?(_=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[T,t.jsx("span",{className:"truncate",children:V})]}),e[18]=V,e[19]=_):_=e[19];let E;e[20]!==S?(E=S?t.jsx(nt,{className:"size-3.5"}):t.jsx(On,{className:"size-3.5"}),e[20]=S,e[21]=E):E=e[21];let P;e[22]!==S||e[23]!==r?(P=r(S?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=S,e[23]=r,e[24]=P):P=e[24];let A;e[25]!==M||e[26]!==S||e[27]!==P||e[28]!==E?(A=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:M,disabled:S,className:"shrink-0",children:[E,P]}),e[25]=M,e[26]=S,e[27]=P,e[28]=E,e[29]=A):A=e[29];let I;return e[30]!==A||e[31]!==_?(I=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[_,A]}),e[30]=A,e[31]=_,e[32]=I):I=e[32],I}function wr(a){return a.status==="rejected"}function Sr(a){const e=U.c(62),{control:s,form:n}=a,i=Z(),l="metadata.runtime.env";let d;e[0]!==s?(d={control:s,name:l},e[0]=s,e[1]=d):d=e[1];const r=Pn(d),{fields:f,append:o,remove:p}=r;let u;e[2]!==n?(u=(F,Y)=>{n.setValue(`${l}.${F}`,Y,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=u):u=e[3];const m=u,h=Ta();let c;if(e[4]!==h){c=new Map;for(const F of h)c.set(F.id,F);e[4]=h,e[5]=c}else c=e[5];const[x,g]=H.useState(null);let v;e[6]!==o?(v=()=>{o({key:"",kind:"literal",value:""})},e[6]=o,e[7]=v):v=e[7];const j=v;let y;e[8]!==o||e[9]!==n||e[10]!==i?(y=async()=>{let F;try{F=await navigator.clipboard.readText()}catch{le.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!F.trim()){le.error(i("sandbox.envVarsField.clipboardEmpty"));return}let Y;try{Y=br(F)}catch(te){const k=te;le.error(k.message);return}const z=Object.entries(Y);if(z.length===0){le.error(i("sandbox.envVarsField.nothingToAdd"));return}const L=n.getValues(l)??[],W=new Set;for(const te of L){const k=(te.key??"").trim();k&&W.add(k)}let G=0,se=0;for(const[te,k]of z){if(W.has(te)){se++;continue}o({key:te,kind:"literal",value:k}),W.add(te),G++}G===0&&se>0?le.message(i("sandbox.envVarsField.allKeysExist",{count:se})):le.success(se>0?i("sandbox.envVarsField.addedWithSkipped",{added:G,skipped:se}):i("sandbox.envVarsField.added",{added:G}))},e[8]=o,e[9]=n,e[10]=i,e[11]=y):y=e[11];const b=y;let w;if(e[12]!==s||e[13]!==f||e[14]!==n||e[15]!==p||e[16]!==c||e[17]!==h||e[18]!==m){let F;e[20]!==s||e[21]!==n||e[22]!==p||e[23]!==c||e[24]!==h||e[25]!==m?(F=(Y,z)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(Nr,{index:z,control:s,form:n,onUpdateEntry:m,fieldPath:l,secrets:h,secretById:c,onSaveAsSecret:(L,W)=>g({kind:"save-literal",index:z,presetKey:L,presetValue:W}),onCreateNewSecret:L=>g({kind:"create-new",index:z,presetKey:L}),onRemove:()=>p(z)})},Y.id),e[20]=s,e[21]=n,e[22]=p,e[23]=c,e[24]=h,e[25]=m,e[26]=F):F=e[26],w=f.map(F),e[12]=s,e[13]=f,e[14]=n,e[15]=p,e[16]=c,e[17]=h,e[18]=m,e[19]=w}else w=e[19];let S;e[27]!==w?(S=t.jsx("ul",{className:"space-y-2",children:w}),e[27]=w,e[28]=S):S=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ze,{className:"size-3.5"}),e[29]=N):N=e[29];let C;e[30]!==i?(C=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=C):C=e[31];let M;e[32]!==j||e[33]!==C?(M=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:j,className:"flex-1",children:[N,C]}),e[32]=j,e[33]=C,e[34]=M):M=e[34];let T;e[35]!==i?(T=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=T):T=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Ti,{className:"size-3.5"}),e[37]=V):V=e[37];let _;e[38]!==i?(_=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=_):_=e[39];let E;e[40]!==b||e[41]!==T||e[42]!==_?(E=t.jsx(Te,{asChild:!0,children:t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":T,children:[V,_]})}),e[40]=b,e[41]=T,e[42]=_,e[43]=E):E=e[43];let P;e[44]!==i?(P=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=P):P=e[45];let A;e[46]!==P?(A=t.jsx(De,{children:P}),e[46]=P,e[47]=A):A=e[47];let I;e[48]!==E||e[49]!==A?(I=t.jsxs(Ve,{children:[E,A]}),e[48]=E,e[49]=A,e[50]=I):I=e[50];let K;e[51]!==I||e[52]!==M?(K=t.jsxs("div",{className:"flex items-center gap-2",children:[M,I]}),e[51]=I,e[52]=M,e[53]=K):K=e[53];let Q;e[54]!==x||e[55]!==n||e[56]!==m?(Q=x!==null?t.jsx(kr,{mode:x,onClose:()=>g(null),onSaved:F=>{const Y=n.getValues(`${l}.${x.index}.key`)?.trim()??"";m(x.index,{key:Y,kind:"secret",secretId:F}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=m,e[57]=Q):Q=e[57];let R;return e[58]!==K||e[59]!==Q||e[60]!==S?(R=t.jsxs("div",{className:"space-y-2",children:[S,K,Q]}),e[58]=K,e[59]=Q,e[60]=S,e[61]=R):R=e[61],R}function Nr(a){const e=U.c(77),{index:s,control:n,form:i,onUpdateEntry:l,fieldPath:d,secrets:r,secretById:f,onSaveAsSecret:o,onCreateNewSecret:p,onRemove:u}=a,m=Z(),h=`${d}.${s}.key`,c=`${d}.${s}.value`,x=`${d}.${s}.secretId`,g=`${d}.${s}.kind`;let v;e[0]!==n||e[1]!==g?(v={control:n,name:g},e[0]=n,e[1]=g,e[2]=v):v=e[2];const y=zt(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==o||e[7]!==l||e[8]!==c?(b=k=>{const $=i.getValues(h)?.trim()??"";if(k==="literal"){l(s,{key:$,kind:"literal",value:""});return}const q=i.getValues(c)??"";if(q.length>0){o($,q);return}l(s,{key:$,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=o,e[7]=l,e[8]=c,e[9]=b):b=e[9];const w=b;let S;e[10]!==s||e[11]!==m?(S=k=>{const{field:$}=k,q=($.value??"").trim(),B=q.length>0&&!wt.test(q);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ne,{...$,value:$.value??"",placeholder:m("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ve("font-mono",B&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":B,"aria-label":m("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:X=>{const ae=X.target.value.trim();$.onChange(ae),$.onBlur()}}),B?t.jsx("p",{className:"text-2xs text-destructive",children:m("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=m,e[12]=S):S=e[12];let N;e[13]!==n||e[14]!==h||e[15]!==S?(N=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{control:n,name:h,render:S})}),e[13]=n,e[14]=h,e[15]=S,e[16]=N):N=e[16];let C;e[17]!==w?(C=k=>w(k),e[17]=w,e[18]=C):C=e[18];let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Re,{className:"h-9 w-[110px]",children:t.jsx(Le,{})}),e[19]=M):M=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Lt,{className:"size-3.5"}),e[20]=T):T=e[20];let V;e[21]!==m?(V=m("sandbox.envVarsField.literal"),e[21]=m,e[22]=V):V=e[22];let _;e[23]!==V?(_=t.jsx(Pe,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[T,V]})}),e[23]=V,e[24]=_):_=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(In,{className:"size-3.5"}),e[25]=E):E=e[25];let P;e[26]!==m?(P=m("sandbox.envVarsField.secret"),e[26]=m,e[27]=P):P=e[27];let A;e[28]!==P?(A=t.jsx(Pe,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[E,P]})}),e[28]=P,e[29]=A):A=e[29];let I;e[30]!==A||e[31]!==_?(I=t.jsxs(Ue,{children:[_,A]}),e[30]=A,e[31]=_,e[32]=I):I=e[32];let K;e[33]!==y||e[34]!==I||e[35]!==C?(K=t.jsx("div",{className:"shrink-0",children:t.jsxs(Be,{value:y,onValueChange:C,children:[M,I]})}),e[33]=y,e[34]=I,e[35]=C,e[36]=K):K=e[36];let Q;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==h||e[41]!==y||e[42]!==p||e[43]!==f||e[44]!==x||e[45]!==r||e[46]!==m||e[47]!==c?(Q=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:y==="literal"?t.jsx(be,{control:n,name:c,render:k=>{const{field:$}=k;return t.jsx(Ne,{...$,value:$.value??"",type:"password",placeholder:m("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":m("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:q=>{$.onChange(q.target.value),$.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(be,{control:n,name:x,render:k=>{const{field:$}=k;return t.jsxs(Be,{value:$.value||"",onValueChange:q=>$.onChange(q),children:[t.jsx(Re,{className:ve("h-9 w-full",!$.value&&"text-muted-foreground"),"aria-label":m("sandbox.envVarsField.secretAriaLabel",{index:s+1}),children:t.jsx(Le,{placeholder:m("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(Ma,{field:$,secretById:f})})}),t.jsx(Ue,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:m("sandbox.envVarsField.noSecretsYet")}):r.map(Cr)})]})}}),t.jsxs(Ve,{children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":m("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const k=i.getValues(h)?.trim()??"";p(k)},children:t.jsx(ze,{className:"size-3.5"})})}),t.jsx(De,{children:m("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=h,e[41]=y,e[42]=p,e[43]=f,e[44]=x,e[45]=r,e[46]=m,e[47]=c,e[48]=Q):Q=e[48];let R;e[49]!==i||e[50]!==h||e[51]!==y||e[52]!==o||e[53]!==m||e[54]!==c?(R=y==="literal"?t.jsxs(Ve,{children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":m("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const k=i.getValues(h)?.trim()??"",$=i.getValues(c)??"";o(k,$)},children:t.jsx(Di,{className:"size-3.5"})})}),t.jsx(De,{children:m("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=y,e[52]=o,e[53]=m,e[54]=c,e[55]=R):R=e[55];let F;e[56]!==m?(F=m("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=m,e[57]=F):F=e[57];let Y;e[58]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx(bt,{className:"size-3.5"}),e[58]=Y):Y=e[58];let z;e[59]!==u||e[60]!==F?(z=t.jsx(Te,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":F,onClick:u,children:Y})}),e[59]=u,e[60]=F,e[61]=z):z=e[61];let L;e[62]!==m?(L=m("sandbox.envVarsField.remove"),e[62]=m,e[63]=L):L=e[63];let W;e[64]!==L?(W=t.jsx(De,{children:L}),e[64]=L,e[65]=W):W=e[65];let G;e[66]!==z||e[67]!==W?(G=t.jsxs(Ve,{children:[z,W]}),e[66]=z,e[67]=W,e[68]=G):G=e[68];let se;e[69]!==R||e[70]!==G?(se=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[R,G]}),e[69]=R,e[70]=G,e[71]=se):se=e[71];let te;return e[72]!==K||e[73]!==Q||e[74]!==se||e[75]!==N?(te=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[N,K,Q,se]}),e[72]=K,e[73]=Q,e[74]=se,e[75]=N,e[76]=te):te=e[76],te}function Cr(a){return t.jsx(Pe,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(Va,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function kr({mode:a,onClose:e,onSaved:s}){const n=Z(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[d,r]=H.useState(()=>Mr(l)),[f,o]=H.useState("organization"),[p,u]=H.useState(i),[m,h]=H.useState(""),c=Da(),x=d.trim(),g=p.length>0&&x.length>0&&_a.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const w=await c.mutateAsync({scope:f,name:x,value:p,description:m.trim()||void 0});le.success(n("sandbox.envVarsField.secretSaved",{name:w.name})),s(w.id)}catch(w){le.error(w instanceof Error?w.message:n("sandbox.envVarsField.failedToSaveSecret"))}},j=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),y=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(at,{open:!0,onOpenChange:b=>{b||e()},children:t.jsxs(it,{className:"sm:max-w-md",children:[t.jsxs(xt,{children:[t.jsx(ht,{children:j}),t.jsx(Is,{children:y})]}),t.jsxs("form",{onSubmit:v,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Se,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs(Be,{value:f,onValueChange:b=>o(b),children:[t.jsx(Re,{id:"save-secret-scope",children:t.jsx(Le,{})}),t.jsxs(Ue,{children:[t.jsx(Pe,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(Pe,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Se,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(Ne,{id:"save-secret-name",value:d,onChange:b=>r(b.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Se,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(Ne,{id:"save-secret-value",type:"password",value:p,onChange:b=>u(b.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Se,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(ut,{id:"save-secret-description",value:m,onChange:b=>h(b.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs($t,{children:[t.jsx(ee,{type:"button",variant:"outline",onClick:e,disabled:c.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(ee,{type:"submit",disabled:!g||c.isPending,children:c.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function ws(a){if(!Array.isArray(a))return[];const e=[];for(const s of a){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!wt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function Mr(a){const e=a.trim();return e&&wt.test(e)?e:""}function _r({repository:a}){const e=a.path.split("/");return{owner:e.slice(0,-1).join("/"),name:e.at(-1)??a.path,url:a.webUrl,repositoryId:a.id}}function Vr(a){const e=U.c(30),{repo:s,onConnect:n}=a,i=Z(),[l,d]=H.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Pa,{size:20,className:"text-foreground/70"}),e[0]=r):r=e[0];let f;e[1]!==s||e[2]!==i?(f=s?`${s.owner}/${s.name}`:i("virtualMcp.settings.repository.none"),e[1]=s,e[2]=i,e[3]=f):f=e[3];let o;e[4]!==s||e[5]!==i?(o=s?s.url:i("virtualMcp.settings.repository.noneDescription"),e[4]=s,e[5]=i,e[6]=o):o=e[6];const p=s?"outline":"default";let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=()=>d(!0),e[7]=u):u=e[7];let m;e[8]!==s||e[9]!==i?(m=i(s?"virtualMcp.settings.repository.change":"virtualMcp.settings.repository.connect"),e[8]=s,e[9]=i,e[10]=m):m=e[10];let h;e[11]!==p||e[12]!==m?(h=t.jsx(ee,{size:"sm",variant:p,onClick:u,children:m}),e[11]=p,e[12]=m,e[13]=h):h=e[13];let c;e[14]!==f||e[15]!==o||e[16]!==h?(c=t.jsx(Me,{children:t.jsx($e,{icon:r,title:f,description:o,action:h})}),e[14]=f,e[15]=o,e[16]=h,e[17]=c):c=e[17];let x;e[18]!==i?(x=i("virtualMcp.settings.repository.connect"),e[18]=i,e[19]=x):x=e[19];let g;e[20]!==n||e[21]!==i?(g=async y=>{await n(_r(y)),d(!1),le.success(i("virtualMcp.settings.repository.connected",{name:y.repository.path}))},e[20]=n,e[21]=i,e[22]=g):g=e[22];let v;e[23]!==l||e[24]!==g||e[25]!==x?(v=t.jsx(Oa,{open:l,onOpenChange:d,title:x,onPicked:g,onError:Tr}),e[23]=l,e[24]=g,e[25]=x,e[26]=v):v=e[26];let j;return e[27]!==v||e[28]!==c?(j=t.jsxs(Oe,{children:[c,v]}),e[27]=v,e[28]=c,e[29]=j):j=e[29],j}function Tr(a){return le.error(a)}const Dr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function Pr(a){const e=a.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const Or=Object.keys(Dr),Tt="__none__";function Ir(a){const e=U.c(47),{control:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==n?(l=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=l):l=e[1];let d;e[2]!==l?(d=t.jsx(Se,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=d):d=e[3];let r;e[4]!==n?(r=C=>{const{field:M}=C;return t.jsxs(Be,{value:M.value??Tt,onValueChange:T=>M.onChange(T===Tt?null:T),children:[t.jsx(Re,{id:"runtime-pm",children:t.jsx(Le,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Ue,{children:[t.jsx(Pe,{value:Tt,children:n("sandbox.runtimeFields.autoDetect")}),Or.map(Ar)]})]})},e[4]=n,e[5]=r):r=e[5];let f;e[6]!==s||e[7]!==r?(f=t.jsx(be,{control:s,name:"metadata.runtime.selected",render:r}),e[6]=s,e[7]=r,e[8]=f):f=e[8];let o;e[9]!==d||e[10]!==f?(o=t.jsxs("div",{className:"space-y-2",children:[d,f]}),e[9]=d,e[10]=f,e[11]=o):o=e[11];let p;e[12]!==n?(p=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=p):p=e[13];let u;e[14]!==p?(u=t.jsx(Se,{htmlFor:"runtime-path",children:p}),e[14]=p,e[15]=u):u=e[15];let m;e[16]!==s?(m=t.jsx(be,{control:s,name:"metadata.runtime.path",render:$r}),e[16]=s,e[17]=m):m=e[17];let h;e[18]!==n?(h=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=h):h=e[19];let c;e[20]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=c):c=e[21];let x;e[22]!==c||e[23]!==u||e[24]!==m?(x=t.jsxs("div",{className:"space-y-2",children:[u,m,c]}),e[22]=c,e[23]=u,e[24]=m,e[25]=x):x=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let v;e[28]!==g?(v=t.jsx(Se,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=v):v=e[29];let j;e[30]!==n?(j=C=>{const{field:M}=C;return t.jsx(Ne,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:M.value??"",onBlur:T=>{const V=Pr(T.target.value);V.ok?M.onChange(V.value):i.current&&(i.current.value=M.value??"")}})},e[30]=n,e[31]=j):j=e[31];let y;e[32]!==s||e[33]!==j?(y=t.jsx(be,{control:s,name:"metadata.runtime.port",render:j}),e[32]=s,e[33]=j,e[34]=y):y=e[34];let b;e[35]!==n?(b=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=b):b=e[36];let w;e[37]!==b?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=w):w=e[38];let S;e[39]!==v||e[40]!==y||e[41]!==w?(S=t.jsxs("div",{className:"space-y-2",children:[v,y,w]}),e[39]=v,e[40]=y,e[41]=w,e[42]=S):S=e[42];let N;return e[43]!==x||e[44]!==S||e[45]!==o?(N=t.jsxs("div",{className:"space-y-5",children:[o,x,S]}),e[43]=x,e[44]=S,e[45]=o,e[46]=N):N=e[46],N}function $r(a){const{field:e}=a;return t.jsx(Ne,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function Ar(a){return t.jsx(Pe,{value:a,children:a},a)}function Er(a){const e=U.c(10),{control:s}=a,n=Z(),[i,l]=H.useState(null),[d,r]=H.useState(null),f=zt({control:s,name:"metadata.runtime.path"})??"";let o;e[0]!==f?(o=cs(f),e[0]=f,e[1]=o):o=e[1];const p=o;let u;e[2]!==i||e[3]!==d||e[4]!==p||e[5]!==n?(u=h=>{const{field:c}=h,x=c.value??[],g=j=>c.onChange(j.length?j:null),v=()=>{if(i===null)return;const j=cs(i);if(!j){l(null),r(null);return}if(j===p||x.some(y=>y.path===j)){r(n("sandbox.runtimeApps.duplicate"));return}g([...x,{path:j}]),l(null),r(null)};return t.jsxs("div",{className:"space-y-2",children:[t.jsx(Se,{htmlFor:"runtime-apps-draft",children:n("sandbox.runtimeApps.title")}),x.length>0&&t.jsx("ul",{className:"space-y-1.5",children:x.map(j=>t.jsxs("li",{className:"flex h-9 items-center gap-2 rounded-md border border-border px-3",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:j.path}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":n("sandbox.runtimeApps.remove",{path:j.path}),onClick:()=>g(x.filter(y=>y.path!==j.path)),children:t.jsx(bt,{})})]},j.path))}),i!==null?t.jsx(Ne,{id:"runtime-apps-draft",autoFocus:!0,placeholder:"apps/checkout",value:i,"aria-invalid":!!d,onChange:j=>{l(j.target.value),r(null)},onBlur:v,onKeyDown:j=>{j.key==="Enter"?(j.preventDefault(),v()):j.key==="Escape"&&(l(null),r(null))}}):x.length<rs&&t.jsxs(ee,{id:"runtime-apps-draft",type:"button",variant:"outline",size:"sm",onClick:()=>l(""),children:[t.jsx(ze,{}),n("sandbox.runtimeApps.add")]}),d?t.jsx("p",{className:"text-xs text-destructive",children:d}):t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.runtimeApps.description",{max:String(rs)})})]})},e[2]=i,e[3]=d,e[4]=p,e[5]=n,e[6]=u):u=e[6];let m;return e[7]!==s||e[8]!==u?(m=t.jsx(be,{control:s,name:"metadata.runtime.apps",render:u}),e[7]=s,e[8]=u,e[9]=m):m=e[9],m}function Fr(a){const e=U.c(5),{control:s}=a,n=Z();let i;e[0]!==n?(i=d=>{const{field:r}=d;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(rt,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:f=>r.onChange(f)})]})},e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=t.jsx(be,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function zr(a){const e=U.c(32),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let d;e[2]!==i?(d=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==l||e[5]!==d?(r={value:"smart",label:l,description:d},e[4]=l,e[5]=d,e[6]=r):r=e[6];let f;e[7]!==i?(f=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=f):f=e[8];let o;e[9]!==i?(o=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=o):o=e[10];let p;e[11]!==f||e[12]!==o?(p={value:"code-review",label:f,description:o},e[11]=f,e[12]=o,e[13]=p):p=e[13];let u;e[14]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=u):u=e[15];let m;e[16]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=m):m=e[17];let h;e[18]!==u||e[19]!==m?(h={value:"open",label:u,description:m},e[18]=u,e[19]=m,e[20]=h):h=e[20];let c;e[21]!==r||e[22]!==p||e[23]!==h?(c=[r,p,h],e[21]=r,e[22]=p,e[23]=h,e[24]=c):c=e[24];const x=c;let g;e[25]!==n||e[26]!==x||e[27]!==i?(g=j=>{const{field:y}=j,b=y.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs(Be,{value:b,onValueChange:w=>{y.onChange(w),n()},children:[t.jsx(Re,{id:"publish-policy",className:"w-44 shrink-0",children:t.jsx(Le,{})}),t.jsx(Ue,{className:"max-w-80",children:x.map(Rr)})]})]})},e[25]=n,e[26]=x,e[27]=i,e[28]=g):g=e[28];let v;return e[29]!==s||e[30]!==g?(v=t.jsx(be,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=v):v=e[31],v}function Rr(a){return t.jsx(Pe,{value:a.value,description:a.description,children:a.label},a.value)}function Lr(a){const e=U.c(24),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let d;e[2]!==i?(d=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==l||e[5]!==d?(r={value:"off",label:l,description:d},e[4]=l,e[5]=d,e[6]=r):r=e[6];let f;e[7]!==i?(f=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=f):f=e[8];let o;e[9]!==i?(o=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=o):o=e[10];let p;e[11]!==f||e[12]!==o?(p={value:"on",label:f,description:o},e[11]=f,e[12]=o,e[13]=p):p=e[13];let u;e[14]!==r||e[15]!==p?(u=[r,p],e[14]=r,e[15]=p,e[16]=u):u=e[16];const m=u;let h;e[17]!==n||e[18]!==m||e[19]!==i?(h=x=>{const{field:g}=x,v=g.value??null,j=en(v);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs(Be,{value:j,onValueChange:y=>{const b=ja.safeParse(y);b.success&&(g.onChange(ya(v,b.data)),n())},children:[t.jsx(Re,{id:"content-editing-mode",className:"w-44 shrink-0",children:t.jsx(Le,{})}),t.jsx(Ue,{className:"max-w-80",children:m.map(Ur)})]})]})},e[17]=n,e[18]=m,e[19]=i,e[20]=h):h=e[20];let c;return e[21]!==s||e[22]!==h?(c=t.jsx(be,{name:"metadata.ui.layout",control:s,render:h}),e[21]=s,e[22]=h,e[23]=c):c=e[23],c}function Ur(a){return t.jsx(Pe,{value:a.value,description:a.description,children:a.label},a.value)}function Ss(a){const e=a.metadata?.sidebarViews,s=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...Ot(It(a.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s,seen:a.metadata?.sidebarViewsSeen??void 0}}function Ns(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((s,n)=>s===e[n])}function Br(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function Yr(a,e){switch(e.type){case"accumulate":{const s=a??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Wr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!wt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:s}}}}async function Kr(a,e){const s=a?.idToken??null;if(s){const i=Cs(s);if(i)return i}const n=a?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),d=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(d)return d}}catch{}return Cs(e)}function Cs(a){try{const e=a.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function Gr({virtualMcp:a,contextSection:e}){const s=Z(),n=ni(),{org:i}=Ee(),l=ri(),{data:d}=oi([a.id]),r=d?.get(a.id)?.last_used_at,f=$s(),o=Ft(),p=ft(),u=Xs(a.id),m=JSON.stringify([i.id,a.id]),h=la(a.metadata,u.snapshot()),c=$n({resolver:An(or),defaultValues:{...a,metadata:{...os(a.metadata),previewServerUrl:va(a.metadata),...h}}}),x=c.watch("connections"),g=Ia("multi_app_preview"),v=Hi(a),j=Qs(a?.metadata),y=j&&en(c.watch("metadata.ui.layout"))==="off",b=Es(a),w=b?{owner:b.owner,name:b.name,url:b.url}:null,[S,N]=H.useReducer(Br,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[C,M]=H.useState(!1),[T,V]=H.useState(!1),{openSidePanel:_}=ei(),{sendMessage:E}=Qn(),P=async()=>{if(T)return;const D=c.getValues("metadata.instructions");if(D?.trim()){V(!0);try{R(),_e("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:D.length}),_();const oe=qn(i.id);await E({tiptapDoc:Jn({managerAgentId:oe.id,managerName:oe.title,kind:"agent",id:a.id,instructions:D})})}finally{V(!1)}}},[A,I]=H.useReducer(Yr,null),K=()=>{A!==null&&(_e("agent_updated",{agent_id:a.id,fields:Array.from(A.fields),instructions_length:A.instructionsLength,save_count:A.saveCount,edit_duration_ms:Date.now()-A.start}),I({type:"reset"}))},{schedule:Q,flush:R}=ts({delayMs:3e4,save:async()=>K()}),F=async()=>{const D=u.snapshot(),oe={predicate:Ce=>ls(Ce.queryKey,i.id)},ne=async()=>(await o.invalidateQueries({predicate:Ce=>ls(Ce.queryKey,i.id),refetchType:"all"}),as(o,i.id,a.id)),xe=(Ce,He)=>{if(Ce){Ns(c.getValues("metadata.sidebarViews"),Ce.rawViews)||c.setValue("metadata.sidebarViews",Ce.rawViews,{shouldDirty:!1}),c.getValues("metadata.sidebarViewsVersion")!==Ce.version&&c.setValue("metadata.sidebarViewsVersion",Ce.version,{shouldDirty:!1}),Ns(c.getValues("metadata.sidebarViewsSeen"),Ce.seen)||c.setValue("metadata.sidebarViewsSeen",Ce.seen,{shouldDirty:!1});return}He!==null&&(c.setValue("metadata.sidebarViews",[...He],{shouldDirty:!1}),c.setValue("metadata.sidebarViewsVersion",ia,{shouldDirty:!1}))},ke=ra(D),Ie=Object.keys(c.control._formState.dirtyFields);if(Ie.length===0&&!ke){await u.settle({snapshot:D,saved:!0,authoritativeViews:D?.persistedViews});return}const Ge=Ie.length>0?Ie:["metadata"],ot=Ge.includes("metadata"),qe=c.getValues();c.reset(qe,{keepValues:!0});const et=Wr(qe),pn=as(o,i.id,a.id),hn=oa({sidebarViews:et.metadata?.sidebarViews,sidebarViewsVersion:et.metadata?.sidebarViewsVersion},D,pn?.metadata);et.metadata={...os(et.metadata),...hn};let Nt;try{Nt=await l.update.mutateAsync({id:a.id,data:et})}catch(Ce){let He=null;try{He=await ne()}catch{}const Wt=He?Ss(He):null,Kt=await u.settle({snapshot:D,saved:!1,authoritativeViews:Wt?.effectiveViews});throw Kt.settledLatest&&xe(Wt,Kt.reconciledViews),Ce}await o.cancelQueries(oe),ca(o,i.id,Nt);const Bt=Ss(Nt),Yt=await u.settle({snapshot:D,saved:!0,authoritativeViews:Bt.effectiveViews});Yt.settledLatest&&xe(Bt,Yt.reconciledViews),I({type:"accumulate",now:Date.now(),fields:Ge,instructionsLength:ot?qe.metadata?.instructions?.length??0:null}),Q()},Y=()=>$a(m,F),{schedule:z,flush:L}=ts({save:Y});H.useEffect(()=>{const D=c.watch(()=>z());return()=>D.unsubscribe()},[]);const W=()=>{_e("connections_dialog_opened",{source:"agent_settings",mode:"add"}),N({type:"SET_ADD_DIALOG_OPEN",payload:!0})},G=async D=>{const oe=c.getValues("connections");if(oe.some(ke=>ke.connection_id===D))return;c.setValue("connections",[...oe,{connection_id:D,selected_tools:Vt.tools,selected_resources:Vt.resources,selected_prompts:Vt.prompts}],{shouldDirty:!0}),N({type:"SET_ADD_DIALOG_OPEN",payload:!1});const ne=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin),xe=await Xt({url:ne.href,token:null,orgId:i.id});xe.supportsOAuth&&!xe.isAuthenticated&&await q(D)},se=D=>{const ne=c.getValues("connections").filter(xe=>xe.connection_id!==D);c.setValue("connections",ne,{shouldDirty:!0})},te=(D,oe)=>{const ne=c.getValues("connections");if(ne.some(xe=>xe.connection_id===oe)){le.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}c.setValue("connections",ne.map(xe=>xe.connection_id===D?{...xe,connection_id:oe}:xe),{shouldDirty:!0})},k=async D=>{if(c.getValues("connections").find(ne=>ne.connection_id===D))try{const{item:ne}=await p.call("COLLECTION_CONNECTIONS_GET",{id:D});if(!ne)return;const xe=ne.title.replace(/\s*\(.*?\)\s*$/,""),ke=Hn("conn"),Ie=`${xe} (${Date.now().toString(36).slice(-4)})`;await f.create.mutateAsync({id:ke,title:Ie,description:ne.description??null,connection_type:ne.connection_type,connection_url:ne.connection_url??null,connection_token:null,icon:ne.icon??null,app_name:ne.app_name??null,app_id:ne.app_id??null,connection_headers:ne.connection_headers??null});const Ge=new URL(`/api/${i.slug}/mcp/${ke}`,window.location.origin),ot=await Xt({url:Ge.href,token:null,orgId:i.id});if(ot.supportsOAuth&&!ot.isAuthenticated){const qe=await q(ke);if(!qe){await f.delete.mutateAsync(ke);return}await f.update.mutateAsync({id:ke,data:{title:`${xe} (${qe})`}})}te(D,ke),le.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(ne){console.error("Failed to create instance:",ne),le.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},$=D=>{N({type:"OPEN_SETTINGS",payload:D})},q=async D=>{const{token:oe,tokenInfo:ne,error:xe}=await ai({connectionId:D,orgSlug:i.slug,scope:"offline_access"});if(xe||!oe)return le.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:xe??""})),null;if(ne)try{const Ie=await fetch(`/api/${i.slug}/connections/${D}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})});if(!Ie.ok)console.error("Failed to save OAuth token:",await Ie.text()),await f.update.mutateAsync({id:D,data:{connection_token:oe}});else try{await f.update.mutateAsync({id:D,data:{}})}catch(Ge){console.warn("Failed to refresh connection tools after OAuth:",Ge)}}catch(Ie){console.error("Error saving OAuth token:",Ie),await f.update.mutateAsync({id:D,data:{connection_token:oe}})}else await f.update.mutateAsync({id:D,data:{connection_token:oe}});const ke=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin);return await o.invalidateQueries({queryKey:Et.isMCPAuthenticated(ke.href,null)}),le.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Kr(ne,oe)},B=()=>{const D=c.getValues("metadata.instructions")??"",oe=s("virtualMcp.virtualMcp.promptTemplateContent"),ne=D.trim()?`${D}
|
|
3
|
-
|
|
4
|
-
${oe}`:oe;c.setValue("metadata.instructions",ne,{shouldDirty:!0})},X=new Set(x.map(D=>D.connection_id)),{section:ae}=Xl(),je=e!==null,ie=e==="instructions"?null:e??ae,ce=ie==="general",ue=je?e==="instructions":ce,ge=xa(a.id),de=En(a.metadata),he=ql({virtualMcpId:a.id,form:c,flushAndSave:L}),me=pt(),[fe,O]=H.useState(!1),J=async()=>{R();try{await l.delete.mutateAsync(a.id),_e("agent_deleted",{agent_id:a.id,source:"agent_detail"}),le.success(s("virtualMcp.virtualMcp.agentDeleted",{title:a.title})),me({to:"/$org",params:{org:i.slug}})}catch{}},ye=t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>{_e("agent_connect_modal_opened",{agent_id:a.id}),N({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Fn,{size:14}),s("virtualMcp.virtualMcp.connect")]}),pe=t.jsxs("div",{className:"flex items-center gap-2",children:[!c.watch("metadata.instructions")?.trim()&&t.jsx(ee,{variant:"outline",size:"sm",onClick:B,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(ee,{variant:"outline",size:"sm",disabled:T||!c.watch("metadata.instructions")?.trim(),onClick:P,children:[t.jsx(dt,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ke,{children:[t.jsxs(t.Fragment,{children:[!je&&t.jsxs(t.Fragment,{children:[t.jsx(Ke.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Ql,{section:ie??"general"})]}),t.jsx(Ke.Actions,{secondary:ie==="connections"?ye:void 0,children:ie==="connections"?t.jsxs(ee,{size:"sm",onClick:W,children:[t.jsx(ze,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):ie==="general"?ye:null}),t.jsx(Ke.Content,{children:t.jsx(Ke.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(zn,{children:[ie==="views"&&t.jsx(Wl,{views:he}),ce&&t.jsx(Hl,{form:c,onCommit:L}),ie==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:x.length===0?t.jsxs("button",{type:"button",onClick:W,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(ze,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:s("virtualMcp.virtualMcp.noConnectionsYet")})]}):x.map(D=>t.jsx(Xe,{fallback:()=>null,children:t.jsx(H.Suspense,{fallback:t.jsx(rn,{}),children:t.jsx(Pl,{connection_id:D.connection_id,usedConnectionIds:X,onOpenSettings:()=>$(D.connection_id),onRemove:()=>se(D.connection_id),onAuthenticate:q,onSwitchInstance:te,onNewInstance:()=>k(D.connection_id)})})},D.connection_id))})}),ue&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.instructions")}),pe]}),t.jsx(be,{name:"metadata.instructions",control:c.control,render:({field:D})=>t.jsxs("div",{className:"relative rounded-xl shadow-edge bg-card focus-within-ring",children:[t.jsx(ut,{...D,value:D.value??"",onChange:oe=>{D.onChange(oe)},onBlur:()=>{D.onBlur(),L()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2 text-muted-foreground",onClick:()=>M(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(Pi,{size:14})})}),t.jsx(De,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),ue&&t.jsx(rl,{form:c}),ie==="site"&&!j&&t.jsx(Oe,{children:t.jsx(Me,{children:t.jsx($e,{title:s("virtualMcp.settings.cmsEmptyTitle"),description:s("virtualMcp.settings.cmsEmpty"),action:t.jsx(ee,{size:"sm",variant:"outline",asChild:!0,children:t.jsx(At,{to:".",search:{section:"repository"},children:s("virtualMcp.settings.repository.open")})})})})}),ie==="site"&&j&&t.jsx(Oe,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(Me,{children:[t.jsx(we,{children:t.jsx(Lr,{control:c.control,onCommit:L})}),!y&&t.jsx(we,{children:t.jsx(Fr,{control:c.control})}),!y&&v&&t.jsx(we,{children:t.jsx(zr,{control:c.control,onCommit:L})})]})}),ie==="site"&&!y&&t.jsx(Oe,{title:s("sandbox.cmsSettings.preview.title"),description:s("sandbox.cmsSettings.preview.description"),children:t.jsx(Me,{children:t.jsx(rr,{control:c.control,isBlocksV8:ge,previewServerUrl:c.watch("metadata.previewServerUrl"),fastPreview:c.watch("metadata.fastPreview")})})}),ie==="site"&&t.jsx(sr,{virtualMcp:a}),ie==="site"&&ge&&de&&t.jsx(er,{orgSlug:i.slug,virtualMcpId:a.id,site:de}),ie==="repository"&&t.jsx(Vr,{repo:w,onConnect:D=>(c.setValue("metadata.repository",D,{shouldDirty:!0}),L())}),ie==="repository"&&t.jsx(Oe,{title:s("virtualMcp.settings.repository.runtimeTitle"),description:s("virtualMcp.settings.repository.runtimeDescription"),children:t.jsxs(Me,{children:[t.jsx(we,{children:t.jsx(Ir,{control:c.control})}),g&&t.jsx(we,{children:t.jsx(Er,{control:c.control})}),t.jsx(we,{children:t.jsx(jr,{control:c.control,form:c,virtualMcpId:a.id,orgSlug:i.slug,sandboxMap:a.metadata.sandboxMap})})]})}),ce&&t.jsx(Oe,{title:s("virtualMcp.settings.groups.details"),children:t.jsxs(Me,{children:[t.jsx($e,{title:s("virtualMcp.virtualMcp.createdBy"),action:t.jsx(Xn,{id:a.created_by,size:"2xs",className:"text-sm text-muted-foreground"})}),t.jsx($e,{title:s("virtualMcp.virtualMcp.created"),action:t.jsx("span",{className:"text-sm text-muted-foreground",children:al(new Date(a.created_at),"PP",{locale:n})})}),t.jsx($e,{title:s("virtualMcp.virtualMcp.lastUsedLabel"),action:t.jsx("span",{className:"text-sm text-muted-foreground",children:r?ii(new Date(r),{addSuffix:!0,locale:n}):s("virtualMcp.virtualMcp.neverUsed")})})]})}),ce&&t.jsx(Oe,{title:s("virtualMcp.settings.groups.advanced"),children:t.jsx(Me,{children:t.jsx($e,{title:s("virtualMcp.virtualMcp.deleteAgent"),description:s("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(ee,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>O(!0),children:[t.jsx(bt,{size:14}),s("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},e??ie)]}),t.jsx(Rn,{open:fe,onOpenChange:O,children:t.jsxs(Ln,{children:[t.jsxs(Un,{children:[t.jsx(Bn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Yn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:a.title})})]}),t.jsxs(Wn,{children:[t.jsx(Kn,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(Gn,{onClick:J,variant:"destructive",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx($i,{open:S.addDialogOpen,onOpenChange:D=>N({type:"SET_ADD_DIALOG_OPEN",payload:D}),agentId:a.id,addedConnectionIds:X,onAdd:G}),t.jsx(Dl,{open:S.settingsDialogOpen,onOpenChange:D=>{D||N({type:"CLOSE_SETTINGS"})},selectedId:S.settingsConnectionId,form:c,connections:x,onAuthenticate:q}),t.jsx(gr,{open:S.shareDialogOpen,onOpenChange:D=>N({type:"SET_SHARE_DIALOG_OPEN",payload:D}),virtualMcp:a}),t.jsx(at,{open:C,onOpenChange:M,children:t.jsxs(it,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(xt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(ht,{children:s("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(be,{name:"metadata.instructions",control:c.control,render:({field:D})=>t.jsx(ut,{...D,value:D.value??"",onChange:oe=>{D.onChange(oe)},onBlur:()=>{D.onBlur(),L()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl shadow-edge px-4 py-3 focus-ring bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function ac(a){const e=U.c(22),{virtualMcpId:s,contextSection:n}=a,i=n===void 0?null:n,l=Z(),d=pt(),{org:r}=Ee(),f=As(s);if(!f){let m;e[0]!==l?(m=l("virtualMcp.virtualMcp.spaceNotFound"),e[0]=l,e[1]=m):m=e[1];let h;e[2]!==l?(h=l("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=l,e[3]=h):h=e[3];let c;e[4]!==d||e[5]!==r.slug?(c=()=>d({to:"/$org",params:{org:r.slug}}),e[4]=d,e[5]=r.slug,e[6]=c):c=e[6];let x;e[7]!==l?(x=l("virtualMcp.virtualMcp.backToSpaces"),e[7]=l,e[8]=x):x=e[8];let g;e[9]!==c||e[10]!==x?(g=t.jsx(ee,{variant:"outline",onClick:c,children:x}),e[9]=c,e[10]=x,e[11]=g):g=e[11];let v;return e[12]!==m||e[13]!==h||e[14]!==g?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Zn,{title:m,description:h,actions:g})}),e[12]=m,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let o;e[16]!==f?(o=Es(f)?.connectionId??"",e[16]=f,e[17]=o):o=e[17];const p=`${f.id}:${o}`;let u;return e[18]!==i||e[19]!==p||e[20]!==f?(u=t.jsx(Gr,{virtualMcp:f,contextSection:i},p),e[18]=i,e[19]=p,e[20]=f,e[21]=u):u=e[21],u}export{ac as V};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f,a5 as h,gZ as d,j as g,N as m,af as p,a2 as j}from"./index-Bm1K3DQC.js";import{L as v}from"./legacy-main-redirect-CxB3kSgS.js";import"./thread-route-C4AshLS2.js";const x=j("/shell/$org/org-shell/");function L(){const t=f.c(19),{org:a}=h(),l=x.useSearch(),{main:i,virtualmcpid:o}=l;if(i!==void 0){let e;t[0]!==i||t[1]!==a.slug||t[2]!==l||t[3]!==o?(e=d({org:a.slug,agentId:o,main:i,search:l}),t[0]=i,t[1]=a.slug,t[2]=l,t[3]=o,t[4]=e):e=t[4];const s=e;if(s?.kind==="canonical"){let r;return t[5]!==s?(r=g.jsx(v,{target:s}),t[5]=s,t[6]=r):r=t[6],r}}let n;t[7]!==o?(n=o?.trim()||null,t[7]=o,t[8]=n):n=t[8];const u=n;if(u){let e;t[9]!==a.slug||t[10]!==u?(e={org:a.slug,agentId:u},t[9]=a.slug,t[10]=u,t[11]=e):e=t[11];let s;t[12]!==l?(s={...l,virtualmcpid:void 0},t[12]=l,t[13]=s):s=t[13];let r;return t[14]!==e||t[15]!==s?(r=g.jsx(m,{to:p.projects,params:e,search:s,hash:!0,replace:!0}),t[14]=e,t[15]=s,t[16]=r):r=t[16],r}let c;return t[17]!==a.slug?(c=g.jsx(m,{to:p.home,params:{org:a.slug},search:N,hash:!0,replace:!0}),t[17]=a.slug,t[18]=c):c=t[18],c}function N(t){return{...t,virtualmcpid:void 0}}export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,cy as L,cz as V,j as c,fW as B,cE as C,cC as b,fV as K,cF as E,fX as _,es as q,cR as w,cK as T,cV as U}from"./index-Bm1K3DQC.js";var I="Radio",[z,P]=w(I),[H,W]=z(I),k=s.forwardRef((t,d)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=b(d,y=>m(y)),u=s.useRef(!1),h=p?R||!!p.closest("form"):!0;return c.jsxs(H,{scope:o,checked:e,disabled:a,children:[c.jsx(C.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:E(t.onClick,y=>{e||f?.(),h&&(u.current=y.isPropagationStopped(),u.current||y.stopPropagation())})}),h&&c.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var g="RadioIndicator",G=s.forwardRef((t,d)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=W(g,o);return c.jsx(q,{present:n||r.checked,children:c.jsx(C.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:d})})});G.displayName=g;var X="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:d,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=b(a,r),f=T(o),R=U(d);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),c.jsx(C.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=X;function A(t){return t?"checked":"unchecked"}var Y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],x="RadioGroup",[J]=w(x,[_,P]),j=_(),N=P(),[Q,Z]=J(x),D=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=j(o),u=L(R),[h,y]=V({prop:r,defaultProp:e??null,onChange:p,caller:x});return c.jsx(Q,{scope:o,name:n,required:a,disabled:l,value:h,onValueChange:y,children:c.jsx(B,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:c.jsx(C.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:d})})})});D.displayName=x;var M="RadioGroupItem",F=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=Z(M,o),a=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=b(d,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=h=>{Y.includes(h.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),c.jsx(K,{asChild:!0,...l,focusable:!a,active:p,children:c.jsx(k,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:E(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:E(e.onFocus,()=>{m.current&&R.current?.click()})})})});F.displayName=M;var $="RadioGroupIndicator",O=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return c.jsx(G,{...e,...n,ref:d})});O.displayName=$;var oe=D,re=F,te=O;export{re as I,oe as R,te as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,d as A,u as J,j as m,n as U}from"./index-Bm1K3DQC.js";import{a4 as q,J as z,R as D}from"./chat-context-DrYmTpG0.js";import{u as F}from"./use-mobile-BDHJ5g4G.js";import{u as G,C as R}from"./index-BQvrkQ8K.js";import{C as B,o as K,d as Q}from"./context-shell-8kNAse1h.js";import{L as E}from"./preview-panel-6f4Q5Yyo.js";import{L as V}from"./library-tab-D_ZcLCG5.js";import"./autosend-Dts_wRXC.js";import"./thread-route-C4AshLS2.js";import"./use-project-scope-BkidtyNv.js";import"./repository-binding-BUEX4lc5.js";import"./use-mcp-client-WgWOA1hL.js";import"./auth-Bh4_Y1Kc.js";import"./thread-intent-C_sXnvWO.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-ECs_hZYZ.js";import"./task-board-CmZ-3pYa.js";import"./schema-CyJEITX6.js";import"./use-entitlements-q4zqHldY.js";import"./use-ai-providers-BCXggb0b.js";import"./use-decopilot-events-DSC6YnSZ.js";import"./use-organization-settings-CiRL-ND2.js";import"./use-sidebar-collapsed-SkR6IFg9.js";import"./use-chat-layout-state-DCbtnqWd.js";import"./agent-icon-Y_Y2D-pt.js";import"./AlertCircle-JDirc_BX.js";import"./Tool01-D5n93WAy.js";import"./ArrowUp-hVHjHInb.js";import"./ArrowLeft-BENlvNHb.js";import"./LinkBroken01-DhH3TW3t.js";import"./ShoppingBag01-sa0ohOEa.js";import"./Globe04-CdHKMOso.js";import"./CheckCircle-BMxSQJ5-.js";import"./ChevronUp-DYc8wyky.js";import"./ChevronSelectorVertical-DDGUPocS.js";import"./UserSquare-CUiDUhHX.js";import"./CreditCard01-EEU_sSyq.js";import"./SwitchHorizontal01-DovJE4RJ.js";import"./Key01-EDnnJ_Gd.js";import"./Minus-XOOEmvqX.js";import"./Monitor01-D3lVwo0x.js";import"./Sun-pw3SuSDm.js";import"./Play-DQ3lppN9.js";import"./Plus-BHZhJmPA.js";import"./SearchMd-MlMwcObI.js";import"./Trash01-C0pW3Nzn.js";import"./Upload01-CEfXDErB.js";import"./Users01-pCKb7aTW.js";import"./XClose-__KXghgf.js";import"./Zap-CyJKtBha.js";import"./tooltip-D0Aro8zv.js";import"./index-BdxdoIZK.js";import"./toolbar-icon-button-kyI973z_.js";import"./shell-layout-DS0Ie03r.js";import"./use-deployment-admin-hI6GNxTJ.js";import"./admin-fetch-BhTJlAsX.js";import"./command-COt4WQ5b.js";import"./index-BswXowEw.js";import"./integration-icon-DTmGScIa.js";import"./project-icon-Cx2a7lKG.js";import"./use-navigate-to-agent-BJdqgQKH.js";import"./use-debounced-value-BsCdYGvU.js";import"./new-project-dialog-Bqd8DZyr.js";import"./label-BQN74rUh.js";import"./repository-picker-mdt05v0y.js";import"./github-icon-Tj2vKr0A.js";import"./useInfiniteQuery-B7UWNEWx.js";import"./infiniteQueryObserver-BNCHN17F.js";import"./collection-search-CrfF1go0.js";import"./legacy-admin-welcome-dialog-DWIUyVc4.js";import"./drawer-CtPWRLqi.js";import"./required-auth-layout-L5uobjCB.js";import"./use-org-sso-BqLBrHG0.js";import"./sheet-CX7jm_if.js";import"./resizable-DTll1yV_.js";import"./require-capability-QLRMJQu8.js";import"./access-gate-5u0FcWOM.js";import"./capability-load-error-CiSG_MLz.js";import"./sections-CN3XzQEo.js";import"./textarea-BNrj1CIV.js";import"./empty-state-DQ9zfSjj.js";import"./use-ask-in-chat-BGPRlKfS.js";import"./use-org-fs-Du2G3PF4.js";import"./preview-content-D5dxxmRk.js";import"./icon-button-DVB6vEll.js";import"./file-share-button-Sja5jda2.js";import"./popover-Dh3TtwDo.js";import"./file-preview-DrfMTr-z.js";import"./utils-8mUwv_Ld.js";import"./editor-TKi-Jvto.js";import"./file-type-icon-CuR7GKVO.js";import"./markdown-BiwQrQ3v.js";import"./use-copy-fJBOhwQv.js";import"./search-input-CZ0rurdO.js";import"./use-org-repo-syncs-CUbaI7hL.js";import"./preview-dialog-ChQFEC_i.js";import"./folder-icon-clC9OBor.js";import"./empty-state-Cgh7_fO1.js";import"./table-CZbeUf_X.js";function Ue(){const t=$.c(56),_=A();let b;t[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},t[0]=b):b=t[0];const{preview:e,expanded:k,section:M}=J(b);let j;t[1]!==M?(j=K(M),t[1]=M,t[2]=j):j=t[2];const l=j;let v;t[3]!==_?(v=i=>_({to:".",search:r=>({...r,...i.path!==void 0&&{path:i.path},preview:i.preview,expanded:i.expanded})}),t[3]=_,t[4]=v):v=t[4];const o=v;let y;t[5]!==o?(y=()=>o({}),t[5]=o,t[6]=y):y=t[6];const p=y,H=F(),C=G().threadOpen&&!H;if(l!=="files"){let i;t[7]!==l?(i=m.jsx(Q,{section:l}),t[7]=l,t[8]=i):i=t[8];let r;return t[9]!==l||t[10]!==i?(r=m.jsx(R.Content,{children:m.jsx(B,{section:l,children:i})}),t[9]=l,t[10]=i,t[11]=r):r=t[11],r}if(e&&(k||C)){let i,r,n,s,f;if(t[12]!==p||t[13]!==e||t[14]!==o){let T;t[20]!==e?(T=e.lastIndexOf("/"),t[20]=e,t[21]=T):T=t[21];const I=e.slice(0,Math.max(T,0));r=R.Content,i=U.Breadcrumbs,n="page",t[22]!==p?(s={onSelect:p},t[22]=p,t[23]=s):s=t[23];let L;t[24]!==o?(L=O=>({key:`folder:${O.path}`,label:O.label,onSelect:()=>o({path:O.path})}),t[24]=o,t[25]=L):L=t[25];const N=q(I,D).map(L);let u;t[26]!==e?(u=z(e),t[26]=e,t[27]=u):u=t[27];let P;t[28]!==u?(P={key:"file",label:u},t[28]=u,t[29]=P):P=t[29],f=[...N,P],t[12]=p,t[13]=e,t[14]=o,t[15]=i,t[16]=r,t[17]=n,t[18]=s,t[19]=f}else i=t[15],r=t[16],n=t[17],s=t[18],f=t[19];let c;t[30]!==i||t[31]!==n||t[32]!==s||t[33]!==f?(c=m.jsx(i,{after:n,parent:s,items:f}),t[30]=i,t[31]=n,t[32]=s,t[33]=f,t[34]=c):c=t[34];let d;t[35]!==C||t[36]!==e||t[37]!==o?(d=C?void 0:()=>o({preview:e}),t[35]=C,t[36]=e,t[37]=o,t[38]=d):d=t[38];let h;t[39]!==d?(h={expanded:!0,onToggle:d},t[39]=d,t[40]=h):h=t[40];let x;t[41]!==p||t[42]!==e||t[43]!==h?(x=m.jsx(E,{previewPath:e,onClose:p,expand:h},e),t[41]=p,t[42]=e,t[43]=h,t[44]=x):x=t[44];let w;return t[45]!==r||t[46]!==x||t[47]!==c?(w=m.jsxs(r,{children:[c,x]}),t[45]=r,t[46]=x,t[47]=c,t[48]=w):w=t[48],w}let a;t[49]!==p||t[50]!==e||t[51]!==o?(a=e&&m.jsx(E,{variant:"aside",previewPath:e,onClose:p,expand:{expanded:!1,onToggle:()=>o({preview:e,expanded:!0})}},e),t[49]=p,t[50]=e,t[51]=o,t[52]=a):a=t[52];let g;t[53]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsx(B,{section:"files",children:m.jsx(V,{filePreview:"side"})}),t[53]=g):g=t[53];let S;return t[54]!==a?(S=m.jsx(R.Content,{aside:a,children:g}),t[54]=a,t[55]=S):S=t[55],S}export{Ue as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as E,u as C,j as o,N as S}from"./index-Bm1K3DQC.js";import{A as y,a as R}from"./auth-entry-BVPXWLe3.js";import{A as U}from"./auth-split-layout-CtNY2lz5.js";import{L as j}from"./legacy-admin-welcome-dialog-DWIUyVc4.js";import"./delay-CnY5UFtP.js";import"./drawer-CtPWRLqi.js";import"./use-mobile-BDHJ5g4G.js";const s="studio_signup_ref",r="studio_signup_src",L=720*60*60,u=128;function l(e){const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?.[1]?decodeURIComponent(t[1]):null}function d(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${L}; samesite=lax`}function O(e){e.ref&&e.ref.length<=u&&!l(s)&&d(s,e.ref),e.src&&e.src.length<=u&&!l(r)&&d(r,e.src)}function k(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function P(){const e=E.useSession(),t=C({from:"/login"}),{next:i="/",client_id:_,redirect_uri:h,response_type:f,state:a,scope:g,code_challenge:p,code_challenge_method:m,src:x,ref:A}=t;O({src:x,ref:A});const c=i.startsWith("/")&&!i.startsWith("//")&&!i.startsWith("/\\")?i:"/",n=k({client_id:_,redirect_uri:h,response_type:f,state:a,scope:g,code_challenge:p,code_challenge_method:m});return e.data?n?(window.location.href=n,o.jsx(y,{})):o.jsx(S,{to:c}):o.jsxs(U,{children:[o.jsx(R,{callbackUrl:c,redirectUrl:n}),o.jsx(j,{})]})}export{P as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{q as z,b as B,e as F,K,c as V,j as m,r as J,D as $,v as L,w as Y,x as G,B as A,t as U}from"./index-Bm1K3DQC.js";import{u as X}from"./use-voice-input-CelDzfp5.js";import{o as Z,c as _,u as I,U as M,a4 as ee,a6 as te,a8 as re,aA as se,ab as ne,Z as ae,X as oe,Y as ie,ah as ce,ag as ue,q as le,$ as fe}from"./site-editor-toast-CRsx3bHf.js";import{s as pe}from"./sandbox-git-api-DcqI6XE4.js";import{u as he}from"./chat-context-DrYmTpG0.js";import{z as de,H as ve}from"./hosted-reconcile-DVhqOXEf.js";import{v as W,u as ye}from"./parse-sections-B7udX6Q3.js";import{b as ge}from"./sandbox-url-D3mC8qhT.js";import{d as we}from"./utils-8mUwv_Ld.js";import{i as me}from"./CheckCircle-BMxSQJ5-.js";import{e as xe}from"./agent-icon-Y_Y2D-pt.js";import{MonacoCodeEditor as Ee}from"./monaco-editor-P5VfXFj7.js";function _e({orgSlug:s,virtualMcpId:e,branch:r}){const t=z(),a=he()?.taskId??null,n=Z(e),o=X(e).runtime==="cms",{url:c}=_(e),u=I(e,r),p=u.kind==="protocol"?u:null,d=M({orgSlug:s,virtualMcpId:e,branch:r}),y=async i=>{if(c)return{ok:!0,existed:!0};if(o){const h=await ce({orgSlug:s,virtualMcpId:e,branch:r},{delete:[i]});return ue(t,{orgSlug:s,virtualMcpId:e,branch:r},h),await t.invalidateQueries({queryKey:pe({orgSlug:s,virtualMcpId:e,branch:r,threadId:a})}),{ok:!0,existed:!0}}const f=le(n,we(i)),l=await fetch(ge({orgSlug:s,virtualMcpId:e,branch:r,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():fe(l,"Delete")},x=B(),C=F({mutationKey:ie(s,e,r),scope:oe(s,e,r),mutationFn:async({blockKey:i,base:f,shown:l})=>{if(p?.source==="github"){const h=l?.();try{await de({queryClient:t,backend:p,params:{orgSlug:s,virtualMcpId:e,branch:r},cacheKey:d},{writes:{},deletes:[i]},f&&f.value!==void 0?{[i]:f.value}:void 0,h&&h.value!==void 0?{[i]:h}:void 0)}catch(v){if(v instanceof ve)return{keptTheirs:!0,deleted:!1};throw v}return{ok:!0,existed:!0}}return p?(await ne(t,p,{orgSlug:s,virtualMcpId:e,branch:r},d,{delete:[i]}),{ok:!0,existed:!0}):ae({queryClient:t,orgSlug:s,virtualMcpId:e,branch:r,backend:u,cacheKey:d},{kind:"edit",write:()=>y(i)})},onMutate:async({blockKey:i})=>{const f=K.decofile(d);await t.cancelQueries({queryKey:f});const l=t.getQueryData(f),h=!!l&&i in l,v=l?.[i];return t.setQueryData(f,E=>{if(!E)return E;const{[i]:w,...j}=E;return j}),{queryKey:f,blockKey:i,hadKey:h,previousValue:v}},onError:(i,f,l)=>{te(x,i),l&&(p?.source==="github"&&(re(i)||i instanceof se)||t.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h))},onSuccess:i=>{if(W(i)){ee(x,!1);return}t.invalidateQueries({queryKey:K.liveMeta(s,e,r)})}}),D=i=>{if(i.base)return i;const f=t.getQueryData(K.decofile(d));return f?{...i,base:{value:f[i.blockKey]}}:i};return{...C,mutate:(i,f)=>C.mutate(D(i),f),mutateAsync:(i,f)=>C.mutateAsync(D(i),f)}}function ke({open:s,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const n=B(),o=t[r],c=o===void 0,u=c?"":JSON.stringify(o,null,2),[p,d]=J.useState(!1),[y,x]=J.useState(u),[C,D]=J.useState(!1),i=!a||c,f=y!==u,l=()=>{navigator.clipboard.writeText(y).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},h=async v=>{if(!a||C)return;let E;try{E=JSON.parse(v)}catch{U.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}D(!0);try{const w=await a(E);W(w)||U.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(w){U.error(n("sectionsEditor.pageJsonDialog.saveError",{error:w instanceof Error?w.message:String(w)}))}finally{D(!1)}};return m.jsx($,{open:s,onOpenChange:e,children:m.jsxs(L,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[m.jsxs(Y,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m.jsx(G,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),m.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[m.jsxs(A,{variant:"ghost",size:"sm",onClick:l,className:"text-xs",children:[p?m.jsx(me,{size:12}):m.jsx(xe,{size:12}),n(p?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!i&&m.jsx(A,{size:"sm",onClick:()=>h(y),disabled:!f||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),c?m.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):m.jsx("div",{className:"min-h-0 flex-1 py-2",children:m.jsx(Ee,{code:u,language:"json",readOnly:i,height:"100%",onChange:v=>x(v??""),onSave:v=>{h(v)}})})]})})}function Ie(s){const e=V.c(10);let r,t;e[0]!==s?({params:r,...t}=s,e[0]=s,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const n=ye(r,a);let o;e[4]!==t.pageKey||e[5]!==n?(o=u=>n.mutateAsync({blockKey:t.pageKey,data:u}),e[4]=t.pageKey,e[5]=n,e[6]=o):o=e[6];let c;return e[7]!==t||e[8]!==o?(c=m.jsx(ke,{...t,onSave:o}),e[7]=t,e[8]=o,e[9]=c):c=e[9],c}var Ce=Object.prototype.toString,b=Array.isArray||function(e){return Ce.call(e)==="[object Array]"};function q(s){return typeof s=="function"}function Se(s){return b(s)?"array":typeof s}function N(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function O(s,e){return s!=null&&typeof s=="object"&&e in s}function De(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var Pe=RegExp.prototype.test;function be(s,e){return Pe.call(s,e)}var je=/\S/;function Te(s){return!be(je,s)}var Re={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Ke(s){return String(s).replace(/[&<>"'`=\/]/g,function(r){return Re[r]})}var Je=/\s*/,Ue=/\s+/,Q=/\s*=/,Ne=/\s*\}/,qe=/#|\^|\/|>|\{|&|=|!/;function Ae(s,e){if(!s)return[];var r=!1,t=[],a=[],n=[],o=!1,c=!1,u="",p=0;function d(){if(o&&!c)for(;n.length;)delete a[n.pop()];else n=[];o=!1,c=!1}var y,x,C;function D(S){if(typeof S=="string"&&(S=S.split(Ue,2)),!b(S)||S.length!==2)throw new Error("Invalid tags: "+S);y=new RegExp(N(S[0])+"\\s*"),x=new RegExp("\\s*"+N(S[1])),C=new RegExp("\\s*"+N("}"+S[1]))}D(e||k.tags);for(var i=new R(s),f,l,h,v,E,w;!i.eos();){if(f=i.pos,h=i.scanUntil(y),h)for(var j=0,H=h.length;j<H;++j)v=h.charAt(j),Te(v)?(n.push(a.length),u+=v):(c=!0,r=!0,u+=" "),a.push(["text",v,f,f+1]),f+=1,v===`
|
|
2
|
-
`&&(d(),u="",p=0,r=!1);if(!i.scan(y))break;if(o=!0,l=i.scan(qe)||"name",i.scan(Je),l==="="?(h=i.scanUntil(Q),i.scan(Q),i.scanUntil(x)):l==="{"?(h=i.scanUntil(C),i.scan(Ne),i.scanUntil(x),l="&"):h=i.scanUntil(x),!i.scan(x))throw new Error("Unclosed tag at "+i.pos);if(l==">"?E=[l,h,f,i.pos,u,p,r]:E=[l,h,f,i.pos],p++,a.push(E),l==="#"||l==="^")t.push(E);else if(l==="/"){if(w=t.pop(),!w)throw new Error('Unopened section "'+h+'" at '+f);if(w[1]!==h)throw new Error('Unclosed section "'+w[1]+'" at '+f)}else l==="name"||l==="{"||l==="&"?c=!0:l==="="&&D(h)}if(d(),w=t.pop(),w)throw new Error('Unclosed section "'+w[1]+'" at '+i.pos);return Qe(Oe(a))}function Oe(s){for(var e=[],r,t,a=0,n=s.length;a<n;++a)r=s[a],r&&(r[0]==="text"&&t&&t[0]==="text"?(t[1]+=r[1],t[3]=r[3]):(e.push(r),t=r));return e}function Qe(s){for(var e=[],r=e,t=[],a,n,o=0,c=s.length;o<c;++o)switch(a=s[o],a[0]){case"#":case"^":r.push(a),t.push(a),r=a[4]=[];break;case"/":n=t.pop(),n[5]=a[2],r=t.length>0?t[t.length-1][4]:e;break;default:r.push(a)}return e}function R(s){this.string=s,this.tail=s,this.pos=0}R.prototype.eos=function(){return this.tail===""};R.prototype.scan=function(e){var r=this.tail.match(e);if(!r||r.index!==0)return"";var t=r[0];return this.tail=this.tail.substring(t.length),this.pos+=t.length,t};R.prototype.scanUntil=function(e){var r=this.tail.search(e),t;switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t};function P(s,e){this.view=s,this.cache={".":this.view},this.parent=e}P.prototype.push=function(e){return new P(e,this)};P.prototype.lookup=function(e){var r=this.cache,t;if(r.hasOwnProperty(e))t=r[e];else{for(var a=this,n,o,c,u=!1;a;){if(e.indexOf(".")>0)for(n=a.view,o=e.split("."),c=0;n!=null&&c<o.length;)c===o.length-1&&(u=O(n,o[c])||De(n,o[c])),n=n[o[c++]];else n=a.view[e],u=O(a.view,e);if(u){t=n;break}a=a.parent}r[e]=t}return q(t)&&(t=t.call(this.view)),t};function g(){this.templateCache={_cache:{},set:function(e,r){this._cache[e]=r},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}g.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};g.prototype.parse=function(e,r){var t=this.templateCache,a=e+":"+(r||k.tags).join(":"),n=typeof t<"u",o=n?t.get(a):void 0;return o==null&&(o=Ae(e,r),n&&t.set(a,o)),o};g.prototype.render=function(e,r,t,a){var n=this.getConfigTags(a),o=this.parse(e,n),c=r instanceof P?r:new P(r,void 0);return this.renderTokens(o,c,t,e,a)};g.prototype.renderTokens=function(e,r,t,a,n){for(var o="",c,u,p,d=0,y=e.length;d<y;++d)p=void 0,c=e[d],u=c[0],u==="#"?p=this.renderSection(c,r,t,a,n):u==="^"?p=this.renderInverted(c,r,t,a,n):u===">"?p=this.renderPartial(c,r,t,n):u==="&"?p=this.unescapedValue(c,r):u==="name"?p=this.escapedValue(c,r,n):u==="text"&&(p=this.rawValue(c)),p!==void 0&&(o+=p);return o};g.prototype.renderSection=function(e,r,t,a,n){var o=this,c="",u=r.lookup(e[1]);function p(x){return o.render(x,r,t,n)}if(u){if(b(u))for(var d=0,y=u.length;d<y;++d)c+=this.renderTokens(e[4],r.push(u[d]),t,a,n);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")c+=this.renderTokens(e[4],r.push(u),t,a,n);else if(q(u)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(r.view,a.slice(e[3],e[5]),p),u!=null&&(c+=u)}else c+=this.renderTokens(e[4],r,t,a,n);return c}};g.prototype.renderInverted=function(e,r,t,a,n){var o=r.lookup(e[1]);if(!o||b(o)&&o.length===0)return this.renderTokens(e[4],r,t,a,n)};g.prototype.indentPartial=function(e,r,t){for(var a=r.replace(/[^ \t]/g,""),n=e.split(`
|
|
3
|
-
`),o=0;o<n.length;o++)n[o].length&&(o>0||!t)&&(n[o]=a+n[o]);return n.join(`
|
|
4
|
-
`)};g.prototype.renderPartial=function(e,r,t,a){if(t){var n=this.getConfigTags(a),o=q(t)?t(e[1]):t[e[1]];if(o!=null){var c=e[6],u=e[5],p=e[4],d=o;u==0&&p&&(d=this.indentPartial(o,p,c));var y=this.parse(d,n);return this.renderTokens(y,r,t,d,a)}}};g.prototype.unescapedValue=function(e,r){var t=r.lookup(e[1]);if(t!=null)return t};g.prototype.escapedValue=function(e,r,t){var a=this.getConfigEscape(t)||k.escape,n=r.lookup(e[1]);if(n!=null)return typeof n=="number"&&a===k.escape?String(n):a(n)};g.prototype.rawValue=function(e){return e[1]};g.prototype.getConfigTags=function(e){return b(e)?e:e&&typeof e=="object"?e.tags:void 0};g.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!b(e))return e.escape};var k={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(s){T.templateCache=s},get templateCache(){return T.templateCache}},T=new g;k.clearCache=function(){return T.clearCache()};k.parse=function(e,r){return T.parse(e,r)};k.render=function(e,r,t,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Se(e)+'" was given as the first argument for mustache#render(template, view, partials)');return T.render(e,r,t,a)};k.escape=Ke;k.Scanner=R;k.Context=P;k.Writer=g;export{ke as P,Ie as S,k as m,_e as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as p,b as g,K as j,e as w,j as t,B as h,i as y}from"./index-Bm1K3DQC.js";import{A as N}from"./auth-split-layout-CtNY2lz5.js";import{A as _}from"./auth-entry-BVPXWLe3.js";import"./delay-CnY5UFtP.js";const f="/api/auth/custom/mcp-consent";function C(){const e=new URLSearchParams(window.location.search);return e.delete("prompt"),e}async function S(e){const n=new URLSearchParams({client_id:e.get("client_id")??"",redirect_uri:e.get("redirect_uri")??"",scope:e.get("scope")??""}),s=await fetch(`${f}?${n}`,{credentials:"include"});if(!s.ok)throw new Error(`consent request failed (${s.status})`);return await s.json()}function A(){const e=p.c(11),n=g();let s,i,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=C(),i=y,c={queryKey:j.mcpOAuthConsent(s.toString()),queryFn:()=>S(s),retry:!1},e[0]=s,e[1]=i,e[2]=c):(s=e[0],i=e[1],c=e[2]);const o=i(c);let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:async()=>{const a=await fetch(f,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:s.get("client_id"),scope:s.get("scope")??void 0})});if(!a.ok)throw new Error(`consent failed (${a.status})`)},onSuccess:()=>{window.location.href=`/api/auth/mcp/authorize?${s}`}},e[3]=l):l=e[3];const r=w(l);let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{const a=new URL(s.get("redirect_uri")??"/");a.searchParams.set("error","access_denied");const m=s.get("state");m&&a.searchParams.set("state",m),window.location.href=a.toString()},e[4]=d):d=e[4];const x=d;if(o.isPending){let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_,{}),e[5]=a):a=e[5],a}let u;return e[6]!==r||e[7]!==o.data||e[8]!==o.isError||e[9]!==n?(u=t.jsx(N,{children:t.jsx("div",{className:"flex w-full max-w-sm flex-col gap-5",children:o.isError||r.isError||!o.data?t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.unavailable")}):t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"text-xl font-semibold",children:n("routes.oauthConsent.title")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:n("routes.oauthConsent.description",{client:o.data.clientName||n("routes.oauthConsent.unknownClient")})}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.redirectLabel")}),t.jsx("code",{className:"break-all text-sm font-medium",children:o.data.redirectTarget})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:n("routes.oauthConsent.scopesLabel")}),t.jsx("span",{className:"text-sm",children:o.data.scopes.join(", ")})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(h,{variant:"outline",className:"flex-1",onClick:x,disabled:r.isPending,children:n("routes.oauthConsent.deny")}),t.jsx(h,{className:"flex-1",onClick:()=>r.mutate(),disabled:r.isPending,children:n("routes.oauthConsent.allow")})]})]})})}),e[6]=r,e[7]=o.data,e[8]=o.isError,e[9]=n,e[10]=u):u=e[10],u}export{A as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{e as J,f as B}from"./input-FxN5JtJx.js";import{aF as A,aG as _,ea as C,b4 as U,cX as X}from"./index-Bm1K3DQC.js";import"./usage-stats-CXQ9FoWO.js";import"./tool-namespace-sf3dpjw4.js";import"./form-DVHd2PmG.js";import"./label-BQN74rUh.js";import"./utils-CVEq3hMx.js";import"./markdown-BiwQrQ3v.js";import"./use-copy-fJBOhwQv.js";import"./agent-icon-Y_Y2D-pt.js";import"./AlertCircle-JDirc_BX.js";import"./Tool01-D5n93WAy.js";import"./ArrowUp-hVHjHInb.js";import"./ArrowLeft-BENlvNHb.js";import"./LinkBroken01-DhH3TW3t.js";import"./ShoppingBag01-sa0ohOEa.js";import"./Globe04-CdHKMOso.js";import"./CheckCircle-BMxSQJ5-.js";import"./ChevronUp-DYc8wyky.js";import"./ChevronSelectorVertical-DDGUPocS.js";import"./UserSquare-CUiDUhHX.js";import"./CreditCard01-EEU_sSyq.js";import"./SwitchHorizontal01-DovJE4RJ.js";import"./Key01-EDnnJ_Gd.js";import"./Minus-XOOEmvqX.js";import"./Monitor01-D3lVwo0x.js";import"./Sun-pw3SuSDm.js";import"./Play-DQ3lppN9.js";import"./Plus-BHZhJmPA.js";import"./SearchMd-MlMwcObI.js";import"./Trash01-C0pW3Nzn.js";import"./Upload01-CEfXDErB.js";import"./Users01-pCKb7aTW.js";import"./XClose-__KXghgf.js";import"./Zap-CyJKtBha.js";import"./chat-context-DrYmTpG0.js";import"./autosend-Dts_wRXC.js";import"./thread-route-C4AshLS2.js";import"./use-project-scope-BkidtyNv.js";import"./repository-binding-BUEX4lc5.js";import"./use-mcp-client-WgWOA1hL.js";import"./auth-Bh4_Y1Kc.js";import"./thread-intent-C_sXnvWO.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-ECs_hZYZ.js";import"./task-board-CmZ-3pYa.js";import"./schema-CyJEITX6.js";import"./use-entitlements-q4zqHldY.js";import"./use-ai-providers-BCXggb0b.js";import"./use-decopilot-events-DSC6YnSZ.js";import"./use-organization-settings-CiRL-ND2.js";import"./use-mobile-BDHJ5g4G.js";import"./tooltip-D0Aro8zv.js";import"./index-BdxdoIZK.js";import"./icon-button-DVB6vEll.js";import"./file-type-icon-CuR7GKVO.js";import"./chat-draft-B1q585AK.js";import"./use-voice-input-CelDzfp5.js";import"./popover-Dh3TtwDo.js";import"./drawer-CtPWRLqi.js";import"./index-CX5-w0f2.js";import"./checkbox-U6ASBfOz.js";import"./select-Ce9OTxeg.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./tabs-D8DBFsJ6.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-Dw1Zq3DU.js";import"./toggle-group-D4APjUwC.js";import"./input-CYGCgpQ0.js";import"./suggestion-D3mu_Xk3.js";import"./use-mcp-prompts-bAmVEPg_.js";import"./use-org-fs-Du2G3PF4.js";import"./useInfiniteQuery-B7UWNEWx.js";import"./infiniteQueryObserver-BNCHN17F.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DK0yyspA.js";import"./plan-ladder-I5kD48rz.js";import"./add-connection-dialog-10mnkwZu.js";import"./collection-search-CrfF1go0.js";import"./extract-connection-data-Cx40NvMQ.js";import"./metadata-D72DunRR.js";import"./connection-CwG18GXt.js";import"./url-slug-DTpv_sm0.js";import"./connection-card-71syl7a3.js";import"./connection-slug-rYoZb8Oi.js";import"./integration-icon-DTmGScIa.js";import"./textarea-BNrj1CIV.js";import"./use-connection-D3dXxxHo.js";import"./schema-BUMYDfBQ.js";import"./connection-form-helpers-Ds89P2qw.js";import"./authenticate-and-persist-oauth-DppRl8su.js";import"./mcp-oauth-969YqM-_.js";import"./mcp-oauth-CeW0VHOL.js";import"./collection-tabs-CXJFRxjE.js";import"./badge-CyMXYtjo.js";import"./use-infinite-scroll-DbrSLbYQ.js";import"./useSuspenseInfiniteQuery-TfssA_Zz.js";import"./use-task-board-events-DFXBTSz0.js";import"./use-chat-layout-state-DCbtnqWd.js";class W{constructor(e,r=4e3){this.onDisconnect=e,this.graceMs=r}onDisconnect;graceMs;timer;report(e){if(e==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(e==="failed"||e==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}e==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const F=A({type:X(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:_(),delta:_(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),H=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:_(),target:C("client")})});class ${constructor(e,r){this.send=e,this.callbacks=r}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(e,r=Date.now()){if(this.closed)return;const n=F.safeParse(e);if(n.success){const t=n.data;if(this.seen.has(t.event_id))return;this.seen.add(t.event_id);const s=t.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:t.delta,start:t.start_ms,end:t.end_ms,arrivedAt:r,id:t.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:t.delta,event_id:t.event_id});return}const a=H.safeParse(e);if(a.success){const{id:t}=a.data.delegation;if(this.delegated.has(t)||this.pending.has(t))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(t,{offset:a.data.offset_ms,receivedAt:r});return}const m=A({type:C("session.thinking.appended"),client_event_id:_()}).safeParse(e);if(m.success){const t=m.data.client_event_id,s=this.awaitingContext.get(t);this.awaitingContext.delete(t),s&&(s.remaining.delete(t),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const d=A({type:_()}).safeParse(e);d.success&&d.data.type==="error"&&this.callbacks.onError()}tick(e=Date.now()){if(!this.closed)for(const[r,n]of this.pending){const a=this.fragments.filter(o=>o.start<n.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,n.receivedAt);if(e-m<500)continue;const d=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!d.length&&e-n.receivedAt<3e3)continue;if(this.pending.delete(r),this.delegated.add(r),!d.length){this.publishUpdate({delivery:"announce",delegationId:r,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const t=d.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(d.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(t.length>J){this.publishUpdate({delivery:"announce",delegationId:r,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of d)this.consumed.add(o.id);this.callbacks.onDelegate({request:t,delegationId:r,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:r,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:r,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(e){if(this.closed)return;if(e.contextId){if(this.contexts.get(e.contextId)===e.text)return;this.contexts.set(e.contextId,e.text)}const n=(e.contextId?`Updated ${e.contextId} data, superseding earlier values:
|
|
2
|
-
`:`Studio result data:
|
|
3
|
-
`)+e.text,a=new TextEncoder,m=e.delivery==="announce"&&a.encode(n).length>480,d={remaining:new Set,delegationId:e.delegationId};let t="",s=0;const o=()=>{if(!t)return;const i=crypto.randomUUID();m&&(d.remaining.add(i),this.awaitingContext.set(i,d)),this.send({type:e.delivery==="announce"&&!m?"session.commentary.append":"session.thinking.append",event_id:i,delegation_id:e.delegationId??null,content:t}),t="",s=0};for(const i of n){const v=a.encode(i).length;s+v>480&&o(),t+=i,s+=v}o()}close(){this.closed=!0,this.pending.clear(),this.awaitingContext.clear()}}async function Jt(E,e,r){r.throwIfAborted();const n=new RTCPeerConnection,a=n.createDataChannel("oai-events"),m=document.createElement("audio");m.autoplay=!0;let d,t,s,o,i=!1,v=!1,h,O,L=0,P=0,g,w,y=!1;const I=Promise.withResolvers(),x=Promise.withResolvers();x.promise.catch(()=>{});const b=new $(p=>{!i&&a.readyState==="open"&&a.send(JSON.stringify(p))},e),q=new W(()=>{i||e.onDisconnect()}),M=async()=>{if(!i){i=!0,q.dispose(),b.close(),clearInterval(O),r.removeEventListener("abort",T),a.close(),n.close();for(const p of d?.getTracks()??[])p.stop();m.pause(),m.srcObject=null,t&&t.state!=="closed"&&await t.close().catch(()=>{})}},T=()=>{M()};r.addEventListener("abort",T,{once:!0});const u=AbortSignal.any([r,AbortSignal.timeout(3e4)]),j=x.promise,z=()=>x.reject(u.reason);u.addEventListener("abort",z,{once:!0}),j.catch(()=>{}),a.onmessage=({data:p})=>{if(!(i||typeof p!="string"))try{const l=JSON.parse(p);typeof l=="object"&&l!==null&&"type"in l&&(l.type==="session.started"&&(v=!0,x.resolve()),l.type==="session.closed"&&(I.resolve(),h||e.onDisconnect())),h||b.receive(l)}catch{e.onError()}},a.onclose=()=>{x.reject(new Error("Voice connection closed")),I.resolve(),!i&&!h&&e.onDisconnect()},n.onconnectionstatechange=()=>{i||q.report(n.connectionState)},n.ontrack=({streams:p,track:l})=>{if(i)return;const D=p[0]??new MediaStream([l]);m.srcObject=D,t??=new AudioContext,s=t.createAnalyser(),s.fftSize=256,o=new Uint8Array(s.fftSize),t.createMediaStreamSource(D).connect(s),t.resume().catch(()=>e.onError()),m.play().catch(()=>e.onError())};function N(){if(!s||!o||i)return 0;s.getByteTimeDomainData(o);let p=0;for(const l of o)p+=((l-128)/128)**2;return Math.min(1,Math.sqrt(p/o.length)*4)}try{const p=navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(c=>{if(i||u.aborted){for(const f of c.getTracks())f.stop();throw new DOMException("Voice connection cancelled","AbortError")}return d=c,c}),l=await Promise.race([p,new Promise((c,f)=>u.addEventListener("abort",()=>f(u.reason),{once:!0}))]);t??=new AudioContext,g=t.createAnalyser(),g.fftSize=256,w=new Uint8Array(g.fftSize),t.createMediaStreamSource(l).connect(g),await t.resume();for(const c of l.getAudioTracks())n.addTrack(c,l);const D=await n.createOffer();await n.setLocalDescription(D),u.throwIfAborted(),n.iceGatheringState!=="complete"&&await new Promise((c,f)=>{const S=()=>{n.iceGatheringState==="complete"&&(G(),c())},k=()=>{G(),f(u.reason)},G=()=>{n.removeEventListener("icegatheringstatechange",S),u.removeEventListener("abort",k)};n.addEventListener("icegatheringstatechange",S),u.addEventListener("abort",k,{once:!0}),S(),u.aborted&&k()});const V=n.localDescription?.sdp;if(!V)throw new Error("Missing voice offer");const R=await E(V,u);return await n.setRemoteDescription({type:"answer",sdp:R.sdp}),await j,r.throwIfAborted(),u.removeEventListener("abort",z),r.removeEventListener("abort",T),e.onConnect(),O=setInterval(()=>{if(i||h)return;if(b.tick(),g&&w&&!y){g.getByteTimeDomainData(w);const f=w.reduce((S,k)=>S+((k-128)/128)**2,0)/w.length;Math.sqrt(f)>.025&&(P=Date.now())}e.onUserSpeaking(!y&&Date.now()-P<400),N()>.02&&(L=Date.now()),e.onModeChange({mode:Date.now()-L<400?"speaking":"listening"})},100),{endSession:()=>(h??=(async()=>{b.close();for(const c of d?.getTracks()??[])c.stop();if(m.pause(),v&&a.readyState==="open"){a.send(JSON.stringify({type:"session.close"}));let c;await Promise.race([I.promise,new Promise(f=>{c=setTimeout(f,3e3)})]),clearTimeout(c)}await M()})(),h),publishUpdate:c=>b.publishUpdate(c),setMicMuted:c=>{y=c;for(const f of d?.getAudioTracks()??[])f.enabled=!y;y&&e.onUserSpeaking(!1)},getOutputVolume:N}}catch(p){throw await M(),p}}export{Jt as startOpenAIConversation};
|