decocms 4.422.1 → 4.422.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-COM2phwL.js → AlertCircle-CVtZx7OF.js} +1 -1
- package/dist/client/assets/{AreaChart-2omR9bO-.js → AreaChart-BhhKa5WC.js} +1 -1
- package/dist/client/assets/{ArrowLeft-iOn4l4NN.js → ArrowLeft-BCkbM4b4.js} +1 -1
- package/dist/client/assets/{ArrowRight-CnYYHlO1.js → ArrowRight-BBBInn6h.js} +1 -1
- package/dist/client/assets/{ArrowUp-BCekwS2q.js → ArrowUp-DA3O9Q_5.js} +1 -1
- package/dist/client/assets/{CartesianChart-FEsrccxX.js → CartesianChart-Dz5ej5Gk.js} +1 -1
- package/dist/client/assets/{Check-DviaYRqC.js → Check-FcxjuFt6.js} +1 -1
- package/dist/client/assets/{CheckCircle-1XHfZ2UO.js → CheckCircle-BO45x9RP.js} +1 -1
- package/dist/client/assets/{ChevronUp-Ce6pKXHb.js → ChevronUp-CFC5Ebq0.js} +1 -1
- package/dist/client/assets/{Copy01-DGhRT6_F.js → Copy01-C6Pi2Z_V.js} +1 -1
- package/dist/client/assets/{CreditCard01-BjP6TXXW.js → CreditCard01-C5pPfXKY.js} +1 -1
- package/dist/client/assets/{DotsVertical-C6bmj-eI.js → DotsVertical-BLLrg_XP.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-Bwjr8Yxj.js → ErrorBarContext-KVNuaRbI.js} +1 -1
- package/dist/client/assets/{Image01-BtbbYKNf.js → Image01-B1u2Kql2.js} +1 -1
- package/dist/client/assets/{Key01-CNG8hgFT.js → Key01-ClN_3drg.js} +1 -1
- package/dist/client/assets/{Line-czqgAV_9.js → Line-CZINWoIp.js} +1 -1
- package/dist/client/assets/{Link01-BBaUvzFn.js → Link01-Vtq2lkbp.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Ca4QyfIX.js → LinkExternal01-F44g-br4.js} +1 -1
- package/dist/client/assets/{Monitor01-h5xGvRXV.js → Monitor01-DzDXiiSe.js} +1 -1
- package/dist/client/assets/{Palette-C2c_hzce.js → Palette-mWfzFBxF.js} +1 -1
- package/dist/client/assets/{Plus-B8RVFJSA.js → Plus-KRmPLJ6h.js} +1 -1
- package/dist/client/assets/{SearchMd-CfSh-vrd.js → SearchMd-V0a6RI0u.js} +1 -1
- package/dist/client/assets/{Sector-CK_2T8dH.js → Sector-DOnsMWPN.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-pynIzeB6.js → ShoppingBag01-CgMyE5tG.js} +1 -1
- package/dist/client/assets/{Sun-C4Be1JCB.js → Sun-BsSXClq1.js} +1 -1
- package/dist/client/assets/{Tool01-QgkBq5BT.js → Tool01-DAEtx7Sx.js} +1 -1
- package/dist/client/assets/{Trash01-BOsOg0lH.js → Trash01-Cakv0Q_K.js} +1 -1
- package/dist/client/assets/{Upload01-DUQcdNe8.js → Upload01-CTQz1wiD.js} +1 -1
- package/dist/client/assets/{User01-Bn561Wgn.js → User01-P9l9chQ8.js} +1 -1
- package/dist/client/assets/{UserSquare-BTJRtaIW.js → UserSquare-C8CLmWk7.js} +1 -1
- package/dist/client/assets/{Users01-DlAkA4Cc.js → Users01-CNwYnNBC.js} +1 -1
- package/dist/client/assets/{X-CG1Rwygc.js → X-CKGbxNhB.js} +1 -1
- package/dist/client/assets/{XAxis-Byu-xxzw.js → XAxis-BtS9K8bJ.js} +1 -1
- package/dist/client/assets/{XClose-Cdoqobpv.js → XClose-YtRhiE3L.js} +1 -1
- package/dist/client/assets/{ZoomOut-CoqqmOBf.js → ZoomOut-C-nvVeIw.js} +1 -1
- package/dist/client/assets/{access-gate-BUXHesQA.js → access-gate-D2ZebaFO.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Sao5zKq7.js → add-connection-dialog-4toRZZCj.js} +1 -1
- package/dist/client/assets/{agent-analytics-DcmctZyG.js → agent-analytics-BcI4DPVo.js} +1 -1
- package/dist/client/assets/agent-app-CDw9NPar.js +1 -0
- package/dist/client/assets/{agent-assets-DUf90QVM.js → agent-assets-oonhj5GS.js} +1 -1
- package/dist/client/assets/{agent-automation-CimXf_MT.js → agent-automation-BJHlaGQQ.js} +1 -1
- package/dist/client/assets/{agent-automations-BEpsFt6x.js → agent-automations-CesK4r4W.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BPRB5Kma.js → agent-connect-sources-CCZJyALU.js} +1 -1
- package/dist/client/assets/agent-deck-BQTunqEK.js +1 -0
- package/dist/client/assets/{agent-e2e-AITc22L9.js → agent-e2e-DuBrWECi.js} +1 -1
- package/dist/client/assets/{agent-experiments-DmM5qRzm.js → agent-experiments-vLmcxuue.js} +1 -1
- package/dist/client/assets/{agent-file-C_Cn0X0N.js → agent-file-BjwSU2v3.js} +1 -1
- package/dist/client/assets/{agent-git-N_JtB4gj.js → agent-git-CFegXvbB.js} +1 -1
- package/dist/client/assets/{agent-hosting-BZT5ByH4.js → agent-hosting-Bg7A-Ube.js} +1 -1
- package/dist/client/assets/{agent-icon-B_6FH0Uz.js → agent-icon-BwVu9Y1n.js} +1 -1
- package/dist/client/assets/agent-library-CmLN_5gu.js +1 -0
- package/dist/client/assets/agent-library-file-exMsSt_M.js +1 -0
- package/dist/client/assets/{agent-monitor-CHRAb_uM.js → agent-monitor-dV--q695.js} +1 -1
- package/dist/client/assets/{agent-overview-1I_3CBd5.js → agent-overview-CKjEypvF.js} +1 -1
- package/dist/client/assets/agent-settings-j2_eVJKl.js +1 -0
- package/dist/client/assets/{agent-site-editor-BpYPeAGL.js → agent-site-editor-DVoJkMOH.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DDFejzkU.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-B18F4dV1.js → agent-site-editor-content-DyztC_34.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-Bsm9fO5Z.js → agent-site-editor-preview-iKb4i4S0.js} +3 -3
- package/dist/client/assets/agent-view-CBFrWHB9.js +1 -0
- package/dist/client/assets/{agent-view-guard-BMJj7X52.js → agent-view-guard-CczFiEQW.js} +1 -1
- package/dist/client/assets/{agents-list-DR9_djQF.js → agents-list-Cx-MnAIR.js} +1 -1
- package/dist/client/assets/{ai-providers-CB6Xz-C4.js → ai-providers-aCtxSLrJ.js} +1 -1
- package/dist/client/assets/{alert-DB7rtAVZ.js → alert-BMhd1qkv.js} +1 -1
- package/dist/client/assets/{alert-dialog-fLB6qkJD.js → alert-dialog-BIKJBSWY.js} +1 -1
- package/dist/client/assets/{analytics-sections-B-HJUcyF.js → analytics-sections-B9AYAPpL.js} +1 -1
- package/dist/client/assets/api-keys-B9-V0bqA.js +1 -0
- package/dist/client/assets/{api-keys-BFKhmbVL.js → api-keys-BiSnsj4I.js} +1 -1
- package/dist/client/assets/app-editor-DSMfMFFh.js +1 -0
- package/dist/client/assets/{asset-utils-Dpu99ktN.js → asset-utils-DJ6ftbPl.js} +1 -1
- package/dist/client/assets/{auth-CWe9v2oI.js → auth-Dy0n9IyK.js} +1 -1
- package/dist/client/assets/{auth-catchall-CA-UKFIh.js → auth-catchall-CjRy2Hgy.js} +1 -1
- package/dist/client/assets/{auth-entry-DeKYMMdS.js → auth-entry-C3yDP8t5.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D7vh4LKs.js → auth-split-layout-DyTMFK4R.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-vOny9ISu.js → authenticate-and-persist-oauth-B-9NlA8S.js} +1 -1
- package/dist/client/assets/{automation-list-row-BXhWDN8i.js → automation-list-row-BcGgpCA_.js} +1 -1
- package/dist/client/assets/{automation-runs-Dzs-so0m.js → automation-runs-CjxY4TUG.js} +1 -1
- package/dist/client/assets/{automations-M7_Q_zjJ.js → automations-UCKOjbB9.js} +1 -1
- package/dist/client/assets/{autosend-DuQV6B4V.js → autosend-VbZkWu24.js} +1 -1
- package/dist/client/assets/{avatar-0NvVLvVw.js → avatar-CRdtD8pR.js} +1 -1
- package/dist/client/assets/{badge-BLzW7Jtz.js → badge-bFS7pJ24.js} +1 -1
- package/dist/client/assets/{block-document-pIFzX45j.js → block-document-B_MVuzvl.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CRjQ0dup.js → blocks-preview-workspace-context-CKUsc--e.js} +1 -1
- package/dist/client/assets/{buckets-CaPXZBJ9.js → buckets-DH_9H2lm.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CfHGp7Rc.js → build-improve-prompt-doc-B2nzL_xr.js} +1 -1
- package/dist/client/assets/{calendar-D9BvBqIj.js → calendar-ehgWJLe7.js} +1 -1
- package/dist/client/assets/{capability-load-error-B0GIPIRK.js → capability-load-error-DjYRR0Ds.js} +1 -1
- package/dist/client/assets/{category-editor-DeWwl0YT.js → category-editor-C7ndb-3d.js} +1 -1
- package/dist/client/assets/{chart-CyMLvQQD.js → chart-S-xxRWdH.js} +1 -1
- package/dist/client/assets/{chat-context-BWtOXr7z.js → chat-context-DgElWmma.js} +1 -1
- package/dist/client/assets/{chat-draft-BHST-yi6.js → chat-draft-Dm7KATsP.js} +1 -1
- package/dist/client/assets/{checkbox-hqkr2BSJ.js → checkbox-DY0rH-TX.js} +1 -1
- package/dist/client/assets/{choose-editor-DFkIIzID.js → choose-editor-BIPaWgYh.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BaNlSQzm.js → claim-phase-copy-CUWSS9Lf.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BA7yl2mu.js → cli-auth-success-5WpzIU3O.js} +1 -1
- package/dist/client/assets/{client-icons-Vn8IU61f.js → client-icons-MslZBuS6.js} +1 -1
- package/dist/client/assets/{collapsible-7-_bQGCT.js → collapsible-CHNqG-q-.js} +1 -1
- package/dist/client/assets/{collection-detail-wObudzTE.js → collection-detail-PSCqQ-Ir.js} +1 -1
- package/dist/client/assets/{collection-display-button-4VGoV7s7.js → collection-display-button-CZEgfpX9.js} +1 -1
- package/dist/client/assets/{collection-search-DgMxWICe.js → collection-search-BnXIXF-r.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D2onZh_D.js → collection-table-wrapper-8Z-CE056.js} +1 -1
- package/dist/client/assets/{collection-tabs-Vsd_4s_Z.js → collection-tabs-Bky3kPsU.js} +1 -1
- package/dist/client/assets/{combobox-Dy_95bR-.js → combobox-CVLqBXTa.js} +1 -1
- package/dist/client/assets/{command-DALADMfA.js → command-CGF9V6Vl.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BJac-eZA.js → companion-mcps-section-DXACuT5k.js} +1 -1
- package/dist/client/assets/{config-VlOFpLCO.js → config-HRkFT4Cj.js} +1 -1
- package/dist/client/assets/{connect-Bp_i3TY5.js → connect-CT9ioKHl.js} +1 -1
- package/dist/client/assets/{connect-layout-D1kV_c5Q.js → connect-layout-BOxr1i7G.js} +1 -1
- package/dist/client/assets/{connection-CZR3YMMQ.js → connection-0cqQcMBd.js} +1 -1
- package/dist/client/assets/{connection-card-XxluIuav.js → connection-card-CVXElGSe.js} +1 -1
- package/dist/client/assets/{connection-detail-DKnZkVXu.js → connection-detail-hNgr8XT5.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B-y_gutV.js → connection-form-helpers-ktc30XoJ.js} +1 -1
- package/dist/client/assets/{connections-DHtVwCbY.js → connections-DmEMDA2h.js} +1 -1
- package/dist/client/assets/{context-CWLFxJdq.js → context-CP59lD4S.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CWWGdLnZ.js → create-organization-dialog-PFEV7FIE.js} +1 -1
- package/dist/client/assets/{decopilot-C6QACVJn.js → decopilot-B7MHJNrn.js} +1 -1
- package/dist/client/assets/{dialog-DvE9S86C.js → dialog-jyWPb2tC.js} +1 -1
- package/dist/client/assets/{discover-H-CXEc3y.js → discover-DKjnWS0t.js} +1 -1
- package/dist/client/assets/{domain-settings-2Sedva0X.js → domain-settings-Dg0qQkrr.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CmzKuQVO.js → download-app-dialog-C5cTfPYs.js} +1 -1
- package/dist/client/assets/{drawer-DssTOBB2.js → drawer-CxXWX_ie.js} +1 -1
- package/dist/client/assets/{editor-CBnmXNlP.js → editor-DOUtwOEV.js} +1 -1
- package/dist/client/assets/{empty-state-BiZdhzEE.js → empty-state-CcOT7JmW.js} +1 -1
- package/dist/client/assets/{empty-state-DPaQxcVh.js → empty-state-pG1Fwit8.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DQls12Xb.js → extract-connection-data-D5OmU01k.js} +1 -1
- package/dist/client/assets/{feature-gate-B6SViKNx.js → feature-gate-D_-FZKAB.js} +1 -1
- package/dist/client/assets/{feature-paywall-DHb2Ym0V.js → feature-paywall-BptzLvdT.js} +1 -1
- package/dist/client/assets/{file-explorer-tUkEocoI.js → file-explorer-t_EBQrR9.js} +1 -1
- package/dist/client/assets/{file-preview-D7FpzUzM.js → file-preview-CETzBHJs.js} +1 -1
- package/dist/client/assets/{file-share-button-BTSWbtQw.js → file-share-button-CSpaHWIA.js} +1 -1
- package/dist/client/assets/{file-type-icon-BQ5pfGz7.js → file-type-icon-DOStMe7n.js} +1 -1
- package/dist/client/assets/flat-project-B7sqVExw.js +1 -0
- package/dist/client/assets/{folder-icon-CUcs_XZB.js → folder-icon-Jx8GrJQl.js} +1 -1
- package/dist/client/assets/{form-DAFWYj3z.js → form-cnyZOBcC.js} +1 -1
- package/dist/client/assets/{gateway-client-CNzWELcp.js → gateway-client-IjNlqnM5.js} +1 -1
- package/dist/client/assets/{general-BNIX735L.js → general-CqUUipBz.js} +1 -1
- package/dist/client/assets/{home-Bu8hU9eq.js → home-RbvSpTmv.js} +1 -1
- package/dist/client/assets/{index-BL4BxfkZ.js → index-4_tDDtww.js} +1 -1
- package/dist/client/assets/{index-DomnVBWW.js → index-BOY7zOPH.js} +1 -1
- package/dist/client/assets/{index-CBTNxEj3.js → index-BdZDESUI.js} +1 -1
- package/dist/client/assets/{index-C0p-dn3X.js → index-C39MmaGO.js} +1 -1
- package/dist/client/assets/{index-zJjXLdAi.js → index-CAk57bVW.js} +1 -1
- package/dist/client/assets/{index-BCcjKfyI.js → index-D40dM9_G.js} +1 -1
- package/dist/client/assets/{index-CWZlqMbx.js → index-DYOIplpK.js} +1 -1
- package/dist/client/assets/{index-BbAWF7pr.js → index-DYUG2RXM.js} +1 -1
- package/dist/client/assets/{index-D9zdWUMZ.js → index-DcP5acbo.js} +1 -1
- package/dist/client/assets/{index-DpsOHc9j.js → index-Dd54RIq4.js} +1 -1
- package/dist/client/assets/{index-DsdaTdbf.js → index-DwDe_p-O.js} +3 -3
- package/dist/client/assets/{index-DckBP-AE.js → index-OnxdjRP9.js} +1 -1
- package/dist/client/assets/{index-BoMAXneA.js → index-b8fp8LDt.js} +2 -2
- package/dist/client/assets/{index-DeYm6rgp.js → index-eyrB46Vy.js} +1 -1
- package/dist/client/assets/{index-redirect-BHOnVKXn.js → index-redirect-7mEnGUFH.js} +1 -1
- package/dist/client/assets/{index-Dt2I0cvE.js → index-rpTqXmHS.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Dx1JQsDW.js → infiniteQueryObserver-gIFPF-Q5.js} +1 -1
- package/dist/client/assets/{infra-billing-CYAh9xIk.js → infra-billing-BA22s6Vk.js} +1 -1
- package/dist/client/assets/{input-guxG_dfA.js → input-Ch2ik4AP.js} +3 -3
- package/dist/client/assets/{input-DFr2U6IG.js → input-DDkZ4YtM.js} +1 -1
- package/dist/client/assets/{input-DDktxnp0.js → input-Dhqv4uND.js} +1 -1
- package/dist/client/assets/{integration-icon-CuXHips1.js → integration-icon-BqF75Sx2.js} +1 -1
- package/dist/client/assets/{label-I23Djct8.js → label-CD-3KHsU.js} +1 -1
- package/dist/client/assets/{last-preview-page-DSTkZHTh.js → last-preview-page-CES2mhUS.js} +1 -1
- package/dist/client/assets/{layout-Bf3RN2B3.js → layout-zn8XiMmQ.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-0iKwX5Si.js → legacy-agents-deep-CRrvqgvY.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BtwmSwht.js → legacy-main-redirect-C5owTiPN.js} +1 -1
- package/dist/client/assets/library-BZeSnq8u.js +1 -0
- package/dist/client/assets/{library-tab-B_JfjgSw.js → library-tab-LDdmtC3E.js} +1 -1
- package/dist/client/assets/{login-Dd_Q4Onv.js → login-CzZNFZzZ.js} +1 -1
- package/dist/client/assets/{markdown-DfHPcvfY.js → markdown-C2wmhZNE.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-Vp20ZCwP.js → mcp-app-renderer-Bfgic9Y6.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BFANkYrx.js → mcp-oauth-btOLn9Vw.js} +1 -1
- package/dist/client/assets/{members-DY33g2Mt.js → members-BjeV4aYZ.js} +1 -1
- package/dist/client/assets/{message-templates-7pzgJ51z.js → message-templates-37PCcMuN.js} +1 -1
- package/dist/client/assets/{mini-report-page-D2xjGwIk.js → mini-report-page-Cpy1UAyy.js} +1 -1
- package/dist/client/assets/{mock-board-BMorA6v4.js → mock-board-BVug8wD7.js} +1 -1
- package/dist/client/assets/{monaco-editor-DZS65FKG.js → monaco-editor-l78K65MA.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-EZNNkwuS.js → monitoring-stats-row-Bb0H1Rix.js} +1 -1
- package/dist/client/assets/{multi-select-DX3oQldO.js → multi-select-RaNmnU24.js} +1 -1
- package/dist/client/assets/{mustache-wPPi3XFI.js → mustache-DqgZNsks.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CSiEcvP5.js → new-project-dialog-1J2k2mif.js} +1 -1
- package/dist/client/assets/{oauth-callback-KP1gRmP_.js → oauth-callback-W8QHmpa4.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-1Lk5wNel.js → oauth-callback-ai-provider-KD5D3EIS.js} +1 -1
- package/dist/client/assets/{onboarding-Ce8DVaaN.js → onboarding-cHYr2QVc.js} +1 -1
- package/dist/client/assets/{openai-conversation-7cNaZnyJ.js → openai-conversation-BIn1UYeU.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DOKE7X3u.js → optimistic-project-sidebar-views-CkEUPeDa.js} +1 -1
- package/dist/client/assets/{org-file-open-context-CKiZWz8V.js → org-file-open-context-De0SRuVZ.js} +1 -1
- package/dist/client/assets/{organization-choice-54LAm2zL.js → organization-choice-X7ttK6bk.js} +1 -1
- package/dist/client/assets/{orgs-CIxotpr_.js → orgs-xczr9FEW.js} +1 -1
- package/dist/client/assets/{page-seo-form-h_Ym67Wi.js → page-seo-form-B_DGL-5l.js} +1 -1
- package/dist/client/assets/{pair-IiB-QqIu.js → pair-De735f7F.js} +1 -1
- package/dist/client/assets/{plan-ladder-DO5S8C3_.js → plan-ladder-DOpWTd4w.js} +1 -1
- package/dist/client/assets/{popover-BWvzuoJ_.js → popover-CrMowaoE.js} +1 -1
- package/dist/client/assets/{post-calendar-DKiBJ_ce.js → post-calendar-BWaqiPVX.js} +1 -1
- package/dist/client/assets/{post-editor-CN2xIYHn.js → post-editor-DqTAcHZP.js} +1 -1
- package/dist/client/assets/{preview-content-B9VOP0tn.js → preview-content-DG2TyiDA.js} +1 -1
- package/dist/client/assets/{preview-dialog-BFhCM1pa.js → preview-dialog-CGk8g9sa.js} +1 -1
- package/dist/client/assets/{profile-CrW8hq-P.js → profile-DtU4frmg.js} +1 -1
- package/dist/client/assets/{project-app-view-BX0fnEyf.js → project-app-view-Dzxt7FUO.js} +1 -1
- package/dist/client/assets/{project-feed-P__dtJd2.js → project-feed-i3l9B4EK.js} +1 -1
- package/dist/client/assets/{project-icon-D2_1nRiU.js → project-icon-DsbzSgwK.js} +1 -1
- package/dist/client/assets/project-reports-B2OszKpU.js +1 -0
- package/dist/client/assets/project-tasks-BDPijl-K.js +1 -0
- package/dist/client/assets/{projects-DUW79Voa.js → projects-Dx-XXRrs.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BvPMvjcz.js → projects-empty-state-DO7zF9CF.js} +1 -1
- package/dist/client/assets/{prompts-Dnj-ckD2.js → prompts-CiuEgK_n.js} +1 -1
- package/dist/client/assets/record-editor-DfoUR1C9.js +1 -0
- package/dist/client/assets/{redirect-editor-DQGM640I.js → redirect-editor-oGDYVob4.js} +1 -1
- package/dist/client/assets/{reports-BE6Ik-Kf.js → reports-DUKjGsub.js} +1 -1
- package/dist/client/assets/reports-fyqF0S5-.js +1 -0
- package/dist/client/assets/{reports-onboarding-CNBB_PWp.js → reports-onboarding-Cn1Pt5RV.js} +1 -1
- package/dist/client/assets/{reports-tab-DO_c-wF-.js → reports-tab-DVHMgSaX.js} +2 -2
- package/dist/client/assets/{repositories-C07CoRkW.js → repositories-DdIRhlQT.js} +1 -1
- package/dist/client/assets/{repository-binding-CNr2LPMh.js → repository-binding-55R_NO8O.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DvM5qu3Z.js → repository-import-picker-CWfeZJ7D.js} +1 -1
- package/dist/client/assets/{repository-picker-4hnyy5h_.js → repository-picker-CuBjKX0n.js} +1 -1
- package/dist/client/assets/{require-capability-CsmoYj3v.js → require-capability-D-8Ab_Tx.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BzsbkHVG.js → required-auth-layout-JHtblyUI.js} +1 -1
- package/dist/client/assets/{reset-password-Bj8YnWXC.js → reset-password-B-zxfe28.js} +1 -1
- package/dist/client/assets/{resizable-CeYUPqWO.js → resizable-CKFWp7Oe.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-Bqt7ru2A.js → resolve-tab-icon-rlvTUfeF.js} +1 -1
- package/dist/client/assets/{review-settings-r1x2XGnt.js → review-settings-OjIn4a5N.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-Bw1X8YiG.js → rich-text-link-control-B2vsYy1E.js} +1 -1
- package/dist/client/assets/{roles-14ynbKxN.js → roles-BEFxXVjZ.js} +1 -1
- package/dist/client/assets/{route-Bsd1_Rfi.js → route-BuhReajl.js} +1 -1
- package/dist/client/assets/{route-sOZXifG4.js → route-CBVJ52nh.js} +1 -1
- package/dist/client/assets/route-v5ayl4uV.js +1 -0
- package/dist/client/assets/{runnable-block-editor-WT6bqmwK.js → runnable-block-editor-DX7F5x5Z.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Dp_d8mpg.js → sandbox-lifecycle-context-3b2Ggym7.js} +1 -1
- package/dist/client/assets/{schema-DRP8i0_6.js → schema-NHiqAi8o.js} +1 -1
- package/dist/client/assets/{scroll-area-B3rMSnLk.js → scroll-area-COFydPyl.js} +1 -1
- package/dist/client/assets/{search-input-Dss1O8LB.js → search-input-DtchHiLr.js} +1 -1
- package/dist/client/assets/{search-toggle-CeR6UM6Z.js → search-toggle-fuY2-Hrd.js} +1 -1
- package/dist/client/assets/{secret-picker-Cn1h_jSH.js → secret-picker-53Y713pM.js} +1 -1
- package/dist/client/assets/{secrets-yqGak-ex.js → secrets-B55lT9Jq.js} +1 -1
- package/dist/client/assets/{sections-editor-CmxGs-OC.js → sections-editor-BQGJ5syj.js} +1 -1
- package/dist/client/assets/{select-Byi1j6ao.js → select-CMOLfTUd.js} +1 -1
- package/dist/client/assets/{select-model-D3Oh4MKD.js → select-model-D3yjsL9p.js} +1 -1
- package/dist/client/assets/{seo-editor-6KFm2aJZ.js → seo-editor-BHnzEyxm.js} +1 -1
- package/dist/client/assets/{separator-C3c8Mfd2.js → separator-Hq7O1iJL.js} +1 -1
- package/dist/client/assets/{settings-tab-0P9F5L43.js → settings-tab-CZGv2Tk2.js} +1 -1
- package/dist/client/assets/{sheet-4HfaHVUC.js → sheet-C50lnPyk.js} +1 -1
- package/dist/client/assets/{shell-layout-CGkzRaFT.js → shell-layout-CdyVKBx2.js} +1 -1
- package/dist/client/assets/{skills-P9dDKpiC.js → skills-D-nKBqvh.js} +1 -1
- package/dist/client/assets/{sso-IgkpyKJL.js → sso-B0rQBNs2.js} +1 -1
- package/dist/client/assets/{suggestion-DHfhmHYU.js → suggestion-C9LFtFjS.js} +1 -1
- package/dist/client/assets/{switch-DWTbFsUq.js → switch-BDTLPd_5.js} +1 -1
- package/dist/client/assets/{synced-repos-Bcvo-VXM.js → synced-repos-DtyQovA-.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CvUvhBXE.js → tab-icon-glyph-D06mui8p.js} +1 -1
- package/dist/client/assets/{table-BUXvxbTX.js → table-DEMhEl9n.js} +1 -1
- package/dist/client/assets/{tabs-Q7CrIeBS.js → tabs-BcDaFfJS.js} +1 -1
- package/dist/client/assets/{task-board-Ch79jFCS.js → task-board-Qc5P6Y-B.js} +1 -1
- package/dist/client/assets/{task-route-DgWdhw9T.js → task-route-BDuG5mFb.js} +1 -1
- package/dist/client/assets/{task-status-D5NwTUkq.js → task-status-gBMnpCuT.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-4JPwBJVM.js → taskboard-analytics-CHiAQUS0.js} +1 -1
- package/dist/client/assets/tasks-4RXJBJM9.js +1 -0
- package/dist/client/assets/{tasks-CyY2EZAk.js → tasks-DbomCk4g.js} +1 -1
- package/dist/client/assets/{textarea-lTC_6fnn.js → textarea-DCQxd4Ep.js} +1 -1
- package/dist/client/assets/{thread-analytics-zbd8i9T6.js → thread-analytics-CpoE5ieH.js} +1 -1
- package/dist/client/assets/{thread-button-CuufFSh-.js → thread-button-ehR7Dlp_.js} +1 -1
- package/dist/client/assets/{thread-intent-jwtsPwjl.js → thread-intent-CRqPosFZ.js} +1 -1
- package/dist/client/assets/{thread-route-XNp3GD3y.js → thread-route-BrcWXGFH.js} +1 -1
- package/dist/client/assets/{thread-route-DcY0UNfs.js → thread-route-CwwNa7rG.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-iJcilptX.js → thread-sheet-body-CCzVo7LK.js} +1 -1
- package/dist/client/assets/{toggle-group-GMiNZZh7.js → toggle-group-JvUFZ5EE.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-M_ABucx8.js → toolbar-icon-button-B6sD_AsQ.js} +1 -1
- package/dist/client/assets/{tooltip-CeoeNj1M.js → tooltip-Bi7JdvkB.js} +1 -1
- package/dist/client/assets/{track-Dsl8PCmn.js → track-v0KVSx34.js} +1 -1
- package/dist/client/assets/{types-BAerGisi.js → types-C6rRSCQU.js} +1 -1
- package/dist/client/assets/{usage-stats-DbtVL10W.js → usage-stats-CuEYS-wZ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BPqFeqFP.js → use-ai-providers-BtMw9gwm.js} +1 -1
- package/dist/client/assets/{use-automations-Dc5pxSHn.js → use-automations-C8zovgC-.js} +1 -1
- package/dist/client/assets/{use-autosave-D_eXY9bx.js → use-autosave-B-NujlgN.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-CorrUKdo.js → use-chat-layout-state-CN6yuxIZ.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Bb5FRV3z.js → use-connect-companion-CEePh-_4.js} +1 -1
- package/dist/client/assets/{use-connection-DjS4AU7J.js → use-connection-Dow_xwpS.js} +1 -1
- package/dist/client/assets/{use-copy-DK4eLVdR.js → use-copy-COrhGZKC.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CpSvjEer.js → use-create-virtual-mcp-B140hp4e.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-okDAjeJQ.js → use-date-fns-locale-xhHRXAbX.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DFwI9Arz.js → use-debounced-autosave-Djt-umpU.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CwMwYzhQ.js → use-debounced-value-B8lQINn7.js} +1 -1
- package/dist/client/assets/{use-deco-credits-B-y2kZSq.js → use-deco-credits-B8qqCrVJ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D1OP5v8l.js → use-decopilot-events-CveMqPsg.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Bn9X8Zc_.js → use-delete-connection-SeG3ePOh.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-B5kRSTmT.js → use-deployment-admin-BUnxG0jx.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Cz06Th9y.js → use-fast-preview-draft-url-Caoiz4Wa.js} +1 -1
- package/dist/client/assets/{use-file-configs-BFs0DxV4.js → use-file-configs-D3-24XdK.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BJM9GGHn.js → use-infinite-scroll-D7ld_EUt.js} +1 -1
- package/dist/client/assets/{use-join-requests-BHkHdHoL.js → use-join-requests-Bp-z6Voq.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-8EUZ7E9q.js → use-main-panel-tabs-Hokx6WHS.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CdJ13oaG.js → use-mcp-auth-status-CmbIVFHS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-ChBjWRzH.js → use-mcp-client-D71dVc6F.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CHequI-u.js → use-mcp-prompts-5J9nyt1f.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-OIggM241.js → use-mcp-tools-CotgwWio.js} +1 -1
- package/dist/client/assets/{use-members-BJ_I50_V.js → use-members-DpznZCfa.js} +1 -1
- package/dist/client/assets/{use-mobile-CJPZWspn.js → use-mobile-gFkCJFqu.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CRC3dZXT.js → use-navigate-to-agent-CKGWZY5B.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-_HCBNSrv.js +1 -0
- package/dist/client/assets/{use-open-billing-url-3yzN-4EB.js → use-open-billing-url-PTsUxw4z.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BaZq57oU.js → use-org-auth-client-CV7Jx-D7.js} +1 -1
- package/dist/client/assets/{use-org-fs-2CvFQJAj.js → use-org-fs-BA8EDTNB.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DQT36zgB.js → use-org-repo-syncs-BzITnjia.js} +1 -1
- package/dist/client/assets/{use-org-sso-D2iGMz0i.js → use-org-sso-4TSO8HVM.js} +1 -1
- package/dist/client/assets/{use-organization-roles-ppLTJgZ8.js → use-organization-roles-BX_jzStw.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DIyTCe3C.js → use-organization-settings-DHUs001C.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-D4ke6Egm.js → use-panel-navigate-D3FhRJpf.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-AFZOJQgW.js → use-project-native-view-presence-Bm3KpKbG.js} +1 -1
- package/dist/client/assets/{use-project-scope-Ch0LLqJA.js → use-project-scope-B0nCeJeZ.js} +1 -1
- package/dist/client/assets/{use-releases-DEbOFdrf.js → use-releases-BHojzkRf.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DI2IzYrY.js → use-reports-diagnostic-ClFQn1-r.js} +1 -1
- package/dist/client/assets/{use-secrets-Dl0Z1zcv.js → use-secrets-CLdLiqbt.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-ZJMoyz-b.js → use-section-preview-base-D1HQsXgu.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CpMwKgzT.js → use-session-runtime-D4ohi0Ue.js} +1 -1
- package/dist/client/assets/{use-tags-Clzub4KW.js → use-tags-Ct_zjiKI.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Dsnwckld.js → use-task-board-analytics-DMpZjl1x.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DN-GD0qn.js → use-task-metadata-C8cu9VOd.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BS1KpX4X.js → use-thread-analytics-DyiU89Jz.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CrngkgFj.js → use-thread-outputs-D6266alc.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CzSAJb3p.js +1 -0
- package/dist/client/assets/{useQueries--gVy0poP.js → useQueries-BTLfD8PB.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bpkp3-ow.js +1 -0
- package/dist/client/assets/{users-Fa3USkQ3.js → users-zGePYZ2o.js} +1 -1
- package/dist/client/assets/{utils-ChfIaZlt.js → utils-BIme68Ov.js} +1 -1
- package/dist/client/assets/{variant-calendar-Cq5v0cQp.js → variant-calendar-B6xlCfDG.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BEgwx92p.js → variant-matcher-override-BQVeN4Ol.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-gKPRw-Br.js → view-mode-toggle-BzJ8plfm.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CWdqHLoM.js → virtual-mcp-D0krbeEv.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Dlo1tljc.js +0 -1
- package/dist/client/assets/agent-deck-DZI3Iork.js +0 -1
- package/dist/client/assets/agent-library-BlP0lZ-M.js +0 -1
- package/dist/client/assets/agent-library-file-DUHMLOKW.js +0 -1
- package/dist/client/assets/agent-settings-D7XfDh9q.js +0 -1
- package/dist/client/assets/agent-site-editor-code-C1QMISvN.js +0 -2
- package/dist/client/assets/agent-view-DnJLBgyD.js +0 -1
- package/dist/client/assets/api-keys-Di9E2HVZ.js +0 -1
- package/dist/client/assets/app-editor-BQPu__l2.js +0 -1
- package/dist/client/assets/flat-project-Cl5Ur_Uq.js +0 -1
- package/dist/client/assets/library-BUisjkcm.js +0 -1
- package/dist/client/assets/project-reports-BL_v7OkU.js +0 -1
- package/dist/client/assets/project-tasks-D43ryYZ8.js +0 -1
- package/dist/client/assets/record-editor-CWf9Xdd2.js +0 -1
- package/dist/client/assets/reports-Dc89v4p_.js +0 -1
- package/dist/client/assets/route-C3fKyLpT.js +0 -1
- package/dist/client/assets/tasks-CryMOUnz.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-Cn6O1MZV.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BeItsPXy.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CwqmnUMW.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{aL as Le,c as R,b as B,r as L,l as O,j as n,ao as ae,bM as Pt,ap as re,bL as Fe,B as W,an as bs,am as As,bN as ys,bK as js,x as ke,aU as ws,dL as we,dM as mt,a2 as ks,e as Ss,t as Pe,q as te,X as Se,d as rt,dJ as Cs,Z as Ns,K as Is,m as Ts,I as _s,F as Ms,H as Ds,G as Ae,aR as xt,aS as gt,aT as vt,h as Rs,aA as Ps,az as Es,af as Ls,cQ as Fs,cU as Te,aF as zs,cW as Us,aG as bt,aM as Os,a as $s,U as Bs,V as Ks,as as tt,a6 as Et,bT as qs,ay as Qs}from"./index-BoMAXneA.js";import{c as Ys,d as Lt,P as Ws,i as Gs}from"./index-BbAWF7pr.js";import{K as Hs,c as Js}from"./shell-layout-CGkzRaFT.js";import{a as Zs}from"./repository-binding-CNr2LPMh.js";import{w as Xs,A as en}from"./autosend-DuQV6B4V.js";import{s as tn,r as At,i as sn,c as nn,w as on,H as rn}from"./chat-draft-BHST-yi6.js";import{u as an}from"./use-session-runtime-CpMwKgzT.js";import{i as Ft}from"./ArrowRight-CnYYHlO1.js";import{i as zt}from"./ArrowUp-BCekwS2q.js";import{n as Ut}from"./ShoppingBag01-pynIzeB6.js";import{i as it}from"./Check-DviaYRqC.js";import{t as Ye,aJ as Ot,_ as $t,aK as st,f as at,ap as ln,W as Vn,aL as cn,p as Bt,aM as Kt,F as dn,aN as un}from"./agent-icon-B_6FH0Uz.js";import{a as qt}from"./Image01-BtbbYKNf.js";import{g as pn}from"./UserSquare-BTJRtaIW.js";import{i as fn}from"./Upload01-DUQcdNe8.js";import{i as lt}from"./X-CG1Rwygc.js";import{a as ze,b as We,c as Ge,i as hn,k as mn,l as xn,m as gn,n as vn,o as bn,p as An,q as yn,f as jn,u as wn,s as kn,d as Sn}from"./chat-context-BWtOXr7z.js";import{m as Cn,z as Nn,o as In,c as Tn}from"./thread-intent-jwtsPwjl.js";import{i as _n}from"./AlertCircle-COM2phwL.js";import{a as Mn}from"./Copy01-DGhRT6_F.js";import{a as nt,b as Vt,d as ct,f as dt,F as Qt}from"./form-DAFWYj3z.js";import{c as Dn,S as Rn,b as Pn,a as En,d as Ln}from"./select-Byi1j6ao.js";import{t as Yt}from"./ChevronUp-Ce6pKXHb.js";import{T as He,a as Je,b as Ze}from"./tooltip-CeoeNj1M.js";import{i as Fn}from"./ArrowLeft-iOn4l4NN.js";import{M as zn,S as Un}from"./usage-stats-DbtVL10W.js";import{c as On,b as $n}from"./tabs-Q7CrIeBS.js";import{d as Bn,h as Kn,c as qn,b as Qn,D as Yn}from"./dialog-DvE9S86C.js";import{e as Ue,f as Wn,c as Gn,g as Hn}from"./use-decopilot-events-D1OP5v8l.js";import{u as Jn}from"./use-deco-credits-B-y2kZSq.js";import{I as Zn}from"./input-DDktxnp0.js";import{T as yt,a as Xn}from"./toggle-group-GMiNZZh7.js";import{s as eo}from"./tool-namespace-DmnQIdtF.js";import{t as to}from"./utils-CVEq3hMx.js";import{u as so}from"./use-open-billing-url-3yzN-4EB.js";import{s as no}from"./XClose-Cdoqobpv.js";import{M as oo,m as ut,g as ro,a as io}from"./decopilot-C6QACVJn.js";import{a as Wt,b as Gt,P as Ht}from"./popover-BWvzuoJ_.js";import{c as ao,b as lo,a as Vo,D as co}from"./drawer-DssTOBB2.js";import{u as Jt}from"./use-mobile-CJPZWspn.js";import{t as uo}from"./Tool01-QgkBq5BT.js";import{c as po,a as fo}from"./use-organization-settings-DIyTCe3C.js";import{u as Zt,c as ho}from"./use-ai-providers-BPqFeqFP.js";import{M as mo}from"./index-D9zdWUMZ.js";import{p as Xt,u as xo,T as go,a as vo,U as bo}from"./input-DFr2U6IG.js";import{d as Ao,g as jt,s as yo}from"./gateway-client-CNzWELcp.js";import{u as jo}from"./use-mcp-client-ChBjWRzH.js";import{l as wo,g as ko}from"./use-mcp-prompts-CHequI-u.js";import{i as So}from"./Link01-BBaUvzFn.js";import{s as wt}from"./Plus-B8RVFJSA.js";import"./suggestion-DHfhmHYU.js";import{p as Co,q as No}from"./question-004-sINsf4GQ.js";import{A as Io}from"./avatar-0NvVLvVw.js";import{u as To}from"./use-members-BJ_I50_V.js";import{F as kt}from"./feature-paywall-DHb2Ym0V.js";import{A as _o}from"./add-connection-dialog-Sao5zKq7.js";import{b as Mo}from"./use-chat-layout-state-CorrUKdo.js";import{u as Do}from"./use-is-desktop-app-BNujXJc_.js";const Ro=Le("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 Po=Le("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 Eo=Le("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 Lo=Le("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 Fo=Le("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",Ka=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"},Uo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Oo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:c,variant:u,onClose:d}=t,p=u===void 0?"default":u,f=B(),[m,h]=L.useState(c),[x,v]=L.useState(!1);let g;e[0]!==d?(g=()=>{v(!0),d?.()},e[0]=d,e[1]=g):g=e[1];const b=g;if(x)return null;const A=Uo[p],j=zo[p];let w;e[2]!==A||e[3]!==j?(w=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]=w):w=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>h($o),e[5]=y):y=e[5];const k=m&&"rounded-b-none",C=!m&&"rounded-b-xl";let S;e[6]!==k||e[7]!==C?(S=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",k,C),e[6]=k,e[7]=C,e[8]=S):S=e[8];const I=Oo[p];let N;e[9]!==I?(N=O("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let T;e[11]!==s||e[12]!==N?(T=n.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=T):T=e[13];let _;e[14]!==o?(_=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=_):_=e[15];let P;e[16]!==r?(P=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=P):P=e[17];const E=m?"rotate(180deg)":"rotate(0deg)";let M;e[18]!==E?(M=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Yt,{size:16,style:{transform:E,transition:`transform 180ms ${et}`}})}),e[18]=E,e[19]=M):M=e[19];let F;e[20]!==f?(F=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=F):F=e[21];let U;e[22]!==f?(U=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=U):U=e[23];let Y,$;e[24]!==b?(Y=le=>{le.stopPropagation(),b()},$=le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),le.stopPropagation(),b())},e[24]=b,e[25]=Y,e[26]=$):(Y=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(lt,{size:16}),e[27]=z):z=e[27];let Q;e[28]!==F||e[29]!==U||e[30]!==Y||e[31]!==$?(Q=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:U,onClick:Y,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]=F,e[29]=U,e[30]=Y,e[31]=$,e[32]=Q):Q=e[32];let Z;e[33]!==m||e[34]!==T||e[35]!==_||e[36]!==P||e[37]!==M||e[38]!==Q||e[39]!==S?(Z=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":m,onClick:y,className:S,children:[T,_,P,M,Q]}),e[33]=m,e[34]=T,e[35]=_,e[36]=P,e[37]=M,e[38]=Q,e[39]=S,e[40]=Z):Z=e[40];const se=m?"1fr":"0fr";let X;e[41]!==se?(X={display:"grid",gridTemplateRows:se,transition:`grid-template-rows 180ms ${et}`},e[41]=se,e[42]=X):X=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D={overflow:"hidden",minHeight:0},e[43]=D):D=e[43];const K=m?1:0;let H;e[44]!==K?(H={opacity:K,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=K,e[45]=H):H=e[45];let ee;e[46]!==i?(ee=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=ee):ee=e[47];let J;e[48]!==V||e[49]!==i?(J=V?n.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=J):J=e[50];let ie;e[51]!==ee||e[52]!==J?(ie=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ee,J]}),e[51]=ee,e[52]=J,e[53]=ie):ie=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ce;e[57]!==H||e[58]!==ie||e[59]!==G?(ce=n.jsx("div",{style:D,children:n.jsxs("div",{className:"flex flex-col",style:H,children:[ie,G]})}),e[57]=H,e[58]=ie,e[59]=G,e[60]=ce):ce=e[60];let oe;e[61]!==X||e[62]!==ce?(oe=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:X,children:ce}),e[61]=X,e[62]=ce,e[63]=oe):oe=e[63];let fe;return e[64]!==Z||e[65]!==oe||e[66]!==w||e[67]!==p?(fe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:w,children:[Z,oe]}),e[64]=Z,e[65]=oe,e[66]=w,e[67]=p,e[68]=fe):fe=e[68],fe}function $o(t){return!t}const Bo=ae({content:re().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Fe(["pending","in_progress","completed"]),activeForm:re().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),es=ae({todos:Pt(Bo)}),Ko="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.";Cn({description:Ko,inputSchema:Nn(es),execute:async({todos:t})=>({ok:!0,count:t.length})});const qo="tool-todo_write",Qo=new Set(["input-available","output-available"]);function Yo(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==qo||typeof i.state!="string"||!Qo.has(i.state))continue;const a=es.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function ts(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 o="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:o,friendlyName:to(eo(o)),input:s.input})}return e}function ss(t){return t.at(-1)}function ns(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 Wo(t){return t?t.message.startsWith("[CREDITS]"):!1}const Go={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Ho(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&Wo(s))return{...Go,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(w=>w.type==="tool-user_ask").filter(w=>w.state!=="output-available").length,d=V.some(w=>w.type==="tool-suggest_task"&&w.state==="input-available"),p=ns(l),f=ts(V),m=Yo(e),h=r?null:tn(s),x=r?null:In(s),v=!r&&!!s&&!h&&!x,g=f.length>0||r&&i,b=p.length>0,j=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||g||b||d))&&!v;return{isCreditExhausted:!1,planRefusal:x,subscriptionErrorKind:h,hasTodos:m.length>0,showError:v,showWarning:j,hasApprovals:g,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:d,todos:m}}function os(){const t=R.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=ze(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=Ho({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]=V):V=t[5],V}function qa(){const t=os(),e=Ue("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",Jo=`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-BIn1UYeU.js","assets/index-b8fp8LDt.js","assets/index-DFBQfnNq.css","assets/index-DYUG2RXM.js","assets/gateway-client-IjNlqnM5.js","assets/dialog-jyWPb2tC.js","assets/X-CKGbxNhB.js","assets/form-cnyZOBcC.js","assets/label-CD-3KHsU.js","assets/input-Dhqv4uND.js","assets/utils-CVEq3hMx.js","assets/org-file-open-context-De0SRuVZ.js","assets/use-mobile-gFkCJFqu.js","assets/use-panel-navigate-D3FhRJpf.js","assets/thread-route-CwwNa7rG.js","assets/use-project-scope-B0nCeJeZ.js","assets/repository-binding-55R_NO8O.js","assets/use-mcp-client-D71dVc6F.js","assets/auth-Dy0n9IyK.js","assets/tooltip-Bi7JdvkB.js","assets/index-rpTqXmHS.js","assets/shell-layout-CdyVKBx2.js","assets/avatar-CRdtD8pR.js","assets/User01-P9l9chQ8.js","assets/Palette-mWfzFBxF.js","assets/UserSquare-C8CLmWk7.js","assets/agent-icon-BwVu9Y1n.js","assets/AlertCircle-CVtZx7OF.js","assets/Tool01-DAEtx7Sx.js","assets/ArrowUp-DA3O9Q_5.js","assets/ArrowLeft-BCkbM4b4.js","assets/ArrowRight-BBBInn6h.js","assets/ShoppingBag01-CgMyE5tG.js","assets/ZoomOut-C-nvVeIw.js","assets/CheckCircle-BO45x9RP.js","assets/Check-FcxjuFt6.js","assets/ChevronUp-CFC5Ebq0.js","assets/Copy01-C6Pi2Z_V.js","assets/CreditCard01-C5pPfXKY.js","assets/DotsVertical-BLLrg_XP.js","assets/Image01-B1u2Kql2.js","assets/XClose-YtRhiE3L.js","assets/Key01-ClN_3drg.js","assets/Link01-Vtq2lkbp.js","assets/LinkExternal01-F44g-br4.js","assets/Monitor01-DzDXiiSe.js","assets/Sun-BsSXClq1.js","assets/Plus-KRmPLJ6h.js","assets/SearchMd-V0a6RI0u.js","assets/Trash01-Cakv0Q_K.js","assets/Upload01-CTQz1wiD.js","assets/Users01-CNwYnNBC.js","assets/download-app-dialog-C5cTfPYs.js","assets/command-CGF9V6Vl.js","assets/index-OnxdjRP9.js","assets/integration-icon-BqF75Sx2.js","assets/project-icon-DsbzSgwK.js","assets/new-project-dialog-1J2k2mif.js","assets/repository-import-picker-CWfeZJ7D.js","assets/use-navigate-to-agent-CKGWZY5B.js","assets/thread-intent-CRqPosFZ.js","assets/backoff-8mStPHYB.js","assets/task-board-Qc5P6Y-B.js","assets/schema-NHiqAi8o.js","assets/slugify-CEUa2lfQ.js","assets/repository-picker-CuBjKX0n.js","assets/useInfiniteQuery-CzSAJb3p.js","assets/infiniteQueryObserver-gIFPF-Q5.js","assets/collection-search-BnXIXF-r.js","assets/use-debounced-value-B8lQINn7.js","assets/use-organization-settings-DHUs001C.js","assets/use-is-desktop-app-BNujXJc_.js","assets/required-auth-layout-JHtblyUI.js","assets/autosend-VbZkWu24.js","assets/use-org-sso-4TSO8HVM.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-Dm7KATsP.js","assets/use-session-runtime-D4ohi0Ue.js","assets/chat-context-DgElWmma.js","assets/use-decopilot-events-CveMqPsg.js","assets/use-ai-providers-BtMw9gwm.js","assets/location-DBePU4bz.js","assets/select-CMOLfTUd.js","assets/usage-stats-CuEYS-wZ.js","assets/use-copy-COrhGZKC.js","assets/markdown-C2wmhZNE.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/tabs-BcDaFfJS.js","assets/use-deco-credits-B8qqCrVJ.js","assets/toggle-group-JvUFZ5EE.js","assets/tool-namespace-DmnQIdtF.js","assets/use-open-billing-url-PTsUxw4z.js","assets/decopilot-B7MHJNrn.js","assets/checkbox-DY0rH-TX.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-CrMowaoE.js","assets/drawer-CxXWX_ie.js","assets/index-DcP5acbo.js","assets/input-DDkZ4YtM.js","assets/suggestion-C9LFtFjS.js","assets/use-mcp-prompts-5J9nyt1f.js","assets/use-org-fs-BA8EDTNB.js","assets/question-004-sINsf4GQ.js","assets/use-members-DpznZCfa.js","assets/use-org-auth-client-CV7Jx-D7.js","assets/feature-paywall-BptzLvdT.js","assets/plan-ladder-DOpWTd4w.js","assets/add-connection-dialog-4toRZZCj.js","assets/extract-connection-data-D5OmU01k.js","assets/metadata-D72DunRR.js","assets/connection-0cqQcMBd.js","assets/connection-card-CVXElGSe.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-DCQxd4Ep.js","assets/use-connection-Dow_xwpS.js","assets/connection-form-helpers-ktc30XoJ.js","assets/authenticate-and-persist-oauth-B-9NlA8S.js","assets/mcp-oauth-btOLn9Vw.js","assets/collection-tabs-Bky3kPsU.js","assets/badge-bFS7pJ24.js","assets/use-infinite-scroll-D7ld_EUt.js","assets/useSuspenseInfiniteQuery-Bpkp3-ow.js","assets/use-chat-layout-state-CN6yuxIZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aL as Le,c as R,b as B,r as L,l as O,j as n,ao as ae,bM as Pt,ap as re,bL as Fe,B as W,an as bs,am as As,bN as ys,bK as js,x as ke,aU as ws,dL as we,dM as mt,a2 as ks,e as Ss,t as Pe,q as te,X as Se,d as rt,dJ as Cs,Z as Ns,K as Is,m as Ts,I as _s,F as Ms,H as Ds,G as Ae,aR as xt,aS as gt,aT as vt,h as Rs,aA as Ps,az as Es,af as Ls,cQ as Fs,cU as Te,aF as zs,cW as Us,aG as bt,aM as Os,a as $s,U as Bs,V as Ks,as as tt,a6 as Et,bT as qs,ay as Qs}from"./index-b8fp8LDt.js";import{c as Ys,d as Lt,P as Ws,i as Gs}from"./index-DYUG2RXM.js";import{K as Hs,c as Js}from"./shell-layout-CdyVKBx2.js";import{a as Zs}from"./repository-binding-55R_NO8O.js";import{w as Xs,A as en}from"./autosend-VbZkWu24.js";import{s as tn,r as At,i as sn,c as nn,w as on,H as rn}from"./chat-draft-Dm7KATsP.js";import{u as an}from"./use-session-runtime-D4ohi0Ue.js";import{i as Ft}from"./ArrowRight-BBBInn6h.js";import{i as zt}from"./ArrowUp-DA3O9Q_5.js";import{n as Ut}from"./ShoppingBag01-CgMyE5tG.js";import{i as it}from"./Check-FcxjuFt6.js";import{t as Ye,aJ as Ot,_ as $t,aK as st,f as at,ap as ln,W as Vn,aL as cn,p as Bt,aM as Kt,F as dn,aN as un}from"./agent-icon-BwVu9Y1n.js";import{a as qt}from"./Image01-B1u2Kql2.js";import{g as pn}from"./UserSquare-C8CLmWk7.js";import{i as fn}from"./Upload01-CTQz1wiD.js";import{i as lt}from"./X-CKGbxNhB.js";import{a as ze,b as We,c as Ge,i as hn,k as mn,l as xn,m as gn,n as vn,o as bn,p as An,q as yn,f as jn,u as wn,s as kn,d as Sn}from"./chat-context-DgElWmma.js";import{m as Cn,z as Nn,o as In,c as Tn}from"./thread-intent-CRqPosFZ.js";import{i as _n}from"./AlertCircle-CVtZx7OF.js";import{a as Mn}from"./Copy01-C6Pi2Z_V.js";import{a as nt,b as Vt,d as ct,f as dt,F as Qt}from"./form-cnyZOBcC.js";import{c as Dn,S as Rn,b as Pn,a as En,d as Ln}from"./select-CMOLfTUd.js";import{t as Yt}from"./ChevronUp-CFC5Ebq0.js";import{T as He,a as Je,b as Ze}from"./tooltip-Bi7JdvkB.js";import{i as Fn}from"./ArrowLeft-BCkbM4b4.js";import{M as zn,S as Un}from"./usage-stats-CuEYS-wZ.js";import{c as On,b as $n}from"./tabs-BcDaFfJS.js";import{d as Bn,h as Kn,c as qn,b as Qn,D as Yn}from"./dialog-jyWPb2tC.js";import{e as Ue,f as Wn,c as Gn,g as Hn}from"./use-decopilot-events-CveMqPsg.js";import{u as Jn}from"./use-deco-credits-B8qqCrVJ.js";import{I as Zn}from"./input-Dhqv4uND.js";import{T as yt,a as Xn}from"./toggle-group-JvUFZ5EE.js";import{s as eo}from"./tool-namespace-DmnQIdtF.js";import{t as to}from"./utils-CVEq3hMx.js";import{u as so}from"./use-open-billing-url-PTsUxw4z.js";import{s as no}from"./XClose-YtRhiE3L.js";import{M as oo,m as ut,g as ro,a as io}from"./decopilot-B7MHJNrn.js";import{a as Wt,b as Gt,P as Ht}from"./popover-CrMowaoE.js";import{c as ao,b as lo,a as Vo,D as co}from"./drawer-CxXWX_ie.js";import{u as Jt}from"./use-mobile-gFkCJFqu.js";import{t as uo}from"./Tool01-DAEtx7Sx.js";import{c as po,a as fo}from"./use-organization-settings-DHUs001C.js";import{u as Zt,c as ho}from"./use-ai-providers-BtMw9gwm.js";import{M as mo}from"./index-DcP5acbo.js";import{p as Xt,u as xo,T as go,a as vo,U as bo}from"./input-DDkZ4YtM.js";import{d as Ao,g as jt,s as yo}from"./gateway-client-IjNlqnM5.js";import{u as jo}from"./use-mcp-client-D71dVc6F.js";import{l as wo,g as ko}from"./use-mcp-prompts-5J9nyt1f.js";import{i as So}from"./Link01-Vtq2lkbp.js";import{s as wt}from"./Plus-KRmPLJ6h.js";import"./suggestion-C9LFtFjS.js";import{p as Co,q as No}from"./question-004-sINsf4GQ.js";import{A as Io}from"./avatar-CRdtD8pR.js";import{u as To}from"./use-members-DpznZCfa.js";import{F as kt}from"./feature-paywall-BptzLvdT.js";import{A as _o}from"./add-connection-dialog-4toRZZCj.js";import{b as Mo}from"./use-chat-layout-state-CN6yuxIZ.js";import{u as Do}from"./use-is-desktop-app-BNujXJc_.js";const Ro=Le("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 Po=Le("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 Eo=Le("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 Lo=Le("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 Fo=Le("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",Ka=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"},Uo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Oo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:c,variant:u,onClose:d}=t,p=u===void 0?"default":u,f=B(),[m,h]=L.useState(c),[x,v]=L.useState(!1);let g;e[0]!==d?(g=()=>{v(!0),d?.()},e[0]=d,e[1]=g):g=e[1];const b=g;if(x)return null;const A=Uo[p],j=zo[p];let w;e[2]!==A||e[3]!==j?(w=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]=w):w=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>h($o),e[5]=y):y=e[5];const k=m&&"rounded-b-none",C=!m&&"rounded-b-xl";let S;e[6]!==k||e[7]!==C?(S=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",k,C),e[6]=k,e[7]=C,e[8]=S):S=e[8];const I=Oo[p];let N;e[9]!==I?(N=O("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let T;e[11]!==s||e[12]!==N?(T=n.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=T):T=e[13];let _;e[14]!==o?(_=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=_):_=e[15];let P;e[16]!==r?(P=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=P):P=e[17];const E=m?"rotate(180deg)":"rotate(0deg)";let M;e[18]!==E?(M=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Yt,{size:16,style:{transform:E,transition:`transform 180ms ${et}`}})}),e[18]=E,e[19]=M):M=e[19];let F;e[20]!==f?(F=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=F):F=e[21];let U;e[22]!==f?(U=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=U):U=e[23];let Y,$;e[24]!==b?(Y=le=>{le.stopPropagation(),b()},$=le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),le.stopPropagation(),b())},e[24]=b,e[25]=Y,e[26]=$):(Y=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(lt,{size:16}),e[27]=z):z=e[27];let Q;e[28]!==F||e[29]!==U||e[30]!==Y||e[31]!==$?(Q=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:U,onClick:Y,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]=F,e[29]=U,e[30]=Y,e[31]=$,e[32]=Q):Q=e[32];let Z;e[33]!==m||e[34]!==T||e[35]!==_||e[36]!==P||e[37]!==M||e[38]!==Q||e[39]!==S?(Z=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":m,onClick:y,className:S,children:[T,_,P,M,Q]}),e[33]=m,e[34]=T,e[35]=_,e[36]=P,e[37]=M,e[38]=Q,e[39]=S,e[40]=Z):Z=e[40];const se=m?"1fr":"0fr";let X;e[41]!==se?(X={display:"grid",gridTemplateRows:se,transition:`grid-template-rows 180ms ${et}`},e[41]=se,e[42]=X):X=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D={overflow:"hidden",minHeight:0},e[43]=D):D=e[43];const K=m?1:0;let H;e[44]!==K?(H={opacity:K,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=K,e[45]=H):H=e[45];let ee;e[46]!==i?(ee=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=ee):ee=e[47];let J;e[48]!==V||e[49]!==i?(J=V?n.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=J):J=e[50];let ie;e[51]!==ee||e[52]!==J?(ie=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ee,J]}),e[51]=ee,e[52]=J,e[53]=ie):ie=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ce;e[57]!==H||e[58]!==ie||e[59]!==G?(ce=n.jsx("div",{style:D,children:n.jsxs("div",{className:"flex flex-col",style:H,children:[ie,G]})}),e[57]=H,e[58]=ie,e[59]=G,e[60]=ce):ce=e[60];let oe;e[61]!==X||e[62]!==ce?(oe=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:X,children:ce}),e[61]=X,e[62]=ce,e[63]=oe):oe=e[63];let fe;return e[64]!==Z||e[65]!==oe||e[66]!==w||e[67]!==p?(fe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:w,children:[Z,oe]}),e[64]=Z,e[65]=oe,e[66]=w,e[67]=p,e[68]=fe):fe=e[68],fe}function $o(t){return!t}const Bo=ae({content:re().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Fe(["pending","in_progress","completed"]),activeForm:re().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),es=ae({todos:Pt(Bo)}),Ko="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.";Cn({description:Ko,inputSchema:Nn(es),execute:async({todos:t})=>({ok:!0,count:t.length})});const qo="tool-todo_write",Qo=new Set(["input-available","output-available"]);function Yo(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==qo||typeof i.state!="string"||!Qo.has(i.state))continue;const a=es.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function ts(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 o="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:o,friendlyName:to(eo(o)),input:s.input})}return e}function ss(t){return t.at(-1)}function ns(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 Wo(t){return t?t.message.startsWith("[CREDITS]"):!1}const Go={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Ho(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&Wo(s))return{...Go,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(w=>w.type==="tool-user_ask").filter(w=>w.state!=="output-available").length,d=V.some(w=>w.type==="tool-suggest_task"&&w.state==="input-available"),p=ns(l),f=ts(V),m=Yo(e),h=r?null:tn(s),x=r?null:In(s),v=!r&&!!s&&!h&&!x,g=f.length>0||r&&i,b=p.length>0,j=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||g||b||d))&&!v;return{isCreditExhausted:!1,planRefusal:x,subscriptionErrorKind:h,hasTodos:m.length>0,showError:v,showWarning:j,hasApprovals:g,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:d,todos:m}}function os(){const t=R.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=ze(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=Ho({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]=V):V=t[5],V}function qa(){const t=os(),e=Ue("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",Jo=`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 Zo(t){return{...t,content:[{type:"paragraph",content:[Ys({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:Jo}}]})]},...t.content??[]]}}function Xo(t){const e=R.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=B();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let c;e[0]!==V?(c=O("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=c):c=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Fn,{size:14}),e[4]=d):d=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==c||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:c,"aria-label":u,children:d}),e[5]=r,e[6]=l,e[7]=c,e[8]=u,e[9]=p):p=e[9];const f=s+1;let m;e[10]!==a||e[11]!==f||e[12]!==o?(m=a("chat.pagination.counter",{current:f,total:o}),e[10]=a,e[11]=f,e[12]=o,e[13]=m):m=e[13];let h;e[14]!==m?(h=n.jsx("span",{className:"tabular-nums text-xs",children:m}),e[14]=m,e[15]=h):h=e[15];const x=s===o-1,v=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let g;e[16]!==v?(g=O("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=g):g=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=n.jsx(Ft,{size:14}),e[20]=A):A=e[20];let j;e[21]!==i||e[22]!==x||e[23]!==g||e[24]!==b?(j=n.jsx("button",{type:"button",onClick:i,disabled:x,className:g,"aria-label":b,children:A}),e[21]=i,e[22]=x,e[23]=g,e[24]=b,e[25]=j):j=e[25];let w;return e[26]!==j||e[27]!==p||e[28]!==h?(w=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,h,j]}),e[26]=j,e[27]=p,e[28]=h,e[29]=w):w=e[29],w}function rs(t){const e=R.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(Xo,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function er(t){const e=R.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,d=o?s:!r,p=d?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==d||e[1]!==i?(f=()=>{d||i()},e[0]=d,e[1]=i,e[2]=f):f=e[2];const m=d&&"opacity-50 cursor-not-allowed";let h;e[3]!==m?(h=O("h-7 px-2.5 text-xs",m),e[3]=m,e[4]=h):h=e[4];let x;e[5]!==d||e[6]!==u||e[7]!==f||e[8]!==h?(x=n.jsx(W,{type:"button",size:"sm","aria-disabled":d,onClick:f,className:h,children:u}),e[5]=d,e[6]=u,e[7]=f,e[8]=h,e[9]=x):x=e[9];const v=x;if(!p)return v;let g;e[10]!==v?(g=n.jsx(He,{asChild:!0,children:v}),e[10]=v,e[11]=g):g=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;return e[14]!==g||e[15]!==b?(A=n.jsxs(Ze,{children:[g,b]}),e[14]=g,e[15]=b,e[16]=A):A=e[16],A}function is(t,e,s){return t.findIndex(o=>e(o)===s)}function Ct(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function Nt(t,e,s,o,r){if(t.length===0)return null;const i=is(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function tr(t){return!t.isStreaming&&t.allAnswered}function as(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[c,u]=L.useState(V),[d,p]=L.useState(!1),f=bs({resolver:As(o),defaultValues:r}),m=f.watch(),h=is(e,s,c),x=h>=0?e[h]:void 0,v=a(m[c]),g=Ct(e,s,m,a),b=tr({isStreaming:i,allAnswered:g}),A=()=>{if(h>0){const I=e[h-1];I&&u(s(I))}},j=()=>{if(h>=0&&h<e.length-1){const I=e[h+1];I&&u(s(I))}},w=()=>{const I=f.getValues(),N=Nt(e,s,I,a,c);N&&u(N)},y=()=>{f.handleSubmit(I=>{const N=I;for(const T of e)l(T,N[s(T)])})()},k=L.useRef(y);k.current=y;const C=()=>{b&&(p(!1),k.current())},S=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),k.current()}else{const N=Nt(e,s,I,a,c);N&&u(N)}};return L.useEffect(()=>{if(d&&!i){if(!g){p(!1);return}p(!1),k.current()}},[d,i,g]),{form:f,activeKey:c,setActiveKey:u,currentIndex:h,currentPart:x,isCurrentAnswered:v,isAllAnswered:g,canSubmit:b,goPrev:A,goNext:j,advanceToNextUnanswered:w,submit:C,submitOrAdvance:S}}const ls="chat.approval.defaultDenyReason";function Vs(t){const e=R.c(36),{onYolo:s}=t,o=B(),[r,i]=ke();let a,l,V,c,u,d,p,f,m;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const A=we.find(y=>y.value===r.toolApprovalLevel)??we[0];let j;e[13]!==s||e[14]!==r||e[15]!==i?(j=y=>{const k=y,C=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:k}),k==="auto"&&s(C)},e[13]=s,e[14]=r,e[15]=i,e[16]=j):j=e[16];const w=j;V=Rn,f=r.toolApprovalLevel,m=w,l=Pn,u="xs",d="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=sr,a=En,c=o(A.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=c,e[8]=u,e[9]=d,e[10]=p,e[11]=f,e[12]=m}else a=e[4],l=e[5],V=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],m=e[12];let h;e[17]!==a||e[18]!==c?(h=n.jsx(a,{children:c}),e[17]=a,e[18]=c,e[19]=h):h=e[19];let x;e[20]!==l||e[21]!==u||e[22]!==d||e[23]!==p||e[24]!==h?(x=n.jsx(l,{size:u,className:d,onClick:p,children:h}),e[20]=l,e[21]=u,e[22]=d,e[23]=p,e[24]=h,e[25]=x):x=e[25];let v;e[26]!==o?(v=we.map(A=>n.jsx(Dn,{value:A.value,children:o(A.labelKey)},A.value)),e[26]=o,e[27]=v):v=e[27];let g;e[28]!==v?(g=n.jsx(Ln,{children:v}),e[28]=v,e[29]=g):g=e[29];let b;return e[30]!==V||e[31]!==g||e[32]!==f||e[33]!==m||e[34]!==x?(b=n.jsxs(V,{value:f,onValueChange:m,children:[x,g]}),e[30]=V,e[31]=g,e[32]=f,e[33]=m,e[34]=x,e[35]=b):b=e[35],b}function sr(t){return t.stopPropagation()}function cs(t){const e=R.c(8),{input:s}=t,o=B();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.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=n.jsx("div",{className:"px-4",children:n.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 nr(t){const e=R.c(38),{approval:s,onRespond:o}=t,r=B(),[i]=ke(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(ls),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let c;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(c=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.approvalId||e[10]!==o?(d=C=>o(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=o,e[11]=d):d=e[11];const p=d;let f;e[12]!==p?(f=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(Vs,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const m=f;let h;e[14]!==r?(h=r("chat.approval.denyButton"),e[14]=r,e[15]=h):h=e[15];let x;e[16]!==V||e[17]!==h?(x=n.jsx(W,{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:V,children:h}),e[16]=V,e[17]=h,e[18]=x):x=e[18];let v;e[19]!==r?(v=r("chat.approval.acceptButton"),e[19]=r,e[20]=v):v=e[20];let g;e[21]!==u||e[22]!==v?(g=n.jsx(W,{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]=g):g=e[23];let b;e[24]!==x||e[25]!==g?(b=n.jsxs(n.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=b):b=e[26];const A=b;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ye,{size:14}),e[27]=j):j=e[27];let w;e[28]!==r?(w=r("chat.approval.needsApproval"),e[28]=r,e[29]=w):w=e[29];let y;e[30]!==s.input?(y=n.jsx(cs,{input:s.input}),e[30]=s.input,e[31]=y):y=e[31];let k;return e[32]!==s.friendlyName||e[33]!==m||e[34]!==A||e[35]!==w||e[36]!==y?(k=n.jsx(pe,{icon:j,label:w,title:s.friendlyName,defaultExpanded:!0,footerLeft:m,footerRight:A,children:y}),e[32]=s.friendlyName,e[33]=m,e[34]=A,e[35]=w,e[36]=y,e[37]=k):k=e[37],k}const or=ys(re(),ae({approved:js().optional(),levelOverride:Fe(["auto","readonly"]).optional()}));function rr(t){const e=R.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=B(),[a]=ke(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(lr)),e[0]=s,e[1]=V):V=e[1];const c=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,T)=>{const _=T;typeof _?.approved=="boolean"&&r(N.approvalId,_.approved,_.approved===!1?i(ls):void 0,_.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let d;e[6]!==s||e[7]!==c||e[8]!==o||e[9]!==u?(d={parts:s,partKey:ar,schema:or,defaultValues:c,isStreaming:o,hasAnswer:ir,onSubmit:u},e[6]=s,e[7]=c,e[8]=o,e[9]=u,e[10]=d):d=e[10];const p=as(d);let f;e[11]!==s||e[12]!==p?(f=N=>{p.form.reset(Object.fromEntries(s.map(T=>[T.approvalId,{approved:!0,levelOverride:N}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const m=f,h=p.currentPart,x=p.form;let v;e[14]!==p?(v=N=>{N.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Ye,{size:14}),e[16]=g):g=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=h?.friendlyName??"";let j;e[20]!==m?(j=n.jsx(Vs,{onYolo:m}),e[20]=m,e[21]=j):j=e[21];let w;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==j?(w=n.jsx(rs,{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]=w):w=e[27];let y;e[28]!==h||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(y=h?n.jsx(Vr,{approvalId:h.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=h,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=y):y=e[31];let k;e[32]!==h?(k=h?n.jsx(cs,{input:h.input}):null,e[32]=h,e[33]=k):k=e[33];let C;e[34]!==w||e[35]!==y||e[36]!==k||e[37]!==b||e[38]!==A?(C=n.jsx(pe,{icon:g,label:b,title:A,defaultExpanded:!0,footerLeft:w,footerRight:y,children:k}),e[34]=w,e[35]=y,e[36]=k,e[37]=b,e[38]=A,e[39]=C):C=e[39];let S;e[40]!==C||e[41]!==v?(S=n.jsx("form",{onSubmit:v,children:C}),e[40]=C,e[41]=v,e[42]=S):S=e[42];let I;return e[43]!==p.form||e[44]!==S?(I=n.jsx(nt,{...x,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function ir(t){return typeof t?.approved=="boolean"}function ar(t){return t.approvalId}function lr(t){return[t.approvalId,{approved:void 0}]}function Vr(t){const e=R.c(7),{approvalId:s,control:o,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=c=>{const{field:u}=c,d=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(W,{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")}),n.jsx(W,{type:"button",variant:d?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":d,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(ws,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function cr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ye,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.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,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function dr(t){const e=R.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(cr,{}),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=n.jsx(nr,{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]!==o||e[6]!==r?(i=n.jsx(rr,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function ur(t){const e=R.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=B();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let c;e[5]!==r||e[6]!==V?(c=n.jsx(W,{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:V}),e[5]=r,e[6]=V,e[7]=c):c=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let d;e[10]!==l||e[11]!==u?(d=n.jsx(W,{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]=d):d=e[12];let p;e[13]!==c||e[14]!==d?(p=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=p):p=e[15];const f=p;let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ot,{size:14}),e[16]=m):m=e[16];let h;e[17]!==i?(h=i("chat.proposePlan.planReady"),e[17]=i,e[18]=h):h=e[18];let x;e[19]!==i?(x=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=x):x=e[20];let v;e[21]!==s.plan?(v=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx(zn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=v):v=e[22];let g;return e[23]!==f||e[24]!==v||e[25]!==h||e[26]!==x?(g=n.jsx(pe,{icon:m,label:h,title:x,defaultExpanded:!0,footerRight:f,children:v}),e[23]=f,e[24]=v,e[25]=h,e[26]=x,e[27]=g):g=e[27],g}function pr(t){const e=R.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=ss(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]!==o||e[4]!==r?(l=n.jsx(ur,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function ds(t){return t?"response"in t?t.response:t.option??t.draft:""}const It=ae({response:re().min(1,"Response is required")}),fr=ae({option:re().nullable(),draft:re()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),hr=ae({response:Fe(["yes","no"])});function mr(t){switch(t.type){case"text":return It;case"choice":return fr;case"confirm":return hr;default:return It}}function xr(t){const e={};for(const s of t)e[s.toolCallId]=mr(s.input);return ae(e)}function gr(t){const e=R.c(7),{control:s,name:o,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:c}=V,u=c.value??"";return n.jsxs(Vt,{children:[n.jsx(ct,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx($t,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...c,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"})]})})}),n.jsx(dt,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Qt,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function us(t,e){const s=R.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{const l=a.target.tagName;if(l==="INPUT"||l==="TEXTAREA"||a.metaKey||a.ctrlKey||a.altKey)return;const V=Number.parseInt(a.key,10);V>=1&&V<=t&&(a.preventDefault(),e(V-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),L.useEffect(o,r)}function vr(t){const e=R.c(51),{control:s,name:o,options:r}=t,i=B(),a=`${o}.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:V}=mt(l),c=`${o}.draft`;let u;e[3]!==s||e[4]!==c?(u={control:s,name:c,defaultValue:""},e[3]=s,e[4]=c,e[5]=u):u=e[5];const{field:d}=mt(u),p=V.value,f=d.value??"";let m;if(e[6]!==V||e[7]!==r?(m=E=>{const M=r[E];M!=null&&V.onChange(M)},e[6]=V,e[7]=r,e[8]=m):m=e[8],us(r.length,m),r.length===0)return null;const h=p===null;let x;e[9]!==i?(x=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=x):x=e[10];let v;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let E;e[16]!==V||e[17]!==p||e[18]!==i?(E=(M,F)=>{const U=p===M;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(M),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",U&&"bg-accent/50",!U&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:M}),children:[n.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",U?"bg-chart-1 text-white":"bg-muted text-foreground"),children:F+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:M})]},`${F}-${M}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=E):E=e[19],v=r.map(E),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=v}else v=e[15];const g=h&&"bg-accent/50",b=!h&&"hover:bg-accent/30";let A;e[20]!==g||e[21]!==b?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,b),e[20]=g,e[21]=b,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx($t,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const w=h?f:"";let y;e[24]!==d||e[25]!==V||e[26]!==p?(y=E=>{d.onChange(E.target.value),p!==null&&V.onChange(null)},e[24]=d,e[25]=V,e[26]=p,e[27]=y):y=e[27];let k;e[28]!==V||e[29]!==p?(k=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=k):k=e[30];let C;e[31]!==i?(C=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=C):C=e[32];let S;e[33]!==i?(S=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=S):S=e[34];let I;e[35]!==w||e[36]!==y||e[37]!==k||e[38]!==C||e[39]!==S?(I=n.jsx("input",{type:"text",value:w,onChange:y,onFocus:k,placeholder:C,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=w,e[36]=y,e[37]=k,e[38]=C,e[39]=S,e[40]=I):I=e[40];let N;e[41]!==A||e[42]!==I?(N=n.jsxs("label",{className:A,children:[j,I]}),e[41]=A,e[42]=I,e[43]=N):N=e[43];let T;e[44]!==N||e[45]!==x||e[46]!==v?(T=n.jsx(ct,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[v,N]})}),e[44]=N,e[45]=x,e[46]=v,e[47]=T):T=e[47];let _;e[48]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(dt,{}),e[48]=_):_=e[48];let P;return e[49]!==T?(P=n.jsxs(Vt,{children:[T,_]}),e[49]=T,e[50]=P):P=e[50],P}function br(t){const e=R.c(8),{control:s,name:o}=t,r=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=L.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=d=>{l.current?.onChange(a[d]??"")},e[1]=V):V=e[1],us(a.length,V);let c;e[2]!==r?(c=d=>{const{field:p}=d;return l.current=p,n.jsxs(Vt,{children:[n.jsx(ct,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const m=p.value===f;return n.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",m&&"bg-accent/50",!m&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",m?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),n.jsx(dt,{})]})},e[2]=r,e[3]=c):c=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==c?(u=n.jsx(Qt,{control:s,name:o,render:c}),e[4]=s,e[5]=o,e[6]=c,e[7]=u):u=e[7],u}function Tt(t){const e=R.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(gr,{control:o,name:i,placeholder:s.default}),e[0]=o,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]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(vr,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(br,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Ar(t){const e=R.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=xr(s.map(kr)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(wr)),e[2]=s,e[3]=l):l=e[3];const V=l;let c;e[4]!==r?(c=($,z)=>{const Q=ds(z);Q&&r($,Q)},e[4]=r,e[5]=c):c=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==c?(u={parts:s,partKey:jr,schema:a,defaultValues:V,isStreaming:o,hasAnswer:yr,onSubmit:c},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=c,e[11]=u):u=e[11];const d=as(u),p=d.currentPart,f=B();let m;e[12]!==p||e[13]!==d||e[14]!==f?(m=()=>{const $=p;if(!$)return;const z=f("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(d.form.setValue(`${Q}.option`,null),d.form.setValue(`${Q}.draft`,z)):d.form.setValue(`${Q}.response`,z),d.advanceToNextUnanswered()},e[12]=p,e[13]=d,e[14]=f,e[15]=m):m=e[15];const h=m;let x;e[16]!==d.currentIndex||e[17]!==d.goNext||e[18]!==d.goPrev||e[19]!==s.length?(x=n.jsx(rs,{currentIndex:d.currentIndex,total:s.length,onPrev:d.goPrev,onNext:d.goNext}),e[16]=d.currentIndex,e[17]=d.goNext,e[18]=d.goPrev,e[19]=s.length,e[20]=x):x=e[20];const v=x;let g;e[21]!==f?(g=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=g):g=e[22];let b;e[23]!==h||e[24]!==g?(b=n.jsx(W,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-7",children:g}),e[23]=h,e[24]=g,e[25]=b):b=e[25];let A;e[26]!==d.isAllAnswered||e[27]!==d.isCurrentAnswered||e[28]!==d.submitOrAdvance||e[29]!==o?(A=n.jsx(er,{isStreaming:o,isAllAnswered:d.isAllAnswered,isCurrentAnswered:d.isCurrentAnswered,onAdvanceOrSubmit:d.submitOrAdvance}),e[26]=d.isAllAnswered,e[27]=d.isCurrentAnswered,e[28]=d.submitOrAdvance,e[29]=o,e[30]=A):A=e[30];let j;e[31]!==b||e[32]!==A?(j=n.jsxs(n.Fragment,{children:[b,A]}),e[31]=b,e[32]=A,e[33]=j):j=e[33];const w=j;if(s.length===1){const $=s[0];if(!$?.input)return null;const z=d.form;let Q;e[34]!==d?(Q=ie=>{ie.preventDefault(),d.submit()},e[34]=d,e[35]=Q):Q=e[35];let Z;e[36]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(st,{size:14}),e[36]=Z):Z=e[36];let se;e[37]!==f?(se=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=se):se=e[38];let X;e[39]!==$.input?.prompt||e[40]!==f?(X=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=X):X=e[41];const D=$.input;let K;e[42]!==d.form.control||e[43]!==$.toolCallId||e[44]!==D?(K=n.jsx(Tt,{input:D,control:d.form.control,toolCallId:$.toolCallId}),e[42]=d.form.control,e[43]=$.toolCallId,e[44]=D,e[45]=K):K=e[45];let H;e[46]!==w||e[47]!==se||e[48]!==X||e[49]!==K?(H=n.jsx(pe,{icon:Z,label:se,title:X,defaultExpanded:!0,footerRight:w,children:K}),e[46]=w,e[47]=se,e[48]=X,e[49]=K,e[50]=H):H=e[50];let ee;e[51]!==Q||e[52]!==H?(ee=n.jsx("form",{onSubmit:Q,autoComplete:"off",children:H}),e[51]=Q,e[52]=H,e[53]=ee):ee=e[53];let J;return e[54]!==d.form||e[55]!==ee?(J=n.jsx(nt,{...z,children:ee}),e[54]=d.form,e[55]=ee,e[56]=J):J=e[56],J}const y=d.form;let k;e[57]!==d?(k=$=>{$.preventDefault(),d.submit()},e[57]=d,e[58]=k):k=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(st,{size:14}),e[59]=C):C=e[59];let S;e[60]!==f?(S=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=S):S=e[61];const I=d.currentIndex+1;let N;e[62]!==s.length||e[63]!==f||e[64]!==I?(N=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=N):N=e[65];let T;e[66]!==p?.input?.prompt||e[67]!==f?(T=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=T):T=e[68];const _=d.activeKey,P=d.setActiveKey;let E;if(e[69]!==d.form||e[70]!==s){let $;e[72]!==d.form?($=z=>n.jsx(On,{value:z.toolCallId,className:"mt-0",children:n.jsx(Tt,{input:z.input,control:d.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=d.form,e[73]=$):$=e[73],E=s.map($),e[69]=d.form,e[70]=s,e[71]=E}else E=e[71];let M;e[74]!==d.activeKey||e[75]!==d.setActiveKey||e[76]!==E?(M=n.jsx($n,{value:_,onValueChange:P,children:E}),e[74]=d.activeKey,e[75]=d.setActiveKey,e[76]=E,e[77]=M):M=e[77];let F;e[78]!==v||e[79]!==w||e[80]!==S||e[81]!==N||e[82]!==T||e[83]!==M?(F=n.jsx(pe,{icon:C,label:S,count:N,title:T,defaultExpanded:!0,footerLeft:v,footerRight:w,children:M}),e[78]=v,e[79]=w,e[80]=S,e[81]=N,e[82]=T,e[83]=M,e[84]=F):F=e[84];let U;e[85]!==k||e[86]!==F?(U=n.jsx("form",{onSubmit:k,autoComplete:"off",children:F}),e[85]=k,e[86]=F,e[87]=U):U=e[87];let Y;return e[88]!==d.form||e[89]!==U?(Y=n.jsx(nt,{...y,children:U}),e[88]=d.form,e[89]=U,e[90]=Y):Y=e[90],Y}function yr(t){return!!ds(t)}function jr(t){return t.toolCallId}function wr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function kr(t){return{toolCallId:t.toolCallId,input:t.input}}function Sr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.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,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function ps(t){const e=R.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Cr),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Sr,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(Ar,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Cr(t){return t.state==="input-available"}function Nr(t){const e=R.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=B();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ot,{size:14}),e[2]=c):c=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const d=V.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 m;e[10]!==o||e[11]!==p||e[12]!==f?(m=n.jsx(W,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:f}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13];let h;e[14]!==r||e[15]!==l?(h=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=h):h=e[16];let x;e[17]!==i?(x=i("chat.suggestTask.create"),e[17]=i,e[18]=x):x=e[18];let v;e[19]!==o||e[20]!==h||e[21]!==x?(v=n.jsx(W,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:h,children:x}),e[19]=o,e[20]=h,e[21]=x,e[22]=v):v=e[22];let g;e[23]!==v||e[24]!==m?(g=n.jsxs(n.Fragment,{children:[m,v]}),e[23]=v,e[24]=m,e[25]=g):g=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let A;return e[28]!==V.title||e[29]!==g||e[30]!==b||e[31]!==u?(A=n.jsx(pe,{icon:c,label:u,title:d,defaultExpanded:!0,footerRight:g,children:b}),e[28]=V.title,e[29]=g,e[30]=b,e[31]=u,e[32]=A):A=e[32],A}function Ir(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Tr(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=Ir(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Rr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(_r),e[4]=s,e[5]=V):V=e[5];let c;e[6]!==V?(c=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=c):c=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==c?(u=n.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:c}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=c,e[12]=u):u=e[12],u}function _r(t,e){return n.jsx(Mr,{todo:t},e)}function Mr(t){const e=R.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(Dr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=O("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const c=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let d;e[4]!==c||e[5]!==u?(d=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:c,transition:u}}),e[4]=c,e[5]=u,e[6]=d):d=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==d?(p=n.jsxs("span",{className:V,children:[i,d]}),e[7]=i,e[8]=V,e[9]=d,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=n.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 Dr(t){const e=R.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.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]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Rr(t){const e=R.c(13),{status:s}=t,o=B();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.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:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==a?(V=n.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]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.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]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.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 Pr={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"}]},Er={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Lr(t){const e=R.c(46),{source:s,onDone:o}=t,r=B(),i=ks(),[a]=ke(),[l,V]=L.useState(a.language==="pt-BR"?"brl":"usd"),[c,u]=L.useState(""),[d,p]=L.useState(!1),f=l==="brl"?"R$":"$";let m;e[0]!==l||e[1]!==i?(m=async M=>{const{url:F}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:M,currency:l});return F},e[0]=l,e[1]=i,e[2]=m):m=e[2];let h;e[3]!==o?(h=M=>{M&&window.open(M,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=h):h=e[4];let x;e[5]!==r?(x=M=>{Pe.error(r("credits.topUp.failed",{message:M.message}))},e[5]=r,e[6]=x):x=e[6];let v;e[7]!==m||e[8]!==h||e[9]!==x?(v={mutationFn:m,onSuccess:h,onError:x},e[7]=m,e[8]=h,e[9]=x,e[10]=v):v=e[10];const{mutate:g,isPending:b}=Ss(v);let A;e[11]!==l||e[12]!==s||e[13]!==g?(A=(M,F)=>{te("credits_topup_clicked",{amount_cents:M,currency:l,tier_label:F,source:s}),g(M)},e[11]=l,e[12]=s,e[13]=g,e[14]=A):A=e[14];const j=A,w=parseFloat(c),y=!isNaN(w)&&w>=1;let k,C,S;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=M=>{M&&V(M)},C=n.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=n.jsx(yt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=k,e[16]=C,e[17]=S):(k=e[15],C=e[16],S=e[17]);let I;e[18]!==l?(I=n.jsx("div",{className:"mb-4",children:n.jsxs(Xn,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:k,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=Pr[l];let T;if(e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==N){let M;e[26]!==j||e[27]!==f||e[28]!==b||e[29]!==r?(M=F=>{const{dollars:U,labelKey:Y}=F;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>j(U*100,Er[Y]??"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:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,U]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(Y)})]},U)},e[26]=j,e[27]=f,e[28]=b,e[29]=r,e[30]=M):M=e[30],T=N.map(M),e[20]=j,e[21]=f,e[22]=b,e[23]=r,e[24]=N,e[25]=T}else T=e[25];let _;e[31]!==T?(_=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:T}),e[31]=T,e[32]=_):_=e[32];let P;e[33]!==j||e[34]!==f||e[35]!==c||e[36]!==w||e[37]!==y||e[38]!==b||e[39]!==d||e[40]!==r?(P=d?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),n.jsx(Zn,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:c,onChange:M=>u(M.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(W,{className:"h-10",disabled:!y||b,onClick:()=>j(Math.round(w*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.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]=c,e[36]=w,e[37]=y,e[38]=b,e[39]=d,e[40]=r,e[41]=P):P=e[41];let E;return e[42]!==_||e[43]!==P||e[44]!==I?(E=n.jsxs("div",{children:[I,_,P]}),e[42]=_,e[43]=P,e[44]=I,e[45]=E):E=e[45],E}const Fr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function zr(t){const e=R.c(47),{onDismiss:s}=t,{org:o}=Se(),r=rt(),{decoKeyId:i}=Jn(),a=B(),l=Ue("credits");let V,c;if(e[0]!==o.id?(V=()=>{te("credits_exhausted_shown",{organization_id:o.id})},c=[o.id],e[0]=o.id,e[1]=V,e[2]=c):(V=e[1],c=e[2]),L.useEffect(V,c),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=["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]=d):d=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:d.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=n.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 m;e[8]!==a?(m=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx(Bn,{className:"text-xl font-semibold tracking-tight",children:m}),e[10]=m,e[11]=h):h=e[11];let x;e[12]!==a?(x=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=x):x=e[13];let v;e[14]!==x?(v=n.jsx(Kn,{className:"mt-1.5 text-sm leading-relaxed",children:x}),e[14]=x,e[15]=v):v=e[15];let g;e[16]!==v||e[17]!==h?(g=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(qn,{className:"relative gap-4",children:[f,n.jsxs("div",{children:[h,v]})]})]}),e[16]=v,e[17]=h,e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"rounded-xl border border-border p-5",children:n.jsx(Lr,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Fr.map(N=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(it,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(N)})]},N))})]}),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=n.jsx(W,{variant:"ghost",size:"sm",onClick:s,children:A}),e[25]=s,e[26]=A,e[27]=j):j=e[27];let w;e[28]!==r||e[29]!==s||e[30]!==o.slug?(w=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=w):w=e[31];let y;e[32]!==a?(y=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=y):y=e[33];let k;e[34]!==w||e[35]!==y?(k=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:w,children:y}),e[34]=w,e[35]=y,e[36]=k):k=e[36];let C;e[37]!==j||e[38]!==k?(C=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,k]}),e[37]=j,e[38]=k,e[39]=C):C=e[39];let S;e[40]!==g||e[41]!==b||e[42]!==C?(S=n.jsxs(Qn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ur,children:[g,b,C]}),e[40]=g,e[41]=b,e[42]=C,e[43]=S):S=e[43];let I;return e[44]!==S||e[45]!==u?(I=n.jsx(Yn,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function Ur(t){return t.preventDefault()}const Or={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 $r(t){const e=R.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=B(),{label:a,title:l}=Or[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(at,{size:14}),e[0]=V):V=e[0];let c;e[1]!==a||e[2]!==i?(c=i(a),e[1]=a,e[2]=i,e[3]=c):c=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 d;e[7]!==s||e[8]!==r||e[9]!==i?(d=s==="trial_exhausted"?n.jsx(W,{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]=d):d=e[10];let p;return e[11]!==o||e[12]!==c||e[13]!==u||e[14]!==d?(p=n.jsx(pe,{icon:V,label:c,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:d}),e[11]=o,e[12]=c,e[13]=u,e[14]=d,e[15]=p):p=e[15],p}const Br={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:o}=t,r=B(),i=rt(),{org:a}=Se(),{label:l,title:V}=Br[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(at,{size:14}),e[0]=c):c=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 d;e[4]!==r||e[5]!==V?(d=r(V),e[4]=r,e[5]=V,e[6]=d):d=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,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 m;e[13]!==p||e[14]!==f?(m=n.jsx(W,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=m):m=e[15];let h;return e[16]!==o||e[17]!==u||e[18]!==d||e[19]!==m?(h=n.jsx(pe,{icon:c,label:u,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:m}),e[16]=o,e[17]=u,e[18]=d,e[19]=m,e[20]=h):h=e[20],h}function fs(t){const e=Kr(t);if(e!==null){const c=fs(e);return{summary:c.summary,rawDetails:c.rawDetails??t}}const s=t.trim(),o=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,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const c=V[1]?.trim().replace(/\.$/,"");return{summary:c?`Your sandbox didn't finish starting up (${c}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||o&&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}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Kr(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:o,message:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const qr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=R.c(29),s=B(),{variant:o,onDismiss:r}=t,i=o==="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,V=i?_n:Ns;let c;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(c=t.variant==="error"?t.error.message:(()=>{const g=qr[t.finishReason];return g?s(g):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=c):c=e[7];const u=c;let d;e[8]!==i||e[9]!==u?(d=i?fs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=d):d=e[10];const{summary:p,rawDetails:f}=d;let m;e[11]!==V?(m=n.jsx(V,{size:14}),e[11]=V,e[12]=m):m=e[12];let h;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(h=i?n.jsx(W,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(W,{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]=h):h=e[17];let x;e[18]!==f||e[19]!==s?(x=f?n.jsxs("details",{className:"group mx-4",children:[n.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:[n.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:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Pe.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Pe.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:n.jsx(Mn,{className:"size-3.5"})}),n.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]=x):x=e[20];let v;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==m||e[25]!==h||e[26]!==x||e[27]!==o?(v=n.jsx(pe,{icon:m,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:h,children:x}),e[21]=l,e[22]=r,e[23]=p,e[24]=m,e[25]=h,e[26]=x,e[27]=o,e[28]=v):v=e[28],v}function Oe(t){const e=R.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=B(),{error:V,clearError:c,finishReason:u,clearFinishReason:d,messages:p,isStreaming:f,submit:m,sendMessage:h}=ze(),[x,v]=ke(),{virtualMcpId:g,createTaskWithMessage:b}=We(),{chatMode:A,simpleModeTier:j}=Ge(),w=Ue("credits"),{mutate:y}=so("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let k;e[2]!==y?(k=()=>y(),e[2]=y,e[3]=k):k=e[3];const C=k;let S;e[4]!==A||e[5]!==j||e[6]!==g||e[7]!==a?(S=ne=>({...a?{voiceMode:!0}:{},tier:j,mode:A,toolApprovalLevel:ne,agent:g?{id:g}:void 0}),e[4]=A,e[5]=j,e[6]=g,e[7]=a,e[8]=S):S=e[8];const I=S;let N;e[9]!==x.toolApprovalLevel?(N=x.toolApprovalLevel??Cs(),e[9]=x.toolApprovalLevel,e[10]=N):N=e[10];const T=N,_=p.at(-1),P=_?.role==="assistant"?_.parts:[],E=P.filter(Hr),M=P.filter(Gr),F=ns(P),U=ts(P);let Y;e[11]!==V||e[12]!==h||e[13]!==l?(Y=()=>{if(V){const ue={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};h(ue)}},e[11]=V,e[12]=h,e[13]=l,e[14]=Y):Y=e[14];const $=Y;let z;e[15]!==h||e[16]!==l?(z=()=>{const ne={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};h(ne)},e[15]=h,e[16]=l,e[17]=z):z=e[17];const Q=z;let Z;e[18]!==I||e[19]!==T||e[20]!==m?(Z=(ne,ue)=>{m({kind:"toolOutput",toolCallId:ne.toolCallId,output:{response:ue}},I(T))},e[18]=I,e[19]=T,e[20]=m,e[21]=Z):Z=e[21];const se=Z;let X;e[22]!==I||e[23]!==T||e[24]!==m?(X=(ne,ue)=>{m({kind:"toolOutput",toolCallId:ne.toolCallId,output:{accepted:ue}},I(T))},e[22]=I,e[23]=T,e[24]=m,e[25]=X):X=e[25];const D=X;let K;e[26]!==b||e[27]!==x||e[28]!==v||e[29]!==l||e[30]!==g?(K=ne=>{v({...x,toolApprovalLevel:"auto"}),b({virtualMcpId:g,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:ne})}]}})},e[26]=b,e[27]=x,e[28]=v,e[29]=l,e[30]=g,e[31]=K):K=e[31];const H=K,ee=Wr;let J;e[32]!==I||e[33]!==m?(J=(ne,ue,Be,be)=>{m({kind:"approval",approvalId:ne,approved:ue,...Be?{reason:Be}:{}},I(be))},e[32]=I,e[33]=m,e[34]=J):J=e[34];const ie=J,G=os();if(G.isCreditExhausted){let ne;return e[35]!==w||e[36]!==c||e[37]!==i?(ne=w?n.jsx(zr,{onDismiss:c}):n.jsx("div",{className:O(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:c})}),e[35]=w,e[36]=c,e[37]=i,e[38]=ne):ne=e[38],ne}const{showError:ce,showWarning:oe,hasApprovals:fe}=G,le=E.map(Yr).join("|"),$e=ss(F)?.toolCallId??"",ft=U.map(Qr).join("|"),Ce=!i&&"absolute bottom-full left-0 right-0";let Ve;e[39]!==Ce?(Ve=O(Ce),e[39]=Ce,e[40]=Ve):Ve=e[40];let he;e[41]!==G.todos?(he=n.jsx(Tr,{todos:G.todos}),e[41]=G.todos,e[42]=he):he=e[42];let xe;e[43]!==c||e[44]!==G.subscriptionErrorKind||e[45]!==C?(xe=G.subscriptionErrorKind&&n.jsx($r,{kind:G.subscriptionErrorKind,onDismiss:c,onSubscribe:C}),e[43]=c,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=xe):xe=e[46];let de;e[47]!==c||e[48]!==G.planRefusal?(de=G.planRefusal&&n.jsx(_t,{kind:G.planRefusal,onDismiss:c}),e[47]=c,e[48]=G.planRefusal,e[49]=de):de=e[49];let ge;e[50]!==c||e[51]!==V||e[52]!==$||e[53]!==ce?(ge=ce&&n.jsx(Qe,{variant:"error",error:V,onDismiss:c,onFixInChat:$}),e[50]=c,e[51]=V,e[52]=$,e[53]=ce,e[54]=ge):ge=e[54];let ye;e[55]!==d||e[56]!==u||e[57]!==Q||e[58]!==oe?(ye=oe&&n.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:d,onContinue:Q}),e[55]=d,e[56]=u,e[57]=Q,e[58]=oe,e[59]=ye):ye=e[59];const Ne=fe&&n.jsx(dr,{approvals:U,isStreaming:f,onRespond:ie},ft),_e=G.hasPlans&&n.jsx(pr,{plans:F,isStreaming:f,onApprove:H,onDismiss:ee},$e),Me=G.hasTaskSuggestion&&n.jsx(Nr,{parts:M,isStreaming:f,onRespond:D},M.at(-1)?.toolCallId??"");let ve;e[60]!==G.isWaitingForUserInput||e[61]!==se||e[62]!==f||e[63]!==le||e[64]!==E?(ve=G.isWaitingForUserInput&&n.jsx(ps,{userAskParts:E,isStreaming:f,onSubmit:se},le),e[60]=G.isWaitingForUserInput,e[61]=se,e[62]=f,e[63]=le,e[64]=E,e[65]=ve):ve=e[65];let je;return e[66]!==Ve||e[67]!==he||e[68]!==xe||e[69]!==de||e[70]!==ge||e[71]!==ye||e[72]!==Ne||e[73]!==_e||e[74]!==Me||e[75]!==ve?(je=n.jsxs("div",{className:Ve,children:[he,xe,de,ge,ye,Ne,_e,Me,ve]}),e[66]=Ve,e[67]=he,e[68]=xe,e[69]=de,e[70]=ge,e[71]=ye,e[72]=Ne,e[73]=_e,e[74]=Me,e[75]=ve,e[76]=je):je=e[76],je}function Qr(t){return t.approvalId}function Yr(t){return t.toolCallId}function Wr(){document.querySelector("[data-chat-input]")?.focus()}function Gr(t){return t.type==="tool-suggest_task"&&t.state==="input-available"}function Hr(t){return t.type==="tool-user_ask"}Oe.Error=function(e){return n.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Oe.Warning=function(e){return n.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Oe.UserAskQuestion=ps;function hs(t){const e=R.c(20),{taskId:s}=t,o=B(),r=hn(s),i=mn(r),a=xn(),{stop:l,removeLocalMessage:V}=ze();if(i.length===0)return null;let c;e[0]!==o?(c=o("chat.queueTray.sendNow"),e[0]=o,e[1]=c):c=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(zt,{size:14}),e[4]=d):d=e[4];let p;e[5]!==c||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c,onClick:u,children:d})}),e[5]=c,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==o?(f=o("chat.queueTray.sendNow"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=n.jsxs(Ze,{delayDuration:400,children:[p,m]}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let x;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(x=(v,g)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.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:g+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,v.messageId).then(b=>{b&&(gn(s,v.messageId),V(v.messageId))})},children:n.jsx(no,{className:"size-3.5"})})})]},v.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=x):x=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[n.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:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),h]}),i.map(x)]})}function Jr(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 Zr={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Xr(t){const e=R.c(31),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,onPick:a,onReset:l,onClose:V}=t,c=B(),u=Zt(),d=new Set(u.map(ei)),p=vn([r,o,i],d),f=p?.keyId??null,[m,h]=L.useState(f??u[0]?.id??null),x=u.some(F=>F.id===m)?m:f??u[0]?.id??null,v=x?u.find(F=>F.id===x):null,g="flex h-[70vh] max-h-[460px] w-full flex-col",b=Zr[s];let A;e[0]!==c||e[1]!==b?(A=c(b),e[0]=c,e[1]=b,e[2]=A):A=e[2];let j;e[3]!==A?(j=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=j):j=e[4];let w;e[5]!==l||e[6]!==c||e[7]!==r?(w=r&&n.jsx("button",{type:"button",onClick:l,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:c("chat.modelPreferences.reset")}),e[5]=l,e[6]=c,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==j||e[10]!==w?(y=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[j,w]}),e[9]=j,e[10]=w,e[11]=y):y=e[11];const k="flex-1 min-h-0",C=L.Suspense;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(oo,{}),e[12]=S):S=e[12];const I=mo,N=!0,T=Jr(f?p:null,v?.providerId??"deco");let _;e[13]!==x||e[14]!==a||e[15]!==h?(_=F=>{const U=F.keyId??x??"";h(U),a({keyId:U,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=a,e[15]=h,e[16]=_):_=e[16];let P;e[17]!==I||e[18]!==x||e[19]!==V||e[20]!==h||e[21]!==T||e[22]!==_?(P=n.jsx(I,{compact:N,onClose:V,credentialId:x,onCredentialChange:h,selectedModel:T,onModelChange:_}),e[17]=I,e[18]=x,e[19]=V,e[20]=h,e[21]=T,e[22]=_,e[23]=P):P=e[23];let E;e[24]!==C||e[25]!==P||e[26]!==S?(E=n.jsx("div",{className:k,children:n.jsx(C,{fallback:S,children:P})}),e[24]=C,e[25]=P,e[26]=S,e[27]=E):E=e[27];let M;return e[28]!==E||e[29]!==y?(M=n.jsxs("div",{className:g,children:[y,E]}),e[28]=E,e[29]=y,e[30]=M):M=e[30],M}function ei(t){return t.id}const ti=["fast","smart","thinking"];function ms(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 si(t){const e=R.c(28),{tier:s,pillIcon:o,groups:r}=t,i=B();let a;e[0]!==i?(a=ms(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,c]=L.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=k=>{k.onSelect(),c(!1)},e[2]=u):u=e[2];const d=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 m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=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]=m):m=e[4];const h=l[s];let x;e[5]!==h?(x=n.jsx("span",{className:m,children:h}),e[5]=h,e[6]=x):x=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Yt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=v):v=e[7];let g;e[8]!==o||e[9]!==p||e[10]!==x?(g=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(Wt,{asChild:!0,children:n.jsxs(W,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[o,x,v]})})})}),e[8]=o,e[9]=p,e[10]=x,e[11]=g):g=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;e[14]!==g||e[15]!==b?(A=n.jsxs(Ze,{children:[g,b]}),e[14]=g,e[15]=b,e[16]=A):A=e[16];let j;if(e[17]!==r||e[18]!==i){let k;e[20]!==i?(k=C=>n.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>d(S),className:O("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",S.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[S.icon&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(it,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&n.jsx(oi,{label:S.title,render:S.modelOverride})]},S.key))},C.key),e[20]=i,e[21]=k):k=e[21],j=r.map(k),e[17]=r,e[18]=i,e[19]=j}else j=e[19];let w;e[22]!==j?(w=n.jsx(Gt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:ni,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=w):w=e[23];let y;return e[24]!==V||e[25]!==A||e[26]!==w?(y=n.jsxs(Ht,{open:V,onOpenChange:c,children:[A,w]}),e[24]=V,e[25]=A,e[26]=w,e[27]=y):y=e[27],y}function ni(t){return t.preventDefault()}function oi(t){const e=R.c(38),{label:s,render:o}=t,r=B(),i=Jt(),[a,l]=L.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const c=V;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 d=a&&"opacity-100";let p;e[4]!==d?(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",d),e[4]=d,e[5]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Vn,{size:14}),e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==p?(m=n.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=m):m=e[9];const h=m;if(i){let A;e[10]!==h?(A=n.jsx(ao,{asChild:!0,children:h}),e[10]=h,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 w;e[15]!==j?(w=n.jsx(lo,{className:"sr-only",children:j}),e[15]=j,e[16]=w):w=e[16];let y;e[17]!==a||e[18]!==o?(y=a&&o(c),e[17]=a,e[18]=o,e[19]=y):y=e[19];let k;e[20]!==y||e[21]!==w?(k=n.jsxs(Vo,{className:"p-0 flex flex-col max-h-[95vh]",children:[w,y]}),e[20]=y,e[21]=w,e[22]=k):k=e[22];let C;return e[23]!==a||e[24]!==k||e[25]!==A?(C=n.jsxs(co,{open:a,onOpenChange:l,children:[A,k]}),e[23]=a,e[24]=k,e[25]=A,e[26]=C):C=e[26],C}let x;e[27]!==h?(x=n.jsx(Wt,{asChild:!0,children:h}),e[27]=h,e[28]=x):x=e[28];let v;e[29]!==a||e[30]!==o?(v=a&&o(c),e[29]=a,e[30]=o,e[31]=v):v=e[31];let g;e[32]!==v?(g=n.jsx(Gt,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:v}),e[32]=v,e[33]=g):g=e[33];let b;return e[34]!==a||e[35]!==x||e[36]!==g?(b=n.jsxs(Ht,{open:a,onOpenChange:l,children:[x,g]}),e[34]=a,e[35]=x,e[36]=g,e[37]=b):b=e[37],b}function Dt(t){return t==="fast"?n.jsx(at,{size:16}):t==="thinking"?n.jsx(ln,{size:16}):n.jsx(uo,{size:16})}function ri(t){const e=R.c(13),s=yn();let o;e[0]!==t||e[1]!==s.tiers?(o=c=>{const u=s.tiers[c];return u?u.title??u.modelId:t.chat[c]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;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 V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function ii(){const t=R.c(23),e=B(),{simpleModeTier:s,setSimpleModeTier:o}=Ge(),r=po(),i=Zt(),a=ho(i),l=ri(a),{data:V,error:c}=bn();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const d=u,p=An(),f=Ue("model_choice"),m=Wn(),h=Gn();if(!m||!f)return null;let x,v;if(t[2]!==a||t[3]!==h||t[4]!==r||t[5]!==o||t[6]!==e||t[7]!==s||t[8]!==l||t[9]!==p||t[10]!==d||t[11]!==c){const w=ms(e);x="decopilot",v=ti.map(y=>{const k=l[y],C=d.tiers[y];return{key:`decopilot-${y}`,icon:Dt(y),title:w[y],subtitle:h?k??e(Mt[y]):e(Mt[y]),active:s===y,onSelect:()=>o(y),modelOverride:h?S=>n.jsxs(n.Fragment,{children:[c&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(Xr,{tier:y,orgSlot:r.tiers[y],userSlot:C,autoSlot:a.chat[y],onClose:S,onPick:I=>p.mutate({tier:y,slot:I}),onReset:()=>p.mutate({tier:y,slot:null})},`${y}:${C?.keyId??"org"}:${C?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=h,t[4]=r,t[5]=o,t[6]=e,t[7]=s,t[8]=l,t[9]=p,t[10]=d,t[11]=c,t[12]=x,t[13]=v}else x=t[12],v=t[13];let g;t[14]!==x||t[15]!==v?(g=[{key:x,rows:v}],t[14]=x,t[15]=v,t[16]=g):g=t[16];const b=g;let A;t[17]!==s?(A=Dt(s),t[17]=s,t[18]=A):A=t[18];let j;return t[19]!==b||t[20]!==A||t[21]!==s?(j=n.jsx(si,{tier:s,pillIcon:A,groups:b}),t[19]=b,t[20]=A,t[21]=s,t[22]=j):j=t[22],j}function xs(t){const e=R.c(3),[s]=ke();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&Co(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const ai={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"},li=Hs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Vi=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function ci(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:Vi.map(di)}),t[0]=e):e=t[0],e}function di(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function ui({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,V]=L.useState(!1),c=xs(ai),{org:u}=Se(),{editor:d}=Lt(),p=L.useRef(null),f=ut(o),m=()=>{!f||r||(V(!1),p.current?.click())},h=async D=>{const K=D.target.files;if(!K||K.length===0||!d)return;const H=Array.from(K);try{let ee=d.state.selection.from;for(const J of H)await Xt(d,o??null,J,ee,i,a),ee=d.state.selection.to}finally{p.current&&(p.current.value="")}},x=jo({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Is.virtualMcpPrompts(s,u.id),{data:g,isLoading:b}=Ts({queryKey:v,queryFn:()=>wo(x),staleTime:6e4,enabled:l&&!!x}),A=g?.prompts??[],[j,w]=L.useState(null),{chatMode:y,setChatMode:k}=Ge(),[C,S]=ke(),I=we.find(D=>D.value===C.toolApprovalLevel)??we[0],N=a(I.shortKey),T=D=>{const K=we.find(H=>H.value===D);if(K){if(K.value===C.toolApprovalLevel){V(!1);return}c(),te("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:K.value,source:"tools_popover"}),S({...C,toolApprovalLevel:K.value}),V(!1)}},_=y==="plan",P=()=>{c();const D=_?"default":"plan";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),k(D),V(!1)},E=()=>{e(),V(!1)},M=async(D,K)=>{if(!d||!x)return;const H=jt(D._meta),ee={from:d.state.selection.from,to:d.state.selection.to};try{const J=await ko(x,D.name,K);Gs(d,ee,{id:D.name,name:yo(D.name,H),metadata:J.messages,char:"/",kind:"prompt",args:K})}catch{Pe.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async D=>{V(!1);const K=!!(D.arguments&&D.arguments.length>0);if(te("chat_prompt_inserted",{prompt_name:D.name,with_arguments:K}),K){w(D);return}await M(D)},U=async D=>{j&&(await M(j,D),w(null))},Y=()=>{c();const D=y==="gen-image"?"default":"gen-image";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),k(D),V(!1)},$=()=>{c();const D=y==="web-search"?"default":"web-search";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),k(D),V(!1)},z=()=>{c();const D=y==="deep-research"?"default":"deep-research";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),k(D),V(!1)},Q=y==="gen-image",Z=y==="web-search",se=y==="deep-research",X=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:ro(o??null),className:"hidden",onChange:h,disabled:r});return n.jsxs(n.Fragment,{children:[X,n.jsxs(_s,{open:l,onOpenChange:D=>{D&&!l&&te("chat_tools_popover_opened",{chat_mode:y}),V(D)},children:[n.jsx(Ms,{asChild:!0,children:n.jsxs(W,{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:[n.jsx(cn,{size:14}),n.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")})]})}),n.jsxs(Ds,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?n.jsxs(Ae,{onClick:m,disabled:r,children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(Ae,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:D=>D.preventDefault(),children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(Ae,{onClick:P,className:O(_&&"text-special"),children:[n.jsx(Ut,{size:16,className:O(_&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:O("text-xs text-muted-foreground",_&&"text-special font-medium"),children:li})]}),n.jsxs(Ae,{onClick:Y,className:O(Q&&"text-special"),children:[n.jsx(qt,{size:16,className:O(Q&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),Q&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:$,className:O(Z&&"text-special"),children:[n.jsx(Bt,{size:16,className:O(Z&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),Z&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:z,className:O(se&&"text-special"),children:[n.jsx(Kt,{size:16,className:O(se&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),se&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(xt,{children:[n.jsxs(gt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),n.jsx(vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Rs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):A.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):A.map(D=>n.jsxs(Ae,{onClick:()=>F(D),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:D.title||Ao(D.name,jt(D._meta))}),D.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:D.description})]},D.name))})]}),n.jsxs(xt,{children:[n.jsxs(gt,{className:"gap-2",children:[n.jsx(Ye,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:N})]}),n.jsx(vt,{className:"w-48 p-1.5",children:n.jsx(Ps,{value:C.toolApprovalLevel,onValueChange:T,children:we.map(D=>n.jsx(Es,{value:D.value,children:a(D.labelKey)},D.value))})})]}),n.jsxs(Ae,{onClick:E,children:[n.jsx(So,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(L.Suspense,{children:n.jsx(ci,{})})]})]})]}),n.jsx(Ws,{prompt:j,setPrompt:w,onSubmit:U})]})}const pi=[{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 fi(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:pi.map(hi)}),t[0]=e):e=t[0],e}function hi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function mi(t){const e=R.c(10),{onClick:s}=t,o=B();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]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.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,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(fi,{}),V=n.jsx(Ls,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let c;return e[7]!==s||e[8]!==a?(c=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=c):c=e[9],c}const Re=48;function xi(){const t=R.c(9),[e,s]=L.useState("idle"),[o,r]=L.useState(""),[i,a]=L.useState(""),[l,V]=L.useState(bi),c=L.useRef(null),u=L.useRef(null),d=L.useRef(null),p=L.useRef(null),f=L.useRef(0),m=L.useRef(!1),h=L.useRef(""),x=L.useRef(""),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(vi),p.current?.getTracks().forEach(gi),d.current=null,u.current=null,p.current=null},t[0]=g):g=t[0];const b=g;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=N=>{p.current=N;const T=new AudioContext;u.current=T;const _=T.createMediaStreamSource(N),P=T.createAnalyser();P.fftSize=128,P.smoothingTimeConstant=.8,_.connect(P),d.current=P;const E=new Uint8Array(P.frequencyBinCount),M=()=>{if(!d.current)return;d.current.getByteFrequencyData(E);const F=[];for(let U=0;U<Re;U++){const Y=Math.floor(U/Re*E.length);F.push(Math.max(.04,(E[Y]??0)/255))}V(F),f.current=requestAnimationFrame(M)};M()};A=async()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N)return s("unsupported"),"unsupported";let T;try{T=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),x.current="",h.current="",m.current=!0,s("recording"),I(T);const _=new N;c.current=_,_.interimResults=!0,_.continuous=!0,_.lang=navigator.language||"en-US",_.onresult=P=>{if(c.current!==_)return;let E="",M="";for(let F=P.resultIndex;F<P.results.length;F++){const U=P.results[F],Y=U?.[0]?.transcript??"";U?.isFinal?M=M+Y:E=E+Y}M&&(h.current=h.current+M,r(h.current)),x.current=E,a(E)},_.onerror=P=>{c.current===_&&P.error!=="no-speech"&&(m.current=!1,c.current=null,b(),s(P.error==="not-allowed"?"permission-denied":"idle"))},_.onend=()=>{if(c.current===_&&m.current)try{_.start()}catch{}};try{_.start()}catch{return m.current=!1,c.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{m.current=!1,c.current?.stop(),b(),s("idle"),V(Array(Re).fill(.05)),a("");const I=(h.current+(x.current?" "+x.current:"")).trim();return r(""),h.current="",x.current="",I},t[2]=w):w=t[2];const y=w;let k;t[3]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{m.current=!1,c.current?.abort(),b(),s("idle"),r(""),a(""),V(Array(Re).fill(.05)),h.current="",x.current=""},t[3]=k):k=t[3];const C=k;let S;return t[4]!==i||t[5]!==e||t[6]!==o||t[7]!==l?(S={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:v,startRecording:j,stopRecording:y,cancelRecording:C},t[4]=i,t[5]=e,t[6]=o,t[7]=l,t[8]=S):S=t[8],S}function gi(t){return t.stop()}function vi(){}function bi(){return Array(Re).fill(.05)}function Ai(t){const e=R.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(yi),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=r):r=e[3],r}function yi(t,e){return n.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 Ee=12e3,Rt=ae({token:re(),expiresAt:zs()});Us("provider",[ae({provider:Te("elevenlabs"),conversationToken:re().min(1)}),ae({provider:Te("openai"),transport:Te("webrtc")})]);const ji=Fs([Rt.extend({provider:Te("elevenlabs").default("elevenlabs"),conversationToken:re().min(1)}),Rt.extend({provider:Te("openai"),transport:Te("webrtc")})]);ae({token:re().min(1).max(4096),text:re().trim().min(1).max(Ee)});const gs=ae({request:re().trim().min(1).max(Ee)}),ot=5e3;Pt(ae({role:Fe(["user","agent"]),text:re().min(1).max(ot)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=ot,{message:"Voice transcript is too long"});function Qa(t){const e=[];let s=ot;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}ae({token:re().min(1).max(4096),sdp:re().min(1).max(1e5),language:Fe(["en","pt"]).default("en")}).strict();const wi=ae({sdp:re().min(1).max(1e5)});async function ki(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-7cNaZnyJ.js");return{startOpenAIConversation:V}},__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]));return l(r,s,o)}const{Conversation:i}=await bt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=gs.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.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 o.aborted&&(await a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const V=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(V):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
9
|
+
The report follows.`;function Zo(t){return{...t,content:[{type:"paragraph",content:[Ys({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:Jo}}]})]},...t.content??[]]}}function Xo(t){const e=R.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=B();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let c;e[0]!==V?(c=O("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=c):c=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Fn,{size:14}),e[4]=d):d=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==c||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:c,"aria-label":u,children:d}),e[5]=r,e[6]=l,e[7]=c,e[8]=u,e[9]=p):p=e[9];const f=s+1;let m;e[10]!==a||e[11]!==f||e[12]!==o?(m=a("chat.pagination.counter",{current:f,total:o}),e[10]=a,e[11]=f,e[12]=o,e[13]=m):m=e[13];let h;e[14]!==m?(h=n.jsx("span",{className:"tabular-nums text-xs",children:m}),e[14]=m,e[15]=h):h=e[15];const x=s===o-1,v=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let g;e[16]!==v?(g=O("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=g):g=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=n.jsx(Ft,{size:14}),e[20]=A):A=e[20];let j;e[21]!==i||e[22]!==x||e[23]!==g||e[24]!==b?(j=n.jsx("button",{type:"button",onClick:i,disabled:x,className:g,"aria-label":b,children:A}),e[21]=i,e[22]=x,e[23]=g,e[24]=b,e[25]=j):j=e[25];let w;return e[26]!==j||e[27]!==p||e[28]!==h?(w=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,h,j]}),e[26]=j,e[27]=p,e[28]=h,e[29]=w):w=e[29],w}function rs(t){const e=R.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(Xo,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function er(t){const e=R.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,d=o?s:!r,p=d?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==d||e[1]!==i?(f=()=>{d||i()},e[0]=d,e[1]=i,e[2]=f):f=e[2];const m=d&&"opacity-50 cursor-not-allowed";let h;e[3]!==m?(h=O("h-7 px-2.5 text-xs",m),e[3]=m,e[4]=h):h=e[4];let x;e[5]!==d||e[6]!==u||e[7]!==f||e[8]!==h?(x=n.jsx(W,{type:"button",size:"sm","aria-disabled":d,onClick:f,className:h,children:u}),e[5]=d,e[6]=u,e[7]=f,e[8]=h,e[9]=x):x=e[9];const v=x;if(!p)return v;let g;e[10]!==v?(g=n.jsx(He,{asChild:!0,children:v}),e[10]=v,e[11]=g):g=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;return e[14]!==g||e[15]!==b?(A=n.jsxs(Ze,{children:[g,b]}),e[14]=g,e[15]=b,e[16]=A):A=e[16],A}function is(t,e,s){return t.findIndex(o=>e(o)===s)}function Ct(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function Nt(t,e,s,o,r){if(t.length===0)return null;const i=is(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function tr(t){return!t.isStreaming&&t.allAnswered}function as(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[c,u]=L.useState(V),[d,p]=L.useState(!1),f=bs({resolver:As(o),defaultValues:r}),m=f.watch(),h=is(e,s,c),x=h>=0?e[h]:void 0,v=a(m[c]),g=Ct(e,s,m,a),b=tr({isStreaming:i,allAnswered:g}),A=()=>{if(h>0){const I=e[h-1];I&&u(s(I))}},j=()=>{if(h>=0&&h<e.length-1){const I=e[h+1];I&&u(s(I))}},w=()=>{const I=f.getValues(),N=Nt(e,s,I,a,c);N&&u(N)},y=()=>{f.handleSubmit(I=>{const N=I;for(const T of e)l(T,N[s(T)])})()},k=L.useRef(y);k.current=y;const C=()=>{b&&(p(!1),k.current())},S=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),k.current()}else{const N=Nt(e,s,I,a,c);N&&u(N)}};return L.useEffect(()=>{if(d&&!i){if(!g){p(!1);return}p(!1),k.current()}},[d,i,g]),{form:f,activeKey:c,setActiveKey:u,currentIndex:h,currentPart:x,isCurrentAnswered:v,isAllAnswered:g,canSubmit:b,goPrev:A,goNext:j,advanceToNextUnanswered:w,submit:C,submitOrAdvance:S}}const ls="chat.approval.defaultDenyReason";function Vs(t){const e=R.c(36),{onYolo:s}=t,o=B(),[r,i]=ke();let a,l,V,c,u,d,p,f,m;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const A=we.find(y=>y.value===r.toolApprovalLevel)??we[0];let j;e[13]!==s||e[14]!==r||e[15]!==i?(j=y=>{const k=y,C=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:k}),k==="auto"&&s(C)},e[13]=s,e[14]=r,e[15]=i,e[16]=j):j=e[16];const w=j;V=Rn,f=r.toolApprovalLevel,m=w,l=Pn,u="xs",d="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=sr,a=En,c=o(A.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=c,e[8]=u,e[9]=d,e[10]=p,e[11]=f,e[12]=m}else a=e[4],l=e[5],V=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],m=e[12];let h;e[17]!==a||e[18]!==c?(h=n.jsx(a,{children:c}),e[17]=a,e[18]=c,e[19]=h):h=e[19];let x;e[20]!==l||e[21]!==u||e[22]!==d||e[23]!==p||e[24]!==h?(x=n.jsx(l,{size:u,className:d,onClick:p,children:h}),e[20]=l,e[21]=u,e[22]=d,e[23]=p,e[24]=h,e[25]=x):x=e[25];let v;e[26]!==o?(v=we.map(A=>n.jsx(Dn,{value:A.value,children:o(A.labelKey)},A.value)),e[26]=o,e[27]=v):v=e[27];let g;e[28]!==v?(g=n.jsx(Ln,{children:v}),e[28]=v,e[29]=g):g=e[29];let b;return e[30]!==V||e[31]!==g||e[32]!==f||e[33]!==m||e[34]!==x?(b=n.jsxs(V,{value:f,onValueChange:m,children:[x,g]}),e[30]=V,e[31]=g,e[32]=f,e[33]=m,e[34]=x,e[35]=b):b=e[35],b}function sr(t){return t.stopPropagation()}function cs(t){const e=R.c(8),{input:s}=t,o=B();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.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=n.jsx("div",{className:"px-4",children:n.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 nr(t){const e=R.c(38),{approval:s,onRespond:o}=t,r=B(),[i]=ke(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(ls),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let c;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(c=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.approvalId||e[10]!==o?(d=C=>o(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=o,e[11]=d):d=e[11];const p=d;let f;e[12]!==p?(f=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(Vs,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const m=f;let h;e[14]!==r?(h=r("chat.approval.denyButton"),e[14]=r,e[15]=h):h=e[15];let x;e[16]!==V||e[17]!==h?(x=n.jsx(W,{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:V,children:h}),e[16]=V,e[17]=h,e[18]=x):x=e[18];let v;e[19]!==r?(v=r("chat.approval.acceptButton"),e[19]=r,e[20]=v):v=e[20];let g;e[21]!==u||e[22]!==v?(g=n.jsx(W,{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]=g):g=e[23];let b;e[24]!==x||e[25]!==g?(b=n.jsxs(n.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=b):b=e[26];const A=b;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ye,{size:14}),e[27]=j):j=e[27];let w;e[28]!==r?(w=r("chat.approval.needsApproval"),e[28]=r,e[29]=w):w=e[29];let y;e[30]!==s.input?(y=n.jsx(cs,{input:s.input}),e[30]=s.input,e[31]=y):y=e[31];let k;return e[32]!==s.friendlyName||e[33]!==m||e[34]!==A||e[35]!==w||e[36]!==y?(k=n.jsx(pe,{icon:j,label:w,title:s.friendlyName,defaultExpanded:!0,footerLeft:m,footerRight:A,children:y}),e[32]=s.friendlyName,e[33]=m,e[34]=A,e[35]=w,e[36]=y,e[37]=k):k=e[37],k}const or=ys(re(),ae({approved:js().optional(),levelOverride:Fe(["auto","readonly"]).optional()}));function rr(t){const e=R.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=B(),[a]=ke(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(lr)),e[0]=s,e[1]=V):V=e[1];const c=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,T)=>{const _=T;typeof _?.approved=="boolean"&&r(N.approvalId,_.approved,_.approved===!1?i(ls):void 0,_.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let d;e[6]!==s||e[7]!==c||e[8]!==o||e[9]!==u?(d={parts:s,partKey:ar,schema:or,defaultValues:c,isStreaming:o,hasAnswer:ir,onSubmit:u},e[6]=s,e[7]=c,e[8]=o,e[9]=u,e[10]=d):d=e[10];const p=as(d);let f;e[11]!==s||e[12]!==p?(f=N=>{p.form.reset(Object.fromEntries(s.map(T=>[T.approvalId,{approved:!0,levelOverride:N}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const m=f,h=p.currentPart,x=p.form;let v;e[14]!==p?(v=N=>{N.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Ye,{size:14}),e[16]=g):g=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=h?.friendlyName??"";let j;e[20]!==m?(j=n.jsx(Vs,{onYolo:m}),e[20]=m,e[21]=j):j=e[21];let w;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==j?(w=n.jsx(rs,{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]=w):w=e[27];let y;e[28]!==h||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(y=h?n.jsx(Vr,{approvalId:h.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=h,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=y):y=e[31];let k;e[32]!==h?(k=h?n.jsx(cs,{input:h.input}):null,e[32]=h,e[33]=k):k=e[33];let C;e[34]!==w||e[35]!==y||e[36]!==k||e[37]!==b||e[38]!==A?(C=n.jsx(pe,{icon:g,label:b,title:A,defaultExpanded:!0,footerLeft:w,footerRight:y,children:k}),e[34]=w,e[35]=y,e[36]=k,e[37]=b,e[38]=A,e[39]=C):C=e[39];let S;e[40]!==C||e[41]!==v?(S=n.jsx("form",{onSubmit:v,children:C}),e[40]=C,e[41]=v,e[42]=S):S=e[42];let I;return e[43]!==p.form||e[44]!==S?(I=n.jsx(nt,{...x,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function ir(t){return typeof t?.approved=="boolean"}function ar(t){return t.approvalId}function lr(t){return[t.approvalId,{approved:void 0}]}function Vr(t){const e=R.c(7),{approvalId:s,control:o,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=c=>{const{field:u}=c,d=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(W,{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")}),n.jsx(W,{type:"button",variant:d?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":d,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(ws,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function cr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ye,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.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,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function dr(t){const e=R.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(cr,{}),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=n.jsx(nr,{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]!==o||e[6]!==r?(i=n.jsx(rr,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function ur(t){const e=R.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=B();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let c;e[5]!==r||e[6]!==V?(c=n.jsx(W,{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:V}),e[5]=r,e[6]=V,e[7]=c):c=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let d;e[10]!==l||e[11]!==u?(d=n.jsx(W,{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]=d):d=e[12];let p;e[13]!==c||e[14]!==d?(p=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=p):p=e[15];const f=p;let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ot,{size:14}),e[16]=m):m=e[16];let h;e[17]!==i?(h=i("chat.proposePlan.planReady"),e[17]=i,e[18]=h):h=e[18];let x;e[19]!==i?(x=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=x):x=e[20];let v;e[21]!==s.plan?(v=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx(zn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=v):v=e[22];let g;return e[23]!==f||e[24]!==v||e[25]!==h||e[26]!==x?(g=n.jsx(pe,{icon:m,label:h,title:x,defaultExpanded:!0,footerRight:f,children:v}),e[23]=f,e[24]=v,e[25]=h,e[26]=x,e[27]=g):g=e[27],g}function pr(t){const e=R.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=ss(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]!==o||e[4]!==r?(l=n.jsx(ur,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function ds(t){return t?"response"in t?t.response:t.option??t.draft:""}const It=ae({response:re().min(1,"Response is required")}),fr=ae({option:re().nullable(),draft:re()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),hr=ae({response:Fe(["yes","no"])});function mr(t){switch(t.type){case"text":return It;case"choice":return fr;case"confirm":return hr;default:return It}}function xr(t){const e={};for(const s of t)e[s.toolCallId]=mr(s.input);return ae(e)}function gr(t){const e=R.c(7),{control:s,name:o,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:c}=V,u=c.value??"";return n.jsxs(Vt,{children:[n.jsx(ct,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx($t,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...c,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"})]})})}),n.jsx(dt,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Qt,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function us(t,e){const s=R.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{const l=a.target.tagName;if(l==="INPUT"||l==="TEXTAREA"||a.metaKey||a.ctrlKey||a.altKey)return;const V=Number.parseInt(a.key,10);V>=1&&V<=t&&(a.preventDefault(),e(V-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),L.useEffect(o,r)}function vr(t){const e=R.c(51),{control:s,name:o,options:r}=t,i=B(),a=`${o}.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:V}=mt(l),c=`${o}.draft`;let u;e[3]!==s||e[4]!==c?(u={control:s,name:c,defaultValue:""},e[3]=s,e[4]=c,e[5]=u):u=e[5];const{field:d}=mt(u),p=V.value,f=d.value??"";let m;if(e[6]!==V||e[7]!==r?(m=E=>{const M=r[E];M!=null&&V.onChange(M)},e[6]=V,e[7]=r,e[8]=m):m=e[8],us(r.length,m),r.length===0)return null;const h=p===null;let x;e[9]!==i?(x=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=x):x=e[10];let v;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let E;e[16]!==V||e[17]!==p||e[18]!==i?(E=(M,F)=>{const U=p===M;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(M),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",U&&"bg-accent/50",!U&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:M}),children:[n.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",U?"bg-chart-1 text-white":"bg-muted text-foreground"),children:F+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:M})]},`${F}-${M}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=E):E=e[19],v=r.map(E),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=v}else v=e[15];const g=h&&"bg-accent/50",b=!h&&"hover:bg-accent/30";let A;e[20]!==g||e[21]!==b?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,b),e[20]=g,e[21]=b,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx($t,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const w=h?f:"";let y;e[24]!==d||e[25]!==V||e[26]!==p?(y=E=>{d.onChange(E.target.value),p!==null&&V.onChange(null)},e[24]=d,e[25]=V,e[26]=p,e[27]=y):y=e[27];let k;e[28]!==V||e[29]!==p?(k=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=k):k=e[30];let C;e[31]!==i?(C=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=C):C=e[32];let S;e[33]!==i?(S=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=S):S=e[34];let I;e[35]!==w||e[36]!==y||e[37]!==k||e[38]!==C||e[39]!==S?(I=n.jsx("input",{type:"text",value:w,onChange:y,onFocus:k,placeholder:C,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=w,e[36]=y,e[37]=k,e[38]=C,e[39]=S,e[40]=I):I=e[40];let N;e[41]!==A||e[42]!==I?(N=n.jsxs("label",{className:A,children:[j,I]}),e[41]=A,e[42]=I,e[43]=N):N=e[43];let T;e[44]!==N||e[45]!==x||e[46]!==v?(T=n.jsx(ct,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[v,N]})}),e[44]=N,e[45]=x,e[46]=v,e[47]=T):T=e[47];let _;e[48]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(dt,{}),e[48]=_):_=e[48];let P;return e[49]!==T?(P=n.jsxs(Vt,{children:[T,_]}),e[49]=T,e[50]=P):P=e[50],P}function br(t){const e=R.c(8),{control:s,name:o}=t,r=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=L.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=d=>{l.current?.onChange(a[d]??"")},e[1]=V):V=e[1],us(a.length,V);let c;e[2]!==r?(c=d=>{const{field:p}=d;return l.current=p,n.jsxs(Vt,{children:[n.jsx(ct,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const m=p.value===f;return n.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",m&&"bg-accent/50",!m&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",m?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),n.jsx(dt,{})]})},e[2]=r,e[3]=c):c=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==c?(u=n.jsx(Qt,{control:s,name:o,render:c}),e[4]=s,e[5]=o,e[6]=c,e[7]=u):u=e[7],u}function Tt(t){const e=R.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(gr,{control:o,name:i,placeholder:s.default}),e[0]=o,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]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(vr,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(br,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Ar(t){const e=R.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=xr(s.map(kr)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(wr)),e[2]=s,e[3]=l):l=e[3];const V=l;let c;e[4]!==r?(c=($,z)=>{const Q=ds(z);Q&&r($,Q)},e[4]=r,e[5]=c):c=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==c?(u={parts:s,partKey:jr,schema:a,defaultValues:V,isStreaming:o,hasAnswer:yr,onSubmit:c},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=c,e[11]=u):u=e[11];const d=as(u),p=d.currentPart,f=B();let m;e[12]!==p||e[13]!==d||e[14]!==f?(m=()=>{const $=p;if(!$)return;const z=f("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(d.form.setValue(`${Q}.option`,null),d.form.setValue(`${Q}.draft`,z)):d.form.setValue(`${Q}.response`,z),d.advanceToNextUnanswered()},e[12]=p,e[13]=d,e[14]=f,e[15]=m):m=e[15];const h=m;let x;e[16]!==d.currentIndex||e[17]!==d.goNext||e[18]!==d.goPrev||e[19]!==s.length?(x=n.jsx(rs,{currentIndex:d.currentIndex,total:s.length,onPrev:d.goPrev,onNext:d.goNext}),e[16]=d.currentIndex,e[17]=d.goNext,e[18]=d.goPrev,e[19]=s.length,e[20]=x):x=e[20];const v=x;let g;e[21]!==f?(g=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=g):g=e[22];let b;e[23]!==h||e[24]!==g?(b=n.jsx(W,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-7",children:g}),e[23]=h,e[24]=g,e[25]=b):b=e[25];let A;e[26]!==d.isAllAnswered||e[27]!==d.isCurrentAnswered||e[28]!==d.submitOrAdvance||e[29]!==o?(A=n.jsx(er,{isStreaming:o,isAllAnswered:d.isAllAnswered,isCurrentAnswered:d.isCurrentAnswered,onAdvanceOrSubmit:d.submitOrAdvance}),e[26]=d.isAllAnswered,e[27]=d.isCurrentAnswered,e[28]=d.submitOrAdvance,e[29]=o,e[30]=A):A=e[30];let j;e[31]!==b||e[32]!==A?(j=n.jsxs(n.Fragment,{children:[b,A]}),e[31]=b,e[32]=A,e[33]=j):j=e[33];const w=j;if(s.length===1){const $=s[0];if(!$?.input)return null;const z=d.form;let Q;e[34]!==d?(Q=ie=>{ie.preventDefault(),d.submit()},e[34]=d,e[35]=Q):Q=e[35];let Z;e[36]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(st,{size:14}),e[36]=Z):Z=e[36];let se;e[37]!==f?(se=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=se):se=e[38];let X;e[39]!==$.input?.prompt||e[40]!==f?(X=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=X):X=e[41];const D=$.input;let K;e[42]!==d.form.control||e[43]!==$.toolCallId||e[44]!==D?(K=n.jsx(Tt,{input:D,control:d.form.control,toolCallId:$.toolCallId}),e[42]=d.form.control,e[43]=$.toolCallId,e[44]=D,e[45]=K):K=e[45];let H;e[46]!==w||e[47]!==se||e[48]!==X||e[49]!==K?(H=n.jsx(pe,{icon:Z,label:se,title:X,defaultExpanded:!0,footerRight:w,children:K}),e[46]=w,e[47]=se,e[48]=X,e[49]=K,e[50]=H):H=e[50];let ee;e[51]!==Q||e[52]!==H?(ee=n.jsx("form",{onSubmit:Q,autoComplete:"off",children:H}),e[51]=Q,e[52]=H,e[53]=ee):ee=e[53];let J;return e[54]!==d.form||e[55]!==ee?(J=n.jsx(nt,{...z,children:ee}),e[54]=d.form,e[55]=ee,e[56]=J):J=e[56],J}const y=d.form;let k;e[57]!==d?(k=$=>{$.preventDefault(),d.submit()},e[57]=d,e[58]=k):k=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(st,{size:14}),e[59]=C):C=e[59];let S;e[60]!==f?(S=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=S):S=e[61];const I=d.currentIndex+1;let N;e[62]!==s.length||e[63]!==f||e[64]!==I?(N=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=N):N=e[65];let T;e[66]!==p?.input?.prompt||e[67]!==f?(T=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=T):T=e[68];const _=d.activeKey,P=d.setActiveKey;let E;if(e[69]!==d.form||e[70]!==s){let $;e[72]!==d.form?($=z=>n.jsx(On,{value:z.toolCallId,className:"mt-0",children:n.jsx(Tt,{input:z.input,control:d.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=d.form,e[73]=$):$=e[73],E=s.map($),e[69]=d.form,e[70]=s,e[71]=E}else E=e[71];let M;e[74]!==d.activeKey||e[75]!==d.setActiveKey||e[76]!==E?(M=n.jsx($n,{value:_,onValueChange:P,children:E}),e[74]=d.activeKey,e[75]=d.setActiveKey,e[76]=E,e[77]=M):M=e[77];let F;e[78]!==v||e[79]!==w||e[80]!==S||e[81]!==N||e[82]!==T||e[83]!==M?(F=n.jsx(pe,{icon:C,label:S,count:N,title:T,defaultExpanded:!0,footerLeft:v,footerRight:w,children:M}),e[78]=v,e[79]=w,e[80]=S,e[81]=N,e[82]=T,e[83]=M,e[84]=F):F=e[84];let U;e[85]!==k||e[86]!==F?(U=n.jsx("form",{onSubmit:k,autoComplete:"off",children:F}),e[85]=k,e[86]=F,e[87]=U):U=e[87];let Y;return e[88]!==d.form||e[89]!==U?(Y=n.jsx(nt,{...y,children:U}),e[88]=d.form,e[89]=U,e[90]=Y):Y=e[90],Y}function yr(t){return!!ds(t)}function jr(t){return t.toolCallId}function wr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function kr(t){return{toolCallId:t.toolCallId,input:t.input}}function Sr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.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,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function ps(t){const e=R.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Cr),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Sr,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(Ar,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Cr(t){return t.state==="input-available"}function Nr(t){const e=R.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=B();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ot,{size:14}),e[2]=c):c=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const d=V.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 m;e[10]!==o||e[11]!==p||e[12]!==f?(m=n.jsx(W,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:f}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13];let h;e[14]!==r||e[15]!==l?(h=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=h):h=e[16];let x;e[17]!==i?(x=i("chat.suggestTask.create"),e[17]=i,e[18]=x):x=e[18];let v;e[19]!==o||e[20]!==h||e[21]!==x?(v=n.jsx(W,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:h,children:x}),e[19]=o,e[20]=h,e[21]=x,e[22]=v):v=e[22];let g;e[23]!==v||e[24]!==m?(g=n.jsxs(n.Fragment,{children:[m,v]}),e[23]=v,e[24]=m,e[25]=g):g=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let A;return e[28]!==V.title||e[29]!==g||e[30]!==b||e[31]!==u?(A=n.jsx(pe,{icon:c,label:u,title:d,defaultExpanded:!0,footerRight:g,children:b}),e[28]=V.title,e[29]=g,e[30]=b,e[31]=u,e[32]=A):A=e[32],A}function Ir(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Tr(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=Ir(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Rr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(_r),e[4]=s,e[5]=V):V=e[5];let c;e[6]!==V?(c=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=c):c=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==c?(u=n.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:c}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=c,e[12]=u):u=e[12],u}function _r(t,e){return n.jsx(Mr,{todo:t},e)}function Mr(t){const e=R.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(Dr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=O("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const c=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let d;e[4]!==c||e[5]!==u?(d=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:c,transition:u}}),e[4]=c,e[5]=u,e[6]=d):d=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==d?(p=n.jsxs("span",{className:V,children:[i,d]}),e[7]=i,e[8]=V,e[9]=d,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=n.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 Dr(t){const e=R.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.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]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Rr(t){const e=R.c(13),{status:s}=t,o=B();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.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:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==a?(V=n.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]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.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]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.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 Pr={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"}]},Er={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Lr(t){const e=R.c(46),{source:s,onDone:o}=t,r=B(),i=ks(),[a]=ke(),[l,V]=L.useState(a.language==="pt-BR"?"brl":"usd"),[c,u]=L.useState(""),[d,p]=L.useState(!1),f=l==="brl"?"R$":"$";let m;e[0]!==l||e[1]!==i?(m=async M=>{const{url:F}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:M,currency:l});return F},e[0]=l,e[1]=i,e[2]=m):m=e[2];let h;e[3]!==o?(h=M=>{M&&window.open(M,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=h):h=e[4];let x;e[5]!==r?(x=M=>{Pe.error(r("credits.topUp.failed",{message:M.message}))},e[5]=r,e[6]=x):x=e[6];let v;e[7]!==m||e[8]!==h||e[9]!==x?(v={mutationFn:m,onSuccess:h,onError:x},e[7]=m,e[8]=h,e[9]=x,e[10]=v):v=e[10];const{mutate:g,isPending:b}=Ss(v);let A;e[11]!==l||e[12]!==s||e[13]!==g?(A=(M,F)=>{te("credits_topup_clicked",{amount_cents:M,currency:l,tier_label:F,source:s}),g(M)},e[11]=l,e[12]=s,e[13]=g,e[14]=A):A=e[14];const j=A,w=parseFloat(c),y=!isNaN(w)&&w>=1;let k,C,S;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=M=>{M&&V(M)},C=n.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=n.jsx(yt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=k,e[16]=C,e[17]=S):(k=e[15],C=e[16],S=e[17]);let I;e[18]!==l?(I=n.jsx("div",{className:"mb-4",children:n.jsxs(Xn,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:k,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=Pr[l];let T;if(e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==N){let M;e[26]!==j||e[27]!==f||e[28]!==b||e[29]!==r?(M=F=>{const{dollars:U,labelKey:Y}=F;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>j(U*100,Er[Y]??"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:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,U]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(Y)})]},U)},e[26]=j,e[27]=f,e[28]=b,e[29]=r,e[30]=M):M=e[30],T=N.map(M),e[20]=j,e[21]=f,e[22]=b,e[23]=r,e[24]=N,e[25]=T}else T=e[25];let _;e[31]!==T?(_=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:T}),e[31]=T,e[32]=_):_=e[32];let P;e[33]!==j||e[34]!==f||e[35]!==c||e[36]!==w||e[37]!==y||e[38]!==b||e[39]!==d||e[40]!==r?(P=d?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),n.jsx(Zn,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:c,onChange:M=>u(M.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(W,{className:"h-10",disabled:!y||b,onClick:()=>j(Math.round(w*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.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]=c,e[36]=w,e[37]=y,e[38]=b,e[39]=d,e[40]=r,e[41]=P):P=e[41];let E;return e[42]!==_||e[43]!==P||e[44]!==I?(E=n.jsxs("div",{children:[I,_,P]}),e[42]=_,e[43]=P,e[44]=I,e[45]=E):E=e[45],E}const Fr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function zr(t){const e=R.c(47),{onDismiss:s}=t,{org:o}=Se(),r=rt(),{decoKeyId:i}=Jn(),a=B(),l=Ue("credits");let V,c;if(e[0]!==o.id?(V=()=>{te("credits_exhausted_shown",{organization_id:o.id})},c=[o.id],e[0]=o.id,e[1]=V,e[2]=c):(V=e[1],c=e[2]),L.useEffect(V,c),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=["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]=d):d=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:d.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=n.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 m;e[8]!==a?(m=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx(Bn,{className:"text-xl font-semibold tracking-tight",children:m}),e[10]=m,e[11]=h):h=e[11];let x;e[12]!==a?(x=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=x):x=e[13];let v;e[14]!==x?(v=n.jsx(Kn,{className:"mt-1.5 text-sm leading-relaxed",children:x}),e[14]=x,e[15]=v):v=e[15];let g;e[16]!==v||e[17]!==h?(g=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(qn,{className:"relative gap-4",children:[f,n.jsxs("div",{children:[h,v]})]})]}),e[16]=v,e[17]=h,e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"rounded-xl border border-border p-5",children:n.jsx(Lr,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Fr.map(N=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(it,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(N)})]},N))})]}),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=n.jsx(W,{variant:"ghost",size:"sm",onClick:s,children:A}),e[25]=s,e[26]=A,e[27]=j):j=e[27];let w;e[28]!==r||e[29]!==s||e[30]!==o.slug?(w=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=w):w=e[31];let y;e[32]!==a?(y=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=y):y=e[33];let k;e[34]!==w||e[35]!==y?(k=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:w,children:y}),e[34]=w,e[35]=y,e[36]=k):k=e[36];let C;e[37]!==j||e[38]!==k?(C=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,k]}),e[37]=j,e[38]=k,e[39]=C):C=e[39];let S;e[40]!==g||e[41]!==b||e[42]!==C?(S=n.jsxs(Qn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ur,children:[g,b,C]}),e[40]=g,e[41]=b,e[42]=C,e[43]=S):S=e[43];let I;return e[44]!==S||e[45]!==u?(I=n.jsx(Yn,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function Ur(t){return t.preventDefault()}const Or={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 $r(t){const e=R.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=B(),{label:a,title:l}=Or[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(at,{size:14}),e[0]=V):V=e[0];let c;e[1]!==a||e[2]!==i?(c=i(a),e[1]=a,e[2]=i,e[3]=c):c=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 d;e[7]!==s||e[8]!==r||e[9]!==i?(d=s==="trial_exhausted"?n.jsx(W,{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]=d):d=e[10];let p;return e[11]!==o||e[12]!==c||e[13]!==u||e[14]!==d?(p=n.jsx(pe,{icon:V,label:c,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:d}),e[11]=o,e[12]=c,e[13]=u,e[14]=d,e[15]=p):p=e[15],p}const Br={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:o}=t,r=B(),i=rt(),{org:a}=Se(),{label:l,title:V}=Br[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(at,{size:14}),e[0]=c):c=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 d;e[4]!==r||e[5]!==V?(d=r(V),e[4]=r,e[5]=V,e[6]=d):d=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,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 m;e[13]!==p||e[14]!==f?(m=n.jsx(W,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=m):m=e[15];let h;return e[16]!==o||e[17]!==u||e[18]!==d||e[19]!==m?(h=n.jsx(pe,{icon:c,label:u,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:m}),e[16]=o,e[17]=u,e[18]=d,e[19]=m,e[20]=h):h=e[20],h}function fs(t){const e=Kr(t);if(e!==null){const c=fs(e);return{summary:c.summary,rawDetails:c.rawDetails??t}}const s=t.trim(),o=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,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const c=V[1]?.trim().replace(/\.$/,"");return{summary:c?`Your sandbox didn't finish starting up (${c}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||o&&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}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Kr(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:o,message:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const qr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=R.c(29),s=B(),{variant:o,onDismiss:r}=t,i=o==="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,V=i?_n:Ns;let c;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(c=t.variant==="error"?t.error.message:(()=>{const g=qr[t.finishReason];return g?s(g):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=c):c=e[7];const u=c;let d;e[8]!==i||e[9]!==u?(d=i?fs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=d):d=e[10];const{summary:p,rawDetails:f}=d;let m;e[11]!==V?(m=n.jsx(V,{size:14}),e[11]=V,e[12]=m):m=e[12];let h;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(h=i?n.jsx(W,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(W,{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]=h):h=e[17];let x;e[18]!==f||e[19]!==s?(x=f?n.jsxs("details",{className:"group mx-4",children:[n.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:[n.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:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Pe.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Pe.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:n.jsx(Mn,{className:"size-3.5"})}),n.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]=x):x=e[20];let v;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==m||e[25]!==h||e[26]!==x||e[27]!==o?(v=n.jsx(pe,{icon:m,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:h,children:x}),e[21]=l,e[22]=r,e[23]=p,e[24]=m,e[25]=h,e[26]=x,e[27]=o,e[28]=v):v=e[28],v}function Oe(t){const e=R.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=B(),{error:V,clearError:c,finishReason:u,clearFinishReason:d,messages:p,isStreaming:f,submit:m,sendMessage:h}=ze(),[x,v]=ke(),{virtualMcpId:g,createTaskWithMessage:b}=We(),{chatMode:A,simpleModeTier:j}=Ge(),w=Ue("credits"),{mutate:y}=so("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let k;e[2]!==y?(k=()=>y(),e[2]=y,e[3]=k):k=e[3];const C=k;let S;e[4]!==A||e[5]!==j||e[6]!==g||e[7]!==a?(S=ne=>({...a?{voiceMode:!0}:{},tier:j,mode:A,toolApprovalLevel:ne,agent:g?{id:g}:void 0}),e[4]=A,e[5]=j,e[6]=g,e[7]=a,e[8]=S):S=e[8];const I=S;let N;e[9]!==x.toolApprovalLevel?(N=x.toolApprovalLevel??Cs(),e[9]=x.toolApprovalLevel,e[10]=N):N=e[10];const T=N,_=p.at(-1),P=_?.role==="assistant"?_.parts:[],E=P.filter(Hr),M=P.filter(Gr),F=ns(P),U=ts(P);let Y;e[11]!==V||e[12]!==h||e[13]!==l?(Y=()=>{if(V){const ue={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};h(ue)}},e[11]=V,e[12]=h,e[13]=l,e[14]=Y):Y=e[14];const $=Y;let z;e[15]!==h||e[16]!==l?(z=()=>{const ne={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};h(ne)},e[15]=h,e[16]=l,e[17]=z):z=e[17];const Q=z;let Z;e[18]!==I||e[19]!==T||e[20]!==m?(Z=(ne,ue)=>{m({kind:"toolOutput",toolCallId:ne.toolCallId,output:{response:ue}},I(T))},e[18]=I,e[19]=T,e[20]=m,e[21]=Z):Z=e[21];const se=Z;let X;e[22]!==I||e[23]!==T||e[24]!==m?(X=(ne,ue)=>{m({kind:"toolOutput",toolCallId:ne.toolCallId,output:{accepted:ue}},I(T))},e[22]=I,e[23]=T,e[24]=m,e[25]=X):X=e[25];const D=X;let K;e[26]!==b||e[27]!==x||e[28]!==v||e[29]!==l||e[30]!==g?(K=ne=>{v({...x,toolApprovalLevel:"auto"}),b({virtualMcpId:g,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:ne})}]}})},e[26]=b,e[27]=x,e[28]=v,e[29]=l,e[30]=g,e[31]=K):K=e[31];const H=K,ee=Wr;let J;e[32]!==I||e[33]!==m?(J=(ne,ue,Be,be)=>{m({kind:"approval",approvalId:ne,approved:ue,...Be?{reason:Be}:{}},I(be))},e[32]=I,e[33]=m,e[34]=J):J=e[34];const ie=J,G=os();if(G.isCreditExhausted){let ne;return e[35]!==w||e[36]!==c||e[37]!==i?(ne=w?n.jsx(zr,{onDismiss:c}):n.jsx("div",{className:O(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:c})}),e[35]=w,e[36]=c,e[37]=i,e[38]=ne):ne=e[38],ne}const{showError:ce,showWarning:oe,hasApprovals:fe}=G,le=E.map(Yr).join("|"),$e=ss(F)?.toolCallId??"",ft=U.map(Qr).join("|"),Ce=!i&&"absolute bottom-full left-0 right-0";let Ve;e[39]!==Ce?(Ve=O(Ce),e[39]=Ce,e[40]=Ve):Ve=e[40];let he;e[41]!==G.todos?(he=n.jsx(Tr,{todos:G.todos}),e[41]=G.todos,e[42]=he):he=e[42];let xe;e[43]!==c||e[44]!==G.subscriptionErrorKind||e[45]!==C?(xe=G.subscriptionErrorKind&&n.jsx($r,{kind:G.subscriptionErrorKind,onDismiss:c,onSubscribe:C}),e[43]=c,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=xe):xe=e[46];let de;e[47]!==c||e[48]!==G.planRefusal?(de=G.planRefusal&&n.jsx(_t,{kind:G.planRefusal,onDismiss:c}),e[47]=c,e[48]=G.planRefusal,e[49]=de):de=e[49];let ge;e[50]!==c||e[51]!==V||e[52]!==$||e[53]!==ce?(ge=ce&&n.jsx(Qe,{variant:"error",error:V,onDismiss:c,onFixInChat:$}),e[50]=c,e[51]=V,e[52]=$,e[53]=ce,e[54]=ge):ge=e[54];let ye;e[55]!==d||e[56]!==u||e[57]!==Q||e[58]!==oe?(ye=oe&&n.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:d,onContinue:Q}),e[55]=d,e[56]=u,e[57]=Q,e[58]=oe,e[59]=ye):ye=e[59];const Ne=fe&&n.jsx(dr,{approvals:U,isStreaming:f,onRespond:ie},ft),_e=G.hasPlans&&n.jsx(pr,{plans:F,isStreaming:f,onApprove:H,onDismiss:ee},$e),Me=G.hasTaskSuggestion&&n.jsx(Nr,{parts:M,isStreaming:f,onRespond:D},M.at(-1)?.toolCallId??"");let ve;e[60]!==G.isWaitingForUserInput||e[61]!==se||e[62]!==f||e[63]!==le||e[64]!==E?(ve=G.isWaitingForUserInput&&n.jsx(ps,{userAskParts:E,isStreaming:f,onSubmit:se},le),e[60]=G.isWaitingForUserInput,e[61]=se,e[62]=f,e[63]=le,e[64]=E,e[65]=ve):ve=e[65];let je;return e[66]!==Ve||e[67]!==he||e[68]!==xe||e[69]!==de||e[70]!==ge||e[71]!==ye||e[72]!==Ne||e[73]!==_e||e[74]!==Me||e[75]!==ve?(je=n.jsxs("div",{className:Ve,children:[he,xe,de,ge,ye,Ne,_e,Me,ve]}),e[66]=Ve,e[67]=he,e[68]=xe,e[69]=de,e[70]=ge,e[71]=ye,e[72]=Ne,e[73]=_e,e[74]=Me,e[75]=ve,e[76]=je):je=e[76],je}function Qr(t){return t.approvalId}function Yr(t){return t.toolCallId}function Wr(){document.querySelector("[data-chat-input]")?.focus()}function Gr(t){return t.type==="tool-suggest_task"&&t.state==="input-available"}function Hr(t){return t.type==="tool-user_ask"}Oe.Error=function(e){return n.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Oe.Warning=function(e){return n.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Oe.UserAskQuestion=ps;function hs(t){const e=R.c(20),{taskId:s}=t,o=B(),r=hn(s),i=mn(r),a=xn(),{stop:l,removeLocalMessage:V}=ze();if(i.length===0)return null;let c;e[0]!==o?(c=o("chat.queueTray.sendNow"),e[0]=o,e[1]=c):c=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(zt,{size:14}),e[4]=d):d=e[4];let p;e[5]!==c||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c,onClick:u,children:d})}),e[5]=c,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==o?(f=o("chat.queueTray.sendNow"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=n.jsxs(Ze,{delayDuration:400,children:[p,m]}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let x;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(x=(v,g)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.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:g+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,v.messageId).then(b=>{b&&(gn(s,v.messageId),V(v.messageId))})},children:n.jsx(no,{className:"size-3.5"})})})]},v.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=x):x=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[n.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:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),h]}),i.map(x)]})}function Jr(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 Zr={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Xr(t){const e=R.c(31),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,onPick:a,onReset:l,onClose:V}=t,c=B(),u=Zt(),d=new Set(u.map(ei)),p=vn([r,o,i],d),f=p?.keyId??null,[m,h]=L.useState(f??u[0]?.id??null),x=u.some(F=>F.id===m)?m:f??u[0]?.id??null,v=x?u.find(F=>F.id===x):null,g="flex h-[70vh] max-h-[460px] w-full flex-col",b=Zr[s];let A;e[0]!==c||e[1]!==b?(A=c(b),e[0]=c,e[1]=b,e[2]=A):A=e[2];let j;e[3]!==A?(j=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=j):j=e[4];let w;e[5]!==l||e[6]!==c||e[7]!==r?(w=r&&n.jsx("button",{type:"button",onClick:l,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:c("chat.modelPreferences.reset")}),e[5]=l,e[6]=c,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==j||e[10]!==w?(y=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[j,w]}),e[9]=j,e[10]=w,e[11]=y):y=e[11];const k="flex-1 min-h-0",C=L.Suspense;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(oo,{}),e[12]=S):S=e[12];const I=mo,N=!0,T=Jr(f?p:null,v?.providerId??"deco");let _;e[13]!==x||e[14]!==a||e[15]!==h?(_=F=>{const U=F.keyId??x??"";h(U),a({keyId:U,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=a,e[15]=h,e[16]=_):_=e[16];let P;e[17]!==I||e[18]!==x||e[19]!==V||e[20]!==h||e[21]!==T||e[22]!==_?(P=n.jsx(I,{compact:N,onClose:V,credentialId:x,onCredentialChange:h,selectedModel:T,onModelChange:_}),e[17]=I,e[18]=x,e[19]=V,e[20]=h,e[21]=T,e[22]=_,e[23]=P):P=e[23];let E;e[24]!==C||e[25]!==P||e[26]!==S?(E=n.jsx("div",{className:k,children:n.jsx(C,{fallback:S,children:P})}),e[24]=C,e[25]=P,e[26]=S,e[27]=E):E=e[27];let M;return e[28]!==E||e[29]!==y?(M=n.jsxs("div",{className:g,children:[y,E]}),e[28]=E,e[29]=y,e[30]=M):M=e[30],M}function ei(t){return t.id}const ti=["fast","smart","thinking"];function ms(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 si(t){const e=R.c(28),{tier:s,pillIcon:o,groups:r}=t,i=B();let a;e[0]!==i?(a=ms(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,c]=L.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=k=>{k.onSelect(),c(!1)},e[2]=u):u=e[2];const d=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 m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=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]=m):m=e[4];const h=l[s];let x;e[5]!==h?(x=n.jsx("span",{className:m,children:h}),e[5]=h,e[6]=x):x=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Yt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=v):v=e[7];let g;e[8]!==o||e[9]!==p||e[10]!==x?(g=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(Wt,{asChild:!0,children:n.jsxs(W,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[o,x,v]})})})}),e[8]=o,e[9]=p,e[10]=x,e[11]=g):g=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;e[14]!==g||e[15]!==b?(A=n.jsxs(Ze,{children:[g,b]}),e[14]=g,e[15]=b,e[16]=A):A=e[16];let j;if(e[17]!==r||e[18]!==i){let k;e[20]!==i?(k=C=>n.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>d(S),className:O("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",S.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[S.icon&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(it,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&n.jsx(oi,{label:S.title,render:S.modelOverride})]},S.key))},C.key),e[20]=i,e[21]=k):k=e[21],j=r.map(k),e[17]=r,e[18]=i,e[19]=j}else j=e[19];let w;e[22]!==j?(w=n.jsx(Gt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:ni,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=w):w=e[23];let y;return e[24]!==V||e[25]!==A||e[26]!==w?(y=n.jsxs(Ht,{open:V,onOpenChange:c,children:[A,w]}),e[24]=V,e[25]=A,e[26]=w,e[27]=y):y=e[27],y}function ni(t){return t.preventDefault()}function oi(t){const e=R.c(38),{label:s,render:o}=t,r=B(),i=Jt(),[a,l]=L.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const c=V;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 d=a&&"opacity-100";let p;e[4]!==d?(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",d),e[4]=d,e[5]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Vn,{size:14}),e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==p?(m=n.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=m):m=e[9];const h=m;if(i){let A;e[10]!==h?(A=n.jsx(ao,{asChild:!0,children:h}),e[10]=h,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 w;e[15]!==j?(w=n.jsx(lo,{className:"sr-only",children:j}),e[15]=j,e[16]=w):w=e[16];let y;e[17]!==a||e[18]!==o?(y=a&&o(c),e[17]=a,e[18]=o,e[19]=y):y=e[19];let k;e[20]!==y||e[21]!==w?(k=n.jsxs(Vo,{className:"p-0 flex flex-col max-h-[95vh]",children:[w,y]}),e[20]=y,e[21]=w,e[22]=k):k=e[22];let C;return e[23]!==a||e[24]!==k||e[25]!==A?(C=n.jsxs(co,{open:a,onOpenChange:l,children:[A,k]}),e[23]=a,e[24]=k,e[25]=A,e[26]=C):C=e[26],C}let x;e[27]!==h?(x=n.jsx(Wt,{asChild:!0,children:h}),e[27]=h,e[28]=x):x=e[28];let v;e[29]!==a||e[30]!==o?(v=a&&o(c),e[29]=a,e[30]=o,e[31]=v):v=e[31];let g;e[32]!==v?(g=n.jsx(Gt,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:v}),e[32]=v,e[33]=g):g=e[33];let b;return e[34]!==a||e[35]!==x||e[36]!==g?(b=n.jsxs(Ht,{open:a,onOpenChange:l,children:[x,g]}),e[34]=a,e[35]=x,e[36]=g,e[37]=b):b=e[37],b}function Dt(t){return t==="fast"?n.jsx(at,{size:16}):t==="thinking"?n.jsx(ln,{size:16}):n.jsx(uo,{size:16})}function ri(t){const e=R.c(13),s=yn();let o;e[0]!==t||e[1]!==s.tiers?(o=c=>{const u=s.tiers[c];return u?u.title??u.modelId:t.chat[c]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;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 V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function ii(){const t=R.c(23),e=B(),{simpleModeTier:s,setSimpleModeTier:o}=Ge(),r=po(),i=Zt(),a=ho(i),l=ri(a),{data:V,error:c}=bn();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const d=u,p=An(),f=Ue("model_choice"),m=Wn(),h=Gn();if(!m||!f)return null;let x,v;if(t[2]!==a||t[3]!==h||t[4]!==r||t[5]!==o||t[6]!==e||t[7]!==s||t[8]!==l||t[9]!==p||t[10]!==d||t[11]!==c){const w=ms(e);x="decopilot",v=ti.map(y=>{const k=l[y],C=d.tiers[y];return{key:`decopilot-${y}`,icon:Dt(y),title:w[y],subtitle:h?k??e(Mt[y]):e(Mt[y]),active:s===y,onSelect:()=>o(y),modelOverride:h?S=>n.jsxs(n.Fragment,{children:[c&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(Xr,{tier:y,orgSlot:r.tiers[y],userSlot:C,autoSlot:a.chat[y],onClose:S,onPick:I=>p.mutate({tier:y,slot:I}),onReset:()=>p.mutate({tier:y,slot:null})},`${y}:${C?.keyId??"org"}:${C?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=h,t[4]=r,t[5]=o,t[6]=e,t[7]=s,t[8]=l,t[9]=p,t[10]=d,t[11]=c,t[12]=x,t[13]=v}else x=t[12],v=t[13];let g;t[14]!==x||t[15]!==v?(g=[{key:x,rows:v}],t[14]=x,t[15]=v,t[16]=g):g=t[16];const b=g;let A;t[17]!==s?(A=Dt(s),t[17]=s,t[18]=A):A=t[18];let j;return t[19]!==b||t[20]!==A||t[21]!==s?(j=n.jsx(si,{tier:s,pillIcon:A,groups:b}),t[19]=b,t[20]=A,t[21]=s,t[22]=j):j=t[22],j}function xs(t){const e=R.c(3),[s]=ke();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&Co(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const ai={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"},li=Hs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Vi=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function ci(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:Vi.map(di)}),t[0]=e):e=t[0],e}function di(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function ui({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,V]=L.useState(!1),c=xs(ai),{org:u}=Se(),{editor:d}=Lt(),p=L.useRef(null),f=ut(o),m=()=>{!f||r||(V(!1),p.current?.click())},h=async D=>{const K=D.target.files;if(!K||K.length===0||!d)return;const H=Array.from(K);try{let ee=d.state.selection.from;for(const J of H)await Xt(d,o??null,J,ee,i,a),ee=d.state.selection.to}finally{p.current&&(p.current.value="")}},x=jo({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Is.virtualMcpPrompts(s,u.id),{data:g,isLoading:b}=Ts({queryKey:v,queryFn:()=>wo(x),staleTime:6e4,enabled:l&&!!x}),A=g?.prompts??[],[j,w]=L.useState(null),{chatMode:y,setChatMode:k}=Ge(),[C,S]=ke(),I=we.find(D=>D.value===C.toolApprovalLevel)??we[0],N=a(I.shortKey),T=D=>{const K=we.find(H=>H.value===D);if(K){if(K.value===C.toolApprovalLevel){V(!1);return}c(),te("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:K.value,source:"tools_popover"}),S({...C,toolApprovalLevel:K.value}),V(!1)}},_=y==="plan",P=()=>{c();const D=_?"default":"plan";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),k(D),V(!1)},E=()=>{e(),V(!1)},M=async(D,K)=>{if(!d||!x)return;const H=jt(D._meta),ee={from:d.state.selection.from,to:d.state.selection.to};try{const J=await ko(x,D.name,K);Gs(d,ee,{id:D.name,name:yo(D.name,H),metadata:J.messages,char:"/",kind:"prompt",args:K})}catch{Pe.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async D=>{V(!1);const K=!!(D.arguments&&D.arguments.length>0);if(te("chat_prompt_inserted",{prompt_name:D.name,with_arguments:K}),K){w(D);return}await M(D)},U=async D=>{j&&(await M(j,D),w(null))},Y=()=>{c();const D=y==="gen-image"?"default":"gen-image";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),k(D),V(!1)},$=()=>{c();const D=y==="web-search"?"default":"web-search";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),k(D),V(!1)},z=()=>{c();const D=y==="deep-research"?"default":"deep-research";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),k(D),V(!1)},Q=y==="gen-image",Z=y==="web-search",se=y==="deep-research",X=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:ro(o??null),className:"hidden",onChange:h,disabled:r});return n.jsxs(n.Fragment,{children:[X,n.jsxs(_s,{open:l,onOpenChange:D=>{D&&!l&&te("chat_tools_popover_opened",{chat_mode:y}),V(D)},children:[n.jsx(Ms,{asChild:!0,children:n.jsxs(W,{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:[n.jsx(cn,{size:14}),n.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")})]})}),n.jsxs(Ds,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?n.jsxs(Ae,{onClick:m,disabled:r,children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(Ae,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:D=>D.preventDefault(),children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(Ae,{onClick:P,className:O(_&&"text-special"),children:[n.jsx(Ut,{size:16,className:O(_&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:O("text-xs text-muted-foreground",_&&"text-special font-medium"),children:li})]}),n.jsxs(Ae,{onClick:Y,className:O(Q&&"text-special"),children:[n.jsx(qt,{size:16,className:O(Q&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),Q&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:$,className:O(Z&&"text-special"),children:[n.jsx(Bt,{size:16,className:O(Z&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),Z&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:z,className:O(se&&"text-special"),children:[n.jsx(Kt,{size:16,className:O(se&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),se&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(xt,{children:[n.jsxs(gt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),n.jsx(vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Rs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):A.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):A.map(D=>n.jsxs(Ae,{onClick:()=>F(D),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:D.title||Ao(D.name,jt(D._meta))}),D.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:D.description})]},D.name))})]}),n.jsxs(xt,{children:[n.jsxs(gt,{className:"gap-2",children:[n.jsx(Ye,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:N})]}),n.jsx(vt,{className:"w-48 p-1.5",children:n.jsx(Ps,{value:C.toolApprovalLevel,onValueChange:T,children:we.map(D=>n.jsx(Es,{value:D.value,children:a(D.labelKey)},D.value))})})]}),n.jsxs(Ae,{onClick:E,children:[n.jsx(So,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(L.Suspense,{children:n.jsx(ci,{})})]})]})]}),n.jsx(Ws,{prompt:j,setPrompt:w,onSubmit:U})]})}const pi=[{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 fi(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:pi.map(hi)}),t[0]=e):e=t[0],e}function hi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function mi(t){const e=R.c(10),{onClick:s}=t,o=B();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]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.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,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(fi,{}),V=n.jsx(Ls,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let c;return e[7]!==s||e[8]!==a?(c=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=c):c=e[9],c}const Re=48;function xi(){const t=R.c(9),[e,s]=L.useState("idle"),[o,r]=L.useState(""),[i,a]=L.useState(""),[l,V]=L.useState(bi),c=L.useRef(null),u=L.useRef(null),d=L.useRef(null),p=L.useRef(null),f=L.useRef(0),m=L.useRef(!1),h=L.useRef(""),x=L.useRef(""),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(vi),p.current?.getTracks().forEach(gi),d.current=null,u.current=null,p.current=null},t[0]=g):g=t[0];const b=g;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=N=>{p.current=N;const T=new AudioContext;u.current=T;const _=T.createMediaStreamSource(N),P=T.createAnalyser();P.fftSize=128,P.smoothingTimeConstant=.8,_.connect(P),d.current=P;const E=new Uint8Array(P.frequencyBinCount),M=()=>{if(!d.current)return;d.current.getByteFrequencyData(E);const F=[];for(let U=0;U<Re;U++){const Y=Math.floor(U/Re*E.length);F.push(Math.max(.04,(E[Y]??0)/255))}V(F),f.current=requestAnimationFrame(M)};M()};A=async()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N)return s("unsupported"),"unsupported";let T;try{T=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),x.current="",h.current="",m.current=!0,s("recording"),I(T);const _=new N;c.current=_,_.interimResults=!0,_.continuous=!0,_.lang=navigator.language||"en-US",_.onresult=P=>{if(c.current!==_)return;let E="",M="";for(let F=P.resultIndex;F<P.results.length;F++){const U=P.results[F],Y=U?.[0]?.transcript??"";U?.isFinal?M=M+Y:E=E+Y}M&&(h.current=h.current+M,r(h.current)),x.current=E,a(E)},_.onerror=P=>{c.current===_&&P.error!=="no-speech"&&(m.current=!1,c.current=null,b(),s(P.error==="not-allowed"?"permission-denied":"idle"))},_.onend=()=>{if(c.current===_&&m.current)try{_.start()}catch{}};try{_.start()}catch{return m.current=!1,c.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{m.current=!1,c.current?.stop(),b(),s("idle"),V(Array(Re).fill(.05)),a("");const I=(h.current+(x.current?" "+x.current:"")).trim();return r(""),h.current="",x.current="",I},t[2]=w):w=t[2];const y=w;let k;t[3]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{m.current=!1,c.current?.abort(),b(),s("idle"),r(""),a(""),V(Array(Re).fill(.05)),h.current="",x.current=""},t[3]=k):k=t[3];const C=k;let S;return t[4]!==i||t[5]!==e||t[6]!==o||t[7]!==l?(S={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:v,startRecording:j,stopRecording:y,cancelRecording:C},t[4]=i,t[5]=e,t[6]=o,t[7]=l,t[8]=S):S=t[8],S}function gi(t){return t.stop()}function vi(){}function bi(){return Array(Re).fill(.05)}function Ai(t){const e=R.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(yi),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=r):r=e[3],r}function yi(t,e){return n.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 Ee=12e3,Rt=ae({token:re(),expiresAt:zs()});Us("provider",[ae({provider:Te("elevenlabs"),conversationToken:re().min(1)}),ae({provider:Te("openai"),transport:Te("webrtc")})]);const ji=Fs([Rt.extend({provider:Te("elevenlabs").default("elevenlabs"),conversationToken:re().min(1)}),Rt.extend({provider:Te("openai"),transport:Te("webrtc")})]);ae({token:re().min(1).max(4096),text:re().trim().min(1).max(Ee)});const gs=ae({request:re().trim().min(1).max(Ee)}),ot=5e3;Pt(ae({role:Fe(["user","agent"]),text:re().min(1).max(ot)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=ot,{message:"Voice transcript is too long"});function Qa(t){const e=[];let s=ot;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}ae({token:re().min(1).max(4096),sdp:re().min(1).max(1e5),language:Fe(["en","pt"]).default("en")}).strict();const wi=ae({sdp:re().min(1).max(1e5)});async function ki(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-BIn1UYeU.js");return{startOpenAIConversation:V}},__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]));return l(r,s,o)}const{Conversation:i}=await bt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=gs.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.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 o.aborted&&(await a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const V=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(V):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
10
10
|
${V}
|
|
11
11
|
Briefly report this update. Do not delegate it as new work.`)}}}function Si(t,e){const s=t.findIndex(V=>V.id===e&&V.role==="user");if(s<0)return null;const o=[];for(const V of t.slice(s+1)){if(V.role==="user")break;V.role==="assistant"&&o.push(V)}const r=o.at(-1);if(!r||r.parts.some(V=>"state"in V&&["approval-requested","input-streaming","input-available"].includes(String(V.state))))return null;const i=r.parts.findLast(V=>V.type==="text"||V.type==="dynamic-tool"||V.type.startsWith("tool-"));if(i?.type!=="text")return"";if(i.state==="streaming")return null;const a=i.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(!a)return"";if(a.length<=Ee)return a;const l=a.slice(0,Ee-1);return`${l.slice(0,l.lastIndexOf(" "))}…`}class Ci{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;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,o])=>this.state[s]===o)){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())}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(-8).map(s=>({id:s.messageId,request:s.request.slice(0,2e3),status:s.result!==void 0?"finished":s.accepted?"accepted":"submitting",result:s.result?.slice(0,2e3)}))}}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;this.patch({working:s||[...this.jobs.values()].some(r=>r.accepted&&r.result===void 0)});const o=JSON.stringify({status:this.status().status,requests:[...this.jobs.values()].map(r=>({requestId:r.messageId,status:r.result!==void 0?"finished":r.accepted?"accepted":"submitting"}))});if(o!==this.lastWorkStatus&&(this.lastWorkStatus=o,this.conversation.publishUpdate({delivery:"context",contextId:"studio-work",text:o})),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 r of this.jobs.values()){if(!r.accepted||r.result!==void 0)continue;const i=e.messages.findIndex(V=>V.id===r.messageId);if(i<0)continue;const a=i>=0&&e.messages.slice(i+1).some(V=>V.role==="user");if(s&&!a)continue;let l;!s&&!a&&(e.error||e.status==="error")?l="The agent's run failed. Ask the user to return to the chat for the error details; do not claim completion.":!s&&!a&&e.finishReason&&["error","length","content-filter","aborted"].includes(e.finishReason)?l=`The run ended with status ${e.finishReason}; successful completion is not established.`:l=Si(e.messages,r.messageId),l!==null&&(r.result=l||"The agent finished without a final text response. Do not infer that the requested change succeeded.",this.report(JSON.stringify({requestId:r.messageId,request:r.delegationId?void 0:r.request,result:r.result}),r.delegationId))}this.patch({working:s||[...this.jobs.values()].some(r=>r.accepted&&r.result===void 0)})}report(e,s){const o={text:e,delegationId:s,delivery:"context"};this.conversation?.publishUpdate(o),this.announcements.push({...o,delivery:"announce"})}flushAnnouncements(){if(!(!this.conversation||!this.announcements.length||this.userSpeaking||this.state.phase!=="listening"||Date.now()-this.lastActivity<1800)){this.lastActivity=Date.now();for(const e of this.announcements.splice(0))this.conversation.publishUpdate(e)}}delegate=async e=>{if(this.utterance===0&&!e.delegationId)return{status:"rejected",reason:"Wait for a spoken user request before delegating work."};const s=gs.safeParse(e);if(!s.success)return{status:"rejected",reason:"A complete, non-empty request is required."};if(this.jobs.size>=40)return{status:"rejected",reason:"This voice session has reached its request limit. Continue in the text chat."};const o=s.data.request,r=[...this.jobs.values()].find(V=>e.delegationId?V.delegationId===e.delegationId:V.utterance===this.utterance||V.request===o&&V.result===void 0);if(r)return{status:r.result!==void 0?"finished":r.accepted?"accepted":"submitting",requestId:r.messageId,result:r.result?.slice(0,2e3),note:"This utterance already has a work request; do not submit it again."};const i=this.generation,a={messageId:crypto.randomUUID(),utterance:this.utterance,request:o,accepted:!1,delegationId:e.delegationId};this.jobs.set(a.messageId,a);const l=this.dispatchQueue.then(async()=>i!==this.generation||!this.conversation?!1:this.bindings?.sendVoiceMessage?.(a.messageId,o,e.transcript)??!1);this.dispatchQueue=l.catch(()=>{});try{const V=await l;return i!==this.generation?{status:"disconnected"}:V?(a.accepted=!0,this.collectResults(),{status:"accepted",requestId:a.messageId,note:"Work is running or queued in Studio. Keep conversing. A background event will supply its actual result."}):(this.jobs.delete(a.messageId),{status:"rejected",reason:"Studio did not accept the request. No work has been confirmed."})}catch{return this.jobs.delete(a.messageId),{status:"rejected",reason:"Studio could not accept the request. Do not claim it started."}}};async start(){if(this.state.phase!=="idle"&&this.state.phase!=="error")return;this.stop();const e=++this.generation,s=new AbortController;this.startupAbort=s;const o=()=>e===this.generation;this.patch({phase:"connecting",error:null,muted:!1});try{if(await this.cleanup,!o())return;const r=fetch(this.url,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"conversation",language:this.language}),signal:AbortSignal.timeout(5e4)}).then(async c=>{if(!c.ok)throw new Error("Voice unavailable");return ji.parse(await c.json())});this.cleanup=r.then(async c=>{o()||await this.revoke(c.token)}).catch(()=>{});const i=await r;if(!o())return;this.token=i.token;const a=ki(i,this.language,{onDelegate:c=>o()?this.delegate(c):Promise.resolve({status:"disconnected"}),getWorkStatus:()=>o()?this.status():{status:"disconnected"},cancelCurrentWork:()=>o()?(this.bindings?.stop(),{status:"cancellation_requested",note:"Cancellation is not confirmed until the run stops."}):{status:"disconnected"},onConnect:()=>{o()&&this.patch({phase:"listening"})},onModeChange:({mode:c})=>{o()&&this.patch({phase:c})},onMessage:({role:c,message:u,event_id:d})=>{if(o()&&c==="user"){if(u.startsWith("[Studio background event,"))return;(d===void 0||!this.seenUserEvents.has(d))&&this.utterance++,d!==void 0&&this.seenUserEvents.add(d),this.lastActivity=Date.now()}},onVadScore:({vadScore:c})=>{o()&&c>.5&&!this.state.muted&&(this.lastActivity=Date.now())},onUserSpeaking:c=>{o()&&(this.userSpeaking=c)},onError:()=>{o()&&this.fail("unavailable")},onDisconnect:()=>{o()&&this.fail("disconnected")}},s.signal,async(c,u)=>{const d=await fetch(`${this.url}/connect`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i.token,sdp:c,language:this.language}),signal:u});if(!d.ok)throw new Error("Voice connection unavailable");return wi.parse(await d.json())});this.cleanup=a.then(async c=>{o()||await c.endSession()}).catch(()=>{});const l=await a;if(!o())return;if(this.conversation=l,this.bindings?.isStreaming||this.bindings?.isRunInProgress){const c=this.bindings.messages.findLast(u=>u.role==="user");c&&this.jobs.set(c.id,{messageId:c.id,utterance:-1,request:c.parts.filter(u=>u.type==="text").map(u=>u.text).join(`
|