decocms 4.504.4 → 4.504.5
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/{ActiveShapeUtils-Brc5d1pX.js → ActiveShapeUtils-BvE9DP0A.js} +1 -1
- package/dist/client/assets/{AlertCircle-CrNq5UW4.js → AlertCircle-BQdHDXJE.js} +1 -1
- package/dist/client/assets/{AreaChart-DbQimEDO.js → AreaChart-CuQfQnjl.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Ia--rShd.js → ArrowLeft-4FjatJyh.js} +1 -1
- package/dist/client/assets/{ArrowUp-C4srIojM.js → ArrowUp-DUcJqTJ2.js} +1 -1
- package/dist/client/assets/{BarChart-CWRN34te.js → BarChart-DS9u9cl4.js} +1 -1
- package/dist/client/assets/{Building02-luVjcvOq.js → Building02-CZSoBcjF.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BVWnHIIh.js → CategoricalChart-D8-cYJ68.js} +1 -1
- package/dist/client/assets/{CheckCircle-BJwooAky.js → CheckCircle-bt0DVl-x.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BS0pq1X-.js → ChevronSelectorVertical-C4Qpvky2.js} +1 -1
- package/dist/client/assets/{ChevronUp-D2OopJl6.js → ChevronUp-CM5YHZaR.js} +1 -1
- package/dist/client/assets/{Copy01-Xsj4E7Vx.js → Copy01-DJfs9oWc.js} +1 -1
- package/dist/client/assets/{CreditCard01-C6RQq3u0.js → CreditCard01-DPVVFici.js} +1 -1
- package/dist/client/assets/{DotsVertical-CgcOPA0F.js → DotsVertical-D7kGSpp1.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CSLswQU1.js → ErrorBarContext-BPhe-AM2.js} +1 -1
- package/dist/client/assets/{Globe04-BUNgxQSF.js → Globe04-frPv3egH.js} +1 -1
- package/dist/client/assets/{Image01-BlMyvXMa.js → Image01-OFj3FDBn.js} +1 -1
- package/dist/client/assets/{Key01-DXZkJBcF.js → Key01-DpM4YxSh.js} +1 -1
- package/dist/client/assets/{Link01-D5d5rf-A.js → Link01-DhmloT9o.js} +1 -1
- package/dist/client/assets/{LinkBroken01-BUtnpCHY.js → LinkBroken01-CT5dhAsI.js} +1 -1
- package/dist/client/assets/{Monitor01-Bd7h349e.js → Monitor01-CPZ0C_n4.js} +1 -1
- package/dist/client/assets/{Play-DhG6M9bL.js → Play-C2R_ghID.js} +1 -1
- package/dist/client/assets/{Plus-CXYJbwnT.js → Plus-BR_HFiUM.js} +1 -1
- package/dist/client/assets/{SearchMd-CbiQ5nzb.js → SearchMd-ByqZu5hY.js} +1 -1
- package/dist/client/assets/{Sector-COnN84fv.js → Sector-y4N7A4B7.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BUUGNtCW.js → ShoppingBag01-DVbVy_Vw.js} +1 -1
- package/dist/client/assets/{Sun-DywxYOA_.js → Sun-C29e_Ety.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CFqAO4Zr.js → SwitchHorizontal01-CLalNFG1.js} +1 -1
- package/dist/client/assets/{Tool01-B3Uc_vub.js → Tool01-BdsfSdtC.js} +1 -1
- package/dist/client/assets/{Trash01-22at-20v.js → Trash01-BSY13r-M.js} +1 -1
- package/dist/client/assets/{Upload01-Cc9Hq4Fr.js → Upload01-Dh-c49ZF.js} +1 -1
- package/dist/client/assets/{User01-opxZZPmx.js → User01-C7KADwYC.js} +1 -1
- package/dist/client/assets/{UserSquare-BX4djEpB.js → UserSquare-BJGiIPKK.js} +1 -1
- package/dist/client/assets/{Users01-D3681W8-.js → Users01-Dc2J4jVj.js} +1 -1
- package/dist/client/assets/{XAxis-BpE_yBSW.js → XAxis-BUiYPQe3.js} +1 -1
- package/dist/client/assets/{XClose-B7qLXd7M.js → XClose-Uumbdavl.js} +1 -1
- package/dist/client/assets/{ZoomOut-D4UNIXaW.js → ZoomOut-RWcNZa7o.js} +1 -1
- package/dist/client/assets/{access-gate-DoeSiNts.js → access-gate-D4CZnnTY.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CjrhrQlh.js → add-connection-dialog-DwXBXDc-.js} +1 -1
- package/dist/client/assets/{agent-analytics-B_T4aY0Y.js → agent-analytics-D_Gjr6cU.js} +1 -1
- package/dist/client/assets/agent-app-DMOn6M2J.js +1 -0
- package/dist/client/assets/{agent-assets-BlhKpI5F.js → agent-assets-B_yGvAbI.js} +1 -1
- package/dist/client/assets/{agent-automation-BGX4Gwuc.js → agent-automation-Cn2mfaAz.js} +1 -1
- package/dist/client/assets/{agent-automations-D6ApYEFJ.js → agent-automations-7eDob4rm.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-COtLGBLy.js → agent-connect-sources-Bp9b1ZvD.js} +1 -1
- package/dist/client/assets/agent-deck-DdbU4d0F.js +1 -0
- package/dist/client/assets/{agent-e2e-BhLeTCyN.js → agent-e2e-B_FiDnC-.js} +1 -1
- package/dist/client/assets/{agent-experiments-Cm16Pf2x.js → agent-experiments-BpHpNmgw.js} +1 -1
- package/dist/client/assets/{agent-file-BFXu4gCx.js → agent-file-DW9J8mYI.js} +1 -1
- package/dist/client/assets/{agent-hosting-DdE-lFp_.js → agent-hosting-1x_pxC4R.js} +1 -1
- package/dist/client/assets/{agent-icon-fSXvGEFF.js → agent-icon-CD07XpUI.js} +1 -1
- package/dist/client/assets/agent-library-B1E2kv1y.js +1 -0
- package/dist/client/assets/agent-library-file-DdyXykXJ.js +1 -0
- package/dist/client/assets/{agent-monitor-B1lUwXTh.js → agent-monitor-DCTO_Q2z.js} +1 -1
- package/dist/client/assets/{agent-overview-RxVy0TL3.js → agent-overview-CYQloqgc.js} +1 -1
- package/dist/client/assets/{agent-releases-DduByY6v.js → agent-releases-BHceLfTF.js} +1 -1
- package/dist/client/assets/agent-settings-BB46K8nG.js +1 -0
- package/dist/client/assets/{agent-site-editor-BSVFc_zn.js → agent-site-editor-B7QfDymn.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-D0BjB7QF.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BxIcdel1.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CHYagg6d.js +1 -0
- package/dist/client/assets/agent-view-Dr0gONeY.js +1 -0
- package/dist/client/assets/{agent-view-guard-ChiTh2c8.js → agent-view-guard-CW4kPRWd.js} +1 -1
- package/dist/client/assets/{agents-list-eFknqRtW.js → agents-list-CiexXkfv.js} +1 -1
- package/dist/client/assets/{ai-providers-QXQ5RY9v.js → ai-providers-PFcD7V9H.js} +1 -1
- package/dist/client/assets/{alert-bHgVlIQ8.js → alert-BvqHAX7E.js} +1 -1
- package/dist/client/assets/{alert-dialog-BJUwNXhZ.js → alert-dialog-C_p3pkwH.js} +1 -1
- package/dist/client/assets/{analytics-sections-DmlITx0B.js → analytics-sections-DHBBQ9wO.js} +1 -1
- package/dist/client/assets/{api-keys-XJW7TxPL.js → api-keys-BccompPs.js} +1 -1
- package/dist/client/assets/api-keys-Dp0Eruhl.js +1 -0
- package/dist/client/assets/{app-editor-SUDXnth2.js → app-editor-BAuYUHp3.js} +1 -1
- package/dist/client/assets/{asset-utils-DcsPiKCN.js → asset-utils-CrGrIHpa.js} +1 -1
- package/dist/client/assets/{auth-C2PmqiPN.js → auth-CYWcAkNL.js} +1 -1
- package/dist/client/assets/{auth-catchall-Cnade6m7.js → auth-catchall-BmgS9JJx.js} +1 -1
- package/dist/client/assets/{auth-entry-DOv1R6MU.js → auth-entry-BxKhAxz3.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D0EQIDeI.js → auth-split-layout-xHFkblHl.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bgh4vNiN.js → authenticate-and-persist-oauth-CMBvt9CI.js} +1 -1
- package/dist/client/assets/{automation-list-row-qtTvX8_I.js → automation-list-row-Yna-cnHL.js} +1 -1
- package/dist/client/assets/{automation-runs-Bv7Z2W-z.js → automation-runs-CCyQWHeV.js} +1 -1
- package/dist/client/assets/{automations-CvIJtrOG.js → automations-lkDqfQZ7.js} +1 -1
- package/dist/client/assets/{autosend-DAp5Pl4Y.js → autosend-i3qEjciO.js} +1 -1
- package/dist/client/assets/{avatar-COJ0KMsq.js → avatar-CVAjlXTO.js} +1 -1
- package/dist/client/assets/{badge-DvXYCBPO.js → badge-0p-_GJaz.js} +1 -1
- package/dist/client/assets/{block-document-B8n2L0Tm.js → block-document-C3G8S8aL.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DeS7AcQ8.js → blocks-preview-workspace-context-BZBg-R0e.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-D4w6meKu.js → blocks-tab-states-CuNbEAfg.js} +3 -3
- package/dist/client/assets/{blog-schema-Ar1X8nFh.js → blog-schema-CiRPhTeQ.js} +1 -1
- package/dist/client/assets/{board-analytics-B29dUGHL.js → board-analytics-CAGRx3L3.js} +1 -1
- package/dist/client/assets/{buckets-gGpGJWG2.js → buckets-BKfm6wVy.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CzVthwT5.js → build-improve-prompt-doc-CAmdG3QN.js} +1 -1
- package/dist/client/assets/{calendar-ZbQlkIWK.js → calendar-DovEEx6p.js} +1 -1
- package/dist/client/assets/{capability-load-error-DXqW1BiC.js → capability-load-error-CRL7cIk0.js} +1 -1
- package/dist/client/assets/{category-editor-_SYDylyj.js → category-editor-BTQpWrQd.js} +1 -1
- package/dist/client/assets/{chart-DJF3LiAG.js → chart-BwUflCce.js} +1 -1
- package/dist/client/assets/{chat-context-BvklKKli.js → chat-context-UIAA0h5o.js} +1 -1
- package/dist/client/assets/{chat-draft-6dAMTylQ.js → chat-draft-75zJmfvC.js} +1 -1
- package/dist/client/assets/{checkbox-DvJFFwH2.js → checkbox-D15fApKh.js} +1 -1
- package/dist/client/assets/{choose-editor-B7nvao1Q.js → choose-editor-Bk0KD7zB.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Bs80jALP.js → cli-auth-success-CojHpkoX.js} +1 -1
- package/dist/client/assets/{client-icons-Bm858rY4.js → client-icons-u7JLCr9L.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CG2bbdng.js +1 -0
- package/dist/client/assets/{collapsible-BBQrOjSc.js → collapsible-T8Cyd4gB.js} +1 -1
- package/dist/client/assets/{collection-detail-Cil-gH3Z.js → collection-detail-BE0WKZXD.js} +1 -1
- package/dist/client/assets/{collection-display-button-GoFiR2Yi.js → collection-display-button-P0_-AxwZ.js} +1 -1
- package/dist/client/assets/{collection-search-BAR6LJTs.js → collection-search-BLm1Rh3R.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CJznnneM.js → collection-table-wrapper-BEDOH7M_.js} +1 -1
- package/dist/client/assets/{collection-tabs-Psv0czM0.js → collection-tabs-SQnRb19p.js} +1 -1
- package/dist/client/assets/{column-rules-pAaWo_1G.js → column-rules-B9HEqIpQ.js} +1 -1
- package/dist/client/assets/{combobox-DjvnPMJ6.js → combobox-Dpry0cKX.js} +1 -1
- package/dist/client/assets/{command-DOhRS27k.js → command-3GSRDq3K.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BLNXKM_z.js → companion-mcps-section-Bg4ufE-p.js} +1 -1
- package/dist/client/assets/{config-CVgJUl_7.js → config--bd-npGm.js} +1 -1
- package/dist/client/assets/{connect-DWRjwVtt.js → connect-C604fQh8.js} +1 -1
- package/dist/client/assets/{connect-layout-CZDp-q5V.js → connect-layout-Bs-47nZn.js} +1 -1
- package/dist/client/assets/{connection-Dk0fSKdj.js → connection-CsADVd0t.js} +1 -1
- package/dist/client/assets/{connection-card-DFF5yVcg.js → connection-card-CK1Gp5gM.js} +1 -1
- package/dist/client/assets/{connection-detail-BzZN1Kg9.js → connection-detail-ChkOBaQp.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-gDrmHMdP.js → connection-form-helpers-CeZBy2s9.js} +1 -1
- package/dist/client/assets/{connections-Dp9gq3bQ.js → connections-DNWP2zur.js} +1 -1
- package/dist/client/assets/{content-tab-BchR3p9m.js → content-tab-CzNwh-vw.js} +3 -3
- package/dist/client/assets/{context-9gi2kj1l.js → context-2qSH6BJN.js} +1 -1
- package/dist/client/assets/{context-menu-DQf072Fw.js → context-menu-B0DcdieA.js} +1 -1
- package/dist/client/assets/{core.esm-DxzG-twT.js → core.esm-ykfX6e5q.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CnfCmdhF.js → create-organization-dialog-BwWv0HTk.js} +1 -1
- package/dist/client/assets/{daily-pulse-DvwtR4v_.js → daily-pulse-BMWPtZba.js} +1 -1
- package/dist/client/assets/{discover-B1NhciiN.js → discover-BczUCHf6.js} +1 -1
- package/dist/client/assets/{domain-settings-CA3wEwpi.js → domain-settings-C-fput9j.js} +1 -1
- package/dist/client/assets/{drawer-CdY7mjQo.js → drawer-H1iY2MTY.js} +1 -1
- package/dist/client/assets/{editor-BASUBjsa.js → editor-DZh5oaTh.js} +1 -1
- package/dist/client/assets/{editor-classes-DRZM62yu.js → editor-classes-DhPEVivY.js} +1 -1
- package/dist/client/assets/{empty-state-CcEtQGBF.js → empty-state-Bgl7kp65.js} +1 -1
- package/dist/client/assets/{empty-state-Gfqa_iKJ.js → empty-state-CE5qTyvm.js} +1 -1
- package/dist/client/assets/{extract-connection-data-FnGxTvG1.js → extract-connection-data-BNOCaLyI.js} +1 -1
- package/dist/client/assets/{feature-gate-D_8i7ELw.js → feature-gate-Bjep93-G.js} +1 -1
- package/dist/client/assets/{feature-paywall-DY5B-D1h.js → feature-paywall-CZ-3eKXv.js} +1 -1
- package/dist/client/assets/{file-explorer-C55ltLC5.js → file-explorer-VJiDmWjm.js} +1 -1
- package/dist/client/assets/{file-preview-BkIaEjRu.js → file-preview-HVQ_xAzr.js} +1 -1
- package/dist/client/assets/{file-share-button-emkLowRu.js → file-share-button-CKh6vr_P.js} +1 -1
- package/dist/client/assets/{file-type-icon-CUgv_W6Q.js → file-type-icon-CvZlzH43.js} +1 -1
- package/dist/client/assets/flat-project-DmDOWUOH.js +1 -0
- package/dist/client/assets/{folder-icon-BJHweZ_m.js → folder-icon-DyL8LHOI.js} +1 -1
- package/dist/client/assets/{form-UQ78ocmL.js → form-DeAkvXbd.js} +1 -1
- package/dist/client/assets/{general-VKoYwo8E.js → general-DdyqyygG.js} +1 -1
- package/dist/client/assets/{home-WFjGUE06.js → home-qwoUWlkp.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-BQWEKvcb.js → hosted-publish-feedback-CLsRr2F3.js} +1 -1
- package/dist/client/assets/{icon-button-HP_nQybv.js → icon-button-D35iYhyt.js} +1 -1
- package/dist/client/assets/{index-BbiXGUyu.js → index-BYyApc_R.js} +1 -1
- package/dist/client/assets/{index-bgY9VUuJ.js → index-B_OHVDgL.js} +1 -1
- package/dist/client/assets/{index-BM3cOgBq.js → index-BeHeFJlC.js} +1 -1
- package/dist/client/assets/{index-BaUL6q-S.js → index-BeSefFhC.js} +1 -1
- package/dist/client/assets/{index-BiA1CvOR.js → index-Cg1bnjz3.js} +3 -3
- package/dist/client/assets/{index-p8FcgKoh.js → index-ChWGVKVJ.js} +1 -1
- package/dist/client/assets/{index-CZrLdJNt.js → index-DTKoYmUv.js} +1 -1
- package/dist/client/assets/{index-eOTdjF5M.js → index-DVa1tVFP.js} +1 -1
- package/dist/client/assets/{index-CHu8A5OR.js → index-D_bPpsGq.js} +1 -1
- package/dist/client/assets/{index-CHYL3bjd.js → index-FVlAwwnp.js} +2 -2
- package/dist/client/assets/{index-y_l26Jgv.js → index-MftrS50p.js} +1 -1
- package/dist/client/assets/{index-C_xIQPg2.js → index-a2WBJR8t.js} +1 -1
- package/dist/client/assets/{index-vfrMRavM.js → index-ojizOChd.js} +1 -1
- package/dist/client/assets/{index-redirect-BS9yQkjj.js → index-redirect-CsxDu9bX.js} +1 -1
- package/dist/client/assets/{index-pqrbRwbv.js → index-xY7dc029.js} +1 -1
- package/dist/client/assets/{index-CqAGTH28.js → index-zHacgqtA.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DI2CK6rY.js → infiniteQueryObserver-DYUxrOsa.js} +1 -1
- package/dist/client/assets/{infra-billing-BmpsX0W5.js → infra-billing-ZAkXcWGf.js} +1 -1
- package/dist/client/assets/{input-CLVexCm9.js → input-Cn2pH46d.js} +3 -3
- package/dist/client/assets/{input-Dtm_t9Iv.js → input-DrDQHQtx.js} +1 -1
- package/dist/client/assets/{integration-icon-snZGlTlE.js → integration-icon-CDUqney3.js} +1 -1
- package/dist/client/assets/{jira-icon-DgooyC87.js → jira-icon-DMEJvAv7.js} +1 -1
- package/dist/client/assets/{label-BYUExRiv.js → label-5YK5n-Jy.js} +1 -1
- package/dist/client/assets/{layout-agicsVGQ.js → layout-Bv17QfvB.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-pq5AXUZb.js → legacy-agents-deep-DwDfndRe.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CHoJ1qGn.js → legacy-main-redirect-DfQe4x8m.js} +1 -1
- package/dist/client/assets/library-BUIcJHn6.js +1 -0
- package/dist/client/assets/{library-tab-TU0mLOzI.js → library-tab-dfi86UKD.js} +1 -1
- package/dist/client/assets/{login-CuyBNzOe.js → login-qHMybRO_.js} +1 -1
- package/dist/client/assets/{markdown-DiphiKu3.js → markdown-BjnMOuF1.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DV7TLoin.js → mcp-app-renderer-D8NppsXy.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CcW2Zmn2.js → mcp-oauth-BZ-t-Wgw.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Dxm0_uRJ.js → mcp-oauth-C66RybUj.js} +1 -1
- package/dist/client/assets/{members-CeMl_LWc.js → members-zWgOuH3D.js} +1 -1
- package/dist/client/assets/{memory-BLaW7Zj0.js → memory-Dsf-CEHq.js} +1 -1
- package/dist/client/assets/{mini-report-page-W60wvvz5.js → mini-report-page-KnWCCuZB.js} +1 -1
- package/dist/client/assets/{mock-board-B3mAcYVo.js → mock-board-CdHeNIz2.js} +1 -1
- package/dist/client/assets/{monaco-editor-CbgOgWsX.js → monaco-editor-Bz5C1qiL.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BfkUvng_.js → monitoring-stats-row-DMV6RAKV.js} +1 -1
- package/dist/client/assets/{multi-select-oQ1IHArY.js → multi-select-CGsm8i3s.js} +1 -1
- package/dist/client/assets/{mustache-OuNgCPQN.js → mustache-DaLCYCxg.js} +1 -1
- package/dist/client/assets/{new-project-dialog-ps0hb6re.js → new-project-dialog-CzhtJtHB.js} +1 -1
- package/dist/client/assets/{oauth-callback-ZEmY7m-t.js → oauth-callback-BNXh-RIt.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BUSz7Fop.js → oauth-callback-ai-provider-D8haalZK.js} +1 -1
- package/dist/client/assets/{onboarding-CGrys6h6.js → onboarding-B35xgxW9.js} +1 -1
- package/dist/client/assets/{openai-conversation-CdouWBSm.js → openai-conversation-CVDPWLE1.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DZyYHS4O.js → optimistic-project-sidebar-views-CXESSCuO.js} +1 -1
- package/dist/client/assets/{order-monitor-day-DJVZ4YnI.js → order-monitor-day-B-4z5pTR.js} +1 -1
- package/dist/client/assets/{organization-choice-DlhyB3Sa.js → organization-choice-GFTWnrd9.js} +1 -1
- package/dist/client/assets/{orgs-yh-w4yD2.js → orgs-C_jYi-B4.js} +1 -1
- package/dist/client/assets/{page-seo-form-C-ozrB0l.js → page-seo-form-ClP7OKv7.js} +1 -1
- package/dist/client/assets/{pair-DVinkKZ2.js → pair-BttkW0Fz.js} +1 -1
- package/dist/client/assets/{plan-ladder-DRVH7_EP.js → plan-ladder-MPy-pVSK.js} +1 -1
- package/dist/client/assets/{popover-DVszB1D2.js → popover-BLWSFuId.js} +1 -1
- package/dist/client/assets/{post-calendar-DRpZwKE5.js → post-calendar-DEe9f6Ov.js} +1 -1
- package/dist/client/assets/{post-editor-CBJmLqGN.js → post-editor-C-AWg3KQ.js} +1 -1
- package/dist/client/assets/{preview-content-CTWcQx72.js → preview-content-CTKy7cPi.js} +1 -1
- package/dist/client/assets/{preview-dialog-WG_s8ScB.js → preview-dialog-McsupYCK.js} +1 -1
- package/dist/client/assets/{preview-panel-lw821k6l.js → preview-panel-C5Bi6V5i.js} +1 -1
- package/dist/client/assets/{preview-tab-CGNPnHOB.js → preview-tab-BN6PDf07.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-C0K_YL_W.js → product-picker-dialog-D21PKqY2.js} +1 -1
- package/dist/client/assets/{profile-7EHCdgGm.js → profile-BN33dxAQ.js} +1 -1
- package/dist/client/assets/{project-app-view-_kjZutk6.js → project-app-view-Dwqk9Mft.js} +1 -1
- package/dist/client/assets/{project-feed-CFbroA1l.js → project-feed-C-epk70M.js} +1 -1
- package/dist/client/assets/{project-icon-DRZTMMul.js → project-icon-DJML-MLd.js} +1 -1
- package/dist/client/assets/project-reports-DsciMnUX.js +1 -0
- package/dist/client/assets/project-tasks-Cs6g8VE4.js +1 -0
- package/dist/client/assets/{projects-CyeDxBm0.js → projects-D644Yr0-.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DmsE9Fb3.js → projects-empty-state-DUJb1lzj.js} +1 -1
- package/dist/client/assets/{prompts-CYAsqEo1.js → prompts-DQVszIhq.js} +1 -1
- package/dist/client/assets/record-editor-Bhn1kPZP.js +1 -0
- package/dist/client/assets/{redirect-editor-CkwmGutf.js → redirect-editor-BmWT3Bh6.js} +1 -1
- package/dist/client/assets/{reports-DUsUCGnS.js → reports-0RpQtlE6.js} +1 -1
- package/dist/client/assets/reports-XBbAMrQ9.js +1 -0
- package/dist/client/assets/{reports-onboarding-kv6EBuy5.js → reports-onboarding-B8Iht981.js} +1 -1
- package/dist/client/assets/{reports-tab-Dwwm5-TE.js → reports-tab-CQtuH54d.js} +2 -2
- package/dist/client/assets/{repositories-DYtIeKJl.js → repositories-Dcy0bO0q.js} +1 -1
- package/dist/client/assets/{repository-binding-C2nTVeK5.js → repository-binding-CQD7GNHY.js} +1 -1
- package/dist/client/assets/{repository-import-picker-qA1DbqvT.js → repository-import-picker-De4Ax-ga.js} +1 -1
- package/dist/client/assets/{repository-picker-XHsAJ1Gi.js → repository-picker-Nf4Ue0M-.js} +1 -1
- package/dist/client/assets/{require-capability-DxAqzoSx.js → require-capability-Blw9D4KR.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dj40Ho5o.js → required-auth-layout-VCktIPHo.js} +1 -1
- package/dist/client/assets/{reset-password-CWf2xPWv.js → reset-password-DrkD-fYe.js} +1 -1
- package/dist/client/assets/{resizable-DJex3L3H.js → resizable-mGdOCiZV.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-C4gpLCN3.js → resolve-tab-icon-B-kk8AT9.js} +1 -1
- package/dist/client/assets/{review-settings-Bz1EF1AT.js → review-settings-BjneeeaF.js} +1 -1
- package/dist/client/assets/{roles-Dzh1bxIx.js → roles-CTHKIL9X.js} +1 -1
- package/dist/client/assets/route-5NDnFeag.js +1 -0
- package/dist/client/assets/{route-O8TfOAM_.js → route-DtqgFMP7.js} +1 -1
- package/dist/client/assets/{route-DPtHDXNT.js → route-retZyRND.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-xWtem6h4.js → sandbox-lifecycle-context-CPqVBWO1.js} +1 -1
- package/dist/client/assets/{schema-C2l11Nlg.js → schema-BJCHPJpH.js} +1 -1
- package/dist/client/assets/{schema-Cti0aSdK.js → schema-DEgfARPh.js} +1 -1
- package/dist/client/assets/{scroll-area-B00038CM.js → scroll-area-tW1Hj4jo.js} +1 -1
- package/dist/client/assets/{search-input-BvpvZtPa.js → search-input-DLIghKNl.js} +1 -1
- package/dist/client/assets/{search-toggle-CdEhZoOU.js → search-toggle-FAsgTv_Z.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-CqzIIhd7.js → secret-ciphertext-Vk5DJky9.js} +1 -1
- package/dist/client/assets/{secret-picker-CWnB1S6U.js → secret-picker-1wnaL-oD.js} +1 -1
- package/dist/client/assets/{secrets-DwiJpvTg.js → secrets-CB1eVTwF.js} +1 -1
- package/dist/client/assets/{sections-editor-CeJ3j6-I.js → sections-editor-xgBaqMlq.js} +1 -1
- package/dist/client/assets/{select-DEQd4lEA.js → select-O5Mvcks5.js} +1 -1
- package/dist/client/assets/{select-model-C2rsjxqf.js → select-model-FFChrB4_.js} +1 -1
- package/dist/client/assets/{seo-editor-Dod1gdG9.js → seo-editor-Bt4xKivW.js} +1 -1
- package/dist/client/assets/{separator-BE7WTn1C.js → separator-D3MRNoiS.js} +1 -1
- package/dist/client/assets/{settings-tab-BgPmxQos.js → settings-tab-CO70ugg0.js} +1 -1
- package/dist/client/assets/{sheet-D3M_7Cyv.js → sheet-iw-P9eT5.js} +1 -1
- package/dist/client/assets/{shell-layout-BSzx19mC.js → shell-layout-CfzwqW6Z.js} +1 -1
- package/dist/client/assets/site-editor-BSdsDCXC.js +1 -0
- package/dist/client/assets/{site-editor-toast-m3Xh05BV.js → site-editor-toast-ER8hIG5c.js} +1 -1
- package/dist/client/assets/{skills-vw0lKEYB.js → skills-BVTuORPI.js} +1 -1
- package/dist/client/assets/{slider-u_V9usHZ.js → slider-BJOV_oT9.js} +1 -1
- package/dist/client/assets/{sortable.esm-C9hOuEP8.js → sortable.esm-DYw9rJqc.js} +1 -1
- package/dist/client/assets/{sso-ukPXZtph.js → sso-DZ-y3BjZ.js} +1 -1
- package/dist/client/assets/{suggestion-Cyd62-y-.js → suggestion-BwtkOr_j.js} +1 -1
- package/dist/client/assets/{switch-CCwbGLRy.js → switch-DDyp_qWV.js} +1 -1
- package/dist/client/assets/{symbol-Y3bcwxh1.js → symbol-BpP2IbGS.js} +1 -1
- package/dist/client/assets/{synced-repos-B1Rb0H3C.js → synced-repos-yoWXj-ig.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BFPZBGSM.js → tab-icon-glyph-CFEsHXMh.js} +1 -1
- package/dist/client/assets/{table-D1az5gLu.js → table-CkgZotsI.js} +1 -1
- package/dist/client/assets/{tabs-PC6R69Go.js → tabs-Dnumb6Iz.js} +1 -1
- package/dist/client/assets/{task-board-BBPRGgSU.js → task-board-Crs-D-MO.js} +1 -1
- package/dist/client/assets/{task-route-CL6nHfwd.js → task-route-BWfpU_MH.js} +1 -1
- package/dist/client/assets/{task-status-BJVtjlQi.js → task-status-8RXGFibo.js} +1 -1
- package/dist/client/assets/taskboard-analytics-DGmYkh9j.js +1 -0
- package/dist/client/assets/tasks-D9YNSLzG.js +1 -0
- package/dist/client/assets/{tasks-Cdn4fgxZ.js → tasks-VzTw049w.js} +1 -1
- package/dist/client/assets/{textarea-IeJaTJ27.js → textarea-DlvL_fA_.js} +1 -1
- package/dist/client/assets/{thread-analytics-BeBsJhvE.js → thread-analytics-DOsgiWWD.js} +1 -1
- package/dist/client/assets/{thread-intent-BnV2ckqK.js → thread-intent-DVws9qcG.js} +1 -1
- package/dist/client/assets/{thread-route-BbDCHKZN.js → thread-route-Do1JQPH4.js} +1 -1
- package/dist/client/assets/{thread-route-CuwRb7YI.js → thread-route-clOLEvdY.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CtDqDQij.js → thread-sheet-body-Bn4tAB2t.js} +1 -1
- package/dist/client/assets/{time-range-picker-CyFLIFF2.js → time-range-picker-C6klYJrC.js} +1 -1
- package/dist/client/assets/{toggle-group-Bt0H2RyG.js → toggle-group-eQb-irWY.js} +1 -1
- package/dist/client/assets/{tool-namespace-XcEZHdvH.js → tool-namespace-ySNs4wsF.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Bz8pBtEG.js → toolbar-icon-button-DDBKQVTF.js} +1 -1
- package/dist/client/assets/{tooltip-BNWxFUch.js → tooltip-z3ahMHp3.js} +1 -1
- package/dist/client/assets/{tooltipContext-Dn6uiojP.js → tooltipContext-Dz8xmrwx.js} +1 -1
- package/dist/client/assets/{track-K9iNy86h.js → track-D0SSZfW4.js} +1 -1
- package/dist/client/assets/{types-DIAGgkuf.js → types-D_PN249t.js} +1 -1
- package/dist/client/assets/{url-slug-CgeNi1xV.js → url-slug-Cemag_Iw.js} +1 -1
- package/dist/client/assets/{usage-stats-BKyYDG3z.js → usage-stats-XrLujIYH.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BoEiUlPV.js → use-ai-providers-UoC8r7Q8.js} +1 -1
- package/dist/client/assets/{use-app-takeover-DNIEDHJt.js → use-app-takeover-CRC736LU.js} +1 -1
- package/dist/client/assets/{use-automations-CehlrVJH.js → use-automations-D0k9_1SZ.js} +1 -1
- package/dist/client/assets/{use-autosave-CwzWfqPS.js → use-autosave-BkrBtpmN.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-A5_JpFpb.js → use-chat-navigation-ChXBnmAd.js} +1 -1
- package/dist/client/assets/{use-clock-tick-B3_TNA8f.js → use-clock-tick-w5Iocw5B.js} +1 -1
- package/dist/client/assets/{use-connect-companion-URv4l8mt.js → use-connect-companion-CUJFBTKr.js} +1 -1
- package/dist/client/assets/{use-connection-BtNvKNdn.js → use-connection-CiAN-dYE.js} +1 -1
- package/dist/client/assets/{use-copy-Dd060A4V.js → use-copy-7OQWJaYZ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-E8kqu3-4.js → use-create-virtual-mcp-Hf8REubM.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-B4d2kDJP.js → use-date-fns-locale-REpOVFZ4.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DxK7j66j.js → use-debounced-autosave-E8EUt0cI.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DX7CqJW4.js → use-debounced-value-DJRfPPIQ.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BtXMOJr8.js → use-deco-credits-DRTYt4_V.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-e6bIbgVG.js → use-decopilot-events-BqYgD_4M.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CrwN0k4t.js → use-delete-connection-BB7fxonW.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-rKWjOXwS.js → use-deployment-admin-B4U42oOl.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-BAxGfDs4.js → use-ensure-project-folder-DloZ6oYX.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url--5KAm72m.js → use-fast-preview-draft-url-88Z5YTXO.js} +1 -1
- package/dist/client/assets/{use-file-configs-B7jYXP_i.js → use-file-configs-DD1dy0Xo.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DPqWFDaZ.js → use-infinite-scroll-qfn7I7sn.js} +1 -1
- package/dist/client/assets/{use-join-requests-BN-pI8r2.js → use-join-requests-C_JW9TvH.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Dc5WqpKy.js → use-main-panel-tabs-BjWGUaZI.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Blu4IVgz.js → use-mcp-auth-status-DEO6yEO0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BzOTPt8T.js → use-mcp-client-Dv-DNRFw.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-ugVth88P.js → use-mcp-prompts-Cq1_3rkU.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DEHa1jkZ.js → use-mcp-tools-DeDEZVkj.js} +1 -1
- package/dist/client/assets/{use-members-CBBodSED.js → use-members-D4r_FyvQ.js} +1 -1
- package/dist/client/assets/{use-mobile-BpZt9lI0.js → use-mobile-q09wIIX1.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CHgjPw9E.js → use-navigate-to-agent-DL18C1F2.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Br9mu-1k.js → use-open-billing-url-Besqar5c.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DovUEtLF.js → use-org-auth-client-yrhxGHx_.js} +1 -1
- package/dist/client/assets/{use-org-fs-CVZcHkW8.js → use-org-fs-elZNIRBu.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-_IXRR-KE.js → use-org-repo-syncs-D7Zdzu7y.js} +1 -1
- package/dist/client/assets/{use-org-sso-DPtje9Zp.js → use-org-sso-Zzzon00H.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cv5pE3ve.js → use-organization-roles-D99Wd_xH.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C2uy0W_V.js → use-organization-settings-DdJ1cqu-.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BVtc5ydw.js → use-panel-navigate-gbEdwKA4.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-CV60Ufwv.js → use-project-native-view-presence-wLMUfOGZ.js} +1 -1
- package/dist/client/assets/{use-project-scope-C-CSmJC6.js → use-project-scope-ANAXeIzu.js} +1 -1
- package/dist/client/assets/{use-recent-apps-C9sz1SMq.js → use-recent-apps-CFtSn-WI.js} +1 -1
- package/dist/client/assets/{use-releases-DOCcUTXg.js → use-releases-DMS_cpf-.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-75yTFWCr.js → use-reports-diagnostic-BQGTTrIN.js} +1 -1
- package/dist/client/assets/{use-secrets-ZWs4A-YL.js → use-secrets-DB7Pbu16.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Df4txLBz.js → use-section-preview-base-D0PdMCnI.js} +1 -1
- package/dist/client/assets/{use-tags-B8q3TCse.js → use-tags-CMHwLogo.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CK4BOJKP.js → use-task-board-analytics-Cquhh6M8.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CGjKNCMP.js → use-task-board-events-BTa7I4At.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CiIUHRgn.js → use-task-board-item-prs-CwPgJIih.js} +1 -1
- package/dist/client/assets/{use-task-board-items-Dalax1Fy.js → use-task-board-items-CU8_Y7OY.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BL-0Ul1_.js → use-task-metadata-De9jb0kZ.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DKLgziPC.js → use-thread-analytics-CdjAaeRZ.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D2nPkIbm.js → use-thread-outputs-BJNsu99c.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-0KyaJBMx.js +1 -0
- package/dist/client/assets/{useQueries-B2MxX5Y7.js → useQueries-BTVtDham.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D_gtxuu-.js +1 -0
- package/dist/client/assets/{users-DLev7ocU.js → users-BAHNhTT3.js} +1 -1
- package/dist/client/assets/{utils-BnhSCPI1.js → utils-DgN421Jd.js} +1 -1
- package/dist/client/assets/{variant-calendar-DyHjYrVs.js → variant-calendar-u9YjKmUi.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-M9CxhbB7.js → variant-draft-pointer-BBBCXTPK.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-GXCCsjBE.js → view-mode-toggle-bUOtIafb.js} +1 -1
- package/dist/client/assets/{virtual-mcp-y4veqNYc.js → virtual-mcp-Z3OibIXi.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-D2gq4yb_.js → watch-sse-pool-l5oLLN0r.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +213 -213
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Cc_U2f4G.js +0 -1
- package/dist/client/assets/agent-deck-CTn1m2FR.js +0 -1
- package/dist/client/assets/agent-library-D3ISj6Xf.js +0 -1
- package/dist/client/assets/agent-library-file-CVuJGFwQ.js +0 -1
- package/dist/client/assets/agent-settings-CaUJnoLM.js +0 -1
- package/dist/client/assets/agent-site-editor-code-D8NuJGY4.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BoZUeYao.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BGFpkFPu.js +0 -1
- package/dist/client/assets/agent-view-CaG572DH.js +0 -1
- package/dist/client/assets/api-keys-OO9sfgy1.js +0 -1
- package/dist/client/assets/cms-settings-editor-J6Ft8hPn.js +0 -1
- package/dist/client/assets/flat-project-0J_Dgste.js +0 -1
- package/dist/client/assets/library-C8wNfqwI.js +0 -1
- package/dist/client/assets/project-reports-DBq658-2.js +0 -1
- package/dist/client/assets/project-tasks-CuSxE8db.js +0 -1
- package/dist/client/assets/record-editor-D_57GVqY.js +0 -1
- package/dist/client/assets/reports-DbbvQnl1.js +0 -1
- package/dist/client/assets/route-BXsC4a3Q.js +0 -1
- package/dist/client/assets/site-editor-CGkISHmH.js +0 -1
- package/dist/client/assets/taskboard-analytics-CM0qMAp3.js +0 -1
- package/dist/client/assets/tasks-B71t302r.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BTn-9Kc0.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ClBD171Z.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-
|
|
2
|
-
import{b0 as Fe,c as R,b as K,r as P,l as O,j as o,aX as it,aF as ie,bW as Ut,aG as ne,bV as ze,B as G,aE as Ss,aD as Cs,cY as Ns,bU as Is,F as Ne,b9 as Ts,dX as Ce,dY as mt,a9 as _s,e as Ms,I as Ds,t as Ue,y as se,a2 as Ie,d as at,ah as lt,v as Rs,aM as Es,s as Ps,q as Us,D as Ls,dS as Fs,a3 as zs,K as Os,m as $s,X as Bs,T as Ks,V as qs,U as ye,as as gt,aq as xt,ar as vt,h as Qs,aT as Ys,aS as Ws,au as Gs,cX as Hs,d0 as je,aY as Js,d2 as Zs,aZ as bt,b2 as Xs,a as en,at as tn,av as sn,aL as st,af as Lt,b_ as nn,aR as on}from"./index-CHYL3bjd.js";import{i as Ft,c as rn,d as an,e as zt,P as ln,f as Vn,S as cn}from"./usage-stats-BKyYDG3z.js";import{s as Ot}from"./XClose-B7qLXd7M.js";import{I as dn}from"./icon-button-HP_nQybv.js";import{F as un}from"./file-type-icon-CUgv_W6Q.js";import{a as pn}from"./use-chat-navigation-A5_JpFpb.js";import{b as fn}from"./location-BjlyegC2.js";import{d as hn,K as mn,b as gn}from"./shell-layout-BSzx19mC.js";import{a as $t}from"./repository-binding-C2nTVeK5.js";import{w as xn,A as vn}from"./autosend-DAp5Pl4Y.js";import{s as bn,r as At,i as An,c as yn,w as jn,H as kn}from"./chat-draft-6dAMTylQ.js";import{r as wn,d as Sn,f as Cn,h as Nn,t as In,z as Tn,o as _n,c as Mn}from"./thread-intent-BnV2ckqK.js";import{u as We,b as Oe,c as Ge,d as He,j as Dn,m as Rn,n as En,o as Pn,q as Un,v as Ln,x as Fn,y as zn,f as On,s as $n,e as Bn}from"./chat-context-BvklKKli.js";import{i as Bt}from"./LinkBroken01-BUtnpCHY.js";import{i as Kt}from"./ArrowUp-C4srIojM.js";import{n as qt}from"./ShoppingBag01-BUUGNtCW.js";import{t as Je,aJ as Qt,a4 as Yt,aK as nt,f as Vt,ax as Kn,B as qn,aL as Qn,q as Wt,aM as Gt,L as Yn,aN as Wn}from"./agent-icon-fSXvGEFF.js";import{a as Ht}from"./Image01-BlMyvXMa.js";import{h as Gn}from"./UserSquare-BX4djEpB.js";import{i as Hn}from"./Upload01-Cc9Hq4Fr.js";import{i as Jn}from"./AlertCircle-CrNq5UW4.js";import{a as Zn}from"./Copy01-Xsj4E7Vx.js";import{a as ot,b as ct,d as dt,f as ut,F as Jt}from"./form-UQ78ocmL.js";import{c as Xn,S as eo,b as to,a as so,d as no}from"./select-DEQd4lEA.js";import{t as Zt}from"./ChevronUp-D2OopJl6.js";import{T as Ze,a as Xe,c as et}from"./tooltip-BNWxFUch.js";import{i as oo}from"./ArrowLeft-Ia--rShd.js";import{c as ro,b as io}from"./tabs-PC6R69Go.js";import{e as $e,f as ao,c as lo,g as Vo}from"./use-decopilot-events-e6bIbgVG.js";import{u as co}from"./use-deco-credits-BtXMOJr8.js";import{T as yt,a as uo}from"./toggle-group-Bt0H2RyG.js";import{a as po,d as fo,g as jt,s as ho}from"./tool-namespace-XcEZHdvH.js";import{t as mo}from"./utils-CVEq3hMx.js";import{u as go}from"./use-open-billing-url-Br9mu-1k.js";import{M as xo,a as vo,m as pt,g as bo,b as Ao}from"./index-BbiXGUyu.js";import{a as Xt,b as es,P as ts}from"./popover-DVszB1D2.js";import{c as yo,b as jo,a as ko,D as wo}from"./drawer-CdY7mjQo.js";import{u as ss}from"./use-mobile-BpZt9lI0.js";import{t as So}from"./Tool01-B3Uc_vub.js";import{d as Co,a as No}from"./use-organization-settings-C2uy0W_V.js";import{u as ns,c as Io,d as To}from"./use-ai-providers-BoEiUlPV.js";import{p as os,u as _o,T as Mo,a as Do,U as Ro}from"./input-Dtm_t9Iv.js";import{a as Eo}from"./use-mcp-client-BzOTPt8T.js";import{l as Po,g as Uo}from"./use-mcp-prompts-ugVth88P.js";import{i as Lo}from"./Link01-D5d5rf-A.js";import{s as kt}from"./Plus-CXYJbwnT.js";import"./suggestion-Cyd62-y-.js";import{p as Fo,q as zo}from"./question-004-sINsf4GQ.js";import{A as Oo}from"./avatar-COJ0KMsq.js";import{u as $o}from"./use-members-CBBodSED.js";import{F as wt}from"./feature-paywall-DY5B-D1h.js";import{A as Bo}from"./add-connection-dialog-CjrhrQlh.js";import{u as Ko}from"./use-task-board-events-CGjKNCMP.js";import{i as qo}from"./use-project-native-view-presence-CV60Ufwv.js";const Qo=Fe("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const Yo=Fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const Wo=Fe("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Go=Fe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Ho=Fe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function Jo(t){const e=R.c(14),s=$t(t),n=We(),r=s?.metadata,i=n?.activeTask,a=i?.metadata?.runtime;let l;e[0]!==a?(l=Nn(a),e[0]=a,e[1]=l):l=e[1];const c=l,d=!!i&&!i.partial,u=i?.metadata;let V;e[2]!==r||e[3]!==u?(V=wn(u,r),e[2]=r,e[3]=u,e[4]=V):V=e[4];const p=!!c||d&&!!s;let f;e[5]!==r?(f=Sn(r),e[5]=r,e[6]=f):f=e[6];let h;e[7]!==r?(h=Cn(r),e[7]=r,e[8]=h):h=e[8];let m;return e[9]!==V||e[10]!==p||e[11]!==f||e[12]!==h?(m={runtime:V,resolved:p,projectDefault:f,previewServerUrl:h},e[9]=V,e[10]=p,e[11]=f,e[12]=h,e[13]=m):m=e[13],m}const tt="cubic-bezier(0.645, 0.045, 0.355, 1)",ll=44,Zo={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-warning/5 after:pointer-events-none after:-z-10"},Xo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},er={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.c(69),{icon:s,label:n,count:r,title:i,footerLeft:a,footerRight:l,children:c,defaultExpanded:d,variant:u,onClose:V}=t,p=u===void 0?"default":u,f=K(),[h,m]=P.useState(d),[g,v]=P.useState(!1);let x;e[0]!==V?(x=()=>{v(!0),V?.()},e[0]=V,e[1]=x):x=e[1];const b=x;if(g)return null;const A=Xo[p],j=Zo[p];let y;e[2]!==A||e[3]!==j?(y=O("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,j),e[2]=A,e[3]=j,e[4]=y):y=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>m(tr),e[5]=k):k=e[5];const w=h&&"rounded-b-none",S=!h&&"rounded-b-xl";let N;e[6]!==w||e[7]!==S?(N=O("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",w,S),e[6]=w,e[7]=S,e[8]=N):N=e[8];const I=er[p];let C;e[9]!==I?(C=O("shrink-0",I),e[9]=I,e[10]=C):C=e[10];let M;e[11]!==s||e[12]!==C?(M=o.jsx("span",{className:C,children:s}),e[11]=s,e[12]=C,e[13]=M):M=e[13];let D;e[14]!==n?(D=o.jsx("span",{className:"flex-1 min-w-0 truncate",children:n}),e[14]=n,e[15]=D):D=e[15];let E;e[16]!==r?(E=r?o.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=E):E=e[17];const U=h?"rotate(180deg)":"rotate(0deg)";let T;e[18]!==U?(T=o.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:o.jsx(Zt,{size:16,style:{transform:U,transition:`transform 180ms ${tt}`}})}),e[18]=U,e[19]=T):T=e[19];let L;e[20]!==f?(L=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=L):L=e[21];let F;e[22]!==f?(F=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=F):F=e[23];let W,$;e[24]!==b?(W=ce=>{ce.stopPropagation(),b()},$=ce=>{(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),ce.stopPropagation(),b())},e[24]=b,e[25]=W,e[26]=$):(W=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=o.jsx(it,{size:16}),e[27]=z):z=e[27];let Q;e[28]!==L||e[29]!==F||e[30]!==W||e[31]!==$?(Q=o.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,title:F,onClick:W,onKeyDown:$,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:z}),e[28]=L,e[29]=F,e[30]=W,e[31]=$,e[32]=Q):Q=e[32];let ee;e[33]!==h||e[34]!==M||e[35]!==D||e[36]!==E||e[37]!==T||e[38]!==Q||e[39]!==N?(ee=o.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:k,className:N,children:[M,D,E,T,Q]}),e[33]=h,e[34]=M,e[35]=D,e[36]=E,e[37]=T,e[38]=Q,e[39]=N,e[40]=ee):ee=e[40];const te=h?"1fr":"0fr";let H;e[41]!==te?(H={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${tt}`},e[41]=te,e[42]=H):H=e[42];let oe;e[43]===Symbol.for("react.memo_cache_sentinel")?(oe={overflow:"hidden",minHeight:0},e[43]=oe):oe=e[43];const _=h?1:0;let B;e[44]!==_?(B={opacity:_,transition:`opacity 120ms ${tt}`,maxHeight:"60vh"},e[44]=_,e[45]=B):B=e[45];let J;e[46]!==i?(J=i?o.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:o.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):o.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=J):J=e[47];let Z;e[48]!==c||e[49]!==i?(Z=c?o.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:c}):null,e[48]=c,e[49]=i,e[50]=Z):Z=e[50];let X;e[51]!==J||e[52]!==Z?(X=o.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[J,Z]}),e[51]=J,e[52]=Z,e[53]=X):X=e[53];let ue;e[54]!==a||e[55]!==l?(ue=a||l?o.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:a}),o.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=ue):ue=e[56];let Y;e[57]!==B||e[58]!==X||e[59]!==ue?(Y=o.jsx("div",{style:oe,children:o.jsxs("div",{className:"flex flex-col",style:B,children:[X,ue]})}),e[57]=B,e[58]=X,e[59]=ue,e[60]=Y):Y=e[60];let le;e[61]!==H||e[62]!==Y?(le=o.jsx("div",{"data-testid":"collapsible-highlight-body",style:H,children:Y}),e[61]=H,e[62]=Y,e[63]=le):le=e[63];let Ve;return e[64]!==ee||e[65]!==le||e[66]!==y||e[67]!==p?(Ve=o.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:y,children:[ee,le]}),e[64]=ee,e[65]=le,e[66]=y,e[67]=p,e[68]=Ve):Ve=e[68],Ve}function tr(t){return!t}const sr=ie({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:ze(["pending","in_progress","completed"]),activeForm:ne().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),rs=ie({todos:Ut(sr)}),nr="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.";In({description:nr,inputSchema:Tn(rs),execute:async({todos:t})=>({ok:!0,count:t.length})});const or="tool-todo_write",rr=new Set(["input-available","output-available"]);function ir(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const n=s.parts;if(Array.isArray(n))for(let r=n.length-1;r>=0;r--){const i=n[r];if(i.type!==or||typeof i.state!="string"||!rr.has(i.state))continue;const a=rs.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function is(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const n="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:n,friendlyName:mo(po(n)),input:s.input})}return e}function as(t){return t.at(-1)}function ls(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function ar(t){return t?t.message.startsWith("[CREDITS]"):!1}const lr={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Vr(t){const{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&ar(s))return{...lr,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],c=l,u=!!c.filter(y=>y.type==="tool-user_ask").filter(y=>y.state!=="output-available").length,V=c.some(Ft),p=ls(l),f=is(c),h=ir(e),m=r?null:bn(s),g=r?null:_n(s),v=!r&&!!s&&!m&&!g,x=f.length>0||r&&i,b=p.length>0,j=!r&&!!n&&n!=="stop"&&!(n==="tool-calls"&&(u||x||b||V))&&!v;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:m,hasTodos:h.length>0,showError:v,showWarning:j,hasApprovals:x,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:V,todos:h}}function Vs(){const t=R.c(6),{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=Oe(),a=s??null,l=n??null;let c;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(c=Vr({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=c):c=t[5],c}function Vl(){const t=Vs(),e=$e("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const St="start-task",cr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-CVDPWLE1.js","assets/index-FVlAwwnp.js","assets/index-s7bCSMKE.css","assets/usage-stats-XrLujIYH.js","assets/tool-namespace-ySNs4wsF.js","assets/form-DeAkvXbd.js","assets/label-5YK5n-Jy.js","assets/utils-CVEq3hMx.js","assets/markdown-BjnMOuF1.js","assets/use-copy-7OQWJaYZ.js","assets/Copy01-DJfs9oWc.js","assets/ZoomOut-RWcNZa7o.js","assets/location-BjlyegC2.js","assets/use-mobile-q09wIIX1.js","assets/use-panel-navigate-gbEdwKA4.js","assets/thread-route-Do1JQPH4.js","assets/use-project-scope-ANAXeIzu.js","assets/repository-binding-CQD7GNHY.js","assets/use-mcp-client-Dv-DNRFw.js","assets/auth-CYWcAkNL.js","assets/tooltip-z3ahMHp3.js","assets/index-DTKoYmUv.js","assets/agent-icon-CD07XpUI.js","assets/AlertCircle-BQdHDXJE.js","assets/Tool01-BdsfSdtC.js","assets/ArrowUp-DUcJqTJ2.js","assets/ArrowLeft-4FjatJyh.js","assets/LinkBroken01-CT5dhAsI.js","assets/ShoppingBag01-DVbVy_Vw.js","assets/Building02-CZSoBcjF.js","assets/CheckCircle-bt0DVl-x.js","assets/ChevronUp-CM5YHZaR.js","assets/ChevronSelectorVertical-C4Qpvky2.js","assets/UserSquare-BJGiIPKK.js","assets/CreditCard01-DPVVFici.js","assets/DotsVertical-D7kGSpp1.js","assets/Image01-OFj3FDBn.js","assets/Globe04-frPv3egH.js","assets/SwitchHorizontal01-CLalNFG1.js","assets/Key01-DpM4YxSh.js","assets/Link01-DhmloT9o.js","assets/Monitor01-CPZ0C_n4.js","assets/Sun-C29e_Ety.js","assets/Play-C2R_ghID.js","assets/Plus-BR_HFiUM.js","assets/SearchMd-ByqZu5hY.js","assets/Trash01-BSY13r-M.js","assets/Upload01-Dh-c49ZF.js","assets/User01-C7KADwYC.js","assets/Users01-Dc2J4jVj.js","assets/XClose-Uumbdavl.js","assets/format-time-CAj8AQXM.js","assets/differenceInSeconds-C3x8sHUj.js","assets/use-decopilot-events-BqYgD_4M.js","assets/thread-intent-DVws9qcG.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-l5oLLN0r.js","assets/task-board-Crs-D-MO.js","assets/schema-DEgfARPh.js","assets/slugify-CEUa2lfQ.js","assets/chat-context-UIAA0h5o.js","assets/autosend-i3qEjciO.js","assets/use-ai-providers-UoC8r7Q8.js","assets/use-chat-navigation-ChXBnmAd.js","assets/use-organization-settings-DdJ1cqu-.js","assets/icon-button-D35iYhyt.js","assets/file-type-icon-CvZlzH43.js","assets/shell-layout-CfzwqW6Z.js","assets/avatar-CVAjlXTO.js","assets/use-clock-tick-w5Iocw5B.js","assets/command-3GSRDq3K.js","assets/index-MftrS50p.js","assets/integration-icon-CDUqney3.js","assets/project-icon-DJML-MLd.js","assets/new-project-dialog-CzhtJtHB.js","assets/repository-import-picker-De4Ax-ga.js","assets/use-navigate-to-agent-DL18C1F2.js","assets/repository-picker-Nf4Ue0M-.js","assets/useInfiniteQuery-0KyaJBMx.js","assets/infiniteQueryObserver-DYUxrOsa.js","assets/collection-search-BLm1Rh3R.js","assets/use-debounced-value-DJRfPPIQ.js","assets/required-auth-layout-VCktIPHo.js","assets/use-org-sso-Zzzon00H.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-75zJmfvC.js","assets/select-O5Mvcks5.js","assets/index-BdQq_4o_.js","assets/tabs-Dnumb6Iz.js","assets/use-deco-credits-DRTYt4_V.js","assets/toggle-group-eQb-irWY.js","assets/use-open-billing-url-Besqar5c.js","assets/index-BYyApc_R.js","assets/checkbox-D15fApKh.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-BLWSFuId.js","assets/drawer-H1iY2MTY.js","assets/input-DrDQHQtx.js","assets/suggestion-BwtkOr_j.js","assets/use-project-native-view-presence-wLMUfOGZ.js","assets/use-file-configs-DD1dy0Xo.js","assets/site-slug-DebpOoQq.js","assets/use-mcp-prompts-Cq1_3rkU.js","assets/use-org-fs-elZNIRBu.js","assets/question-004-sINsf4GQ.js","assets/use-members-D4r_FyvQ.js","assets/use-org-auth-client-yrhxGHx_.js","assets/feature-paywall-CZ-3eKXv.js","assets/plan-ladder-MPy-pVSK.js","assets/add-connection-dialog-DwXBXDc-.js","assets/extract-connection-data-BNOCaLyI.js","assets/metadata-D72DunRR.js","assets/connection-CsADVd0t.js","assets/url-slug-Cemag_Iw.js","assets/connection-card-CK1Gp5gM.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-DlvL_fA_.js","assets/use-connection-CiAN-dYE.js","assets/schema-BJCHPJpH.js","assets/connection-form-helpers-CeZBy2s9.js","assets/authenticate-and-persist-oauth-CMBvt9CI.js","assets/mcp-oauth-BZ-t-Wgw.js","assets/mcp-oauth-C66RybUj.js","assets/collection-tabs-SQnRb19p.js","assets/badge-0p-_GJaz.js","assets/use-infinite-scroll-qfn7I7sn.js","assets/useSuspenseInfiniteQuery-D_gtxuu-.js","assets/use-task-board-events-BTa7I4At.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{b0 as Fe,c as R,b as K,r as P,l as O,j as o,aX as it,aF as ie,bW as Ut,aG as ne,bV as ze,B as G,aE as Ss,aD as Cs,cY as Ns,bU as Is,F as Ne,b9 as Ts,dX as Ce,dY as mt,a9 as _s,e as Ms,I as Ds,t as Ue,y as se,a2 as Ie,d as at,ah as lt,v as Rs,aM as Es,s as Ps,q as Us,D as Ls,dS as Fs,a3 as zs,K as Os,m as $s,X as Bs,T as Ks,V as qs,U as ye,as as gt,aq as xt,ar as vt,h as Qs,aT as Ys,aS as Ws,au as Gs,cX as Hs,d0 as je,aY as Js,d2 as Zs,aZ as bt,b2 as Xs,a as en,at as tn,av as sn,aL as st,af as Lt,b_ as nn,aR as on}from"./index-FVlAwwnp.js";import{i as Ft,c as rn,d as an,e as zt,P as ln,f as Vn,S as cn}from"./usage-stats-XrLujIYH.js";import{s as Ot}from"./XClose-Uumbdavl.js";import{I as dn}from"./icon-button-D35iYhyt.js";import{F as un}from"./file-type-icon-CvZlzH43.js";import{a as pn}from"./use-chat-navigation-ChXBnmAd.js";import{b as fn}from"./location-BjlyegC2.js";import{d as hn,K as mn,b as gn}from"./shell-layout-CfzwqW6Z.js";import{a as $t}from"./repository-binding-CQD7GNHY.js";import{w as xn,A as vn}from"./autosend-i3qEjciO.js";import{s as bn,r as At,i as An,c as yn,w as jn,H as kn}from"./chat-draft-75zJmfvC.js";import{r as wn,d as Sn,f as Cn,h as Nn,t as In,z as Tn,o as _n,c as Mn}from"./thread-intent-DVws9qcG.js";import{u as We,b as Oe,c as Ge,d as He,j as Dn,m as Rn,n as En,o as Pn,q as Un,v as Ln,x as Fn,y as zn,f as On,s as $n,e as Bn}from"./chat-context-UIAA0h5o.js";import{i as Bt}from"./LinkBroken01-CT5dhAsI.js";import{i as Kt}from"./ArrowUp-DUcJqTJ2.js";import{n as qt}from"./ShoppingBag01-DVbVy_Vw.js";import{t as Je,aJ as Qt,a4 as Yt,aK as nt,f as Vt,ax as Kn,B as qn,aL as Qn,q as Wt,aM as Gt,L as Yn,aN as Wn}from"./agent-icon-CD07XpUI.js";import{a as Ht}from"./Image01-OFj3FDBn.js";import{h as Gn}from"./UserSquare-BJGiIPKK.js";import{i as Hn}from"./Upload01-Dh-c49ZF.js";import{i as Jn}from"./AlertCircle-BQdHDXJE.js";import{a as Zn}from"./Copy01-DJfs9oWc.js";import{a as ot,b as ct,d as dt,f as ut,F as Jt}from"./form-DeAkvXbd.js";import{c as Xn,S as eo,b as to,a as so,d as no}from"./select-O5Mvcks5.js";import{t as Zt}from"./ChevronUp-CM5YHZaR.js";import{T as Ze,a as Xe,c as et}from"./tooltip-z3ahMHp3.js";import{i as oo}from"./ArrowLeft-4FjatJyh.js";import{c as ro,b as io}from"./tabs-Dnumb6Iz.js";import{e as $e,f as ao,c as lo,g as Vo}from"./use-decopilot-events-BqYgD_4M.js";import{u as co}from"./use-deco-credits-DRTYt4_V.js";import{T as yt,a as uo}from"./toggle-group-eQb-irWY.js";import{a as po,d as fo,g as jt,s as ho}from"./tool-namespace-ySNs4wsF.js";import{t as mo}from"./utils-CVEq3hMx.js";import{u as go}from"./use-open-billing-url-Besqar5c.js";import{M as xo,a as vo,m as pt,g as bo,b as Ao}from"./index-BYyApc_R.js";import{a as Xt,b as es,P as ts}from"./popover-BLWSFuId.js";import{c as yo,b as jo,a as ko,D as wo}from"./drawer-H1iY2MTY.js";import{u as ss}from"./use-mobile-q09wIIX1.js";import{t as So}from"./Tool01-BdsfSdtC.js";import{d as Co,a as No}from"./use-organization-settings-DdJ1cqu-.js";import{u as ns,c as Io,d as To}from"./use-ai-providers-UoC8r7Q8.js";import{p as os,u as _o,T as Mo,a as Do,U as Ro}from"./input-DrDQHQtx.js";import{a as Eo}from"./use-mcp-client-Dv-DNRFw.js";import{l as Po,g as Uo}from"./use-mcp-prompts-Cq1_3rkU.js";import{i as Lo}from"./Link01-DhmloT9o.js";import{s as kt}from"./Plus-BR_HFiUM.js";import"./suggestion-BwtkOr_j.js";import{p as Fo,q as zo}from"./question-004-sINsf4GQ.js";import{A as Oo}from"./avatar-CVAjlXTO.js";import{u as $o}from"./use-members-D4r_FyvQ.js";import{F as wt}from"./feature-paywall-CZ-3eKXv.js";import{A as Bo}from"./add-connection-dialog-DwXBXDc-.js";import{u as Ko}from"./use-task-board-events-BTa7I4At.js";import{i as qo}from"./use-project-native-view-presence-wLMUfOGZ.js";const Qo=Fe("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const Yo=Fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const Wo=Fe("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Go=Fe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Ho=Fe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function Jo(t){const e=R.c(14),s=$t(t),n=We(),r=s?.metadata,i=n?.activeTask,a=i?.metadata?.runtime;let l;e[0]!==a?(l=Nn(a),e[0]=a,e[1]=l):l=e[1];const c=l,d=!!i&&!i.partial,u=i?.metadata;let V;e[2]!==r||e[3]!==u?(V=wn(u,r),e[2]=r,e[3]=u,e[4]=V):V=e[4];const p=!!c||d&&!!s;let f;e[5]!==r?(f=Sn(r),e[5]=r,e[6]=f):f=e[6];let h;e[7]!==r?(h=Cn(r),e[7]=r,e[8]=h):h=e[8];let m;return e[9]!==V||e[10]!==p||e[11]!==f||e[12]!==h?(m={runtime:V,resolved:p,projectDefault:f,previewServerUrl:h},e[9]=V,e[10]=p,e[11]=f,e[12]=h,e[13]=m):m=e[13],m}const tt="cubic-bezier(0.645, 0.045, 0.355, 1)",ll=44,Zo={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-warning/5 after:pointer-events-none after:-z-10"},Xo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},er={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.c(69),{icon:s,label:n,count:r,title:i,footerLeft:a,footerRight:l,children:c,defaultExpanded:d,variant:u,onClose:V}=t,p=u===void 0?"default":u,f=K(),[h,m]=P.useState(d),[g,v]=P.useState(!1);let x;e[0]!==V?(x=()=>{v(!0),V?.()},e[0]=V,e[1]=x):x=e[1];const b=x;if(g)return null;const A=Xo[p],j=Zo[p];let y;e[2]!==A||e[3]!==j?(y=O("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,j),e[2]=A,e[3]=j,e[4]=y):y=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>m(tr),e[5]=k):k=e[5];const w=h&&"rounded-b-none",S=!h&&"rounded-b-xl";let N;e[6]!==w||e[7]!==S?(N=O("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",w,S),e[6]=w,e[7]=S,e[8]=N):N=e[8];const I=er[p];let C;e[9]!==I?(C=O("shrink-0",I),e[9]=I,e[10]=C):C=e[10];let M;e[11]!==s||e[12]!==C?(M=o.jsx("span",{className:C,children:s}),e[11]=s,e[12]=C,e[13]=M):M=e[13];let D;e[14]!==n?(D=o.jsx("span",{className:"flex-1 min-w-0 truncate",children:n}),e[14]=n,e[15]=D):D=e[15];let E;e[16]!==r?(E=r?o.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=E):E=e[17];const U=h?"rotate(180deg)":"rotate(0deg)";let T;e[18]!==U?(T=o.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:o.jsx(Zt,{size:16,style:{transform:U,transition:`transform 180ms ${tt}`}})}),e[18]=U,e[19]=T):T=e[19];let L;e[20]!==f?(L=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=L):L=e[21];let F;e[22]!==f?(F=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=F):F=e[23];let W,$;e[24]!==b?(W=ce=>{ce.stopPropagation(),b()},$=ce=>{(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),ce.stopPropagation(),b())},e[24]=b,e[25]=W,e[26]=$):(W=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=o.jsx(it,{size:16}),e[27]=z):z=e[27];let Q;e[28]!==L||e[29]!==F||e[30]!==W||e[31]!==$?(Q=o.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,title:F,onClick:W,onKeyDown:$,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:z}),e[28]=L,e[29]=F,e[30]=W,e[31]=$,e[32]=Q):Q=e[32];let ee;e[33]!==h||e[34]!==M||e[35]!==D||e[36]!==E||e[37]!==T||e[38]!==Q||e[39]!==N?(ee=o.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:k,className:N,children:[M,D,E,T,Q]}),e[33]=h,e[34]=M,e[35]=D,e[36]=E,e[37]=T,e[38]=Q,e[39]=N,e[40]=ee):ee=e[40];const te=h?"1fr":"0fr";let H;e[41]!==te?(H={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${tt}`},e[41]=te,e[42]=H):H=e[42];let oe;e[43]===Symbol.for("react.memo_cache_sentinel")?(oe={overflow:"hidden",minHeight:0},e[43]=oe):oe=e[43];const _=h?1:0;let B;e[44]!==_?(B={opacity:_,transition:`opacity 120ms ${tt}`,maxHeight:"60vh"},e[44]=_,e[45]=B):B=e[45];let J;e[46]!==i?(J=i?o.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:o.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):o.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=J):J=e[47];let Z;e[48]!==c||e[49]!==i?(Z=c?o.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:c}):null,e[48]=c,e[49]=i,e[50]=Z):Z=e[50];let X;e[51]!==J||e[52]!==Z?(X=o.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[J,Z]}),e[51]=J,e[52]=Z,e[53]=X):X=e[53];let ue;e[54]!==a||e[55]!==l?(ue=a||l?o.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:a}),o.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=ue):ue=e[56];let Y;e[57]!==B||e[58]!==X||e[59]!==ue?(Y=o.jsx("div",{style:oe,children:o.jsxs("div",{className:"flex flex-col",style:B,children:[X,ue]})}),e[57]=B,e[58]=X,e[59]=ue,e[60]=Y):Y=e[60];let le;e[61]!==H||e[62]!==Y?(le=o.jsx("div",{"data-testid":"collapsible-highlight-body",style:H,children:Y}),e[61]=H,e[62]=Y,e[63]=le):le=e[63];let Ve;return e[64]!==ee||e[65]!==le||e[66]!==y||e[67]!==p?(Ve=o.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:y,children:[ee,le]}),e[64]=ee,e[65]=le,e[66]=y,e[67]=p,e[68]=Ve):Ve=e[68],Ve}function tr(t){return!t}const sr=ie({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:ze(["pending","in_progress","completed"]),activeForm:ne().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),rs=ie({todos:Ut(sr)}),nr="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.";In({description:nr,inputSchema:Tn(rs),execute:async({todos:t})=>({ok:!0,count:t.length})});const or="tool-todo_write",rr=new Set(["input-available","output-available"]);function ir(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const n=s.parts;if(Array.isArray(n))for(let r=n.length-1;r>=0;r--){const i=n[r];if(i.type!==or||typeof i.state!="string"||!rr.has(i.state))continue;const a=rs.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function is(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const n="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:n,friendlyName:mo(po(n)),input:s.input})}return e}function as(t){return t.at(-1)}function ls(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function ar(t){return t?t.message.startsWith("[CREDITS]"):!1}const lr={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Vr(t){const{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&ar(s))return{...lr,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],c=l,u=!!c.filter(y=>y.type==="tool-user_ask").filter(y=>y.state!=="output-available").length,V=c.some(Ft),p=ls(l),f=is(c),h=ir(e),m=r?null:bn(s),g=r?null:_n(s),v=!r&&!!s&&!m&&!g,x=f.length>0||r&&i,b=p.length>0,j=!r&&!!n&&n!=="stop"&&!(n==="tool-calls"&&(u||x||b||V))&&!v;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:m,hasTodos:h.length>0,showError:v,showWarning:j,hasApprovals:x,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:V,todos:h}}function Vs(){const t=R.c(6),{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=Oe(),a=s??null,l=n??null;let c;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(c=Vr({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=c):c=t[5],c}function Vl(){const t=Vs(),e=$e("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const St="start-task",cr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
3
3
|
|
|
4
4
|
1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
|
|
5
5
|
2. Call TASK_BOARD_ITEM_LIST. Its \`repos\` are this organization's repositories — the only valid values for a task's repo, so pick the one the report is about and never invent a name.
|
|
6
6
|
3. Call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, assigneeId "super-agent", and onDuplicate "return_existing". That assignment is what queues the work; the duplicate option makes the tool hand back an existing task when one already covers this report instead of opening a second one.
|
|
7
7
|
4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. If the output says \`deduplicated: true\`, say the report was already tracked by that task and quote its \`duplicateReason\`. Never invent a URL. Do NOT implement the fix here; the task's own run does that, and the reporter gets an email when its PR is ready for review.
|
|
8
8
|
|
|
9
|
-
The report follows.`;function dr(t){return{...t,content:[{type:"paragraph",content:[rn({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:cr}}]})]},...t.content??[]]}}function ur(){const t=R.c(24),e=K(),s=pn();if(!s)return null;let n,r,i,a;t[0]!==s.path||t[1]!==e?(n=fn(s.path),a="flex px-3 pt-3",r="surface-inset flex h-7 min-w-0 items-center gap-1.5 rounded-full pr-0.5 pl-2.5 text-xs text-foreground",i=e("chat.input.openFileContext",{name:n}),t[0]=s.path,t[1]=e,t[2]=n,t[3]=r,t[4]=i,t[5]=a):(n=t[2],r=t[3],i=t[4],a=t[5]);let l,c;t[6]!==n?(l=o.jsx(un,{filename:n,className:"h-4 w-3 shrink-0"}),c=o.jsx("span",{className:"truncate",children:n}),t[6]=n,t[7]=l,t[8]=c):(l=t[7],c=t[8]);let d;t[9]!==e?(d=e("chat.input.openFileDismiss"),t[9]=e,t[10]=d):d=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(Ot,{size:12}),t[11]=u):u=t[11];let V;t[12]!==s.dismiss||t[13]!==d?(V=o.jsx(dn,{label:d,size:"icon-sm",onClick:s.dismiss,children:u}),t[12]=s.dismiss,t[13]=d,t[14]=V):V=t[14];let p;t[15]!==r||t[16]!==i||t[17]!==l||t[18]!==c||t[19]!==V?(p=o.jsxs("span",{className:r,title:i,children:[l,c,V]}),t[15]=r,t[16]=i,t[17]=l,t[18]=c,t[19]=V,t[20]=p):p=t[20];let f;return t[21]!==a||t[22]!==p?(f=o.jsx("div",{className:a,children:p}),t[21]=a,t[22]=p,t[23]=f):f=t[23],f}function pr(t){const e=R.c(30),{current:s,total:n,onPrev:r,onNext:i}=t,a=K();if(n<=1)return null;const l=s===0,c=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==c?(d=O("p-0.5 transition-colors rounded-lg",c),e[0]=c,e[1]=d):d=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(oo,{size:14}),e[4]=V):V=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=o.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:V}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let h;e[10]!==a||e[11]!==f||e[12]!==n?(h=a("chat.pagination.counter",{current:f,total:n}),e[10]=a,e[11]=f,e[12]=n,e[13]=h):h=e[13];let m;e[14]!==h?(m=o.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=m):m=e[15];const g=s===n-1,v=s===n-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let x;e[16]!==v?(x=O("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=x):x=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(Bt,{size:14}),e[20]=A):A=e[20];let j;e[21]!==i||e[22]!==g||e[23]!==x||e[24]!==b?(j=o.jsx("button",{type:"button",onClick:i,disabled:g,className:x,"aria-label":b,children:A}),e[21]=i,e[22]=g,e[23]=x,e[24]=b,e[25]=j):j=e[25];let y;return e[26]!==j||e[27]!==p||e[28]!==m?(y=o.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,m,j]}),e[26]=j,e[27]=p,e[28]=m,e[29]=y):y=e[29],y}function cs(t){const e=R.c(8),{currentIndex:s,total:n,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==n?(l=o.jsx(pr,{current:s,total:n,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=n,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=o.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function fr(t){const e=R.c(17),{isStreaming:s,isAllAnswered:n,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=n?a===void 0?"Submit":a:l===void 0?"Next":l,V=n?s:!r,p=V?n?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==V||e[1]!==i?(f=()=>{V||i()},e[0]=V,e[1]=i,e[2]=f):f=e[2];const h=V&&"opacity-50 cursor-not-allowed";let m;e[3]!==h?(m=O("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=m):m=e[4];let g;e[5]!==V||e[6]!==u||e[7]!==f||e[8]!==m?(g=o.jsx(G,{type:"button",size:"sm","aria-disabled":V,onClick:f,className:m,children:u}),e[5]=V,e[6]=u,e[7]=f,e[8]=m,e[9]=g):g=e[9];const v=g;if(!p)return v;let x;e[10]!==v?(x=o.jsx(Ze,{asChild:!0,children:v}),e[10]=v,e[11]=x):x=e[11];let b;e[12]!==p?(b=o.jsx(Xe,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;return e[14]!==x||e[15]!==b?(A=o.jsxs(et,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16],A}function ds(t,e,s){return t.findIndex(n=>e(n)===s)}function Ct(t,e,s,n){return t.length===0?!1:t.every(r=>n(s[e(r)]))}function Nt(t,e,s,n,r){if(t.length===0)return null;const i=ds(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const c=e(l);if(c!==r&&!n(s[c]))return c}return null}function hr(t){return!t.isStreaming&&t.allAnswered}function us(t){const{parts:e,partKey:s,schema:n,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,c=e[0]?s(e[0]):"",[d,u]=P.useState(c),[V,p]=P.useState(!1),f=Ss({resolver:Cs(n),defaultValues:r}),h=f.watch(),m=ds(e,s,d),g=m>=0?e[m]:void 0,v=a(h[d]),x=Ct(e,s,h,a),b=hr({isStreaming:i,allAnswered:x}),A=()=>{if(m>0){const I=e[m-1];I&&u(s(I))}},j=()=>{if(m>=0&&m<e.length-1){const I=e[m+1];I&&u(s(I))}},y=()=>{const I=f.getValues(),C=Nt(e,s,I,a,d);C&&u(C)},k=()=>{f.handleSubmit(I=>{const C=I;for(const M of e)l(M,C[s(M)])})()},w=P.useRef(k);w.current=k;const S=()=>{b&&(p(!1),w.current())},N=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),w.current()}else{const C=Nt(e,s,I,a,d);C&&u(C)}};return P.useEffect(()=>{if(V&&!i){if(!x){p(!1);return}p(!1),w.current()}},[V,i,x]),{form:f,activeKey:d,setActiveKey:u,currentIndex:m,currentPart:g,isCurrentAnswered:v,isAllAnswered:x,canSubmit:b,goPrev:A,goNext:j,advanceToNextUnanswered:y,submit:S,submitOrAdvance:N}}const ps="chat.approval.defaultDenyReason";function fs(t){const e=R.c(36),{onYolo:s}=t,n=K(),[r,i]=Ne();let a,l,c,d,u,V,p,f,h;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const A=Ce.find(k=>k.value===r.toolApprovalLevel)??Ce[0];let j;e[13]!==s||e[14]!==r||e[15]!==i?(j=k=>{const w=k,S=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:w}),w==="auto"&&s(S)},e[13]=s,e[14]=r,e[15]=i,e[16]=j):j=e[16];const y=j;c=eo,f=r.toolApprovalLevel,h=y,l=to,u="xs",V="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=mr,a=so,d=n(A.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=a,e[5]=l,e[6]=c,e[7]=d,e[8]=u,e[9]=V,e[10]=p,e[11]=f,e[12]=h}else a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],V=e[9],p=e[10],f=e[11],h=e[12];let m;e[17]!==a||e[18]!==d?(m=o.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=m):m=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==V||e[23]!==p||e[24]!==m?(g=o.jsx(l,{size:u,className:V,onClick:p,children:m}),e[20]=l,e[21]=u,e[22]=V,e[23]=p,e[24]=m,e[25]=g):g=e[25];let v;e[26]!==n?(v=Ce.map(A=>o.jsx(Xn,{value:A.value,children:n(A.labelKey)},A.value)),e[26]=n,e[27]=v):v=e[27];let x;e[28]!==v?(x=o.jsx(no,{children:v}),e[28]=v,e[29]=x):x=e[29];let b;return e[30]!==c||e[31]!==x||e[32]!==f||e[33]!==h||e[34]!==g?(b=o.jsxs(c,{value:f,onValueChange:h,children:[g,x]}),e[30]=c,e[31]=x,e[32]=f,e[33]=h,e[34]=g,e[35]=b):b=e[35],b}function mr(t){return t.stopPropagation()}function hs(t){const e=R.c(8),{input:s}=t,n=K();if(s==null){let a;e[0]!==n?(a=n("chat.approval.noInput"),e[0]=n,e[1]=a):a=e[1];let l;return e[2]!==a?(l=o.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(i=o.jsx("div",{className:"px-4",children:o.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[6]=r,e[7]=i):i=e[7],i}function gr(t){const e=R.c(38),{approval:s,onRespond:n}=t,r=K(),[i]=Ne(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==n||e[3]!==r?(l=()=>n(s.approvalId,!1,r(ps),a),e[0]=s.approvalId,e[1]=a,e[2]=n,e[3]=r,e[4]=l):l=e[4];const c=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==n?(d=()=>n(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=n,e[8]=d):d=e[8];const u=d;let V;e[9]!==s.approvalId||e[10]!==n?(V=S=>n(s.approvalId,!0,void 0,S),e[9]=s.approvalId,e[10]=n,e[11]=V):V=e[11];const p=V;let f;e[12]!==p?(f=o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(fs,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const h=f;let m;e[14]!==r?(m=r("chat.approval.denyButton"),e[14]=r,e[15]=m):m=e[15];let g;e[16]!==c||e[17]!==m?(g=o.jsx(G,{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:m}),e[16]=c,e[17]=m,e[18]=g):g=e[18];let v;e[19]!==r?(v=r("chat.approval.acceptButton"),e[19]=r,e[20]=v):v=e[20];let x;e[21]!==u||e[22]!==v?(x=o.jsx(G,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:v}),e[21]=u,e[22]=v,e[23]=x):x=e[23];let b;e[24]!==g||e[25]!==x?(b=o.jsxs(o.Fragment,{children:[g,x]}),e[24]=g,e[25]=x,e[26]=b):b=e[26];const A=b;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Je,{size:14}),e[27]=j):j=e[27];let y;e[28]!==r?(y=r("chat.approval.needsApproval"),e[28]=r,e[29]=y):y=e[29];let k;e[30]!==s.input?(k=o.jsx(hs,{input:s.input}),e[30]=s.input,e[31]=k):k=e[31];let w;return e[32]!==s.friendlyName||e[33]!==h||e[34]!==A||e[35]!==y||e[36]!==k?(w=o.jsx(pe,{icon:j,label:y,title:s.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:A,children:k}),e[32]=s.friendlyName,e[33]=h,e[34]=A,e[35]=y,e[36]=k,e[37]=w):w=e[37],w}const xr=Ns(ne(),ie({approved:Is().optional(),levelOverride:ze(["auto","readonly"]).optional()}));function vr(t){const e=R.c(46),{approvals:s,isStreaming:n,onRespond:r}=t,i=K(),[a]=Ne(),l=a.toolApprovalLevel??"readonly";let c;e[0]!==s?(c=Object.fromEntries(s.map(yr)),e[0]=s,e[1]=c):c=e[1];const d=c;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(C,M)=>{const D=M;typeof D?.approved=="boolean"&&r(C.approvalId,D.approved,D.approved===!1?i(ps):void 0,D.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let V;e[6]!==s||e[7]!==d||e[8]!==n||e[9]!==u?(V={parts:s,partKey:Ar,schema:xr,defaultValues:d,isStreaming:n,hasAnswer:br,onSubmit:u},e[6]=s,e[7]=d,e[8]=n,e[9]=u,e[10]=V):V=e[10];const p=us(V);let f;e[11]!==s||e[12]!==p?(f=C=>{p.form.reset(Object.fromEntries(s.map(M=>[M.approvalId,{approved:!0,levelOverride:C}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const h=f,m=p.currentPart,g=p.form;let v;e[14]!==p?(v=C=>{C.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Je,{size:14}),e[16]=x):x=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const A=m?.friendlyName??"";let j;e[20]!==h?(j=o.jsx(fs,{onYolo:h}),e[20]=h,e[21]=j):j=e[21];let y;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==j?(y=o.jsx(cs,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:j}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=j,e[27]=y):y=e[27];let k;e[28]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(k=m?o.jsx(jr,{approvalId:m.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=m,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=k):k=e[31];let w;e[32]!==m?(w=m?o.jsx(hs,{input:m.input}):null,e[32]=m,e[33]=w):w=e[33];let S;e[34]!==y||e[35]!==k||e[36]!==w||e[37]!==b||e[38]!==A?(S=o.jsx(pe,{icon:x,label:b,title:A,defaultExpanded:!0,footerLeft:y,footerRight:k,children:w}),e[34]=y,e[35]=k,e[36]=w,e[37]=b,e[38]=A,e[39]=S):S=e[39];let N;e[40]!==S||e[41]!==v?(N=o.jsx("form",{onSubmit:v,children:S}),e[40]=S,e[41]=v,e[42]=N):N=e[42];let I;return e[43]!==p.form||e[44]!==N?(I=o.jsx(ot,{...g,children:N}),e[43]=p.form,e[44]=N,e[45]=I):I=e[45],I}function br(t){return typeof t?.approved=="boolean"}function Ar(t){return t.approvalId}function yr(t){return[t.approvalId,{approved:void 0}]}function jr(t){const e=R.c(7),{approvalId:s,control:n,onChange:r}=t,i=K(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,V=u.value===!0,p=u.value===!1;return o.jsxs(o.Fragment,{children:[o.jsx(G,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),o.jsx(G,{type:"button",variant:V?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":V,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let c;return e[3]!==n||e[4]!==a||e[5]!==l?(c=o.jsx(Ts,{control:n,name:a,render:l}),e[3]=n,e[4]=a,e[5]=l,e[6]=c):c=e[6],c}function kr(){const t=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Je,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.approval.preparingRequest"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.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,o.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function wr(t){const e=R.c(8),{approvals:s,isStreaming:n,onRespond:r}=t;if(n&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(kr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=o.jsx(gr,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==n||e[6]!==r?(i=o.jsx(vr,{approvals:s,isStreaming:n,onRespond:r}),e[4]=s,e[5]=n,e[6]=r,e[7]=i):i=e[7],i}function Sr(t){const e=R.c(28),{plan:s,onApprove:n,onDismiss:r}=t,i=K();let a;e[0]!==n||e[1]!==s.plan?(a=()=>{n(s.plan)},e[0]=n,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let c;e[3]!==i?(c=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==c?(d=o.jsx(G,{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:r,children:c}),e[5]=r,e[6]=c,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let V;e[10]!==l||e[11]!==u?(V=o.jsx(G,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:l,children:u}),e[10]=l,e[11]=u,e[12]=V):V=e[12];let p;e[13]!==d||e[14]!==V?(p=o.jsxs(o.Fragment,{children:[d,V]}),e[13]=d,e[14]=V,e[15]=p):p=e[15];const f=p;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Qt,{size:14}),e[16]=h):h=e[16];let m;e[17]!==i?(m=i("chat.proposePlan.planReady"),e[17]=i,e[18]=m):m=e[18];let g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let v;e[21]!==s.plan?(v=o.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:o.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:o.jsx(an,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=v):v=e[22];let x;return e[23]!==f||e[24]!==v||e[25]!==m||e[26]!==g?(x=o.jsx(pe,{icon:h,label:m,title:g,defaultExpanded:!0,footerRight:f,children:v}),e[23]=f,e[24]=v,e[25]=m,e[26]=g,e[27]=x):x=e[27],x}function Cr(t){const e=R.c(6),{plans:s,onApprove:n,onDismiss:r}=t;let i;e[0]!==s?(i=as(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==n||e[4]!==r?(l=o.jsx(Sr,{plan:a,onApprove:n,onDismiss:r}),e[2]=a,e[3]=n,e[4]=r,e[5]=l):l=e[5],l}function ms(t){return t?"response"in t?t.response:t.option??t.draft:""}const It=ie({response:ne().min(1,"Response is required")}),Nr=ie({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ir=ie({response:ze(["yes","no"])});function Tr(t){switch(t.type){case"text":return It;case"choice":return Nr;case"confirm":return Ir;default:return It}}function _r(t){const e={};for(const s of t)e[s.toolCallId]=Tr(s.input);return ie(e)}function Mr(t){const e=R.c(7),{control:s,name:n,placeholder:r}=t,i=K();let a;e[0]!==r||e[1]!==i?(a=c=>{const{field:d}=c,u=d.value??"";return o.jsxs(ct,{children:[o.jsx(dt,{children:o.jsx("div",{className:"px-2",children:o.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Yt,{size:16,className:"text-muted-foreground"})}),o.jsx("input",{...d,value:u,type:"text",placeholder:r||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),o.jsx(ut,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==n||e[5]!==a?(l=o.jsx(Jt,{control:s,name:n,render:a}),e[3]=s,e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function gs(t,e){const s=R.c(4);let n,r;s[0]!==t||s[1]!==e?(n=()=>{const i=a=>{if(hn(a.target)||a.metaKey||a.ctrlKey||a.altKey)return;const l=Number.parseInt(a.key,10);l>=1&&l<=t&&(a.preventDefault(),e(l-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=n,s[3]=r):(n=s[2],r=s[3]),P.useEffect(n,r)}function Dr(t){const e=R.c(51),{control:s,name:n,options:r}=t,i=K(),a=`${n}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:c}=mt(l),d=`${n}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:V}=mt(u),p=c.value,f=V.value??"";let h;if(e[6]!==c||e[7]!==r?(h=U=>{const T=r[U];T!=null&&c.onChange(T)},e[6]=c,e[7]=r,e[8]=h):h=e[8],gs(r.length,h),r.length===0)return null;const m=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let v;if(e[11]!==c||e[12]!==p||e[13]!==r||e[14]!==i){let U;e[16]!==c||e[17]!==p||e[18]!==i?(U=(T,L)=>{const F=p===T;return o.jsxs("button",{type:"button",onClick:()=>c.onChange(T),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",F&&"bg-accent/50",!F&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:T}),children:[o.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",F?"bg-chart-1 text-white":"bg-muted text-foreground"),children:L+1}),o.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:T})]},`${L}-${T}`)},e[16]=c,e[17]=p,e[18]=i,e[19]=U):U=e[19],v=r.map(U),e[11]=c,e[12]=p,e[13]=r,e[14]=i,e[15]=v}else v=e[15];const x=m&&"bg-accent/50",b=!m&&"hover:bg-accent/30";let A;e[20]!==x||e[21]!==b?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",x,b),e[20]=x,e[21]=b,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Yt,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const y=m?f:"";let k;e[24]!==V||e[25]!==c||e[26]!==p?(k=U=>{V.onChange(U.target.value),p!==null&&c.onChange(null)},e[24]=V,e[25]=c,e[26]=p,e[27]=k):k=e[27];let w;e[28]!==c||e[29]!==p?(w=()=>{p!==null&&c.onChange(null)},e[28]=c,e[29]=p,e[30]=w):w=e[30];let S;e[31]!==i?(S=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=S):S=e[32];let N;e[33]!==i?(N=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=N):N=e[34];let I;e[35]!==y||e[36]!==k||e[37]!==w||e[38]!==S||e[39]!==N?(I=o.jsx("input",{type:"text",value:y,onChange:k,onFocus:w,placeholder:S,"aria-label":N,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=y,e[36]=k,e[37]=w,e[38]=S,e[39]=N,e[40]=I):I=e[40];let C;e[41]!==A||e[42]!==I?(C=o.jsxs("label",{className:A,children:[j,I]}),e[41]=A,e[42]=I,e[43]=C):C=e[43];let M;e[44]!==C||e[45]!==g||e[46]!==v?(M=o.jsx(dt,{children:o.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[v,C]})}),e[44]=C,e[45]=g,e[46]=v,e[47]=M):M=e[47];let D;e[48]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(ut,{}),e[48]=D):D=e[48];let E;return e[49]!==M?(E=o.jsxs(ct,{children:[M,D]}),e[49]=M,e[50]=E):E=e[50],E}function Rr(t){const e=R.c(8),{control:s,name:n}=t,r=K();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.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],gs(a.length,c);let d;e[2]!==r?(d=V=>{const{field:p}=V;return l.current=p,o.jsxs(ct,{children:[o.jsx(dt,{children:o.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const h=p.value===f;return o.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[o.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),o.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),o.jsx(ut,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==n||e[6]!==d?(u=o.jsx(Jt,{control:s,name:n,render:d}),e[4]=s,e[5]=n,e[6]=d,e[7]=u):u=e[7],u}function Tt(t){const e=R.c(13),{input:s,control:n,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==n||e[1]!==s.default||e[2]!==i?(a=o.jsx(Mr,{control:n,name:i,placeholder:s.default}),e[0]=n,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==n||e[7]!==a||e[8]!==r?(l=o.jsx(Dr,{control:n,name:r,options:a}),e[6]=n,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==n||e[11]!==i?(a=o.jsx(Rr,{control:n,name:i}),e[10]=n,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Er(t){const e=R.c(91),{parts:s,isStreaming:n,onSubmit:r}=t;let i;e[0]!==s?(i=_r(s.map(Fr)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Lr)),e[2]=s,e[3]=l):l=e[3];const c=l;let d;e[4]!==r?(d=($,z)=>{const Q=ms(z);Q&&r($,Q)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==n||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Ur,schema:a,defaultValues:c,isStreaming:n,hasAnswer:Pr,onSubmit:d},e[6]=c,e[7]=n,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const V=us(u),p=V.currentPart,f=K();let h;e[12]!==p||e[13]!==V||e[14]!==f?(h=()=>{const $=p;if(!$)return;const z=f("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(V.form.setValue(`${Q}.option`,null),V.form.setValue(`${Q}.draft`,z)):V.form.setValue(`${Q}.response`,z),V.advanceToNextUnanswered()},e[12]=p,e[13]=V,e[14]=f,e[15]=h):h=e[15];const m=h;let g;e[16]!==V.currentIndex||e[17]!==V.goNext||e[18]!==V.goPrev||e[19]!==s.length?(g=o.jsx(cs,{currentIndex:V.currentIndex,total:s.length,onPrev:V.goPrev,onNext:V.goNext}),e[16]=V.currentIndex,e[17]=V.goNext,e[18]=V.goPrev,e[19]=s.length,e[20]=g):g=e[20];const v=g;let x;e[21]!==f?(x=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=x):x=e[22];let b;e[23]!==m||e[24]!==x?(b=o.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:x}),e[23]=m,e[24]=x,e[25]=b):b=e[25];let A;e[26]!==V.isAllAnswered||e[27]!==V.isCurrentAnswered||e[28]!==V.submitOrAdvance||e[29]!==n?(A=o.jsx(fr,{isStreaming:n,isAllAnswered:V.isAllAnswered,isCurrentAnswered:V.isCurrentAnswered,onAdvanceOrSubmit:V.submitOrAdvance}),e[26]=V.isAllAnswered,e[27]=V.isCurrentAnswered,e[28]=V.submitOrAdvance,e[29]=n,e[30]=A):A=e[30];let j;e[31]!==b||e[32]!==A?(j=o.jsxs(o.Fragment,{children:[b,A]}),e[31]=b,e[32]=A,e[33]=j):j=e[33];const y=j;if(s.length===1){const $=s[0];if(!$?.input)return null;const z=V.form;let Q;e[34]!==V?(Q=X=>{X.preventDefault(),V.submit()},e[34]=V,e[35]=Q):Q=e[35];let ee;e[36]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(nt,{size:14}),e[36]=ee):ee=e[36];let te;e[37]!==f?(te=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=te):te=e[38];let H;e[39]!==$.input?.prompt||e[40]!==f?(H=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=H):H=e[41];const oe=$.input;let _;e[42]!==V.form.control||e[43]!==$.toolCallId||e[44]!==oe?(_=o.jsx(Tt,{input:oe,control:V.form.control,toolCallId:$.toolCallId}),e[42]=V.form.control,e[43]=$.toolCallId,e[44]=oe,e[45]=_):_=e[45];let B;e[46]!==y||e[47]!==te||e[48]!==H||e[49]!==_?(B=o.jsx(pe,{icon:ee,label:te,title:H,defaultExpanded:!0,footerRight:y,children:_}),e[46]=y,e[47]=te,e[48]=H,e[49]=_,e[50]=B):B=e[50];let J;e[51]!==Q||e[52]!==B?(J=o.jsx("form",{onSubmit:Q,autoComplete:"off",children:B}),e[51]=Q,e[52]=B,e[53]=J):J=e[53];let Z;return e[54]!==V.form||e[55]!==J?(Z=o.jsx(ot,{...z,children:J}),e[54]=V.form,e[55]=J,e[56]=Z):Z=e[56],Z}const k=V.form;let w;e[57]!==V?(w=$=>{$.preventDefault(),V.submit()},e[57]=V,e[58]=w):w=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(nt,{size:14}),e[59]=S):S=e[59];let N;e[60]!==f?(N=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=N):N=e[61];const I=V.currentIndex+1;let C;e[62]!==s.length||e[63]!==f||e[64]!==I?(C=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=C):C=e[65];let M;e[66]!==p?.input?.prompt||e[67]!==f?(M=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=M):M=e[68];const D=V.activeKey,E=V.setActiveKey;let U;if(e[69]!==V.form||e[70]!==s){let $;e[72]!==V.form?($=z=>o.jsx(ro,{value:z.toolCallId,className:"mt-0",children:o.jsx(Tt,{input:z.input,control:V.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=V.form,e[73]=$):$=e[73],U=s.map($),e[69]=V.form,e[70]=s,e[71]=U}else U=e[71];let T;e[74]!==V.activeKey||e[75]!==V.setActiveKey||e[76]!==U?(T=o.jsx(io,{value:D,onValueChange:E,children:U}),e[74]=V.activeKey,e[75]=V.setActiveKey,e[76]=U,e[77]=T):T=e[77];let L;e[78]!==v||e[79]!==y||e[80]!==N||e[81]!==C||e[82]!==M||e[83]!==T?(L=o.jsx(pe,{icon:S,label:N,count:C,title:M,defaultExpanded:!0,footerLeft:v,footerRight:y,children:T}),e[78]=v,e[79]=y,e[80]=N,e[81]=C,e[82]=M,e[83]=T,e[84]=L):L=e[84];let F;e[85]!==w||e[86]!==L?(F=o.jsx("form",{onSubmit:w,autoComplete:"off",children:L}),e[85]=w,e[86]=L,e[87]=F):F=e[87];let W;return e[88]!==V.form||e[89]!==F?(W=o.jsx(ot,{...k,children:F}),e[88]=V.form,e[89]=F,e[90]=W):W=e[90],W}function Pr(t){return!!ms(t)}function Ur(t){return t.toolCallId}function Lr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Fr(t){return{toolCallId:t.toolCallId,input:t.input}}function zr(){const t=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(nt,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.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,o.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function xs(t){const e=R.c(7),{userAskParts:s,isStreaming:n,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Or),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(n){let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(zr,{}),e[2]=c):c=e[2],c}return null}let l;return e[3]!==n||e[4]!==r||e[5]!==a?(l=o.jsx(Er,{parts:a,isStreaming:n,onSubmit:r}),e[3]=n,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Or(t){return t.state==="input-available"}function $r(t){const e=R.c(33),{parts:s,isStreaming:n,onRespond:r}=t,i=K();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,c=l?.input;if(!l||!c?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Qt,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const V=c.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==i?(f=i("chat.suggestTask.notNow"),e[8]=i,e[9]=f):f=e[9];let h;e[10]!==n||e[11]!==p||e[12]!==f?(h=o.jsx(G,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:n,onClick:p,children:f}),e[10]=n,e[11]=p,e[12]=f,e[13]=h):h=e[13];let m;e[14]!==r||e[15]!==l?(m=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=m):m=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let v;e[19]!==n||e[20]!==m||e[21]!==g?(v=o.jsx(G,{type:"button",size:"sm",className:"h-7",disabled:n,onClick:m,children:g}),e[19]=n,e[20]=m,e[21]=g,e[22]=v):v=e[22];let x;e[23]!==v||e[24]!==h?(x=o.jsxs(o.Fragment,{children:[h,v]}),e[23]=v,e[24]=h,e[25]=x):x=e[25];let b;e[26]!==c.summary?(b=c.summary?o.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:c.summary}):null,e[26]=c.summary,e[27]=b):b=e[27];let A;return e[28]!==c.title||e[29]!==x||e[30]!==b||e[31]!==u?(A=o.jsx(pe,{icon:d,label:u,title:V,defaultExpanded:!0,footerRight:x,children:b}),e[28]=c.title,e[29]=x,e[30]=b,e[31]=u,e[32]=A):A=e[32],A}function Br(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,n=t.length;if(n>0&&s===n)return{icon:"completed",activity:"All done",progress:`${n}/${n}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${n} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${n} done`}:s>0?{icon:"pending",activity:`${n-s} pending`,progress:`${s}/${n} done`}:{icon:"pending",activity:`${n} todos`,progress:"not started"}}function Kr(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let n;e[0]!==s?(n=Br(s),e[0]=s,e[1]=n):n=e[1];const r=n;let i;e[2]!==r.icon?(i=o.jsx(Wr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let c;e[4]!==s?(c=s.map(qr),e[4]=s,e[5]=c):c=e[5];let d;e[6]!==c?(d=o.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:c}),e[6]=c,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=o.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function qr(t,e){return o.jsx(Qr,{todo:t},e)}function Qr(t){const e=R.c(14),{todo:s}=t,n=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=o.jsx(Yr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=n&&"text-muted-foreground";let c;e[2]!==l?(c=O("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=c):c=e[3];const d=n?"100%":"0%",u=n?"width 300ms ease 200ms":"width 150ms ease";let V;e[4]!==d||e[5]!==u?(V=o.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=V):V=e[6];let p;e[7]!==i||e[8]!==c||e[9]!==V?(p=o.jsxs("span",{className:c,children:[i,V]}),e[7]=i,e[8]=c,e[9]=V,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=o.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[a,p]}),e[11]=a,e[12]=p,e[13]=f):f=e[13],f}function Yr(t){const e=R.c(4),{status:s}=t,n=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("svg",{viewBox:"0 0 21 21",children:o.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]=i):i=e[0];let a;return e[1]!==n||e[2]!==r?(a=o.jsx("div",{className:"todo-cb mt-0.5","data-checked":n,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function Wr(t){const e=R.c(13),{status:s}=t,n=K();if(s==="completed"){let a;e[0]!==n?(a=n("chat.todoStatus.completed"),e[0]=n,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.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:o.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let c;return e[3]!==a?(c=o.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=c):c=e[4],c}if(s==="in_progress"){let a;e[5]!==n?(a=n("chat.todoStatus.inProgress"),e[5]=n,e[6]=a):a=e[6];let l;return e[7]!==a?(l=o.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==n?(r=n("chat.todoStatus.pending"),e[9]=n,e[10]=r):r=e[10];let i;return e[11]!==r?(i=o.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const Gr={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},Hr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Jr(t){const e=R.c(46),{source:s,onDone:n}=t,r=K(),i=_s(),[a]=Ne(),[l,c]=P.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=P.useState(""),[V,p]=P.useState(!1),f=l==="brl"?"R$":"$";let h;e[0]!==l||e[1]!==i?(h=async T=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:T,currency:l});return L},e[0]=l,e[1]=i,e[2]=h):h=e[2];let m;e[3]!==n?(m=T=>{T&&window.open(T,"_blank","noopener,noreferrer"),n?.()},e[3]=n,e[4]=m):m=e[4];let g;e[5]!==r?(g=T=>{Ue.error(r("credits.topUp.failed",{message:T.message}))},e[5]=r,e[6]=g):g=e[6];let v;e[7]!==h||e[8]!==m||e[9]!==g?(v={mutationFn:h,onSuccess:m,onError:g},e[7]=h,e[8]=m,e[9]=g,e[10]=v):v=e[10];const{mutate:x,isPending:b}=Ms(v);let A;e[11]!==l||e[12]!==s||e[13]!==x?(A=(T,L)=>{se("credits_topup_clicked",{amount_cents:T,currency:l,tier_label:L,source:s}),x(T)},e[11]=l,e[12]=s,e[13]=x,e[14]=A):A=e[14];const j=A,y=parseFloat(d),k=!isNaN(y)&&y>=1;let w,S,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=T=>{T&&c(T)},S=o.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=o.jsx(yt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=w,e[16]=S,e[17]=N):(w=e[15],S=e[16],N=e[17]);let I;e[18]!==l?(I=o.jsx("div",{className:"mb-4",children:o.jsxs(uo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:w,children:[S,N]})}),e[18]=l,e[19]=I):I=e[19];const C=Gr[l];let M;if(e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==C){let T;e[26]!==j||e[27]!==f||e[28]!==b||e[29]!==r?(T=L=>{const{dollars:F,labelKey:W}=L;return o.jsxs("button",{type:"button",disabled:b,onClick:()=>j(F*100,Hr[W]??"preset"),className:O("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:[o.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,F]}),o.jsx("span",{className:"text-xs text-muted-foreground",children:r(W)})]},F)},e[26]=j,e[27]=f,e[28]=b,e[29]=r,e[30]=T):T=e[30],M=C.map(T),e[20]=j,e[21]=f,e[22]=b,e[23]=r,e[24]=C,e[25]=M}else M=e[25];let D;e[31]!==M?(D=o.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:M}),e[31]=M,e[32]=D):D=e[32];let E;e[33]!==j||e[34]!==f||e[35]!==d||e[36]!==y||e[37]!==k||e[38]!==b||e[39]!==V||e[40]!==r?(E=V?o.jsxs("div",{className:"flex gap-2 mt-3",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),o.jsx(Ds,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:d,onChange:T=>u(T.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),o.jsx(G,{className:"h-10",disabled:!k||b,onClick:()=>j(Math.round(y*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):o.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:r("credits.topUp.enterCustom")}),e[33]=j,e[34]=f,e[35]=d,e[36]=y,e[37]=k,e[38]=b,e[39]=V,e[40]=r,e[41]=E):E=e[41];let U;return e[42]!==D||e[43]!==E||e[44]!==I?(U=o.jsxs("div",{children:[I,D,E]}),e[42]=D,e[43]=E,e[44]=I,e[45]=U):U=e[45],U}const Zr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Xr(t){const e=R.c(47),{onDismiss:s}=t,{org:n}=Ie(),r=at(),{decoKeyId:i}=co(),a=K(),l=$e("credits");let c,d;if(e[0]!==n.id?(c=()=>{se("credits_exhausted_shown",{organization_id:n.id})},d=[n.id],e[0]=n.id,e[1]=c,e[2]=d):(c=e[1],d=e[2]),P.useEffect(c,d),!l)return null;let u;e[3]!==s?(u=C=>!C&&s?.(),e[3]=s,e[4]=u):u=e[4];let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=["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[5]=V):V=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:V.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=o.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"}),e[7]=f):f=e[7];let h;e[8]!==a?(h=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=h):h=e[9];let m;e[10]!==h?(m=o.jsx(Rs,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=m):m=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let v;e[14]!==g?(v=o.jsx(Es,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=v):v=e[15];let x;e[16]!==v||e[17]!==m?(x=o.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,o.jsxs(Ps,{className:"relative gap-4",children:[f,o.jsxs("div",{children:[m,v]})]})]}),e[16]=v,e[17]=m,e[18]=x):x=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&o.jsxs("div",{className:"px-8 pt-5 pb-6",children:[o.jsx("div",{className:"rounded-xl border border-border p-5",children:o.jsx(Jr,{source:"exhausted_banner",onDone:s})}),o.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Zr.map(C=>o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:o.jsx(lt,{size:12,className:"text-success"})}),o.jsx("span",{className:"text-sm text-foreground/80",children:a(C)})]},C))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let A;e[23]!==a?(A=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=A):A=e[24];let j;e[25]!==s||e[26]!==A?(j=o.jsx(G,{variant:"ghost",size:"sm",onClick:s,children:A}),e[25]=s,e[26]=A,e[27]=j):j=e[27];let y;e[28]!==r||e[29]!==s||e[30]!==n.slug?(y=()=>{r({to:"/$org/settings/ai-providers",params:{org:n.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=n.slug,e[31]=y):y=e[31];let k;e[32]!==a?(k=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=o.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:y,children:k}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let S;e[37]!==j||e[38]!==w?(S=o.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,w]}),e[37]=j,e[38]=w,e[39]=S):S=e[39];let N;e[40]!==x||e[41]!==b||e[42]!==S?(N=o.jsxs(Us,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ei,children:[x,b,S]}),e[40]=x,e[41]=b,e[42]=S,e[43]=N):N=e[43];let I;return e[44]!==N||e[45]!==u?(I=o.jsx(Ls,{open:!0,onOpenChange:u,children:N}),e[44]=N,e[45]=u,e[46]=I):I=e[46],I}function ei(t){return t.preventDefault()}const ti={trial_exhausted:{label:"chat.subscriptionLimit.trialLabel",title:"chat.subscriptionLimit.trialTitle"},monthly_exhausted:{label:"chat.subscriptionLimit.monthlyLabel",title:"chat.subscriptionLimit.monthlyTitle"},runs_exhausted:{label:"chat.subscriptionLimit.runsLabel",title:"chat.subscriptionLimit.runsTitle"}};function si(t){const e=R.c(16),{kind:s,onDismiss:n,onSubscribe:r}=t,i=K(),{label:a,title:l}=ti[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Vt,{size:14}),e[0]=c):c=e[0];let d;e[1]!==a||e[2]!==i?(d=i(a),e[1]=a,e[2]=i,e[3]=d):d=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let V;e[7]!==s||e[8]!==r||e[9]!==i?(V=s==="trial_exhausted"?o.jsx(G,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=V):V=e[10];let p;return e[11]!==n||e[12]!==d||e[13]!==u||e[14]!==V?(p=o.jsx(pe,{icon:c,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:n,footerRight:V}),e[11]=n,e[12]=d,e[13]=u,e[14]=V,e[15]=p):p=e[15],p}const ni={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function _t(t){const e=R.c(21),{kind:s,onDismiss:n}=t,r=K(),i=at(),{org:a}=Ie(),{label:l,title:c}=ni[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Vt,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let V;e[4]!==r||e[5]!==c?(V=r(c),e[4]=r,e[5]=c,e[6]=V):V=e[6];let p;e[7]!==i||e[8]!==n||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),n()},e[7]=i,e[8]=n,e[9]=a.slug,e[10]=p):p=e[10];let f;e[11]!==r?(f=r("chat.planRefused.seePlans"),e[11]=r,e[12]=f):f=e[12];let h;e[13]!==p||e[14]!==f?(h=o.jsx(G,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=h):h=e[15];let m;return e[16]!==n||e[17]!==u||e[18]!==V||e[19]!==h?(m=o.jsx(pe,{icon:d,label:u,title:V,defaultExpanded:!0,variant:"warning",onClose:n,footerRight:h}),e[16]=n,e[17]=u,e[18]=V,e[19]=h,e[20]=m):m=e[20],m}function vs(t){const e=oi(t);if(e!==null){const d=vs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),n=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,c=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(c){const d=c[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||n&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{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}}function oi(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:n,message:r}=s,i=typeof n=="string"?n:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const ri={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Ye(t){const e=R.c(29),s=K(),{variant:n,onDismiss:r}=t,i=n==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,c=i?Jn:zs;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const x=ri[t.finishReason];return x?s(x):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let V;e[8]!==i||e[9]!==u?(V=i?vs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=V):V=e[10];const{summary:p,rawDetails:f}=V;let h;e[11]!==c?(h=o.jsx(c,{size:14}),e[11]=c,e[12]=h):h=e[12];let m;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(m=i?o.jsx(G,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):o.jsx(G,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=m):m=e[17];let g;e[18]!==f||e[19]!==s?(g=f?o.jsxs("details",{className:"group mx-4",children:[o.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:[o.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:o.jsx("path",{d:"m4.5 3 3 3-3 3"})}),o.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),o.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),o.jsxs("div",{className:"relative mt-2",children:[o.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Ue.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ue.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:o.jsx(Zn,{className:"size-3.5"})}),o.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:f})]})]}):null,e[18]=f,e[19]=s,e[20]=g):g=e[20];let v;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==h||e[25]!==m||e[26]!==g||e[27]!==n?(v=o.jsx(pe,{icon:h,label:l,title:p,defaultExpanded:!0,variant:n,onClose:r,footerRight:m,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=h,e[25]=m,e[26]=g,e[27]=n,e[28]=v):v=e[28],v}function Be(t){const e=R.c(78);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:n,voiceMode:r}=s,i=n===void 0?!1:n,a=r===void 0?!1:r,l=K(),{error:c,clearError:d,finishReason:u,clearFinishReason:V,messages:p,isStreaming:f,submit:h,sendMessage:m}=Oe(),[g,v]=Ne(),{virtualMcpId:x,createTaskWithMessage:b}=Ge(),{chatMode:A,setChatMode:j,simpleModeTier:y}=He(),k=$e("credits"),{mutate:w}=go("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let S;e[2]!==w?(S=()=>w(),e[2]=w,e[3]=S):S=e[3];const N=S;let I;e[4]!==A||e[5]!==y||e[6]!==x||e[7]!==a?(I=re=>({...a?{voiceMode:!0}:{},tier:y,mode:A,toolApprovalLevel:re,agent:x?{id:x}:void 0}),e[4]=A,e[5]=y,e[6]=x,e[7]=a,e[8]=I):I=e[8];const C=I;let M;e[9]!==g.toolApprovalLevel?(M=g.toolApprovalLevel??Fs(),e[9]=g.toolApprovalLevel,e[10]=M):M=e[10];const D=M,E=p.at(-1),U=E?.role==="assistant"?E.parts:[],T=U.filter(Vi),L=U.filter(Ft),F=ls(U),W=is(U);let $;e[11]!==c||e[12]!==m||e[13]!==l?($=()=>{if(c){const ae={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:c.message})}]}]};m(ae)}},e[11]=c,e[12]=m,e[13]=l,e[14]=$):$=e[14];const z=$;let Q;e[15]!==m||e[16]!==l?(Q=()=>{const re={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(re)},e[15]=m,e[16]=l,e[17]=Q):Q=e[17];const ee=Q;let te;e[18]!==C||e[19]!==D||e[20]!==h?(te=(re,ae)=>{h({kind:"toolOutput",toolCallId:re.toolCallId,output:{response:ae}},C(D))},e[18]=C,e[19]=D,e[20]=h,e[21]=te):te=e[21];const H=te;let oe;e[22]!==C||e[23]!==D||e[24]!==h?(oe=(re,ae)=>{h({kind:"toolOutput",toolCallId:re.toolCallId,output:{accepted:ae}},C(D))},e[22]=C,e[23]=D,e[24]=h,e[25]=oe):oe=e[25];const _=oe;let B;e[26]!==b||e[27]!==g||e[28]!==j||e[29]!==v||e[30]!==l||e[31]!==x?(B=re=>{j("default"),v({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:x,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:re})}]}})},e[26]=b,e[27]=g,e[28]=j,e[29]=v,e[30]=l,e[31]=x,e[32]=B):B=e[32];const J=B,Z=li;let X;e[33]!==C||e[34]!==h?(X=(re,ae,Me,Ae)=>{h({kind:"approval",approvalId:re,approved:ae,...Me?{reason:Me}:{}},C(Ae))},e[33]=C,e[34]=h,e[35]=X):X=e[35];const ue=X,Y=Vs();if(Y.isCreditExhausted){let re;return e[36]!==k||e[37]!==d||e[38]!==i?(re=k?o.jsx(Xr,{onDismiss:d}):o.jsx("div",{className:O(!i&&"absolute bottom-full left-0 right-0"),children:o.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:d})}),e[36]=k,e[37]=d,e[38]=i,e[39]=re):re=e[39],re}const{showError:le,showWarning:Ve,hasApprovals:ce}=Y,ke=T.map(ai).join("|"),Ke=as(F)?.toolCallId??"",me=W.map(ii).join("|"),Te=!i&&"absolute bottom-full left-0 right-0";let ge;e[40]!==Te?(ge=O(Te),e[40]=Te,e[41]=ge):ge=e[41];let de;e[42]!==Y.todos?(de=o.jsx(Kr,{todos:Y.todos}),e[42]=Y.todos,e[43]=de):de=e[43];let xe;e[44]!==d||e[45]!==Y.subscriptionErrorKind||e[46]!==N?(xe=Y.subscriptionErrorKind&&o.jsx(si,{kind:Y.subscriptionErrorKind,onDismiss:d,onSubscribe:N}),e[44]=d,e[45]=Y.subscriptionErrorKind,e[46]=N,e[47]=xe):xe=e[47];let we;e[48]!==d||e[49]!==Y.planRefusal?(we=Y.planRefusal&&o.jsx(_t,{kind:Y.planRefusal,onDismiss:d}),e[48]=d,e[49]=Y.planRefusal,e[50]=we):we=e[50];let fe;e[51]!==d||e[52]!==c||e[53]!==z||e[54]!==le?(fe=le&&o.jsx(Ye,{variant:"error",error:c,onDismiss:d,onFixInChat:z}),e[51]=d,e[52]=c,e[53]=z,e[54]=le,e[55]=fe):fe=e[55];let ve;e[56]!==V||e[57]!==u||e[58]!==ee||e[59]!==Ve?(ve=Ve&&o.jsx(Ye,{variant:"warning",finishReason:u,onDismiss:V,onContinue:ee}),e[56]=V,e[57]=u,e[58]=ee,e[59]=Ve,e[60]=ve):ve=e[60];const De=ce&&o.jsx(wr,{approvals:W,isStreaming:f,onRespond:ue},me),Re=Y.hasPlans&&o.jsx(Cr,{plans:F,isStreaming:f,onApprove:J,onDismiss:Z},Ke),_e=Y.hasTaskSuggestion&&o.jsx($r,{parts:L,isStreaming:f,onRespond:_},L.at(-1)?.toolCallId??"");let be;e[61]!==Y.isWaitingForUserInput||e[62]!==H||e[63]!==f||e[64]!==ke||e[65]!==T?(be=Y.isWaitingForUserInput&&o.jsx(xs,{userAskParts:T,isStreaming:f,onSubmit:H},ke),e[61]=Y.isWaitingForUserInput,e[62]=H,e[63]=f,e[64]=ke,e[65]=T,e[66]=be):be=e[66];let Se;return e[67]!==ge||e[68]!==de||e[69]!==xe||e[70]!==we||e[71]!==fe||e[72]!==ve||e[73]!==De||e[74]!==Re||e[75]!==_e||e[76]!==be?(Se=o.jsxs("div",{className:ge,children:[de,xe,we,fe,ve,De,Re,_e,be]}),e[67]=ge,e[68]=de,e[69]=xe,e[70]=we,e[71]=fe,e[72]=ve,e[73]=De,e[74]=Re,e[75]=_e,e[76]=be,e[77]=Se):Se=e[77],Se}function ii(t){return t.approvalId}function ai(t){return t.toolCallId}function li(){document.querySelector("[data-chat-input]")?.focus()}function Vi(t){return t.type==="tool-user_ask"}Be.Error=function(e){return o.jsx(Ye,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Be.Warning=function(e){return o.jsx(Ye,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Be.UserAskQuestion=xs;function bs(t){const e=R.c(20),{taskId:s}=t,n=K(),r=Dn(s),i=Rn(r),a=En(),{stop:l,removeLocalMessage:c}=Oe();if(i.length===0)return null;let d;e[0]!==n?(d=n("chat.queueTray.sendNow"),e[0]=n,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(Kt,{size:14}),e[4]=V):V=e[4];let p;e[5]!==d||e[6]!==u?(p=o.jsx(Ze,{asChild:!0,children:o.jsx(G,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:V})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==n?(f=n("chat.queueTray.sendNow"),e[8]=n,e[9]=f):f=e[9];let h;e[10]!==f?(h=o.jsx(Xe,{side:"top",children:o.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=h):h=e[11];let m;e[12]!==p||e[13]!==h?(m=o.jsxs(et,{delayDuration:400,children:[p,h]}),e[12]=p,e[13]=h,e[14]=m):m=e[14];let g;return e[15]!==a||e[16]!==c||e[17]!==n||e[18]!==s?(g=(v,x)=>o.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[o.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:x+1}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.text}),o.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:o.jsx(G,{type:"button",variant:"ghost",size:"icon-sm",title:n("chat.queueTray.removeFromQueue"),"aria-label":n("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,v.messageId).then(b=>{b&&(Pn(s,v.messageId),c(v.messageId))})},children:o.jsx(Ot,{className:"size-3.5"})})})]},v.messageId),e[15]=a,e[16]=c,e[17]=n,e[18]=s,e[19]=g):g=e[19],o.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[o.jsx("span",{children:n(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),m]}),i.map(g)]})}function ci(t){return["openai-compatible","openrouter","deco"].includes(t)}function di(t,e){return ci(t)&&ui(e)!==null}function ui(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const pi={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function fi(t,e){return pi[t]?.test(e)??!1}function hi(t){return Io(t)&&fi(t.providerId,t.modelId)}function mi(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const gi={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function xi(t){const e=R.c(32),{tier:s,orgSlot:n,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:c,onClose:d}=t,u=K(),V=ns(),p=new Set(V.map(vi)),f=Un([r,n,i],p),h=f?.keyId??null,[m,g]=P.useState(h??V[0]?.id??null),v=V.some(F=>F.id===m)?m:h??V[0]?.id??null,x=v?V.find(F=>F.id===v):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",A=gi[s];let j;e[0]!==u||e[1]!==A?(j=u(A),e[0]=u,e[1]=A,e[2]=j):j=e[2];let y;e[3]!==j?(y=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:j}),e[3]=j,e[4]=y):y=e[4];let k;e[5]!==c||e[6]!==u||e[7]!==r?(k=r&&o.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:u("chat.modelPreferences.reset")}),e[5]=c,e[6]=u,e[7]=r,e[8]=k):k=e[8];let w;e[9]!==y||e[10]!==k?(w=o.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[y,k]}),e[9]=y,e[10]=k,e[11]=w):w=e[11];const S="flex-1 min-h-0",N=P.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(vo,{}),e[12]=I):I=e[12];const C=xo,M=!0,D=mi(h?f:null,x?.providerId??"deco");let E;e[13]!==v||e[14]!==l||e[15]!==g?(E=F=>{const W=F.keyId??v??"";g(W),l({keyId:W,modelId:F.modelId,title:F.title})},e[13]=v,e[14]=l,e[15]=g,e[16]=E):E=e[16];let U;e[17]!==C||e[18]!==v||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==D||e[23]!==E?(U=o.jsx(C,{compact:M,filterModels:a,onClose:d,credentialId:v,onCredentialChange:g,selectedModel:D,onModelChange:E}),e[17]=C,e[18]=v,e[19]=a,e[20]=d,e[21]=g,e[22]=D,e[23]=E,e[24]=U):U=e[24];let T;e[25]!==N||e[26]!==U||e[27]!==I?(T=o.jsx("div",{className:S,children:o.jsx(N,{fallback:I,children:U})}),e[25]=N,e[26]=U,e[27]=I,e[28]=T):T=e[28];let L;return e[29]!==T||e[30]!==w?(L=o.jsxs("div",{className:b,children:[w,T]}),e[29]=T,e[30]=w,e[31]=L):L=e[31],L}function vi(t){return t.id}const bi=["fast","smart","thinking"];function As(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Mt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function Ai(t){const e=R.c(28),{tier:s,pillIcon:n,groups:r}=t,i=K();let a;e[0]!==i?(a=As(i),e[0]=i,e[1]=a):a=e[1];const l=a,[c,d]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{w.onSelect(),d(!1)},e[2]=u):u=e[2];const V=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=O("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[4]=h):h=e[4];const m=l[s];let g;e[5]!==m?(g=o.jsx("span",{className:h,children:m}),e[5]=m,e[6]=g):g=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Zt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=v):v=e[7];let x;e[8]!==n||e[9]!==p||e[10]!==g?(x=o.jsx(Ze,{asChild:!0,children:o.jsx("span",{className:"inline-flex min-w-0 shrink",children:o.jsx(Xt,{asChild:!0,children:o.jsxs(G,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[n,g,v]})})})}),e[8]=n,e[9]=p,e[10]=g,e[11]=x):x=e[11];let b;e[12]!==p?(b=o.jsx(Xe,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;e[14]!==x||e[15]!==b?(A=o.jsxs(et,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16];let j;if(e[17]!==r||e[18]!==i){let w;e[20]!==i?(w=S=>o.jsx("div",{className:"flex flex-col",children:S.rows.map(N=>o.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[o.jsxs("button",{type:"button",role:"menuitem","aria-label":N.title,onClick:()=>V(N),className:O("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",N.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[N.icon&&o.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:N.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm",children:N.title}),N.subtitle&&o.jsx("div",{className:"text-xs text-muted-foreground",children:N.subtitle})]}),N.active&&o.jsx("span",{title:i("chat.tierTrigger.selected"),children:o.jsx(lt,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&o.jsx(ji,{label:N.title,render:N.modelOverride})]},N.key))},S.key),e[20]=i,e[21]=w):w=e[21],j=r.map(w),e[17]=r,e[18]=i,e[19]=j}else j=e[19];let y;e[22]!==j?(y=o.jsx(es,{align:"end",className:"p-1 w-64",onOpenAutoFocus:yi,children:o.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=y):y=e[23];let k;return e[24]!==c||e[25]!==A||e[26]!==y?(k=o.jsxs(ts,{open:c,onOpenChange:d,children:[A,y]}),e[24]=c,e[25]=A,e[26]=y,e[27]=k):k=e[27],k}function yi(t){return t.preventDefault()}function ji(t){const e=R.c(38),{label:s,render:n}=t,r=K(),i=ss(),[a,l]=P.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>l(!1),e[0]=c):c=e[0];const d=c;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const V=a&&"opacity-100";let p;e[4]!==V?(p=O("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg bg-background border border-border/60 shadow-sm","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",V),e[4]=V,e[5]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(qn,{size:14}),e[6]=f):f=e[6];let h;e[7]!==u||e[8]!==p?(h=o.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=h):h=e[9];const m=h;if(i){let A;e[10]!==m?(A=o.jsx(yo,{asChild:!0,children:m}),e[10]=m,e[11]=A):A=e[11];let j;e[12]!==s||e[13]!==r?(j=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=j):j=e[14];let y;e[15]!==j?(y=o.jsx(jo,{className:"sr-only",children:j}),e[15]=j,e[16]=y):y=e[16];let k;e[17]!==a||e[18]!==n?(k=a&&n(d),e[17]=a,e[18]=n,e[19]=k):k=e[19];let w;e[20]!==k||e[21]!==y?(w=o.jsxs(ko,{className:"p-0 flex flex-col max-h-[95vh]",children:[y,k]}),e[20]=k,e[21]=y,e[22]=w):w=e[22];let S;return e[23]!==a||e[24]!==w||e[25]!==A?(S=o.jsxs(wo,{open:a,onOpenChange:l,children:[A,w]}),e[23]=a,e[24]=w,e[25]=A,e[26]=S):S=e[26],S}let g;e[27]!==m?(g=o.jsx(Xt,{asChild:!0,children:m}),e[27]=m,e[28]=g):g=e[28];let v;e[29]!==a||e[30]!==n?(v=a&&n(d),e[29]=a,e[30]=n,e[31]=v):v=e[31];let x;e[32]!==v?(x=o.jsx(es,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:v}),e[32]=v,e[33]=x):x=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==x?(b=o.jsxs(ts,{open:a,onOpenChange:l,children:[g,x]}),e[34]=a,e[35]=g,e[36]=x,e[37]=b):b=e[37],b}function Dt(t){return t==="fast"?o.jsx(Vt,{size:16}):t==="thinking"?o.jsx(Kn,{size:16}):o.jsx(So,{size:16})}function ki(t){const e=R.c(13),s=zn();let n;e[0]!==t||e[1]!==s.tiers?(n=d=>{const u=s.tiers[d];return u?u.title??u.modelId:t.chat[d]?.title},e[0]=t,e[1]=s.tiers,e[2]=n):n=e[2];const r=n;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let c;return e[9]!==i||e[10]!==a||e[11]!==l?(c={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=c):c=e[12],c}function wi(){const t=R.c(25),e=K(),{simpleModeTier:s,setSimpleModeTier:n}=He(),r=Co(),i=ns(),a=To(i),l=ki(a),{data:c,error:d}=Ln();let u;t[0]!==c?(u=c===void 0?{tiers:{}}:c,t[0]=c,t[1]=u):u=t[1];const V=u,p=Fn(),f=We()?.lockedHarness,h=f==="claude-code",m=$e("model_choice"),g=ao(),v=lo();if(!g||!m)return null;let x,b;if(t[2]!==a||t[3]!==v||t[4]!==h||t[5]!==f||t[6]!==r||t[7]!==n||t[8]!==e||t[9]!==s||t[10]!==l||t[11]!==p||t[12]!==V||t[13]!==d){const w=As(e);x="decopilot",b=bi.map(S=>{const N=l[S],I=V.tiers[S];return{key:`decopilot-${S}`,icon:Dt(S),title:w[S],subtitle:v?N??e(Mt[S]):e(Mt[S]),active:s===S,onSelect:()=>n(S),modelOverride:v?C=>o.jsxs(o.Fragment,{children:[d&&o.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),o.jsx(xi,{tier:S,orgSlot:r.tiers[S],userSlot:I,autoSlot:a.chat[S],filterModels:f==="codex"?Si:h?hi:void 0,onClose:C,onPick:M=>p.mutate({tier:S,slot:M}),onReset:()=>p.mutate({tier:S,slot:null})},`${S}:${I?.keyId??"org"}:${I?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=v,t[4]=h,t[5]=f,t[6]=r,t[7]=n,t[8]=e,t[9]=s,t[10]=l,t[11]=p,t[12]=V,t[13]=d,t[14]=x,t[15]=b}else x=t[14],b=t[15];let A;t[16]!==x||t[17]!==b?(A=[{key:x,rows:b}],t[16]=x,t[17]=b,t[18]=A):A=t[18];const j=A;let y;t[19]!==s?(y=Dt(s),t[19]=s,t[20]=y):y=t[20];let k;return t[21]!==j||t[22]!==y||t[23]!==s?(k=o.jsx(Ai,{tier:s,pillIcon:y,groups:j}),t[21]=j,t[22]=y,t[23]=s,t[24]=k):k=t[24],k}function Si(t){return di(t.providerId,t.modelId)}function ys(t){const e=R.c(3),[s]=Ne();let n;return e[0]!==s.enableSounds||e[1]!==t?(n=()=>{s.enableSounds&&Fo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=n):n=e[2],n}const Ci={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"},Ni=mn.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Ii=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Ti(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center -space-x-1.5",children:Ii.map(_i)}),t[0]=e):e=t[0],e}function _i(t){return o.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Mi({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:n,isStreaming:r,onUnsupportedFile:i}){const a=K(),[l,c]=P.useState(!1),d=ys(Ci),{org:u}=Ie(),{editor:V}=zt(),p=P.useRef(null),f=pt(n),h=()=>{!f||r||(c(!1),p.current?.click())},m=async _=>{const B=_.target.files;if(!B||B.length===0||!V)return;const J=Array.from(B);try{let Z=V.state.selection.from;for(const X of J)await os(V,n??null,X,Z,i,a),Z=V.state.selection.to}finally{p.current&&(p.current.value="")}},g=Eo({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Os.virtualMcpPrompts(s,u.id),{data:x,isLoading:b}=$s({queryKey:v,queryFn:()=>Po(g),staleTime:6e4,enabled:l&&!!g}),A=x?.prompts??[],[j,y]=P.useState(null),{chatMode:k,setChatMode:w}=He(),[S,N]=Ne(),I=We()?.lockedHarness!=="claude-code",C=Ce.find(_=>_.value===S.toolApprovalLevel)??Ce[0],M=a(C.shortKey),D=_=>{const B=Ce.find(J=>J.value===_);if(B){if(B.value===S.toolApprovalLevel){c(!1);return}d(),se("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:B.value,source:"tools_popover"}),N({...S,toolApprovalLevel:B.value}),c(!1)}},E=k==="plan",U=()=>{d();const _=E?"default":"plan";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},T=()=>{e(),c(!1)},L=async(_,B)=>{if(!V||!g)return;const J=jt(_._meta),Z={from:V.state.selection.from,to:V.state.selection.to};try{const X=await Uo(g,_.name,B);Vn(V,Z,{id:_.name,name:ho(_.name,J),metadata:X.messages,char:"/",kind:"prompt",args:B})}catch{Ue.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async _=>{c(!1);const B=!!(_.arguments&&_.arguments.length>0);if(se("chat_prompt_inserted",{prompt_name:_.name,with_arguments:B}),B){y(_);return}await L(_)},W=async _=>{j&&(await L(j,_),y(null))},$=()=>{d();const _=k==="gen-image"?"default":"gen-image";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},z=()=>{d();const _=k==="web-search"?"default":"web-search";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},Q=()=>{d();const _=k==="deep-research"?"default":"deep-research";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},ee=k==="gen-image",te=k==="web-search",H=k==="deep-research",oe=o.jsx("input",{ref:p,type:"file",multiple:!0,accept:bo(n??null),className:"hidden",onChange:m,disabled:r});return o.jsxs(o.Fragment,{children:[oe,o.jsxs(Bs,{open:l,onOpenChange:_=>{_&&!l&&se("chat_tools_popover_opened",{chat_mode:k}),c(_)},children:[o.jsx(Ks,{asChild:!0,children:o.jsxs(G,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[o.jsx(Qn,{size:14}),o.jsx("span",{className:O("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:a("chat.toolsPopover.tools")})]})}),o.jsxs(qs,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?o.jsxs(ye,{onClick:h,disabled:r,children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):o.jsxs(et,{children:[o.jsx(Ze,{asChild:!0,children:o.jsxs(ye,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:_=>_.preventDefault(),children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),o.jsx(Xe,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),o.jsxs(ye,{onClick:U,className:O(E&&"text-special"),children:[o.jsx(qt,{size:16,className:O(E&&"text-special")}),o.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),o.jsx("span",{className:O("text-xs text-muted-foreground",E&&"text-special font-medium"),children:Ni})]}),o.jsxs(ye,{onClick:$,className:O(ee&&"text-special"),children:[o.jsx(Ht,{size:16,className:O(ee&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),ee&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:z,className:O(te&&"text-special"),children:[o.jsx(Wt,{size:16,className:O(te&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:Q,className:O(H&&"text-special"),children:[o.jsx(Gt,{size:16,className:O(H&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),H&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),o.jsx(vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?o.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[o.jsx(Qs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):A.length===0?o.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):A.map(_=>o.jsxs(ye,{onClick:()=>F(_),className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"font-medium text-sm capitalize",children:_.title||fo(_.name,jt(_._meta))}),_.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:_.description})]},_.name))})]}),I&&o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx(Je,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:M})]}),o.jsx(vt,{className:"w-48 p-1.5",children:o.jsx(Ys,{value:S.toolApprovalLevel,onValueChange:D,children:Ce.map(_=>o.jsx(Ws,{value:_.value,children:a(_.labelKey)},_.value))})})]}),o.jsxs(ye,{onClick:T,children:[o.jsx(Lo,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),o.jsx(P.Suspense,{children:o.jsx(Ti,{})})]})]})]}),o.jsx(ln,{prompt:j,setPrompt:y,onSubmit:W})]})}const Di=[{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 Ri(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center -space-x-1",children:Di.map(Ei)}),t[0]=e):e=t[0],e}function Ei(t){return o.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Pi(t){const e=R.c(10),{onClick:s}=t,n=K();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=O("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==n?(i=n("chat.connectionsBanner.description"),e[1]=n,e[2]=i):i=e[2];let a;e[3]!==i?(a=o.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,c;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ri,{}),c=o.jsx(Gs,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=c):(l=e[5],c=e[6]);let d;return e[7]!==s||e[8]!==a?(d=o.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,c]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Pe=48;function Ui(){const t=R.c(9),[e,s]=P.useState("idle"),[n,r]=P.useState(""),[i,a]=P.useState(""),[l,c]=P.useState(zi),d=P.useRef(null),u=P.useRef(null),V=P.useRef(null),p=P.useRef(null),f=P.useRef(0),h=P.useRef(!1),m=P.useRef(""),g=P.useRef(""),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(Fi),p.current?.getTracks().forEach(Li),V.current=null,u.current=null,p.current=null},t[0]=x):x=t[0];const b=x;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=C=>{p.current=C;const M=new AudioContext;u.current=M;const D=M.createMediaStreamSource(C),E=M.createAnalyser();E.fftSize=128,E.smoothingTimeConstant=.8,D.connect(E),V.current=E;const U=new Uint8Array(E.frequencyBinCount),T=()=>{if(!V.current)return;V.current.getByteFrequencyData(U);const L=[];for(let F=0;F<Pe;F++){const W=Math.floor(F/Pe*U.length);L.push(Math.max(.04,(U[W]??0)/255))}c(L),f.current=requestAnimationFrame(T)};T()};A=async()=>{const C=window.SpeechRecognition||window.webkitSpeechRecognition;if(!C)return s("unsupported"),"unsupported";let M;try{M=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),g.current="",m.current="",h.current=!0,s("recording"),I(M);const D=new C;d.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=E=>{if(d.current!==D)return;let U="",T="";for(let L=E.resultIndex;L<E.results.length;L++){const F=E.results[L],W=F?.[0]?.transcript??"";F?.isFinal?T=T+W:U=U+W}T&&(m.current=m.current+T,r(m.current)),g.current=U,a(U)},D.onerror=E=>{d.current===D&&E.error!=="no-speech"&&(h.current=!1,d.current=null,b(),s(E.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(d.current===D&&h.current)try{D.start()}catch{}};try{D.start()}catch{return h.current=!1,d.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let y;t[2]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{h.current=!1,d.current?.stop(),b(),s("idle"),c(Array(Pe).fill(.05)),a("");const I=(m.current+(g.current?" "+g.current:"")).trim();return r(""),m.current="",g.current="",I},t[2]=y):y=t[2];const k=y;let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),c(Array(Pe).fill(.05)),m.current="",g.current=""},t[3]=w):w=t[3];const S=w;let N;return t[4]!==i||t[5]!==e||t[6]!==n||t[7]!==l?(N={status:e,transcript:n,interimTranscript:i,waveformData:l,isSupported:v,startRecording:j,stopRecording:k,cancelRecording:S},t[4]=i,t[5]=e,t[6]=n,t[7]=l,t[8]=N):N=t[8],N}function Li(t){return t.stop()}function Fi(){}function zi(){return Array(Pe).fill(.05)}function Oi(t){const e=R.c(4),{data:s}=t;let n;e[0]!==s?(n=s.map($i),e[0]=s,e[1]=n):n=e[1];let r;return e[2]!==n?(r=o.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:n}),e[2]=n,e[3]=r):r=e[3],r}function $i(t,e){return o.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)}const Le=12e3,Rt=ie({token:ne(),expiresAt:Js()});Zs("provider",[ie({provider:je("elevenlabs"),conversationToken:ne().min(1)}),ie({provider:je("openai"),transport:je("webrtc")})]);const Bi=Hs([Rt.extend({provider:je("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Rt.extend({provider:je("openai"),transport:je("webrtc")})]);ie({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Le)});const js=ie({request:ne().trim().min(1).max(Le)}),rt=5e3;Ut(ie({role:ze(["user","agent"]),text:ne().min(1).max(rt)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=rt,{message:"Voice transcript is too long"});function cl(t){const e=[];let s=rt;for(const n of t.slice(-60).reverse()){if(s<=0)break;const r=n.text.slice(-s);e.unshift({role:n.role,text:r}),s-=r.length}return e}ie({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:ze(["en","pt"]).default("en")}).strict();const Ki=ie({sdp:ne().min(1).max(1e5)});async function qi(t,e,s,n,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:c}=await import("./openai-conversation-CdouWBSm.js");return{startOpenAIConversation:c}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return l(r,s,n)}const{Conversation:i}=await bt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);n.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const c=js.safeParse(l);return JSON.stringify(c.success?await s.onDelegate(c.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return n.aborted&&(await a.endSession(),n.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const c=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?a.sendContextualUpdate(c):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
9
|
+
The report follows.`;function dr(t){return{...t,content:[{type:"paragraph",content:[rn({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:cr}}]})]},...t.content??[]]}}function ur(){const t=R.c(24),e=K(),s=pn();if(!s)return null;let n,r,i,a;t[0]!==s.path||t[1]!==e?(n=fn(s.path),a="flex px-3 pt-3",r="surface-inset flex h-7 min-w-0 items-center gap-1.5 rounded-full pr-0.5 pl-2.5 text-xs text-foreground",i=e("chat.input.openFileContext",{name:n}),t[0]=s.path,t[1]=e,t[2]=n,t[3]=r,t[4]=i,t[5]=a):(n=t[2],r=t[3],i=t[4],a=t[5]);let l,c;t[6]!==n?(l=o.jsx(un,{filename:n,className:"h-4 w-3 shrink-0"}),c=o.jsx("span",{className:"truncate",children:n}),t[6]=n,t[7]=l,t[8]=c):(l=t[7],c=t[8]);let d;t[9]!==e?(d=e("chat.input.openFileDismiss"),t[9]=e,t[10]=d):d=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(Ot,{size:12}),t[11]=u):u=t[11];let V;t[12]!==s.dismiss||t[13]!==d?(V=o.jsx(dn,{label:d,size:"icon-sm",onClick:s.dismiss,children:u}),t[12]=s.dismiss,t[13]=d,t[14]=V):V=t[14];let p;t[15]!==r||t[16]!==i||t[17]!==l||t[18]!==c||t[19]!==V?(p=o.jsxs("span",{className:r,title:i,children:[l,c,V]}),t[15]=r,t[16]=i,t[17]=l,t[18]=c,t[19]=V,t[20]=p):p=t[20];let f;return t[21]!==a||t[22]!==p?(f=o.jsx("div",{className:a,children:p}),t[21]=a,t[22]=p,t[23]=f):f=t[23],f}function pr(t){const e=R.c(30),{current:s,total:n,onPrev:r,onNext:i}=t,a=K();if(n<=1)return null;const l=s===0,c=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==c?(d=O("p-0.5 transition-colors rounded-lg",c),e[0]=c,e[1]=d):d=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(oo,{size:14}),e[4]=V):V=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=o.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:V}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let h;e[10]!==a||e[11]!==f||e[12]!==n?(h=a("chat.pagination.counter",{current:f,total:n}),e[10]=a,e[11]=f,e[12]=n,e[13]=h):h=e[13];let m;e[14]!==h?(m=o.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=m):m=e[15];const g=s===n-1,v=s===n-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let x;e[16]!==v?(x=O("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=x):x=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(Bt,{size:14}),e[20]=A):A=e[20];let j;e[21]!==i||e[22]!==g||e[23]!==x||e[24]!==b?(j=o.jsx("button",{type:"button",onClick:i,disabled:g,className:x,"aria-label":b,children:A}),e[21]=i,e[22]=g,e[23]=x,e[24]=b,e[25]=j):j=e[25];let y;return e[26]!==j||e[27]!==p||e[28]!==m?(y=o.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,m,j]}),e[26]=j,e[27]=p,e[28]=m,e[29]=y):y=e[29],y}function cs(t){const e=R.c(8),{currentIndex:s,total:n,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==n?(l=o.jsx(pr,{current:s,total:n,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=n,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=o.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function fr(t){const e=R.c(17),{isStreaming:s,isAllAnswered:n,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=n?a===void 0?"Submit":a:l===void 0?"Next":l,V=n?s:!r,p=V?n?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==V||e[1]!==i?(f=()=>{V||i()},e[0]=V,e[1]=i,e[2]=f):f=e[2];const h=V&&"opacity-50 cursor-not-allowed";let m;e[3]!==h?(m=O("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=m):m=e[4];let g;e[5]!==V||e[6]!==u||e[7]!==f||e[8]!==m?(g=o.jsx(G,{type:"button",size:"sm","aria-disabled":V,onClick:f,className:m,children:u}),e[5]=V,e[6]=u,e[7]=f,e[8]=m,e[9]=g):g=e[9];const v=g;if(!p)return v;let x;e[10]!==v?(x=o.jsx(Ze,{asChild:!0,children:v}),e[10]=v,e[11]=x):x=e[11];let b;e[12]!==p?(b=o.jsx(Xe,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;return e[14]!==x||e[15]!==b?(A=o.jsxs(et,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16],A}function ds(t,e,s){return t.findIndex(n=>e(n)===s)}function Ct(t,e,s,n){return t.length===0?!1:t.every(r=>n(s[e(r)]))}function Nt(t,e,s,n,r){if(t.length===0)return null;const i=ds(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const c=e(l);if(c!==r&&!n(s[c]))return c}return null}function hr(t){return!t.isStreaming&&t.allAnswered}function us(t){const{parts:e,partKey:s,schema:n,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,c=e[0]?s(e[0]):"",[d,u]=P.useState(c),[V,p]=P.useState(!1),f=Ss({resolver:Cs(n),defaultValues:r}),h=f.watch(),m=ds(e,s,d),g=m>=0?e[m]:void 0,v=a(h[d]),x=Ct(e,s,h,a),b=hr({isStreaming:i,allAnswered:x}),A=()=>{if(m>0){const I=e[m-1];I&&u(s(I))}},j=()=>{if(m>=0&&m<e.length-1){const I=e[m+1];I&&u(s(I))}},y=()=>{const I=f.getValues(),C=Nt(e,s,I,a,d);C&&u(C)},k=()=>{f.handleSubmit(I=>{const C=I;for(const M of e)l(M,C[s(M)])})()},w=P.useRef(k);w.current=k;const S=()=>{b&&(p(!1),w.current())},N=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),w.current()}else{const C=Nt(e,s,I,a,d);C&&u(C)}};return P.useEffect(()=>{if(V&&!i){if(!x){p(!1);return}p(!1),w.current()}},[V,i,x]),{form:f,activeKey:d,setActiveKey:u,currentIndex:m,currentPart:g,isCurrentAnswered:v,isAllAnswered:x,canSubmit:b,goPrev:A,goNext:j,advanceToNextUnanswered:y,submit:S,submitOrAdvance:N}}const ps="chat.approval.defaultDenyReason";function fs(t){const e=R.c(36),{onYolo:s}=t,n=K(),[r,i]=Ne();let a,l,c,d,u,V,p,f,h;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const A=Ce.find(k=>k.value===r.toolApprovalLevel)??Ce[0];let j;e[13]!==s||e[14]!==r||e[15]!==i?(j=k=>{const w=k,S=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:w}),w==="auto"&&s(S)},e[13]=s,e[14]=r,e[15]=i,e[16]=j):j=e[16];const y=j;c=eo,f=r.toolApprovalLevel,h=y,l=to,u="xs",V="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=mr,a=so,d=n(A.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=a,e[5]=l,e[6]=c,e[7]=d,e[8]=u,e[9]=V,e[10]=p,e[11]=f,e[12]=h}else a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],V=e[9],p=e[10],f=e[11],h=e[12];let m;e[17]!==a||e[18]!==d?(m=o.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=m):m=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==V||e[23]!==p||e[24]!==m?(g=o.jsx(l,{size:u,className:V,onClick:p,children:m}),e[20]=l,e[21]=u,e[22]=V,e[23]=p,e[24]=m,e[25]=g):g=e[25];let v;e[26]!==n?(v=Ce.map(A=>o.jsx(Xn,{value:A.value,children:n(A.labelKey)},A.value)),e[26]=n,e[27]=v):v=e[27];let x;e[28]!==v?(x=o.jsx(no,{children:v}),e[28]=v,e[29]=x):x=e[29];let b;return e[30]!==c||e[31]!==x||e[32]!==f||e[33]!==h||e[34]!==g?(b=o.jsxs(c,{value:f,onValueChange:h,children:[g,x]}),e[30]=c,e[31]=x,e[32]=f,e[33]=h,e[34]=g,e[35]=b):b=e[35],b}function mr(t){return t.stopPropagation()}function hs(t){const e=R.c(8),{input:s}=t,n=K();if(s==null){let a;e[0]!==n?(a=n("chat.approval.noInput"),e[0]=n,e[1]=a):a=e[1];let l;return e[2]!==a?(l=o.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(i=o.jsx("div",{className:"px-4",children:o.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[6]=r,e[7]=i):i=e[7],i}function gr(t){const e=R.c(38),{approval:s,onRespond:n}=t,r=K(),[i]=Ne(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==n||e[3]!==r?(l=()=>n(s.approvalId,!1,r(ps),a),e[0]=s.approvalId,e[1]=a,e[2]=n,e[3]=r,e[4]=l):l=e[4];const c=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==n?(d=()=>n(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=n,e[8]=d):d=e[8];const u=d;let V;e[9]!==s.approvalId||e[10]!==n?(V=S=>n(s.approvalId,!0,void 0,S),e[9]=s.approvalId,e[10]=n,e[11]=V):V=e[11];const p=V;let f;e[12]!==p?(f=o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(fs,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const h=f;let m;e[14]!==r?(m=r("chat.approval.denyButton"),e[14]=r,e[15]=m):m=e[15];let g;e[16]!==c||e[17]!==m?(g=o.jsx(G,{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:m}),e[16]=c,e[17]=m,e[18]=g):g=e[18];let v;e[19]!==r?(v=r("chat.approval.acceptButton"),e[19]=r,e[20]=v):v=e[20];let x;e[21]!==u||e[22]!==v?(x=o.jsx(G,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:v}),e[21]=u,e[22]=v,e[23]=x):x=e[23];let b;e[24]!==g||e[25]!==x?(b=o.jsxs(o.Fragment,{children:[g,x]}),e[24]=g,e[25]=x,e[26]=b):b=e[26];const A=b;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Je,{size:14}),e[27]=j):j=e[27];let y;e[28]!==r?(y=r("chat.approval.needsApproval"),e[28]=r,e[29]=y):y=e[29];let k;e[30]!==s.input?(k=o.jsx(hs,{input:s.input}),e[30]=s.input,e[31]=k):k=e[31];let w;return e[32]!==s.friendlyName||e[33]!==h||e[34]!==A||e[35]!==y||e[36]!==k?(w=o.jsx(pe,{icon:j,label:y,title:s.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:A,children:k}),e[32]=s.friendlyName,e[33]=h,e[34]=A,e[35]=y,e[36]=k,e[37]=w):w=e[37],w}const xr=Ns(ne(),ie({approved:Is().optional(),levelOverride:ze(["auto","readonly"]).optional()}));function vr(t){const e=R.c(46),{approvals:s,isStreaming:n,onRespond:r}=t,i=K(),[a]=Ne(),l=a.toolApprovalLevel??"readonly";let c;e[0]!==s?(c=Object.fromEntries(s.map(yr)),e[0]=s,e[1]=c):c=e[1];const d=c;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(C,M)=>{const D=M;typeof D?.approved=="boolean"&&r(C.approvalId,D.approved,D.approved===!1?i(ps):void 0,D.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let V;e[6]!==s||e[7]!==d||e[8]!==n||e[9]!==u?(V={parts:s,partKey:Ar,schema:xr,defaultValues:d,isStreaming:n,hasAnswer:br,onSubmit:u},e[6]=s,e[7]=d,e[8]=n,e[9]=u,e[10]=V):V=e[10];const p=us(V);let f;e[11]!==s||e[12]!==p?(f=C=>{p.form.reset(Object.fromEntries(s.map(M=>[M.approvalId,{approved:!0,levelOverride:C}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const h=f,m=p.currentPart,g=p.form;let v;e[14]!==p?(v=C=>{C.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Je,{size:14}),e[16]=x):x=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const A=m?.friendlyName??"";let j;e[20]!==h?(j=o.jsx(fs,{onYolo:h}),e[20]=h,e[21]=j):j=e[21];let y;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==j?(y=o.jsx(cs,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:j}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=j,e[27]=y):y=e[27];let k;e[28]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(k=m?o.jsx(jr,{approvalId:m.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=m,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=k):k=e[31];let w;e[32]!==m?(w=m?o.jsx(hs,{input:m.input}):null,e[32]=m,e[33]=w):w=e[33];let S;e[34]!==y||e[35]!==k||e[36]!==w||e[37]!==b||e[38]!==A?(S=o.jsx(pe,{icon:x,label:b,title:A,defaultExpanded:!0,footerLeft:y,footerRight:k,children:w}),e[34]=y,e[35]=k,e[36]=w,e[37]=b,e[38]=A,e[39]=S):S=e[39];let N;e[40]!==S||e[41]!==v?(N=o.jsx("form",{onSubmit:v,children:S}),e[40]=S,e[41]=v,e[42]=N):N=e[42];let I;return e[43]!==p.form||e[44]!==N?(I=o.jsx(ot,{...g,children:N}),e[43]=p.form,e[44]=N,e[45]=I):I=e[45],I}function br(t){return typeof t?.approved=="boolean"}function Ar(t){return t.approvalId}function yr(t){return[t.approvalId,{approved:void 0}]}function jr(t){const e=R.c(7),{approvalId:s,control:n,onChange:r}=t,i=K(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,V=u.value===!0,p=u.value===!1;return o.jsxs(o.Fragment,{children:[o.jsx(G,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),o.jsx(G,{type:"button",variant:V?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":V,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let c;return e[3]!==n||e[4]!==a||e[5]!==l?(c=o.jsx(Ts,{control:n,name:a,render:l}),e[3]=n,e[4]=a,e[5]=l,e[6]=c):c=e[6],c}function kr(){const t=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Je,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.approval.preparingRequest"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.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,o.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function wr(t){const e=R.c(8),{approvals:s,isStreaming:n,onRespond:r}=t;if(n&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(kr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=o.jsx(gr,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==n||e[6]!==r?(i=o.jsx(vr,{approvals:s,isStreaming:n,onRespond:r}),e[4]=s,e[5]=n,e[6]=r,e[7]=i):i=e[7],i}function Sr(t){const e=R.c(28),{plan:s,onApprove:n,onDismiss:r}=t,i=K();let a;e[0]!==n||e[1]!==s.plan?(a=()=>{n(s.plan)},e[0]=n,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let c;e[3]!==i?(c=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==c?(d=o.jsx(G,{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:r,children:c}),e[5]=r,e[6]=c,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let V;e[10]!==l||e[11]!==u?(V=o.jsx(G,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:l,children:u}),e[10]=l,e[11]=u,e[12]=V):V=e[12];let p;e[13]!==d||e[14]!==V?(p=o.jsxs(o.Fragment,{children:[d,V]}),e[13]=d,e[14]=V,e[15]=p):p=e[15];const f=p;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Qt,{size:14}),e[16]=h):h=e[16];let m;e[17]!==i?(m=i("chat.proposePlan.planReady"),e[17]=i,e[18]=m):m=e[18];let g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let v;e[21]!==s.plan?(v=o.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:o.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:o.jsx(an,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=v):v=e[22];let x;return e[23]!==f||e[24]!==v||e[25]!==m||e[26]!==g?(x=o.jsx(pe,{icon:h,label:m,title:g,defaultExpanded:!0,footerRight:f,children:v}),e[23]=f,e[24]=v,e[25]=m,e[26]=g,e[27]=x):x=e[27],x}function Cr(t){const e=R.c(6),{plans:s,onApprove:n,onDismiss:r}=t;let i;e[0]!==s?(i=as(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==n||e[4]!==r?(l=o.jsx(Sr,{plan:a,onApprove:n,onDismiss:r}),e[2]=a,e[3]=n,e[4]=r,e[5]=l):l=e[5],l}function ms(t){return t?"response"in t?t.response:t.option??t.draft:""}const It=ie({response:ne().min(1,"Response is required")}),Nr=ie({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ir=ie({response:ze(["yes","no"])});function Tr(t){switch(t.type){case"text":return It;case"choice":return Nr;case"confirm":return Ir;default:return It}}function _r(t){const e={};for(const s of t)e[s.toolCallId]=Tr(s.input);return ie(e)}function Mr(t){const e=R.c(7),{control:s,name:n,placeholder:r}=t,i=K();let a;e[0]!==r||e[1]!==i?(a=c=>{const{field:d}=c,u=d.value??"";return o.jsxs(ct,{children:[o.jsx(dt,{children:o.jsx("div",{className:"px-2",children:o.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Yt,{size:16,className:"text-muted-foreground"})}),o.jsx("input",{...d,value:u,type:"text",placeholder:r||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),o.jsx(ut,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==n||e[5]!==a?(l=o.jsx(Jt,{control:s,name:n,render:a}),e[3]=s,e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function gs(t,e){const s=R.c(4);let n,r;s[0]!==t||s[1]!==e?(n=()=>{const i=a=>{if(hn(a.target)||a.metaKey||a.ctrlKey||a.altKey)return;const l=Number.parseInt(a.key,10);l>=1&&l<=t&&(a.preventDefault(),e(l-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=n,s[3]=r):(n=s[2],r=s[3]),P.useEffect(n,r)}function Dr(t){const e=R.c(51),{control:s,name:n,options:r}=t,i=K(),a=`${n}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:c}=mt(l),d=`${n}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:V}=mt(u),p=c.value,f=V.value??"";let h;if(e[6]!==c||e[7]!==r?(h=U=>{const T=r[U];T!=null&&c.onChange(T)},e[6]=c,e[7]=r,e[8]=h):h=e[8],gs(r.length,h),r.length===0)return null;const m=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let v;if(e[11]!==c||e[12]!==p||e[13]!==r||e[14]!==i){let U;e[16]!==c||e[17]!==p||e[18]!==i?(U=(T,L)=>{const F=p===T;return o.jsxs("button",{type:"button",onClick:()=>c.onChange(T),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",F&&"bg-accent/50",!F&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:T}),children:[o.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",F?"bg-chart-1 text-white":"bg-muted text-foreground"),children:L+1}),o.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:T})]},`${L}-${T}`)},e[16]=c,e[17]=p,e[18]=i,e[19]=U):U=e[19],v=r.map(U),e[11]=c,e[12]=p,e[13]=r,e[14]=i,e[15]=v}else v=e[15];const x=m&&"bg-accent/50",b=!m&&"hover:bg-accent/30";let A;e[20]!==x||e[21]!==b?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",x,b),e[20]=x,e[21]=b,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Yt,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const y=m?f:"";let k;e[24]!==V||e[25]!==c||e[26]!==p?(k=U=>{V.onChange(U.target.value),p!==null&&c.onChange(null)},e[24]=V,e[25]=c,e[26]=p,e[27]=k):k=e[27];let w;e[28]!==c||e[29]!==p?(w=()=>{p!==null&&c.onChange(null)},e[28]=c,e[29]=p,e[30]=w):w=e[30];let S;e[31]!==i?(S=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=S):S=e[32];let N;e[33]!==i?(N=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=N):N=e[34];let I;e[35]!==y||e[36]!==k||e[37]!==w||e[38]!==S||e[39]!==N?(I=o.jsx("input",{type:"text",value:y,onChange:k,onFocus:w,placeholder:S,"aria-label":N,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=y,e[36]=k,e[37]=w,e[38]=S,e[39]=N,e[40]=I):I=e[40];let C;e[41]!==A||e[42]!==I?(C=o.jsxs("label",{className:A,children:[j,I]}),e[41]=A,e[42]=I,e[43]=C):C=e[43];let M;e[44]!==C||e[45]!==g||e[46]!==v?(M=o.jsx(dt,{children:o.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[v,C]})}),e[44]=C,e[45]=g,e[46]=v,e[47]=M):M=e[47];let D;e[48]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(ut,{}),e[48]=D):D=e[48];let E;return e[49]!==M?(E=o.jsxs(ct,{children:[M,D]}),e[49]=M,e[50]=E):E=e[50],E}function Rr(t){const e=R.c(8),{control:s,name:n}=t,r=K();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.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],gs(a.length,c);let d;e[2]!==r?(d=V=>{const{field:p}=V;return l.current=p,o.jsxs(ct,{children:[o.jsx(dt,{children:o.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const h=p.value===f;return o.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[o.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),o.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),o.jsx(ut,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==n||e[6]!==d?(u=o.jsx(Jt,{control:s,name:n,render:d}),e[4]=s,e[5]=n,e[6]=d,e[7]=u):u=e[7],u}function Tt(t){const e=R.c(13),{input:s,control:n,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==n||e[1]!==s.default||e[2]!==i?(a=o.jsx(Mr,{control:n,name:i,placeholder:s.default}),e[0]=n,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==n||e[7]!==a||e[8]!==r?(l=o.jsx(Dr,{control:n,name:r,options:a}),e[6]=n,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==n||e[11]!==i?(a=o.jsx(Rr,{control:n,name:i}),e[10]=n,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Er(t){const e=R.c(91),{parts:s,isStreaming:n,onSubmit:r}=t;let i;e[0]!==s?(i=_r(s.map(Fr)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Lr)),e[2]=s,e[3]=l):l=e[3];const c=l;let d;e[4]!==r?(d=($,z)=>{const Q=ms(z);Q&&r($,Q)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==n||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Ur,schema:a,defaultValues:c,isStreaming:n,hasAnswer:Pr,onSubmit:d},e[6]=c,e[7]=n,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const V=us(u),p=V.currentPart,f=K();let h;e[12]!==p||e[13]!==V||e[14]!==f?(h=()=>{const $=p;if(!$)return;const z=f("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(V.form.setValue(`${Q}.option`,null),V.form.setValue(`${Q}.draft`,z)):V.form.setValue(`${Q}.response`,z),V.advanceToNextUnanswered()},e[12]=p,e[13]=V,e[14]=f,e[15]=h):h=e[15];const m=h;let g;e[16]!==V.currentIndex||e[17]!==V.goNext||e[18]!==V.goPrev||e[19]!==s.length?(g=o.jsx(cs,{currentIndex:V.currentIndex,total:s.length,onPrev:V.goPrev,onNext:V.goNext}),e[16]=V.currentIndex,e[17]=V.goNext,e[18]=V.goPrev,e[19]=s.length,e[20]=g):g=e[20];const v=g;let x;e[21]!==f?(x=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=x):x=e[22];let b;e[23]!==m||e[24]!==x?(b=o.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:x}),e[23]=m,e[24]=x,e[25]=b):b=e[25];let A;e[26]!==V.isAllAnswered||e[27]!==V.isCurrentAnswered||e[28]!==V.submitOrAdvance||e[29]!==n?(A=o.jsx(fr,{isStreaming:n,isAllAnswered:V.isAllAnswered,isCurrentAnswered:V.isCurrentAnswered,onAdvanceOrSubmit:V.submitOrAdvance}),e[26]=V.isAllAnswered,e[27]=V.isCurrentAnswered,e[28]=V.submitOrAdvance,e[29]=n,e[30]=A):A=e[30];let j;e[31]!==b||e[32]!==A?(j=o.jsxs(o.Fragment,{children:[b,A]}),e[31]=b,e[32]=A,e[33]=j):j=e[33];const y=j;if(s.length===1){const $=s[0];if(!$?.input)return null;const z=V.form;let Q;e[34]!==V?(Q=X=>{X.preventDefault(),V.submit()},e[34]=V,e[35]=Q):Q=e[35];let ee;e[36]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(nt,{size:14}),e[36]=ee):ee=e[36];let te;e[37]!==f?(te=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=te):te=e[38];let H;e[39]!==$.input?.prompt||e[40]!==f?(H=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=H):H=e[41];const oe=$.input;let _;e[42]!==V.form.control||e[43]!==$.toolCallId||e[44]!==oe?(_=o.jsx(Tt,{input:oe,control:V.form.control,toolCallId:$.toolCallId}),e[42]=V.form.control,e[43]=$.toolCallId,e[44]=oe,e[45]=_):_=e[45];let B;e[46]!==y||e[47]!==te||e[48]!==H||e[49]!==_?(B=o.jsx(pe,{icon:ee,label:te,title:H,defaultExpanded:!0,footerRight:y,children:_}),e[46]=y,e[47]=te,e[48]=H,e[49]=_,e[50]=B):B=e[50];let J;e[51]!==Q||e[52]!==B?(J=o.jsx("form",{onSubmit:Q,autoComplete:"off",children:B}),e[51]=Q,e[52]=B,e[53]=J):J=e[53];let Z;return e[54]!==V.form||e[55]!==J?(Z=o.jsx(ot,{...z,children:J}),e[54]=V.form,e[55]=J,e[56]=Z):Z=e[56],Z}const k=V.form;let w;e[57]!==V?(w=$=>{$.preventDefault(),V.submit()},e[57]=V,e[58]=w):w=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(nt,{size:14}),e[59]=S):S=e[59];let N;e[60]!==f?(N=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=N):N=e[61];const I=V.currentIndex+1;let C;e[62]!==s.length||e[63]!==f||e[64]!==I?(C=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=C):C=e[65];let M;e[66]!==p?.input?.prompt||e[67]!==f?(M=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=M):M=e[68];const D=V.activeKey,E=V.setActiveKey;let U;if(e[69]!==V.form||e[70]!==s){let $;e[72]!==V.form?($=z=>o.jsx(ro,{value:z.toolCallId,className:"mt-0",children:o.jsx(Tt,{input:z.input,control:V.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=V.form,e[73]=$):$=e[73],U=s.map($),e[69]=V.form,e[70]=s,e[71]=U}else U=e[71];let T;e[74]!==V.activeKey||e[75]!==V.setActiveKey||e[76]!==U?(T=o.jsx(io,{value:D,onValueChange:E,children:U}),e[74]=V.activeKey,e[75]=V.setActiveKey,e[76]=U,e[77]=T):T=e[77];let L;e[78]!==v||e[79]!==y||e[80]!==N||e[81]!==C||e[82]!==M||e[83]!==T?(L=o.jsx(pe,{icon:S,label:N,count:C,title:M,defaultExpanded:!0,footerLeft:v,footerRight:y,children:T}),e[78]=v,e[79]=y,e[80]=N,e[81]=C,e[82]=M,e[83]=T,e[84]=L):L=e[84];let F;e[85]!==w||e[86]!==L?(F=o.jsx("form",{onSubmit:w,autoComplete:"off",children:L}),e[85]=w,e[86]=L,e[87]=F):F=e[87];let W;return e[88]!==V.form||e[89]!==F?(W=o.jsx(ot,{...k,children:F}),e[88]=V.form,e[89]=F,e[90]=W):W=e[90],W}function Pr(t){return!!ms(t)}function Ur(t){return t.toolCallId}function Lr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Fr(t){return{toolCallId:t.toolCallId,input:t.input}}function zr(){const t=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(nt,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.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,o.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function xs(t){const e=R.c(7),{userAskParts:s,isStreaming:n,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Or),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(n){let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(zr,{}),e[2]=c):c=e[2],c}return null}let l;return e[3]!==n||e[4]!==r||e[5]!==a?(l=o.jsx(Er,{parts:a,isStreaming:n,onSubmit:r}),e[3]=n,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Or(t){return t.state==="input-available"}function $r(t){const e=R.c(33),{parts:s,isStreaming:n,onRespond:r}=t,i=K();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,c=l?.input;if(!l||!c?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Qt,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const V=c.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==i?(f=i("chat.suggestTask.notNow"),e[8]=i,e[9]=f):f=e[9];let h;e[10]!==n||e[11]!==p||e[12]!==f?(h=o.jsx(G,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:n,onClick:p,children:f}),e[10]=n,e[11]=p,e[12]=f,e[13]=h):h=e[13];let m;e[14]!==r||e[15]!==l?(m=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=m):m=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let v;e[19]!==n||e[20]!==m||e[21]!==g?(v=o.jsx(G,{type:"button",size:"sm",className:"h-7",disabled:n,onClick:m,children:g}),e[19]=n,e[20]=m,e[21]=g,e[22]=v):v=e[22];let x;e[23]!==v||e[24]!==h?(x=o.jsxs(o.Fragment,{children:[h,v]}),e[23]=v,e[24]=h,e[25]=x):x=e[25];let b;e[26]!==c.summary?(b=c.summary?o.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:c.summary}):null,e[26]=c.summary,e[27]=b):b=e[27];let A;return e[28]!==c.title||e[29]!==x||e[30]!==b||e[31]!==u?(A=o.jsx(pe,{icon:d,label:u,title:V,defaultExpanded:!0,footerRight:x,children:b}),e[28]=c.title,e[29]=x,e[30]=b,e[31]=u,e[32]=A):A=e[32],A}function Br(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,n=t.length;if(n>0&&s===n)return{icon:"completed",activity:"All done",progress:`${n}/${n}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${n} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${n} done`}:s>0?{icon:"pending",activity:`${n-s} pending`,progress:`${s}/${n} done`}:{icon:"pending",activity:`${n} todos`,progress:"not started"}}function Kr(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let n;e[0]!==s?(n=Br(s),e[0]=s,e[1]=n):n=e[1];const r=n;let i;e[2]!==r.icon?(i=o.jsx(Wr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let c;e[4]!==s?(c=s.map(qr),e[4]=s,e[5]=c):c=e[5];let d;e[6]!==c?(d=o.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:c}),e[6]=c,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=o.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function qr(t,e){return o.jsx(Qr,{todo:t},e)}function Qr(t){const e=R.c(14),{todo:s}=t,n=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=o.jsx(Yr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=n&&"text-muted-foreground";let c;e[2]!==l?(c=O("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=c):c=e[3];const d=n?"100%":"0%",u=n?"width 300ms ease 200ms":"width 150ms ease";let V;e[4]!==d||e[5]!==u?(V=o.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=V):V=e[6];let p;e[7]!==i||e[8]!==c||e[9]!==V?(p=o.jsxs("span",{className:c,children:[i,V]}),e[7]=i,e[8]=c,e[9]=V,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=o.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[a,p]}),e[11]=a,e[12]=p,e[13]=f):f=e[13],f}function Yr(t){const e=R.c(4),{status:s}=t,n=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("svg",{viewBox:"0 0 21 21",children:o.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]=i):i=e[0];let a;return e[1]!==n||e[2]!==r?(a=o.jsx("div",{className:"todo-cb mt-0.5","data-checked":n,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function Wr(t){const e=R.c(13),{status:s}=t,n=K();if(s==="completed"){let a;e[0]!==n?(a=n("chat.todoStatus.completed"),e[0]=n,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.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:o.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let c;return e[3]!==a?(c=o.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=c):c=e[4],c}if(s==="in_progress"){let a;e[5]!==n?(a=n("chat.todoStatus.inProgress"),e[5]=n,e[6]=a):a=e[6];let l;return e[7]!==a?(l=o.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==n?(r=n("chat.todoStatus.pending"),e[9]=n,e[10]=r):r=e[10];let i;return e[11]!==r?(i=o.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const Gr={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},Hr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Jr(t){const e=R.c(46),{source:s,onDone:n}=t,r=K(),i=_s(),[a]=Ne(),[l,c]=P.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=P.useState(""),[V,p]=P.useState(!1),f=l==="brl"?"R$":"$";let h;e[0]!==l||e[1]!==i?(h=async T=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:T,currency:l});return L},e[0]=l,e[1]=i,e[2]=h):h=e[2];let m;e[3]!==n?(m=T=>{T&&window.open(T,"_blank","noopener,noreferrer"),n?.()},e[3]=n,e[4]=m):m=e[4];let g;e[5]!==r?(g=T=>{Ue.error(r("credits.topUp.failed",{message:T.message}))},e[5]=r,e[6]=g):g=e[6];let v;e[7]!==h||e[8]!==m||e[9]!==g?(v={mutationFn:h,onSuccess:m,onError:g},e[7]=h,e[8]=m,e[9]=g,e[10]=v):v=e[10];const{mutate:x,isPending:b}=Ms(v);let A;e[11]!==l||e[12]!==s||e[13]!==x?(A=(T,L)=>{se("credits_topup_clicked",{amount_cents:T,currency:l,tier_label:L,source:s}),x(T)},e[11]=l,e[12]=s,e[13]=x,e[14]=A):A=e[14];const j=A,y=parseFloat(d),k=!isNaN(y)&&y>=1;let w,S,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=T=>{T&&c(T)},S=o.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=o.jsx(yt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=w,e[16]=S,e[17]=N):(w=e[15],S=e[16],N=e[17]);let I;e[18]!==l?(I=o.jsx("div",{className:"mb-4",children:o.jsxs(uo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:w,children:[S,N]})}),e[18]=l,e[19]=I):I=e[19];const C=Gr[l];let M;if(e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==C){let T;e[26]!==j||e[27]!==f||e[28]!==b||e[29]!==r?(T=L=>{const{dollars:F,labelKey:W}=L;return o.jsxs("button",{type:"button",disabled:b,onClick:()=>j(F*100,Hr[W]??"preset"),className:O("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:[o.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,F]}),o.jsx("span",{className:"text-xs text-muted-foreground",children:r(W)})]},F)},e[26]=j,e[27]=f,e[28]=b,e[29]=r,e[30]=T):T=e[30],M=C.map(T),e[20]=j,e[21]=f,e[22]=b,e[23]=r,e[24]=C,e[25]=M}else M=e[25];let D;e[31]!==M?(D=o.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:M}),e[31]=M,e[32]=D):D=e[32];let E;e[33]!==j||e[34]!==f||e[35]!==d||e[36]!==y||e[37]!==k||e[38]!==b||e[39]!==V||e[40]!==r?(E=V?o.jsxs("div",{className:"flex gap-2 mt-3",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),o.jsx(Ds,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:d,onChange:T=>u(T.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),o.jsx(G,{className:"h-10",disabled:!k||b,onClick:()=>j(Math.round(y*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):o.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:r("credits.topUp.enterCustom")}),e[33]=j,e[34]=f,e[35]=d,e[36]=y,e[37]=k,e[38]=b,e[39]=V,e[40]=r,e[41]=E):E=e[41];let U;return e[42]!==D||e[43]!==E||e[44]!==I?(U=o.jsxs("div",{children:[I,D,E]}),e[42]=D,e[43]=E,e[44]=I,e[45]=U):U=e[45],U}const Zr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Xr(t){const e=R.c(47),{onDismiss:s}=t,{org:n}=Ie(),r=at(),{decoKeyId:i}=co(),a=K(),l=$e("credits");let c,d;if(e[0]!==n.id?(c=()=>{se("credits_exhausted_shown",{organization_id:n.id})},d=[n.id],e[0]=n.id,e[1]=c,e[2]=d):(c=e[1],d=e[2]),P.useEffect(c,d),!l)return null;let u;e[3]!==s?(u=C=>!C&&s?.(),e[3]=s,e[4]=u):u=e[4];let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=["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[5]=V):V=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:V.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=o.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"}),e[7]=f):f=e[7];let h;e[8]!==a?(h=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=h):h=e[9];let m;e[10]!==h?(m=o.jsx(Rs,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=m):m=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let v;e[14]!==g?(v=o.jsx(Es,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=v):v=e[15];let x;e[16]!==v||e[17]!==m?(x=o.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,o.jsxs(Ps,{className:"relative gap-4",children:[f,o.jsxs("div",{children:[m,v]})]})]}),e[16]=v,e[17]=m,e[18]=x):x=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&o.jsxs("div",{className:"px-8 pt-5 pb-6",children:[o.jsx("div",{className:"rounded-xl border border-border p-5",children:o.jsx(Jr,{source:"exhausted_banner",onDone:s})}),o.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Zr.map(C=>o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:o.jsx(lt,{size:12,className:"text-success"})}),o.jsx("span",{className:"text-sm text-foreground/80",children:a(C)})]},C))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let A;e[23]!==a?(A=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=A):A=e[24];let j;e[25]!==s||e[26]!==A?(j=o.jsx(G,{variant:"ghost",size:"sm",onClick:s,children:A}),e[25]=s,e[26]=A,e[27]=j):j=e[27];let y;e[28]!==r||e[29]!==s||e[30]!==n.slug?(y=()=>{r({to:"/$org/settings/ai-providers",params:{org:n.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=n.slug,e[31]=y):y=e[31];let k;e[32]!==a?(k=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=o.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:y,children:k}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let S;e[37]!==j||e[38]!==w?(S=o.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,w]}),e[37]=j,e[38]=w,e[39]=S):S=e[39];let N;e[40]!==x||e[41]!==b||e[42]!==S?(N=o.jsxs(Us,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ei,children:[x,b,S]}),e[40]=x,e[41]=b,e[42]=S,e[43]=N):N=e[43];let I;return e[44]!==N||e[45]!==u?(I=o.jsx(Ls,{open:!0,onOpenChange:u,children:N}),e[44]=N,e[45]=u,e[46]=I):I=e[46],I}function ei(t){return t.preventDefault()}const ti={trial_exhausted:{label:"chat.subscriptionLimit.trialLabel",title:"chat.subscriptionLimit.trialTitle"},monthly_exhausted:{label:"chat.subscriptionLimit.monthlyLabel",title:"chat.subscriptionLimit.monthlyTitle"},runs_exhausted:{label:"chat.subscriptionLimit.runsLabel",title:"chat.subscriptionLimit.runsTitle"}};function si(t){const e=R.c(16),{kind:s,onDismiss:n,onSubscribe:r}=t,i=K(),{label:a,title:l}=ti[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Vt,{size:14}),e[0]=c):c=e[0];let d;e[1]!==a||e[2]!==i?(d=i(a),e[1]=a,e[2]=i,e[3]=d):d=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let V;e[7]!==s||e[8]!==r||e[9]!==i?(V=s==="trial_exhausted"?o.jsx(G,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=V):V=e[10];let p;return e[11]!==n||e[12]!==d||e[13]!==u||e[14]!==V?(p=o.jsx(pe,{icon:c,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:n,footerRight:V}),e[11]=n,e[12]=d,e[13]=u,e[14]=V,e[15]=p):p=e[15],p}const ni={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function _t(t){const e=R.c(21),{kind:s,onDismiss:n}=t,r=K(),i=at(),{org:a}=Ie(),{label:l,title:c}=ni[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Vt,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let V;e[4]!==r||e[5]!==c?(V=r(c),e[4]=r,e[5]=c,e[6]=V):V=e[6];let p;e[7]!==i||e[8]!==n||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),n()},e[7]=i,e[8]=n,e[9]=a.slug,e[10]=p):p=e[10];let f;e[11]!==r?(f=r("chat.planRefused.seePlans"),e[11]=r,e[12]=f):f=e[12];let h;e[13]!==p||e[14]!==f?(h=o.jsx(G,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=h):h=e[15];let m;return e[16]!==n||e[17]!==u||e[18]!==V||e[19]!==h?(m=o.jsx(pe,{icon:d,label:u,title:V,defaultExpanded:!0,variant:"warning",onClose:n,footerRight:h}),e[16]=n,e[17]=u,e[18]=V,e[19]=h,e[20]=m):m=e[20],m}function vs(t){const e=oi(t);if(e!==null){const d=vs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),n=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,c=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(c){const d=c[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||n&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{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}}function oi(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:n,message:r}=s,i=typeof n=="string"?n:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const ri={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Ye(t){const e=R.c(29),s=K(),{variant:n,onDismiss:r}=t,i=n==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,c=i?Jn:zs;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const x=ri[t.finishReason];return x?s(x):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let V;e[8]!==i||e[9]!==u?(V=i?vs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=V):V=e[10];const{summary:p,rawDetails:f}=V;let h;e[11]!==c?(h=o.jsx(c,{size:14}),e[11]=c,e[12]=h):h=e[12];let m;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(m=i?o.jsx(G,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):o.jsx(G,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=m):m=e[17];let g;e[18]!==f||e[19]!==s?(g=f?o.jsxs("details",{className:"group mx-4",children:[o.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:[o.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:o.jsx("path",{d:"m4.5 3 3 3-3 3"})}),o.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),o.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),o.jsxs("div",{className:"relative mt-2",children:[o.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Ue.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ue.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:o.jsx(Zn,{className:"size-3.5"})}),o.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:f})]})]}):null,e[18]=f,e[19]=s,e[20]=g):g=e[20];let v;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==h||e[25]!==m||e[26]!==g||e[27]!==n?(v=o.jsx(pe,{icon:h,label:l,title:p,defaultExpanded:!0,variant:n,onClose:r,footerRight:m,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=h,e[25]=m,e[26]=g,e[27]=n,e[28]=v):v=e[28],v}function Be(t){const e=R.c(78);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:n,voiceMode:r}=s,i=n===void 0?!1:n,a=r===void 0?!1:r,l=K(),{error:c,clearError:d,finishReason:u,clearFinishReason:V,messages:p,isStreaming:f,submit:h,sendMessage:m}=Oe(),[g,v]=Ne(),{virtualMcpId:x,createTaskWithMessage:b}=Ge(),{chatMode:A,setChatMode:j,simpleModeTier:y}=He(),k=$e("credits"),{mutate:w}=go("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let S;e[2]!==w?(S=()=>w(),e[2]=w,e[3]=S):S=e[3];const N=S;let I;e[4]!==A||e[5]!==y||e[6]!==x||e[7]!==a?(I=re=>({...a?{voiceMode:!0}:{},tier:y,mode:A,toolApprovalLevel:re,agent:x?{id:x}:void 0}),e[4]=A,e[5]=y,e[6]=x,e[7]=a,e[8]=I):I=e[8];const C=I;let M;e[9]!==g.toolApprovalLevel?(M=g.toolApprovalLevel??Fs(),e[9]=g.toolApprovalLevel,e[10]=M):M=e[10];const D=M,E=p.at(-1),U=E?.role==="assistant"?E.parts:[],T=U.filter(Vi),L=U.filter(Ft),F=ls(U),W=is(U);let $;e[11]!==c||e[12]!==m||e[13]!==l?($=()=>{if(c){const ae={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:c.message})}]}]};m(ae)}},e[11]=c,e[12]=m,e[13]=l,e[14]=$):$=e[14];const z=$;let Q;e[15]!==m||e[16]!==l?(Q=()=>{const re={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(re)},e[15]=m,e[16]=l,e[17]=Q):Q=e[17];const ee=Q;let te;e[18]!==C||e[19]!==D||e[20]!==h?(te=(re,ae)=>{h({kind:"toolOutput",toolCallId:re.toolCallId,output:{response:ae}},C(D))},e[18]=C,e[19]=D,e[20]=h,e[21]=te):te=e[21];const H=te;let oe;e[22]!==C||e[23]!==D||e[24]!==h?(oe=(re,ae)=>{h({kind:"toolOutput",toolCallId:re.toolCallId,output:{accepted:ae}},C(D))},e[22]=C,e[23]=D,e[24]=h,e[25]=oe):oe=e[25];const _=oe;let B;e[26]!==b||e[27]!==g||e[28]!==j||e[29]!==v||e[30]!==l||e[31]!==x?(B=re=>{j("default"),v({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:x,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:re})}]}})},e[26]=b,e[27]=g,e[28]=j,e[29]=v,e[30]=l,e[31]=x,e[32]=B):B=e[32];const J=B,Z=li;let X;e[33]!==C||e[34]!==h?(X=(re,ae,Me,Ae)=>{h({kind:"approval",approvalId:re,approved:ae,...Me?{reason:Me}:{}},C(Ae))},e[33]=C,e[34]=h,e[35]=X):X=e[35];const ue=X,Y=Vs();if(Y.isCreditExhausted){let re;return e[36]!==k||e[37]!==d||e[38]!==i?(re=k?o.jsx(Xr,{onDismiss:d}):o.jsx("div",{className:O(!i&&"absolute bottom-full left-0 right-0"),children:o.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:d})}),e[36]=k,e[37]=d,e[38]=i,e[39]=re):re=e[39],re}const{showError:le,showWarning:Ve,hasApprovals:ce}=Y,ke=T.map(ai).join("|"),Ke=as(F)?.toolCallId??"",me=W.map(ii).join("|"),Te=!i&&"absolute bottom-full left-0 right-0";let ge;e[40]!==Te?(ge=O(Te),e[40]=Te,e[41]=ge):ge=e[41];let de;e[42]!==Y.todos?(de=o.jsx(Kr,{todos:Y.todos}),e[42]=Y.todos,e[43]=de):de=e[43];let xe;e[44]!==d||e[45]!==Y.subscriptionErrorKind||e[46]!==N?(xe=Y.subscriptionErrorKind&&o.jsx(si,{kind:Y.subscriptionErrorKind,onDismiss:d,onSubscribe:N}),e[44]=d,e[45]=Y.subscriptionErrorKind,e[46]=N,e[47]=xe):xe=e[47];let we;e[48]!==d||e[49]!==Y.planRefusal?(we=Y.planRefusal&&o.jsx(_t,{kind:Y.planRefusal,onDismiss:d}),e[48]=d,e[49]=Y.planRefusal,e[50]=we):we=e[50];let fe;e[51]!==d||e[52]!==c||e[53]!==z||e[54]!==le?(fe=le&&o.jsx(Ye,{variant:"error",error:c,onDismiss:d,onFixInChat:z}),e[51]=d,e[52]=c,e[53]=z,e[54]=le,e[55]=fe):fe=e[55];let ve;e[56]!==V||e[57]!==u||e[58]!==ee||e[59]!==Ve?(ve=Ve&&o.jsx(Ye,{variant:"warning",finishReason:u,onDismiss:V,onContinue:ee}),e[56]=V,e[57]=u,e[58]=ee,e[59]=Ve,e[60]=ve):ve=e[60];const De=ce&&o.jsx(wr,{approvals:W,isStreaming:f,onRespond:ue},me),Re=Y.hasPlans&&o.jsx(Cr,{plans:F,isStreaming:f,onApprove:J,onDismiss:Z},Ke),_e=Y.hasTaskSuggestion&&o.jsx($r,{parts:L,isStreaming:f,onRespond:_},L.at(-1)?.toolCallId??"");let be;e[61]!==Y.isWaitingForUserInput||e[62]!==H||e[63]!==f||e[64]!==ke||e[65]!==T?(be=Y.isWaitingForUserInput&&o.jsx(xs,{userAskParts:T,isStreaming:f,onSubmit:H},ke),e[61]=Y.isWaitingForUserInput,e[62]=H,e[63]=f,e[64]=ke,e[65]=T,e[66]=be):be=e[66];let Se;return e[67]!==ge||e[68]!==de||e[69]!==xe||e[70]!==we||e[71]!==fe||e[72]!==ve||e[73]!==De||e[74]!==Re||e[75]!==_e||e[76]!==be?(Se=o.jsxs("div",{className:ge,children:[de,xe,we,fe,ve,De,Re,_e,be]}),e[67]=ge,e[68]=de,e[69]=xe,e[70]=we,e[71]=fe,e[72]=ve,e[73]=De,e[74]=Re,e[75]=_e,e[76]=be,e[77]=Se):Se=e[77],Se}function ii(t){return t.approvalId}function ai(t){return t.toolCallId}function li(){document.querySelector("[data-chat-input]")?.focus()}function Vi(t){return t.type==="tool-user_ask"}Be.Error=function(e){return o.jsx(Ye,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Be.Warning=function(e){return o.jsx(Ye,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Be.UserAskQuestion=xs;function bs(t){const e=R.c(20),{taskId:s}=t,n=K(),r=Dn(s),i=Rn(r),a=En(),{stop:l,removeLocalMessage:c}=Oe();if(i.length===0)return null;let d;e[0]!==n?(d=n("chat.queueTray.sendNow"),e[0]=n,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(Kt,{size:14}),e[4]=V):V=e[4];let p;e[5]!==d||e[6]!==u?(p=o.jsx(Ze,{asChild:!0,children:o.jsx(G,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:V})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==n?(f=n("chat.queueTray.sendNow"),e[8]=n,e[9]=f):f=e[9];let h;e[10]!==f?(h=o.jsx(Xe,{side:"top",children:o.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=h):h=e[11];let m;e[12]!==p||e[13]!==h?(m=o.jsxs(et,{delayDuration:400,children:[p,h]}),e[12]=p,e[13]=h,e[14]=m):m=e[14];let g;return e[15]!==a||e[16]!==c||e[17]!==n||e[18]!==s?(g=(v,x)=>o.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[o.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:x+1}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.text}),o.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:o.jsx(G,{type:"button",variant:"ghost",size:"icon-sm",title:n("chat.queueTray.removeFromQueue"),"aria-label":n("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,v.messageId).then(b=>{b&&(Pn(s,v.messageId),c(v.messageId))})},children:o.jsx(Ot,{className:"size-3.5"})})})]},v.messageId),e[15]=a,e[16]=c,e[17]=n,e[18]=s,e[19]=g):g=e[19],o.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[o.jsx("span",{children:n(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),m]}),i.map(g)]})}function ci(t){return["openai-compatible","openrouter","deco"].includes(t)}function di(t,e){return ci(t)&&ui(e)!==null}function ui(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const pi={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function fi(t,e){return pi[t]?.test(e)??!1}function hi(t){return Io(t)&&fi(t.providerId,t.modelId)}function mi(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const gi={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function xi(t){const e=R.c(32),{tier:s,orgSlot:n,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:c,onClose:d}=t,u=K(),V=ns(),p=new Set(V.map(vi)),f=Un([r,n,i],p),h=f?.keyId??null,[m,g]=P.useState(h??V[0]?.id??null),v=V.some(F=>F.id===m)?m:h??V[0]?.id??null,x=v?V.find(F=>F.id===v):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",A=gi[s];let j;e[0]!==u||e[1]!==A?(j=u(A),e[0]=u,e[1]=A,e[2]=j):j=e[2];let y;e[3]!==j?(y=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:j}),e[3]=j,e[4]=y):y=e[4];let k;e[5]!==c||e[6]!==u||e[7]!==r?(k=r&&o.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:u("chat.modelPreferences.reset")}),e[5]=c,e[6]=u,e[7]=r,e[8]=k):k=e[8];let w;e[9]!==y||e[10]!==k?(w=o.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[y,k]}),e[9]=y,e[10]=k,e[11]=w):w=e[11];const S="flex-1 min-h-0",N=P.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(vo,{}),e[12]=I):I=e[12];const C=xo,M=!0,D=mi(h?f:null,x?.providerId??"deco");let E;e[13]!==v||e[14]!==l||e[15]!==g?(E=F=>{const W=F.keyId??v??"";g(W),l({keyId:W,modelId:F.modelId,title:F.title})},e[13]=v,e[14]=l,e[15]=g,e[16]=E):E=e[16];let U;e[17]!==C||e[18]!==v||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==D||e[23]!==E?(U=o.jsx(C,{compact:M,filterModels:a,onClose:d,credentialId:v,onCredentialChange:g,selectedModel:D,onModelChange:E}),e[17]=C,e[18]=v,e[19]=a,e[20]=d,e[21]=g,e[22]=D,e[23]=E,e[24]=U):U=e[24];let T;e[25]!==N||e[26]!==U||e[27]!==I?(T=o.jsx("div",{className:S,children:o.jsx(N,{fallback:I,children:U})}),e[25]=N,e[26]=U,e[27]=I,e[28]=T):T=e[28];let L;return e[29]!==T||e[30]!==w?(L=o.jsxs("div",{className:b,children:[w,T]}),e[29]=T,e[30]=w,e[31]=L):L=e[31],L}function vi(t){return t.id}const bi=["fast","smart","thinking"];function As(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Mt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function Ai(t){const e=R.c(28),{tier:s,pillIcon:n,groups:r}=t,i=K();let a;e[0]!==i?(a=As(i),e[0]=i,e[1]=a):a=e[1];const l=a,[c,d]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{w.onSelect(),d(!1)},e[2]=u):u=e[2];const V=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=O("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[4]=h):h=e[4];const m=l[s];let g;e[5]!==m?(g=o.jsx("span",{className:h,children:m}),e[5]=m,e[6]=g):g=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Zt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=v):v=e[7];let x;e[8]!==n||e[9]!==p||e[10]!==g?(x=o.jsx(Ze,{asChild:!0,children:o.jsx("span",{className:"inline-flex min-w-0 shrink",children:o.jsx(Xt,{asChild:!0,children:o.jsxs(G,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[n,g,v]})})})}),e[8]=n,e[9]=p,e[10]=g,e[11]=x):x=e[11];let b;e[12]!==p?(b=o.jsx(Xe,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;e[14]!==x||e[15]!==b?(A=o.jsxs(et,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16];let j;if(e[17]!==r||e[18]!==i){let w;e[20]!==i?(w=S=>o.jsx("div",{className:"flex flex-col",children:S.rows.map(N=>o.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[o.jsxs("button",{type:"button",role:"menuitem","aria-label":N.title,onClick:()=>V(N),className:O("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",N.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[N.icon&&o.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:N.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm",children:N.title}),N.subtitle&&o.jsx("div",{className:"text-xs text-muted-foreground",children:N.subtitle})]}),N.active&&o.jsx("span",{title:i("chat.tierTrigger.selected"),children:o.jsx(lt,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&o.jsx(ji,{label:N.title,render:N.modelOverride})]},N.key))},S.key),e[20]=i,e[21]=w):w=e[21],j=r.map(w),e[17]=r,e[18]=i,e[19]=j}else j=e[19];let y;e[22]!==j?(y=o.jsx(es,{align:"end",className:"p-1 w-64",onOpenAutoFocus:yi,children:o.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=y):y=e[23];let k;return e[24]!==c||e[25]!==A||e[26]!==y?(k=o.jsxs(ts,{open:c,onOpenChange:d,children:[A,y]}),e[24]=c,e[25]=A,e[26]=y,e[27]=k):k=e[27],k}function yi(t){return t.preventDefault()}function ji(t){const e=R.c(38),{label:s,render:n}=t,r=K(),i=ss(),[a,l]=P.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>l(!1),e[0]=c):c=e[0];const d=c;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const V=a&&"opacity-100";let p;e[4]!==V?(p=O("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg bg-background border border-border/60 shadow-sm","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",V),e[4]=V,e[5]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(qn,{size:14}),e[6]=f):f=e[6];let h;e[7]!==u||e[8]!==p?(h=o.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=h):h=e[9];const m=h;if(i){let A;e[10]!==m?(A=o.jsx(yo,{asChild:!0,children:m}),e[10]=m,e[11]=A):A=e[11];let j;e[12]!==s||e[13]!==r?(j=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=j):j=e[14];let y;e[15]!==j?(y=o.jsx(jo,{className:"sr-only",children:j}),e[15]=j,e[16]=y):y=e[16];let k;e[17]!==a||e[18]!==n?(k=a&&n(d),e[17]=a,e[18]=n,e[19]=k):k=e[19];let w;e[20]!==k||e[21]!==y?(w=o.jsxs(ko,{className:"p-0 flex flex-col max-h-[95vh]",children:[y,k]}),e[20]=k,e[21]=y,e[22]=w):w=e[22];let S;return e[23]!==a||e[24]!==w||e[25]!==A?(S=o.jsxs(wo,{open:a,onOpenChange:l,children:[A,w]}),e[23]=a,e[24]=w,e[25]=A,e[26]=S):S=e[26],S}let g;e[27]!==m?(g=o.jsx(Xt,{asChild:!0,children:m}),e[27]=m,e[28]=g):g=e[28];let v;e[29]!==a||e[30]!==n?(v=a&&n(d),e[29]=a,e[30]=n,e[31]=v):v=e[31];let x;e[32]!==v?(x=o.jsx(es,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:v}),e[32]=v,e[33]=x):x=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==x?(b=o.jsxs(ts,{open:a,onOpenChange:l,children:[g,x]}),e[34]=a,e[35]=g,e[36]=x,e[37]=b):b=e[37],b}function Dt(t){return t==="fast"?o.jsx(Vt,{size:16}):t==="thinking"?o.jsx(Kn,{size:16}):o.jsx(So,{size:16})}function ki(t){const e=R.c(13),s=zn();let n;e[0]!==t||e[1]!==s.tiers?(n=d=>{const u=s.tiers[d];return u?u.title??u.modelId:t.chat[d]?.title},e[0]=t,e[1]=s.tiers,e[2]=n):n=e[2];const r=n;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let c;return e[9]!==i||e[10]!==a||e[11]!==l?(c={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=c):c=e[12],c}function wi(){const t=R.c(25),e=K(),{simpleModeTier:s,setSimpleModeTier:n}=He(),r=Co(),i=ns(),a=To(i),l=ki(a),{data:c,error:d}=Ln();let u;t[0]!==c?(u=c===void 0?{tiers:{}}:c,t[0]=c,t[1]=u):u=t[1];const V=u,p=Fn(),f=We()?.lockedHarness,h=f==="claude-code",m=$e("model_choice"),g=ao(),v=lo();if(!g||!m)return null;let x,b;if(t[2]!==a||t[3]!==v||t[4]!==h||t[5]!==f||t[6]!==r||t[7]!==n||t[8]!==e||t[9]!==s||t[10]!==l||t[11]!==p||t[12]!==V||t[13]!==d){const w=As(e);x="decopilot",b=bi.map(S=>{const N=l[S],I=V.tiers[S];return{key:`decopilot-${S}`,icon:Dt(S),title:w[S],subtitle:v?N??e(Mt[S]):e(Mt[S]),active:s===S,onSelect:()=>n(S),modelOverride:v?C=>o.jsxs(o.Fragment,{children:[d&&o.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),o.jsx(xi,{tier:S,orgSlot:r.tiers[S],userSlot:I,autoSlot:a.chat[S],filterModels:f==="codex"?Si:h?hi:void 0,onClose:C,onPick:M=>p.mutate({tier:S,slot:M}),onReset:()=>p.mutate({tier:S,slot:null})},`${S}:${I?.keyId??"org"}:${I?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=v,t[4]=h,t[5]=f,t[6]=r,t[7]=n,t[8]=e,t[9]=s,t[10]=l,t[11]=p,t[12]=V,t[13]=d,t[14]=x,t[15]=b}else x=t[14],b=t[15];let A;t[16]!==x||t[17]!==b?(A=[{key:x,rows:b}],t[16]=x,t[17]=b,t[18]=A):A=t[18];const j=A;let y;t[19]!==s?(y=Dt(s),t[19]=s,t[20]=y):y=t[20];let k;return t[21]!==j||t[22]!==y||t[23]!==s?(k=o.jsx(Ai,{tier:s,pillIcon:y,groups:j}),t[21]=j,t[22]=y,t[23]=s,t[24]=k):k=t[24],k}function Si(t){return di(t.providerId,t.modelId)}function ys(t){const e=R.c(3),[s]=Ne();let n;return e[0]!==s.enableSounds||e[1]!==t?(n=()=>{s.enableSounds&&Fo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=n):n=e[2],n}const Ci={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"},Ni=mn.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Ii=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Ti(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center -space-x-1.5",children:Ii.map(_i)}),t[0]=e):e=t[0],e}function _i(t){return o.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Mi({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:n,isStreaming:r,onUnsupportedFile:i}){const a=K(),[l,c]=P.useState(!1),d=ys(Ci),{org:u}=Ie(),{editor:V}=zt(),p=P.useRef(null),f=pt(n),h=()=>{!f||r||(c(!1),p.current?.click())},m=async _=>{const B=_.target.files;if(!B||B.length===0||!V)return;const J=Array.from(B);try{let Z=V.state.selection.from;for(const X of J)await os(V,n??null,X,Z,i,a),Z=V.state.selection.to}finally{p.current&&(p.current.value="")}},g=Eo({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Os.virtualMcpPrompts(s,u.id),{data:x,isLoading:b}=$s({queryKey:v,queryFn:()=>Po(g),staleTime:6e4,enabled:l&&!!g}),A=x?.prompts??[],[j,y]=P.useState(null),{chatMode:k,setChatMode:w}=He(),[S,N]=Ne(),I=We()?.lockedHarness!=="claude-code",C=Ce.find(_=>_.value===S.toolApprovalLevel)??Ce[0],M=a(C.shortKey),D=_=>{const B=Ce.find(J=>J.value===_);if(B){if(B.value===S.toolApprovalLevel){c(!1);return}d(),se("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:B.value,source:"tools_popover"}),N({...S,toolApprovalLevel:B.value}),c(!1)}},E=k==="plan",U=()=>{d();const _=E?"default":"plan";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},T=()=>{e(),c(!1)},L=async(_,B)=>{if(!V||!g)return;const J=jt(_._meta),Z={from:V.state.selection.from,to:V.state.selection.to};try{const X=await Uo(g,_.name,B);Vn(V,Z,{id:_.name,name:ho(_.name,J),metadata:X.messages,char:"/",kind:"prompt",args:B})}catch{Ue.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async _=>{c(!1);const B=!!(_.arguments&&_.arguments.length>0);if(se("chat_prompt_inserted",{prompt_name:_.name,with_arguments:B}),B){y(_);return}await L(_)},W=async _=>{j&&(await L(j,_),y(null))},$=()=>{d();const _=k==="gen-image"?"default":"gen-image";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},z=()=>{d();const _=k==="web-search"?"default":"web-search";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},Q=()=>{d();const _=k==="deep-research"?"default":"deep-research";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},ee=k==="gen-image",te=k==="web-search",H=k==="deep-research",oe=o.jsx("input",{ref:p,type:"file",multiple:!0,accept:bo(n??null),className:"hidden",onChange:m,disabled:r});return o.jsxs(o.Fragment,{children:[oe,o.jsxs(Bs,{open:l,onOpenChange:_=>{_&&!l&&se("chat_tools_popover_opened",{chat_mode:k}),c(_)},children:[o.jsx(Ks,{asChild:!0,children:o.jsxs(G,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[o.jsx(Qn,{size:14}),o.jsx("span",{className:O("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:a("chat.toolsPopover.tools")})]})}),o.jsxs(qs,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?o.jsxs(ye,{onClick:h,disabled:r,children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):o.jsxs(et,{children:[o.jsx(Ze,{asChild:!0,children:o.jsxs(ye,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:_=>_.preventDefault(),children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),o.jsx(Xe,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),o.jsxs(ye,{onClick:U,className:O(E&&"text-special"),children:[o.jsx(qt,{size:16,className:O(E&&"text-special")}),o.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),o.jsx("span",{className:O("text-xs text-muted-foreground",E&&"text-special font-medium"),children:Ni})]}),o.jsxs(ye,{onClick:$,className:O(ee&&"text-special"),children:[o.jsx(Ht,{size:16,className:O(ee&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),ee&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:z,className:O(te&&"text-special"),children:[o.jsx(Wt,{size:16,className:O(te&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:Q,className:O(H&&"text-special"),children:[o.jsx(Gt,{size:16,className:O(H&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),H&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),o.jsx(vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?o.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[o.jsx(Qs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):A.length===0?o.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):A.map(_=>o.jsxs(ye,{onClick:()=>F(_),className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"font-medium text-sm capitalize",children:_.title||fo(_.name,jt(_._meta))}),_.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:_.description})]},_.name))})]}),I&&o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx(Je,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:M})]}),o.jsx(vt,{className:"w-48 p-1.5",children:o.jsx(Ys,{value:S.toolApprovalLevel,onValueChange:D,children:Ce.map(_=>o.jsx(Ws,{value:_.value,children:a(_.labelKey)},_.value))})})]}),o.jsxs(ye,{onClick:T,children:[o.jsx(Lo,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),o.jsx(P.Suspense,{children:o.jsx(Ti,{})})]})]})]}),o.jsx(ln,{prompt:j,setPrompt:y,onSubmit:W})]})}const Di=[{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 Ri(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center -space-x-1",children:Di.map(Ei)}),t[0]=e):e=t[0],e}function Ei(t){return o.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Pi(t){const e=R.c(10),{onClick:s}=t,n=K();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=O("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==n?(i=n("chat.connectionsBanner.description"),e[1]=n,e[2]=i):i=e[2];let a;e[3]!==i?(a=o.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,c;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ri,{}),c=o.jsx(Gs,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=c):(l=e[5],c=e[6]);let d;return e[7]!==s||e[8]!==a?(d=o.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,c]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Pe=48;function Ui(){const t=R.c(9),[e,s]=P.useState("idle"),[n,r]=P.useState(""),[i,a]=P.useState(""),[l,c]=P.useState(zi),d=P.useRef(null),u=P.useRef(null),V=P.useRef(null),p=P.useRef(null),f=P.useRef(0),h=P.useRef(!1),m=P.useRef(""),g=P.useRef(""),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(Fi),p.current?.getTracks().forEach(Li),V.current=null,u.current=null,p.current=null},t[0]=x):x=t[0];const b=x;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=C=>{p.current=C;const M=new AudioContext;u.current=M;const D=M.createMediaStreamSource(C),E=M.createAnalyser();E.fftSize=128,E.smoothingTimeConstant=.8,D.connect(E),V.current=E;const U=new Uint8Array(E.frequencyBinCount),T=()=>{if(!V.current)return;V.current.getByteFrequencyData(U);const L=[];for(let F=0;F<Pe;F++){const W=Math.floor(F/Pe*U.length);L.push(Math.max(.04,(U[W]??0)/255))}c(L),f.current=requestAnimationFrame(T)};T()};A=async()=>{const C=window.SpeechRecognition||window.webkitSpeechRecognition;if(!C)return s("unsupported"),"unsupported";let M;try{M=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),g.current="",m.current="",h.current=!0,s("recording"),I(M);const D=new C;d.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=E=>{if(d.current!==D)return;let U="",T="";for(let L=E.resultIndex;L<E.results.length;L++){const F=E.results[L],W=F?.[0]?.transcript??"";F?.isFinal?T=T+W:U=U+W}T&&(m.current=m.current+T,r(m.current)),g.current=U,a(U)},D.onerror=E=>{d.current===D&&E.error!=="no-speech"&&(h.current=!1,d.current=null,b(),s(E.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(d.current===D&&h.current)try{D.start()}catch{}};try{D.start()}catch{return h.current=!1,d.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let y;t[2]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{h.current=!1,d.current?.stop(),b(),s("idle"),c(Array(Pe).fill(.05)),a("");const I=(m.current+(g.current?" "+g.current:"")).trim();return r(""),m.current="",g.current="",I},t[2]=y):y=t[2];const k=y;let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),c(Array(Pe).fill(.05)),m.current="",g.current=""},t[3]=w):w=t[3];const S=w;let N;return t[4]!==i||t[5]!==e||t[6]!==n||t[7]!==l?(N={status:e,transcript:n,interimTranscript:i,waveformData:l,isSupported:v,startRecording:j,stopRecording:k,cancelRecording:S},t[4]=i,t[5]=e,t[6]=n,t[7]=l,t[8]=N):N=t[8],N}function Li(t){return t.stop()}function Fi(){}function zi(){return Array(Pe).fill(.05)}function Oi(t){const e=R.c(4),{data:s}=t;let n;e[0]!==s?(n=s.map($i),e[0]=s,e[1]=n):n=e[1];let r;return e[2]!==n?(r=o.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:n}),e[2]=n,e[3]=r):r=e[3],r}function $i(t,e){return o.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)}const Le=12e3,Rt=ie({token:ne(),expiresAt:Js()});Zs("provider",[ie({provider:je("elevenlabs"),conversationToken:ne().min(1)}),ie({provider:je("openai"),transport:je("webrtc")})]);const Bi=Hs([Rt.extend({provider:je("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Rt.extend({provider:je("openai"),transport:je("webrtc")})]);ie({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Le)});const js=ie({request:ne().trim().min(1).max(Le)}),rt=5e3;Ut(ie({role:ze(["user","agent"]),text:ne().min(1).max(rt)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=rt,{message:"Voice transcript is too long"});function cl(t){const e=[];let s=rt;for(const n of t.slice(-60).reverse()){if(s<=0)break;const r=n.text.slice(-s);e.unshift({role:n.role,text:r}),s-=r.length}return e}ie({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:ze(["en","pt"]).default("en")}).strict();const Ki=ie({sdp:ne().min(1).max(1e5)});async function qi(t,e,s,n,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:c}=await import("./openai-conversation-CVDPWLE1.js");return{startOpenAIConversation:c}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return l(r,s,n)}const{Conversation:i}=await bt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);n.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const c=js.safeParse(l);return JSON.stringify(c.success?await s.onDelegate(c.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return n.aborted&&(await a.endSession(),n.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const c=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?a.sendContextualUpdate(c):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
10
10
|
${c}
|
|
11
11
|
Briefly report this update. Do not delegate it as new work.`)}}}const Qi=ie({background:je(!0),status:je("started"),jobId:ne().min(1)}),Yi=ie({item:ie({id:ne().min(1),title:ne(),status:ne()})}),Wi=t=>`${t}:react-msg`;function ks(t,e){const s=t.findIndex(r=>r.id===e&&r.role==="user");if(s<0)return null;const n=[];for(const r of t.slice(s+1))if(!r.metadata?.subtaskJobId){if(r.role==="user")break;r.role==="assistant"&&n.push(r)}return n}function Et(t,e){const s=[],n=[];for(const r of ks(t,e)??[])for(const i of r.parts){if(!("state"in i)||i.state!=="output-available"||!("output"in i))continue;const a=i.type;if(a==="tool-subtask"){const l=Qi.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(a==="tool-TASK_BOARD_ITEM_CREATE"){const l=Yi.safeParse(i.output);l.success&&n.push(l.data.item)}}return{backgroundJobs:s,tasks:n}}function Pt(t,e){const s=ks(t,e);if(!s)return null;const n=s.at(-1);if(!n||n.parts.some(l=>"state"in l&&["approval-requested","input-streaming","input-available"].includes(String(l.state))))return null;const r=n.parts.findLast(l=>l.type==="text"||l.type==="dynamic-tool"||l.type.startsWith("tool-"));if(r?.type!=="text")return"";if(r.state==="streaming")return null;const i=r.text.replace(/```[\s\S]*?```/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+\.\s+)/gm,"").replace(/[*_`]/g,"").trim();if(!i)return"";if(i.length<=Le)return i;const a=i.slice(0,Le-1);return`${a.slice(0,a.lastIndexOf(" "))}…`}class Gi{constructor(e,s){this.url=e,this.language=s}url;language;state={phase:"idle",muted:!1,working:!1,error:null};listeners=new Set;generation=0;conversation;startupAbort;userSpeaking=!1;token;timer;expires;bindings;jobs=new Map;announcements=[];lastActivity=0;approvalReported=!1;cleanup=Promise.resolve();dispatchQueue=Promise.resolve();lastContext="";lastWorkStatus="";utterance=0;seenUserEvents=new Set;tasks=new Map;boardUpdates=new Map;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;outputVolume=()=>this.conversation?.getOutputVolume()??0;patch(e){if(!Object.entries(e).every(([s,n])=>this.state[s]===n)){this.state={...this.state,...e};for(const s of this.listeners)s()}}updateBindings(e,s){if(this.bindings=e,!s&&this.state.phase!=="idle"){this.stop();return}this.conversation&&(this.updateContext(),this.collectResults())}requestStatus(e){return e.result!==void 0?"finished":e.accepted?e.background?"running_in_background":this.bindings?.messages.some(s=>s.id===e.messageId)?"running":"queued":"submitting"}status(){const e=this.bindings;return{status:e?.isWaitingForApprovals?"approval_required":e?.error||e?.status==="error"?"failed":e?.isStreaming||e?.isRunInProgress?"working":"idle",requests:[...this.jobs.values()].slice(-6).map(s=>({id:s.messageId,request:s.request.slice(0,200),status:this.requestStatus(s),result:s.result?.slice(0,500)})),tasks:[...this.tasks.values()].slice(-10).map(s=>({title:s.title.slice(0,120),status:s.status}))}}updateContext(){const e=this.bindings?.voiceContext??"";e!==this.lastContext&&(this.lastContext=e,this.conversation?.publishUpdate({text:`Current Studio view, supplied as context only:
|
|
12
12
|
${e.slice(0,12e3)}`,delivery:"context",contextId:"studio-view"}))}collectResults(){const e=this.bindings;if(!e||!this.conversation)return;const s=e.isStreaming||e.isRunInProgress;if(this.patch({working:s||[...this.jobs.values()].some(n=>n.accepted&&n.result===void 0)}),this.publishWorkStatus(),e.isWaitingForApprovals){this.approvalReported||(this.approvalReported=!0,this.report("The Studio agent needs the user's approval. The approval controls are visible in this chat. Ask the user to review them; do not approve on their behalf."));return}this.approvalReported=!1;for(const n of this.jobs.values()){if(!n.accepted||n.result!==void 0)continue;if(n.background){this.collectBackground(n,s);continue}const r=e.messages.findIndex(l=>l.id===n.messageId);if(r<0)continue;const i=r>=0&&e.messages.slice(r+1).some(l=>l.role==="user");if(s&&!i)continue;let a;if(!s&&!i&&(e.error||e.status==="error"))a="The agent's run failed. Ask the user to return to the chat for the error details; do not claim completion.";else if(!s&&!i&&e.finishReason&&["error","length","content-filter","aborted"].includes(e.finishReason))a=`The run ended with status ${e.finishReason}; successful completion is not established.`;else{const l=Pt(e.messages,n.messageId);if(l===null)continue;a=l;const c=Et(e.messages,n.messageId);if(this.track(c.tasks),c.backgroundJobs.length){n.background=c.backgroundJobs,this.collectBackground(n,s);continue}}this.finish(n,a||"The agent finished without a final text response. Do not infer that the requested change succeeded.")}this.patch({working:s||[...this.jobs.values()].some(n=>n.accepted&&n.result===void 0)}),this.publishWorkStatus()}collectBackground(e,s){const n=this.bindings?.messages??[],r=[];for(const i of e.background??[]){const a=Wi(i),l=n.findIndex(u=>u.id===a);if(l<0)return;const c=n.slice(l+1).some(u=>u.role==="user");if(s&&!c)return;const d=Pt(n,a);if(d===null)return;this.track(Et(n,a).tasks),r.push(d)}this.finish(e,r.filter(Boolean).join(`
|