decocms 3.16.4 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-C7z-V8PW.js → AlertCircle-DtsIkyhv.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DrdPL0e7.js → ArrowUpRight-CC6Cv2i7.js} +1 -1
- package/dist/client/assets/{Check-Dd4DY5uR.js → Check-vtGHgjfG.js} +1 -1
- package/dist/client/assets/{CheckCircle-FfKjcpCo.js → CheckCircle-BVxEOwgz.js} +1 -1
- package/dist/client/assets/{ChevronDown-q6om2VnP.js → ChevronDown--sdzrX52.js} +1 -1
- package/dist/client/assets/{ChevronLeft-MgGV-KON.js → ChevronLeft-HhUtQNOL.js} +1 -1
- package/dist/client/assets/{ChevronRight-DF_7Jr6-.js → ChevronRight-I6954Qlw.js} +1 -1
- package/dist/client/assets/{ChevronUp-CZ2c4QT8.js → ChevronUp-B7_FaTuI.js} +1 -1
- package/dist/client/assets/{Container-CLTqJvB-.js → Container-UwZa4Sjq.js} +1 -1
- package/dist/client/assets/{DotsVertical-ChEXuCNr.js → DotsVertical-CRhU-CQp.js} +1 -1
- package/dist/client/assets/{Eye-Cg3KEYLR.js → Eye-CrIialez.js} +1 -1
- package/dist/client/assets/{FilterLines-8Z1EXJU1.js → FilterLines-CcSUEwfK.js} +1 -1
- package/dist/client/assets/{Globe01-DhsYVZ78.js → Globe01-CWUyneqk.js} +1 -1
- package/dist/client/assets/{HardDrive-I0CJViHA.js → HardDrive-B4ApPRkU.js} +1 -1
- package/dist/client/assets/{Key01-BOdS0XJd.js → Key01-D8nYbfp6.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bb0s-28Y.js → LayoutLeft-CYBI43zr.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D5bRZZ7Q.js → LinkExternal01-BBQVGsHV.js} +1 -1
- package/dist/client/assets/{Monitor01-BMO0nffP.js → Monitor01-BqyNv3z7.js} +1 -1
- package/dist/client/assets/{Palette-cVasQJYG.js → Palette-Dc7v0Lbc.js} +1 -1
- package/dist/client/assets/{Play-CnLbQjiF.js → Play-Bfu6rzoI.js} +1 -1
- package/dist/client/assets/{Plus-C2lPEpk2.js → Plus-CAk921Ey.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DkjqduXo.js → RefreshCcw01-CJHsMXtu.js} +1 -1
- package/dist/client/assets/{SearchMd-BZ5uFVyv.js → SearchMd-BGGjtsz7.js} +1 -1
- package/dist/client/assets/{Settings02-CkecSEd-.js → Settings02-B3pc9FAS.js} +1 -1
- package/dist/client/assets/{Shield01-DHeMOigW.js → Shield01-CevvPkir.js} +1 -1
- package/dist/client/assets/{Star01-CcEuFfec.js → Star01-B2sYJOUY.js} +1 -1
- package/dist/client/assets/{Stars01-CbHt_6-5.js → Stars01-ChUleI_g.js} +1 -1
- package/dist/client/assets/{Stars02-BqzITFM8.js → Stars02-DR0TfdJs.js} +1 -1
- package/dist/client/assets/{Sun-iU2rGybo.js → Sun-D0Tw1Afb.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CJ4InXIK.js → SwitchHorizontal01-UKGE6L3t.js} +1 -1
- package/dist/client/assets/{Tool01-G_qe4xr9.js → Tool01-NFK8H_gw.js} +1 -1
- package/dist/client/assets/{Trash01-CLPIYWB0.js → Trash01-BV0g0LQO.js} +1 -1
- package/dist/client/assets/{Upload01-CMufGYXQ.js → Upload01-VAW7QmhA.js} +1 -1
- package/dist/client/assets/{User01-DlH74QWo.js → User01-DaoMnnxf.js} +1 -1
- package/dist/client/assets/{Users01-Cu8ZTFie.js → Users01-BlMLYKx0.js} +1 -1
- package/dist/client/assets/{Users03-DzGgBVNT.js → Users03-B7HqdPkm.js} +1 -1
- package/dist/client/assets/{X-DcUCV36T.js → X-Tdfyixv6.js} +1 -1
- package/dist/client/assets/{XCircle-BLtazoy5.js → XCircle-B14veD9i.js} +1 -1
- package/dist/client/assets/{XClose-n_6qPNJf.js → XClose-Blplvetp.js} +1 -1
- package/dist/client/assets/{Zap-kDewRIEE.js → Zap-DXci2BUM.js} +1 -1
- package/dist/client/assets/{ZapSquare-NBV5NA7W.js → ZapSquare-DzpMrwRR.js} +1 -1
- package/dist/client/assets/{ZoomOut-B-M27CLc.js → ZoomOut-CT9E4Qhq.js} +1 -1
- package/dist/client/assets/{access-gate-fR4pq-L8.js → access-gate-DiknBkEw.js} +1 -1
- package/dist/client/assets/{accordion-C2y9Pzbc.js → accordion-CtA-xauN.js} +1 -1
- package/dist/client/assets/{add-section-modal-BOgkPRCm.js → add-section-modal-DlaN-qAI.js} +1 -1
- package/dist/client/assets/agent-capabilities-CmInpctC.js +3 -0
- package/dist/client/assets/{agent-icon-BfUtMte0.js → agent-icon-zELPPL2m.js} +1 -1
- package/dist/client/assets/{agent-icons-hvA3E_Do.js → agent-icons-x_5O6PzC.js} +1 -1
- package/dist/client/assets/{agents-list-CQqZGdLA.js → agents-list-Bszw9lN6.js} +1 -1
- package/dist/client/assets/{ai-providers-Db0YGoZI.js → ai-providers-BEo_1p1S.js} +1 -1
- package/dist/client/assets/{alert-BxLN58Xd.js → alert-CfEuO2dR.js} +1 -1
- package/dist/client/assets/{alert-dialog-DjURN0Wv.js → alert-dialog-CU8ZYA21.js} +1 -1
- package/dist/client/assets/app-editor-Qvrv5Jlv.js +1 -0
- package/dist/client/assets/{auth-catchall-BNZ78VhB.js → auth-catchall-CKY6yLJq.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CZSuZiHz.js → auth-split-layout-CUDE_iDP.js} +1 -1
- package/dist/client/assets/{automation-list-row-0aY-wHMF.js → automation-list-row-CH--ZnEF.js} +1 -1
- package/dist/client/assets/{automation-runs-Cw5GALKR.js → automation-runs-yWXMKQTD.js} +1 -1
- package/dist/client/assets/{automations-DVaLtsbr.js → automations-qMMzEqRX.js} +1 -1
- package/dist/client/assets/{avatar-CPeVEYzP.js → avatar-DXzeiiiO.js} +1 -1
- package/dist/client/assets/{badge-Sld47C66.js → badge-zsFX23zy.js} +1 -1
- package/dist/client/assets/{brand-context-D5g1kbTY.js → brand-context-4BmiQwTN.js} +1 -1
- package/dist/client/assets/{buckets-CQrAL2WH.js → buckets-CCG_qbCS.js} +1 -1
- package/dist/client/assets/{calendar-D_lfc4-f.js → calendar-Crmr906f.js} +1 -1
- package/dist/client/assets/{capability-load-error-DntEpZQa.js → capability-load-error-BravgH0a.js} +1 -1
- package/dist/client/assets/{card-BoIkIdKw.js → card-D5IvObwB.js} +1 -1
- package/dist/client/assets/{chat-context-BllQ4wIO.js → chat-context-LqGwxYAF.js} +1 -1
- package/dist/client/assets/{checkbox-C3vxmcaB.js → checkbox-OOQKZtC_.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dp4mfXYL.js → cli-auth-success-DhicbQB5.js} +1 -1
- package/dist/client/assets/{collection-detail-072-Guix.js → collection-detail-BbVWcOS7.js} +1 -1
- package/dist/client/assets/{collection-display-button-AGMnoaLE.js → collection-display-button-D5hrgHkh.js} +1 -1
- package/dist/client/assets/{collection-search-BRyG5fy4.js → collection-search-DGClB-Gb.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DE0BllZg.js → collection-table-wrapper-VWPtHFYE.js} +1 -1
- package/dist/client/assets/{collection-tabs-CZlafXgn.js → collection-tabs-BQEO65ib.js} +1 -1
- package/dist/client/assets/{collections-OmqpbRHJ.js → collections-C_m5uhEc.js} +1 -1
- package/dist/client/assets/{command-BqieK0cx.js → command-DzVv4p4m.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BBJ3ZBYq.js → connect-desktop-dialog-CZAbswkh.js} +1 -1
- package/dist/client/assets/{connection-card-Bm_mNiXs.js → connection-card-CDttZAWV.js} +1 -1
- package/dist/client/assets/{connection-detail-D3-zF53f.js → connection-detail-CWgx3CGW.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B7Hi4AVw.js → connection-form-helpers-BgC55lri.js} +1 -1
- package/dist/client/assets/{connections-DxOhnozc.js → connections-BTE9TZOq.js} +1 -1
- package/dist/client/assets/{constants-BN3EnnK5.js → constants-BCfpLdj8.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cl6vHzIb.js → decopilot-sse-pool-nEWZU_3q.js} +1 -1
- package/dist/client/assets/{dialog-qOMSPeFV.js → dialog-CLtwKT7T.js} +1 -1
- package/dist/client/assets/{domain-settings-e9uj9KSS.js → domain-settings-DnOdm4Gh.js} +1 -1
- package/dist/client/assets/{drawer-DgiouEht.js → drawer-BewkeO2E.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CD9L0NpR.js → dropdown-menu-COlaUXPy.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-B38NSbtx.js → dynamic-plugin-layout-CboUuftB.js} +1 -1
- package/dist/client/assets/{empty-state-kyadFKbp.js → empty-state-CZdqlaa-.js} +1 -1
- package/dist/client/assets/{empty-state-oUgpGFDY.js → empty-state-Cm-JBk7p.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DUfac6xd.js → extract-connection-data-F1Fp1AMr.js} +1 -1
- package/dist/client/assets/{features-DVXCwn_d.js → features-BPybOqVM.js} +1 -1
- package/dist/client/assets/{file-explorer-QJj5R7Vm.js → file-explorer-Dfpjlouj.js} +1 -1
- package/dist/client/assets/{file-type-icon-D-cvDShc.js → file-type-icon-DfjHHTyz.js} +1 -1
- package/dist/client/assets/{files-GjQ9-UbG.js → files-Jq4xd8Mr.js} +1 -1
- package/dist/client/assets/{form-DCJSDrN9.js → form-hhL2WFgR.js} +1 -1
- package/dist/client/assets/{general-C0YCcLeg.js → general-Bs5LdWae.js} +1 -1
- package/dist/client/assets/{generate-id-BxP01XU4.js → generate-id-D01ICZCx.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DE4TiJ6h.js → github-repo-picker-CvAVXvxg.js} +1 -1
- package/dist/client/assets/{header-tab-button-6bRdq2K-.js → header-tab-button-D5FYUotU.js} +1 -1
- package/dist/client/assets/{hover-card-lMFQF9-F.js → hover-card-CeQv0SdX.js} +1 -1
- package/dist/client/assets/{image-field-Dzduad-d.js → image-field-DlsH5ki1.js} +1 -1
- package/dist/client/assets/{index-Brd11Ohc.js → index-8WMbGW3I.js} +1 -1
- package/dist/client/assets/{index-OvgvLmj6.js → index-BTfRGSGJ.js} +1 -1
- package/dist/client/assets/{index-Bm7p6st-.js → index-BZAd5qB-.js} +1 -1
- package/dist/client/assets/{index-DDQ1B6Aj.js → index-BsTDIiyh.js} +1 -1
- package/dist/client/assets/{index-BIms-A8c.js → index-C2ou5Sih.js} +1 -1
- package/dist/client/assets/{index-CvOh-PKX.js → index-C3xxqIK9.js} +1 -1
- package/dist/client/assets/{index-Ddo-OAlk.js → index-CW2GDOZp.js} +3 -3
- package/dist/client/assets/{index-HfFXcyYk.js → index-CZHEDR-7.js} +1 -1
- package/dist/client/assets/{index-CtHmN2ln.js → index-CtKv8aMq.js} +1 -1
- package/dist/client/assets/{index-BLl7lttY.js → index-Cu5tt_hf.js} +1 -1
- package/dist/client/assets/{index-CGbH7bcb.js → index-DVjiRpca.js} +1 -1
- package/dist/client/assets/{index-CqTgM-6C.js → index-DljQCipR.js} +1 -1
- package/dist/client/assets/{index-CvgbrWNJ.js → index-Dtlw9Wg_.js} +1 -1
- package/dist/client/assets/{index-CtGs1DJJ.js → index-IBdkM0WT.js} +4 -4
- package/dist/client/assets/{index-UyCB-Rx1.js → index-MDvkqSr6.js} +1 -1
- package/dist/client/assets/{index-redirect-DVYvuCCP.js → index-redirect-BQ64Fw6U.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DVXVEIds.js → infiniteQueryObserver-CNU9jr7j.js} +1 -1
- package/dist/client/assets/{input-rSCTpjle.js → input-C6I0qBHa.js} +1 -1
- package/dist/client/assets/{integration-icon-Bud2iScJ.js → integration-icon-CRQNKwzw.js} +1 -1
- package/dist/client/assets/{label-B7rNFDmP.js → label-CBS86XNa.js} +1 -1
- package/dist/client/assets/{layout-CEqxg3rT.js → layout-f-vBvuP7.js} +1 -1
- package/dist/client/assets/{login-CapaPVFw.js → login-mW1jrlie.js} +1 -1
- package/dist/client/assets/{members-EJxlsGI5.js → members-C0DJ4-OC.js} +1 -1
- package/dist/client/assets/{monaco-editor-CqDQuYzQ.js → monaco-editor--4Yuy9-K.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CC0b-8JY.js → monitoring-stats-row-B05aJEZ3.js} +1 -1
- package/dist/client/assets/{oauth-callback-CWWtjtNz.js → oauth-callback-BAaF4Jac.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C52td6lP.js → oauth-callback-ai-provider-CXA6h4bA.js} +1 -1
- package/dist/client/assets/{onboarding-B3pW3OTI.js → onboarding-DwclTGQV.js} +1 -1
- package/dist/client/assets/{org-install-BKl8mAvw.js → org-install-ClS1U1Is.js} +1 -1
- package/dist/client/assets/{org-layout-B6_x4zIK.js → org-layout-D2q337za.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-CCB1NusG.js → org-plugin-layout-BU42ml-u.js} +1 -1
- package/dist/client/assets/{page-seo-form-enQgxFv1.js → page-seo-form-BSUK8MM8.js} +1 -1
- package/dist/client/assets/page-seo-sheet-rUbxuV0U.js +1 -0
- package/dist/client/assets/{pair-B1riNa41.js → pair-CZ7RQwEQ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CTuwNPDg.js → plugin-empty-state-DUHVGpp4.js} +1 -1
- package/dist/client/assets/{plugin-header-CDXeYEXC.js → plugin-header-Ce72Z8AJ.js} +1 -1
- package/dist/client/assets/{plugin-layout-CaUNVm6a.js → plugin-layout-quK7uCnU.js} +1 -1
- package/dist/client/assets/{popover-C9laUh6-.js → popover-Cb-Bmegp.js} +1 -1
- package/dist/client/assets/{post-editor-lhgneqmv.js → post-editor-BAaD8Gds.js} +1 -1
- package/dist/client/assets/{primitives-B4sR9JrK.js → primitives-D8jiHpwv.js} +1 -1
- package/dist/client/assets/{profile-pHe9Ajxu.js → profile-B_6YhXTS.js} +1 -1
- package/dist/client/assets/project-app-view-DLZKJqsT.js +1 -0
- package/dist/client/assets/record-editor-DV-uP4sg.js +1 -0
- package/dist/client/assets/registry-BdCcAkG7.js +2 -0
- package/dist/client/assets/{registry-layout-BIYDgiNs.js → registry-layout-CCF3dO1N.js} +1 -1
- package/dist/client/assets/{require-capability-CLzzkYsu.js → require-capability-9UoybC--.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DdJg8zF9.js → required-auth-layout-chyvqjm-.js} +1 -1
- package/dist/client/assets/{reset-password-nThxnoX9.js → reset-password-bYeIRZhU.js} +1 -1
- package/dist/client/assets/{resizable-D9zGGmNX.js → resizable-C3e36PAj.js} +1 -1
- package/dist/client/assets/{roles-Cp9Isv-V.js → roles-DUk2EDKN.js} +1 -1
- package/dist/client/assets/{save-status-Wb7i0dV6.js → save-status-SrY_Xvn_.js} +1 -1
- package/dist/client/assets/{schema-form-yX6Ft6zW.js → schema-form-q1GGwsV5.js} +1 -1
- package/dist/client/assets/{scroll-area-lnnHcoAD.js → scroll-area-DqzfAJq4.js} +1 -1
- package/dist/client/assets/{search-input-DwibiVVh.js → search-input-dUUxotu4.js} +1 -1
- package/dist/client/assets/{secrets-BDyxrSjf.js → secrets--HC37_lL.js} +1 -1
- package/dist/client/assets/{sections-editor-DUAAqhpr.js → sections-editor-9HzWjIQN.js} +1 -1
- package/dist/client/assets/{select-LFt-mET5.js → select-CuTEW-jA.js} +1 -1
- package/dist/client/assets/select-model-DeVtvLgk.js +1 -0
- package/dist/client/assets/{seo-editor-DCSDlOjD.js → seo-editor-CxXb6Pa5.js} +1 -1
- package/dist/client/assets/{settings-layout-wrO6UXp0.js → settings-layout-DsImRu68.js} +1 -1
- package/dist/client/assets/{settings-section-nFhQ9DC2.js → settings-section-Dqo82vZl.js} +1 -1
- package/dist/client/assets/{sheet-pqbHPkyu.js → sheet-XNQn2l1w.js} +1 -1
- package/dist/client/assets/{shell-controls-DJGk-Cm5.js → shell-controls-DOdJ_gGX.js} +1 -1
- package/dist/client/assets/shell-layout-BU6DfdCA.js +1 -0
- package/dist/client/assets/{shell-route-loading-CIX4Wpf7.js → shell-route-loading-D_OJep1W.js} +1 -1
- package/dist/client/assets/{sidebar-BZQ9ZuwD.js → sidebar-BVvI-fKb.js} +1 -1
- package/dist/client/assets/{skeleton-DDFad7Zm.js → skeleton-BsmA3SJi.js} +1 -1
- package/dist/client/assets/{sortable.esm-BmQU85RQ.js → sortable.esm-BLbNDEWA.js} +1 -1
- package/dist/client/assets/{spinner-DecrbM2u.js → spinner-CA6Z7ply.js} +1 -1
- package/dist/client/assets/{sso-uPYu69iU.js → sso-CaRqQ4Z-.js} +1 -1
- package/dist/client/assets/{store-DxDAvQny.js → store-D79L8ARY.js} +1 -1
- package/dist/client/assets/store-registry-RjLPX_BT.js +2 -0
- package/dist/client/assets/{switch-BB-CM41R.js → switch-kiGGiVP7.js} +1 -1
- package/dist/client/assets/{tab-id-CgZSqh3C.js → tab-id-AROsVU94.js} +1 -1
- package/dist/client/assets/{table-D77MLzgL.js → table-D-3eWTFI.js} +1 -1
- package/dist/client/assets/{tabs-DCe9cJFy.js → tabs-_BMD3gqc.js} +1 -1
- package/dist/client/assets/{task-status-COuLaDdz.js → task-status-DDOPfPO7.js} +1 -1
- package/dist/client/assets/{textarea-Dd_nswrz.js → textarea-CvogFpDT.js} +1 -1
- package/dist/client/assets/{toggle-group-CVhoCxfd.js → toggle-group-BAx4pQQl.js} +1 -1
- package/dist/client/assets/{toolbar-hSa6Dbq7.js → toolbar-CcJJYCIE.js} +1 -1
- package/dist/client/assets/{tools-list-DuzN2FYL.js → tools-list-C2KBBz4b.js} +1 -1
- package/dist/client/assets/{tooltip-BUQdgInQ.js → tooltip-6V7elEEX.js} +1 -1
- package/dist/client/assets/{types-C1v54Mz6.js → types-fKs_ggmz.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B_B7XI7_.js → use-ai-providers-BSAUX_gL.js} +1 -1
- package/dist/client/assets/{use-automations-DH2iF1St.js → use-automations-ByU0cONY.js} +1 -1
- package/dist/client/assets/{use-capability-BGUE7EVy.js → use-capability-DLwHss1A.js} +1 -1
- package/dist/client/assets/{use-collections-DFTbd6Fl.js → use-collections-BauLzZZO.js} +1 -1
- package/dist/client/assets/{use-connection-lE__8xdh.js → use-connection-C4GFr9nL.js} +1 -1
- package/dist/client/assets/{use-copy-ZYwX79XH.js → use-copy-B4x7tAnY.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B_aHPeoS.js → use-create-virtual-mcp-CP1TTRIQ.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B34gfDHg.js → use-debounced-autosave-tQOo4KW5.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CDUrp1iY.js → use-delete-connection-CvS5aoFM.js} +1 -1
- package/dist/client/assets/{use-file-configs-Cax2DWWv.js → use-file-configs-DXuMASqs.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-hBDGyHUM.js → use-infinite-scroll-CUCni0HP.js} +1 -1
- package/dist/client/assets/{use-list-state-xrbgUm4z.js → use-list-state-Cy-nbUe7.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dxg9Un5w.js → use-mcp-prompts-r6vl6hj5.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-QU_D_i6C.js → use-mcp-tools-BH6fBXOQ.js} +1 -1
- package/dist/client/assets/{use-members-BWJ8hwfe.js → use-members-CN7LSdK8.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cc-xymgp.js → use-navigate-to-agent-B17xxfnF.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-NsurVUJ9.js → use-org-auth-client-Ct06vKxv.js} +1 -1
- package/dist/client/assets/{use-org-sso-DLBFty4l.js → use-org-sso-VGIrGw_f.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BWWLZ7O1.js → use-organization-roles-CTeY8LZY.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CCbA9nGy.js → use-organization-settings--FTRiCSw.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DLPkHVYT.js → use-registry-connections-D9b3sQhT.js} +1 -1
- package/dist/client/assets/{use-secrets-cpRcdu7B.js → use-secrets-YYVI-1hB.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B2yZVdDL.js → use-status-sounds-BDpAOn6X.js} +1 -1
- package/dist/client/assets/{use-view-mode-DeAHyjDR.js → use-view-mode-4iMRc-bf.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BlTQLNpO.js → use-virtual-mcp-BzRoDsnX.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DKdeEHtH.js +1 -0
- package/dist/client/assets/{useRouterState-BDC7x_pD.js → useRouterState-DwQFoqEO.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BgTbRsAD.js +1 -0
- package/dist/client/assets/{user-CJzOQ38j.js → user-CEZjs4lV.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BRumGdwQ.js → view-mode-toggle-BwZQDE89.js} +1 -1
- package/dist/client/assets/{workflow-C89XsL5x.js → workflow-2WDykuxZ.js} +1 -1
- package/dist/client/assets/workflow-detail-B48uxbIE.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +6 -5
- package/dist/server/server.js +4 -4
- package/package.json +1 -1
- package/dist/client/assets/agent-capabilities-CsVK4Iyy.js +0 -3
- package/dist/client/assets/app-editor-C6PYtYB9.js +0 -1
- package/dist/client/assets/page-seo-sheet-8AFg5HN-.js +0 -1
- package/dist/client/assets/project-app-view-CLH-EuPS.js +0 -1
- package/dist/client/assets/record-editor-Cm14ALiS.js +0 -1
- package/dist/client/assets/registry-B-mQZydb.js +0 -2
- package/dist/client/assets/select-model-C3GfXMo3.js +0 -1
- package/dist/client/assets/shell-layout-Chk-dikt.js +0 -1
- package/dist/client/assets/store-registry-B62lR_g6.js +0 -2
- package/dist/client/assets/useInfiniteQuery-FZ-eOLUd.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DY0Najlz.js +0 -1
- package/dist/client/assets/workflow-detail-CXHAQziO.js +0 -1
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{G as ze,r as S,au as Ls,as as $s,e as L,q as ie,c as B,j as s,E as zs,o as le,T as xe,aH as Bs,W as _e,aI as Pt,L as Us,B as re,H as Ks,I as qs,aJ as Qs,aK as Ys,a0 as Ee,D as Hs,aL as Pe,aM as Gt,n as En,K as Ie,t as G,f as rt,a as Dt,aN as Gs,v as Rn,R as Ws,aO as Js,b as Tn,aP as Zs,aQ as Pn,aR as Xs,aS as ce,aT as gt,aU as er,aV as tr,aW as bt,aX as nr,aY as sr,aZ as rr,a_ as or,s as ar,a$ as lr,b0 as ir,b1 as cr,b2 as dr,b3 as Dn,b4 as Fe,l as ur,F as Mn}from"./index-Ddo-OAlk.js";import{e as Fn,s as ot,g as Ve,P as Je,f as Mt,t as Vr,h as fr,M as mr,i as pr,j as Oe,k as hr,l as xr,F as gr,c as br,S as vr,m as yr,n as Ar,o as Wt}from"./pair-B1riNa41.js";import{c as me,a as Be,d as Ue,u as wr,b as jr,g as Sr,f as On,A as Cr,h as Nr}from"./chat-context-BllQ4wIO.js";import{S as St}from"./spinner-DecrbM2u.js";import{c as Ct,u as kr,T as ge,a as be,b as ve}from"./tooltip-BUQdgInQ.js";import{b as at,c as lt,a as it,D as ct,e as Ft}from"./dialog-qOMSPeFV.js";import{c as _r,D as Ir,a as Er,b as Rr}from"./drawer-DgiouEht.js";import{C as Tr}from"./collection-search-BRyG5fy4.js";import{g as dt,u as ue,S as ut,i as Jt}from"./constants-BN3EnnK5.js";import{u as Pr,g as Vt,l as Nt}from"./use-mcp-prompts-Dxg9Un5w.js";import{t as ft}from"./ChevronDown-q6om2VnP.js";import{i as De}from"./X-DcUCV36T.js";import{t as Dr,z as Mr,u as Fr,w as Or,A as Lr}from"./tab-id-CgZSqh3C.js";import{K as $r,i as zr}from"./shell-layout-Chk-dikt.js";import{a as Br,u as Ur}from"./use-virtual-mcp-BlTQLNpO.js";import{i as Kr}from"./SwitchHorizontal01-CJ4InXIK.js";import{n as Ln}from"./ZapSquare-NBV5NA7W.js";import{i as Ke}from"./Check-Dd4DY5uR.js";import{s as $n}from"./Star01-CcEuFfec.js";import{a as zn}from"./Tool01-G_qe4xr9.js";import{a0 as mt,m as qr,L as Bn,A as Un,i as He,b as Qr,O as Yr,a1 as Hr,r as Gr,a2 as Wr,a3 as Jr,X as Kn}from"./agent-icon-BfUtMte0.js";import{i as Zr}from"./Upload01-CMufGYXQ.js";import{i as qn}from"./AlertCircle-C7z-V8PW.js";import{a as Xr}from"./Eye-Cg3KEYLR.js";import{a as kt,b as Ot,d as Lt,f as $t,F as Qn}from"./form-DCJSDrN9.js";import{b as eo,d as to,c as no,S as so,a as ro}from"./select-LFt-mET5.js";import{i as oo}from"./RefreshCcw01-DkjqduXo.js";import{a as Yn,t as _t,b as ao}from"./XCircle-BLtazoy5.js";import{b as lo,c as io}from"./tabs-DCe9cJFy.js";import{T as Hn,a as Ze}from"./toggle-group-CVhoCxfd.js";import{I as Gn}from"./input-rSCTpjle.js";import{u as co}from"./use-ai-providers-B_B7XI7_.js";import{i as Wn}from"./Monitor01-BMO0nffP.js";import{C as Jn}from"./connect-desktop-dialog-BBJ3ZBYq.js";import{C as Zn,a as Xn,m as pt,i as uo,g as es,b as Vo,N as fo}from"./agent-icons-hvA3E_Do.js";import{P as zt,a as Bt,b as Ut}from"./popover-C9laUh6-.js";import{a as Zt,e as Xt,f as mo,c as po,C as ho,d as xo,b as go}from"./command-BqieK0cx.js";import{u as bo}from"./useInfiniteQuery-FZ-eOLUd.js";import{g as ts,A as vo}from"./sortable.esm-BmQU85RQ.js";import{t as yo}from"./Stars01-CbHt_6-5.js";import{P as It,a as Ao,b as wo,u as jo,E as So,c as Kt,i as Co,d as No}from"./scroll-area-lnnHcoAD.js";import{S as ko}from"./index-OvgvLmj6.js";import{D as _o,a as Io,b as Eo,c as pe,e as en,f as tn,g as nn,i as Ro,j as To}from"./dropdown-menu-CD9L0NpR.js";import{s as sn}from"./Plus-C2lPEpk2.js";import{p as Po,q as Do}from"./question-004-sINsf4GQ.js";import{i as Mo}from"./ChevronRight-DF_7Jr6-.js";function Fo(t,e){const n=ze(e);return Oo({filters:{...t,status:"pending"}},n).length}function rn(t,e){return t.findAll(e.filters).map(n=>e.select?e.select(n):n.state)}function Oo(t={},e){const n=ze(e).getMutationCache(),r=S.useRef(t),o=S.useRef(null);return o.current===null&&(o.current=rn(n,t)),S.useEffect(()=>{r.current=t}),S.useSyncExternalStore(S.useCallback(a=>n.subscribe(()=>{const l=Ls(o.current,rn(n,r.current));o.current!==l&&(o.current=l,$s.schedule(a))}),[n]),()=>o.current,()=>o.current)}const on=3,ns="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Lo="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function ss(t){const e=L.c(46),{item:n,onSelect:r,isLoading:o,isDisabled:a,variant:l}=t,c=l===void 0?"pill":l,{prompt:i}=n;let u;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const k=Ve(i._meta);u=i.title??Mt(i.name,k),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=u}else u=e[3];const V=u,d=i.description||null;if(c==="card"){let k;e[4]!==r||e[5]!==i?(k=()=>r(i),e[4]=r,e[5]=i,e[6]=k):k=e[6];const j=a||o,C=o&&"bg-accent/40",P=(a||o)&&"cursor-not-allowed opacity-50";let N;e[7]!==C||e[8]!==P?(N=B(Lo,"hover:bg-accent/60 text-foreground",C,P),e[7]=C,e[8]=P,e[9]=N):N=e[9];let T;e[10]!==V?(T=s.jsx("span",{className:"font-medium truncate capitalize",children:V}),e[10]=V,e[11]=T):T=e[11];let E;e[12]!==o?(E=o&&s.jsx(St,{size:"xs"}),e[12]=o,e[13]=E):E=e[13];let _;e[14]!==T||e[15]!==E?(_=s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[T,E]}),e[14]=T,e[15]=E,e[16]=_):_=e[16];let R;e[17]!==d?(R=d&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:d}),e[17]=d,e[18]=R):R=e[18];let F;return e[19]!==_||e[20]!==R||e[21]!==k||e[22]!==j||e[23]!==N?(F=s.jsxs("button",{type:"button",onClick:k,disabled:j,className:N,children:[_,R]}),e[19]=_,e[20]=R,e[21]=k,e[22]=j,e[23]=N,e[24]=F):F=e[24],F}let m;e[25]!==r||e[26]!==i?(m=()=>r(i),e[25]=r,e[26]=i,e[27]=m):m=e[27];const f=a||o,x=o&&"bg-muted/50",h=(a||o)&&"cursor-not-allowed opacity-50";let p;e[28]!==x||e[29]!==h?(p=B(ns,"hover:bg-muted/70 hover:text-foreground",x,h),e[28]=x,e[29]=h,e[30]=p):p=e[30];let b;e[31]!==V?(b=s.jsx("span",{className:"capitalize",children:V}),e[31]=V,e[32]=b):b=e[32];let g;e[33]!==o?(g=o&&s.jsx(St,{size:"xs"}),e[33]=o,e[34]=g):g=e[34];let v;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==b||e[39]!==g?(v=s.jsx(ge,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:m,disabled:f,className:p,children:[b,g]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=b,e[39]=g,e[40]=v):v=e[40];const y=d??V;let w;e[41]!==y?(w=s.jsx(be,{side:"top",className:"max-w-xs",children:s.jsx("p",{className:"text-xs",children:y})}),e[41]=y,e[42]=w):w=e[42];let A;return e[43]!==v||e[44]!==w?(A=s.jsxs(ve,{delayDuration:400,children:[v,w]}),e[43]=v,e[44]=w,e[45]=A):A=e[45],A}function $o(t){const e=L.c(41),{items:n,open:r,onOpenChange:o,onSelect:a,loadingPrompt:l}=t,[c,i]=S.useState(""),u=!!l;let V;e[0]!==n||e[1]!==c?(V=c.trim()?n.filter(j=>{const C=c.toLowerCase();return j.prompt.name.toLowerCase().includes(C)||(j.prompt.title??"").toLowerCase().includes(C)||(j.prompt.description??"").toLowerCase().includes(C)}):n,e[0]=n,e[1]=c,e[2]=V):V=e[2];const d=V,m=kr();let f;e[3]!==d.length||e[4]!==c?(f=d.length===0&&s.jsxs("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:["No prompts match “",c,"”"]}),e[3]=d.length,e[4]=c,e[5]=f):f=e[5];let x;if(e[6]!==d||e[7]!==u||e[8]!==l?.name||e[9]!==o||e[10]!==a){let j;e[12]!==u||e[13]!==l?.name||e[14]!==o||e[15]!==a?(j=C=>s.jsx(ss,{item:C,variant:"card",onSelect:P=>{o(!1),a(P)},isLoading:l?.name===C.prompt.name,isDisabled:u&&l?.name!==C.prompt.name},C.prompt.name),e[12]=u,e[13]=l?.name,e[14]=o,e[15]=a,e[16]=j):j=e[16],x=d.map(j),e[6]=d,e[7]=u,e[8]=l?.name,e[9]=o,e[10]=a,e[11]=x}else x=e[11];let h;e[17]!==f||e[18]!==x?(h=s.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[f,x]})}),e[17]=f,e[18]=x,e[19]=h):h=e[19];const p=h;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=j=>{j.key==="Escape"&&i("")},e[20]=b):b=e[20];let g;e[21]!==c?(g=s.jsx(Tr,{value:c,onChange:i,placeholder:"Search prompts...",onKeyDown:b}),e[21]=c,e[22]=g):g=e[22];const v=g;if(m){let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(_r,{className:"sr-only",children:s.jsx(Ir,{children:"All prompts"})}),e[23]=j):j=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Prompts"})}),e[24]=C):C=e[24];let P;e[25]!==p||e[26]!==v?(P=s.jsxs(Er,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[j,C,v,p]}),e[25]=p,e[26]=v,e[27]=P):P=e[27];let N;return e[28]!==o||e[29]!==r||e[30]!==P?(N=s.jsx(Ct,{delayDuration:400,children:s.jsx(Rr,{open:r,onOpenChange:o,children:P})}),e[28]=o,e[29]=r,e[30]=P,e[31]=N):N=e[31],N}let y;e[32]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(at,{className:"sr-only",children:s.jsx(lt,{children:"All prompts"})}),e[32]=y):y=e[32];let w;e[33]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Prompts"})}),e[33]=w):w=e[33];let A;e[34]!==p||e[35]!==v?(A=s.jsxs(it,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[y,w,v,p]}),e[34]=p,e[35]=v,e[36]=A):A=e[36];let k;return e[37]!==o||e[38]!==r||e[39]!==A?(k=s.jsx(Ct,{delayDuration:400,children:s.jsx(ct,{open:r,onOpenChange:o,children:A})}),e[37]=o,e[38]=r,e[39]=A,e[40]=k):k=e[40],k}function zo(t){const e=L.c(29),{items:n,onSelect:r,loadingPrompt:o,className:a}=t,[l,c]=S.useState(!1);if(n.length===0)return null;let i,u,V;if(e[0]!==n||e[1]!==o||e[2]!==r){const b=n.slice(0,on);let g;e[6]!==n?(g=n.slice(on),e[6]=n,e[7]=g):g=e[7],i=g,u=!!o;let v;e[8]!==u||e[9]!==o?.name||e[10]!==r?(v=y=>s.jsx(ss,{item:y,onSelect:r,isLoading:o?.name===y.prompt.name,isDisabled:u&&o?.name!==y.prompt.name},y.prompt.name),e[8]=u,e[9]=o?.name,e[10]=r,e[11]=v):v=e[11],V=b.map(v),e[0]=n,e[1]=o,e[2]=r,e[3]=i,e[4]=u,e[5]=V}else i=e[3],u=e[4],V=e[5];const d=V;let m;e[12]!==a?(m=B("w-full flex flex-wrap gap-2 justify-center",a),e[12]=a,e[13]=m):m=e[13];let f;e[14]!==i.length||e[15]!==u?(f=i.length>0&&s.jsxs("button",{type:"button",disabled:u,onClick:()=>c(!0),className:B(ns,"hover:bg-muted/70 hover:text-foreground",u&&"opacity-50 cursor-not-allowed"),children:["+",i.length," more"]}),e[14]=i.length,e[15]=u,e[16]=f):f=e[16];let x;e[17]!==d||e[18]!==m||e[19]!==f?(x=s.jsxs("div",{className:m,children:[d,f]}),e[17]=d,e[18]=m,e[19]=f,e[20]=x):x=e[20];let h;e[21]!==n||e[22]!==o||e[23]!==l||e[24]!==r?(h=s.jsx($o,{items:n,open:l,onOpenChange:c,onSelect:r,loadingPrompt:o}),e[21]=n,e[22]=o,e[23]=l,e[24]=r,e[25]=h):h=e[25];let p;return e[26]!==x||e[27]!==h?(p=s.jsxs(Ct,{delayDuration:400,children:[x,h]}),e[26]=x,e[27]=h,e[28]=p):p=e[28],p}function Bo(){return null}function Uo(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function Ko(t){const e=L.c(30),{connectionId:n}=t,{sendMessage:r}=Be(),{org:o}=ie();let a;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(a={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=a):a=e[3];const l=ue(a);let c;e[4]!==l?(c={client:l,staleTime:6e4},e[4]=l,e[5]=c):c=e[5];const{data:i}=Pr(c);let u;e[6]!==i?.prompts?(u=i?.prompts??[],e[6]=i?.prompts,e[7]=u):u=e[7];const V=u;let d;e[8]!==V?(d=V.map(qo),e[8]=V,e[9]=d):d=e[9];const m=d;let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f={stage:"idle"},e[10]=f):f=e[10];const[x,h]=S.useReducer(Uo,f),[p,b]=S.useState(null);let g;e[11]!==l||e[12]!==r?(g=async(E,_)=>{if(!l){le.error("MCP client not available"),h({type:"RESET"});return}try{const R=await Vt(l,E.name,_);h({type:"RESET"});const F={type:"doc",content:[{type:"paragraph",content:[Fn({id:E.name,name:ot(E.name,Ve(E._meta)),metadata:R.messages,char:"/",kind:"prompt",args:_}),{type:"text",text:" "}]}]};await r(F)}catch(R){console.error("[ice-breakers] Failed to fetch prompt:",R),le.error("Failed to load prompt. Please try again."),h({type:"RESET"})}},e[11]=l,e[12]=r,e[13]=g):g=e[13];const v=g;let y;e[14]!==v?(y=async E=>{if(E.arguments&&E.arguments.length>0){h({type:"SELECT_PROMPT",prompt:E}),b(E);return}h({type:"START_LOADING",prompt:E}),await v(E)},e[14]=v,e[15]=y):y=e[15];const w=y;let A;e[16]!==p||e[17]!==v?(A=async E=>{p&&(h({type:"START_LOADING",prompt:p,arguments:E}),b(null),await v(p,E))},e[16]=p,e[17]=v,e[18]=A):A=e[18];const k=A;if(m.length===0)return null;const j=x.stage==="loading"?x.prompt:null;let C;e[19]!==w||e[20]!==m||e[21]!==j?(C=s.jsx(zo,{items:m,onSelect:w,loadingPrompt:j}),e[19]=w,e[20]=m,e[21]=j,e[22]=C):C=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{b(null),h({type:"RESET"})},e[23]=P):P=e[23];let N;e[24]!==p||e[25]!==k?(N=s.jsx(Je,{prompt:p,setPrompt:P,onSubmit:k}),e[24]=p,e[25]=k,e[26]=N):N=e[26];let T;return e[27]!==C||e[28]!==N?(T=s.jsxs(s.Fragment,{children:[C,N]}),e[27]=C,e[28]=N,e[29]=T):T=e[29],T}function qo(t){return{prompt:t}}function Qo(t){const e=L.c(13),{className:n}=t,{selectedVirtualMcp:r}=me(),{org:o}=ie();let a;e[0]!==o.id?(a=dt(o.id),e[0]=o.id,e[1]=a):a=e[1];const l=a.id,c=r?.id??l;let i;e[2]!==n?(i=B("w-full @container",n),e[2]=n,e[3]=i):i=e[3];const u=c??"default";let V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Bo,{}),e[4]=V):V=e[4];let d;e[5]!==c?(d=s.jsx(Ko,{connectionId:c}),e[5]=c,e[6]=d):d=e[6];let m;e[7]!==u||e[8]!==d?(m=s.jsx(zs,{fallback:null,children:s.jsx(S.Suspense,{fallback:V,children:d},u)}),e[7]=u,e[8]=d,e[9]=m):m=e[9];let f;return e[10]!==i||e[11]!==m?(f=s.jsx("div",{className:i,children:m}),e[10]=i,e[11]=m,e[12]=f):f=e[12],f}const vt="cubic-bezier(0.645, 0.045, 0.355, 1)",Yo=44,Ho={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-amber-500/5 after:pointer-events-none after:-z-10"},Go={default:"border-border",error:"border-destructive/30",warning:"border-amber-500/30"},Wo={default:"text-muted-foreground",error:"text-destructive",warning:"text-amber-600 dark:text-amber-500"};function fe(t){const e=L.c(61),{icon:n,label:r,count:o,title:a,footerLeft:l,footerRight:c,children:i,defaultExpanded:u,variant:V,onClose:d}=t,m=V===void 0?"default":V,[f,x]=S.useState(u),[h,p]=S.useState(!1);let b;e[0]!==d?(b=()=>{p(!0),d?.()},e[0]=d,e[1]=b):b=e[1];const g=b;if(h)return null;const v=Go[m],y=Ho[m];let w;e[2]!==v||e[3]!==y?(w=B("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",v,y),e[2]=v,e[3]=y,e[4]=w):w=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>x(Jo),e[5]=A):A=e[5];const k=f&&"rounded-b-none",j=!f&&"rounded-b-xl";let C;e[6]!==k||e[7]!==j?(C=B("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",k,j),e[6]=k,e[7]=j,e[8]=C):C=e[8];const P=Wo[m];let N;e[9]!==P?(N=B("shrink-0",P),e[9]=P,e[10]=N):N=e[10];let T;e[11]!==n||e[12]!==N?(T=s.jsx("span",{className:N,children:n}),e[11]=n,e[12]=N,e[13]=T):T=e[13];let E;e[14]!==r?(E=s.jsx("span",{className:"flex-1 min-w-0 truncate",children:r}),e[14]=r,e[15]=E):E=e[15];let _;e[16]!==o?(_=o?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o}):null,e[16]=o,e[17]=_):_=e[17];const R=f?"rotate(180deg)":"rotate(0deg)";let F;e[18]!==R?(F=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(ft,{size:16,style:{transform:R,transition:`transform 180ms ${vt}`}})}),e[18]=R,e[19]=F):F=e[19];let D,I;e[20]!==g?(D=ee=>{ee.stopPropagation(),g()},I=ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),ee.stopPropagation(),g())},e[20]=g,e[21]=D,e[22]=I):(D=e[21],I=e[22]);let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(De,{size:16}),e[23]=O):O=e[23];let z;e[24]!==D||e[25]!==I?(z=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":"Close",title:"Close",onClick:D,onKeyDown:I,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:O}),e[24]=D,e[25]=I,e[26]=z):z=e[26];let $;e[27]!==f||e[28]!==T||e[29]!==E||e[30]!==_||e[31]!==F||e[32]!==z||e[33]!==C?($=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":f,onClick:A,className:C,children:[T,E,_,F,z]}),e[27]=f,e[28]=T,e[29]=E,e[30]=_,e[31]=F,e[32]=z,e[33]=C,e[34]=$):$=e[34];const K=f?"1fr":"0fr";let M;e[35]!==K?(M={display:"grid",gridTemplateRows:K,transition:`grid-template-rows 180ms ${vt}`},e[35]=K,e[36]=M):M=e[36];let U;e[37]===Symbol.for("react.memo_cache_sentinel")?(U={overflow:"hidden",minHeight:0},e[37]=U):U=e[37];const Q=f?1:0;let q;e[38]!==Q?(q={opacity:Q,transition:`opacity 120ms ${vt}`},e[38]=Q,e[39]=q):q=e[39];let Y;e[40]!==a?(Y=a?s.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:s.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:a})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[40]=a,e[41]=Y):Y=e[41];let se;e[42]!==i||e[43]!==a?(se=i?s.jsx("div",{className:B("overflow-clip pb-4",!a&&"pt-4"),children:i}):null,e[42]=i,e[43]=a,e[44]=se):se=e[44];let X;e[45]!==l||e[46]!==c?(X=l||c?s.jsx("div",{className:"border-t border-border px-3 py-3 pb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:l}),s.jsx("div",{className:"flex items-center gap-2",children:c})]})}):null,e[45]=l,e[46]=c,e[47]=X):X=e[47];let te;e[48]!==q||e[49]!==Y||e[50]!==se||e[51]!==X?(te=s.jsx("div",{style:U,children:s.jsxs("div",{style:q,children:[Y,se,X]})}),e[48]=q,e[49]=Y,e[50]=se,e[51]=X,e[52]=te):te=e[52];let W;e[53]!==M||e[54]!==te?(W=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:M,children:te}),e[53]=M,e[54]=te,e[55]=W):W=e[55];let J;return e[56]!==$||e[57]!==W||e[58]!==w||e[59]!==m?(J=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":m,className:w,children:[$,W]}),e[56]=$,e[57]=W,e[58]=w,e[59]=m,e[60]=J):J=e[60],J}function Jo(t){return!t}const Zo=xe({content:_e().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Pt(["pending","in_progress","completed"]),activeForm:_e().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),rs=xe({todos:Bs(Zo)}),Xo="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";Dr({description:Xo,inputSchema:Mr(rs),execute:async({todos:t})=>({ok:!0,count:t.length})});const ea="tool-todo_write",ta=new Set(["input-available","output-available"]);function os(t){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.role!=="assistant")continue;const r=n.parts;if(Array.isArray(r))for(let o=r.length-1;o>=0;o--){const a=r[o];if(a.type!==ea||typeof a.state!="string"||!ta.has(a.state))continue;const l=rs.safeParse(a.input);if(l.success)return l.data.todos}}return[]}function as(t){const e=[];for(const n of t)if("state"in n&&n.state==="approval-requested"&&"approval"in n&&n.approval?.id&&"toolCallId"in n&&n.toolCallId){const r="toolName"in n&&typeof n.toolName=="string"?n.toolName:n.type.startsWith("tool-")?n.type.replace("tool-",""):"Tool";e.push({approvalId:n.approval.id,toolCallId:n.toolCallId,toolName:r,friendlyName:Vr(fr(r)),input:n.input})}return e}function ls(t){const e=[];for(const n of t)if("type"in n&&n.type==="tool-propose_plan"&&"state"in n&&n.state==="input-available"&&"toolCallId"in n&&"input"in n){const r=n.input;e.push({toolCallId:n.toolCallId,plan:r.plan,state:n.state})}return e}function na(t){return t?t.message.startsWith("[CREDITS]"):!1}const sa={isCreditExhausted:!1,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1};function ra(t){const{messages:e,error:n,finishReason:r,isStreaming:o,isWaitingForApprovals:a}=t;if(!o&&n&&na(n))return{...sa,isCreditExhausted:!0};const l=e.at(-1),c=l?.role==="assistant"?l.parts:[],i=c,V=!!i.filter(v=>v.type==="tool-user_ask").filter(v=>v.state!=="output-available").length,d=ls(c),m=as(i),f=os(e),x=!o&&!!n,h=m.length>0||o&&a,p=d.length>0,g=!o&&!!r&&r!=="stop"&&!(r==="tool-calls"&&(V||h||p))&&!x;return{isCreditExhausted:!1,hasTodos:f.length>0,showError:x,showWarning:g,hasApprovals:h,hasPlans:p,isWaitingForUserInput:V}}function is(){const t=L.c(6),{messages:e,error:n,finishReason:r,isStreaming:o,isWaitingForApprovals:a}=Be(),l=n??null,c=r??null;let i;return t[0]!==o||t[1]!==a||t[2]!==e||t[3]!==l||t[4]!==c?(i=ra({messages:e,error:l,finishReason:c,isStreaming:o,isWaitingForApprovals:a}),t[0]=o,t[1]=a,t[2]=e,t[3]=l,t[4]=c,t[5]=i):i=t[5],i}function oa(){const t=is();return t.isCreditExhausted?0:Number(t.hasTodos)+Number(t.showError)+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)}function cs(t){return!t||!t.content||t.content.length===0?!0:t.content.every(e=>e.type==="paragraph"?!e.content||e.content.length===0?!0:e.content.every(n=>n.type==="hardBreak"||n.type==="text"&&(!n.text||n.text.trim()==="")):!1)}const aa="__home__";function qt(t,e){return Us.chatDraft(t,e)}function la(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object"||typeof e.updatedAt!="number")return null;const n=e.tiptapDoc;return!n||typeof n!="object"||n.type!=="doc"||!Array.isArray(n.content)?null:n}function ia(t,e,n,r,o){const a=qt(e,n);if(cs(r)){t.removeItem(a);return}const l={tiptapDoc:r,updatedAt:Date.now()},c=JSON.stringify(l);try{t.setItem(a,c)}catch(i){if(da(i)){const u=new TextEncoder().encode(c).byteLength;o?.onQuotaExceeded?.({docSizeBytes:u});return}throw i}}function an(t,e,n){const r=qt(e,n),o=t.getItem(r),a=la(o);return o!==null&&a===null&&t.removeItem(r),a}function ca(t,e,n){t.removeItem(qt(e,n))}function da(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}function ua(t){const e=L.c(21),{current:n,total:r,onPrev:o,onNext:a}=t;if(r<=1)return null;const l=n===0,c=n===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let i;e[0]!==c?(i=B("p-0.5 rounded transition-colors",c),e[0]=c,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(oo,{size:14}),e[2]=u):u=e[2];let V;e[3]!==o||e[4]!==l||e[5]!==i?(V=s.jsx("button",{type:"button",onClick:o,disabled:l,className:i,"aria-label":"Previous question",children:u}),e[3]=o,e[4]=l,e[5]=i,e[6]=V):V=e[6];const d=n+1;let m;e[7]!==d||e[8]!==r?(m=s.jsxs("span",{className:"tabular-nums text-xs",children:[d," of ",r]}),e[7]=d,e[8]=r,e[9]=m):m=e[9];const f=n===r-1,x=n===r-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let h;e[10]!==x?(h=B("p-0.5 rounded transition-colors",x),e[10]=x,e[11]=h):h=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Yn,{size:14}),e[12]=p):p=e[12];let b;e[13]!==a||e[14]!==h||e[15]!==f?(b=s.jsx("button",{type:"button",onClick:a,disabled:f,className:h,"aria-label":"Next question",children:p}),e[13]=a,e[14]=h,e[15]=f,e[16]=b):b=e[16];let g;return e[17]!==b||e[18]!==V||e[19]!==m?(g=s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[V,m,b]}),e[17]=b,e[18]=V,e[19]=m,e[20]=g):g=e[20],g}function ds(t){const e=L.c(8),{currentIndex:n,total:r,onPrev:o,onNext:a,extraLeft:l}=t;let c;e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==r?(c=s.jsx(ua,{current:n,total:r,onPrev:o,onNext:a}),e[0]=n,e[1]=a,e[2]=o,e[3]=r,e[4]=c):c=e[4];let i;return e[5]!==l||e[6]!==c?(i=s.jsxs("div",{className:"flex items-center gap-2",children:[c,l]}),e[5]=l,e[6]=c,e[7]=i):i=e[7],i}function Va(t){const e=L.c(17),{isStreaming:n,isAllAnswered:r,isCurrentAnswered:o,onAdvanceOrSubmit:a,submitLabel:l,nextLabel:c}=t,V=r?l===void 0?"Submit":l:c===void 0?"Next":c,d=r?n:!o,m=d?r?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==d||e[1]!==a?(f=()=>{d||a()},e[0]=d,e[1]=a,e[2]=f):f=e[2];const x=d&&"opacity-50 cursor-not-allowed";let h;e[3]!==x?(h=B("h-7 px-2.5 text-xs",x),e[3]=x,e[4]=h):h=e[4];let p;e[5]!==d||e[6]!==V||e[7]!==f||e[8]!==h?(p=s.jsx(re,{type:"button",size:"sm","aria-disabled":d,onClick:f,className:h,children:V}),e[5]=d,e[6]=V,e[7]=f,e[8]=h,e[9]=p):p=e[9];const b=p;if(!m)return b;let g;e[10]!==b?(g=s.jsx(ge,{asChild:!0,children:b}),e[10]=b,e[11]=g):g=e[11];let v;e[12]!==m?(v=s.jsx(be,{children:m}),e[12]=m,e[13]=v):v=e[13];let y;return e[14]!==g||e[15]!==v?(y=s.jsxs(ve,{children:[g,v]}),e[14]=g,e[15]=v,e[16]=y):y=e[16],y}function us(t,e,n){return t.findIndex(r=>e(r)===n)}function ln(t,e,n,r){return t.length===0?!1:t.every(o=>r(n[e(o)]))}function cn(t,e,n,r,o){if(t.length===0)return null;const a=us(t,e,o);for(let l=1;l<=t.length;l++){const c=t[(a+l)%t.length];if(!c)continue;const i=e(c);if(i!==o&&!r(n[i]))return i}return null}function fa(t){return!t.isStreaming&&t.allAnswered}function Vs(t){const{parts:e,partKey:n,schema:r,defaultValues:o,isStreaming:a,hasAnswer:l,onSubmit:c}=t,i=e[0]?n(e[0]):"",[u,V]=S.useState(i),[d,m]=S.useState(!1),f=Ks({resolver:qs(r),defaultValues:o}),x=f.watch(),h=us(e,n,u),p=h>=0?e[h]:void 0,b=l(x[u]),g=ln(e,n,x,l),v=fa({isStreaming:a,allAnswered:g}),y=()=>{if(h>0){const N=e[h-1];N&&V(n(N))}},w=()=>{if(h>=0&&h<e.length-1){const N=e[h+1];N&&V(n(N))}},A=()=>{const N=f.getValues(),T=cn(e,n,N,l,u);T&&V(T)},k=()=>{f.handleSubmit(N=>{const T=N;for(const E of e)c(E,T[n(E)])})()},j=S.useRef(k);j.current=k;const C=()=>{v&&(m(!1),j.current())},P=()=>{const N=f.getValues();if(ln(e,n,N,l)){if(a){m(!0);return}m(!1),j.current()}else{const T=cn(e,n,N,l,u);T&&V(T)}};return S.useEffect(()=>{if(d&&!a){if(!g){m(!1);return}m(!1),j.current()}},[d,a,g]),{form:f,activeKey:u,setActiveKey:V,currentIndex:h,currentPart:p,isCurrentAnswered:b,isAllAnswered:g,canSubmit:v,goPrev:y,goNext:w,advanceToNextUnanswered:A,submit:C,submitOrAdvance:P}}const fs="User denied this tool call, give other alternatives.";function ms(t){const e=L.c(9),{onYolo:n}=t,[r,o]=Ee();let a;e[0]!==n||e[1]!==r||e[2]!==o?(a=V=>{const d=V;o({...r,toolApprovalLevel:d}),d==="auto"&&n(d)},e[0]=n,e[1]=r,e[2]=o,e[3]=a):a=e[3];const l=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(so,{size:"xs",className:"text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",onClick:pa,children:s.jsx(ro,{})}),e[4]=c):c=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(eo,{children:Pe.map(ma)}),e[5]=i):i=e[5];let u;return e[6]!==l||e[7]!==r.toolApprovalLevel?(u=s.jsxs(to,{value:r.toolApprovalLevel,onValueChange:l,children:[c,i]}),e[6]=l,e[7]=r.toolApprovalLevel,e[8]=u):u=e[8],u}function ma(t){return s.jsx(no,{value:t.value,children:t.label},t.value)}function pa(t){return t.stopPropagation()}function ps(t){const e=L.c(5),{input:n}=t;if(n==null){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:"No input"}),e[0]=a):a=e[0],a}let r;try{let a;e[1]!==n?(a=JSON.stringify(n,null,2),e[1]=n,e[2]=a):a=e[2],r=a}catch{r=String(n)}let o;return e[3]!==r?(o=s.jsx("div",{className:"px-4",children:s.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:r})}),e[3]=r,e[4]=o):o=e[4],o}function ha(t){const e=L.c(28),{approval:n,onRespond:r}=t,[o]=Ee(),a=o.toolApprovalLevel??"readonly";let l;e[0]!==n.approvalId||e[1]!==a||e[2]!==r?(l=()=>r(n.approvalId,!1,fs,a),e[0]=n.approvalId,e[1]=a,e[2]=r,e[3]=l):l=e[3];const c=l;let i;e[4]!==n.approvalId||e[5]!==a||e[6]!==r?(i=()=>r(n.approvalId,!0,void 0,a),e[4]=n.approvalId,e[5]=a,e[6]=r,e[7]=i):i=e[7];const u=i;let V;e[8]!==n.approvalId||e[9]!==r?(V=w=>r(n.approvalId,!0,void 0,w),e[8]=n.approvalId,e[9]=r,e[10]=V):V=e[10];const d=V;let m;e[11]!==d?(m=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ms,{onYolo:d})}),e[11]=d,e[12]=m):m=e[12];const f=m;let x;e[13]!==c?(x=s.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:c,children:"Deny"}),e[13]=c,e[14]=x):x=e[14];let h;e[15]!==u?(h=s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:"Accept"}),e[15]=u,e[16]=h):h=e[16];let p;e[17]!==x||e[18]!==h?(p=s.jsxs(s.Fragment,{children:[x,h]}),e[17]=x,e[18]=h,e[19]=p):p=e[19];const b=p;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(mt,{size:14}),e[20]=g):g=e[20];let v;e[21]!==n.input?(v=s.jsx(ps,{input:n.input}),e[21]=n.input,e[22]=v):v=e[22];let y;return e[23]!==n.friendlyName||e[24]!==f||e[25]!==b||e[26]!==v?(y=s.jsx(fe,{icon:g,label:"Approval needed",title:n.friendlyName,defaultExpanded:!0,footerLeft:f,footerRight:b,children:v}),e[23]=n.friendlyName,e[24]=f,e[25]=b,e[26]=v,e[27]=y):y=e[27],y}const xa=Qs(_e(),xe({approved:Ys().optional(),levelOverride:Pt(["auto","readonly"]).optional()}));function ga(t){const e=L.c(42),{approvals:n,isStreaming:r,onRespond:o}=t,[a]=Ee(),l=a.toolApprovalLevel??"readonly";let c;e[0]!==n?(c=Object.fromEntries(n.map(ya)),e[0]=n,e[1]=c):c=e[1];const i=c;let u;e[2]!==l||e[3]!==o?(u=(P,N)=>{const T=N;typeof T?.approved=="boolean"&&o(P.approvalId,T.approved,T.approved===!1?fs:void 0,T.levelOverride??l)},e[2]=l,e[3]=o,e[4]=u):u=e[4];let V;e[5]!==n||e[6]!==i||e[7]!==r||e[8]!==u?(V={parts:n,partKey:va,schema:xa,defaultValues:i,isStreaming:r,hasAnswer:ba,onSubmit:u},e[5]=n,e[6]=i,e[7]=r,e[8]=u,e[9]=V):V=e[9];const d=Vs(V);let m;e[10]!==n||e[11]!==d?(m=P=>{d.form.reset(Object.fromEntries(n.map(N=>[N.approvalId,{approved:!0,levelOverride:P}]))),d.submitOrAdvance()},e[10]=n,e[11]=d,e[12]=m):m=e[12];const f=m,x=d.currentPart;let h;e[13]!==d?(h=P=>{P.preventDefault(),d.submit()},e[13]=d,e[14]=h):h=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(mt,{size:14}),e[15]=p):p=e[15];const b=`${n.length} approvals pending`,g=x?.friendlyName??"";let v;e[16]!==f?(v=s.jsx(ms,{onYolo:f}),e[16]=f,e[17]=v):v=e[17];let y;e[18]!==n.length||e[19]!==d.currentIndex||e[20]!==d.goNext||e[21]!==d.goPrev||e[22]!==v?(y=s.jsx(ds,{currentIndex:d.currentIndex,total:n.length,onPrev:d.goPrev,onNext:d.goNext,extraLeft:v}),e[18]=n.length,e[19]=d.currentIndex,e[20]=d.goNext,e[21]=d.goPrev,e[22]=v,e[23]=y):y=e[23];let w;e[24]!==x||e[25]!==d.form.control||e[26]!==d.submitOrAdvance?(w=x?s.jsx(Aa,{approvalId:x.approvalId,control:d.form.control,onChange:d.submitOrAdvance}):null,e[24]=x,e[25]=d.form.control,e[26]=d.submitOrAdvance,e[27]=w):w=e[27];let A;e[28]!==x?(A=x?s.jsx(ps,{input:x.input}):null,e[28]=x,e[29]=A):A=e[29];let k;e[30]!==y||e[31]!==w||e[32]!==A||e[33]!==b||e[34]!==g?(k=s.jsx(fe,{icon:p,label:b,title:g,defaultExpanded:!0,footerLeft:y,footerRight:w,children:A}),e[30]=y,e[31]=w,e[32]=A,e[33]=b,e[34]=g,e[35]=k):k=e[35];let j;e[36]!==k||e[37]!==h?(j=s.jsx("form",{onSubmit:h,children:k}),e[36]=k,e[37]=h,e[38]=j):j=e[38];let C;return e[39]!==d.form||e[40]!==j?(C=s.jsx(kt,{...d.form,children:j}),e[39]=d.form,e[40]=j,e[41]=C):C=e[41],C}function ba(t){return typeof t?.approved=="boolean"}function va(t){return t.approvalId}function ya(t){return[t.approvalId,{approved:void 0}]}function Aa(t){const e=L.c(6),{approvalId:n,control:r,onChange:o}=t,a=`${n}.approved`;let l;e[0]!==o?(l=i=>{const{field:u}=i,V=u.value===!0,d=u.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(re,{type:"button",variant:d?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),o()},"aria-pressed":d,children:"Deny"}),s.jsx(re,{type:"button",variant:V?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),o()},"aria-pressed":V,children:"Accept"})]})},e[0]=o,e[1]=l):l=e[1];let c;return e[2]!==r||e[3]!==a||e[4]!==l?(c=s.jsx(Hs,{control:r,name:a,render:l}),e[2]=r,e[3]=a,e[4]=l,e[5]=c):c=e[5],c}function wa(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s.jsx(mt,{className:"size-5 text-muted-foreground shimmer"}),s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:"Preparing approval request..."})]}),t[0]=e):e=t[0],e}function ja(t){const e=L.c(8),{approvals:n,isStreaming:r,onRespond:o}=t;if(r&&n.length===0){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(wa,{}),e[0]=l):l=e[0],l}if(n.length===0)return null;if(n.length===1){const l=n[0];if(!l)return null;let c;return e[1]!==o||e[2]!==l?(c=s.jsx(ha,{approval:l,onRespond:o}),e[1]=o,e[2]=l,e[3]=c):c=e[3],c}let a;return e[4]!==n||e[5]!==r||e[6]!==o?(a=s.jsx(ga,{approvals:n,isStreaming:r,onRespond:o}),e[4]=n,e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Sa(t){const e=L.c(16),{plan:n,onApprove:r,onDismiss:o}=t;let a;e[0]!==r||e[1]!==n.plan?(a=()=>{r(n.plan)},e[0]=r,e[1]=n.plan,e[2]=a):a=e[2];const l=a;let c;e[3]!==o?(c=s.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:o,children:"Keep iterating"}),e[3]=o,e[4]=c):c=e[4];let i;e[5]!==l?(i=s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-purple-600 hover:bg-purple-700 text-white active:scale-[0.97] transition-transform",onClick:l,children:"Let's go"}),e[5]=l,e[6]=i):i=e[6];let u;e[7]!==c||e[8]!==i?(u=s.jsxs(s.Fragment,{children:[c,i]}),e[7]=c,e[8]=i,e[9]=u):u=e[9];const V=u;let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(qr,{size:14}),e[10]=d):d=e[10];let m;e[11]!==n.plan?(m=s.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:s.jsx(mr,{id:"plan-preview",part:{type:"text",text:n.plan}})})}),e[11]=n.plan,e[12]=m):m=e[12];let f;return e[13]!==V||e[14]!==m?(f=s.jsx(fe,{icon:d,label:"Plan ready",title:"Implementation Plan",defaultExpanded:!0,footerRight:V,children:m}),e[13]=V,e[14]=m,e[15]=f):f=e[15],f}function Ca(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed border-purple-500/30 rounded-lg bg-purple-500/5 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s.jsx(Ke,{className:"size-5 text-purple-500 shimmer"}),s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:"Preparing plan..."})]}),t[0]=e):e=t[0],e}function Na(t){const e=L.c(7),{plans:n,isStreaming:r,onApprove:o,onDismiss:a}=t;if(r&&n.length===0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ca,{}),e[0]=u):u=e[0],u}let l;e[1]!==n?(l=n.at(-1),e[1]=n,e[2]=l):l=e[2];const c=l;if(!c)return null;let i;return e[3]!==c||e[4]!==o||e[5]!==a?(i=s.jsx(Sa,{plan:c,onApprove:o,onDismiss:a}),e[3]=c,e[4]=o,e[5]=a,e[6]=i):i=e[6],i}function hs(t){return t?"response"in t?t.response:t.option??t.draft:""}const dn=xe({response:_e().min(1,"Response is required")}),ka=xe({option:_e().nullable(),draft:_e()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),_a=xe({response:Pt(["yes","no"])});function Ia(t){switch(t.type){case"text":return dn;case"choice":return ka;case"confirm":return _a;default:return dn}}function Ea(t){const e={};for(const n of t)e[n.toolCallId]=Ia(n.input);return xe(e)}function Ra(t){const e=L.c(6),{control:n,name:r,placeholder:o}=t;let a;e[0]!==o?(a=c=>{const{field:i}=c,u=i.value??"";return s.jsxs(Ot,{children:[s.jsx(Lt,{children:s.jsx("div",{className:"px-2",children:s.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(Bn,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...i,value:u,type:"text",placeholder:o||"Type your response...",autoFocus:!0,"aria-label":"Text response input",className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx($t,{})]})},e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==n||e[3]!==r||e[4]!==a?(l=s.jsx(Qn,{control:n,name:r,render:a}),e[2]=n,e[3]=r,e[4]=a,e[5]=l):l=e[5],l}function xs(t,e){const n=L.c(4);let r,o;n[0]!==t||n[1]!==e?(r=()=>{const a=l=>{const c=l.target.tagName;if(c==="INPUT"||c==="TEXTAREA"||l.metaKey||l.ctrlKey||l.altKey)return;const i=Number.parseInt(l.key,10);i>=1&&i<=t&&(l.preventDefault(),e(i-1))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},o=[t,e],n[0]=t,n[1]=e,n[2]=r,n[3]=o):(r=n[2],o=n[3]),S.useEffect(r,o)}function Ta(t){const e=L.c(40),{control:n,name:r,options:o}=t,a=`${r}.option`;let l;e[0]!==n||e[1]!==a?(l={control:n,name:a,defaultValue:null},e[0]=n,e[1]=a,e[2]=l):l=e[2];const{field:c}=Gt(l),i=`${r}.draft`;let u;e[3]!==n||e[4]!==i?(u={control:n,name:i,defaultValue:""},e[3]=n,e[4]=i,e[5]=u):u=e[5];const{field:V}=Gt(u),d=c.value,m=V.value??"";let f;if(e[6]!==c||e[7]!==o?(f=T=>{const E=o[T];E!=null&&c.onChange(E)},e[6]=c,e[7]=o,e[8]=f):f=e[8],xs(o.length,f),o.length===0)return null;const x=d===null;let h;if(e[9]!==c||e[10]!==d||e[11]!==o){let T;e[13]!==c||e[14]!==d?(T=(E,_)=>{const R=d===E;return s.jsxs("button",{type:"button",onClick:()=>c.onChange(E),className:B("flex items-center gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",R&&"bg-accent/50",!R&&"hover:bg-accent/30"),"aria-label":`Select ${E}`,children:[s.jsx("span",{className:B("flex items-center justify-center size-6 rounded-md text-sm shrink-0",R?"bg-chart-1 text-white":"bg-muted text-foreground"),children:_+1}),s.jsx("span",{className:"text-sm text-foreground truncate",children:E})]},`${_}-${E}`)},e[13]=c,e[14]=d,e[15]=T):T=e[15],h=o.map(T),e[9]=c,e[10]=d,e[11]=o,e[12]=h}else h=e[12];const p=x&&"bg-accent/50",b=!x&&"hover:bg-accent/30";let g;e[16]!==p||e[17]!==b?(g=B("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",p,b),e[16]=p,e[17]=b,e[18]=g):g=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(Bn,{size:16,className:"text-muted-foreground"})}),e[19]=v):v=e[19];const y=x?m:"";let w;e[20]!==V||e[21]!==c||e[22]!==d?(w=T=>{V.onChange(T.target.value),d!==null&&c.onChange(null)},e[20]=V,e[21]=c,e[22]=d,e[23]=w):w=e[23];let A;e[24]!==c||e[25]!==d?(A=()=>{d!==null&&c.onChange(null)},e[24]=c,e[25]=d,e[26]=A):A=e[26];let k;e[27]!==y||e[28]!==w||e[29]!==A?(k=s.jsx("input",{type:"text",value:y,onChange:w,onFocus:A,placeholder:"Something else...","aria-label":"Custom choice input",className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[27]=y,e[28]=w,e[29]=A,e[30]=k):k=e[30];let j;e[31]!==k||e[32]!==g?(j=s.jsxs("label",{className:g,children:[v,k]}),e[31]=k,e[32]=g,e[33]=j):j=e[33];let C;e[34]!==j||e[35]!==h?(C=s.jsx(Lt,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":"Choice options",children:[h,j]})}),e[34]=j,e[35]=h,e[36]=C):C=e[36];let P;e[37]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx($t,{}),e[37]=P):P=e[37];let N;return e[38]!==C?(N=s.jsxs(Ot,{children:[C,P]}),e[38]=C,e[39]=N):N=e[39],N}function Pa(t){const e=L.c(6),{control:n,name:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["yes","no"],e[0]=o):o=e[0];const a=o,l=S.useRef(null);let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=V=>{l.current?.onChange(a[V]??"")},e[1]=c):c=e[1],xs(a.length,c);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=V=>{const{field:d}=V;return l.current=d,s.jsxs(Ot,{children:[s.jsx(Lt,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":"Confirmation options",children:a.map(m=>{const f=d.value===m;return s.jsxs("button",{type:"button",onClick:()=>d.onChange(m),className:B("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",f&&"bg-accent/50",!f&&"hover:bg-accent/30"),"aria-label":`Confirm ${m}`,children:[s.jsx("span",{className:B("flex items-center justify-center size-6 rounded-md text-sm shrink-0",f?"bg-chart-1 text-white":"bg-muted text-foreground"),children:m==="yes"?1:2}),s.jsx("span",{className:"text-sm text-foreground capitalize",children:m})]},m)})})}),s.jsx($t,{})]})},e[2]=i):i=e[2];let u;return e[3]!==n||e[4]!==r?(u=s.jsx(Qn,{control:n,name:r,render:i}),e[3]=n,e[4]=r,e[5]=u):u=e[5],u}function un(t){const e=L.c(13),{input:n,control:r,toolCallId:o}=t;switch(n.type){case"text":{const a=`${o}.response`;let l;return e[0]!==r||e[1]!==n.default||e[2]!==a?(l=s.jsx(Ra,{control:r,name:a,placeholder:n.default}),e[0]=r,e[1]=n.default,e[2]=a,e[3]=l):l=e[3],l}case"choice":{let a;e[4]!==n.options?(a=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=a):a=e[5];const l=a;let c;return e[6]!==r||e[7]!==l||e[8]!==o?(c=s.jsx(Ta,{control:r,name:o,options:l}),e[6]=r,e[7]=l,e[8]=o,e[9]=c):c=e[9],c}case"confirm":{const a=`${o}.response`;let l;return e[10]!==r||e[11]!==a?(l=s.jsx(Pa,{control:r,name:a}),e[10]=r,e[11]=a,e[12]=l):l=e[12],l}default:return null}}function Da(t){const e=L.c(71),{parts:n,isStreaming:r,onSubmit:o}=t;let a;e[0]!==n?(a=Ea(n.map(La)),e[0]=n,e[1]=a):a=e[1];const l=a;let c;e[2]!==n?(c=Object.fromEntries(n.map(Oa)),e[2]=n,e[3]=c):c=e[3];const i=c;let u;e[4]!==o?(u=(D,I)=>{const O=hs(I);O&&o(D,O)},e[4]=o,e[5]=u):u=e[5];let V;e[6]!==i||e[7]!==r||e[8]!==n||e[9]!==l||e[10]!==u?(V={parts:n,partKey:Fa,schema:l,defaultValues:i,isStreaming:r,hasAnswer:Ma,onSubmit:u},e[6]=i,e[7]=r,e[8]=n,e[9]=l,e[10]=u,e[11]=V):V=e[11];const d=Vs(V),m=d.currentPart;let f;e[12]!==m||e[13]!==d?(f=()=>{const D=m;if(!D)return;const I=D.toolCallId;D.input?.type==="choice"?(d.form.setValue(`${I}.option`,null),d.form.setValue(`${I}.draft`,"user has skip this question")):d.form.setValue(`${I}.response`,"user has skip this question"),d.advanceToNextUnanswered()},e[12]=m,e[13]=d,e[14]=f):f=e[14];const x=f;let h;e[15]!==d.currentIndex||e[16]!==d.goNext||e[17]!==d.goPrev||e[18]!==n.length?(h=s.jsx(ds,{currentIndex:d.currentIndex,total:n.length,onPrev:d.goPrev,onNext:d.goNext}),e[15]=d.currentIndex,e[16]=d.goNext,e[17]=d.goPrev,e[18]=n.length,e[19]=h):h=e[19];const p=h;let b;e[20]!==x?(b=s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:x,className:"h-7",children:"Skip"}),e[20]=x,e[21]=b):b=e[21];let g;e[22]!==d.isAllAnswered||e[23]!==d.isCurrentAnswered||e[24]!==d.submitOrAdvance||e[25]!==r?(g=s.jsx(Va,{isStreaming:r,isAllAnswered:d.isAllAnswered,isCurrentAnswered:d.isCurrentAnswered,onAdvanceOrSubmit:d.submitOrAdvance}),e[22]=d.isAllAnswered,e[23]=d.isCurrentAnswered,e[24]=d.submitOrAdvance,e[25]=r,e[26]=g):g=e[26];let v;e[27]!==b||e[28]!==g?(v=s.jsxs(s.Fragment,{children:[b,g]}),e[27]=b,e[28]=g,e[29]=v):v=e[29];const y=v;if(n.length===1){const D=n[0];if(!D?.input)return null;let I;e[30]!==d?(I=q=>{q.preventDefault(),d.submit()},e[30]=d,e[31]=I):I=e[31];let O;e[32]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(_t,{size:14}),e[32]=O):O=e[32];const z=D.input?.prompt??"Question",$=D.input;let K;e[33]!==d.form.control||e[34]!==D.toolCallId||e[35]!==$?(K=s.jsx(un,{input:$,control:d.form.control,toolCallId:D.toolCallId}),e[33]=d.form.control,e[34]=D.toolCallId,e[35]=$,e[36]=K):K=e[36];let M;e[37]!==y||e[38]!==z||e[39]!==K?(M=s.jsx(fe,{icon:O,label:"Question pending",title:z,defaultExpanded:!0,footerRight:y,children:K}),e[37]=y,e[38]=z,e[39]=K,e[40]=M):M=e[40];let U;e[41]!==I||e[42]!==M?(U=s.jsx("form",{onSubmit:I,autoComplete:"off",children:M}),e[41]=I,e[42]=M,e[43]=U):U=e[43];let Q;return e[44]!==d.form||e[45]!==U?(Q=s.jsx(kt,{...d.form,children:U}),e[44]=d.form,e[45]=U,e[46]=Q):Q=e[46],Q}const w=d.form;let A;e[47]!==d?(A=D=>{D.preventDefault(),d.submit()},e[47]=d,e[48]=A):A=e[48];let k;e[49]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(_t,{size:14}),e[49]=k):k=e[49];const j=`${d.currentIndex+1} of ${n.length}`,C=m?.input?.prompt??"Question",P=d.activeKey,N=d.setActiveKey;let T;if(e[50]!==d.form||e[51]!==n){let D;e[53]!==d.form?(D=I=>s.jsx(lo,{value:I.toolCallId,className:"mt-0",children:s.jsx(un,{input:I.input,control:d.form.control,toolCallId:I.toolCallId})},I.toolCallId),e[53]=d.form,e[54]=D):D=e[54],T=n.map(D),e[50]=d.form,e[51]=n,e[52]=T}else T=e[52];let E;e[55]!==d.activeKey||e[56]!==d.setActiveKey||e[57]!==T?(E=s.jsx(io,{value:P,onValueChange:N,children:T}),e[55]=d.activeKey,e[56]=d.setActiveKey,e[57]=T,e[58]=E):E=e[58];let _;e[59]!==p||e[60]!==y||e[61]!==j||e[62]!==C||e[63]!==E?(_=s.jsx(fe,{icon:k,label:"Question pending",count:j,title:C,defaultExpanded:!0,footerLeft:p,footerRight:y,children:E}),e[59]=p,e[60]=y,e[61]=j,e[62]=C,e[63]=E,e[64]=_):_=e[64];let R;e[65]!==A||e[66]!==_?(R=s.jsx("form",{onSubmit:A,autoComplete:"off",children:_}),e[65]=A,e[66]=_,e[67]=R):R=e[67];let F;return e[68]!==d.form||e[69]!==R?(F=s.jsx(kt,{...w,children:R}),e[68]=d.form,e[69]=R,e[70]=F):F=e[70],F}function Ma(t){return!!hs(t)}function Fa(t){return t.toolCallId}function Oa(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function La(t){return{toolCallId:t.toolCallId,input:t.input}}function $a(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s.jsx(_t,{className:"size-5 text-muted-foreground shimmer"}),s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:"Preparing question..."})]}),t[0]=e):e=t[0],e}function gs(t){const e=L.c(7),{userAskParts:n,isStreaming:r,onSubmit:o}=t;let a;e[0]!==n?(a=n.filter(za),e[0]=n,e[1]=a):a=e[1];const l=a;if(l.length===0){if(r){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($a,{}),e[2]=i):i=e[2],i}return null}let c;return e[3]!==r||e[4]!==o||e[5]!==l?(c=s.jsx(Da,{parts:l,isStreaming:r,onSubmit:o}),e[3]=r,e[4]=o,e[5]=l,e[6]=c):c=e[6],c}function za(t){return t.state==="input-available"}function Ba(t){const e=t.filter(a=>a.status==="in_progress"),n=t.filter(a=>a.status==="completed").length,r=t.length;if(r>0&&n===r)return{icon:"completed",activity:"All done",progress:`${r}/${r}`};const[o]=e;return o&&e.length===1?{icon:"in_progress",activity:o.activeForm,progress:`${n}/${r} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${n}/${r} done`}:n>0?{icon:"pending",activity:`${r-n} pending`,progress:`${n}/${r} done`}:{icon:"pending",activity:`${r} todos`,progress:"not started"}}function Ua(){const t=L.c(21),{messages:e}=Be();let n,r,o,a,l,c,i,u,V;if(t[0]!==e){V=Symbol.for("react.early_return_sentinel");e:{const f=os(e);if(f.length===0){V=null;break e}const x=Ba(f);n=fe,l=s.jsx(Ya,{status:x.icon}),c=x.activity,i=x.progress,u=!1,r="todos-list",o="flex flex-col px-2 max-h-[40vh] overflow-y-auto",a=f.map(Ka)}t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=l,t[6]=c,t[7]=i,t[8]=u,t[9]=V}else n=t[1],r=t[2],o=t[3],a=t[4],l=t[5],c=t[6],i=t[7],u=t[8],V=t[9];if(V!==Symbol.for("react.early_return_sentinel"))return V;let d;t[10]!==r||t[11]!==o||t[12]!==a?(d=s.jsx("ul",{"data-testid":r,className:o,children:a}),t[10]=r,t[11]=o,t[12]=a,t[13]=d):d=t[13];let m;return t[14]!==n||t[15]!==l||t[16]!==c||t[17]!==i||t[18]!==u||t[19]!==d?(m=s.jsx(n,{icon:l,label:c,count:i,defaultExpanded:u,children:d}),t[14]=n,t[15]=l,t[16]=c,t[17]=i,t[18]=u,t[19]=d,t[20]=m):m=t[20],m}function Ka(t,e){return s.jsx(qa,{todo:t},e)}function qa(t){const e=L.c(14),{todo:n}=t,r=n.status==="completed",a=n.status==="in_progress"?n.activeForm:n.content;let l;e[0]!==n.status?(l=s.jsx(Qa,{status:n.status}),e[0]=n.status,e[1]=l):l=e[1];const c=r&&"text-muted-foreground";let i;e[2]!==c?(i=B("relative text-sm leading-snug pt-px select-none",c),e[2]=c,e[3]=i):i=e[3];const u=r?"100%":"0%",V=r?"width 300ms ease 200ms":"width 150ms ease";let d;e[4]!==u||e[5]!==V?(d=s.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:u,transition:V}}),e[4]=u,e[5]=V,e[6]=d):d=e[6];let m;e[7]!==a||e[8]!==i||e[9]!==d?(m=s.jsxs("span",{className:i,children:[a,d]}),e[7]=a,e[8]=i,e[9]=d,e[10]=m):m=e[10];let f;return e[11]!==l||e[12]!==m?(f=s.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[l,m]}),e[11]=l,e[12]=m,e[13]=f):f=e[13],f}function Qa(t){const e=L.c(4),{status:n}=t,r=n==="completed"?"true":void 0,o=n==="in_progress"?"true":void 0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("svg",{viewBox:"0 0 21 21",children:s.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=a):a=e[0];let l;return e[1]!==r||e[2]!==o?(l=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":r,"data-progress":o,"aria-hidden":"true",children:a}),e[1]=r,e[2]=o,e[3]=l):l=e[3],l}function Ya(t){const e=L.c(3),{status:n}=t;if(n==="completed"){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{"aria-label":"completed",className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:s.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:s.jsx("path",{d:"M1 4l2.5 2.5L9 1"})})}),e[0]=o):o=e[0],o}if(n==="in_progress"){let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{"aria-label":"in progress",className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[1]=o):o=e[1],o}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{"aria-label":"pending",className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[2]=r):r=e[2],r}const Vn=new Map;function bs(){const{org:t}=ie(),e=ue({connectionId:ut,orgId:t.id,orgSlug:t.slug}),n=co(),r=n.find(p=>p.providerId==="deco"),{data:o,isLoading:a,refetch:l,isFetching:c}=En({queryKey:Ie.aiProviderCredits(t.id,"deco"),enabled:!!r,staleTime:6e4,queryFn:async()=>{const p=await e.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return p?.isError?null:p.structuredContent??null}}),i=o?.balanceCents??null,u=i!=null?i/100:null,V=S.useRef(new Map);if(i!=null){const p=Vn.get(t.id);V.current.get(t.id)&&p!=null&&i>p&&G("credits_topped_up_detected",{organization_id:t.id,delta_cents:i-p,previous_balance_cents:p,new_balance_cents:i}),Vn.set(t.id,i),V.current.set(t.id,!0)}const d=!!r,m=i!=null&&i>0,f=i!=null&&i===0,x=i!=null&&i===200,h=n.length>0&&n.every(p=>p.providerId==="deco");return{hasDecoKey:d,decoKeyId:r?.id??null,balanceCents:i,balanceDollars:u,hasCredits:m,isZeroBalance:f,isInitialFreeCredit:x,hasOnlyDecoProvider:h,isLoading:a,isFetching:c,refetch:l}}const Ha={usd:[{dollars:10,label:"Starter"},{dollars:20,label:"Popular"},{dollars:100,label:"Best value"}],brl:[{dollars:50,label:"Starter"},{dollars:100,label:"Popular"},{dollars:500,label:"Best value"}]},Ga=["Access to 100+ AI models","Unified API, no separate keys needed","Pay only for what you use"];function vs(t){const e=L.c(44),{onDismiss:n}=t,{org:r}=ie(),o=rt(),{decoKeyId:a}=bs();let l;e[0]!==r.id||e[1]!==r.slug?(l={connectionId:ut,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=l):l=e[2];const c=ue(l),[i,u]=S.useState(""),[V,d]=S.useState(!1),[m,f]=S.useState("usd"),x=m==="brl"?"R$":"$";let h,p;e[3]!==r.id?(h=()=>{G("credits_exhausted_shown",{organization_id:r.id})},p=[r.id],e[3]=r.id,e[4]=h,e[5]=p):(h=e[4],p=e[5]),S.useEffect(h,p);let b;e[6]!==c||e[7]!==m?(b=async I=>{const O=await c.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:I,currency:m}});if(O?.isError)throw new Error(O.content?.[0]?.text??"Failed to get top-up URL");return O.structuredContent?.url},e[6]=c,e[7]=m,e[8]=b):b=e[8];let g;e[9]!==n?(g=I=>{I&&window.open(I,"_blank","noopener,noreferrer"),n?.()},e[9]=n,e[10]=g):g=e[10];let v;e[11]!==b||e[12]!==g?(v={mutationFn:b,onSuccess:g,onError:Za},e[11]=b,e[12]=g,e[13]=v):v=e[13];const{mutate:y,isPending:w}=Dt(v),A=parseFloat(i),k=!isNaN(A)&&A>=1;let j;e[14]!==n?(j=I=>!I&&n?.(),e[14]=n,e[15]=j):j=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[16]=C):C=e[16];let P;e[17]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:C.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[17]=P):P=e[17];let N;e[18]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[P,s.jsxs(at,{className:"relative gap-4",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsxs("div",{children:[s.jsx(lt,{className:"text-xl font-semibold tracking-tight",children:"Top up to keep building"}),s.jsx(Ft,{className:"mt-1.5 text-sm leading-relaxed",children:"Your credits are used up. Add more to continue using AI across all your agents."})]})]})]}),e[18]=N):N=e[18];let T;e[19]!==m||e[20]!==x||e[21]!==i||e[22]!==A||e[23]!==a||e[24]!==k||e[25]!==w||e[26]!==V||e[27]!==y?(T=a&&s.jsxs("div",{className:"px-8 pt-5 pb-6",children:[s.jsx("div",{className:"mb-4",children:s.jsxs(Hn,{type:"single",variant:"outline",size:"sm",value:m,onValueChange:I=>{I&&f(I)},children:[s.jsx(Ze,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),s.jsx(Ze,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"})]})}),s.jsxs("div",{className:"rounded-xl border border-border p-5",children:[s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:Ha[m].map(I=>{const{dollars:O,label:z}=I;return s.jsxs("button",{type:"button",disabled:w,onClick:()=>{G("credits_topup_clicked",{amount_cents:O*100,currency:m,tier_label:z,source:"exhausted_banner"}),y(O*100)},className:B("relative flex flex-col items-center gap-1 py-5 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[x,O]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:z})]},O)})}),V?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:x}),s.jsx(Gn,{type:"number",min:"1",step:"1",placeholder:"50",value:i,onChange:I=>u(I.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(re,{className:"h-10",disabled:!k||w,onClick:()=>{G("credits_topup_clicked",{amount_cents:Math.round(A*100),currency:m,tier_label:"custom",source:"exhausted_banner"}),y(Math.round(A*100))},children:w?"Opening...":"Add"})]}):s.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>d(!0),children:"Enter custom amount"})]}),s.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Ga.map(Wa)})]}),e[19]=m,e[20]=x,e[21]=i,e[22]=A,e[23]=a,e[24]=k,e[25]=w,e[26]=V,e[27]=y,e[28]=T):T=e[28];let E;e[29]!==n?(E=s.jsx(re,{variant:"ghost",size:"sm",onClick:n,children:"Dismiss"}),e[29]=n,e[30]=E):E=e[30];let _;e[31]!==o||e[32]!==n||e[33]!==r.slug?(_=s.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>{o({to:"/$org/settings/ai-providers",params:{org:r.slug}}),n?.()},children:"Manage providers"}),e[31]=o,e[32]=n,e[33]=r.slug,e[34]=_):_=e[34];let R;e[35]!==E||e[36]!==_?(R=s.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[E,_]}),e[35]=E,e[36]=_,e[37]=R):R=e[37];let F;e[38]!==T||e[39]!==R?(F=s.jsxs(it,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ja,children:[N,T,R]}),e[38]=T,e[39]=R,e[40]=F):F=e[40];let D;return e[41]!==F||e[42]!==j?(D=s.jsx(ct,{open:!0,onOpenChange:j,children:F}),e[41]=F,e[42]=j,e[43]=D):D=e[43],D}function Wa(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-[hsl(var(--chart-1))]/15 shrink-0",children:s.jsx(Ke,{size:12,className:"text-[hsl(var(--chart-1))]"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:t})]},t)}function Ja(t){return t.preventDefault()}function Za(t){le.error(`Top-up failed: ${t.message}`)}function Xa(){const t=L.c(5),e=Ue(),n=wr(),[r,o]=S.useState(!1);if(!(e?.lockedSandbox==="user-desktop")||!n.ready||n.online)return null;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Wn,{size:14}),t[0]=l):l=t[0];let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(re,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>o(!0),children:"Reconnect desktop"}),t[1]=c):c=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(fe,{icon:l,label:"Your desktop is offline",title:"This chat runs on your desktop, which isn't connected right now.",defaultExpanded:!0,variant:"warning",footerRight:c,children:s.jsxs("p",{className:"mx-4 text-xs text-muted-foreground",children:["Run ",s.jsx("code",{className:"font-mono",children:"bunx decocms link"})," in a terminal on that machine to bring it back. Messages you send while it's offline will fail."]})}),t[2]=i):i=t[2];let u;return t[3]!==r?(u=s.jsxs(s.Fragment,{children:[i,s.jsx(Jn,{open:r,onOpenChange:o})]}),t[3]=r,t[4]=u):u=t[4],u}function el(t){const e=t.trim(),n=e.startsWith("<")&&/<[a-z][\s\S]*>/i.test(e),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(e),o=/failed to fetch|networkerror|load failed|offline/i.test(e),a=/timeout|timed out|aborted|deadline/i.test(e),l=e.length>240,c=/sandbox failed to start(?::\s*(.+))?/is.exec(e);if(c){const i=c[1]?.trim().replace(/\.$/,"");return{summary:i?`Your sandbox didn't finish starting up (${i}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return/link_unavailable|user_desktop_link_/i.test(e)?/user_desktop_link_capability_missing/i.test(e)?{summary:"Your desktop is connected, but the CLI this chat uses wasn't detected there. Install it and sign in on your desktop, then try again.",rawDetails:t}:{summary:"Your desktop is offline. Run `bunx decocms link` in a terminal on it, then try again.",rawDetails:t}:r||n&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:o?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:n||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}const tl={length:"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.","content-filter":"Response was filtered due to content policy.","tool-calls":"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working."};function Xe(t){const e=L.c(19),{variant:n,onDismiss:r}=t,o=n==="error",a=o?"Error occurred":"Response incomplete",l=o?qn:Rn,c=o?t.error.message:tl[t.finishReason]??`Response stopped unexpectedly: ${t.finishReason}`;let i;e[0]!==o||e[1]!==c?(i=o?el(c):{summary:c,rawDetails:null},e[0]=o,e[1]=c,e[2]=i):i=e[2];const{summary:u,rawDetails:V}=i;let d;e[3]!==l?(d=s.jsx(l,{size:14}),e[3]=l,e[4]=d):d=e[4];let m;e[5]!==o||e[6]!==t.onContinue||e[7]!==t.onFixInChat?(m=o?s.jsx(re,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:"Fix in chat"}):s.jsx(re,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:"Continue"}),e[5]=o,e[6]=t.onContinue,e[7]=t.onFixInChat,e[8]=m):m=e[8];let f;e[9]!==V?(f=V?s.jsxs("details",{className:"group mx-4",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[s.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"m4.5 3 3 3-3 3"})}),s.jsx("span",{className:"group-open:hidden",children:"Show technical details"}),s.jsx("span",{className:"hidden group-open:inline",children:"Hide technical details"})]}),s.jsxs("div",{className:"relative mt-2",children:[s.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(V).then(sl).catch(nl)},"aria-label":"Copy error details",title:"Copy",className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-md bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(Xr,{className:"size-3.5"})}),s.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:V})]})]}):null,e[9]=V,e[10]=f):f=e[10];let x;return e[11]!==a||e[12]!==r||e[13]!==u||e[14]!==d||e[15]!==m||e[16]!==f||e[17]!==n?(x=s.jsx(fe,{icon:d,label:a,title:u,defaultExpanded:!0,variant:n,onClose:r,footerRight:m,children:f}),e[11]=a,e[12]=r,e[13]=u,e[14]=d,e[15]=m,e[16]=f,e[17]=n,e[18]=x):x=e[18],x}function nl(){return le.error("Could not copy")}function sl(){return le.success("Copied to clipboard")}function ht(){const t=L.c(62),{error:e,clearError:n,finishReason:r,clearFinishReason:o,messages:a,isStreaming:l,submit:c,sendMessage:i}=Be(),[u,V]=Ee(),{virtualMcpId:d,createTaskWithMessage:m}=jr(),{chatMode:f,simpleModeTier:x}=me();let h;t[0]!==f||t[1]!==x||t[2]!==d?(h=Z=>({tier:x,mode:f,toolApprovalLevel:Z,agent:d?{id:d}:void 0}),t[0]=f,t[1]=x,t[2]=d,t[3]=h):h=t[3];const p=h;let b;t[4]!==u.toolApprovalLevel?(b=u.toolApprovalLevel??Gs(),t[4]=u.toolApprovalLevel,t[5]=b):b=t[5];const g=b,v=a.at(-1),y=v?.role==="assistant"?v.parts:[],w=y.filter(ll),A=ls(y),k=as(y);let j;t[6]!==e||t[7]!==i?(j=()=>{if(e){const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`I encountered this error: ${e.message}. Can you help me fix it?`}]}]};i(oe)}},t[6]=e,t[7]=i,t[8]=j):j=t[8];const C=j;let P;t[9]!==i?(P=()=>{i({type:"doc",content:[{type:"paragraph",content:[{type:"text",text:"Please continue."}]}]})},t[9]=i,t[10]=P):P=t[10];const N=P;let T;t[11]!==p||t[12]!==g||t[13]!==c?(T=(Z,oe)=>{c({kind:"toolOutput",toolCallId:Z.toolCallId,output:{response:oe}},p(g))},t[11]=p,t[12]=g,t[13]=c,t[14]=T):T=t[14];const E=T;let _;t[15]!==m||t[16]!==u||t[17]!==V||t[18]!==d?(_=Z=>{V({...u,toolApprovalLevel:"auto"}),m({virtualMcpId:d,message:{parts:[{type:"text",text:`Implement this plan:
|
|
2
|
-
|
|
3
|
-
${Z}`}]}})},t[15]=m,t[16]=u,t[17]=V,t[18]=d,t[19]=_):_=t[19];const R=_,F=al;let D;t[20]!==p||t[21]!==c?(D=(Z,oe,H,ne)=>{c({kind:"approval",approvalId:Z,approved:oe,...H?{reason:H}:{}},p(ne))},t[20]=p,t[21]=c,t[22]=D):D=t[22];const I=D,O=is();if(O.isCreditExhausted){let Z;return t[23]!==n?(Z=s.jsx(vs,{onDismiss:n}),t[23]=n,t[24]=Z):Z=t[24],Z}const{showError:z,showWarning:$,hasApprovals:K}=O,M=w.map(ol).join("|"),U=A[0]?.toolCallId??"",Q=k.map(rl).join("|");let q,Y;t[25]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ua,{}),Y=s.jsx(Xa,{}),t[25]=q,t[26]=Y):(q=t[25],Y=t[26]);let se;t[27]!==n||t[28]!==e||t[29]!==C||t[30]!==z?(se=z&&s.jsx(Xe,{variant:"error",error:e,onDismiss:n,onFixInChat:C}),t[27]=n,t[28]=e,t[29]=C,t[30]=z,t[31]=se):se=t[31];let X;t[32]!==o||t[33]!==r||t[34]!==N||t[35]!==$?(X=$&&s.jsx(Xe,{variant:"warning",finishReason:r,onDismiss:o,onContinue:N}),t[32]=o,t[33]=r,t[34]=N,t[35]=$,t[36]=X):X=t[36];let te;t[37]!==Q||t[38]!==I||t[39]!==K||t[40]!==l||t[41]!==k?(te=K&&s.jsx(ja,{approvals:k,isStreaming:l,onRespond:I},Q),t[37]=Q,t[38]=I,t[39]=K,t[40]=l,t[41]=k,t[42]=te):te=t[42];let W;t[43]!==O.hasPlans||t[44]!==R||t[45]!==F||t[46]!==l||t[47]!==A||t[48]!==U?(W=O.hasPlans&&s.jsx(Na,{plans:A,isStreaming:l,onApprove:R,onDismiss:F},U),t[43]=O.hasPlans,t[44]=R,t[45]=F,t[46]=l,t[47]=A,t[48]=U,t[49]=W):W=t[49];let J;t[50]!==O.isWaitingForUserInput||t[51]!==E||t[52]!==l||t[53]!==M||t[54]!==w?(J=O.isWaitingForUserInput&&s.jsx(gs,{userAskParts:w,isStreaming:l,onSubmit:E},M),t[50]=O.isWaitingForUserInput,t[51]=E,t[52]=l,t[53]=M,t[54]=w,t[55]=J):J=t[55];let ee;return t[56]!==X||t[57]!==te||t[58]!==W||t[59]!==J||t[60]!==se?(ee=s.jsxs("div",{className:"absolute bottom-full left-0 right-0",children:[q,Y,se,X,te,W,J]}),t[56]=X,t[57]=te,t[58]=W,t[59]=J,t[60]=se,t[61]=ee):ee=t[61],ee}function rl(t){return t.approvalId}function ol(t){return t.toolCallId}function al(){document.querySelector("[data-chat-input]")?.focus()}function ll(t){return t.type==="tool-user_ask"}ht.Error=function(e){return s.jsx(Xe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};ht.Warning=function(e){return s.jsx(Xe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};ht.UserAskQuestion=gs;async function il(t,e,n){const r=await t.callTool({name:e,arguments:n});if(r.isError){const o=r.content?.[0]?.text??`Tool ${e} failed without a message`;throw new Error(o)}return r}const ys=["SANDBOX_START"],Qe=new Map,cl=t=>`${t.virtualMcpId}::${t.branch??""}`,yt=new Set,dl={mark:(t,e)=>yt.add(`${t}::${e}`),clear:(t,e)=>yt.delete(`${t}::${e}`),isStopped:(t,e)=>yt.has(`${t}::${e}`)};function ul(t){const e=ze();return Dt({mutationKey:ys,mutationFn:async n=>{n.branch&&dl.clear(n.virtualMcpId,n.branch);const r=cl(n),o=Qe.get(r);if(o)return o;const a=(async()=>(await il(t,"SANDBOX_START",n)).structuredContent)();Qe.set(r,a);try{return await a}finally{Qe.get(r)===a&&Qe.delete(r)}},onSuccess:()=>{Ws(e)}})}function Jd(t,e){const n=L.c(3);let r;return n[0]!==e||n[1]!==t?(r={mutationKey:ys,predicate:a=>{if(!t)return!1;const l=a.state.variables;return!l||l.virtualMcpId!==t?!1:(l.branch??"")===(e??"")}},n[0]=e,n[1]=t,n[2]=r):r=n[2],Fo(r)>0}const Vl={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5"},smart:{modelId:"claude-code:sonnet",label:"Sonnet 4.6"},thinking:{modelId:"claude-code:fable",label:"Fable 5"}},fl={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini"},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4"},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5"}};function ml(t){return t==="claude-code"?Vl:t==="codex"?fl:null}function fn(t,e){return ml(t)?.[e]??null}const pl={"cloud-decopilot":"decopilot","local-decopilot":"decopilot-desktop","local-claude-code":"claude-code-desktop","local-codex":"codex-desktop"},hl={decopilot:"cloud-decopilot","decopilot-desktop":"local-decopilot","claude-code-desktop":"local-claude-code","codex-desktop":"local-codex"};function xl(t){return pl[t]}function gl(t){return t===null?"cloud-decopilot":hl[t]}function As(){const t=L.c(2),{pendingAgentOption:e}=me();let n;return t[0]!==e?(n=gl(e),t[0]=e,t[1]=n):n=t[1],n}function bl(){const t=L.c(2),{setPendingAgentOption:e}=me();let n;return t[0]!==e?(n=r=>e(xl(r)),t[0]=e,t[1]=n):n=t[1],n}function vl(){return me().simpleModeTier}function yl(){return me().setSimpleModeTier}const Al={fast:"Quicker responses",smart:"Balanced quality",thinking:"Deeper reasoning"};function wl(t,e){return t==="local-claude-code"?fn("claude-code",e)?.label??null:t==="local-codex"?fn("codex",e)?.label??null:Al[e]}const jl={decopilot:"Decopilot","claude-code":"Claude Code",codex:"Codex"},Sl=dt("").icon;function et(t){const e=L.c(4),{compact:n}=t,o=(n===void 0?!1:n)?"size-3.5 rounded-sm":"size-4 rounded-sm";let a;e[0]!==o?(a=B(o),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=s.jsx(Un,{icon:Sl,name:"Decopilot",size:"2xs",className:a}),e[2]=a,e[3]=l):l=e[3],l}const Cl={mode:"cloud-decopilot",label:"Decopilot",description:"Runs in an agent sandbox",group:"cloud",icon:s.jsx(et,{}),isAvailable:t=>t.agentSandbox},Nl={mode:"local-decopilot",label:"Decopilot",description:"Runs on your desktop",group:"local",icon:s.jsx(et,{}),isAvailable:t=>t.userDesktop},kl={mode:"local-claude-code",label:"Claude Code",description:"Runs via Claude Code CLI",group:"local",icon:s.jsx(Zn,{size:16}),isAvailable:t=>t.userDesktop&&t.claudeCode},_l={mode:"local-codex",label:"Codex",description:"Runs via Codex CLI",group:"local",icon:s.jsx(Xn,{size:16}),isAvailable:t=>t.userDesktop&&t.codex},tt=[Cl,Nl,kl,_l];function Il(t,e){return tt.some(n=>n.mode===t&&n.isAvailable(e))}function El(t,e){return Il(t,e)?t:tt.find(n=>n.isAvailable(e))?.mode??t}function Rl(t){return t==="local-decopilot"?{icon:s.jsx(et,{compact:!0}),text:"Decopilot"}:t==="local-claude-code"?{icon:s.jsx(Zn,{size:14}),text:"Claude Code"}:t==="local-codex"?{icon:s.jsx(Xn,{size:14}),text:"Codex"}:{icon:s.jsx(et,{compact:!0}),text:"Cloud"}}const Tl="text-muted-foreground hover:text-foreground text-xs transition-[gap] duration-200",Pl="text-success hover:text-success";function Dl(t){const e=L.c(81),{mode:n,availability:r,locked:o,lockedHarness:a,onSelect:l,onConnectDesktop:c}=t,[i,u]=S.useState(!1);let V;e[0]!==n?(V=Rl(n),e[0]=n,e[1]=V):V=e[1];const{icon:d,text:m}=V,f=n!=="cloud-decopilot",x=o&&a!=null,h=a?jl[a]:null;let p,b,g,v,y,w,A,k,j,C,P,N,T;if(e[2]!==r||e[3]!==h||e[4]!==d||e[5]!==f||e[6]!==x||e[7]!==o||e[8]!==n||e[9]!==c||e[10]!==l||e[11]!==i||e[12]!==m){let F;e[26]!==r?(F=ne=>ne.group==="cloud"&&ne.isAvailable(r),e[26]=r,e[27]=F):F=e[27];const D=tt.filter(F),I=tt.filter(Ml);let O;e[28]!==l?(O=ne=>{l(ne),u(!1)},e[28]=l,e[29]=O):O=e[29];const z=O;let $;e[30]!==c?($=()=>{u(!1),c?.()},e[30]=c,e[31]=$):$=e[31];const K=$;b=zt,g=i,v=o?void 0:u;const M=x&&h?`This chat is using ${h}. Start a new chat to use a different runtime.`:m,U=x?"harness-picker-locked":"harness-picker",Q=f&&Pl,q=o?"gap-0":"gap-0 @[320px]/chat-bottom:gap-1.5";let Y;e[32]!==Q||e[33]!==q?(Y=B(Tl,Q,"shrink min-w-0",q),e[32]=Q,e[33]=q,e[34]=Y):Y=e[34];const se=!o&&"@[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100";let X;e[35]!==se?(X=B("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0",se),e[35]=se,e[36]=X):X=e[36];let te;e[37]!==X||e[38]!==m?(te=s.jsx("span",{className:X,children:m}),e[37]=X,e[38]=m,e[39]=te):te=e[39];let W;e[40]!==o?(W=!o&&s.jsx(ft,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[40]=o,e[41]=W):W=e[41];let J;e[42]!==d||e[43]!==o||e[44]!==M||e[45]!==U||e[46]!==Y||e[47]!==te||e[48]!==W?(J=s.jsx(ge,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Bt,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"ghost",size:"default","aria-label":M,disabled:o,"data-testid":U,className:Y,children:[d,te,W]})})})}),e[42]=d,e[43]=o,e[44]=M,e[45]=U,e[46]=Y,e[47]=te,e[48]=W,e[49]=J):J=e[49];const ee=x&&h?`This chat is using ${h}. Start a new chat to use a different runtime.`:m;let Z;e[50]!==ee?(Z=s.jsx(be,{children:ee}),e[50]=ee,e[51]=Z):Z=e[51],e[52]!==J||e[53]!==Z?(y=s.jsxs(ve,{children:[J,Z]}),e[52]=J,e[53]=Z,e[54]=y):y=e[54],p=Ut,N="start",T="p-1 w-64",w="menu",A="flex flex-col",k=D.length>0&&s.jsx(mn,{title:"Cloud"});let oe;e[55]!==z||e[56]!==n?(oe=ne=>s.jsx(pn,{row:ne,active:n===ne.mode,onSelect:z},ne.mode),e[55]=z,e[56]=n,e[57]=oe):oe=e[57],j=D.map(oe),C=I.length>0&&s.jsx(mn,{title:"Local",variant:"success",icon:s.jsx(Wn,{size:12,"data-testid":"local-section-desktop-icon"}),testId:"local-section-header"});let H;e[58]!==r||e[59]!==K||e[60]!==z||e[61]!==n?(H=ne=>{const de=ne.isAvailable(r);return s.jsx(pn,{row:ne,active:de&&n===ne.mode,onSelect:z,unavailableHint:de?void 0:r.userDesktop?"Not detected on your desktop":"Connect your desktop to enable",onUnavailableClick:K},ne.mode)},e[58]=r,e[59]=K,e[60]=z,e[61]=n,e[62]=H):H=e[62],P=I.map(H),e[2]=r,e[3]=h,e[4]=d,e[5]=f,e[6]=x,e[7]=o,e[8]=n,e[9]=c,e[10]=l,e[11]=i,e[12]=m,e[13]=p,e[14]=b,e[15]=g,e[16]=v,e[17]=y,e[18]=w,e[19]=A,e[20]=k,e[21]=j,e[22]=C,e[23]=P,e[24]=N,e[25]=T}else p=e[13],b=e[14],g=e[15],v=e[16],y=e[17],w=e[18],A=e[19],k=e[20],j=e[21],C=e[22],P=e[23],N=e[24],T=e[25];let E;e[63]!==w||e[64]!==A||e[65]!==k||e[66]!==j||e[67]!==C||e[68]!==P?(E=s.jsxs("div",{role:w,className:A,children:[k,j,C,P]}),e[63]=w,e[64]=A,e[65]=k,e[66]=j,e[67]=C,e[68]=P,e[69]=E):E=e[69];let _;e[70]!==p||e[71]!==E||e[72]!==N||e[73]!==T?(_=s.jsx(p,{align:N,className:T,children:E}),e[70]=p,e[71]=E,e[72]=N,e[73]=T,e[74]=_):_=e[74];let R;return e[75]!==b||e[76]!==g||e[77]!==v||e[78]!==y||e[79]!==_?(R=s.jsxs(b,{open:g,onOpenChange:v,children:[y,_]}),e[75]=b,e[76]=g,e[77]=v,e[78]=y,e[79]=_,e[80]=R):R=e[80],R}function Ml(t){return t.group==="local"}function mn(t){const e=L.c(9),{title:n,variant:r,icon:o,testId:a}=t,c=(r===void 0?"muted":r)==="success"?"bg-success/10 text-success":"text-muted-foreground";let i;e[0]!==c?(i=B("inline-flex w-fit items-center gap-2 mx-1 mt-2 mb-1 px-1.5 py-0.5 rounded text-[10px] font-medium uppercase tracking-wide",c),e[0]=c,e[1]=i):i=e[1];let u;e[2]!==n?(u=s.jsx("span",{children:n}),e[2]=n,e[3]=u):u=e[3];let V;return e[4]!==o||e[5]!==i||e[6]!==u||e[7]!==a?(V=s.jsxs("div",{"data-testid":a,className:i,children:[o,u]}),e[4]=o,e[5]=i,e[6]=u,e[7]=a,e[8]=V):V=e[8],V}function pn(t){const e=L.c(25),{row:n,active:r,onSelect:o,unavailableHint:a,onUnavailableClick:l}=t,c=a!=null,i=c||void 0;let u;e[0]!==o||e[1]!==l||e[2]!==n.mode||e[3]!==c?(u=()=>c?l?.():o(n.mode),e[0]=o,e[1]=l,e[2]=n.mode,e[3]=c,e[4]=u):u=e[4];const V=c&&"opacity-60";let d;e[5]!==V?(d=B("flex items-start gap-2 px-2 py-1.5 rounded-md text-left","hover:bg-muted",V),e[5]=V,e[6]=d):d=e[6];let m;e[7]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:n.icon}),e[7]=n.icon,e[8]=m):m=e[8];let f;e[9]!==n.label?(f=s.jsx("div",{className:"text-sm",children:n.label}),e[9]=n.label,e[10]=f):f=e[10];const x=a??n.description;let h;e[11]!==x?(h=s.jsx("div",{className:"text-xs text-muted-foreground",children:x}),e[11]=x,e[12]=h):h=e[12];let p;e[13]!==f||e[14]!==h?(p=s.jsxs("div",{className:"flex-1",children:[f,h]}),e[13]=f,e[14]=h,e[15]=p):p=e[15];let b;e[16]!==r?(b=r&&s.jsx(Ke,{size:14,className:"text-foreground mt-0.5"}),e[16]=r,e[17]=b):b=e[17];let g;return e[18]!==i||e[19]!==b||e[20]!==u||e[21]!==d||e[22]!==m||e[23]!==p?(g=s.jsxs("button",{type:"button",role:"menuitem","aria-disabled":i,onClick:u,className:d,children:[m,p,b]}),e[18]=i,e[19]=b,e[20]=u,e[21]=d,e[22]=m,e[23]=p,e[24]=g):g=e[24],g}function Fl(t){const e=L.c(23),{locked:n,currentBranch:r,virtualMcpId:o}=t,a=As(),l=bl(),{org:c}=ie();let i;e[0]!==c.id||e[1]!==c.slug?(i={connectionId:ut,orgId:c.id,orgSlug:c.slug},e[0]=c.id,e[1]=c.slug,e[2]=i):i=e[2];const u=ue(i),V=ul(u),m=Ue()?.lockedHarness??null,f=Sr();let x;e[3]!==f||e[4]!==a?(x=El(a,f),e[3]=f,e[4]=a,e[5]=x):x=e[5];const h=x,[p,b]=S.useState(!1);let g;e[6]!==r||e[7]!==l||e[8]!==V||e[9]!==o?(g=j=>{l(j),G("agent_mode_selected",{mode:j}),r&&V.mutate({virtualMcpId:o,branch:r,sandboxProviderKind:j==="cloud-decopilot"?"agent-sandbox":"user-desktop"})},e[6]=r,e[7]=l,e[8]=V,e[9]=o,e[10]=g):g=e[10];const v=g;let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{G("agent_mode_connect_desktop_opened"),b(!0)},e[11]=y):y=e[11];let w;e[12]!==f||e[13]!==v||e[14]!==n||e[15]!==m||e[16]!==h?(w=s.jsx(Dl,{mode:h,availability:f,locked:n,lockedHarness:m,onSelect:v,onConnectDesktop:y}),e[12]=f,e[13]=v,e[14]=n,e[15]=m,e[16]=h,e[17]=w):w=e[17];let A;e[18]!==p?(A=s.jsx(Jn,{open:p,onOpenChange:b}),e[18]=p,e[19]=A):A=e[19];let k;return e[20]!==w||e[21]!==A?(k=s.jsxs(s.Fragment,{children:[w,A]}),e[20]=w,e[21]=A,e[22]=k):k=e[22],k}const hn=["amber","bold","bright","calm","crimson","coral","daring","deep","dusty","eager","faint","fierce","frozen","gentle","golden","grand","green","hollow","iron","ivory","keen","lasting","lunar","mellow","misty","noble","olive","pale","prime","quiet","rapid","rustic","serene","sharp","silver","sleek","solar","stark","still","swift","tawny","tender","thin","true","vast","velvet","warm","wild","young","zen"],xn=["anchor","birch","brook","cedar","cliff","cove","crane","dune","echo","ember","falcon","fern","flint","forge","frost","glade","grove","harbor","hawk","iris","jade","lark","maple","marsh","mesa","opal","orbit","peak","pine","plume","quartz","rapids","reef","ridge","river","sage","shore","slate","spruce","stone","summit","thorn","tide","trail","vale","wren","aspen","delta","crest","spark"];function Ol(){const t=hn[Math.floor(Math.random()*hn.length)],e=xn[Math.floor(Math.random()*xn.length)];return`deco/${t}-${e}`}const Ge=100;function Ll(t,e,n){const r=e.trim().toLowerCase();return r?(t??[]).some(o=>o.branches.some(a=>typeof a.name=="string"&&!n.has(a.name)&&a.name.toLowerCase().includes(r))):!0}function $l(t,e){const n=e.trim().toLowerCase();return n?[...t].some(r=>r.toLowerCase().includes(n)):!0}function zl(t){const e=t;if(e.structuredContent)return e.structuredContent;const n=e.content?.find(r=>r.type==="text")?.text;if(n)try{return JSON.parse(n)}catch{return[]}return[]}function Bl(t){const e=L.c(48),{orgId:n,orgSlug:r,userId:o,connectionId:a,sandboxMap:l,owner:c,repo:i,enabled:u}=t,V=u===void 0?!0:u,d=a??null;let m;e[0]!==n||e[1]!==r||e[2]!==d?(m={connectionId:d,orgId:n,orgSlug:r},e[0]=n,e[1]=r,e[2]=d,e[3]=m):m=e[3];const f=ue(m);let x;e[4]!==a||e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==i?(x=Js.githubBranches(n,r,a,c,i),e[4]=a,e[5]=n,e[6]=r,e[7]=c,e[8]=i,e[9]=x):x=e[9];const h=V&&!!a&&!!c&&!!i;let p;e[10]!==f||e[11]!==c||e[12]!==i?(p=async $=>{const{pageParam:K,signal:M}=$,U=Number(K),Q=await f.callTool({name:"list_branches",arguments:{owner:c,repo:i,page:U,perPage:Ge}},void 0,{signal:M}),q=zl(Q);return{branches:Array.isArray(q)?q:q.branches??[],default_branch:Array.isArray(q)?null:q.default_branch??null,page:U}},e[10]=f,e[11]=c,e[12]=i,e[13]=p):p=e[13];let b;e[14]!==x||e[15]!==h||e[16]!==p?(b={queryKey:x,enabled:h,staleTime:3e4,retry:!1,initialPageParam:1,queryFn:p,getNextPageParam:Hl},e[14]=x,e[15]=h,e[16]=p,e[17]=b):b=e[17];const{data:g,isLoading:v,isError:y,hasNextPage:w,isFetchingNextPage:A,fetchNextPage:k}=bo(b);let j,C;e[18]!==l||e[19]!==o?(C=new Set(Object.keys(l?.[o]??{})),j=[...C].sort().map(Yl),e[18]=l,e[19]=o,e[20]=j,e[21]=C):(j=e[20],C=e[21]);const P=j;let N;if(e[22]!==g?.pages){const $=new Map;for(const M of g?.pages??[])for(const U of M.branches)typeof U.name=="string"&&$.set(U.name,U);N=[...$.values()].filter(Ql),e[22]=g?.pages,e[23]=N}else N=e[23];let T;e[24]!==N||e[25]!==C?(T=N.filter($=>!C.has($.name)).map(ql),e[24]=N,e[25]=C,e[26]=T):T=e[26];const E=T;let _;e[27]!==g?.pages?(_=g?.pages.find(Kl)?.default_branch??null,e[27]=g?.pages,e[28]=_):_=e[28];const R=_;let F;e[29]!==g?.pages||e[30]!==k||e[31]!==A||e[32]!==C?(F=async($,K)=>{const M=K===void 0?Ul:K;if(!M()||$l(C,$)||A)return;let U=g?.pages??[];for(;M()&&!Ll(U,$,C)&&(U.at(-1)?.branches.length??Ge)>=Ge;){const Q=await k();if(!M())break;const q=Q.data?.pages??U;if(q.length===U.length)break;U=q}},e[29]=g?.pages,e[30]=k,e[31]=A,e[32]=C,e[33]=F):F=e[33];const D=F,I=w??!1;let O;e[34]!==k||e[35]!==w||e[36]!==A?(O=()=>{w&&!A&&k()},e[34]=k,e[35]=w,e[36]=A,e[37]=O):O=e[37];let z;return e[38]!==R||e[39]!==D||e[40]!==y||e[41]!==A||e[42]!==v||e[43]!==E||e[44]!==I||e[45]!==O||e[46]!==P?(z={yours:P,others:E,defaultBase:R,isLoading:v,isError:y,hasMore:I,isFetchingMore:A,fetchMore:O,fetchUntilMatch:D},e[38]=R,e[39]=D,e[40]=y,e[41]=A,e[42]=v,e[43]=E,e[44]=I,e[45]=O,e[46]=P,e[47]=z):z=e[47],z}function Ul(){return!0}function Kl(t){return t.default_branch}function ql(t){return{name:t.name,source:"other",author:typeof t.commit?.author=="string"?t.commit.author:t.commit?.author?.login??null}}function Ql(t){return typeof t.name=="string"}function Yl(t){return{name:t,source:"yours"}}function Hl(t){if(!(t.branches.length<Ge))return t.page+1}function Gl(t){const e=L.c(85),{orgId:n,orgSlug:r,userId:o,connectionId:a,owner:l,repo:c,sandboxMap:i,value:u,onChange:V,disabled:d,placement:m}=t,f=d===void 0?!1:d,h=(m===void 0?"chat":m)==="header",[p,b]=S.useState(!1),[g,v]=S.useState(""),[y,w]=S.useState(!1),A=S.useRef(0);let k;e[0]!==a||e[1]!==p||e[2]!==n||e[3]!==r||e[4]!==l||e[5]!==c||e[6]!==i||e[7]!==o?(k={orgId:n,orgSlug:r,userId:o,connectionId:a,sandboxMap:i,owner:l,repo:c,enabled:p},e[0]=a,e[1]=p,e[2]=n,e[3]=r,e[4]=l,e[5]=c,e[6]=i,e[7]=o,e[8]=k):k=e[8];const{yours:j,others:C,isLoading:P,isError:N,hasMore:T,isFetchingMore:E,fetchMore:_,fetchUntilMatch:R}=Bl(k);let F;e[9]!==V?(F=ae=>{V(ae),b(!1)},e[9]=V,e[10]=F):F=e[10];const D=F,I=u??"Select branch…";let O;e[11]!==R?(O=ae=>{v(ae),A.current=A.current+1;const Ne=A.current,xt=ae.trim();if(!xt){w(!1);return}w(!0),R(xt,()=>Ne===A.current).finally(()=>{Ne===A.current&&w(!1)})},e[11]=R,e[12]=O):O=e[12];const z=O;let $;e[13]!==_?($=ae=>{const Ne=ae.currentTarget;Ne.scrollHeight-Ne.scrollTop-Ne.clientHeight<48&&_()},e[13]=_,e[14]=$):$=e[14];const K=$,M=f?void 0:b,U=h?"outline":"ghost",Q=h?"sm":"default";let q;e[15]!==f||e[16]!==h?(q=B("font-mono shrink min-w-0 max-w-[200px]",h?"gap-1.5 text-xs":B("text-xs text-muted-foreground hover:text-foreground transition-[gap] duration-200",f?"gap-0":"gap-0 @[320px]/chat-bottom:gap-1.5")),e[15]=f,e[16]=h,e[17]=q):q=e[17];let Y;e[18]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(He,{className:"h-3.5 w-3.5 shrink-0"}),e[18]=Y):Y=e[18];let se;e[19]!==f||e[20]!==h?(se=B("min-w-0 truncate",h?"":B("transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0",!f&&"@[320px]/chat-bottom:max-w-[200px] @[320px]/chat-bottom:opacity-100")),e[19]=f,e[20]=h,e[21]=se):se=e[21];let X;e[22]!==I||e[23]!==se?(X=s.jsx("span",{className:se,children:I}),e[22]=I,e[23]=se,e[24]=X):X=e[24];let te;e[25]!==f||e[26]!==h?(te=!f&&s.jsx(ft,{size:12,className:B("opacity-60 shrink-0",h?"":"hidden @[320px]/chat-bottom:inline-block")}),e[25]=f,e[26]=h,e[27]=te):te=e[27];let W;e[28]!==f||e[29]!==I||e[30]!==q||e[31]!==X||e[32]!==te||e[33]!==U||e[34]!==Q?(W=s.jsx(ge,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Bt,{asChild:!0,children:s.jsxs(re,{variant:U,size:Q,"aria-label":I,disabled:f,className:q,children:[Y,X,te]})})})}),e[28]=f,e[29]=I,e[30]=q,e[31]=X,e[32]=te,e[33]=U,e[34]=Q,e[35]=W):W=e[35];let J;e[36]!==I?(J=s.jsx(be,{children:I}),e[36]=I,e[37]=J):J=e[37];let ee;e[38]!==W||e[39]!==J?(ee=s.jsxs(ve,{children:[W,J]}),e[38]=W,e[39]=J,e[40]=ee):ee=e[40];let Z;e[41]!==z||e[42]!==g?(Z=s.jsx(po,{placeholder:"Search loaded branches…",value:g,onValueChange:z}),e[41]=z,e[42]=g,e[43]=Z):Z=e[43];let oe;e[44]!==D?(oe=s.jsx(re,{variant:"outline",size:"sm",className:"h-7 shrink-0",onClick:()=>D(Ol()),children:"New"}),e[44]=D,e[45]=oe):oe=e[45];let H;e[46]!==Z||e[47]!==oe?(H=s.jsxs("div",{className:"*:data-[slot=command-input-wrapper]:flex-1 *:data-[slot=command-input-wrapper]:border-b-0 flex items-center border-b pr-2",children:[Z,oe]}),e[46]=Z,e[47]=oe,e[48]=H):H=e[48];let ne;e[49]!==N?(ne=N&&s.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"Couldn't load branches from GitHub. You can still pick from your branches."}),e[49]=N,e[50]=ne):ne=e[50];let de;e[51]!==T||e[52]!==N||e[53]!==P?(de=!N&&!P&&s.jsx(ho,{children:T?"Looking through more branches...":"No branches found."}),e[51]=T,e[52]=N,e[53]=P,e[54]=de):de=e[54];let ye;e[55]!==D||e[56]!==j?(ye=j.length>0&&s.jsx(Zt,{heading:"Your branches",children:j.map(ae=>s.jsxs(Xt,{value:ae.name,onSelect:()=>D(ae.name),children:[s.jsx(He,{className:"mr-2 h-4 w-4"}),s.jsx("span",{className:"flex-1 truncate",children:ae.name})]},ae.name))}),e[55]=D,e[56]=j,e[57]=ye):ye=e[57];let Ae;e[58]!==C||e[59]!==D?(Ae=C.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(mo,{}),s.jsx(Zt,{heading:"Other branches in repo",children:C.map(ae=>s.jsxs(Xt,{value:ae.name,onSelect:()=>D(ae.name),children:[s.jsx(He,{className:"mr-2 h-4 w-4"}),s.jsx("span",{className:"flex-1 truncate",children:ae.name}),ae.author&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",ae.author]})]},ae.name))})]}),e[58]=C,e[59]=D,e[60]=Ae):Ae=e[60];let we;e[61]!==_||e[62]!==T||e[63]!==E||e[64]!==y?(we=T&&s.jsx("div",{className:"border-t p-2",children:s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:E,onClick:_,children:E||y?"Loading more…":"Load more branches"})}),e[61]=_,e[62]=T,e[63]=E,e[64]=y,e[65]=we):we=e[65];let je;e[66]!==T||e[67]!==C.length?(je=!T&&C.length>0&&s.jsx("div",{className:"border-t p-2 text-center text-xs text-muted-foreground",children:"All loaded"}),e[66]=T,e[67]=C.length,e[68]=je):je=e[68];let Se;e[69]!==K||e[70]!==ne||e[71]!==de||e[72]!==ye||e[73]!==Ae||e[74]!==we||e[75]!==je?(Se=s.jsxs(xo,{onScroll:K,children:[ne,de,ye,Ae,we,je]}),e[69]=K,e[70]=ne,e[71]=de,e[72]=ye,e[73]=Ae,e[74]=we,e[75]=je,e[76]=Se):Se=e[76];let Ce;e[77]!==H||e[78]!==Se?(Ce=s.jsx(Ut,{className:"w-[min(420px,calc(100vw-2rem))] p-0",align:"start",children:s.jsxs(go,{children:[H,Se]})}),e[77]=H,e[78]=Se,e[79]=Ce):Ce=e[79];let qe;return e[80]!==p||e[81]!==ee||e[82]!==Ce||e[83]!==M?(qe=s.jsxs(zt,{open:p,onOpenChange:M,children:[ee,Ce]}),e[80]=p,e[81]=ee,e[82]=Ce,e[83]=M,e[84]=qe):qe=e[84],qe}function Wl(t){const e=L.c(24);let n,r,o;e[0]!==t?({locked:n,placement:r,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const a=Ue(),l=a?.isThreadLocked??!1,c=a?.lockedBranch??null,i=r==="header";if(l){const V=c??"(no branch)",d=i?"h-8 border border-input bg-background px-2.5":"h-9 px-2";let m;e[4]!==d?(m=B("inline-flex items-center gap-1.5 rounded-md font-mono text-xs","text-muted-foreground cursor-default min-w-0 max-w-[200px]",d),e[4]=d,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(He,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),e[6]=f):f=e[6];const x=i?"":"transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:max-w-[160px] @[320px]/chat-bottom:opacity-100";let h;e[7]!==x?(h=B("min-w-0 truncate",x),e[7]=x,e[8]=h):h=e[8];let p;e[9]!==V||e[10]!==h?(p=s.jsx("span",{className:h,children:V}),e[9]=V,e[10]=h,e[11]=p):p=e[11];let b;e[12]!==m||e[13]!==p?(b=s.jsx(ge,{asChild:!0,children:s.jsxs("span",{"data-testid":"branch-picker-locked","aria-disabled":"true",className:m,children:[f,p]})}),e[12]=m,e[13]=p,e[14]=b):b=e[14];let g;e[15]!==V?(g=s.jsxs(be,{children:["This chat is using branch ",V,". Start a new chat to use a different branch."]}),e[15]=V,e[16]=g):g=e[16];let v;return e[17]!==b||e[18]!==g?(v=s.jsxs(ve,{children:[b,g]}),e[17]=b,e[18]=g,e[19]=v):v=e[19],v}let u;return e[20]!==n||e[21]!==r||e[22]!==o?(u=s.jsx(Gl,{...o,disabled:n,placement:r}),e[20]=n,e[21]=r,e[22]=o,e[23]=u):u=e[23],u}function Jl(t){const e=L.c(3),{branchPill:n,modePicker:r}=t;if(!n&&!r)return null;let o;return e[0]!==n||e[1]!==r?(o=s.jsxs(s.Fragment,{children:[r,n]}),e[0]=n,e[1]=r,e[2]=o):o=e[2],o}function Zl(t){const e=L.c(22),{virtualMcp:n,currentBranch:r}=t,o=On(),a=Ue();let l;e[0]!==o?.messages||e[1]!==a?.isThreadLocked?(l=(o?.messages??[]).length>0||(a?.isThreadLocked??!1),e[0]=o?.messages,e[1]=a?.isThreadLocked,e[2]=l):l=e[2];const c=l,i=a?.setCurrentTaskBranch;let u;e[3]!==n?(u=ts(n),e[3]=n,e[4]=u):u=e[4];const V=u,d=V?.connectionId,{data:m}=Tn.useSession(),f=m?.user?.id??"",{org:x}=ie();let h;e[5]!==d||e[6]!==r||e[7]!==V||e[8]!==c||e[9]!==x||e[10]!==i||e[11]!==f||e[12]!==n?.id||e[13]!==n?.metadata?.sandboxMap?(h=V&&d?s.jsx(Wl,{orgId:x.id,orgSlug:x.slug,userId:f,virtualMcpId:n?.id??"",connectionId:d,owner:V.owner,repo:V.name,sandboxMap:n?.metadata?.sandboxMap,value:r,onChange:w=>{i&&i(w)},locked:c,placement:"chat"}):null,e[5]=d,e[6]=r,e[7]=V,e[8]=c,e[9]=x,e[10]=i,e[11]=f,e[12]=n?.id,e[13]=n?.metadata?.sandboxMap,e[14]=h):h=e[14];const p=h,b=n?.id??"";let g;e[15]!==r||e[16]!==c||e[17]!==b?(g=s.jsx(Fl,{locked:c,currentBranch:r,virtualMcpId:b}),e[15]=r,e[16]=c,e[17]=b,e[18]=g):g=e[18];const v=g;let y;return e[19]!==p||e[20]!==v?(y=s.jsx(Jl,{branchPill:p,modePicker:v}),e[19]=p,e[20]=v,e[21]=y):y=e[21],y}const Xl=["fast","smart","thinking"],Re={fast:"Fast",smart:"Smart",thinking:"Thinking"};function ei(t){const e=L.c(30),{tier:n,subtitleFor:r,iconFor:o,onSelect:a}=t,[l,c]=S.useState(!1);let i;e[0]!==a?(i=j=>{a(j),c(!1)},e[0]=a,e[1]=i):i=e[1];const u=i,V=Re[n];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=B("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[2]=d):d=e[2];let m;e[3]!==o||e[4]!==n?(m=o?.(n),e[3]=o,e[4]=n,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=B("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[6]=f):f=e[6];const x=Re[n];let h;e[7]!==x?(h=s.jsx("span",{className:f,children:x}),e[7]=x,e[8]=h):h=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ft,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[9]=p):p=e[9];let b;e[10]!==V||e[11]!==m||e[12]!==h?(b=s.jsx(ge,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Bt,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"ghost",size:"default","aria-label":V,className:d,children:[m,h,p]})})})}),e[10]=V,e[11]=m,e[12]=h,e[13]=b):b=e[13];const g=Re[n];let v;e[14]!==g?(v=s.jsx(be,{children:g}),e[14]=g,e[15]=v):v=e[15];let y;e[16]!==v||e[17]!==b?(y=s.jsxs(ve,{children:[b,v]}),e[16]=v,e[17]=b,e[18]=y):y=e[18];let w;e[19]!==u||e[20]!==o||e[21]!==r||e[22]!==n?(w=Xl.map(j=>{const C=r(j),P=o?.(j),N=j===n;return s.jsxs("button",{type:"button",role:"menuitem","aria-label":Re[j],onClick:()=>u(j),className:B("flex items-start gap-2 px-2 py-1.5 rounded-md text-left","hover:bg-muted"),children:[P&&s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:P}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-sm",children:Re[j]}),C&&s.jsx("div",{className:"text-xs text-muted-foreground",children:C})]}),N&&s.jsx(Ke,{size:14,className:"text-foreground mt-0.5"})]},j)}),e[19]=u,e[20]=o,e[21]=r,e[22]=n,e[23]=w):w=e[23];let A;e[24]!==w?(A=s.jsx(Ut,{align:"end",className:"p-1 w-56",children:s.jsx("div",{role:"menu",className:"flex flex-col",children:w})}),e[24]=w,e[25]=A):A=e[25];let k;return e[26]!==l||e[27]!==y||e[28]!==A?(k=s.jsxs(zt,{open:l,onOpenChange:c,children:[y,A]}),e[26]=l,e[27]=y,e[28]=A,e[29]=k):k=e[29],k}function ti(t){return t==="fast"?s.jsx(Qr,{size:16}):t==="thinking"?s.jsx(Yr,{size:16}):s.jsx(yo,{size:16})}function ni(){const t=L.c(6),e=vl(),n=yl(),r=As();let o;t[0]!==r?(o=c=>wl(r,c),t[0]=r,t[1]=o):o=t[1];const a=o;let l;return t[2]!==n||t[3]!==a||t[4]!==e?(l=s.jsx(ei,{tier:e,subtitleFor:a,iconFor:ti,onSelect:n}),t[2]=n,t[3]=a,t[4]=e,t[5]=l):l=t[5],l}async function Qt(t,e,n,r,o){if(!pt(e)){le.error("Selected model does not support file uploads");return}const a=n.type||"application/octet-stream";if(!uo(a,e)){const c=es(e),i=e?.title??"This model";o?o({fileName:n.name,modelName:i,accepted:c}):le.error(`"${n.name}" can't be attached`,{description:`${i} accepts ${c}.`});return}const l=10*1024*1024;if(n.size>l){le.error(`File "${n.name}" exceeds 10MB limit`);return}try{const c=new FileReader,i=new Promise((d,m)=>{c.onload=()=>{const f=c.result;if(typeof f!="string"){m(new Error("Failed to read file as data URL"));return}const x=f.includes(",")?f.split(",")[1]??f:f;d(x)},c.onerror=m});c.readAsDataURL(n);const u=await i,V={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:u};pr(t,{from:r,to:r},V)}catch(c){console.error("Failed to process file:",c),le.error(`Failed to load file "${n.name}"`)}}function si(t){const e=L.c(8),{editor:n,selectedModel:r,onUnsupportedFile:o}=t,a=S.useRef(oi);let l,c;e[0]!==n||e[1]!==o||e[2]!==r?(l=()=>{a.current=async(V,d)=>{await Qt(n,r,V,d,o)}},c=[n,r,o],e[0]=n,e[1]=o,e[2]=r,e[3]=l,e[4]=c):(l=e[3],c=e[4]),S.useEffect(l,c);let i,u;return e[5]!==n?(i=()=>{if(n?.isDestroyed)return;const V=new It("fileDropHandler");n.state.plugins.find(f=>f.spec.key===V)&&n.unregisterPlugin(V);const m=new Ao({key:V,props:{handleDrop:(f,x,h,p)=>{if(p)return!1;const b=x.dataTransfer?.files;if(!b||b.length===0)return!1;x.preventDefault();const g=f.posAtCoords({left:x.clientX,top:x.clientY});if(!g)return!1;const v=Array.from(b),y=g.pos;for(const w of v)a.current?.(w,y);return!0},handlePaste:(f,x)=>{const h=x.clipboardData?.items;if(!h)return!1;const p=Array.from(h).filter(ri);if(p.length===0)return!1;x.preventDefault();const{from:b}=f.state.selection;for(const g of p){const v=g.getAsFile();v&&a.current?.(v,b)}return!0}}});return n.registerPlugin(m),()=>{n?.isDestroyed||n.unregisterPlugin(V)}},u=[n],e[5]=n,e[6]=i,e[7]=u):(i=e[6],u=e[7]),S.useEffect(i,u),null}function ri(t){return t.kind==="file"}function oi(){return Promise.resolve()}function ai(t){const e=L.c(26),{info:n,onClose:r}=t,o=n!==null;let a;e[0]!==r?(a=w=>!w&&r(),e[0]=r,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=l):l=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:l.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=c):c=e[3];let i,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-amber-500/15 text-amber-600 dark:text-amber-400",children:s.jsx(Rn,{size:18})}),u=s.jsx(lt,{className:"text-xl font-semibold tracking-tight",children:"File type not supported"}),e[4]=i,e[5]=u):(i=e[4],u=e[5]);const V=n?.fileName;let d;e[6]!==V?(d=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[c,s.jsxs(at,{className:"relative gap-4",children:[i,s.jsxs("div",{children:[u,s.jsxs(Ft,{className:"mt-1.5 text-sm leading-relaxed",children:[s.jsxs("span",{className:"font-medium text-foreground",children:["“",V,"”"]})," ","can't be attached to this chat."]})]})]})]}),e[6]=V,e[7]=d):d=e[7];const m=n?.modelName;let f;e[8]!==m?(f=s.jsxs("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:[m," accepts"]}),e[8]=m,e[9]=f):f=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Hr,{size:14,className:"text-muted-foreground"}),e[10]=x):x=e[10];const h=n?.accepted;let p;e[11]!==h?(p=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[x,s.jsx("span",{className:"capitalize",children:h})]}),e[11]=h,e[12]=p):p=e[12];let b;e[13]!==f||e[14]!==p?(b=s.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:s.jsxs("div",{className:"rounded-xl border border-border p-4",children:[f,p]})}),e[13]=f,e[14]=p,e[15]=b):b=e[15];let g;e[16]!==r?(g=s.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:s.jsx(re,{onClick:r,children:"Got it"})}),e[16]=r,e[17]=g):g=e[17];let v;e[18]!==b||e[19]!==g||e[20]!==d?(v=s.jsxs(it,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:li,children:[d,b,g]}),e[18]=b,e[19]=g,e[20]=d,e[21]=v):v=e[21];let y;return e[22]!==o||e[23]!==v||e[24]!==a?(y=s.jsx(ct,{open:o,onOpenChange:a,children:v}),e[22]=o,e[23]=v,e[24]=a,e[25]=y):y=e[25],y}function li(t){return t.preventDefault()}function ii(){const t=L.c(3),[e,n]=S.useState(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>n(null),t[0]=r):r=t[0];let o;return t[1]!==e?(o={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:r},t[1]=e,t[2]=o):o=t[2],o}var ci=wo;var di=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Et=di.join(","),ws=typeof Element>"u",Le=ws?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,nt=!ws&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},st=function(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),a=o===""||o==="true",l=a||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):st(e.parentNode));return l},ui=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},Vi=function(e,n,r){if(st(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Et));return n&&Le.call(e,Et)&&o.unshift(e),o=o.filter(r),o},Rt=function(e,n,r){for(var o=[],a=Array.from(e);a.length;){var l=a.shift();if(!st(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),i=c.length?c:l.children,u=Rt(i,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else{var V=Le.call(l,Et);V&&r.filter(l)&&(n||!e.includes(l))&&o.push(l);var d=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),m=!st(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(d&&m){var f=Rt(d===!0?l.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else a.unshift.apply(a,l.children)}}return o},js=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ss=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ui(e))&&!js(e)?0:e.tabIndex},fi=function(e,n){var r=Ss(e);return r<0&&n&&!js(e)?0:r},mi=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Cs=function(e){return e.tagName==="INPUT"},pi=function(e){return Cs(e)&&e.type==="hidden"},hi=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},xi=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},gi=function(e){if(!e.name)return!0;var n=e.form||nt(e),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(e.name));else try{o=r(e.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var a=xi(o,e.form);return!a||a===e},bi=function(e){return Cs(e)&&e.type==="radio"},vi=function(e){return bi(e)&&!gi(e)},yi=function(e){var n,r=e&&nt(e),o=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==e){var l,c,i;for(a=!!((l=o)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(o)||e!=null&&(i=e.ownerDocument)!==null&&i!==void 0&&i.contains(e));!a&&o;){var u,V,d;r=nt(o),o=(u=r)===null||u===void 0?void 0:u.host,a=!!((V=o)!==null&&V!==void 0&&(d=V.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return a},gn=function(e){var n=e.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Ai=function(e,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var a=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(e).visibility==="hidden")return!0;var l=Le.call(e,"details>summary:first-of-type"),c=l?e.parentElement:e;if(Le.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var i=e;e;){var u=e.parentElement,V=nt(e);if(u&&!u.shadowRoot&&o(u)===!0)return gn(e);e.assignedSlot?e=e.assignedSlot:!u&&V!==e.ownerDocument?e=V.host:e=u}e=i}if(yi(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return gn(e);return!1},wi=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Le.call(n,"fieldset[disabled] *")?!0:!o.contains(e)}return!0}n=n.parentElement}return!1},ji=function(e,n){return!(n.disabled||pi(n)||Ai(n,e)||hi(n)||wi(n))},bn=function(e,n){return!(vi(n)||Ss(n)<0||!ji(e,n))},Si=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ns=function(e){var n=[],r=[];return e.forEach(function(o,a){var l=!!o.scopeParent,c=l?o.scopeParent:o,i=fi(c,l),u=l?Ns(o.candidates):c;i===0?l?n.push.apply(n,u):n.push(c):r.push({documentOrder:a,tabIndex:i,item:o,isScope:l,content:u})}),r.sort(mi).reduce(function(o,a){return a.isScope?o.push.apply(o,a.content):o.push(a.content),o},[]).concat(n)},ks=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Rt([e],n.includeContainer,{filter:bn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Si}):r=Vi(e,n.includeContainer,bn.bind(null,n)),Ns(r)};function Ci(){return/apple/i.test(navigator.vendor)}const vn="data-floating-ui-focusable";function Ni(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Tt(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Zs(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function Te(t){return"composedPath"in t?t.composedPath()[0]:t.target}function At(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function ki(t){return t.matches("html,body")}function $e(t){return t?.ownerDocument||document}function _i(t){return t?t.hasAttribute(vn)?t:t.querySelector("["+vn+"]")||t:null}function We(t,e,n){return n===void 0&&(n=!0),t.filter(o=>{var a;return o.parentId===e&&(!n||((a=o.context)==null?void 0:a.open))}).flatMap(o=>[o,...We(t,o.id,n)])}function Ii(t){return"nativeEvent"in t}var Ei=typeof document<"u",Ri=function(){},he=Ei?S.useLayoutEffect:Ri;const Ti={...Pn},Pi=Ti.useInsertionEffect,Di=Pi||(t=>t());function ke(t){const e=S.useRef(()=>{});return Di(()=>{e.current=t}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}const _s=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Is(t,e){const n=ks(t,_s()),r=n.length;if(r===0)return;const o=Ni($e(t)),a=n.indexOf(o),l=a===-1?e===1?0:r-1:a+e;return n[l]}function Mi(t){return Is($e(t).body,1)||t}function Fi(t){return Is($e(t).body,-1)||t}function wt(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!Tt(n,r)}function Oi(t){ks(t,_s()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function yn(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Li="data-floating-ui-focusable",An="active",wn="selected",$i={...Pn};let jn=!1,zi=0;const Sn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+zi++;function Bi(){const[t,e]=S.useState(()=>jn?Sn():void 0);return he(()=>{t==null&&e(Sn())},[]),S.useEffect(()=>{jn=!0},[]),t}const Ui=$i.useId,Yt=Ui||Bi;function Ki(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const qi=S.createContext(null),Qi=S.createContext(null),Es=()=>{var t;return((t=S.useContext(qi))==null?void 0:t.id)||null},Rs=()=>S.useContext(Qi);function Ht(t){return"data-floating-ui-"+t}const Yi={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Cn=S.forwardRef(function(e,n){const[r,o]=S.useState();he(()=>{Ci()&&o("button")},[]);const a={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ht("focus-guard")]:"",style:Yi};return s.jsx("span",{...e,...a})}),Hi={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Ts=S.createContext(null),Nn=Ht("portal");function Gi(t){t===void 0&&(t={});const{id:e,root:n}=t,r=Yt(),o=Ji(),[a,l]=S.useState(null),c=S.useRef(null);return he(()=>()=>{a?.remove(),queueMicrotask(()=>{c.current=null})},[a]),he(()=>{if(!r||c.current)return;const i=e?document.getElementById(e):null;if(!i)return;const u=document.createElement("div");u.id=r,u.setAttribute(Nn,""),i.appendChild(u),c.current=u,l(u)},[e,r]),he(()=>{if(n===null||!r||c.current)return;let i=n||o?.portalNode;i&&!or(i)&&(i=i.current),i=i||document.body;let u=null;e&&(u=document.createElement("div"),u.id=e,i.appendChild(u));const V=document.createElement("div");V.id=r,V.setAttribute(Nn,""),i=u||i,i.appendChild(V),c.current=V,l(V)},[e,n,r,o]),a}function Wi(t){const{children:e,id:n,root:r,preserveTabOrder:o=!0}=t,a=Gi({id:n,root:r}),[l,c]=S.useState(null),i=S.useRef(null),u=S.useRef(null),V=S.useRef(null),d=S.useRef(null),m=l?.modal,f=l?.open,x=!!l&&!l.modal&&l.open&&o&&!!(r||a);return S.useEffect(()=>{if(!a||!o||m)return;function h(p){a&&wt(p)&&(p.type==="focusin"?yn:Oi)(a)}return a.addEventListener("focusin",h,!0),a.addEventListener("focusout",h,!0),()=>{a.removeEventListener("focusin",h,!0),a.removeEventListener("focusout",h,!0)}},[a,o,m]),S.useEffect(()=>{a&&(f||yn(a))},[f,a]),s.jsxs(Ts.Provider,{value:S.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:i,afterOutsideRef:u,beforeInsideRef:V,afterInsideRef:d,portalNode:a,setFocusManagerState:c}),[o,a]),children:[x&&a&&s.jsx(Cn,{"data-type":"outside",ref:i,onFocus:h=>{if(wt(h,a)){var p;(p=V.current)==null||p.focus()}else{const b=l?l.domReference:null,g=Fi(b);g?.focus()}}}),x&&a&&s.jsx("span",{"aria-owns":a.id,style:Hi}),a&&er.createPortal(e,a),x&&a&&s.jsx(Cn,{"data-type":"outside",ref:u,onFocus:h=>{if(wt(h,a)){var p;(p=d.current)==null||p.focus()}else{const b=l?l.domReference:null,g=Mi(b);g?.focus(),l?.closeOnFocusOut&&l?.onOpenChange(!1,h.nativeEvent,"focus-out")}}})]})}const Ji=()=>S.useContext(Ts),Zi={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Xi={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kn=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function ec(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:o,dataRef:a}=t,{enabled:l=!0,escapeKey:c=!0,outsidePress:i=!0,outsidePressEvent:u="pointerdown",referencePress:V=!1,referencePressEvent:d="pointerdown",ancestorScroll:m=!1,bubbles:f,capture:x}=e,h=Rs(),p=ke(typeof i=="function"?i:()=>!1),b=typeof i=="function"?p:i,g=S.useRef(!1),{escapeKey:v,outsidePress:y}=kn(f),{escapeKey:w,outsidePress:A}=kn(x),k=S.useRef(!1),j=ke(_=>{var R;if(!n||!l||!c||_.key!=="Escape"||k.current)return;const F=(R=a.current.floatingContext)==null?void 0:R.nodeId,D=h?We(h.nodesRef.current,F):[];if(!v&&(_.stopPropagation(),D.length>0)){let I=!0;if(D.forEach(O=>{var z;if((z=O.context)!=null&&z.open&&!O.context.dataRef.current.__escapeKeyBubbles){I=!1;return}}),!I)return}r(!1,Ii(_)?_.nativeEvent:_,"escape-key")}),C=ke(_=>{var R;const F=()=>{var D;j(_),(D=Te(_))==null||D.removeEventListener("keydown",F)};(R=Te(_))==null||R.addEventListener("keydown",F)}),P=ke(_=>{var R;const F=a.current.insideReactTree;a.current.insideReactTree=!1;const D=g.current;if(g.current=!1,u==="click"&&D||F||typeof b=="function"&&!b(_))return;const I=Te(_),O="["+Ht("inert")+"]",z=$e(o.floating).querySelectorAll(O);let $=ce(I)?I:null;for(;$&&!bt($);){const Q=nr($);if(bt(Q)||!ce(Q))break;$=Q}if(z.length&&ce(I)&&!ki(I)&&!Tt(I,o.floating)&&Array.from(z).every(Q=>!Tt($,Q)))return;if(sr(I)&&E){const Q=bt(I),q=rr(I),Y=/auto|scroll/,se=Q||Y.test(q.overflowX),X=Q||Y.test(q.overflowY),te=se&&I.clientWidth>0&&I.scrollWidth>I.clientWidth,W=X&&I.clientHeight>0&&I.scrollHeight>I.clientHeight,J=q.direction==="rtl",ee=W&&(J?_.offsetX<=I.offsetWidth-I.clientWidth:_.offsetX>I.clientWidth),Z=te&&_.offsetY>I.clientHeight;if(ee||Z)return}const K=(R=a.current.floatingContext)==null?void 0:R.nodeId,M=h&&We(h.nodesRef.current,K).some(Q=>{var q;return At(_,(q=Q.context)==null?void 0:q.elements.floating)});if(At(_,o.floating)||At(_,o.domReference)||M)return;const U=h?We(h.nodesRef.current,K):[];if(U.length>0){let Q=!0;if(U.forEach(q=>{var Y;if((Y=q.context)!=null&&Y.open&&!q.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}r(!1,_,"outside-press")}),N=ke(_=>{var R;const F=()=>{var D;P(_),(D=Te(_))==null||D.removeEventListener(u,F)};(R=Te(_))==null||R.addEventListener(u,F)});S.useEffect(()=>{if(!n||!l)return;a.current.__escapeKeyBubbles=v,a.current.__outsidePressBubbles=y;let _=-1;function R(z){r(!1,z,"ancestor-scroll")}function F(){window.clearTimeout(_),k.current=!0}function D(){_=window.setTimeout(()=>{k.current=!1},tr()?5:0)}const I=$e(o.floating);c&&(I.addEventListener("keydown",w?C:j,w),I.addEventListener("compositionstart",F),I.addEventListener("compositionend",D)),b&&I.addEventListener(u,A?N:P,A);let O=[];return m&&(ce(o.domReference)&&(O=gt(o.domReference)),ce(o.floating)&&(O=O.concat(gt(o.floating))),!ce(o.reference)&&o.reference&&o.reference.contextElement&&(O=O.concat(gt(o.reference.contextElement)))),O=O.filter(z=>{var $;return z!==(($=I.defaultView)==null?void 0:$.visualViewport)}),O.forEach(z=>{z.addEventListener("scroll",R,{passive:!0})}),()=>{c&&(I.removeEventListener("keydown",w?C:j,w),I.removeEventListener("compositionstart",F),I.removeEventListener("compositionend",D)),b&&I.removeEventListener(u,A?N:P,A),O.forEach(z=>{z.removeEventListener("scroll",R)}),window.clearTimeout(_)}},[a,o,c,b,u,n,r,m,l,v,y,j,w,C,P,A,N]),S.useEffect(()=>{a.current.insideReactTree=!1},[a,b,u]);const T=S.useMemo(()=>({onKeyDown:j,...V&&{[Zi[d]]:_=>{r(!1,_.nativeEvent,"reference-press")},...d!=="click"&&{onClick(_){r(!1,_.nativeEvent,"reference-press")}}}}),[j,r,V,d]),E=S.useMemo(()=>{function _(R){R.button===0&&(g.current=!0)}return{onKeyDown:j,onMouseDown:_,onMouseUp:_,[Xi[u]]:()=>{a.current.insideReactTree=!0}}},[j,u,a]);return S.useMemo(()=>l?{reference:T,floating:E}:{},[l,T,E])}function tc(t){const{open:e=!1,onOpenChange:n,elements:r}=t,o=Yt(),a=S.useRef({}),[l]=S.useState(()=>Ki()),c=Es()!=null,[i,u]=S.useState(r.reference),V=ke((f,x,h)=>{a.current.openEvent=f?x:void 0,l.emit("openchange",{open:f,event:x,reason:h,nested:c}),n?.(f,x,h)}),d=S.useMemo(()=>({setPositionReference:u}),[]),m=S.useMemo(()=>({reference:i||r.reference||null,floating:r.floating||null,domReference:r.reference}),[i,r.reference,r.floating]);return S.useMemo(()=>({dataRef:a,open:e,onOpenChange:V,elements:m,events:l,floatingId:o,refs:d}),[e,V,m,l,o,d])}function nc(t){t===void 0&&(t={});const{nodeId:e}=t,n=tc({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,o=r.elements,[a,l]=S.useState(null),[c,i]=S.useState(null),V=o?.domReference||a,d=S.useRef(null),m=Rs();he(()=>{V&&(d.current=V)},[V]);const f=Xs({...t,elements:{...o,...c&&{reference:c}}}),x=S.useCallback(v=>{const y=ce(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;i(y),f.refs.setReference(y)},[f.refs]),h=S.useCallback(v=>{(ce(v)||v===null)&&(d.current=v,l(v)),(ce(f.refs.reference.current)||f.refs.reference.current===null||v!==null&&!ce(v))&&f.refs.setReference(v)},[f.refs]),p=S.useMemo(()=>({...f.refs,setReference:h,setPositionReference:x,domReference:d}),[f.refs,h,x]),b=S.useMemo(()=>({...f.elements,domReference:V}),[f.elements,V]),g=S.useMemo(()=>({...f,...r,refs:p,elements:b,nodeId:e}),[f,p,b,e,r]);return he(()=>{r.dataRef.current.floatingContext=g;const v=m?.nodesRef.current.find(y=>y.id===e);v&&(v.context=g)}),S.useMemo(()=>({...f,context:g,refs:p,elements:b}),[f,p,b,g])}function jt(t,e,n){const r=new Map,o=n==="item";let a=t;if(o&&t){const{[An]:l,[wn]:c,...i}=t;a=i}return{...n==="floating"&&{tabIndex:-1,[Li]:""},...a,...e.map(l=>{const c=l?l[n]:null;return typeof c=="function"?t?c(t):null:c}).concat(t).reduce((l,c)=>(c&&Object.entries(c).forEach(i=>{let[u,V]=i;if(!(o&&[An,wn].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof V=="function"){var d;(d=r.get(u))==null||d.push(V),l[u]=function(){for(var m,f=arguments.length,x=new Array(f),h=0;h<f;h++)x[h]=arguments[h];return(m=r.get(u))==null?void 0:m.map(p=>p(...x)).find(p=>p!==void 0)}}}else l[u]=V}),l),{})}}function sc(t){t===void 0&&(t=[]);const e=t.map(c=>c?.reference),n=t.map(c=>c?.floating),r=t.map(c=>c?.item),o=S.useCallback(c=>jt(c,t,"reference"),e),a=S.useCallback(c=>jt(c,t,"floating"),n),l=S.useCallback(c=>jt(c,t,"item"),r);return S.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:l}),[o,a,l])}const rc=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function oc(t,e){var n,r;e===void 0&&(e={});const{open:o,elements:a,floatingId:l}=t,{enabled:c=!0,role:i="dialog"}=e,u=Yt(),V=((n=a.domReference)==null?void 0:n.id)||u,d=S.useMemo(()=>{var g;return((g=_i(a.floating))==null?void 0:g.id)||l},[a.floating,l]),m=(r=rc.get(i))!=null?r:i,x=Es()!=null,h=S.useMemo(()=>m==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":m==="alertdialog"?"dialog":m,"aria-controls":o?d:void 0,...m==="listbox"&&{role:"combobox"},...m==="menu"&&{id:V},...m==="menu"&&x&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[m,d,x,o,V,i]),p=S.useMemo(()=>{const g={id:d,...m&&{role:m}};return m==="tooltip"||i==="label"?g:{...g,...m==="menu"&&{"aria-labelledby":V}}},[m,d,V,i]),b=S.useCallback(g=>{let{active:v,selected:y}=g;const w={role:"option",...v&&{id:d+"-fui-option"}};switch(i){case"select":case"combobox":return{...w,"aria-selected":y}}return{}},[d,i]);return S.useMemo(()=>c?{reference:h,floating:p,item:b}:{},[c,h,p,b])}function ac(t){const e=L.c(24),{editor:n,query:r,items:o,onSelect:a,onClose:l}=t,[c,i]=S.useState(0),u=S.useRef(o),V=S.useRef(c),d=S.useRef(a),m=S.useRef(l),f=S.useDeferredValue(r);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{i(0)},e[0]=x):x=e[0];let h;e[1]!==f?(h=[f],e[1]=f,e[2]=h):h=e[2],S.useEffect(x,h);let p,b;e[3]!==o.length||e[4]!==c?(p=()=>{c>=o.length&&o.length>0&&i(0)},b=[o.length,c],e[3]=o.length,e[4]=c,e[5]=p,e[6]=b):(p=e[5],b=e[6]),S.useEffect(p,b);let g,v;e[7]!==o?(g=()=>{u.current=o},v=[o],e[7]=o,e[8]=g,e[9]=v):(g=e[8],v=e[9]),S.useEffect(g,v);let y,w;e[10]!==c?(y=()=>{V.current=c},w=[c],e[10]=c,e[11]=y,e[12]=w):(y=e[11],w=e[12]),S.useEffect(y,w);let A,k;e[13]!==a?(k=()=>{d.current=a},A=[a],e[13]=a,e[14]=A,e[15]=k):(A=e[14],k=e[15]),S.useEffect(k,A);let j,C;e[16]!==l?(j=()=>{m.current=l},C=[l],e[16]=l,e[17]=j,e[18]=C):(j=e[17],C=e[18]),S.useEffect(j,C);let P,N;e[19]!==n?(P=()=>{if(n?.isDestroyed)return;let _;try{_=n.view.dom}catch{return}if(!_)return;const R=D=>{const I=u.current;if(!I.length)return!1;const O=()=>i($=>($+1)%I.length),z=()=>i($=>($-1+I.length)%I.length);switch(D.key){case"ArrowUp":return D.preventDefault(),z(),!0;case"ArrowDown":return D.preventDefault(),O(),!0;case"Tab":return D.preventDefault(),D.shiftKey?z():O(),!0;case"Home":return D.preventDefault(),i(0),!0;case"End":return D.preventDefault(),i(I.length-1),!0;case"Enter":{if(D.isComposing)return!1;D.preventDefault();const $=V.current;return $!==-1&&I[$]&&d.current?.(I[$],$),!0}case"Escape":return D.preventDefault(),m.current?.(),!0;default:return!1}},F=D=>{R(D)};return _.addEventListener("keydown",F,!0),()=>{_?.removeEventListener("keydown",F,!0)}},N=[n],e[19]=n,e[20]=P,e[21]=N):(P=e[20],N=e[21]),S.useEffect(P,N);const T=o.length?c:void 0;let E;return e[22]!==T?(E={selectedIndex:T,setSelectedIndex:i},e[22]=T,e[23]=E):E=e[23],E}function lc(t,e){switch(e.type){case"SET_SELECTED_ITEM":return{...t,selectedItem:e.payload};case"ON_START":return{...t,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...t,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return t}}const Ps=S.createContext(void 0);function Ds(){const t=S.useContext(Ps);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function ic({editor:t,char:e,pluginKey:n,allow:r,onOpenChange:o}){const[a,l]=S.useReducer(lc,{open:!1,element:null,query:"",range:null,selectedItem:null}),c=S.useRef(o);return c.current=o,S.useEffect(()=>{if(t?.isDestroyed)return;const i=n instanceof It?n:new It(n);t.state.plugins.find(d=>d.spec.key===i)&&t.unregisterPlugin(i);const V=ko({pluginKey:i,editor:t,char:e,allow(d){const m=t.state.doc.resolve(d.range.from);for(let f=m.depth;f>0;f--)if(m.node(f).type.name==="image")return!1;return!(r&&!r(d))},command(){},render:()=>({onStart:d=>{l({type:"ON_START",payload:{element:d.decorationNode??null,query:d.query,range:d.range}}),c.current?.(!0)},onUpdate:d=>{l({type:"ON_UPDATE",payload:{element:d.decorationNode??null,query:d.query,range:d.range}})},onKeyDown:d=>d.event.key==="Escape"?(l({type:"ON_EXIT"}),!0):!1,onExit:()=>{l({type:"ON_EXIT"}),c.current?.(!1)}}),items:()=>[]});return t.registerPlugin(V),()=>{t?.isDestroyed||t.unregisterPlugin(i)}},[t,n,e,l,r]),{state:a,dispatch:l}}function cc({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:o,dispatch:a}=Ds(),l=S.useDeferredValue(o.query),{data:c}=ar({queryKey:Ie.suggestionItems(e,o.open,l),queryFn:()=>o.open?n({query:l}):[]}),i=()=>{a({type:"ON_EXIT"})},u=async(d,m)=>{if(!(o.selectedItem!==null||!o.range)){a({type:"SET_SELECTED_ITEM",payload:d});try{const{view:f}=t,h=f.state.selection.$to.nodeAfter?.text?.startsWith(" "),p=o.range?{...o.range}:{from:0,to:0};h&&o.range&&(p.to+=1),await r({range:p,item:d})===!1?a({type:"SET_SELECTED_ITEM",payload:null}):i()}catch{i()}}},{selectedIndex:V}=ac({editor:t,query:l,items:c,onSelect:u,onClose:i});return{selectedItem:o.selectedItem,items:c,selectedIndex:V,close:i,onSelect:u}}function dc({children:t}){const{state:e,dispatch:n}=Ds(),{open:r,element:o}=e,a=()=>{n({type:"ON_EXIT"})},{refs:l,floatingStyles:c,context:i}=nc({placement:"bottom-start",open:r,onOpenChange:m=>{m||a()},elements:{reference:o},middleware:[lr(10),ir(),cr()],whileElementsMounted:dr}),u=ec(i,{outsidePress:m=>!(m.target instanceof Element&&m.target.closest(".ProseMirror"))}),V=oc(i,{role:"listbox"}),{getFloatingProps:d}=sc([u,V]);return r?s.jsx(Wi,{children:s.jsx("div",{ref:l.setFloating,style:c,...d(),className:"z-50 w-auto min-w-[360px] max-w-[520px] rounded-lg border bg-popover p-0 text-popover-foreground shadow-md outline-hidden overflow-hidden",children:t})}):null}const uc=t=>{const e=L.c(29),{item:n,isSelected:r,onSelect:o,isLoading:a,ref:l}=t;let c;if(e[0]!==n){const A=Ve(n._meta);c=n.title||Mt(n.name,A),e[0]=n,e[1]=c}else c=e[1];const i=c,u=n.description||null,V=n.icon,d=r&&"bg-accent text-accent-foreground",m=a&&"pointer-events-none opacity-50";let f;e[2]!==d||e[3]!==m?(f=B("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground",d,m),e[2]=d,e[3]=m,e[4]=f):f=e[4];let x;e[5]!==V||e[6]!==i?(x=V!==void 0&&s.jsx(Un,{icon:V,name:i,size:"xs",className:"mr-2"}),e[5]=V,e[6]=i,e[7]=x):x=e[7];let h;e[8]!==i?(h=s.jsx("span",{className:"font-medium flex items-center truncate capitalize",children:i}),e[8]=i,e[9]=h):h=e[9];let p;e[10]!==a?(p=a&&s.jsx(St,{size:"xs"}),e[10]=a,e[11]=p):p=e[11];let b;e[12]!==h||e[13]!==p?(b=s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,p]}),e[12]=h,e[13]=p,e[14]=b):b=e[14];let g;e[15]!==u?(g=u&&s.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:u}),e[15]=u,e[16]=g):g=e[16];let v;e[17]!==b||e[18]!==g?(v=s.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[b,g]}),e[17]=b,e[18]=g,e[19]=v):v=e[19];let y;e[20]!==n.drillable?(y=n.drillable&&s.jsx("kbd",{className:"shrink-0 ml-2 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground bg-muted border border-border rounded",children:"↵"}),e[20]=n.drillable,e[21]=y):y=e[21];let w;return e[22]!==o||e[23]!==l||e[24]!==v||e[25]!==y||e[26]!==f||e[27]!==x?(w=s.jsxs("div",{ref:l,onClick:o,className:f,children:[x,v,y]}),e[22]=o,e[23]=l,e[24]=v,e[25]=y,e[26]=f,e[27]=x,e[28]=w):w=e[28],w},Vc=t=>{const e=L.c(18),{editor:n,queryKey:r,queryFn:o,onSelect:a}=t;let l;e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==r?(l={editor:n,queryKey:r,queryFn:o,onSelect:a},e[0]=n,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const{items:c,selectedIndex:i,onSelect:u,selectedItem:V}=cc(l);if(!c.length){let x;return e[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md border shadow-md p-3 text-sm",children:"No items found"}),e[5]=x):x=e[5],x}let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d={maxHeight:"min(320px, var(--radix-popover-content-available-height, 320px))"},e[6]=d):d=e[6];let m;if(e[7]!==u||e[8]!==c||e[9]!==i||e[10]!==V?.name){let x;e[12]!==u||e[13]!==i||e[14]!==V?.name?(x=(h,p)=>s.jsx(uc,{item:h,isSelected:p===i,ref:p===i?pc:void 0,onSelect:()=>u(h,p),isLoading:V?.name===h.name},h.name),e[12]=u,e[13]=i,e[14]=V?.name,e[15]=x):x=e[15],m=c.map(x),e[7]=u,e[8]=c,e[9]=i,e[10]=V?.name,e[11]=m}else m=e[11];let f;return e[16]!==m?(f=s.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md overflow-y-auto",style:d,children:s.jsx("div",{className:"p-1",children:m})}),e[16]=m,e[17]=f):f=e[17],f};function fc(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"p-1",children:[...Array(3)].map(mc)}),t[0]=e):e=t[0],e}function mc(t,e){return s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 animate-pulse",children:[s.jsx("div",{className:"h-4 w-24 bg-muted rounded"}),s.jsx("div",{className:"h-3 w-32 bg-muted rounded"})]},e)}function Ms(t){const e=L.c(18),{editor:n,char:r,pluginKey:o,queryKey:a,queryFn:l,onSelect:c,allow:i,onOpenChange:u}=t;let V;e[0]!==i||e[1]!==r||e[2]!==n||e[3]!==u||e[4]!==o?(V={editor:n,char:r,pluginKey:o,allow:i,onOpenChange:u},e[0]=i,e[1]=r,e[2]=n,e[3]=u,e[4]=o,e[5]=V):V=e[5];const{state:d,dispatch:m}=ic(V);let f;e[6]!==m||e[7]!==d?(f={state:d,dispatch:m},e[6]=m,e[7]=d,e[8]=f):f=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fc,{}),e[9]=x):x=e[9];let h;e[10]!==n||e[11]!==c||e[12]!==l||e[13]!==a?(h=s.jsx(dc,{children:s.jsx(S.Suspense,{fallback:x,children:s.jsx(Vc,{editor:n,queryKey:a,queryFn:l,onSelect:c})})}),e[10]=n,e[11]=c,e[12]=l,e[13]=a,e[14]=h):h=e[14];let p;return e[15]!==f||e[16]!==h?(p=s.jsx(Ps.Provider,{value:f,children:h}),e[15]=f,e[16]=h,e[17]=p):p=e[17],p}function pc(t){t&&t.scrollIntoView({block:"center",behavior:"smooth"})}const hc=[{name:"agents",title:"Agents",description:"Mention an agent to hand off work",kind:"category",drillable:!0},{name:"resources",title:"Resources",description:"Attach a resource as context",kind:"category",drillable:!0}],xc=({editor:t,virtualMcpId:e})=>{const n=ze(),{org:r}=ie(),o=Br(),a=ue({connectionId:e,orgId:r.id,orgSlug:r.slug}),l=Ie.virtualMcpResources(e,r.id),[c,i]=S.useState("categories"),u=S.useRef(c);u.current=c;const V=S.useRef(null),d=S.useRef(!1),m=["at-mention",r.id,e??"default",c],f=async({item:p,range:b})=>{if(G("chat_picker_item_selected",{picker:"@",item_kind:p.kind,item_name:p.name}),p.kind!=="category"&&(d.current=!0),p.kind==="category")return i(p.name==="agents"?"agents":"resources"),!1;if(p.kind==="agent"&&p.agentId){Oe(t,b,{id:p.agentId,name:p.name,metadata:{agentId:p.agentId,title:p.name},char:"@"}),i("categories");return}if(p.kind==="resource"&&p.uri&&a){try{const g=await Dn(a,p.uri);Oe(t,b,{id:p.uri,name:p.uri,metadata:g.contents,char:"@"})}catch(g){console.error("[at-mention] Failed to fetch resource:",g),le.error("Failed to load resource. Please try again.")}i("categories");return}},x=async p=>{const{query:b}=p,g=u.current;if(g==="categories"){if(!b.trim())return hc;const w=b.toLowerCase(),A=o.filter(j=>j.status==="active"&&(!j.id||!Jt(j.id))&&j.id!==e&&(j.title.toLowerCase().includes(w)||j.description?.toLowerCase().includes(w))).map(j=>({name:j.title,title:j.title,description:j.description??void 0,icon:j.icon??null,kind:"agent",agentId:j.id})),k=await(async()=>{if(!a)return[];let j=n.getQueryData(l);return j||(j=await n.fetchQuery({queryKey:l,queryFn:()=>Fe(a),staleTime:6e4})),(j?.resources??[]).filter(C=>C.uri.toLowerCase().includes(w)||C.name?.toLowerCase().includes(w)||C.description?.toLowerCase().includes(w)).map(C=>({name:C.name??C.uri,title:C.name,description:C.description,kind:"resource",uri:C.uri}))})();return[...A,...k]}if(g==="agents"){let w=o.filter(A=>A.status==="active"&&(!A.id||!Jt(A.id))&&A.id!==e);if(b.trim()){const A=b.toLowerCase();w=w.filter(k=>k.title.toLowerCase().includes(A)||k.description?.toLowerCase().includes(A))}return w.map(A=>({name:A.title,title:A.title,description:A.description??void 0,icon:A.icon??null,kind:"agent",agentId:A.id}))}if(!a)return[];let v=n.getQueryData(l);v?n.fetchQuery({queryKey:l,queryFn:()=>Fe(a),staleTime:6e4}).catch(()=>{}):v=await n.fetchQuery({queryKey:l,queryFn:()=>Fe(a),staleTime:6e4});let y=v?.resources??[];if(b.trim()){const w=b.toLowerCase();y=y.filter(A=>A.uri.toLowerCase().includes(w)||A.name?.toLowerCase().includes(w)||A.description?.toLowerCase().includes(w))}return y.map(w=>({name:w.name??w.uri,title:w.name,description:w.description,kind:"resource",uri:w.uri}))},h=p=>{if(p)V.current=Date.now(),d.current=!1,G("chat_picker_opened",{picker:"@"});else{const b=V.current;G("chat_picker_closed",{picker:"@",outcome:d.current?"selected":"dismissed",duration_ms:b?Date.now()-b:null}),V.current=null,i("categories")}};return s.jsx(Ms,{editor:t,char:"@",pluginKey:"atDropdownMenu",queryKey:m,queryFn:x,onSelect:f,onOpenChange:h})};async function _n(t,e,n,r,o,a){try{const l=await Vt(n,r,a);Oe(t,e,{id:r,name:ot(r,o),metadata:l.messages,char:"/",kind:"prompt",args:a})}catch(l){console.error("[slash] Failed to fetch prompt:",l),le.error("Failed to load prompt. Please try again.")}}async function gc(t,e,n,r){try{const o=await Dn(n,r);Oe(t,e,{id:r,name:r,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),le.error("Failed to load resource. Please try again.")}}const bc=({editor:t,virtualMcpId:e})=>{const n=ze(),{org:r}=ie(),o=ue({connectionId:e,orgId:r.id,orgSlug:r.slug}),a=Ie.virtualMcpPrompts(e,r.id),l=Ie.virtualMcpResources(e,r.id),c=["slash-mention",r.id,e??"default"],[i,u]=S.useState(null),[V,d]=S.useState(null),m=hr(t);m&&(m.onEditChip=async y=>{if(o)try{const A=(await In(n,a,o)).find(k=>k.name===y.promptId);if(!A?.arguments||A.arguments.length===0)return;d({...y,prompt:A})}catch(w){console.error("[slash] Failed to load prompt for editing:",w),le.error("Failed to load prompt. Please try again.")}});const f=S.useRef(null),x=S.useRef(!1),h=async({item:y,range:w})=>{if(G("chat_picker_item_selected",{picker:"/",item_kind:y.kind,item_name:y.name}),x.current=!0,!!o)if(y.kind==="prompt"){if(y.arguments&&y.arguments.length>0){u({range:w,item:y});return}const A=Ve(y._meta);await _n(t,w,o,y.name,A)}else y.uri&&await gc(t,w,o,y.uri)},p=async y=>{if(!i||!o)return;const{range:w,item:A}=i,k=Ve(A._meta);await _n(t,w,o,A.name,k,y),u(null)},b=async y=>{if(!(!V||!o)){try{const w=await Vt(o,V.promptId,y),A=Ve(V.prompt._meta);t.chain().focus().setNodeSelection(V.pos).deleteSelection().insertContentAt(V.pos,Fn({id:V.promptId,name:ot(V.promptId,A),metadata:w.messages,char:"/",kind:"prompt",args:y})).run(),G("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:V.promptId})}catch(w){console.error("[slash] Failed to update prompt:",w),le.error("Failed to update prompt. Please try again.")}d(null)}},g=async y=>{const{query:w}=y;if(!o)return[];const[A,k]=await Promise.all([In(n,a,o),vc(n,l,o)]),j=w.trim().toLowerCase(),C=(A??[]).filter(N=>!j||N.name.toLowerCase().includes(j)||N.title?.toLowerCase().includes(j)||N.description?.toLowerCase().includes(j)).map(N=>({name:N.name,title:N.title,description:N.description,kind:"prompt",arguments:N.arguments,_meta:N._meta})),P=(k??[]).filter(N=>!j||N.uri.toLowerCase().includes(j)||N.name?.toLowerCase().includes(j)||N.description?.toLowerCase().includes(j)).map(N=>({name:N.name??N.uri,title:N.name,description:N.description,kind:"resource",uri:N.uri}));return[...C,...P]},v=i?.item.kind==="prompt"?{name:i.item.name,title:i.item.title,arguments:i.item.arguments,description:i.item.description,_meta:i.item._meta}:null;return s.jsxs(s.Fragment,{children:[s.jsx(Ms,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:c,queryFn:g,onSelect:h,onOpenChange:y=>{if(y)f.current=Date.now(),x.current=!1,G("chat_picker_opened",{picker:"/"});else{const w=f.current;G("chat_picker_closed",{picker:"/",outcome:x.current?"selected":"dismissed",duration_ms:w?Date.now()-w:null}),f.current=null}}}),s.jsx(Je,{prompt:v,setPrompt:()=>u(null),onSubmit:p}),s.jsx(Je,{prompt:V?.prompt??null,setPrompt:()=>d(null),onSubmit:b,defaultValues:V?.args},V?`edit-${V.promptId}-${V.pos}`:"edit-idle")]})};async function In(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>Nt(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>Nt(n),staleTime:6e4}),r?.prompts??[]}async function vc(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>Fe(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>Fe(n),staleTime:6e4}),r?.resources??[]}function yc(t){return[Co.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),ci.configure({placeholder:()=>t.current??"Ask anything, / for prompts, @ for agents & resources...",showOnlyWhenEditable:!1}),xr,gr]}function Ac({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:r=!1,placeholder:o,onSubmit:a,children:l}){const c=S.useRef(a),i=S.useRef(e),u=S.useRef(r),V=S.useRef(o),d=jo({extensions:yc(V),content:t||"",editorProps:{attributes:{"data-chat-input":"true",class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(m,f)=>f.key==="Enter"&&!f.shiftKey&&u.current?(f.preventDefault(),c.current?.(),!0):!1},onUpdate:({editor:m})=>{i.current(m?.getJSON())}});return S.useEffect(()=>{d?.setEditable(!n)},[d,n]),S.useEffect(()=>{c.current=a},[a]),S.useEffect(()=>{i.current=e},[e]),S.useEffect(()=>{u.current=r},[r]),S.useEffect(()=>{V.current=o},[o]),S.useEffect(()=>{if(d?.isDestroyed)return;const m=JSON.stringify(d?.getJSON()),f=JSON.stringify(t||{type:"doc",content:[]});m!==f&&d.commands.setContent(t||{type:"doc",content:[]})},[d,t]),s.jsx(So.Provider,{value:{editor:d},children:l})}function wc(t){const e=L.c(26),{disabled:n,virtualMcpId:r,showFileUploader:o,selectedModel:a,onUnsupportedFile:l,ref:c,className:i}=t,u=n===void 0?!1:n,V=o===void 0?!1:o,{editor:d}=Kt();let m,f;if(e[0]!==d?(m=()=>({focus:()=>{d?.commands.focus()},clear:()=>{d?.commands.clearContent(!0)},appendText:j=>{if(!d)return;const C=d.state.doc.textContent.trim()==="";d.commands.focus("end"),C||d.commands.insertContent(" "),d.commands.insertContent(j)},syncVoiceText:(j,C)=>{if(d&&(d.commands.setContent(j||{type:"doc",content:[]}),C)){d.commands.focus("end");const P=d.state.doc.textContent.trim().length>0;d.commands.insertContent(P?" "+C:C)}},restoreContent:j=>{d&&d.commands.setContent(j||{type:"doc",content:[]})}}),f=[d],e[0]=d,e[1]=m,e[2]=f):(m=e[1],f=e[2]),S.useImperativeHandle(c??null,m,f),!d)return null;const x=u&&"cursor-not-allowed opacity-70",h=u&&"[&_.ProseMirror]:cursor-not-allowed";let p;e[3]!==i||e[4]!==x||e[5]!==h?(p=B("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",i,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0",x,h),e[3]=i,e[4]=x,e[5]=h,e[6]=p):p=e[6];let b;e[7]!==d||e[8]!==p?(b=s.jsx(No,{editor:d,className:p}),e[7]=d,e[8]=p,e[9]=b):b=e[9];const g=r??null;let v;e[10]!==d||e[11]!==g?(v=s.jsx(S.Suspense,{fallback:null,children:s.jsx(bc,{editor:d,virtualMcpId:g})}),e[10]=d,e[11]=g,e[12]=v):v=e[12];const y=r??null;let w;e[13]!==d||e[14]!==y?(w=s.jsx(S.Suspense,{fallback:null,children:s.jsx(xc,{editor:d,virtualMcpId:y})}),e[13]=d,e[14]=y,e[15]=w):w=e[15];let A;e[16]!==d||e[17]!==l||e[18]!==a||e[19]!==V?(A=V&&a?s.jsx(si,{editor:d,selectedModel:a,onUnsupportedFile:l}):null,e[16]=d,e[17]=l,e[18]=a,e[19]=V,e[20]=A):A=e[20];let k;return e[21]!==v||e[22]!==w||e[23]!==A||e[24]!==b?(k=s.jsxs(s.Fragment,{children:[b,v,w,A]}),e[21]=v,e[22]=w,e[23]=A,e[24]=b,e[25]=k):k=e[25],k}function Fs(t){const e=L.c(3),[n]=Ee();let r;return e[0]!==n.enableSounds||e[1]!==t?(r=()=>{n.enableSounds&&Po(t.dataUri).catch(a=>{console.warn(`[sound] ${t.name} playback failed:`,a)})},e[0]=n.enableSounds,e[1]=t,e[2]=r):r=e[2],r}const jc={name:"switch-005",dataUri:"data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0VAAAAOAAADTGF2ZjYyLjMuMTAwAAAAAAAAAAAAAAD/+1DAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABkAABU4ABMTEx0dHR0nJycnMTExMTs7OztERERETk5OTlhYWFhiYmJibGxsbHZ2dnZ/f39/iYmJiZOTk5OdnZ2dp6enp7GxsbG7u7u7xMTExM7Ozs7Y2NjY4uLi4uzs7Oz29vb2/////wAAAABMYXZjNjIuMTEAAAAAAAAAAAAAAAAkBVYAAAAAAAAVOPCP8KUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//tQxAAACEwDXvQRAAG8Ii93HtACUCAABAKCJwfaCEHwfeoEAQdEAYygIHBOCAIAgCAJh9QIOg+D5/ygPh/wfB8DuKAgCHyn9QPh/5SCDv+CEHAQdxOD4B27c39tbckkqYbBAYAN9bNJLB+aXAf5wQAKdzxfbmrVIRQ4xNx3HwnoDmLhfMhgJiiw/HREXNCHqjvHEPEG8QjBYlxQNepJAT0kC8ip6JzSWj1TasoG+iyycbf2Uil1ovf1f/oUtR1qP+s1WSBFKoAAU02BDjMhuP/7UsQEgws8bRpd8YABJYPeBf9wCGXTGxBYcw5AJFMFMAmQQAhGAxgLBgHIAMYAAALhgAchipbe/91aU1VV4zcZj1Vf1XgYCIMBNrsBAIGs9/Ue4i/xFPeqCqwViI9/UeLf///rOngdA3OPHFjmOBv+EQnGahgaZxVplmkAH5JadDTQlNCEuGNiWYbCCONWdUJg6HXNazFdu1T+VgaEpOP70exv7f2/4b/yH//2/4cqCX/zWRUrIw+IPNMNlDnjAXQas/I4AzmYifA0tMSCgQDF//tSxBCDSzzi3k/sQwEyCtjJ/rBZAk+Uqj1YhA5YMCAAMwgOUchTkK7OR7LbMl0W1H6SvzG0Q2ZzfKUhnmTobv9DNhS1v7P8h//8Gv8gTRt1jReZ7YEjmMQg9hhwwMycHooasFmZyjcZGBKJD+IwbMCQQLoi+IQXCcIoydKoilI2MWFS5uJdDEu2taRrYI2ZSqKY50pJLv2NfjUAAuQAMfqVQ/T3PDQgMJMeEZ45hJzY6MNoFMxqTj1zNGQKJjAxEsSCBgQJBSIL0mcKYQJfVAn/+1LEGwLKlEKrD3MiYcuMkVa/wABB8Vh6M1q1epbvXwWBURhkyEhWZ/////////////9gjZ/Wt4w+4MNMCpE4TBYQl4w1IHvMDdA2zBngBMwc8COMDhCpDAfgOAAgrBgNYU+YC0FBGAkAMpgWoSCYAGESGBGAKBgXgJOdiOJmMCmNwCYNDJhYRPykRCJhTBnEUzlsjv4UNLj/z97n3Mv/7z1nZqyitYAZIqErIwMwJAqEw0GAAMFptJMaqFwB8CQIWlhuhuDAwNjfuwrQFAYXCf/7UsQVAA+9PTP42gYRdiIu9zBwAPbFUCi0DAhgNcS+7cDwVgM05A9bUDeuQMyE/u3CygVISgZhpIau/9PhdQG2C9DpxZZJmn/dn/Psmt0EFm////l84ThUTopE4VD/9JkubOGasTvN30C20G21qgUCkVCoUCgPMywrPCGly27V5q5t24vl/8jSlSAPCxzNseNCw3oh3NGBu4BZJ5hv7DRSfR/+eWG7nA8IKh2Olv5iz3q5m3//Joxo3JqNyYkSuGt/k6D4DeoBOHmHdl0dkZYA//tSxAUAC4B1Z/2DADEcA17Z/uhI4Yoik/TrZo+ww7UtmpW4LDWu2IacoJKJJeTSM+ZmAYBEiU+ZnnAwCn1VVVV6JUJQVnioKhrgqdKgqGpUFeCp0sDR3ztQNREDRUFioKuxKCpYGQBlRIBk+aLwb8KblGQVDdphPYTUdBOGbVpAaTF6ZdjEV0iRUZRCYkA4oUQDx5zqDugtXvza/7fuNNvfZ+j9v+T/2f//J/4cAAOTpE5K4zksR9MfIB+TDcQTI4gNs1XKAzEFUrGkxABYEBb/+1LEEYNKrEjgT/TCwYYVmUX+mHoKgWhKU5Eiw9SFIRmppw+3fYo4siPhUFeexM8KgIO6wVuPDDy01qeRaVbw357//y3+o8M0pBNlNLCGBzGKwyYw2IIFOE1WNTjRM6x8MlA1AxDhUHTAkEiyKpnbWrLcaOBotBUKbk1pypcWDAIK00AhKLGkUco6q9VWvM53mcaq3tVa8zjTM/tX//EDP//////////XAAmrwAAPoKwcw0ShDCZD/BQlhzinxQdorsOuXTEIC01ZkJyu4k/qPP/7UsQUAEjkrrkvZaPBIRXUoe5QObfMhYKX9RVgTPqCSCaSCaSC0XVdV1f/////6IAlguuAJSiDRNloNBsZg+0+Ts8MMCn81WUTRAlIi+GHECD0y8AWDIqswYsxGOSKVV7MqOni8tkVOip0fZX/////9HrMCbAz2EHGS4GKAAiRAAAYAcDdKd4G6Z/nwYgJ0ZAIgZyC8aPAs/iPBhwMpWDQNARltNS5Y61v//9i8Yl4SkFkIGTkAc0UBrIYLPA4MYBEy+YLMRuY4nhTC3hZA68H//tSxCoAyQC6mY6CkWDJBIsBz/QUrgNmahSzcrYw0/HhfnMAZBojDsgTFkDR5MDkG/DZEbk2FCmowqdqv2TYABiJwqqYjaQRGZ1URZ1DhSsdiHX/GBu0QpzIBNSaLqZ0ARkwFARxMrpt/Eh47mbQAhhU6sisFUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LESoHHJCRaj/dmYAIAQAAQAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsSLg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsShg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",duration:.609,format:"mp3",license:"CC0",author:"Kenney"},Sc=$r.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Cc=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Nc(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1.5",children:Cc.map(kc)}),t[0]=e):e=t[0],e}function kc(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function _c({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:r,isStreaming:o,onUnsupportedFile:a}){const[l,c]=S.useState(!1),i=Fs(jc),{org:u}=ie(),{editor:V}=Kt(),d=S.useRef(null),m=pt(r),f=()=>{!m||o||(c(!1),d.current?.click())},x=async M=>{const U=M.target.files;if(!U||U.length===0||!V)return;const Q=Array.from(U),{from:q}=V.state.selection;try{for(const Y of Q)await Qt(V,r??null,Y,q,a)}finally{d.current&&(d.current.value="")}},h=ue({connectionId:n,orgId:u.id,orgSlug:u.slug}),p=Ie.virtualMcpPrompts(n,u.id),{data:b,isLoading:g}=En({queryKey:p,queryFn:()=>Nt(h),staleTime:6e4,enabled:l&&!!h}),v=b?.prompts??[],[y,w]=S.useState(null),{chatMode:A,setChatMode:k}=me(),[j,C]=Ee(),N=(Pe.find(M=>M.value===j.toolApprovalLevel)??Pe[0]).short,T=M=>{const U=Pe.find(Q=>Q.value===M);if(U){if(U.value===j.toolApprovalLevel){c(!1);return}i(),G("chat_approval_level_changed",{from_level:j.toolApprovalLevel,to_level:U.value,source:"tools_popover"}),C({...j,toolApprovalLevel:U.value}),c(!1)}},E=A==="plan",_=()=>{i();const M=E?"default":"plan";G("chat_mode_changed",{from_mode:A,to_mode:M,source:"tools_popover"}),k(M),c(!1)},R=()=>{e(),c(!1)},F=async(M,U)=>{if(!V||!h)return;const Q=Ve(M._meta),q={from:V.state.selection.from,to:V.state.selection.to};try{const Y=await Vt(h,M.name,U);Oe(V,q,{id:M.name,name:ot(M.name,Q),metadata:Y.messages,char:"/",kind:"prompt",args:U})}catch{le.error("Failed to load prompt. Please try again.")}},D=async M=>{c(!1);const U=!!(M.arguments&&M.arguments.length>0);if(G("chat_prompt_inserted",{prompt_name:M.name,with_arguments:U}),U){w(M);return}await F(M)},I=async M=>{y&&(await F(y,M),w(null))},O=()=>{i();const M=A==="gen-image"?"default":"gen-image";G("chat_mode_changed",{from_mode:A,to_mode:M,source:"tools_popover"}),k(M),c(!1)},z=()=>{i();const M=A==="web-search"?"default":"web-search";G("chat_mode_changed",{from_mode:A,to_mode:M,source:"tools_popover"}),k(M),c(!1)},$=A==="gen-image",K=A==="web-search";return s.jsxs(s.Fragment,{children:[s.jsx("input",{ref:d,type:"file",multiple:!0,accept:Vo(r??null),className:"hidden",onChange:x,disabled:o}),s.jsxs(_o,{open:l,onOpenChange:M=>{M&&!l&&G("chat_tools_popover_opened",{chat_mode:A}),c(M)},children:[s.jsx(Io,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"ghost",size:"default",disabled:t,title:"Tools","aria-label":"Tools",className:B("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[s.jsx(Gr,{size:14}),s.jsx("span",{className:B("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:"Tools"})]})}),s.jsxs(Eo,{align:"start",className:"w-52 p-1.5 space-y-1",children:[m?s.jsxs(pe,{onClick:f,disabled:o,children:[s.jsx(sn,{size:16}),s.jsx("span",{className:"flex-1",children:"Add file"})]}):s.jsxs(ve,{children:[s.jsx(ge,{asChild:!0,children:s.jsxs(pe,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:M=>M.preventDefault(),children:[s.jsx(sn,{size:16}),s.jsx("span",{className:"flex-1",children:"Add file"})]})}),s.jsx(be,{side:"right",children:"The selected model does not support reading files or images."})]}),s.jsxs(pe,{onClick:_,className:B(E&&"text-violet-600 dark:text-violet-400"),children:[s.jsx(Ln,{size:16,className:B(E&&"text-violet-500")}),s.jsx("span",{className:"flex-1",children:"Plan mode"}),s.jsx("span",{className:B("text-xs text-muted-foreground",E&&"text-violet-500 font-medium"),children:Sc})]}),s.jsxs(pe,{onClick:O,className:B($&&"text-pink-600 dark:text-pink-400"),children:[s.jsx(zn,{size:16,className:B($&&"text-pink-500")}),s.jsx("span",{className:"flex-1",children:"Create image"}),$&&s.jsx("span",{className:"text-xs text-pink-500 font-medium",children:"On"})]}),s.jsxs(pe,{onClick:z,className:B(K&&"text-blue-600 dark:text-blue-400"),children:[s.jsx($n,{size:16,className:B(K&&"text-blue-500")}),s.jsx("span",{className:"flex-1",children:"Web search"}),K&&s.jsx("span",{className:"text-xs text-blue-500 font-medium",children:"On"})]}),s.jsxs(en,{children:[s.jsxs(tn,{className:"gap-2",children:[s.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),s.jsx("span",{className:"flex-1",children:"Prompts"})]}),s.jsx(nn,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:g?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(ur,{size:14,className:"animate-spin"}),"Loading prompts…"]}):v.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:"No prompts available"}):v.map(M=>s.jsxs(pe,{onClick:()=>D(M),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:M.title||Mt(M.name,Ve(M._meta))}),M.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:M.description})]},M.name))})]}),s.jsxs(en,{children:[s.jsxs(tn,{className:"gap-2",children:[s.jsx(mt,{size:16}),s.jsx("span",{className:"flex-1",children:"Approval"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:N})]}),s.jsx(nn,{className:"w-48 p-1.5",children:s.jsx(Ro,{value:j.toolApprovalLevel,onValueChange:T,children:Pe.map(M=>s.jsx(To,{value:M.value,children:M.label},M.value))})})]}),s.jsxs(pe,{onClick:R,children:[s.jsx(ao,{size:16}),s.jsx("span",{className:"flex-1",children:"Connections"}),s.jsx(S.Suspense,{children:s.jsx(Nc,{})})]})]})]}),s.jsx(Je,{prompt:y,setPrompt:w,onSubmit:I})]})}const Ic=[{src:"/connections/github.png",name:"GitHub"},{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/linear.png",name:"Linear"},{src:"/connections/shopify.png",name:"Shopify"},{src:"/connections/firecrawl.png",name:"Firecrawl"},{src:"/connections/perplexity.png",name:"Perplexity"}];function Ec(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1",children:Ic.map(Rc)}),t[0]=e):e=t[0],e}function Rc(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Tc(t){const e=L.c(6),{onClick:n}=t;let r,o,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=B("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),o=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:"Connect tools and get more done"}),a=s.jsx(Ec,{}),l=s.jsx(Mo,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[0]=r,e[1]=o,e[2]=a,e[3]=l):(r=e[0],o=e[1],a=e[2],l=e[3]);let c;return e[4]!==n?(c=s.jsxs("button",{type:"button",onClick:n,className:r,children:[o,a,l]}),e[4]=n,e[5]=c):c=e[5],c}const Me=48;function Pc(){const t=L.c(9),[e,n]=S.useState("idle"),[r,o]=S.useState(""),[a,l]=S.useState(""),[c,i]=S.useState(Fc),u=S.useRef(null),V=S.useRef(null),d=S.useRef(null),m=S.useRef(null),f=S.useRef(0),x=S.useRef(!1),h=S.useRef(""),p=S.useRef(""),b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),V.current?.close().catch(Mc),m.current?.getTracks().forEach(Dc),d.current=null,V.current=null,m.current=null},t[0]=g):g=t[0];const v=g;let y;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const N=T=>{m.current=T;const E=new AudioContext;V.current=E;const _=E.createMediaStreamSource(T),R=E.createAnalyser();R.fftSize=128,R.smoothingTimeConstant=.8,_.connect(R),d.current=R;const F=new Uint8Array(R.frequencyBinCount),D=()=>{if(!d.current)return;d.current.getByteFrequencyData(F);const I=[];for(let O=0;O<Me;O++){const z=Math.floor(O/Me*F.length);I.push(Math.max(.04,(F[z]??0)/255))}i(I),f.current=requestAnimationFrame(D)};D()};y=async()=>{const T=window.SpeechRecognition||window.webkitSpeechRecognition;if(!T){n("unsupported");return}let E;try{E=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{n("permission-denied");return}o(""),l(""),p.current="",h.current="",x.current=!0,n("recording"),N(E);const _=new T;u.current=_,_.interimResults=!0,_.continuous=!0,_.lang=navigator.language||"en-US",_.onresult=R=>{let F="",D="";for(let I=R.resultIndex;I<R.results.length;I++){const O=R.results[I],z=O?.[0]?.transcript??"";O?.isFinal?D=D+z:F=F+z}D&&(h.current=h.current+D,o(h.current)),p.current=F,l(F)},_.onend=()=>{if(x.current)try{_.start()}catch{}};try{_.start()}catch{n("idle")}},t[1]=y}else y=t[1];const w=y;let A;t[2]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{x.current=!1,u.current?.stop(),v(),n("idle"),i(Array(Me).fill(.05)),l("");const N=(h.current+(p.current?" "+p.current:"")).trim();return o(""),h.current="",p.current="",N},t[2]=A):A=t[2];const k=A;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{x.current=!1,u.current?.abort(),v(),n("idle"),o(""),l(""),i(Array(Me).fill(.05)),h.current="",p.current=""},t[3]=j):j=t[3];const C=j;let P;return t[4]!==a||t[5]!==e||t[6]!==r||t[7]!==c?(P={status:e,transcript:r,interimTranscript:a,waveformData:c,isSupported:b,startRecording:w,stopRecording:k,cancelRecording:C},t[4]=a,t[5]=e,t[6]=r,t[7]=c,t[8]=P):P=t[8],P}function Dc(t){return t.stop()}function Mc(){}function Fc(){return Array(Me).fill(.05)}function Oc(t){const e=L.c(4),{data:n}=t;let r;e[0]!==n?(r=n.map(Lc),e[0]=n,e[1]=r):r=e[1];let o;return e[2]!==r?(o=s.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:r}),e[2]=r,e[3]=o):o=e[3],o}function Lc(t,e){return s.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}function $c({messageCount:t,showConnectionsBanner:e}){return t>0||e}function zc(t,e){const n=L.c(5),{editor:r}=Kt(),[o,a]=S.useState(!1),l=S.useRef(0);let c,i;return n[0]!==r||n[1]!==e||n[2]!==t?(c=()=>{const u=f=>{f.dataTransfer?.types.includes("Files")&&(f.preventDefault(),l.current=l.current+1,a(!0))},V=f=>{f.preventDefault(),l.current=Math.max(0,l.current-1),l.current===0&&a(!1)},d=Bc,m=f=>{if(f.preventDefault(),l.current=0,a(!1),!r||!t||!pt(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const{from:h}=r.state.selection;for(const p of Array.from(x))Qt(r,t,p,h,e)};return window.addEventListener("dragenter",u),window.addEventListener("dragleave",V),window.addEventListener("dragover",d),window.addEventListener("drop",m),()=>{window.removeEventListener("dragenter",u),window.removeEventListener("dragleave",V),window.removeEventListener("dragover",d),window.removeEventListener("drop",m)}},i=[r,t,e],n[0]=r,n[1]=e,n[2]=t,n[3]=c,n[4]=i):(c=n[3],i=n[4]),S.useEffect(c,i),o}function Bc(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function Uc(t){const e=L.c(11),{selectedModel:n,onUnsupportedFile:r}=t,o=zc(n,r);let a;e[0]!==n?(a=pt(n),e[0]=n,e[1]=a):a=e[1];const l=a,c=o?"opacity-100":"opacity-0 pointer-events-none",i=l?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let u;e[2]!==c||e[3]!==i?(u=B("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",c,i),e[2]=c,e[3]=i,e[4]=u):u=e[4];let V;e[5]!==n||e[6]!==l?(V=l?s.jsxs(s.Fragment,{children:[s.jsx(Zr,{size:24}),s.jsxs("span",{className:"text-sm font-medium",children:["Drop ",es(n)," here"]})]}):s.jsxs(s.Fragment,{children:[s.jsx(Mn,{size:24}),s.jsx("span",{className:"text-sm font-medium",children:"This model can't read attachments — switch to one with vision or file support"})]}),e[5]=n,e[6]=l,e[7]=V):V=e[7];let d;return e[8]!==u||e[9]!==V?(d=s.jsx("div",{className:u,children:V}),e[8]=u,e[9]=V,e[10]=d):d=e[10],d}function Kc(){const t=L.c(6),e=rt(),{org:n,locator:r}=ie(),{create:o}=Fr();let a;return t[0]!==o||t[1]!==r||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(a=async l=>{const{tiptapDoc:c,virtualMcp:i}=l,u=crypto.randomUUID(),V=i?.id??dt(n.id).id;Or(sessionStorage,r,u,{tiptapDoc:c});try{await o({id:u,virtual_mcp_id:V})}catch{}const d={virtualmcpid:V,autosend:Lr};e({to:"/$org/$taskId",params:{org:n.slug,taskId:u},search:d})},t[0]=o,t[1]=r,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=a):a=t[5],a}function qc({onOpenContextPanel:t,showConnectionsBanner:e=!1}){const n=On(),r=Ue(),o=n?.messages??[],a=n?.isStreaming??!1,l=n?.isRunInProgress??!1,c=n?.stop??(()=>{}),i=r?.taskId??"",u=i||aa,V=Kc(),{selectedModel:d,selectedVirtualMcp:m,isModelsLoading:f,tiptapDocRef:x,imageModel:h,deepResearchModel:p,chatMode:b,setChatMode:g}=me(),{data:v}=Tn.useSession(),y=v?.user?.id,{org:w,locator:A}=ie(),k=dt(w.id).id,j=Ur(m?.id??k),C=Fs(Do),[P,N]=S.useState(!1),{unsupportedFile:T,onUnsupportedFile:E,clearUnsupportedFile:_}=ii(),R=Pc(),F=S.useRef(void 0),D=async()=>{F.current=$,await R.startRecording();const H=R.status==="recording"?"started":R.status==="unsupported"?"unsupported":R.status==="permission-denied"?"permission_denied":"unknown";G("chat_voice_started",{thread_id:i,outcome:H})},I=()=>{G("chat_voice_confirmed",{thread_id:i});const H=R.stopRecording();Y.current?.syncVoiceText(F.current,H),Y.current?.focus()},O=()=>{G("chat_voice_cancelled",{thread_id:i}),R.cancelRecording(),Y.current?.restoreContent(F.current)};S.useEffect(()=>{if(R.status!=="recording")return;const H=(R.transcript+(R.interimTranscript?" "+R.interimTranscript:"")).trim();Y.current?.syncVoiceText(F.current,H)},[R.transcript,R.interimTranscript,R.status]);const z=r?.activeTask??null,[$,K]=S.useState(()=>an(sessionStorage,A,u)??void 0),M=H=>{K(H),x.current=H,ia(sessionStorage,A,u,H,{onQuotaExceeded:({docSizeBytes:ne})=>{G("chat_draft_quota_exceeded",{thread_id:i||null,doc_size_bytes:ne}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},U=S.useRef(i);if(U.current!==i){U.current=i;const H=an(sessionStorage,A,u)??void 0;K(H),x.current=H}const q=[...o].reverse().find(H=>H.role==="assistant")?.metadata?.modelLimits?.contextWindow??d?.limits?.contextWindow,Y=S.useRef(null),se=b==="plan";S.useEffect(()=>{const H=ne=>{zr(ne)&&ne.code==="KeyL"&&(ne.preventDefault(),ne.shiftKey&&g(b==="plan"?"default":"plan"),Y.current?.focus())};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[b,g]);const X=br(o),W=[...o].reverse().find(H=>H.role==="assistant"&&H.metadata?.usage)?.metadata?.usage?.contextTokens??0,J=!a&&!f&&!cs($),ee=a||l,Z=$c({messageCount:o.length,showConnectionsBanner:e}),oe=H=>{H?.preventDefault(),a?(G("chat_message_stopped",{thread_id:i}),c()):l?(G("chat_message_stopped",{thread_id:i}),c()):J&&$&&(G("chat_message_sent",{thread_id:i||null,mode:b,model_id:d?.modelId??null,model_provider:d?.providerId??null,virtual_mcp_id:m?.id??null,submission:H?"button_or_enter":"programmatic"}),n?n.sendMessage($):V({tiptapDoc:$,virtualMcp:m}),ca(sessionStorage,A,u),M(void 0))};return y&&z?.created_by&&z.created_by!==y?s.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[s.jsx(Mn,{size:14,className:"shrink-0"}),s.jsx("span",{className:"text-sm",children:"Read only — you're viewing someone else's thread"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col w-full justify-end",children:s.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&s.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),n&&r&&s.jsx(ht,{}),s.jsx(Ac,{tiptapDoc:$,setTiptapDoc:M,disabled:a,enterToSubmit:!0,onSubmit:oe,children:s.jsxs("form",{onSubmit:oe,className:B("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[s.jsx(Uc,{selectedModel:d,onUnsupportedFile:E}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(wc,{ref:Y,disabled:a||R.status==="recording",virtualMcpId:m?.id??k,showFileUploader:!0,selectedModel:d,onUnsupportedFile:E})}),s.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:R.status==="recording"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx(Oc,{data:R.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:O,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":"Cancel recording",children:s.jsx(De,{size:16})}),s.jsx("button",{type:"button",onClick:I,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":"Use transcription",children:s.jsx(Ke,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(_c,{disabled:a,onOpenConnections:()=>{G("connections_dialog_opened",{source:"tools_popover",mode:"add"}),N(!0)},virtualMcpId:m?.id??k,selectedModel:d,isStreaming:a,onUnsupportedFile:E}),se&&s.jsxs("button",{type:"button",onClick:()=>{C(),G("chat_mode_changed",{from_mode:"plan",to_mode:"default",source:"pill_dismiss"}),g("default")},title:"Plan mode","aria-label":"Plan mode",className:"flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium text-violet-600 dark:text-violet-400 hover:bg-violet-500/10 group min-w-0 shrink animate-in fade-in duration-200",children:[s.jsx(Ln,{size:14,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100",children:"Plan mode"}),s.jsx(De,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"})]}),b==="gen-image"&&h&&s.jsxs("button",{type:"button",disabled:a,onClick:()=>{C(),G("chat_mode_changed",{from_mode:"gen-image",to_mode:"default",source:"pill_dismiss"}),g("default")},title:"Create image","aria-label":"Create image",className:"flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 group min-w-0 shrink animate-in fade-in duration-200 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",children:[s.jsx(zn,{size:14,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:max-w-[120px] @[320px]/chat-bottom:opacity-100",children:"Create image"}),s.jsx(De,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"})]}),b==="web-search"&&p&&s.jsxs("button",{type:"button",disabled:a,onClick:()=>{C(),G("chat_mode_changed",{from_mode:"web-search",to_mode:"default",source:"pill_dismiss"}),g("default")},title:"Web search","aria-label":"Web search",className:"flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 group min-w-0 shrink animate-in fade-in duration-200 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",children:[s.jsx($n,{size:14,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:max-w-[120px] @[320px]/chat-bottom:opacity-100",children:"Web search"}),s.jsx(De,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"})]}),q&&W>0&&s.jsx(vr,{usage:X,totalTokens:W,contextWindow:q,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[Z&&s.jsx(Zl,{virtualMcp:j,currentBranch:r?.currentBranch??null}),s.jsx(ni,{}),R.isSupported&&s.jsx(re,{type:"button",onClick:D,disabled:a||l,variant:"ghost",size:"icon",className:B("size-8 rounded-lg transition-colors",R.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:R.status==="permission-denied"?"Microphone access denied — click to try again":"Voice input",children:s.jsx(Wr,{size:18})}),s.jsx(re,{type:ee?"button":"submit",onClick:H=>{ee&&(H.preventDefault(),H.stopPropagation(),c())},variant:J||ee?"default":"ghost",size:"icon",disabled:!J&&!ee,className:B("size-8 rounded-lg transition-all",!J&&!ee&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:a?"Stop generating":l?"Cancel run":"Send message (Enter)",children:ee?s.jsx(Jr,{size:20}):s.jsx(Kr,{size:20})})]})]})})]})},i),e&&s.jsx(Tc,{onClick:()=>{G("connections_banner_clicked",{source:"home_chat_input"}),G("connections_dialog_opened",{source:"home_banner",mode:"add"}),N(!0)}})]})}),s.jsx(vo,{mode:"browse",open:P,onOpenChange:N,defaultTab:"all"}),s.jsx(ai,{info:T,onClose:_})]})}const Qc={usd:[{dollars:10,label:"Starter"},{dollars:20,label:"Popular"},{dollars:100,label:"Best value"}],brl:[{dollars:50,label:"Starter"},{dollars:100,label:"Popular"},{dollars:500,label:"Best value"}]};function Os(t){return`deco-credits-empty-dismissed:${t}`}function Zd(t){try{return localStorage.getItem(Os(t))==="1"}catch{return!1}}function Yc(){const t=L.c(50),{org:e}=ie(),n=rt(),{decoKeyId:r}=bs();let o;t[0]!==e.id||t[1]!==e.slug?(o={connectionId:ut,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=o):o=t[2];const a=ue(o),[l,c]=S.useState(!0),[i,u]=S.useState(""),[V,d]=S.useState(!1),[m,f]=S.useState("usd"),x=m==="brl"?"R$":"$";let h;t[3]!==e.id?(h=()=>{G("credits_empty_state_dismissed",{organization_id:e.id}),c(!1);try{localStorage.setItem(Os(e.id),"1")}catch{}},t[3]=e.id,t[4]=h):h=t[4];const p=h;let b,g;t[5]!==l||t[6]!==e.id?(b=()=>{l&&G("credits_empty_state_shown",{organization_id:e.id})},g=[l,e.id],t[5]=l,t[6]=e.id,t[7]=b,t[8]=g):(b=t[7],g=t[8]),S.useEffect(b,g);let v;t[9]!==a||t[10]!==m?(v=async K=>{const M=await a.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:K,currency:m}});if(M?.isError)throw new Error(M.content?.[0]?.text??"Failed to get top-up URL");return M.structuredContent?.url},t[9]=a,t[10]=m,t[11]=v):v=t[11];let y;t[12]!==p?(y=K=>{K&&window.open(K,"_blank","noopener,noreferrer"),p()},t[12]=p,t[13]=y):y=t[13];let w;t[14]!==v||t[15]!==y?(w={mutationFn:v,onSuccess:y,onError:Gc},t[14]=v,t[15]=y,t[16]=w):w=t[16];const{mutate:A,isPending:k}=Dt(w),j=parseFloat(i),C=!isNaN(j)&&j>=1;if(!l)return null;let P;t[17]!==p?(P=K=>!K&&p(),t[17]=p,t[18]=P):P=t[18];let N;t[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-amber-500/8 to-transparent pointer-events-none rounded-t-lg"}),t[19]=N):N=t[19];let T;t[20]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-amber-100 dark:bg-amber-900/40 border border-amber-200/60 dark:border-amber-800/40 mx-auto",children:s.jsx(Kn,{size:20,className:"text-amber-600 dark:text-amber-400"})}),t[20]=T):T=t[20];let E;t[21]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[N,s.jsxs(at,{className:"relative gap-3",children:[T,s.jsxs("div",{className:"text-center",children:[s.jsx(lt,{className:"text-lg font-semibold",children:"This workspace has no credits"}),s.jsx(Ft,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:"Your free credits were used in another workspace. Add credits to use AI here."})]})]})]}),t[21]=E):E=t[21];let _;t[22]!==m||t[23]!==x||t[24]!==i||t[25]!==j||t[26]!==r||t[27]!==C||t[28]!==k||t[29]!==V||t[30]!==A?(_=r&&s.jsxs("div",{className:"px-6 pb-5",children:[s.jsx("div",{className:"mb-4",children:s.jsxs(Hn,{type:"single",variant:"outline",size:"sm",value:m,onValueChange:K=>{K&&f(K)},children:[s.jsx(Ze,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),s.jsx(Ze,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"})]})}),s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:Qc[m].map(K=>{const{dollars:M,label:U}=K;return s.jsxs("button",{type:"button",disabled:k,onClick:()=>{G("credits_topup_clicked",{amount_cents:M*100,currency:m,tier_label:U,source:"empty_state"}),A(M*100)},className:B("relative flex flex-col items-center gap-1 py-6 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[x,M]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:U})]},M)})}),V?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:x}),s.jsx(Gn,{type:"number",min:"1",step:"1",placeholder:"50",value:i,onChange:K=>u(K.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(re,{className:"h-10",disabled:!C||k,onClick:()=>{G("credits_topup_clicked",{amount_cents:Math.round(j*100),currency:m,tier_label:"custom",source:"empty_state"}),A(Math.round(j*100))},children:k?"Opening...":"Add"})]}):s.jsx("button",{type:"button",className:"w-full mt-2.5 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>d(!0),children:"Enter custom amount"})]}),t[22]=m,t[23]=x,t[24]=i,t[25]=j,t[26]=r,t[27]=C,t[28]=k,t[29]=V,t[30]=A,t[31]=_):_=t[31];let R;t[32]!==p||t[33]!==n||t[34]!==e.slug?(R=()=>{n({to:"/$org/settings/ai-providers",params:{org:e.slug}}),p()},t[32]=p,t[33]=n,t[34]=e.slug,t[35]=R):R=t[35];let F;t[36]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Yn,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[36]=F):F=t[36];let D;t[37]!==R?(D=s.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:R,children:["Use your own provider",F]}),t[37]=R,t[38]=D):D=t[38];let I;t[39]!==p?(I=s.jsx(re,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:p,children:"Skip for now"}),t[39]=p,t[40]=I):I=t[40];let O;t[41]!==D||t[42]!==I?(O=s.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[D,I]}),t[41]=D,t[42]=I,t[43]=O):O=t[43];let z;t[44]!==_||t[45]!==O?(z=s.jsxs(it,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Hc,children:[E,_,O]}),t[44]=_,t[45]=O,t[46]=z):z=t[46];let $;return t[47]!==z||t[48]!==P?($=s.jsx(ct,{open:!0,onOpenChange:P,children:z}),t[47]=z,t[48]=P,t[49]=$):$=t[49],$}function Hc(t){return t.preventDefault()}function Gc(t){le.error(`Top-up failed: ${t.message}`)}function Wc(t){const e=L.c(6),{balanceDollars:n}=t;let r;e[0]!==n?(r=n.toFixed(2),e[0]=n,e[1]=r):r=e[1];const o=r;let a,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=B("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-emerald-50 dark:bg-emerald-950/30","border border-emerald-200/60 dark:border-emerald-800/40","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),l=s.jsx(Kn,{size:13,className:"text-emerald-600 dark:text-emerald-400"}),e[2]=a,e[3]=l):(a=e[2],l=e[3]);let c;return e[4]!==o?(c=s.jsxs("div",{className:a,children:[l,s.jsxs("span",{className:"text-xs font-medium text-emerald-700 dark:text-emerald-300 tabular-nums",children:["$",o," in credits to get started"]})]}),e[4]=o,e[5]=c):c=e[5],c}function Jc(){const t=L.c(8),{org:e}=ie(),n=rt();let r;t[0]!==n||t[1]!==e.slug?(r=()=>n({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=n,t[1]=e.slug,t[2]=r):r=t[2];let o,a,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=B("inline-flex items-center gap-1.5 px-3 py-1 rounded-full cursor-pointer","bg-amber-50 dark:bg-amber-950/30","border border-amber-200/60 dark:border-amber-800/40","hover:bg-amber-100/60 dark:hover:bg-amber-900/30","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=s.jsx(qn,{size:13,className:"text-amber-600 dark:text-amber-400"}),l=s.jsx("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-300",children:"No credits remaining · Add more"}),t[3]=o,t[4]=a,t[5]=l):(o=t[3],a=t[4],l=t[5]);let c;return t[6]!==r?(c=s.jsxs("button",{type:"button",onClick:r,className:o,children:[a,l]}),t[6]=r,t[7]=c):c=t[7],c}function Zc(t){const e=L.c(11),{className:n}=t;let r;e[0]!==n?(r=B("flex h-full w-full flex-col bg-background",n),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),e[2]=o):o=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex items-center gap-3",children:[o,s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),s.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),e[3]=a):a=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[a,s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),s.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),e[4]=l):l=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:s.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[s.jsx(Ye,{align:"right",width:"w-3/4"}),s.jsx(Ye,{align:"left",width:"w-full",lines:3}),s.jsx(Ye,{align:"right",width:"w-2/3"}),s.jsx(Ye,{align:"left",width:"w-5/6",lines:2})]})}),e[5]=c):c=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:s.jsx("div",{className:"relative flex-1",children:s.jsxs("div",{className:"space-y-2 p-2",children:[s.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),s.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),e[6]=i):i=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"flex items-center gap-1",children:s.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),e[7]=u):u=e[7];let V;e[8]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("div",{className:"px-4 py-4",children:s.jsx("div",{className:"mx-auto w-full max-w-2xl",children:s.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl bg-background card-shadow",children:[i,s.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[u,s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),s.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})}),e[8]=V):V=e[8];let d;return e[9]!==r?(d=s.jsxs("div",{className:r,children:[l,c,V]}),e[9]=r,e[10]=d):d=e[10],d}function Ye(t){const e=L.c(22),{align:n,width:r,lines:o}=t,a=r===void 0?"w-full":r,l=o===void 0?1:o,c=n==="right"?"flex-row-reverse":"flex-row";let i;e[0]!==c?(i=B("flex w-full gap-4 px-4 py-2",c),e[0]=c,e[1]=i):i=e[1];const u=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let V;e[2]!==u?(V=B("flex min-w-0 flex-col gap-2",u),e[2]=u,e[3]=V):V=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=d):d=e[4];const m=n==="right"?"bg-muted":"bg-transparent border border-border/40";let f;e[5]!==m||e[6]!==a?(f=B("min-w-0 rounded-2xl p-4",m,a),e[5]=m,e[6]=a,e[7]=f):f=e[7];let x;e[8]!==l?(x=Array.from({length:l}),e[8]=l,e[9]=x):x=e[9];let h;e[10]!==l||e[11]!==x?(h=s.jsx("div",{className:"space-y-2",children:x.map((v,y)=>s.jsx("div",{className:B("h-3 rounded bg-muted-foreground/20 animate-pulse",y===l-1?"w-3/4":"w-full"),style:{animationDelay:`${y*.1}s`}},y))}),e[10]=l,e[11]=x,e[12]=h):h=e[12];let p;e[13]!==h||e[14]!==f?(p=s.jsx("div",{className:f,children:h}),e[13]=h,e[14]=f,e[15]=p):p=e[15];let b;e[16]!==p||e[17]!==V?(b=s.jsxs("div",{className:V,children:[d,p]}),e[16]=p,e[17]=V,e[18]=b):b=e[18];let g;return e[19]!==b||e[20]!==i?(g=s.jsx("div",{className:i,children:b}),e[19]=b,e[20]=i,e[21]=g):g=e[21],g}function Xc(t){const e=L.c(7),{scrollRef:n,sentinelRef:r,hasMoreOlder:o,isFetchingOlder:a,fetchOlderMessages:l}=t;let c,i;e[0]!==l||e[1]!==o||e[2]!==a||e[3]!==n||e[4]!==r?(c=()=>{const u=r.current,V=n.current;if(!u||!V||!o)return;const d=new IntersectionObserver(async m=>{if(!m[0]?.isIntersecting||a||!o)return;const x=V.scrollHeight,h=V.scrollTop;await l(),requestAnimationFrame(()=>{const p=V.scrollHeight;V.scrollTop=h+(p-x)})},{root:V,rootMargin:"200px 0px 0px 0px"});return d.observe(u),()=>d.disconnect()},i=[n,r,o,a,l],e[0]=l,e[1]=o,e[2]=a,e[3]=n,e[4]=r,e[5]=c,e[6]=i):(c=e[5],i=e[6]),S.useEffect(c,i)}function ed(t){const e=L.c(5),{className:n,children:r}=t;let o;e[0]!==n?(o=B("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",n),e[0]=n,e[1]=o):o=e[1];let a;return e[2]!==r||e[3]!==o?(a=s.jsx("div",{className:o,children:r}),e[2]=r,e[3]=o,e[4]=a):a=e[4],a}function td(t){const e=L.c(5),{children:n,className:r}=t;let o;e[0]!==r?(o=B("flex-1 min-h-0 overflow-y-auto isolate",r),e[0]=r,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=s.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function nd(t){const e=L.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:n}),e[0]=n,e[1]=r):r=e[1],r}function sd(){const t=L.c(36),{messages:e,status:n,hasMoreOlder:r,isFetchingOlder:o,fetchOlderMessages:a,isStreaming:l}=Be(),c=yr(e),i=c.at(-1),V=oa()*Yo+16,d=S.useRef(null),m=S.useRef(null);let f;t[0]!==a||t[1]!==r||t[2]!==o?(f={scrollRef:d,sentinelRef:m,hasMoreOlder:r,isFetchingOlder:o,fetchOlderMessages:a},t[0]=a,t[1]=r,t[2]=o,t[3]=f):f=t[3],Xc(f);const x=i?.assistant?.parts,h=x?.length,p=x?.at(-1);let b;t[4]!==h||t[5]!==p?(b=[h,p],t[4]=h,t[5]=p,t[6]=b):b=t[6];let g;t[7]!==l||t[8]!==b?(g={containerRef:d,enabled:l,contentDeps:b},t[7]=l,t[8]=b,t[9]=g):g=t[9];const{sentinelRef:v}=Ar(g);let y;t[10]!==V?(y={paddingBottom:V},t[10]=V,t[11]=y):y=t[11];let w;t[12]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{ref:m,"aria-hidden":!0,className:"h-px"}),t[12]=w):w=t[12];let A;t[13]!==o?(A=o&&s.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:"Loading older messages…"}),t[13]=o,t[14]=A):A=t[14];let k;if(t[15]!==c||t[16]!==n){let E;t[18]!==c.length||t[19]!==n?(E=(_,R)=>s.jsx(Wt,{pair:_,isLastPair:!1,status:R===c.length-1?n:void 0},`pair-${_.user?.id??_.assistant?.id}`),t[18]=c.length,t[19]=n,t[20]=E):E=t[20],k=c.slice(0,-1).map(E),t[15]=c,t[16]=n,t[17]=k}else k=t[17];let j;t[21]!==A||t[22]!==k?(j=s.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[w,A,k]}),t[21]=A,t[22]=k,t[23]=j):j=t[23];let C;t[24]!==i||t[25]!==n?(C=i&&s.jsx("div",{className:"min-h-full min-w-0 max-w-2xl mx-auto w-full",children:s.jsx(Wt,{pair:i,isLastPair:!0,status:n},`pair-${i.user?.id??i.assistant?.id}`)}),t[24]=i,t[25]=n,t[26]=C):C=t[26];let P;t[27]!==C||t[28]!==y||t[29]!==j?(P=s.jsxs("div",{style:y,children:[j,C]}),t[27]=C,t[28]=y,t[29]=j,t[30]=P):P=t[30];let N;t[31]!==v?(N=s.jsx("div",{ref:v,"aria-hidden":!0,className:"h-0"}),t[31]=v,t[32]=N):N=t[32];let T;return t[33]!==P||t[34]!==N?(T=s.jsxs("div",{ref:d,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",children:[P,N]}),t[33]=P,t[34]=N,t[35]=T):T=t[35],T}function rd(t){const e=L.c(5),{children:n,className:r}=t;let o;e[0]!==r?(o=B("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",r),e[0]=r,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=s.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}const Xd=Object.assign(ed,{Main:td,Messages:sd,EmptyState:nd,Footer:rd,Input:qc,Provider:Nr,ActiveTaskProvider:Cr,Skeleton:Zc,IceBreakers:Qo,NoAiProviderEmptyState:fo,CreditsEmptyState:Yc,CreditsEyebrow:Wc,NoCreditsEyebrow:Jc,CreditsExhaustedBanner:vs});function eu(t){if(typeof t!="object"||t===null)return!1;const n=t.githubRepo?.url;return typeof n=="string"&&n.length>0}function tu(t){return!!ts(t??null)?.connectionId}function nu(t){return t.online?t.capabilities.includes("claude-code")||t.capabilities.includes("codex"):!1}export{Xd as C,Ac as T,Zl as a,eu as b,tu as c,ul as d,wc as e,Jd as f,Ol as g,nu as h,ci as i,dl as s,bs as u,Zd as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as M,r as S,j as o,l as q}from"./index-Ddo-OAlk.js";import{S as G}from"./scroll-area-lnnHcoAD.js";import{j as H,a4 as J,d as Q}from"./index-CtGs1DJJ.js";import{S as U}from"./schema-form-yX6Ft6zW.js";import{S as W}from"./save-status-Wb7i0dV6.js";import"./select-LFt-mET5.js";import"./tooltip-BUQdgInQ.js";import"./Check-Dd4DY5uR.js";import"./ChevronDown-q6om2VnP.js";import"./ChevronUp-CZ2c4QT8.js";import"./agent-capabilities-CsVK4Iyy.js";import"./pair-B1riNa41.js";import"./agent-icon-BfUtMte0.js";import"./AlertCircle-C7z-V8PW.js";import"./Tool01-G_qe4xr9.js";import"./SwitchHorizontal01-CJ4InXIK.js";import"./RefreshCcw01-DkjqduXo.js";import"./XCircle-BLtazoy5.js";import"./ArrowUpRight-DrdPL0e7.js";import"./ZapSquare-NBV5NA7W.js";import"./Users03-DzGgBVNT.js";import"./CheckCircle-FfKjcpCo.js";import"./ChevronLeft-MgGV-KON.js";import"./ChevronRight-DF_7Jr6-.js";import"./DotsVertical-ChEXuCNr.js";import"./Container-CLTqJvB-.js";import"./Eye-Cg3KEYLR.js";import"./ZoomOut-B-M27CLc.js";import"./Globe01-DhsYVZ78.js";import"./FilterLines-8Z1EXJU1.js";import"./Star01-CcEuFfec.js";import"./Palette-cVasQJYG.js";import"./HardDrive-I0CJViHA.js";import"./Stars02-BqzITFM8.js";import"./Key01-BOdS0XJd.js";import"./LayoutLeft-Bb0s-28Y.js";import"./LinkExternal01-D5bRZZ7Q.js";import"./Monitor01-BMO0nffP.js";import"./Sun-iU2rGybo.js";import"./Play-CnLbQjiF.js";import"./Plus-C2lPEpk2.js";import"./SearchMd-BZ5uFVyv.js";import"./Settings02-CkecSEd-.js";import"./Shield01-DHeMOigW.js";import"./Stars01-CbHt_6-5.js";import"./Trash01-CLPIYWB0.js";import"./Upload01-CMufGYXQ.js";import"./User01-DlH74QWo.js";import"./Users01-Cu8ZTFie.js";import"./XClose-n_6qPNJf.js";import"./X-DcUCV36T.js";import"./Zap-kDewRIEE.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ZYwX79XH.js";import"./file-type-icon-D-cvDShc.js";import"./dialog-qOMSPeFV.js";import"./content-blocks-o63cs2vh.js";import"./types-C1v54Mz6.js";import"./constants-BN3EnnK5.js";import"./chat-context-BllQ4wIO.js";import"./tab-id-CgZSqh3C.js";import"./decopilot-sse-pool-Cl6vHzIb.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-BlTQLNpO.js";import"./use-collections-DFTbd6Fl.js";import"./use-ai-providers-B_B7XI7_.js";import"./use-organization-settings-CCbA9nGy.js";import"./shell-layout-Chk-dikt.js";import"./avatar-CPeVEYzP.js";import"./required-auth-layout-DdJg8zF9.js";import"./useRouterState-BDC7x_pD.js";import"./use-org-sso-DLBFty4l.js";import"./integration-icon-Bud2iScJ.js";import"./use-navigate-to-agent-Cc-xymgp.js";import"./use-connection-lE__8xdh.js";import"./use-mcp-prompts-Dxg9Un5w.js";import"./form-DCJSDrN9.js";import"./label-B7rNFDmP.js";import"./input-rSCTpjle.js";import"./spinner-DecrbM2u.js";import"./drawer-DgiouEht.js";import"./collection-search-BRyG5fy4.js";import"./tabs-DCe9cJFy.js";import"./toggle-group-CVhoCxfd.js";import"./connect-desktop-dialog-BBJ3ZBYq.js";import"./agent-icons-hvA3E_Do.js";import"./checkbox-C3vxmcaB.js";import"./skeleton-DDFad7Zm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-nFhQ9DC2.js";import"./card-BoIkIdKw.js";import"./popover-C9laUh6-.js";import"./command-BqieK0cx.js";import"./index-Brd11Ohc.js";import"./useInfiniteQuery-FZ-eOLUd.js";import"./infiniteQueryObserver-DVXVEIds.js";import"./sortable.esm-BmQU85RQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Bm_mNiXs.js";import"./use-registry-connections-DLPkHVYT.js";import"./extract-connection-data-DUfac6xd.js";import"./generate-id-BxP01XU4.js";import"./collections-OmqpbRHJ.js";import"./collection-tabs-CZlafXgn.js";import"./badge-Sld47C66.js";import"./textarea-Dd_nswrz.js";import"./connection-form-helpers-B7Hi4AVw.js";import"./use-infinite-scroll-hBDGyHUM.js";import"./useSuspenseInfiniteQuery-DY0Najlz.js";import"./index-OvgvLmj6.js";import"./dropdown-menu-CD9L0NpR.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-CIX4Wpf7.js";import"./sidebar-BZQ9ZuwD.js";import"./sheet-pqbHPkyu.js";import"./toolbar-hSa6Dbq7.js";import"./use-create-virtual-mcp-B_aHPeoS.js";import"./github-repo-picker-DE4TiJ6h.js";import"./use-mcp-tools-QU_D_i6C.js";import"./alert-dialog-DjURN0Wv.js";import"./index-Bm7p6st-.js";import"./use-org-auth-client-NsurVUJ9.js";import"./hover-card-lMFQF9-F.js";import"./task-status-COuLaDdz.js";import"./use-status-sounds-B2yZVdDL.js";import"./empty-state-kyadFKbp.js";import"./resizable-D9zGGmNX.js";import"./use-capability-BGUE7EVy.js";import"./header-tab-button-6bRdq2K-.js";import"./index-HfFXcyYk.js";import"./user-CJzOQ38j.js";import"./tools-list-DuzN2FYL.js";import"./switch-BB-CM41R.js";import"./use-debounced-autosave-B34gfDHg.js";import"./index-UyCB-Rx1.js";import"./search-input-DwibiVVh.js";import"./use-secrets-cpRcdu7B.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-C2y9Pzbc.js";import"./view-mode-toggle-BRumGdwQ.js";import"./select-model-C3GfXMo3.js";import"./use-automations-DH2iF1St.js";import"./monaco-editor-CqDQuYzQ.js";import"./automation-runs-Cw5GALKR.js";import"./table-D77MLzgL.js";import"./use-members-BWJ8hwfe.js";import"./automation-list-row-0aY-wHMF.js";import"./calendar-D_lfc4-f.js";import"./image-field-Dzduad-d.js";import"./use-file-configs-Cax2DWWv.js";function qo(g){const t=M.c(38),{orgSlug:N,virtualMcpId:_,branch:k,blockKey:r,block:i,meta:m,title:E,excludeFields:n,schemaPending:C}=g,P=C===void 0?!1:C,e=typeof i?.__resolveType=="string"?i.__resolveType:"";let d;if(t[0]!==n||t[1]!==m||t[2]!==e){const c=e?H(e,m):null;d=c&&n?.length?{...c,properties:Object.fromEntries(Object.entries(c.properties??{}).filter(y=>{const[I]=y;return!n.includes(I)}))}:c,t[0]=n,t[1]=m,t[2]=e,t[3]=d}else d=t[3];const f=d;let u;t[4]!==i||t[5]!==r||t[6]!==m||t[7]!==E?(u=E??(i?J(r,i,m):r),t[4]=i,t[5]=r,t[6]=m,t[7]=E,t[8]=u):u=t[8];const B=u;let x;t[9]!==k||t[10]!==N||t[11]!==_?(x={orgSlug:N,virtualMcpId:_,branch:k},t[9]=k,t[10]=N,t[11]=_,t[12]=x):x=t[12];const{save:K,isPending:R}=Q(x),[A,L]=S.useState(r),[z,O]=S.useState(null),[V,D]=S.useState(0);let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[13]=h):h=t[13];const[w,$]=S.useState(h);A!==r&&(L(r),O(null),D(X),$([]));let v;t[14]!==i?(v=i??{},t[14]=i,t[15]=v):v=t[15];const F=z??v;let b;t[16]!==r||t[17]!==e||t[18]!==K?(b=c=>{const y=c;O(y),K(r,{...y,__resolveType:e})},t[16]=r,t[17]=e,t[18]=K,t[19]=b):b=t[19];const T=b;let p;t[20]!==B?(p=o.jsx("span",{className:"text-sm font-medium",children:B}),t[20]=B,t[21]=p):p=t[21];let s;t[22]!==R?(s=o.jsx(W,{isPending:R,isError:!1}),t[22]=R,t[23]=s):s=t[23];let l;t[24]!==p||t[25]!==s?(l=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[p,s]}),t[24]=p,t[25]=s,t[26]=l):l=t[26];let a;t[27]!==r||t[28]!==w||t[29]!==F||t[30]!==V||t[31]!==T||t[32]!==f||t[33]!==P?(a=o.jsx(G,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:f?o.jsx(U,{schema:f,value:F,onChange:T,basePath:"",breadcrumbPath:w,onBreadcrumbChange:$},`${r}:${V}`):P?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(q,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[27]=r,t[28]=w,t[29]=F,t[30]=V,t[31]=T,t[32]=f,t[33]=P,t[34]=a):a=t[34];let j;return t[35]!==l||t[36]!==a?(j=o.jsxs("div",{className:"flex h-full flex-col",children:[l,a]}),t[35]=l,t[36]=a,t[37]=j):j=t[37],j}function X(g){return g+1}export{qo as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as it,r as E,j as e,l as rt}from"./index-Ddo-OAlk.js";import{S as mt,d as pt,a as st,b as at}from"./sheet-pqbHPkyu.js";import{S as nt}from"./scroll-area-lnnHcoAD.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-enQgxFv1.js";import{j as xt}from"./index-CtGs1DJJ.js";import"./X-DcUCV36T.js";import"./select-LFt-mET5.js";import"./tooltip-BUQdgInQ.js";import"./Check-Dd4DY5uR.js";import"./ChevronDown-q6om2VnP.js";import"./ChevronUp-CZ2c4QT8.js";import"./label-B7rNFDmP.js";import"./switch-BB-CM41R.js";import"./schema-form-yX6Ft6zW.js";import"./agent-icon-BfUtMte0.js";import"./AlertCircle-C7z-V8PW.js";import"./Tool01-G_qe4xr9.js";import"./SwitchHorizontal01-CJ4InXIK.js";import"./RefreshCcw01-DkjqduXo.js";import"./XCircle-BLtazoy5.js";import"./ArrowUpRight-DrdPL0e7.js";import"./ZapSquare-NBV5NA7W.js";import"./Users03-DzGgBVNT.js";import"./CheckCircle-FfKjcpCo.js";import"./ChevronLeft-MgGV-KON.js";import"./ChevronRight-DF_7Jr6-.js";import"./DotsVertical-ChEXuCNr.js";import"./Container-CLTqJvB-.js";import"./Eye-Cg3KEYLR.js";import"./ZoomOut-B-M27CLc.js";import"./Globe01-DhsYVZ78.js";import"./FilterLines-8Z1EXJU1.js";import"./Star01-CcEuFfec.js";import"./Palette-cVasQJYG.js";import"./HardDrive-I0CJViHA.js";import"./Stars02-BqzITFM8.js";import"./Key01-BOdS0XJd.js";import"./LayoutLeft-Bb0s-28Y.js";import"./LinkExternal01-D5bRZZ7Q.js";import"./Monitor01-BMO0nffP.js";import"./Sun-iU2rGybo.js";import"./Play-CnLbQjiF.js";import"./Plus-C2lPEpk2.js";import"./SearchMd-BZ5uFVyv.js";import"./Settings02-CkecSEd-.js";import"./Shield01-DHeMOigW.js";import"./Stars01-CbHt_6-5.js";import"./Trash01-CLPIYWB0.js";import"./Upload01-CMufGYXQ.js";import"./User01-DlH74QWo.js";import"./Users01-Cu8ZTFie.js";import"./XClose-n_6qPNJf.js";import"./Zap-kDewRIEE.js";import"./calendar-D_lfc4-f.js";import"./input-rSCTpjle.js";import"./popover-C9laUh6-.js";import"./textarea-Dd_nswrz.js";import"./dropdown-menu-CD9L0NpR.js";import"./image-field-Dzduad-d.js";import"./dialog-qOMSPeFV.js";import"./skeleton-DDFad7Zm.js";import"./tabs-DCe9cJFy.js";import"./use-file-configs-Cax2DWWv.js";import"./constants-BN3EnnK5.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./useInfiniteQuery-FZ-eOLUd.js";import"./infiniteQueryObserver-DVXVEIds.js";import"./agent-capabilities-CsVK4Iyy.js";import"./pair-B1riNa41.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ZYwX79XH.js";import"./file-type-icon-D-cvDShc.js";import"./content-blocks-o63cs2vh.js";import"./types-C1v54Mz6.js";import"./chat-context-BllQ4wIO.js";import"./tab-id-CgZSqh3C.js";import"./decopilot-sse-pool-Cl6vHzIb.js";import"./create-sse-subscription-BS5983N4.js";import"./use-virtual-mcp-BlTQLNpO.js";import"./use-collections-DFTbd6Fl.js";import"./use-ai-providers-B_B7XI7_.js";import"./use-organization-settings-CCbA9nGy.js";import"./shell-layout-Chk-dikt.js";import"./avatar-CPeVEYzP.js";import"./required-auth-layout-DdJg8zF9.js";import"./useRouterState-BDC7x_pD.js";import"./use-org-sso-DLBFty4l.js";import"./integration-icon-Bud2iScJ.js";import"./use-navigate-to-agent-Cc-xymgp.js";import"./use-connection-lE__8xdh.js";import"./use-mcp-prompts-Dxg9Un5w.js";import"./form-DCJSDrN9.js";import"./spinner-DecrbM2u.js";import"./drawer-DgiouEht.js";import"./collection-search-BRyG5fy4.js";import"./toggle-group-CVhoCxfd.js";import"./connect-desktop-dialog-BBJ3ZBYq.js";import"./agent-icons-hvA3E_Do.js";import"./checkbox-C3vxmcaB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-nFhQ9DC2.js";import"./card-BoIkIdKw.js";import"./command-BqieK0cx.js";import"./index-Brd11Ohc.js";import"./sortable.esm-BmQU85RQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Bm_mNiXs.js";import"./use-registry-connections-DLPkHVYT.js";import"./extract-connection-data-DUfac6xd.js";import"./generate-id-BxP01XU4.js";import"./collections-OmqpbRHJ.js";import"./collection-tabs-CZlafXgn.js";import"./badge-Sld47C66.js";import"./connection-form-helpers-B7Hi4AVw.js";import"./use-infinite-scroll-hBDGyHUM.js";import"./useSuspenseInfiniteQuery-DY0Najlz.js";import"./index-OvgvLmj6.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-CIX4Wpf7.js";import"./sidebar-BZQ9ZuwD.js";import"./toolbar-hSa6Dbq7.js";import"./use-create-virtual-mcp-B_aHPeoS.js";import"./github-repo-picker-DE4TiJ6h.js";import"./use-mcp-tools-QU_D_i6C.js";import"./alert-dialog-DjURN0Wv.js";import"./index-Bm7p6st-.js";import"./use-org-auth-client-NsurVUJ9.js";import"./hover-card-lMFQF9-F.js";import"./task-status-COuLaDdz.js";import"./use-status-sounds-B2yZVdDL.js";import"./empty-state-kyadFKbp.js";import"./resizable-D9zGGmNX.js";import"./use-capability-BGUE7EVy.js";import"./header-tab-button-6bRdq2K-.js";import"./index-HfFXcyYk.js";import"./user-CJzOQ38j.js";import"./tools-list-DuzN2FYL.js";import"./use-debounced-autosave-B34gfDHg.js";import"./index-UyCB-Rx1.js";import"./search-input-DwibiVVh.js";import"./use-secrets-cpRcdu7B.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-C2y9Pzbc.js";import"./view-mode-toggle-BRumGdwQ.js";import"./select-model-C3GfXMo3.js";import"./use-automations-DH2iF1St.js";import"./monaco-editor-CqDQuYzQ.js";import"./automation-runs-Cw5GALKR.js";import"./table-D77MLzgL.js";import"./use-members-BWJ8hwfe.js";import"./automation-list-row-0aY-wHMF.js";function Si(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(jt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),j=m.kind==="page",ot=j?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=j?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!j||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let w;t[0]!==s?(w=vt(s),t[0]=s,t[1]=w):w=t[1];const M=w;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=j&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function jt(u){return u+1}export{Si as SeoSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as H,q as $,j}from"./index-Ddo-OAlk.js";import{h as q,g as O,s as b}from"./pair-B1riNa41.js";import{u as v}from"./constants-BN3EnnK5.js";import{a as L,c as B}from"./use-mcp-tools-QU_D_i6C.js";import{c as Y}from"./content-blocks-o63cs2vh.js";import{g as k,M as G,a as E}from"./types-C1v54Mz6.js";import{a as V,c as z}from"./chat-context-BllQ4wIO.js";import{u as F}from"./shell-layout-Chk-dikt.js";import"./agent-icon-BfUtMte0.js";import"./AlertCircle-C7z-V8PW.js";import"./Tool01-G_qe4xr9.js";import"./SwitchHorizontal01-CJ4InXIK.js";import"./RefreshCcw01-DkjqduXo.js";import"./XCircle-BLtazoy5.js";import"./ArrowUpRight-DrdPL0e7.js";import"./ZapSquare-NBV5NA7W.js";import"./Users03-DzGgBVNT.js";import"./CheckCircle-FfKjcpCo.js";import"./Check-Dd4DY5uR.js";import"./ChevronDown-q6om2VnP.js";import"./ChevronLeft-MgGV-KON.js";import"./ChevronRight-DF_7Jr6-.js";import"./ChevronUp-CZ2c4QT8.js";import"./DotsVertical-ChEXuCNr.js";import"./Container-CLTqJvB-.js";import"./Eye-Cg3KEYLR.js";import"./ZoomOut-B-M27CLc.js";import"./Globe01-DhsYVZ78.js";import"./FilterLines-8Z1EXJU1.js";import"./Star01-CcEuFfec.js";import"./Palette-cVasQJYG.js";import"./HardDrive-I0CJViHA.js";import"./Stars02-BqzITFM8.js";import"./Key01-BOdS0XJd.js";import"./LayoutLeft-Bb0s-28Y.js";import"./LinkExternal01-D5bRZZ7Q.js";import"./Monitor01-BMO0nffP.js";import"./Sun-iU2rGybo.js";import"./Play-CnLbQjiF.js";import"./Plus-C2lPEpk2.js";import"./SearchMd-BZ5uFVyv.js";import"./Settings02-CkecSEd-.js";import"./Shield01-DHeMOigW.js";import"./Stars01-CbHt_6-5.js";import"./Trash01-CLPIYWB0.js";import"./Upload01-CMufGYXQ.js";import"./User01-DlH74QWo.js";import"./Users01-Cu8ZTFie.js";import"./XClose-n_6qPNJf.js";import"./X-DcUCV36T.js";import"./Zap-kDewRIEE.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-lnnHcoAD.js";import"./select-LFt-mET5.js";import"./tooltip-BUQdgInQ.js";import"./use-copy-ZYwX79XH.js";import"./file-type-icon-D-cvDShc.js";import"./dialog-qOMSPeFV.js";import"./tab-id-CgZSqh3C.js";import"./decopilot-sse-pool-Cl6vHzIb.js";import"./create-sse-subscription-BS5983N4.js";import"./integration-icon-Bud2iScJ.js";import"./use-virtual-mcp-BlTQLNpO.js";import"./use-collections-DFTbd6Fl.js";import"./use-navigate-to-agent-Cc-xymgp.js";import"./use-connection-lE__8xdh.js";import"./use-mcp-prompts-Dxg9Un5w.js";import"./form-DCJSDrN9.js";import"./label-B7rNFDmP.js";import"./input-rSCTpjle.js";import"./spinner-DecrbM2u.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-B_B7XI7_.js";import"./use-organization-settings-CCbA9nGy.js";import"./avatar-CPeVEYzP.js";import"./required-auth-layout-DdJg8zF9.js";import"./useRouterState-BDC7x_pD.js";import"./use-org-sso-DLBFty4l.js";const J={};function K(S){const t=H.c(37),{client:r,resourceURI:g,tool:e,connectionId:s,orgId:a,args:c}=S,{sendMessage:u}=V(),{setAppContext:d,clearAppContext:o}=z(),{setChatOpen:f,openTab:m}=F(),p=`${s}:${e.name}`;let l;t[0]!==m?(l=h=>h==="inline"?(m("0"),"inline"):"fullscreen",t[0]=m,t[1]=l):l=t[1];const i=l,n=c??J;let T;t[2]!==r||t[3]!==e.name||t[4]!==n?(T={client:r,toolName:e.name,toolArguments:n},t[2]=r,t[3]=e.name,t[4]=n,t[5]=T):T=t[5];const{data:x}=B(T);let R;if(t[6]!==e._meta||t[7]!==e.name){const h=O(e._meta);R=b(e.name,h),t[6]=e._meta,t[7]=e.name,t[8]=R}else R=t[8];const U=R;let I;t[9]!==e.inputSchema?(I=e.inputSchema??{type:"object"},t[9]=e.inputSchema,t[10]=I):I=t[10];let N;t[11]!==U||t[12]!==I||t[13]!==e?(N={...e,name:U,inputSchema:I},t[11]=U,t[12]=I,t[13]=e,t[14]=N):N=t[14];const y=N;let _;t[15]!==u||t[16]!==f?(_=h=>{const w=Y(h.content);w.content.length>0&&(f(!0),u({tiptapDoc:w}))},t[15]=u,t[16]=f,t[17]=_):_=t[17];const D=_;let C;t[18]!==y?(C={tool:y},t[18]=y,t[19]=C):C=t[19];let M;t[20]!==d||t[21]!==p?(M=h=>d(p,h),t[20]=d,t[21]=p,t[22]=M):M=t[22];let P;t[23]!==o||t[24]!==p?(P=()=>o(p),t[23]=o,t[24]=p,t[25]=P):P=t[25];let A;return t[26]!==r||t[27]!==D||t[28]!==i||t[29]!==a||t[30]!==g||t[31]!==C||t[32]!==M||t[33]!==P||t[34]!==n||t[35]!==x?(A=j.jsx(G,{resourceURI:g,orgId:a,toolInfo:C,toolInput:n,toolResult:x,displayMode:"fullscreen",minHeight:E.fullscreen.minHeight,maxHeight:E.fullscreen.maxHeight,client:r,onMessage:D,onUpdateModelContext:M,onTeardown:P,onRequestDisplayMode:i,className:"h-full"}),t[26]=r,t[27]=D,t[28]=i,t[29]=a,t[30]=g,t[31]=C,t[32]=M,t[33]=P,t[34]=n,t[35]=x,t[36]=A):A=t[36],A}function Pe(S){const t=H.c(20),{connectionId:r,toolName:g,args:e}=S,{org:s}=$();let a;t[0]!==r||t[1]!==s.id||t[2]!==s.slug?(a={connectionId:r,orgId:s.id,orgSlug:s.slug},t[0]=r,t[1]=s.id,t[2]=s.slug,t[3]=a):a=t[3];const c=v(a);let u;t[4]!==c?(u={client:c},t[4]=c,t[5]=u):u=t[5];const{data:d}=L(u);let o,f,m;t[6]!==g||t[7]!==d.tools?(o=q(decodeURIComponent(g)),m=d.tools.find(i=>i.name===o)??d.tools.find(i=>{const n=O(i._meta);if(!n)return!1;if(b(i.name,n)===o)return!0;const x=b(o,n);return x!==o&&i.name===x}),f=m?._meta?k(m._meta):void 0,t[6]=g,t[7]=d.tools,t[8]=o,t[9]=f,t[10]=m):(o=t[8],f=t[9],m=t[10]);const p=f;if(!m||!p){let i;return t[11]!==o?(i=j.jsx("div",{className:"flex items-center justify-center h-full w-full",children:j.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',o,'" not found or has no UI']})}),t[11]=o,t[12]=i):i=t[12],i}let l;return t[13]!==e||t[14]!==c||t[15]!==r||t[16]!==s.id||t[17]!==p||t[18]!==m?(l=j.jsx(K,{client:c,resourceURI:p,tool:m,connectionId:r,orgId:s.id,args:e}),t[13]=e,t[14]=c,t[15]=r,t[16]=s.id,t[17]=p,t[18]=m,t[19]=l):l=t[19],l}export{Pe as AppViewContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as C,j as r}from"./index-Ddo-OAlk.js";import{I as F}from"./input-rSCTpjle.js";import{L as T}from"./label-B7rNFDmP.js";import{T as L}from"./textarea-Dd_nswrz.js";import{I as A}from"./image-field-Dzduad-d.js";import{a7 as R,a8 as D,aa as J}from"./index-CtGs1DJJ.js";import{u as K,s as S}from"./primitives-B4sR9JrK.js";import{S as M}from"./save-status-Wb7i0dV6.js";import"./Tool01-G_qe4xr9.js";import"./Trash01-CLPIYWB0.js";import"./Upload01-CMufGYXQ.js";import"./AlertCircle-C7z-V8PW.js";import"./Check-Dd4DY5uR.js";import"./Eye-Cg3KEYLR.js";import"./DotsVertical-ChEXuCNr.js";import"./agent-icon-BfUtMte0.js";import"./SwitchHorizontal01-CJ4InXIK.js";import"./RefreshCcw01-DkjqduXo.js";import"./XCircle-BLtazoy5.js";import"./ArrowUpRight-DrdPL0e7.js";import"./ZapSquare-NBV5NA7W.js";import"./Users03-DzGgBVNT.js";import"./CheckCircle-FfKjcpCo.js";import"./ChevronDown-q6om2VnP.js";import"./ChevronLeft-MgGV-KON.js";import"./ChevronRight-DF_7Jr6-.js";import"./ChevronUp-CZ2c4QT8.js";import"./Container-CLTqJvB-.js";import"./ZoomOut-B-M27CLc.js";import"./Globe01-DhsYVZ78.js";import"./FilterLines-8Z1EXJU1.js";import"./Star01-CcEuFfec.js";import"./Palette-cVasQJYG.js";import"./HardDrive-I0CJViHA.js";import"./Stars02-BqzITFM8.js";import"./Key01-BOdS0XJd.js";import"./LayoutLeft-Bb0s-28Y.js";import"./LinkExternal01-D5bRZZ7Q.js";import"./Monitor01-BMO0nffP.js";import"./Sun-iU2rGybo.js";import"./Play-CnLbQjiF.js";import"./Plus-C2lPEpk2.js";import"./SearchMd-BZ5uFVyv.js";import"./Settings02-CkecSEd-.js";import"./Shield01-DHeMOigW.js";import"./Stars01-CbHt_6-5.js";import"./User01-DlH74QWo.js";import"./Users01-Cu8ZTFie.js";import"./XClose-n_6qPNJf.js";import"./X-DcUCV36T.js";import"./Zap-kDewRIEE.js";import"./dialog-qOMSPeFV.js";import"./dropdown-menu-CD9L0NpR.js";import"./skeleton-DDFad7Zm.js";import"./tabs-DCe9cJFy.js";import"./use-file-configs-Cax2DWWv.js";import"./constants-BN3EnnK5.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./useInfiniteQuery-FZ-eOLUd.js";import"./infiniteQueryObserver-DVXVEIds.js";import"./agent-capabilities-CsVK4Iyy.js";import"./pair-B1riNa41.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-lnnHcoAD.js";import"./select-LFt-mET5.js";import"./tooltip-BUQdgInQ.js";import"./use-copy-ZYwX79XH.js";import"./file-type-icon-D-cvDShc.js";import"./content-blocks-o63cs2vh.js";import"./types-C1v54Mz6.js";import"./chat-context-BllQ4wIO.js";import"./tab-id-CgZSqh3C.js";import"./decopilot-sse-pool-Cl6vHzIb.js";import"./create-sse-subscription-BS5983N4.js";import"./use-virtual-mcp-BlTQLNpO.js";import"./use-collections-DFTbd6Fl.js";import"./use-ai-providers-B_B7XI7_.js";import"./use-organization-settings-CCbA9nGy.js";import"./shell-layout-Chk-dikt.js";import"./avatar-CPeVEYzP.js";import"./required-auth-layout-DdJg8zF9.js";import"./useRouterState-BDC7x_pD.js";import"./use-org-sso-DLBFty4l.js";import"./integration-icon-Bud2iScJ.js";import"./use-navigate-to-agent-Cc-xymgp.js";import"./use-connection-lE__8xdh.js";import"./use-mcp-prompts-Dxg9Un5w.js";import"./form-DCJSDrN9.js";import"./spinner-DecrbM2u.js";import"./drawer-DgiouEht.js";import"./collection-search-BRyG5fy4.js";import"./toggle-group-CVhoCxfd.js";import"./connect-desktop-dialog-BBJ3ZBYq.js";import"./agent-icons-hvA3E_Do.js";import"./checkbox-C3vxmcaB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-nFhQ9DC2.js";import"./card-BoIkIdKw.js";import"./popover-C9laUh6-.js";import"./command-BqieK0cx.js";import"./index-Brd11Ohc.js";import"./sortable.esm-BmQU85RQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Bm_mNiXs.js";import"./use-registry-connections-DLPkHVYT.js";import"./extract-connection-data-DUfac6xd.js";import"./generate-id-BxP01XU4.js";import"./collections-OmqpbRHJ.js";import"./collection-tabs-CZlafXgn.js";import"./badge-Sld47C66.js";import"./connection-form-helpers-B7Hi4AVw.js";import"./use-infinite-scroll-hBDGyHUM.js";import"./useSuspenseInfiniteQuery-DY0Najlz.js";import"./index-OvgvLmj6.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-CIX4Wpf7.js";import"./sidebar-BZQ9ZuwD.js";import"./sheet-pqbHPkyu.js";import"./toolbar-hSa6Dbq7.js";import"./use-create-virtual-mcp-B_aHPeoS.js";import"./github-repo-picker-DE4TiJ6h.js";import"./use-mcp-tools-QU_D_i6C.js";import"./alert-dialog-DjURN0Wv.js";import"./index-Bm7p6st-.js";import"./use-org-auth-client-NsurVUJ9.js";import"./hover-card-lMFQF9-F.js";import"./task-status-COuLaDdz.js";import"./use-status-sounds-B2yZVdDL.js";import"./empty-state-kyadFKbp.js";import"./resizable-D9zGGmNX.js";import"./use-capability-BGUE7EVy.js";import"./header-tab-button-6bRdq2K-.js";import"./index-HfFXcyYk.js";import"./user-CJzOQ38j.js";import"./tools-list-DuzN2FYL.js";import"./switch-BB-CM41R.js";import"./use-debounced-autosave-B34gfDHg.js";import"./index-UyCB-Rx1.js";import"./search-input-DwibiVVh.js";import"./use-secrets-cpRcdu7B.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-C2y9Pzbc.js";import"./view-mode-toggle-BRumGdwQ.js";import"./select-model-C3GfXMo3.js";import"./use-automations-DH2iF1St.js";import"./monaco-editor-CqDQuYzQ.js";import"./automation-runs-Cw5GALKR.js";import"./table-D77MLzgL.js";import"./use-members-BWJ8hwfe.js";import"./automation-list-row-0aY-wHMF.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}],categories:[{key:"name",label:"Name",widget:"text"},{key:"slug",label:"Slug",widget:"text",placeholder:"my-category"}]},q={authors:"Author",categories:"Category"};function Tr(P){const t=C.c(34),{orgSlug:v,virtualMcpId:j,branch:w,kind:p,blockKey:y,block:f}=P;let u;t[0]!==w||t[1]!==v||t[2]!==j?(u={orgSlug:v,virtualMcpId:j,branch:w},t[0]=w,t[1]=v,t[2]=j,t[3]=u):u=t[3];const m=R(u);let d;t[4]!==f||t[5]!==p?(d=D(f,p),t[4]=f,t[5]=p,t[6]=d):d=t[6];const B=d;let h;t[7]!==y||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:y,data:J(y,p,e)})},t[7]=y,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=K(B,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(M,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(A,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:x=>a(o.key,x),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(T,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:S(i[o.key]),onChange:x=>a(o.key,x.target.value),rows:3}):r.jsx(F,{id:o.key,value:S(i[o.key]),placeholder:o.placeholder,onChange:x=>a(o.key,x.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let g;t[29]!==c?(g=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=g):g=t[30];let b;return t[31]!==g||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,g]}),t[31]=g,t[32]=n,t[33]=b):b=t[33],b}export{Tr as RecordEditor};
|