decocms 3.2.1 → 3.2.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-ByuuAmrP.js → AlertCircle-C8E06jfW.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-7eXsw1ql.js → ArrowUpRight-CkF0i1No.js} +1 -1
- package/dist/client/assets/{Check-BbSnE7nF.js → Check-DwRXhDYN.js} +1 -1
- package/dist/client/assets/{CheckCircle-Ca1wJWW6.js → CheckCircle-2iMrjx7D.js} +1 -1
- package/dist/client/assets/{ChevronDown-B3TWWBuw.js → ChevronDown-k1VC2srD.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CuRKchB5.js → ChevronLeft-7V2_qQ3E.js} +1 -1
- package/dist/client/assets/{ChevronRight-CYgA53ZB.js → ChevronRight-bA2PmkN9.js} +1 -1
- package/dist/client/assets/{ChevronUp-0T6APBSE.js → ChevronUp-gzUJvPqk.js} +1 -1
- package/dist/client/assets/{Container-RPSmr1XN.js → Container-DrffveDY.js} +1 -1
- package/dist/client/assets/{DotsVertical-BQNv4yup.js → DotsVertical-BZEdPJTY.js} +1 -1
- package/dist/client/assets/{Eye-CNWO8gM7.js → Eye-CbDINxSR.js} +1 -1
- package/dist/client/assets/{FilterLines-Cpimx7eF.js → FilterLines-DGIJAfna.js} +1 -1
- package/dist/client/assets/{Globe01-C0ij8Y-s.js → Globe01-CXHtWC8F.js} +1 -1
- package/dist/client/assets/{HardDrive-ChaMHCwz.js → HardDrive-HIDpzn4I.js} +1 -1
- package/dist/client/assets/{Key01-Bfuisq2G.js → Key01-BTeVSARy.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BDqI6g0z.js → LinkExternal01-D7lnMhd-.js} +1 -1
- package/dist/client/assets/{Monitor01-CcL8iOzY.js → Monitor01-F6bKl6tK.js} +1 -1
- package/dist/client/assets/{Palette-DKpoyUgd.js → Palette-szvJEqXU.js} +1 -1
- package/dist/client/assets/{Play-Bb6uueKI.js → Play-sw2az4p0.js} +1 -1
- package/dist/client/assets/{Plus-CZ_sF7TZ.js → Plus-dxS60FPA.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-BPWCc7Ui.js → RefreshCcw01-B2-HH-To.js} +1 -1
- package/dist/client/assets/{SearchMd-BFlkVflN.js → SearchMd-88iVjfqP.js} +1 -1
- package/dist/client/assets/{Settings02-Ch7efITK.js → Settings02-CdYsqAUT.js} +1 -1
- package/dist/client/assets/{Shield01-rrS6w-7t.js → Shield01-D6lV8m1d.js} +1 -1
- package/dist/client/assets/{Star01-CNXX9diU.js → Star01-K2L8_aik.js} +1 -1
- package/dist/client/assets/{Stars01-BQswryR6.js → Stars01-Bmg9xGSu.js} +1 -1
- package/dist/client/assets/{Stars02-CSL2rgyN.js → Stars02-nn8T1-WQ.js} +1 -1
- package/dist/client/assets/{Sun-Ck3cYoCA.js → Sun-Bk5MW5gf.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DsrQHrpb.js → SwitchHorizontal01-Caie0gIK.js} +1 -1
- package/dist/client/assets/{Tool01-Cjv1XJEb.js → Tool01-CBtpfChg.js} +1 -1
- package/dist/client/assets/{Trash01-CxCHXGOx.js → Trash01-DDKaJVRQ.js} +1 -1
- package/dist/client/assets/{Upload01-CeYSkJhe.js → Upload01-B5AbRmag.js} +1 -1
- package/dist/client/assets/{User01-DrA8Lgm7.js → User01-C5NUNAi1.js} +1 -1
- package/dist/client/assets/{Users01-3z4KNhww.js → Users01-BCOOK-yw.js} +1 -1
- package/dist/client/assets/{Users03-C9tAd5Ba.js → Users03-CS9FNDsP.js} +1 -1
- package/dist/client/assets/{X-DSdGdxng.js → X-D96et_XK.js} +1 -1
- package/dist/client/assets/{XCircle--wEB3Wnr.js → XCircle-toDSs4J6.js} +1 -1
- package/dist/client/assets/{XClose-SBhbV0jV.js → XClose-C8XjR0Oj.js} +1 -1
- package/dist/client/assets/{Zap-BRXknHpU.js → Zap-DPY_aC88.js} +1 -1
- package/dist/client/assets/{ZapSquare-DW4J95z9.js → ZapSquare-D_bnCoLi.js} +1 -1
- package/dist/client/assets/{ZoomOut-1w3s7N6o.js → ZoomOut-CFJklA2J.js} +1 -1
- package/dist/client/assets/{access-gate-DUP-FMW_.js → access-gate-Bxa3dGfK.js} +1 -1
- package/dist/client/assets/{accordion-Bu_taiZe.js → accordion-7Hq31-jA.js} +1 -1
- package/dist/client/assets/{add-section-modal-BvFEBv0h.js → add-section-modal-ctMF5sBw.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DbMxSg-C.js → agent-capabilities-BLrQsLZt.js} +1 -1
- package/dist/client/assets/{agent-icon-DkS6Ap-C.js → agent-icon-CEtrmBbc.js} +1 -1
- package/dist/client/assets/{agent-icons-BU8H-xTW.js → agent-icons-CasiUZSA.js} +1 -1
- package/dist/client/assets/{agents-list-DVZwv3E6.js → agents-list-CSKXo2_8.js} +1 -1
- package/dist/client/assets/{ai-providers-agn-dcob.js → ai-providers-DFSkJ7HL.js} +1 -1
- package/dist/client/assets/{alert-DN73WALn.js → alert-C0wwDo4J.js} +1 -1
- package/dist/client/assets/{alert-dialog-Bw7NBbRz.js → alert-dialog-jD0HIb4F.js} +1 -1
- package/dist/client/assets/app-editor-DJDkUDig.js +1 -0
- package/dist/client/assets/{auth-catchall-BlJ-5WHw.js → auth-catchall-CQy9rKP1.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Dzm1aPH4.js → auth-split-layout-D2GxEaTP.js} +1 -1
- package/dist/client/assets/{automation-list-row-C3x-E244.js → automation-list-row-XWf2Pzvs.js} +1 -1
- package/dist/client/assets/{automation-runs-CTZmIulC.js → automation-runs-d4uENwdC.js} +1 -1
- package/dist/client/assets/{automations-S87NSt_f.js → automations-Cn-4c3Au.js} +1 -1
- package/dist/client/assets/{avatar-6TETgWGc.js → avatar-DXqnRYfU.js} +1 -1
- package/dist/client/assets/{badge-B8xisPo_.js → badge-CnPW-GqK.js} +1 -1
- package/dist/client/assets/{brand-context-Mfgei73B.js → brand-context-C1cfILrc.js} +1 -1
- package/dist/client/assets/{buckets-CVy4SLLv.js → buckets-ByaOx_bc.js} +1 -1
- package/dist/client/assets/{calendar-BvvsEYKA.js → calendar-DeW_DdNU.js} +1 -1
- package/dist/client/assets/{capability-load-error-VErw4nLB.js → capability-load-error-BGVv1fL5.js} +1 -1
- package/dist/client/assets/{card-XQIiSY-b.js → card-DJApDAXW.js} +1 -1
- package/dist/client/assets/{chat-context-DzUbC-xr.js → chat-context-CQlAaKi3.js} +1 -1
- package/dist/client/assets/{checkbox-Bpq-GtnK.js → checkbox-BIvxdAqx.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BrX77bKE.js → cli-auth-success-BHBjLjeF.js} +1 -1
- package/dist/client/assets/{collection-detail-Dvs8YEXJ.js → collection-detail-C_EFjExv.js} +1 -1
- package/dist/client/assets/{collection-display-button-B3IAyNvh.js → collection-display-button-Bj56qTcS.js} +1 -1
- package/dist/client/assets/{collection-search-Dnrehh9Y.js → collection-search-BJxAlGyH.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-UpBeyOT3.js → collection-table-wrapper-D6peytAO.js} +1 -1
- package/dist/client/assets/{collection-tabs-CoI7UjOp.js → collection-tabs-CbsCH9v8.js} +1 -1
- package/dist/client/assets/{collections-B7jkmTPa.js → collections-Btisq60d.js} +1 -1
- package/dist/client/assets/{command-B39UMlEv.js → command-BFgPrNtf.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-B_fv-zC_.js → connect-desktop-dialog-Dh1zqCgF.js} +1 -1
- package/dist/client/assets/{connection-card-BxD3hzYk.js → connection-card-DHoKYS6O.js} +1 -1
- package/dist/client/assets/{connection-detail-Bi7jbI9b.js → connection-detail-Bp6uv95F.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-qDos9L_s.js → connection-form-helpers-q_5sAECo.js} +1 -1
- package/dist/client/assets/{connections-qXvhTW3S.js → connections-BH-sbBlr.js} +1 -1
- package/dist/client/assets/{constants-_OexfFJl.js → constants-C-D4Pmy6.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-B9TJutJ9.js → decopilot-sse-pool-BrQw0UAm.js} +1 -1
- package/dist/client/assets/{dialog-N8dYL9IV.js → dialog-m1msdckr.js} +1 -1
- package/dist/client/assets/{domain-settings-BMZMOFLc.js → domain-settings-De5BKpSF.js} +1 -1
- package/dist/client/assets/{drawer-BDyeiuJ6.js → drawer-KxvT14L5.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Jaik1o9W.js → dropdown-menu-BXhpM-R_.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-CGMYG2P8.js → dynamic-plugin-layout-DLRUs164.js} +1 -1
- package/dist/client/assets/{empty-state-BIZp3Wzl.js → empty-state-BXMuvewe.js} +1 -1
- package/dist/client/assets/{empty-state-DmuFPxSA.js → empty-state-D3juNsZ6.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BMrTOxqq.js → extract-connection-data-CvUd4tJL.js} +1 -1
- package/dist/client/assets/{features-RZhE2UVO.js → features--cEA_34N.js} +1 -1
- package/dist/client/assets/{file-explorer-eWHbqcdV.js → file-explorer-CwfYBal8.js} +1 -1
- package/dist/client/assets/{file-type-icon-Bscuxmvi.js → file-type-icon-aSS_wfKX.js} +1 -1
- package/dist/client/assets/{files-C6VU3gjR.js → files-CKP66dnf.js} +1 -1
- package/dist/client/assets/{form-BzUl5L3O.js → form-DIz1lXzt.js} +1 -1
- package/dist/client/assets/{general-FkmFS6e6.js → general-CSQvrtS8.js} +1 -1
- package/dist/client/assets/{generate-id-BHkehxKG.js → generate-id-MICojNT7.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BFiC9cbF.js → github-repo-picker-CUBnWzWO.js} +1 -1
- package/dist/client/assets/{header-tab-button-CeJ9c_tl.js → header-tab-button-BCxnrLni.js} +1 -1
- package/dist/client/assets/{hover-card-Cd5Q8igo.js → hover-card-BagBBHwl.js} +1 -1
- package/dist/client/assets/{image-field-UZAPAOOz.js → image-field-DInBNYXf.js} +1 -1
- package/dist/client/assets/{index-CVcc7k1H.js → index-42kOoh0P.js} +1 -1
- package/dist/client/assets/{index-B8ILnfS6.js → index-BCwnQG_j.js} +1 -1
- package/dist/client/assets/{index-meHkju0S.js → index-BWtmYkwi.js} +1 -1
- package/dist/client/assets/{index-CEk4GIBJ.js → index-C3NmhGwz.js} +1 -1
- package/dist/client/assets/{index-3PLXj9NO.js → index-CN3cwfwy.js} +4 -4
- package/dist/client/assets/{index-BQjzxwMq.js → index-CWjORjiD.js} +1 -1
- package/dist/client/assets/{index-CapCq4uG.js → index-ChQwZqpG.js} +1 -1
- package/dist/client/assets/{index-CUwWwcrX.js → index-Csz3ibNb.js} +1 -1
- package/dist/client/assets/{index-CXD35HrY.js → index-DHt9Mf9G.js} +3 -3
- package/dist/client/assets/{index-BLB4nIBt.js → index-DLIj-Jcg.js} +1 -1
- package/dist/client/assets/{index-BUA93rVM.js → index-DfrAcw3c.js} +1 -1
- package/dist/client/assets/{index-BLLBrYfT.js → index-Dg2RoULU.js} +1 -1
- package/dist/client/assets/{index-WmwIsUVI.js → index-Dla-fDpI.js} +1 -1
- package/dist/client/assets/{index-Du62ET2a.js → index-ZsTpfnpi.js} +1 -1
- package/dist/client/assets/{index-Dc-40HGd.js → index-eeLoYk5O.js} +1 -1
- package/dist/client/assets/{index-redirect-DDOXoojV.js → index-redirect-BTEQzwYi.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CGU6vZCH.js → infiniteQueryObserver-C0HsJFoc.js} +1 -1
- package/dist/client/assets/{input-C9wjfV7v.js → input-D2dMhViX.js} +1 -1
- package/dist/client/assets/{integration-icon-DsMTB170.js → integration-icon-D5ZAVm0g.js} +1 -1
- package/dist/client/assets/{label-g7qALGmg.js → label-W8QKQ71a.js} +1 -1
- package/dist/client/assets/{layout-bDoXge5D.js → layout-C3II9QQW.js} +1 -1
- package/dist/client/assets/{login-CPZKVFaQ.js → login-CN2Q_xpv.js} +1 -1
- package/dist/client/assets/{members-DWt34Meb.js → members-Dx-3G2q9.js} +1 -1
- package/dist/client/assets/{monaco-editor-CIVDk0X4.js → monaco-editor-637MBJHf.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DVsMM237.js → monitoring-stats-row-vcZ8M2dk.js} +1 -1
- package/dist/client/assets/{oauth-callback-CSUHKD_o.js → oauth-callback-MkSvb6XB.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BlWETFFP.js → oauth-callback-ai-provider-BRN5UHIt.js} +1 -1
- package/dist/client/assets/{onboarding-D5Ic9zJG.js → onboarding-Ci3GX3X7.js} +1 -1
- package/dist/client/assets/{org-install-Bn_KoOXH.js → org-install-DvKUkehf.js} +1 -1
- package/dist/client/assets/{org-layout-BELYI7z_.js → org-layout-CDF7rmnv.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-WHwrW77i.js → org-plugin-layout-C7dImV9m.js} +1 -1
- package/dist/client/assets/{page-seo-form-Rig1soEP.js → page-seo-form-_pRbcmAC.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CKWQNz11.js +1 -0
- package/dist/client/assets/{pair-zYr2GmQ7.js → pair-BzvzVihx.js} +3 -3
- package/dist/client/assets/{plugin-empty-state-CaWAfurE.js → plugin-empty-state-RFNgD2Hl.js} +1 -1
- package/dist/client/assets/{plugin-header-BD-ptlOP.js → plugin-header-Cjy2H9Lt.js} +1 -1
- package/dist/client/assets/{plugin-layout-CIQ_MNTQ.js → plugin-layout-CMzjQ3je.js} +1 -1
- package/dist/client/assets/{popover-OD-r-fVD.js → popover-CBH5jqt8.js} +1 -1
- package/dist/client/assets/{post-editor-Ww43847q.js → post-editor-DgGiGnFb.js} +1 -1
- package/dist/client/assets/{primitives-BkhZbhaK.js → primitives-DIzZ8vtF.js} +1 -1
- package/dist/client/assets/{profile-DScmkuI4.js → profile-CzlZVbcz.js} +1 -1
- package/dist/client/assets/project-app-view-CpvI7p3P.js +1 -0
- package/dist/client/assets/record-editor-CVyJ-HfI.js +1 -0
- package/dist/client/assets/{registry-layout-aQVqpLkk.js → registry-layout-CK2u5-1Q.js} +1 -1
- package/dist/client/assets/registry-vLK01UDd.js +2 -0
- package/dist/client/assets/{require-capability-B83Rfplv.js → require-capability-DvXpu1NE.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DCPdZlSg.js → required-auth-layout-CceJrchr.js} +1 -1
- package/dist/client/assets/{reset-password-BSCF-TYh.js → reset-password-MOrCv-Jk.js} +1 -1
- package/dist/client/assets/{resizable-BT2keVUf.js → resizable-B9nPHbdY.js} +1 -1
- package/dist/client/assets/{roles-DDxTqNFx.js → roles-C0nb3z6u.js} +1 -1
- package/dist/client/assets/{save-status-BWK9t34W.js → save-status-XRuEx_--.js} +1 -1
- package/dist/client/assets/{schema-form-DMN65tMe.js → schema-form-CB484siM.js} +1 -1
- package/dist/client/assets/{scroll-area-huDDjp9h.js → scroll-area-DVU-pYpl.js} +1 -1
- package/dist/client/assets/{search-input-Bo1czWuc.js → search-input-BMiEmNCi.js} +1 -1
- package/dist/client/assets/{secrets-BSGdlXxl.js → secrets-Cnbscr4a.js} +1 -1
- package/dist/client/assets/{sections-editor-Kc6kOt9I.js → sections-editor-CFNE6H-Z.js} +1 -1
- package/dist/client/assets/{select-D_rADyeN.js → select-BISzCSVs.js} +1 -1
- package/dist/client/assets/{select-model-D4qI7a0H.js → select-model-DYDHHLGi.js} +1 -1
- package/dist/client/assets/{seo-editor-GY9idGrl.js → seo-editor-0nVP1sQh.js} +1 -1
- package/dist/client/assets/{settings-layout-B0Ul5kvB.js → settings-layout-BVrDhJki.js} +1 -1
- package/dist/client/assets/{settings-section-DMc4s0vU.js → settings-section-BZG2d-sE.js} +1 -1
- package/dist/client/assets/{sheet-Pz5-NB3k.js → sheet-C-msc_1A.js} +1 -1
- package/dist/client/assets/{shell-controls-C0ImSETI.js → shell-controls-BvFNuvl3.js} +1 -1
- package/dist/client/assets/{shell-layout-Dgdt_8rv.js → shell-layout-xcJQ-oXv.js} +1 -1
- package/dist/client/assets/{shell-route-loading-CB1BVSfX.js → shell-route-loading-BToLUOm_.js} +1 -1
- package/dist/client/assets/{sidebar-B-j-nI2l.js → sidebar-C1EbFBeG.js} +1 -1
- package/dist/client/assets/{skeleton-DIe_hcjh.js → skeleton-HacfcGLU.js} +1 -1
- package/dist/client/assets/{sortable.esm-DY8YVkDQ.js → sortable.esm-Dlj8q3TW.js} +1 -1
- package/dist/client/assets/{spinner-B0UNMt-U.js → spinner-CXR5LEFP.js} +1 -1
- package/dist/client/assets/{sso-B0wN1G0O.js → sso-DlZR7eJk.js} +1 -1
- package/dist/client/assets/{store-Ck7Guxqc.js → store-C2kJGW5G.js} +1 -1
- package/dist/client/assets/store-registry-DESNxNEj.js +2 -0
- package/dist/client/assets/{switch-CCm7Q442.js → switch-CWfvQ3qI.js} +1 -1
- package/dist/client/assets/{tab-id-Bw_e4wJV.js → tab-id-CuSxDIM1.js} +1 -1
- package/dist/client/assets/{table-BYsCVFvU.js → table--UQXxBBH.js} +1 -1
- package/dist/client/assets/{tabs-DU8yElp1.js → tabs-33vYy1bT.js} +1 -1
- package/dist/client/assets/{task-status-DukwwWFW.js → task-status-DdX5GyQu.js} +1 -1
- package/dist/client/assets/{textarea-Bg3_-gyq.js → textarea-C-zVkKAJ.js} +1 -1
- package/dist/client/assets/{toggle-group-D3JRSHCm.js → toggle-group-CoUQzFHk.js} +1 -1
- package/dist/client/assets/{toolbar-BcNvXnW_.js → toolbar-BmXelHzT.js} +1 -1
- package/dist/client/assets/{tools-list-D-XUldpQ.js → tools-list-CV_q_f0Z.js} +1 -1
- package/dist/client/assets/{tooltip-BLOVWRLB.js → tooltip-DY1LX4fr.js} +1 -1
- package/dist/client/assets/{types-BDkt4vmT.js → types-Dl5kxJ-o.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D8uqA8F3.js → use-ai-providers-BcOqTKKC.js} +1 -1
- package/dist/client/assets/{use-automations-B9xj4bsi.js → use-automations-BPP1PerV.js} +1 -1
- package/dist/client/assets/{use-capability-D90XVo0g.js → use-capability-BsGHGYLW.js} +1 -1
- package/dist/client/assets/{use-collections-DoCz8MGT.js → use-collections-ZGWkQryR.js} +1 -1
- package/dist/client/assets/{use-connection-BP0gNEj8.js → use-connection-BAOUEhf6.js} +1 -1
- package/dist/client/assets/{use-copy-QEEDdK3_.js → use-copy-eq8o4JlH.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BH7S5Lx3.js → use-create-virtual-mcp-KZ5vkVjY.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CiGa02ts.js → use-debounced-autosave-CVMWB9VT.js} +1 -1
- package/dist/client/assets/{use-delete-connection-ClZdPbyx.js → use-delete-connection-BddckOeq.js} +1 -1
- package/dist/client/assets/{use-file-configs-DryWc5C3.js → use-file-configs-BDCkFZ7E.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-G1byfuk0.js → use-infinite-scroll-CAJkZLHC.js} +1 -1
- package/dist/client/assets/{use-list-state-ao0R-NZI.js → use-list-state-ufhhKZZh.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dsxmrp6C.js → use-mcp-prompts-BJKxU2Na.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CP1ukXK9.js → use-mcp-tools-ftOL48Fr.js} +1 -1
- package/dist/client/assets/{use-members-DJtUNna_.js → use-members-D0MeIqsF.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D4AslRZm.js → use-navigate-to-agent-BYyEy_zS.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CxpHs_Vn.js → use-org-auth-client-YKBoNqBy.js} +1 -1
- package/dist/client/assets/{use-org-sso-RJt5vtQj.js → use-org-sso-Lxt3NvQV.js} +1 -1
- package/dist/client/assets/{use-organization-roles-B1v3SUrz.js → use-organization-roles-DE5F_seS.js} +1 -1
- package/dist/client/assets/{use-organization-settings-1zemtEzS.js → use-organization-settings-C-jLCwb5.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Ex6acs_f.js → use-registry-connections-DWZHQxm0.js} +1 -1
- package/dist/client/assets/{use-secrets-CIR-JEqt.js → use-secrets-BT7pvkDh.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DYoN9DxD.js → use-status-sounds-DLyX7i_J.js} +1 -1
- package/dist/client/assets/{use-view-mode-ZMLCKL2b.js → use-view-mode-ljpeZqvp.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BRv_CvsW.js → use-virtual-mcp-Rn9fsUNN.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CWJ6mtkH.js +1 -0
- package/dist/client/assets/{useRouterState-DNu2gJlX.js → useRouterState-CXGDCAP4.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DDVcuWif.js +1 -0
- package/dist/client/assets/{user-CDUKY7Tn.js → user-Dh7nE-E-.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DgZQSMnW.js → view-mode-toggle-7zw5kq-m.js} +1 -1
- package/dist/client/assets/{workflow-H0Kk_Nq-.js → workflow-BAq_lzuZ.js} +1 -1
- package/dist/client/assets/workflow-detail-DpURA77E.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +435 -432
- package/dist/server/migrate.js +9 -9
- package/dist/server/server.js +288 -285
- package/package.json +1 -1
- package/dist/client/assets/app-editor-BuMABOjf.js +0 -1
- package/dist/client/assets/page-seo-sheet-Bf_FSOof.js +0 -1
- package/dist/client/assets/project-app-view-DRVCBkTN.js +0 -1
- package/dist/client/assets/record-editor-DNW7IuYT.js +0 -1
- package/dist/client/assets/registry-BDe37MkZ.js +0 -2
- package/dist/client/assets/store-registry-CFkyafgO.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Dsby0HYE.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DMzYQ3Lt.js +0 -1
- package/dist/client/assets/workflow-detail-G3IbeOSM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as F,F as te,K as U,j as a,r as M,c as ne}from"./index-CXD35HrY.js";import{i as oe,j as z,X as se,Y as re,Z as ie,d as le}from"./index-3PLXj9NO.js";import{L as Y}from"./label-g7qALGmg.js";import{S as $}from"./switch-CCm7Q442.js";import{a as ce,S as ae}from"./schema-form-DMN65tMe.js";import{c as ue,S as fe,a as pe,b as de,d as ye}from"./select-D_rADyeN.js";const he="website/sections/Rendering/Lazy.tsx";function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function N(t){if(!K(t))return!1;const e=t.__resolveType;return typeof e=="string"&&oe(e)}function k(t){return t!=null}function w(t){if(t==null)return t;if(N(t)){const e=t.section;return e==null?null:K(e)?e:{}}return K(t)?t:void 0}function G(t,e){return t===null?null:N(e)?{...e,section:t}:t}function me(t){return{__resolveType:t}}function Se(t,e){if(!k(e))return null;if(t){const n=w(e)??{};return{__resolveType:he,section:n}}return N(e)?w(e)??null:K(e)?e:null}const ge="General";function O(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function Q(t,e){return t===C?ge:e}function Z(t){const e=re(t),n=new Set,o=[];for(const s of e)O(s.resolveType)&&(ie(s.resolveType)||n.has(s.resolveType)||(n.add(s.resolveType),o.push({resolveType:s.resolveType,title:Q(s.resolveType,s.title),description:s.description})));return o}function V(t){const e=se(t),n=z(e,t),o=Z(n?.properties?.seo);return o.length>0?o:ve(t)}function ve(t){const e=t.manifest?.blocks??{},n=[];for(const[o,s]of Object.entries(e))if(o.includes("sections"))for(const r of Object.keys(s)){if(!O(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Q(r,i)})}return n}function W(t){const e=V(t),n=e.find(o=>o.resolveType===C);return n?n.resolveType:e[0]?.resolveType??C}function q(t,e){const n=e.__resolveType;if(typeof n=="string"){const o=z(n,t),s=Z(o?.properties?.seo);if(s.length>0)return s}return V(t)}function be(t,e){const n=q(t,e),o=n.find(s=>s.resolveType===C);return o?o.resolveType:n[0]?.resolveType??W(t)}function Te(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:W(t)}function xe(t,e,n){const o=n.__resolveType;return typeof o=="string"&&O(o)?o:be(t,e)}const _e=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]),C="website/sections/Seo/SeoV2.tsx",Re=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function L(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function je(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function Ee(t,e){for(const[n,o]of Object.entries(t)){if(!L(o))continue;const s=o,r=s.__resolveType;if(typeof r=="string"&&_e.has(r))continue;const i=s.seo;if(L(i)){const c=i;if(je(c))return{blockKey:n,kind:"nested",seoData:c,blockData:s,seoResolveType:e?xe(e,s,c):typeof c.__resolveType=="string"&&O(c.__resolveType)?c.__resolveType:C}}}for(const[n,o]of Object.entries(t)){if(!L(o))continue;const s=o;if(typeof s.__resolveType=="string"&&O(s.__resolveType))return{blockKey:n,kind:"block",seoData:s,blockData:s,seoResolveType:s.__resolveType}}return null}function De(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function qe(t,e,n){if(e.kind==="site"){const l=Ee(t,n);return l?{blockKey:l.blockKey,seoData:l.seoData,seoResolveType:l.seoResolveType,siteKind:l.kind,seoTypeOptions:n?q(n,l.blockData):void 0,build:d=>De(l,d)}:null}const o=t[e.pageKey];if(!L(o))return null;const s=o,r=s.seo,i=w(r),c=i&&L(i)?i:void 0;return{blockKey:e.pageKey,seoData:c,rawSeoData:r,seoResolveType:n?Te(n,c):typeof c?.__resolveType=="string"?c.__resolveType:C,seoTypeOptions:n?V(n):void 0,build:l=>({...s,seo:l===null?null:G(l,r)})}}function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ce(t,e,n,o){if(t.kind==="page"){if(!I(n))return null;const s=n.seo!==void 0?n.seo:e.rawSeoData;return{...n,seo:o===null?null:G(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function He(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function Je(t){const e=F.c(23),{orgSlug:n,virtualMcpId:o,branch:s,target:r,resolved:i,onSaved:c}=t,l=te(),d=`${n}/${o}/${s}`;let y;e[0]!==s||e[1]!==n||e[2]!==o?(y={orgSlug:n,virtualMcpId:o,branch:s},e[0]=s,e[1]=n,e[2]=o,e[3]=y):y=e[3];let p;e[4]!==c?(p={onSaved:c},e[4]=c,e[5]=p):p=e[5];const{save:f,flush:S,isPending:h}=le(y,p);let m;e[6]!==d||e[7]!==l||e[8]!==i||e[9]!==f||e[10]!==r?(m=j=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return Ce(r,i,b,j)})},e[6]=d,e[7]=l,e[8]=i,e[9]=f,e[10]=r,e[11]=m):m=e[11];const g=m;let v;e[12]!==d||e[13]!==l||e[14]!==i||e[15]!==f||e[16]!==r?(v=j=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:j}:null})},e[12]=d,e[13]=l,e[14]=i,e[15]=f,e[16]=r,e[17]=v):v=e[17];const R=v;let x;return e[18]!==S||e[19]!==h||e[20]!==R||e[21]!==g?(x={persistSeo:g,persistRawSeo:R,flush:S,isPending:h},e[18]=S,e[19]=h,e[20]=R,e[21]=g,e[22]=x):x=e[22],x}const Pe="https://deco.cx/docs/en/performance/edge-async-render";function Oe(t){const e=F.c(16),{rawSeo:n,onEnableChange:o,onAsyncRenderChange:s,children:r}=t;let i;e[0]!==n?(i=k(n),e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]!==n?(l=N(n),e[2]=n,e[3]=l):l=e[3];const d=l;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Y,{htmlFor:"seo-enable",className:"text-sm font-medium",children:"Enable SEO"}),e[4]=y):y=e[4];let p;e[5]!==c||e[6]!==o?(p=a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,a.jsx($,{id:"seo-enable",checked:c,onCheckedChange:o})]}),e[5]=c,e[6]=o,e[7]=p):p=e[7];let f;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==s?(f=c&&a.jsxs(a.Fragment,{children:[r,a.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Async render"}),a.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",a.jsx("a",{href:Pe,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"documentation"}),"."]})]}),a.jsx($,{id:"seo-async-render",checked:d,onCheckedChange:s,className:"shrink-0"})]})]}),e[8]=d,e[9]=r,e[10]=c,e[11]=s,e[12]=f):f=e[12];let S;return e[13]!==p||e[14]!==f?(S=a.jsxs("div",{className:"space-y-4",children:[p,f]}),e[13]=p,e[14]=f,e[15]=S):S=e[15],S}const B=["type","title","description","canonical","favicon","image","themeColor"],Fe=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],Le=["jsonLD","title","description","noIndexing","configJsonLD"];function H(t){return t===C||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":"full"}function Ke(t){switch(t){case"general":return B;case"pdp":return Fe;case"plp":return Le;default:return null}}function J(t,e){const n=Ke(H(e));if(!n||!t.properties)return t;const o={};for(const s of n){const r=t.properties[s];r&&(o[s]=r)}return{...t,properties:o}}function ke(){return B.filter(t=>t!=="type")}function Ne(t){return t.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).trim()}function Ae(t,e){return t[e]===void 0}function $e(t){const e=F.c(13),{schema:n,value:o,onChange:s,siteDefaultSeo:r,formResetKey:i}=t,l=J(n,C).properties??{},d=ke();let y;e[0]!==r?(y=!!r&&Object.keys(r).length>0,e[0]=r,e[1]=y):y=e[1];const p=y,[f,S]=M.useState(i);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];const[m,g]=M.useState(h);f!==i&&(S(i),g({}));let v;e[3]!==m||e[4]!==o?(v=u=>m[u]!==void 0?m[u]:Ae(o,u),e[3]=m,e[4]=o,e[5]=v):v=e[5];const R=v;let x;e[6]!==s||e[7]!==r||e[8]!==o?(x=(u,T)=>{g(D=>({...D,[u]:T}));const E={...o};if(T)delete E[u];else{const D=r?.[u];E[u]=D??(u==="type"?"website":"")}s(E)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const j=x,P="min-w-0 space-y-6",b=B.map(u=>{const T=l[u];if(!T)return null;const E=p&&d.includes(u),D=E&&R(u),X=D?r?.[u]??o[u]:o[u],ee=T.title??Ne(u);return a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:ne(D&&"pointer-events-none opacity-60"),children:ce({schema:T,value:X,onChange:A=>{D||s({...o,[u]:A})},path:u,label:ee,breadcrumbPath:[],onBreadcrumbChange:we})}),E&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>j(u,A)}),a.jsx(Y,{htmlFor:`seo-use-default-${u}`,className:"text-xs font-normal text-muted-foreground",children:"Use default"})]})]},u)});let _;return e[10]!==i||e[11]!==b?(_=a.jsx("div",{className:P,children:b},i),e[10]=i,e[11]=b,e[12]=_):_=e[12],_}function we(){}function Ie(t){const e=F.c(18),{schema:n,resolveType:o,value:s,formResetKey:r,onChange:i,onBreadcrumbChange:c,siteDefaultSeo:l}=t;if(H(o)==="general"){let m;e[0]!==i?(m=v=>i(v),e[0]=i,e[1]=m):m=e[1];let g;return e[2]!==r||e[3]!==n||e[4]!==l||e[5]!==m||e[6]!==s?(g=a.jsx($e,{schema:n,value:s,onChange:m,siteDefaultSeo:l,formResetKey:r}),e[2]=r,e[3]=n,e[4]=l,e[5]=m,e[6]=s,e[7]=g):g=e[7],g}let y;e[8]!==o||e[9]!==n?(y=J(n,o),e[8]=o,e[9]=n,e[10]=y):y=e[10];const p=y;let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[11]=f):f=e[11];const S=c??Ye;let h;return e[12]!==p||e[13]!==r||e[14]!==i||e[15]!==S||e[16]!==s?(h=a.jsx(ae,{schema:p,value:s,onChange:i,basePath:"",breadcrumbPath:f,onBreadcrumbChange:S},r),e[12]=p,e[13]=r,e[14]=i,e[15]=S,e[16]=s,e[17]=h):h=e[17],h}function Ye(){}function Ve(t){const e=F.c(10),{options:n,value:o,onChange:s}=t;if(n.length<=1)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Y,{className:"text-xs text-muted-foreground",children:"SEO type"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(fe,{className:"w-full",children:a.jsx(pe,{placeholder:"Select SEO type"})}),e[1]=i):i=e[1];let c;e[2]!==n?(c=n.filter(Ue).map(Be),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==c?(l=a.jsx(de,{children:c}),e[4]=c,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l||e[8]!==o?(d=a.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[r,a.jsxs(ye,{value:o,onValueChange:s,children:[i,l]})]}),e[6]=s,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}function Be(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Ue(t){return t.resolveType.length>0}function Xe(t){const e=F.c(33),{rawSeo:n,innerSeo:o,defaultResolveType:s,seoSchema:r,activeResolveType:i,seoTypeOptions:c,formResetKey:l,siteDefaultSeo:d,onBreadcrumbChange:y,onPersistRaw:p,onInnerChange:f,onClearForm:S,onBumpFormKey:h,beforeFields:m}=t;let g;e[0]!==s||e[1]!==h||e[2]!==S||e[3]!==p?(g=T=>{if(T){const E=me(s);p(E),S(),h();return}p(null),S(),h()},e[0]=s,e[1]=h,e[2]=S,e[3]=p,e[4]=g):g=e[4];const v=g;let R;e[5]!==p||e[6]!==n?(R=T=>{const E=Se(T,n);p(E)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let j;e[8]!==h||e[9]!==f?(j=T=>{f({__resolveType:T}),h()},e[8]=h,e[9]=f,e[10]=j):j=e[10];const P=j;let b;e[11]!==i||e[12]!==P||e[13]!==n||e[14]!==r||e[15]!==c?(b=k(n)&&r&&i&&c&&c.length>0&&a.jsx(Ve,{options:c,value:i,onChange:P}),e[11]=i,e[12]=P,e[13]=n,e[14]=r,e[15]=c,e[16]=b):b=e[16];let _;e[17]!==i||e[18]!==l||e[19]!==o||e[20]!==y||e[21]!==f||e[22]!==n||e[23]!==r||e[24]!==d?(_=k(n)&&r&&i&&a.jsx(Ie,{schema:r,resolveType:i,value:o,formResetKey:l,onChange:T=>f(T),onBreadcrumbChange:y,siteDefaultSeo:d}),e[17]=i,e[18]=l,e[19]=o,e[20]=y,e[21]=f,e[22]=n,e[23]=r,e[24]=d,e[25]=_):_=e[25];let u;return e[26]!==m||e[27]!==x||e[28]!==v||e[29]!==n||e[30]!==b||e[31]!==_?(u=a.jsxs(Oe,{rawSeo:n,onEnableChange:v,onAsyncRenderChange:x,children:[m,b,_]}),e[26]=m,e[27]=x,e[28]=v,e[29]=n,e[30]=b,e[31]=_,e[32]=u):u=e[32],u}export{Xe as P,Ie as S,He as a,Ce as b,Je as c,W as d,Ee as f,k as i,qe as r,w as u};
|
|
1
|
+
import{e as F,F as te,K as U,j as a,r as M,c as ne}from"./index-DHt9Mf9G.js";import{i as oe,j as z,X as se,Y as re,Z as ie,d as le}from"./index-CN3cwfwy.js";import{L as Y}from"./label-W8QKQ71a.js";import{S as $}from"./switch-CWfvQ3qI.js";import{a as ce,S as ae}from"./schema-form-CB484siM.js";import{c as ue,S as fe,a as pe,b as de,d as ye}from"./select-BISzCSVs.js";const he="website/sections/Rendering/Lazy.tsx";function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function N(t){if(!K(t))return!1;const e=t.__resolveType;return typeof e=="string"&&oe(e)}function k(t){return t!=null}function w(t){if(t==null)return t;if(N(t)){const e=t.section;return e==null?null:K(e)?e:{}}return K(t)?t:void 0}function G(t,e){return t===null?null:N(e)?{...e,section:t}:t}function me(t){return{__resolveType:t}}function Se(t,e){if(!k(e))return null;if(t){const n=w(e)??{};return{__resolveType:he,section:n}}return N(e)?w(e)??null:K(e)?e:null}const ge="General";function O(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function Q(t,e){return t===C?ge:e}function Z(t){const e=re(t),n=new Set,o=[];for(const s of e)O(s.resolveType)&&(ie(s.resolveType)||n.has(s.resolveType)||(n.add(s.resolveType),o.push({resolveType:s.resolveType,title:Q(s.resolveType,s.title),description:s.description})));return o}function V(t){const e=se(t),n=z(e,t),o=Z(n?.properties?.seo);return o.length>0?o:ve(t)}function ve(t){const e=t.manifest?.blocks??{},n=[];for(const[o,s]of Object.entries(e))if(o.includes("sections"))for(const r of Object.keys(s)){if(!O(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Q(r,i)})}return n}function W(t){const e=V(t),n=e.find(o=>o.resolveType===C);return n?n.resolveType:e[0]?.resolveType??C}function q(t,e){const n=e.__resolveType;if(typeof n=="string"){const o=z(n,t),s=Z(o?.properties?.seo);if(s.length>0)return s}return V(t)}function be(t,e){const n=q(t,e),o=n.find(s=>s.resolveType===C);return o?o.resolveType:n[0]?.resolveType??W(t)}function Te(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:W(t)}function xe(t,e,n){const o=n.__resolveType;return typeof o=="string"&&O(o)?o:be(t,e)}const _e=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]),C="website/sections/Seo/SeoV2.tsx",Re=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function L(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function je(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function Ee(t,e){for(const[n,o]of Object.entries(t)){if(!L(o))continue;const s=o,r=s.__resolveType;if(typeof r=="string"&&_e.has(r))continue;const i=s.seo;if(L(i)){const c=i;if(je(c))return{blockKey:n,kind:"nested",seoData:c,blockData:s,seoResolveType:e?xe(e,s,c):typeof c.__resolveType=="string"&&O(c.__resolveType)?c.__resolveType:C}}}for(const[n,o]of Object.entries(t)){if(!L(o))continue;const s=o;if(typeof s.__resolveType=="string"&&O(s.__resolveType))return{blockKey:n,kind:"block",seoData:s,blockData:s,seoResolveType:s.__resolveType}}return null}function De(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function qe(t,e,n){if(e.kind==="site"){const l=Ee(t,n);return l?{blockKey:l.blockKey,seoData:l.seoData,seoResolveType:l.seoResolveType,siteKind:l.kind,seoTypeOptions:n?q(n,l.blockData):void 0,build:d=>De(l,d)}:null}const o=t[e.pageKey];if(!L(o))return null;const s=o,r=s.seo,i=w(r),c=i&&L(i)?i:void 0;return{blockKey:e.pageKey,seoData:c,rawSeoData:r,seoResolveType:n?Te(n,c):typeof c?.__resolveType=="string"?c.__resolveType:C,seoTypeOptions:n?V(n):void 0,build:l=>({...s,seo:l===null?null:G(l,r)})}}function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ce(t,e,n,o){if(t.kind==="page"){if(!I(n))return null;const s=n.seo!==void 0?n.seo:e.rawSeoData;return{...n,seo:o===null?null:G(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function He(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function Je(t){const e=F.c(23),{orgSlug:n,virtualMcpId:o,branch:s,target:r,resolved:i,onSaved:c}=t,l=te(),d=`${n}/${o}/${s}`;let y;e[0]!==s||e[1]!==n||e[2]!==o?(y={orgSlug:n,virtualMcpId:o,branch:s},e[0]=s,e[1]=n,e[2]=o,e[3]=y):y=e[3];let p;e[4]!==c?(p={onSaved:c},e[4]=c,e[5]=p):p=e[5];const{save:f,flush:S,isPending:h}=le(y,p);let m;e[6]!==d||e[7]!==l||e[8]!==i||e[9]!==f||e[10]!==r?(m=j=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return Ce(r,i,b,j)})},e[6]=d,e[7]=l,e[8]=i,e[9]=f,e[10]=r,e[11]=m):m=e[11];const g=m;let v;e[12]!==d||e[13]!==l||e[14]!==i||e[15]!==f||e[16]!==r?(v=j=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:j}:null})},e[12]=d,e[13]=l,e[14]=i,e[15]=f,e[16]=r,e[17]=v):v=e[17];const R=v;let x;return e[18]!==S||e[19]!==h||e[20]!==R||e[21]!==g?(x={persistSeo:g,persistRawSeo:R,flush:S,isPending:h},e[18]=S,e[19]=h,e[20]=R,e[21]=g,e[22]=x):x=e[22],x}const Pe="https://deco.cx/docs/en/performance/edge-async-render";function Oe(t){const e=F.c(16),{rawSeo:n,onEnableChange:o,onAsyncRenderChange:s,children:r}=t;let i;e[0]!==n?(i=k(n),e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]!==n?(l=N(n),e[2]=n,e[3]=l):l=e[3];const d=l;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Y,{htmlFor:"seo-enable",className:"text-sm font-medium",children:"Enable SEO"}),e[4]=y):y=e[4];let p;e[5]!==c||e[6]!==o?(p=a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,a.jsx($,{id:"seo-enable",checked:c,onCheckedChange:o})]}),e[5]=c,e[6]=o,e[7]=p):p=e[7];let f;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==s?(f=c&&a.jsxs(a.Fragment,{children:[r,a.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Async render"}),a.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",a.jsx("a",{href:Pe,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"documentation"}),"."]})]}),a.jsx($,{id:"seo-async-render",checked:d,onCheckedChange:s,className:"shrink-0"})]})]}),e[8]=d,e[9]=r,e[10]=c,e[11]=s,e[12]=f):f=e[12];let S;return e[13]!==p||e[14]!==f?(S=a.jsxs("div",{className:"space-y-4",children:[p,f]}),e[13]=p,e[14]=f,e[15]=S):S=e[15],S}const B=["type","title","description","canonical","favicon","image","themeColor"],Fe=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],Le=["jsonLD","title","description","noIndexing","configJsonLD"];function H(t){return t===C||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":"full"}function Ke(t){switch(t){case"general":return B;case"pdp":return Fe;case"plp":return Le;default:return null}}function J(t,e){const n=Ke(H(e));if(!n||!t.properties)return t;const o={};for(const s of n){const r=t.properties[s];r&&(o[s]=r)}return{...t,properties:o}}function ke(){return B.filter(t=>t!=="type")}function Ne(t){return t.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).trim()}function Ae(t,e){return t[e]===void 0}function $e(t){const e=F.c(13),{schema:n,value:o,onChange:s,siteDefaultSeo:r,formResetKey:i}=t,l=J(n,C).properties??{},d=ke();let y;e[0]!==r?(y=!!r&&Object.keys(r).length>0,e[0]=r,e[1]=y):y=e[1];const p=y,[f,S]=M.useState(i);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];const[m,g]=M.useState(h);f!==i&&(S(i),g({}));let v;e[3]!==m||e[4]!==o?(v=u=>m[u]!==void 0?m[u]:Ae(o,u),e[3]=m,e[4]=o,e[5]=v):v=e[5];const R=v;let x;e[6]!==s||e[7]!==r||e[8]!==o?(x=(u,T)=>{g(D=>({...D,[u]:T}));const E={...o};if(T)delete E[u];else{const D=r?.[u];E[u]=D??(u==="type"?"website":"")}s(E)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const j=x,P="min-w-0 space-y-6",b=B.map(u=>{const T=l[u];if(!T)return null;const E=p&&d.includes(u),D=E&&R(u),X=D?r?.[u]??o[u]:o[u],ee=T.title??Ne(u);return a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:ne(D&&"pointer-events-none opacity-60"),children:ce({schema:T,value:X,onChange:A=>{D||s({...o,[u]:A})},path:u,label:ee,breadcrumbPath:[],onBreadcrumbChange:we})}),E&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>j(u,A)}),a.jsx(Y,{htmlFor:`seo-use-default-${u}`,className:"text-xs font-normal text-muted-foreground",children:"Use default"})]})]},u)});let _;return e[10]!==i||e[11]!==b?(_=a.jsx("div",{className:P,children:b},i),e[10]=i,e[11]=b,e[12]=_):_=e[12],_}function we(){}function Ie(t){const e=F.c(18),{schema:n,resolveType:o,value:s,formResetKey:r,onChange:i,onBreadcrumbChange:c,siteDefaultSeo:l}=t;if(H(o)==="general"){let m;e[0]!==i?(m=v=>i(v),e[0]=i,e[1]=m):m=e[1];let g;return e[2]!==r||e[3]!==n||e[4]!==l||e[5]!==m||e[6]!==s?(g=a.jsx($e,{schema:n,value:s,onChange:m,siteDefaultSeo:l,formResetKey:r}),e[2]=r,e[3]=n,e[4]=l,e[5]=m,e[6]=s,e[7]=g):g=e[7],g}let y;e[8]!==o||e[9]!==n?(y=J(n,o),e[8]=o,e[9]=n,e[10]=y):y=e[10];const p=y;let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[11]=f):f=e[11];const S=c??Ye;let h;return e[12]!==p||e[13]!==r||e[14]!==i||e[15]!==S||e[16]!==s?(h=a.jsx(ae,{schema:p,value:s,onChange:i,basePath:"",breadcrumbPath:f,onBreadcrumbChange:S},r),e[12]=p,e[13]=r,e[14]=i,e[15]=S,e[16]=s,e[17]=h):h=e[17],h}function Ye(){}function Ve(t){const e=F.c(10),{options:n,value:o,onChange:s}=t;if(n.length<=1)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Y,{className:"text-xs text-muted-foreground",children:"SEO type"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(fe,{className:"w-full",children:a.jsx(pe,{placeholder:"Select SEO type"})}),e[1]=i):i=e[1];let c;e[2]!==n?(c=n.filter(Ue).map(Be),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==c?(l=a.jsx(de,{children:c}),e[4]=c,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l||e[8]!==o?(d=a.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[r,a.jsxs(ye,{value:o,onValueChange:s,children:[i,l]})]}),e[6]=s,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}function Be(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Ue(t){return t.resolveType.length>0}function Xe(t){const e=F.c(33),{rawSeo:n,innerSeo:o,defaultResolveType:s,seoSchema:r,activeResolveType:i,seoTypeOptions:c,formResetKey:l,siteDefaultSeo:d,onBreadcrumbChange:y,onPersistRaw:p,onInnerChange:f,onClearForm:S,onBumpFormKey:h,beforeFields:m}=t;let g;e[0]!==s||e[1]!==h||e[2]!==S||e[3]!==p?(g=T=>{if(T){const E=me(s);p(E),S(),h();return}p(null),S(),h()},e[0]=s,e[1]=h,e[2]=S,e[3]=p,e[4]=g):g=e[4];const v=g;let R;e[5]!==p||e[6]!==n?(R=T=>{const E=Se(T,n);p(E)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let j;e[8]!==h||e[9]!==f?(j=T=>{f({__resolveType:T}),h()},e[8]=h,e[9]=f,e[10]=j):j=e[10];const P=j;let b;e[11]!==i||e[12]!==P||e[13]!==n||e[14]!==r||e[15]!==c?(b=k(n)&&r&&i&&c&&c.length>0&&a.jsx(Ve,{options:c,value:i,onChange:P}),e[11]=i,e[12]=P,e[13]=n,e[14]=r,e[15]=c,e[16]=b):b=e[16];let _;e[17]!==i||e[18]!==l||e[19]!==o||e[20]!==y||e[21]!==f||e[22]!==n||e[23]!==r||e[24]!==d?(_=k(n)&&r&&i&&a.jsx(Ie,{schema:r,resolveType:i,value:o,formResetKey:l,onChange:T=>f(T),onBreadcrumbChange:y,siteDefaultSeo:d}),e[17]=i,e[18]=l,e[19]=o,e[20]=y,e[21]=f,e[22]=n,e[23]=r,e[24]=d,e[25]=_):_=e[25];let u;return e[26]!==m||e[27]!==x||e[28]!==v||e[29]!==n||e[30]!==b||e[31]!==_?(u=a.jsxs(Oe,{rawSeo:n,onEnableChange:v,onAsyncRenderChange:x,children:[m,b,_]}),e[26]=m,e[27]=x,e[28]=v,e[29]=n,e[30]=b,e[31]=_,e[32]=u):u=e[32],u}export{Xe as P,Ie as S,He as a,Ce as b,Je as c,W as d,Ee as f,k as i,qe as r,w as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as it,r as E,j as e,l as rt}from"./index-DHt9Mf9G.js";import{S as mt,d as pt,a as st,b as at}from"./sheet-C-msc_1A.js";import{S as nt}from"./scroll-area-DVU-pYpl.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-_pRbcmAC.js";import{j as xt}from"./index-CN3cwfwy.js";import"./X-D96et_XK.js";import"./select-BISzCSVs.js";import"./tooltip-DY1LX4fr.js";import"./Check-DwRXhDYN.js";import"./ChevronDown-k1VC2srD.js";import"./ChevronUp-gzUJvPqk.js";import"./label-W8QKQ71a.js";import"./switch-CWfvQ3qI.js";import"./schema-form-CB484siM.js";import"./agent-icon-CEtrmBbc.js";import"./AlertCircle-C8E06jfW.js";import"./Tool01-CBtpfChg.js";import"./SwitchHorizontal01-Caie0gIK.js";import"./RefreshCcw01-B2-HH-To.js";import"./XCircle-toDSs4J6.js";import"./ArrowUpRight-CkF0i1No.js";import"./ZapSquare-D_bnCoLi.js";import"./Users03-CS9FNDsP.js";import"./CheckCircle-2iMrjx7D.js";import"./ChevronLeft-7V2_qQ3E.js";import"./ChevronRight-bA2PmkN9.js";import"./DotsVertical-BZEdPJTY.js";import"./Container-DrffveDY.js";import"./Eye-CbDINxSR.js";import"./ZoomOut-CFJklA2J.js";import"./Globe01-CXHtWC8F.js";import"./FilterLines-DGIJAfna.js";import"./Star01-K2L8_aik.js";import"./Palette-szvJEqXU.js";import"./HardDrive-HIDpzn4I.js";import"./Stars02-nn8T1-WQ.js";import"./Key01-BTeVSARy.js";import"./LinkExternal01-D7lnMhd-.js";import"./Monitor01-F6bKl6tK.js";import"./Sun-Bk5MW5gf.js";import"./Play-sw2az4p0.js";import"./Plus-dxS60FPA.js";import"./SearchMd-88iVjfqP.js";import"./Settings02-CdYsqAUT.js";import"./Shield01-D6lV8m1d.js";import"./Stars01-Bmg9xGSu.js";import"./Trash01-DDKaJVRQ.js";import"./Upload01-B5AbRmag.js";import"./User01-C5NUNAi1.js";import"./Users01-BCOOK-yw.js";import"./XClose-C8XjR0Oj.js";import"./Zap-DPY_aC88.js";import"./calendar-DeW_DdNU.js";import"./input-D2dMhViX.js";import"./popover-CBH5jqt8.js";import"./textarea-C-zVkKAJ.js";import"./dropdown-menu-BXhpM-R_.js";import"./image-field-DInBNYXf.js";import"./dialog-m1msdckr.js";import"./skeleton-HacfcGLU.js";import"./tabs-33vYy1bT.js";import"./use-file-configs-BDCkFZ7E.js";import"./constants-C-D4Pmy6.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./useInfiniteQuery-CWJ6mtkH.js";import"./infiniteQueryObserver-C0HsJFoc.js";import"./agent-capabilities-BLrQsLZt.js";import"./pair-BzvzVihx.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-eq8o4JlH.js";import"./file-type-icon-aSS_wfKX.js";import"./content-blocks-o63cs2vh.js";import"./types-Dl5kxJ-o.js";import"./chat-context-CQlAaKi3.js";import"./tab-id-CuSxDIM1.js";import"./decopilot-sse-pool-BrQw0UAm.js";import"./create-sse-subscription-BS5983N4.js";import"./use-virtual-mcp-Rn9fsUNN.js";import"./use-collections-ZGWkQryR.js";import"./use-ai-providers-BcOqTKKC.js";import"./use-organization-settings-C-jLCwb5.js";import"./shell-layout-xcJQ-oXv.js";import"./avatar-DXqnRYfU.js";import"./required-auth-layout-CceJrchr.js";import"./useRouterState-CXGDCAP4.js";import"./use-org-sso-Lxt3NvQV.js";import"./integration-icon-D5ZAVm0g.js";import"./use-navigate-to-agent-BYyEy_zS.js";import"./use-connection-BAOUEhf6.js";import"./use-mcp-prompts-BJKxU2Na.js";import"./form-DIz1lXzt.js";import"./spinner-CXR5LEFP.js";import"./drawer-KxvT14L5.js";import"./collection-search-BJxAlGyH.js";import"./toggle-group-CoUQzFHk.js";import"./agent-icons-CasiUZSA.js";import"./checkbox-BIvxdAqx.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BZG2d-sE.js";import"./card-DJApDAXW.js";import"./connect-desktop-dialog-Dh1zqCgF.js";import"./command-BFgPrNtf.js";import"./index-CWjORjiD.js";import"./sortable.esm-Dlj8q3TW.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DHoKYS6O.js";import"./use-registry-connections-DWZHQxm0.js";import"./extract-connection-data-CvUd4tJL.js";import"./generate-id-MICojNT7.js";import"./collections-Btisq60d.js";import"./collection-tabs-CbsCH9v8.js";import"./badge-CnPW-GqK.js";import"./connection-form-helpers-q_5sAECo.js";import"./use-infinite-scroll-CAJkZLHC.js";import"./useSuspenseInfiniteQuery-DDVcuWif.js";import"./index-ChQwZqpG.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-BToLUOm_.js";import"./sidebar-C1EbFBeG.js";import"./toolbar-BmXelHzT.js";import"./use-create-virtual-mcp-KZ5vkVjY.js";import"./github-repo-picker-CUBnWzWO.js";import"./use-mcp-tools-ftOL48Fr.js";import"./alert-dialog-jD0HIb4F.js";import"./index-Dla-fDpI.js";import"./use-org-auth-client-YKBoNqBy.js";import"./hover-card-BagBBHwl.js";import"./task-status-DdX5GyQu.js";import"./use-status-sounds-DLyX7i_J.js";import"./empty-state-D3juNsZ6.js";import"./resizable-B9nPHbdY.js";import"./use-capability-BsGHGYLW.js";import"./header-tab-button-BCxnrLni.js";import"./index-Dg2RoULU.js";import"./user-Dh7nE-E-.js";import"./tools-list-CV_q_f0Z.js";import"./use-debounced-autosave-CVMWB9VT.js";import"./index-BWtmYkwi.js";import"./search-input-BMiEmNCi.js";import"./use-secrets-BT7pvkDh.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-7Hq31-jA.js";import"./view-mode-toggle-7zw5kq-m.js";import"./select-model-DYDHHLGi.js";import"./use-automations-BPP1PerV.js";import"./monaco-editor-637MBJHf.js";import"./automation-runs-d4uENwdC.js";import"./table--UQXxBBH.js";import"./use-members-D0MeIqsF.js";import"./automation-list-row-XWf2Pzvs.js";function di(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(jt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),j=m.kind==="page",ot=j?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=j?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!j||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let w;t[0]!==s?(w=vt(s),t[0]=s,t[1]=w):w=t[1];const M=w;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=j&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function jt(u){return u+1}export{di as SeoSheet};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as H,e as $,R as at,H as Dt,G as Ht,j as n,B as Ne,U as Xe,c as q,t as Bt,q as he,F as Ut,a as Wt,K as me,o as ze,n as Oe,f as je,E as qt,z as Vt,bu as De}from"./index-CXD35HrY.js";import{Z as Gt,E as Kt,y as Jt,aa as Xt,M as Qt,r as Qe,L as Yt,K as Zt,a6 as rt,ab as es,ac as ts,A as it,ad as ie,ae as ss,af as ns,ag as ls,b as os}from"./agent-icon-DkS6Ap-C.js";import{t as He}from"./Stars01-BQswryR6.js";import{a as ct,t as as,b as _e,d as rs}from"./XCircle--wEB3Wnr.js";import{i as Be}from"./Check-BbSnE7nF.js";import{i as Ye}from"./ChevronRight-CYgA53ZB.js";import{a as ut,s as is}from"./Eye-CNWO8gM7.js";import{a as de,c as Ze,t as cs}from"./format-time-Cy7tTmZp.js";import{N as dt,R as ft,e as mt,C as us,f as ds,g as fs,u as ms,i as ps,d as xs}from"./scroll-area-huDDjp9h.js";import{u as pt}from"./use-copy-QEEDdK3_.js";import{T as pe,a as xe,b as ge}from"./tooltip-BLOVWRLB.js";import{M as xt,I as gt,F as gs}from"./file-type-icon-Bscuxmvi.js";import{c as hs}from"./content-blocks-o63cs2vh.js";import{g as ht,M as bs}from"./types-BDkt4vmT.js";import{f as $e,i as ys,d as Ue,a as js}from"./chat-context-DzUbC-xr.js";import{S as vs,u as We,c as Ns,b as Ss}from"./constants-_OexfFJl.js";import{m as ks,f as _s,n as ws}from"./tab-id-Bw_e4wJV.js";import{i as bt}from"./AlertCircle-ByuuAmrP.js";import{s as Ce,t as yt}from"./Star01-CNXX9diU.js";import{s as Ts}from"./XClose-SBhbV0jV.js";import{n as jt}from"./ZapSquare-DW4J95z9.js";import{n as vt,i as Cs}from"./Globe01-C0ij8Y-s.js";import{b as $s,i as Is,a as Le}from"./Tool01-Cjv1XJEb.js";import{i as Ms}from"./ZoomOut-1w3s7N6o.js";import{i as Te}from"./Monitor01-CcL8iOzY.js";import{i as Ls}from"./SearchMd-BFlkVflN.js";import{i as Rs}from"./Upload01-CeYSkJhe.js";import{u as As,c as zs}from"./shell-layout-Dgdt_8rv.js";import{n as Nt}from"./LinkExternal01-BDqI6g0z.js";import{I as Ie}from"./integration-icon-DsMTB170.js";import{u as Es}from"./use-virtual-mcp-BRv_CvsW.js";import{a as St}from"./Users03-C9tAd5Ba.js";import{a as ce}from"./Palette-DKpoyUgd.js";import{k as kt}from"./use-navigate-to-agent-D4AslRZm.js";import{a as Ps}from"./use-connection-BP0gNEj8.js";import{s as Fs}from"./Stars02-CSL2rgyN.js";import{g as Os}from"./use-mcp-prompts-Dsxmrp6C.js";import{c as Ds,b as Hs,d as Bs,a as Us,D as Ws}from"./dialog-N8dYL9IV.js";import{a as qs,F as Vs,b as Gs,c as Ks,d as Js,f as Xs}from"./form-BzUl5L3O.js";import{I as Qs}from"./input-C9wjfV7v.js";import{S as Ys}from"./spinner-B0UNMt-U.js";import{t as Zs}from"./ChevronDown-B3TWWBuw.js";const en={openrouter:s=>{const e=s?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function _t(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(en)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function wt(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Tt(s,e){if(!e)return s;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,l=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:s.inputTokens+(e.inputTokens??0),outputTokens:s.outputTokens+(e.outputTokens??0),reasoningTokens:s.reasoningTokens+(e.reasoningTokens??0),totalTokens:s.totalTokens+(e.totalTokens??0),cost:s.cost+_t(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function ca(s){return s.reduce((e,t)=>Tt(e,t.metadata?.usage),wt())}function tn({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:r=500}){const[a,o]=H.useState(null),[u,f]=H.useState(!1),i=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!a)return;let p=a.parentElement;for(;p;){const c=window.getComputedStyle(p);if(c.overflowY==="auto"||c.overflowY==="scroll"||c.overflow==="auto"||c.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!a)return;const p=new IntersectionObserver(c=>{const d=c[0]?.isIntersecting??!1;f(d)},{root:s?.current??null,threshold:i,rootMargin:"0px"});return p.observe(a),()=>p.disconnect()},[a,i]),H.useEffect(()=>{if(!e||!u)return;const p=setInterval(m,r);return()=>clearInterval(p)},[e,u,r]),H.useEffect(()=>{!e||!u||m()},[e,u,...t]),{sentinelRef:o,isTracking:u}}function sn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function qe(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Ve(s,e){if(!e)return s;const t=`${sn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function nn(s,e){return Ve(s,e).replace(/[_-]/g," ").toLowerCase()}function ln(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Xe().min(1,"Required"):Xe();return at(e)}function on(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function an(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:r,defaultValues:a}=s,o=H.useId();let u;if(e[0]!==t){const A=t?ln(t):at({});u=Dt(A),e[0]=t,e[1]=u}else u=e[1];const i=u;let m;e[2]!==a||e[3]!==t?(m=t?on(t,a):{},e[2]=a,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==i||e[6]!==m?(p={resolver:i,defaultValues:m,mode:"onChange"},e[5]=i,e[6]=m,e[7]=p):p=e[7];const c=Ht(p);let d;e[8]!==t?.arguments?(d=t?.arguments??[],e[8]=t?.arguments,e[9]=d):d=e[9];const x=d;let g;e[10]!==c||e[11]!==r||e[12]!==l?(g=async A=>{await r(A),l(null),c.reset()},e[10]=c,e[11]=r,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==c||e[15]!==l?(h=A=>{A||(c.reset(),l(null))},e[14]=c,e[15]=l,e[16]=h):h=e[16];const N=h;if(!t)return null;let j;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(j=t.title||nn(t.name,qe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=j):j=e[20];let S;e[21]!==j?(S=n.jsx(Ds,{children:n.jsx("span",{className:"capitalize",children:j})}),e[21]=j,e[22]=S):S=e[22];let y;e[23]!==t.description?(y=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==S?(v=n.jsxs(Hs,{children:[S,y]}),e[25]=y,e[26]=S,e[27]=v):v=e[27];let k;e[28]!==c||e[29]!==b?(k=A=>{A.stopPropagation(),c.handleSubmit(b)(A)},e[28]=c,e[29]=b,e[30]=k):k=e[30];let _;if(e[31]!==x||e[32]!==c.control||e[33]!==c.formState.isSubmitting){let A;e[35]!==c.control||e[36]!==c.formState.isSubmitting?(A=z=>n.jsx(Vs,{control:c.control,name:z.name,render:O=>{const{field:U}=O;return n.jsxs(Gs,{children:[n.jsxs(Ks,{className:"text-xs",children:[z.name,z.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(Js,{children:n.jsx(Qs,{...U,value:U.value??"",required:z.required,placeholder:z.description??"",className:"h-9",disabled:c.formState.isSubmitting})}),n.jsx(Xs,{})]})}},z.name),e[35]=c.control,e[36]=c.formState.isSubmitting,e[37]=A):A=e[37],_=x.map(A),e[31]=x,e[32]=c.control,e[33]=c.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==N?(w=()=>N(!1),e[38]=N,e[39]=w):w=e[39];let T;e[40]!==c.formState.isSubmitting||e[41]!==w?(T=n.jsx(Ne,{type:"button",variant:"ghost",onClick:w,disabled:c.formState.isSubmitting,children:"Cancel"}),e[40]=c.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==c.formState.isSubmitting?(I=c.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ys,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=c.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==c.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(Ne,{type:"submit",form:o,disabled:c.formState.isSubmitting,children:I}),e[45]=c.formState.isSubmitting,e[46]=o,e[47]=I,e[48]=M):M=e[48];let C;e[49]!==T||e[50]!==M?(C=n.jsxs(Bs,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let L;e[52]!==o||e[53]!==k||e[54]!==_||e[55]!==C?(L=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:k,children:[_,C]}),e[52]=o,e[53]=k,e[54]=_,e[55]=C,e[56]=L):L=e[56];let R;e[57]!==c||e[58]!==L?(R=n.jsx(qs,{...c,children:L}),e[57]=c,e[58]=L,e[59]=R):R=e[59];let F;e[60]!==v||e[61]!==R?(F=n.jsxs(Us,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,R]}),e[60]=v,e[61]=R,e[62]=F):F=e[62];let E;return e[63]!==N||e[64]!==F?(E=n.jsx(Ws,{open:!0,onOpenChange:N,children:F}),e[63]=N,e[64]=F,e[65]=E):E=e[65],E}function Ct(s){return s?s.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function re(s,e){return s==="output-error"||s==="output-denied"?"error":s==="approval-requested"?"approval":s==="input-streaming"||s==="input-available"||s==="output-available"&&e===!0?"loading":"idle"}function ve(s){if(s==null||typeof s!="object")return;const e=s;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return s}function rn(s){return s.storage.mention}function ua(s,e,t){s.chain().focus().insertContentAt(e,[$t(t),{type:"text",text:" "}]).run()}function $t(s){return{type:"mention",attrs:s}}function cn(s){const e=$.c(19),{node:t,selected:l,view:r,editor:a,getPos:o}=s,{name:u,char:f,kind:i,id:m,args:p}=t.attrs,c=l&&r.editable,d=f==="@",x=r.editable&&f==="/"&&i!=="resource";let g;e[0]!==p||e[1]!==a||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==u?(g=_=>{if(!x)return;const T=rn(a)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:u,args:p??{},pos:I}))},e[0]=p,e[1]=a,e[2]=o,e[3]=m,e[4]=x,e[5]=u,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",N=d?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",j=c&&"outline-2 outline-blue-300 outline-offset-0",S=x&&"hover:brightness-95";let y;e[7]!==h||e[8]!==N||e[9]!==j||e[10]!==S?(y=q("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",N,j,S,"capitalize"),e[7]=h,e[8]=N,e[9]=j,e[10]=S,e[11]=y):y=e[11];let v;e[12]!==u?(v=u?Ct(u):"",e[12]=u,e[13]=v):v=e[13];let k;return e[14]!==f||e[15]!==b||e[16]!==y||e[17]!==v?(k=n.jsxs(mt,{onClick:b,className:y,children:[f,v]}),e[14]=f,e[15]=b,e[16]=y,e[17]=v,e[18]=k):k=e[18],k}const un=dt.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},char:{default:"/",parseHTML:s=>s.getAttribute("data-char")||"/",renderHTML:s=>s.char?{"data-char":s.char}:{}},metadata:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:s=>s.metadata?{"data-metadata":JSON.stringify(s.metadata)}:{}},kind:{default:null,parseHTML:s=>s.getAttribute("data-kind")||null,renderHTML:s=>s.kind?{"data-kind":s.kind}:{}},args:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-args")||"null")}catch{return null}},renderHTML:s=>s.args?{"data-args":JSON.stringify(s.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"mention"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.char&&(t["data-char"]=s.attrs.char),s.attrs.metadata&&(t["data-metadata"]=JSON.stringify(s.attrs.metadata)),s.attrs.kind&&(t["data-kind"]=s.attrs.kind),s.attrs.args&&(t["data-args"]=JSON.stringify(s.attrs.args)),["span",{...e,...t}]},renderText({node:s}){const e=s.attrs.char??"@",t=s.attrs.name??"";return`${e}${t}`},addNodeView(){return ft(cn)}}),dn=/^mcp__[a-zA-Z0-9_-]+__/;function It(s){return s.replace(dn,"")}function Ge(s){const e=$.c(17),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o}=s,u=r===void 0?!1:r,f=o===void 0?!1:o,{handleCopy:i}=pt(),[m,p]=H.useState(!1);let c;e[0]!==i||e[1]!==t||e[2]!==l.text?(c=async()=>{Bt("chat_message_copied",{message_id:t,chars:l.text.length}),await i(l.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=i,e[1]=t,e[2]=l.text,e[3]=c):c=e[3];const d=c,x=u&&a,g=x||a;let b;e[4]!==t||e[5]!==l.text?(b=n.jsx(xt,{id:t,text:l.text}),e[4]=t,e[5]=l.text,e[6]=b):b=e[6];let h;e[7]!==f||e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==g||e[12]!==x?(h=g&&n.jsxs("div",{className:q("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",f?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,x&&a&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),x&&n.jsx("button",{type:"button",onClick:d,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:m?n.jsx(Be,{className:"size-4"}):n.jsx(ut,{className:"size-4"})})]}),e[7]=f,e[8]=a,e[9]=d,e[10]=m,e[11]=g,e[12]=x,e[13]=h):h=e[13];let N;return e[14]!==b||e[15]!==h?(N=n.jsxs("div",{className:"group/part relative",children:[b,h]}),e[14]=b,e[15]=h,e[16]=N):N=e[16],N}function da(s,e,t){s.chain().focus().insertContentAt(e,[fn(t),{type:"text",text:" "}]).run()}function fn(s){return{type:"file",attrs:s}}function mn(s){const e=$.c(17),{node:t,selected:l,view:r}=s,{name:a,mimeType:o,data:u}=t.attrs,f=l&&r.editable;let i;e[0]!==o?(i=o.startsWith("image/"),e[0]=o,e[1]=i):i=e[1];const m=i,p=f&&"outline-2 outline-blue-300 outline-offset-0";let c;e[2]!==p?(c=q("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",p),e[2]=p,e[3]=c):c=e[3];let d;e[4]!==a?(d=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:a})}),e[4]=a,e[5]=d):d=e[5];let x;e[6]!==u||e[7]!==m||e[8]!==o||e[9]!==a?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${u}`,alt:a,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:a}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=u,e[7]=m,e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==d||e[12]!==x?(g=n.jsxs(ge,{children:[d,x]}),e[11]=d,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==c||e[15]!==g?(b=n.jsx(mt,{className:c,children:g}),e[14]=c,e[15]=g,e[16]=b):b=e[16],b}const pn=dt.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},mimeType:{default:null,parseHTML:s=>s.getAttribute("data-mime-type")||null,renderHTML:s=>s.mimeType?{"data-mime-type":s.mimeType}:{}},size:{default:0,parseHTML:s=>{const e=s.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:s=>s.size?{"data-size":String(s.size)}:{}},data:{default:null,parseHTML:s=>s.getAttribute("data-data")||null,renderHTML:s=>s.data?{"data-data":s.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"file"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.mimeType&&(t["data-mime-type"]=s.attrs.mimeType),s.attrs.size&&(t["data-size"]=String(s.attrs.size)),s.attrs.data&&(t["data-data"]=s.attrs.data),["span",{...e,...t}]},renderText({node:s}){return`[${s.attrs.name??""}]`},addNodeView(){return ft(mn)}}),fe=16,Ee=2.5,Pe=(fe-Ee)/2,Re=2*Math.PI*Pe;function xn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:r,outputTokens:a,cost:o}=t;if(!l&&!r&&!a)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Gt,{size:12}),e[0]=u):u=e[0];let f;e[1]!==o||e[2]!==l?(f=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=f):f=e[3];let i;e[4]!==f?(i=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[u,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:f})]})}),e[4]=f,e[5]=i):i=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let c;e[8]!==r?(c=r.toLocaleString(),e[8]=r,e[9]=c):c=e[9];let d;e[10]!==c?(d=n.jsx("span",{className:"text-right tabular-nums",children:c}),e[10]=c,e[11]=d):d=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-muted",children:"out"}),e[12]=x):x=e[12];const g=a-(t.reasoningTokens??0);let b;e[13]!==g?(b=g.toLocaleString(),e[13]=g,e[14]=b):b=e[14];let h;e[15]!==b?(h=n.jsx("span",{className:"text-right tabular-nums",children:b}),e[15]=b,e[16]=h):h=e[16];let N;e[17]!==r||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(N=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:r>0?`${(t.cacheReadTokens/r*100).toFixed(0)}%`:"0%"})]}),e[17]=r,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=N):N=e[20];let j;e[21]!==o?(j=o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",o.toFixed(4)]})]}),e[21]=o,e[22]=j):j=e[22];let S;e[23]!==h||e[24]!==N||e[25]!==j||e[26]!==d?(S=n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[m,n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p,d,x,h,N,j]})]}),e[23]=h,e[24]=N,e[25]=j,e[26]=d,e[27]=S):S=e[27];let y;return e[28]!==S||e[29]!==i?(y=n.jsxs(ge,{children:[i,S]}),e[28]=S,e[29]=i,e[30]=y):y=e[30],y}function gn(s){const e=$.c(19),{usage:t,duration:l}=s,r=l!=null&&l>0,a=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!r&&!a&&!o)return null;let u;e[0]!==l||e[1]!==r?(u=r?de(l/1e3):null,e[0]=l,e[1]=r,e[2]=u):u=e[2];const f=u;let i;e[3]!==l||e[4]!==f||e[5]!==t?(i=f&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:f})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),n.jsx("span",{className:"tabular-nums",children:de(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=f,e[5]=t,e[6]=i):i=e[6];let m;e[7]!==a||e[8]!==r||e[9]!==o?(m=r&&(a||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=a,e[8]=r,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==a||e[12]!==o||e[13]!==t?(p=(a||o)&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:a?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[n.jsx("span",{className:"opacity-60",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),n.jsx("span",{className:"opacity-60",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"think"}),n.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:(t?.inputTokens??0)>0?`${((t?.cacheReadTokens??0)/t.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=a,e[12]=o,e[13]=t,e[14]=p):p=e[14];let c;return e[15]!==i||e[16]!==m||e[17]!==p?(c=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[i,m,p]}),e[15]=i,e[16]=m,e[17]=p,e[18]=c):c=e[18],c}function fa(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:r,onOpenContextPanel:a}=s,o=Math.min(l/r*100,100),u=Re-o/100*Re,f=t?.cost??0,i=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==f?(c=f>0?`, $${f.toFixed(2)}`:"",e[2]=f,e[3]=c):c=e[3];const d=`Context usage: ${p}%${c}`,x=a?"cursor-pointer":"cursor-default";let g;e[4]!==x?(g=q("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=g):g=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("circle",{cx:fe/2,cy:fe/2,r:Pe,fill:"none",stroke:"currentColor",strokeWidth:Ee,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let N;e[7]!==h?(N=q(h),e[7]=h,e[8]=N):N=e[8];let j;e[9]!==u||e[10]!==N?(j=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Pe,fill:"none",stroke:"currentColor",strokeWidth:Ee,strokeDasharray:Re,strokeDashoffset:u,strokeLinecap:"round",className:N})]}),e[9]=u,e[10]=N,e[11]=j):j=e[11];let S;e[12]!==o?(S=o.toFixed(0),e[12]=o,e[13]=S):S=e[13];let y;e[14]!==f?(y=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,e[15]=y):y=e[15];let v;e[16]!==S||e[17]!==y?(v=n.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[S,"%",y]}),e[16]=S,e[17]=y,e[18]=v):v=e[18];let k;e[19]!==a||e[20]!==v||e[21]!==d||e[22]!==g||e[23]!==j?(k=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":d,className:g,children:[j,v]})}),e[19]=a,e[20]=v,e[21]=d,e[22]=g,e[23]=j,e[24]=k):k=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=_):_=e[25];let w;e[26]!==l?(w=l.toLocaleString(),e[26]=l,e[27]=w):w=e[27];let T;e[28]!==r?(T=r.toLocaleString(),e[28]=r,e[29]=T):T=e[29];let I;e[30]!==o?(I=o.toFixed(1),e[30]=o,e[31]=I):I=e[31];let M;e[32]!==w||e[33]!==T||e[34]!==I?(M=n.jsxs("span",{className:"text-right tabular-nums",children:[w," / ",T," (",I,"%)"]}),e[32]=w,e[33]=T,e[34]=I,e[35]=M):M=e[35];let C;e[36]!==f||e[37]!==i||e[38]!==m?(C=f>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",f.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:i.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=f,e[37]=i,e[38]=m,e[39]=C):C=e[39];let L;e[40]!==i||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(L=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:i>0?`${((t?.cacheReadTokens??0)/i*100).toFixed(0)}%`:"0%"})]}),e[40]=i,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=L):L=e[43];let R;e[44]!==M||e[45]!==C||e[46]!==L?(R=n.jsx(xe,{side:"top",className:"font-mono text-[11px]",children:n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[_,M,C,L]})}),e[44]=M,e[45]=C,e[46]=L,e[47]=R):R=e[47];let F;return e[48]!==k||e[49]!==R?(F=n.jsxs(ge,{children:[k,R]}),e[48]=k,e[49]=R,e[50]=F):F=e[50],F}function hn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(fs,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function bn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(us,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function yn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(ds,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function D(s){const e=$.c(53),{icon:t,title:l,usage:r,summary:a,state:o,detail:u,detailVariant:f,forceOpen:i,variant:m,trailing:p,iconDestructive:c,alwaysChevron:d,defaultOpen:x,children:g}=s,b=f===void 0?"code":f,h=m===void 0?"default":m,[N,j]=H.useState(x??!1),{handleCopy:S,copied:y}=pt(),v=o==="loading",k=o==="error";let _;e[0]!==u?(_=u&&u.trim(),e[0]=u,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(i??!1)||N,C=H.useRef(null),L=v&&M;let R;e[2]!==u?(R=[u],e[2]=u,e[3]=R):R=e[3];let F;e[4]!==L||e[5]!==R?(F={containerRef:C,enabled:L,contentDeps:R},e[4]=L,e[5]=R,e[6]=F):F=e[6];const{sentinelRef:E}=tn(F),A=i?void 0:j,z=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",U=!T&&"cursor-default",W=v&&"shimmer";let V;e[7]!==U||e[8]!==W||e[9]!==O?(V=q("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",O,U,W),e[7]=U,e[8]=W,e[9]=O,e[10]=V):V=e[10];const ne=!T;let X;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==c||e[15]!==k||e[16]!==T?(X=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?n.jsx(Ye,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:q("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",c?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",T&&(M?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),T&&n.jsx("div",{className:q("absolute inset-0 flex items-center justify-center transition-opacity duration-150",M?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(Ye,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=d,e[12]=M,e[13]=t,e[14]=c,e[15]=k,e[16]=T,e[17]=X):X=e[17];const Q=k?"text-warning/80":"text-foreground";let J;e[18]!==Q?(J=q("shrink-0 text-[14px] font-normal",Q),e[18]=Q,e[19]=J):J=e[19];let ee;e[20]!==J||e[21]!==l?(ee=n.jsx("span",{className:J,children:l}),e[20]=J,e[21]=l,e[22]=ee):ee=e[22];let P;e[23]!==a?(P=a?n.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:a})}):n.jsx("div",{className:"flex-1"}),e[23]=a,e[24]=P):P=e[24];let B;e[25]!==p?(B=p&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:p}),e[25]=p,e[26]=B):B=e[26];let G;e[27]!==r?(G=n.jsx(xn,{usage:r}),e[27]=r,e[28]=G):G=e[28];let K;e[29]!==V||e[30]!==ne||e[31]!==X||e[32]!==ee||e[33]!==P||e[34]!==B||e[35]!==G||e[36]!==z?(K=n.jsxs(bn,{disabled:z,className:V,"aria-disabled":ne,children:[X,ee,P,B,G]}),e[29]=V,e[30]=ne,e[31]=X,e[32]=ee,e[33]=P,e[34]=B,e[35]=G,e[36]=z,e[37]=K):K=e[37];let Y;e[38]!==g||e[39]!==y||e[40]!==u||e[41]!==b||e[42]!==S||e[43]!==T||e[44]!==E?(Y=T&&n.jsx(yn,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:g||(b==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsxs("div",{ref:C,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:[n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:u}),n.jsx("div",{ref:E,className:"h-0 shrink-0"})]})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsxs("div",{ref:C,className:"flex flex-col max-h-48 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u})}),n.jsx("button",{type:"button",onClick:()=>S(u),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:y?n.jsx(Be,{className:"size-3.5"}):n.jsx(ut,{className:"size-3.5"})})]}),n.jsx("div",{ref:E,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=y,e[40]=u,e[41]=b,e[42]=S,e[43]=T,e[44]=E,e[45]=Y):Y=e[45];let ue;e[46]!==M||e[47]!==K||e[48]!==Y||e[49]!==A?(ue=n.jsxs(hn,{open:M,onOpenChange:A,className:"min-w-0",children:[K,Y]}),e[46]=M,e[47]=K,e[48]=Y,e[49]=A,e[50]=ue):ue=e[50];const le=ue;if(I){let oe;return e[51]!==le?(oe=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:le}),e[51]=le,e[52]=oe):oe=e[52],oe}return le}function Z(s){const e=$.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=de(t),e[0]=t,e[1]=l):l=e[1];let r;return e[2]!==l?(r=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=r):r=e[3],r}const Mt=4;function Lt(s){const e=$.c(5),{count:t,noun:l,onClick:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ct,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=a):a=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==r?(o=n.jsxs("button",{type:"button",onClick:r,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",t," ",l,a]}),e[1]=t,e[2]=l,e[3]=r,e[4]=o):o=e[4],o}function jn(s){const e=$.c(27),{org:t}=he(),l=Ut(),r=ks();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:vs,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const o=We(a);let u;e[3]!==o||e[4]!==s?(u=async b=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=await o.callTool({name:"COLLECTION_THREADS_GET",arguments:{id:s}}),j=(h.structuredContent??h).item?.metadata??{},y=(j.expanded_tools??[]).filter(k=>k.toolName!==b.toolName);y.push({...b,expandedAt:new Date().toISOString()});const v={...j,expanded_tools:y};return await o.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:s,data:{metadata:v}}}),y},e[3]=o,e[4]=s,e[5]=u):u=e[5];let f,i,m;e[6]!==t.id||e[7]!==l||e[8]!==s?(f=async b=>{const h=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:h});const N=l.getQueryData(h),S=(N?.metadata?.expanded_tools??[]).filter(y=>y.toolName!==b.toolName);return S.push({...b,expandedAt:new Date().toISOString()}),l.setQueryData(h,y=>y&&{...y,metadata:{...y.metadata??{},expanded_tools:S}}),{previous:N}},i=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},m=(b,h,N)=>{const j=me.ensureTask(t.id,s??"");N?.previous===void 0?l.removeQueries({queryKey:j,exact:!0}):l.setQueryData(j,N.previous),ze.error(b instanceof Error?b.message:"Failed to expand tool")},e[6]=t.id,e[7]=l,e[8]=s,e[9]=f,e[10]=i,e[11]=m):(f=e[9],i=e[10],m=e[11]);let p;e[12]!==u||e[13]!==f||e[14]!==i||e[15]!==m?(p={mutationFn:u,onMutate:f,onSuccess:i,onError:m},e[12]=u,e[13]=f,e[14]=i,e[15]=m,e[16]=p):p=e[16];const c=Wt(p);let d;e[17]!==r||e[18]!==c||e[19]!==t.id||e[20]!==l||e[21]!==s?(d=b=>{if(!s||!r)return;const h=me.ensureTask(t.id,s),N=l.getQueryData(h),S=(N?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==b.toolName);S.push({...b,expandedAt:new Date().toISOString()});const y={...N?.metadata??{},expanded_tools:S};l.setQueryData(h,v=>v&&{...v,metadata:y}),r.patchThread({id:s,metadata:y}),c.mutate(b)},e[17]=r,e[18]=c,e[19]=t.id,e[20]=l,e[21]=s,e[22]=d):d=e[22];const x=d;let g;return e[23]!==x||e[24]!==c.isPending||e[25]!==c.mutate?(g={addOrReplace:c.mutate,addOrReplaceEager:x,isPending:c.isPending},e[23]=x,e[24]=c.isPending,e[25]=c.mutate,e[26]=g):g=e[26],g}function vn(s,e,t,l){const{data:r,isLoading:a}=Oe({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await Ns({connectionId:e,orgId:t,orgSlug:l});try{const{tools:u}=await o.listTools(),f=It(s);return u.find(i=>i.name===f)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:r??void 0,isLoading:a}}const Nn={read:{icon:Qe,label:"Read File"},write:{icon:Is,label:"Write File"},edit:{icon:Zt,label:"Edit File"},grep:{icon:Ls,label:"Search Content"},glob:{icon:Ms,label:"Find Files"},bash:{icon:Yt,label:"Run Command"},read_tool_output:{icon:Qe,label:"Read Tool Output"},read_resource:{icon:Qt,label:"Read Resource"},read_prompt:{icon:jt,label:"Read Prompt"},enable_tool:{icon:$s,label:"Enable Tool"},open_in_agent:{icon:Xt,label:"Open in Agent"},sandbox:{icon:Jt,label:"Run Code"},copy_to_sandbox:{icon:vt,label:"Load File"},share_with_user:{icon:Rs,label:"Share with User"},take_screenshot:{icon:Te,label:"Take Screenshot"},scrape_url:{icon:Ce,label:"Scrape URL"},inspect_page:{icon:Kt,label:"Inspect Page"}};function Ke(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ye(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}const Sn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function kn(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
|
|
1
|
+
import{r as H,e as $,R as at,H as Dt,G as Ht,j as n,B as Ne,U as Xe,c as q,t as Bt,q as he,F as Ut,a as Wt,K as me,o as ze,n as Oe,f as je,E as qt,z as Vt,bu as De}from"./index-DHt9Mf9G.js";import{Z as Gt,E as Kt,y as Jt,aa as Xt,M as Qt,r as Qe,L as Yt,K as Zt,a6 as rt,ab as es,ac as ts,A as it,ad as ie,ae as ss,af as ns,ag as ls,b as os}from"./agent-icon-CEtrmBbc.js";import{t as He}from"./Stars01-Bmg9xGSu.js";import{a as ct,t as as,b as _e,d as rs}from"./XCircle-toDSs4J6.js";import{i as Be}from"./Check-DwRXhDYN.js";import{i as Ye}from"./ChevronRight-bA2PmkN9.js";import{a as ut,s as is}from"./Eye-CbDINxSR.js";import{a as de,c as Ze,t as cs}from"./format-time-Cy7tTmZp.js";import{N as dt,R as ft,e as mt,C as us,f as ds,g as fs,u as ms,i as ps,d as xs}from"./scroll-area-DVU-pYpl.js";import{u as pt}from"./use-copy-eq8o4JlH.js";import{T as pe,a as xe,b as ge}from"./tooltip-DY1LX4fr.js";import{M as xt,I as gt,F as gs}from"./file-type-icon-aSS_wfKX.js";import{c as hs}from"./content-blocks-o63cs2vh.js";import{g as ht,M as bs}from"./types-Dl5kxJ-o.js";import{f as $e,i as ys,d as Ue,a as js}from"./chat-context-CQlAaKi3.js";import{S as vs,u as We,c as Ns,b as Ss}from"./constants-C-D4Pmy6.js";import{m as ks,f as _s,n as ws}from"./tab-id-CuSxDIM1.js";import{i as bt}from"./AlertCircle-C8E06jfW.js";import{s as Ce,t as yt}from"./Star01-K2L8_aik.js";import{s as Ts}from"./XClose-C8XjR0Oj.js";import{n as jt}from"./ZapSquare-D_bnCoLi.js";import{n as vt,i as Cs}from"./Globe01-CXHtWC8F.js";import{b as $s,i as Is,a as Le}from"./Tool01-CBtpfChg.js";import{i as Ms}from"./ZoomOut-CFJklA2J.js";import{i as Te}from"./Monitor01-F6bKl6tK.js";import{i as Ls}from"./SearchMd-88iVjfqP.js";import{i as Rs}from"./Upload01-B5AbRmag.js";import{u as As,c as zs}from"./shell-layout-xcJQ-oXv.js";import{n as Nt}from"./LinkExternal01-D7lnMhd-.js";import{I as Ie}from"./integration-icon-D5ZAVm0g.js";import{u as Es}from"./use-virtual-mcp-Rn9fsUNN.js";import{a as St}from"./Users03-CS9FNDsP.js";import{a as ce}from"./Palette-szvJEqXU.js";import{k as kt}from"./use-navigate-to-agent-BYyEy_zS.js";import{a as Ps}from"./use-connection-BAOUEhf6.js";import{s as Fs}from"./Stars02-nn8T1-WQ.js";import{g as Os}from"./use-mcp-prompts-BJKxU2Na.js";import{c as Ds,b as Hs,d as Bs,a as Us,D as Ws}from"./dialog-m1msdckr.js";import{a as qs,F as Vs,b as Gs,c as Ks,d as Js,f as Xs}from"./form-DIz1lXzt.js";import{I as Qs}from"./input-D2dMhViX.js";import{S as Ys}from"./spinner-CXR5LEFP.js";import{t as Zs}from"./ChevronDown-k1VC2srD.js";const en={openrouter:s=>{const e=s?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function _t(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(en)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function wt(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Tt(s,e){if(!e)return s;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,l=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:s.inputTokens+(e.inputTokens??0),outputTokens:s.outputTokens+(e.outputTokens??0),reasoningTokens:s.reasoningTokens+(e.reasoningTokens??0),totalTokens:s.totalTokens+(e.totalTokens??0),cost:s.cost+_t(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function ca(s){return s.reduce((e,t)=>Tt(e,t.metadata?.usage),wt())}function tn({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:r=500}){const[a,o]=H.useState(null),[u,f]=H.useState(!1),i=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!a)return;let p=a.parentElement;for(;p;){const c=window.getComputedStyle(p);if(c.overflowY==="auto"||c.overflowY==="scroll"||c.overflow==="auto"||c.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!a)return;const p=new IntersectionObserver(c=>{const d=c[0]?.isIntersecting??!1;f(d)},{root:s?.current??null,threshold:i,rootMargin:"0px"});return p.observe(a),()=>p.disconnect()},[a,i]),H.useEffect(()=>{if(!e||!u)return;const p=setInterval(m,r);return()=>clearInterval(p)},[e,u,r]),H.useEffect(()=>{!e||!u||m()},[e,u,...t]),{sentinelRef:o,isTracking:u}}function sn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function qe(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Ve(s,e){if(!e)return s;const t=`${sn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function nn(s,e){return Ve(s,e).replace(/[_-]/g," ").toLowerCase()}function ln(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Xe().min(1,"Required"):Xe();return at(e)}function on(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function an(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:r,defaultValues:a}=s,o=H.useId();let u;if(e[0]!==t){const A=t?ln(t):at({});u=Dt(A),e[0]=t,e[1]=u}else u=e[1];const i=u;let m;e[2]!==a||e[3]!==t?(m=t?on(t,a):{},e[2]=a,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==i||e[6]!==m?(p={resolver:i,defaultValues:m,mode:"onChange"},e[5]=i,e[6]=m,e[7]=p):p=e[7];const c=Ht(p);let d;e[8]!==t?.arguments?(d=t?.arguments??[],e[8]=t?.arguments,e[9]=d):d=e[9];const x=d;let g;e[10]!==c||e[11]!==r||e[12]!==l?(g=async A=>{await r(A),l(null),c.reset()},e[10]=c,e[11]=r,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==c||e[15]!==l?(h=A=>{A||(c.reset(),l(null))},e[14]=c,e[15]=l,e[16]=h):h=e[16];const N=h;if(!t)return null;let j;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(j=t.title||nn(t.name,qe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=j):j=e[20];let S;e[21]!==j?(S=n.jsx(Ds,{children:n.jsx("span",{className:"capitalize",children:j})}),e[21]=j,e[22]=S):S=e[22];let y;e[23]!==t.description?(y=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==S?(v=n.jsxs(Hs,{children:[S,y]}),e[25]=y,e[26]=S,e[27]=v):v=e[27];let k;e[28]!==c||e[29]!==b?(k=A=>{A.stopPropagation(),c.handleSubmit(b)(A)},e[28]=c,e[29]=b,e[30]=k):k=e[30];let _;if(e[31]!==x||e[32]!==c.control||e[33]!==c.formState.isSubmitting){let A;e[35]!==c.control||e[36]!==c.formState.isSubmitting?(A=z=>n.jsx(Vs,{control:c.control,name:z.name,render:O=>{const{field:U}=O;return n.jsxs(Gs,{children:[n.jsxs(Ks,{className:"text-xs",children:[z.name,z.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(Js,{children:n.jsx(Qs,{...U,value:U.value??"",required:z.required,placeholder:z.description??"",className:"h-9",disabled:c.formState.isSubmitting})}),n.jsx(Xs,{})]})}},z.name),e[35]=c.control,e[36]=c.formState.isSubmitting,e[37]=A):A=e[37],_=x.map(A),e[31]=x,e[32]=c.control,e[33]=c.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==N?(w=()=>N(!1),e[38]=N,e[39]=w):w=e[39];let T;e[40]!==c.formState.isSubmitting||e[41]!==w?(T=n.jsx(Ne,{type:"button",variant:"ghost",onClick:w,disabled:c.formState.isSubmitting,children:"Cancel"}),e[40]=c.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==c.formState.isSubmitting?(I=c.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ys,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=c.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==c.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(Ne,{type:"submit",form:o,disabled:c.formState.isSubmitting,children:I}),e[45]=c.formState.isSubmitting,e[46]=o,e[47]=I,e[48]=M):M=e[48];let C;e[49]!==T||e[50]!==M?(C=n.jsxs(Bs,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let L;e[52]!==o||e[53]!==k||e[54]!==_||e[55]!==C?(L=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:k,children:[_,C]}),e[52]=o,e[53]=k,e[54]=_,e[55]=C,e[56]=L):L=e[56];let R;e[57]!==c||e[58]!==L?(R=n.jsx(qs,{...c,children:L}),e[57]=c,e[58]=L,e[59]=R):R=e[59];let F;e[60]!==v||e[61]!==R?(F=n.jsxs(Us,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,R]}),e[60]=v,e[61]=R,e[62]=F):F=e[62];let E;return e[63]!==N||e[64]!==F?(E=n.jsx(Ws,{open:!0,onOpenChange:N,children:F}),e[63]=N,e[64]=F,e[65]=E):E=e[65],E}function Ct(s){return s?s.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function re(s,e){return s==="output-error"||s==="output-denied"?"error":s==="approval-requested"?"approval":s==="input-streaming"||s==="input-available"||s==="output-available"&&e===!0?"loading":"idle"}function ve(s){if(s==null||typeof s!="object")return;const e=s;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return s}function rn(s){return s.storage.mention}function ua(s,e,t){s.chain().focus().insertContentAt(e,[$t(t),{type:"text",text:" "}]).run()}function $t(s){return{type:"mention",attrs:s}}function cn(s){const e=$.c(19),{node:t,selected:l,view:r,editor:a,getPos:o}=s,{name:u,char:f,kind:i,id:m,args:p}=t.attrs,c=l&&r.editable,d=f==="@",x=r.editable&&f==="/"&&i!=="resource";let g;e[0]!==p||e[1]!==a||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==u?(g=_=>{if(!x)return;const T=rn(a)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:u,args:p??{},pos:I}))},e[0]=p,e[1]=a,e[2]=o,e[3]=m,e[4]=x,e[5]=u,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",N=d?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",j=c&&"outline-2 outline-blue-300 outline-offset-0",S=x&&"hover:brightness-95";let y;e[7]!==h||e[8]!==N||e[9]!==j||e[10]!==S?(y=q("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",N,j,S,"capitalize"),e[7]=h,e[8]=N,e[9]=j,e[10]=S,e[11]=y):y=e[11];let v;e[12]!==u?(v=u?Ct(u):"",e[12]=u,e[13]=v):v=e[13];let k;return e[14]!==f||e[15]!==b||e[16]!==y||e[17]!==v?(k=n.jsxs(mt,{onClick:b,className:y,children:[f,v]}),e[14]=f,e[15]=b,e[16]=y,e[17]=v,e[18]=k):k=e[18],k}const un=dt.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},char:{default:"/",parseHTML:s=>s.getAttribute("data-char")||"/",renderHTML:s=>s.char?{"data-char":s.char}:{}},metadata:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:s=>s.metadata?{"data-metadata":JSON.stringify(s.metadata)}:{}},kind:{default:null,parseHTML:s=>s.getAttribute("data-kind")||null,renderHTML:s=>s.kind?{"data-kind":s.kind}:{}},args:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-args")||"null")}catch{return null}},renderHTML:s=>s.args?{"data-args":JSON.stringify(s.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"mention"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.char&&(t["data-char"]=s.attrs.char),s.attrs.metadata&&(t["data-metadata"]=JSON.stringify(s.attrs.metadata)),s.attrs.kind&&(t["data-kind"]=s.attrs.kind),s.attrs.args&&(t["data-args"]=JSON.stringify(s.attrs.args)),["span",{...e,...t}]},renderText({node:s}){const e=s.attrs.char??"@",t=s.attrs.name??"";return`${e}${t}`},addNodeView(){return ft(cn)}}),dn=/^mcp__[a-zA-Z0-9_-]+__/;function It(s){return s.replace(dn,"")}function Ge(s){const e=$.c(17),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o}=s,u=r===void 0?!1:r,f=o===void 0?!1:o,{handleCopy:i}=pt(),[m,p]=H.useState(!1);let c;e[0]!==i||e[1]!==t||e[2]!==l.text?(c=async()=>{Bt("chat_message_copied",{message_id:t,chars:l.text.length}),await i(l.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=i,e[1]=t,e[2]=l.text,e[3]=c):c=e[3];const d=c,x=u&&a,g=x||a;let b;e[4]!==t||e[5]!==l.text?(b=n.jsx(xt,{id:t,text:l.text}),e[4]=t,e[5]=l.text,e[6]=b):b=e[6];let h;e[7]!==f||e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==g||e[12]!==x?(h=g&&n.jsxs("div",{className:q("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",f?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,x&&a&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),x&&n.jsx("button",{type:"button",onClick:d,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:m?n.jsx(Be,{className:"size-4"}):n.jsx(ut,{className:"size-4"})})]}),e[7]=f,e[8]=a,e[9]=d,e[10]=m,e[11]=g,e[12]=x,e[13]=h):h=e[13];let N;return e[14]!==b||e[15]!==h?(N=n.jsxs("div",{className:"group/part relative",children:[b,h]}),e[14]=b,e[15]=h,e[16]=N):N=e[16],N}function da(s,e,t){s.chain().focus().insertContentAt(e,[fn(t),{type:"text",text:" "}]).run()}function fn(s){return{type:"file",attrs:s}}function mn(s){const e=$.c(17),{node:t,selected:l,view:r}=s,{name:a,mimeType:o,data:u}=t.attrs,f=l&&r.editable;let i;e[0]!==o?(i=o.startsWith("image/"),e[0]=o,e[1]=i):i=e[1];const m=i,p=f&&"outline-2 outline-blue-300 outline-offset-0";let c;e[2]!==p?(c=q("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",p),e[2]=p,e[3]=c):c=e[3];let d;e[4]!==a?(d=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:a})}),e[4]=a,e[5]=d):d=e[5];let x;e[6]!==u||e[7]!==m||e[8]!==o||e[9]!==a?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${u}`,alt:a,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:a}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=u,e[7]=m,e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==d||e[12]!==x?(g=n.jsxs(ge,{children:[d,x]}),e[11]=d,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==c||e[15]!==g?(b=n.jsx(mt,{className:c,children:g}),e[14]=c,e[15]=g,e[16]=b):b=e[16],b}const pn=dt.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},mimeType:{default:null,parseHTML:s=>s.getAttribute("data-mime-type")||null,renderHTML:s=>s.mimeType?{"data-mime-type":s.mimeType}:{}},size:{default:0,parseHTML:s=>{const e=s.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:s=>s.size?{"data-size":String(s.size)}:{}},data:{default:null,parseHTML:s=>s.getAttribute("data-data")||null,renderHTML:s=>s.data?{"data-data":s.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"file"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.mimeType&&(t["data-mime-type"]=s.attrs.mimeType),s.attrs.size&&(t["data-size"]=String(s.attrs.size)),s.attrs.data&&(t["data-data"]=s.attrs.data),["span",{...e,...t}]},renderText({node:s}){return`[${s.attrs.name??""}]`},addNodeView(){return ft(mn)}}),fe=16,Ee=2.5,Pe=(fe-Ee)/2,Re=2*Math.PI*Pe;function xn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:r,outputTokens:a,cost:o}=t;if(!l&&!r&&!a)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Gt,{size:12}),e[0]=u):u=e[0];let f;e[1]!==o||e[2]!==l?(f=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=f):f=e[3];let i;e[4]!==f?(i=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[u,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:f})]})}),e[4]=f,e[5]=i):i=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let c;e[8]!==r?(c=r.toLocaleString(),e[8]=r,e[9]=c):c=e[9];let d;e[10]!==c?(d=n.jsx("span",{className:"text-right tabular-nums",children:c}),e[10]=c,e[11]=d):d=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-muted",children:"out"}),e[12]=x):x=e[12];const g=a-(t.reasoningTokens??0);let b;e[13]!==g?(b=g.toLocaleString(),e[13]=g,e[14]=b):b=e[14];let h;e[15]!==b?(h=n.jsx("span",{className:"text-right tabular-nums",children:b}),e[15]=b,e[16]=h):h=e[16];let N;e[17]!==r||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(N=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:r>0?`${(t.cacheReadTokens/r*100).toFixed(0)}%`:"0%"})]}),e[17]=r,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=N):N=e[20];let j;e[21]!==o?(j=o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",o.toFixed(4)]})]}),e[21]=o,e[22]=j):j=e[22];let S;e[23]!==h||e[24]!==N||e[25]!==j||e[26]!==d?(S=n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[m,n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p,d,x,h,N,j]})]}),e[23]=h,e[24]=N,e[25]=j,e[26]=d,e[27]=S):S=e[27];let y;return e[28]!==S||e[29]!==i?(y=n.jsxs(ge,{children:[i,S]}),e[28]=S,e[29]=i,e[30]=y):y=e[30],y}function gn(s){const e=$.c(19),{usage:t,duration:l}=s,r=l!=null&&l>0,a=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!r&&!a&&!o)return null;let u;e[0]!==l||e[1]!==r?(u=r?de(l/1e3):null,e[0]=l,e[1]=r,e[2]=u):u=e[2];const f=u;let i;e[3]!==l||e[4]!==f||e[5]!==t?(i=f&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:f})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),n.jsx("span",{className:"tabular-nums",children:de(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=f,e[5]=t,e[6]=i):i=e[6];let m;e[7]!==a||e[8]!==r||e[9]!==o?(m=r&&(a||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=a,e[8]=r,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==a||e[12]!==o||e[13]!==t?(p=(a||o)&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:a?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[n.jsx("span",{className:"opacity-60",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),n.jsx("span",{className:"opacity-60",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"think"}),n.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:(t?.inputTokens??0)>0?`${((t?.cacheReadTokens??0)/t.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=a,e[12]=o,e[13]=t,e[14]=p):p=e[14];let c;return e[15]!==i||e[16]!==m||e[17]!==p?(c=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[i,m,p]}),e[15]=i,e[16]=m,e[17]=p,e[18]=c):c=e[18],c}function fa(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:r,onOpenContextPanel:a}=s,o=Math.min(l/r*100,100),u=Re-o/100*Re,f=t?.cost??0,i=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==f?(c=f>0?`, $${f.toFixed(2)}`:"",e[2]=f,e[3]=c):c=e[3];const d=`Context usage: ${p}%${c}`,x=a?"cursor-pointer":"cursor-default";let g;e[4]!==x?(g=q("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=g):g=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("circle",{cx:fe/2,cy:fe/2,r:Pe,fill:"none",stroke:"currentColor",strokeWidth:Ee,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let N;e[7]!==h?(N=q(h),e[7]=h,e[8]=N):N=e[8];let j;e[9]!==u||e[10]!==N?(j=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Pe,fill:"none",stroke:"currentColor",strokeWidth:Ee,strokeDasharray:Re,strokeDashoffset:u,strokeLinecap:"round",className:N})]}),e[9]=u,e[10]=N,e[11]=j):j=e[11];let S;e[12]!==o?(S=o.toFixed(0),e[12]=o,e[13]=S):S=e[13];let y;e[14]!==f?(y=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,e[15]=y):y=e[15];let v;e[16]!==S||e[17]!==y?(v=n.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[S,"%",y]}),e[16]=S,e[17]=y,e[18]=v):v=e[18];let k;e[19]!==a||e[20]!==v||e[21]!==d||e[22]!==g||e[23]!==j?(k=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":d,className:g,children:[j,v]})}),e[19]=a,e[20]=v,e[21]=d,e[22]=g,e[23]=j,e[24]=k):k=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=_):_=e[25];let w;e[26]!==l?(w=l.toLocaleString(),e[26]=l,e[27]=w):w=e[27];let T;e[28]!==r?(T=r.toLocaleString(),e[28]=r,e[29]=T):T=e[29];let I;e[30]!==o?(I=o.toFixed(1),e[30]=o,e[31]=I):I=e[31];let M;e[32]!==w||e[33]!==T||e[34]!==I?(M=n.jsxs("span",{className:"text-right tabular-nums",children:[w," / ",T," (",I,"%)"]}),e[32]=w,e[33]=T,e[34]=I,e[35]=M):M=e[35];let C;e[36]!==f||e[37]!==i||e[38]!==m?(C=f>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",f.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:i.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=f,e[37]=i,e[38]=m,e[39]=C):C=e[39];let L;e[40]!==i||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(L=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:i>0?`${((t?.cacheReadTokens??0)/i*100).toFixed(0)}%`:"0%"})]}),e[40]=i,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=L):L=e[43];let R;e[44]!==M||e[45]!==C||e[46]!==L?(R=n.jsx(xe,{side:"top",className:"font-mono text-[11px]",children:n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[_,M,C,L]})}),e[44]=M,e[45]=C,e[46]=L,e[47]=R):R=e[47];let F;return e[48]!==k||e[49]!==R?(F=n.jsxs(ge,{children:[k,R]}),e[48]=k,e[49]=R,e[50]=F):F=e[50],F}function hn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(fs,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function bn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(us,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function yn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(ds,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function D(s){const e=$.c(53),{icon:t,title:l,usage:r,summary:a,state:o,detail:u,detailVariant:f,forceOpen:i,variant:m,trailing:p,iconDestructive:c,alwaysChevron:d,defaultOpen:x,children:g}=s,b=f===void 0?"code":f,h=m===void 0?"default":m,[N,j]=H.useState(x??!1),{handleCopy:S,copied:y}=pt(),v=o==="loading",k=o==="error";let _;e[0]!==u?(_=u&&u.trim(),e[0]=u,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(i??!1)||N,C=H.useRef(null),L=v&&M;let R;e[2]!==u?(R=[u],e[2]=u,e[3]=R):R=e[3];let F;e[4]!==L||e[5]!==R?(F={containerRef:C,enabled:L,contentDeps:R},e[4]=L,e[5]=R,e[6]=F):F=e[6];const{sentinelRef:E}=tn(F),A=i?void 0:j,z=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",U=!T&&"cursor-default",W=v&&"shimmer";let V;e[7]!==U||e[8]!==W||e[9]!==O?(V=q("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",O,U,W),e[7]=U,e[8]=W,e[9]=O,e[10]=V):V=e[10];const ne=!T;let X;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==c||e[15]!==k||e[16]!==T?(X=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?n.jsx(Ye,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:q("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",c?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",T&&(M?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),T&&n.jsx("div",{className:q("absolute inset-0 flex items-center justify-center transition-opacity duration-150",M?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(Ye,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=d,e[12]=M,e[13]=t,e[14]=c,e[15]=k,e[16]=T,e[17]=X):X=e[17];const Q=k?"text-warning/80":"text-foreground";let J;e[18]!==Q?(J=q("shrink-0 text-[14px] font-normal",Q),e[18]=Q,e[19]=J):J=e[19];let ee;e[20]!==J||e[21]!==l?(ee=n.jsx("span",{className:J,children:l}),e[20]=J,e[21]=l,e[22]=ee):ee=e[22];let P;e[23]!==a?(P=a?n.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:a})}):n.jsx("div",{className:"flex-1"}),e[23]=a,e[24]=P):P=e[24];let B;e[25]!==p?(B=p&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:p}),e[25]=p,e[26]=B):B=e[26];let G;e[27]!==r?(G=n.jsx(xn,{usage:r}),e[27]=r,e[28]=G):G=e[28];let K;e[29]!==V||e[30]!==ne||e[31]!==X||e[32]!==ee||e[33]!==P||e[34]!==B||e[35]!==G||e[36]!==z?(K=n.jsxs(bn,{disabled:z,className:V,"aria-disabled":ne,children:[X,ee,P,B,G]}),e[29]=V,e[30]=ne,e[31]=X,e[32]=ee,e[33]=P,e[34]=B,e[35]=G,e[36]=z,e[37]=K):K=e[37];let Y;e[38]!==g||e[39]!==y||e[40]!==u||e[41]!==b||e[42]!==S||e[43]!==T||e[44]!==E?(Y=T&&n.jsx(yn,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:g||(b==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsxs("div",{ref:C,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:[n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:u}),n.jsx("div",{ref:E,className:"h-0 shrink-0"})]})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsxs("div",{ref:C,className:"flex flex-col max-h-48 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u})}),n.jsx("button",{type:"button",onClick:()=>S(u),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:y?n.jsx(Be,{className:"size-3.5"}):n.jsx(ut,{className:"size-3.5"})})]}),n.jsx("div",{ref:E,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=y,e[40]=u,e[41]=b,e[42]=S,e[43]=T,e[44]=E,e[45]=Y):Y=e[45];let ue;e[46]!==M||e[47]!==K||e[48]!==Y||e[49]!==A?(ue=n.jsxs(hn,{open:M,onOpenChange:A,className:"min-w-0",children:[K,Y]}),e[46]=M,e[47]=K,e[48]=Y,e[49]=A,e[50]=ue):ue=e[50];const le=ue;if(I){let oe;return e[51]!==le?(oe=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:le}),e[51]=le,e[52]=oe):oe=e[52],oe}return le}function Z(s){const e=$.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=de(t),e[0]=t,e[1]=l):l=e[1];let r;return e[2]!==l?(r=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=r):r=e[3],r}const Mt=4;function Lt(s){const e=$.c(5),{count:t,noun:l,onClick:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ct,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=a):a=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==r?(o=n.jsxs("button",{type:"button",onClick:r,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",t," ",l,a]}),e[1]=t,e[2]=l,e[3]=r,e[4]=o):o=e[4],o}function jn(s){const e=$.c(27),{org:t}=he(),l=Ut(),r=ks();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:vs,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const o=We(a);let u;e[3]!==o||e[4]!==s?(u=async b=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=await o.callTool({name:"COLLECTION_THREADS_GET",arguments:{id:s}}),j=(h.structuredContent??h).item?.metadata??{},y=(j.expanded_tools??[]).filter(k=>k.toolName!==b.toolName);y.push({...b,expandedAt:new Date().toISOString()});const v={...j,expanded_tools:y};return await o.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:s,data:{metadata:v}}}),y},e[3]=o,e[4]=s,e[5]=u):u=e[5];let f,i,m;e[6]!==t.id||e[7]!==l||e[8]!==s?(f=async b=>{const h=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:h});const N=l.getQueryData(h),S=(N?.metadata?.expanded_tools??[]).filter(y=>y.toolName!==b.toolName);return S.push({...b,expandedAt:new Date().toISOString()}),l.setQueryData(h,y=>y&&{...y,metadata:{...y.metadata??{},expanded_tools:S}}),{previous:N}},i=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},m=(b,h,N)=>{const j=me.ensureTask(t.id,s??"");N?.previous===void 0?l.removeQueries({queryKey:j,exact:!0}):l.setQueryData(j,N.previous),ze.error(b instanceof Error?b.message:"Failed to expand tool")},e[6]=t.id,e[7]=l,e[8]=s,e[9]=f,e[10]=i,e[11]=m):(f=e[9],i=e[10],m=e[11]);let p;e[12]!==u||e[13]!==f||e[14]!==i||e[15]!==m?(p={mutationFn:u,onMutate:f,onSuccess:i,onError:m},e[12]=u,e[13]=f,e[14]=i,e[15]=m,e[16]=p):p=e[16];const c=Wt(p);let d;e[17]!==r||e[18]!==c||e[19]!==t.id||e[20]!==l||e[21]!==s?(d=b=>{if(!s||!r)return;const h=me.ensureTask(t.id,s),N=l.getQueryData(h),S=(N?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==b.toolName);S.push({...b,expandedAt:new Date().toISOString()});const y={...N?.metadata??{},expanded_tools:S};l.setQueryData(h,v=>v&&{...v,metadata:y}),r.patchThread({id:s,metadata:y}),c.mutate(b)},e[17]=r,e[18]=c,e[19]=t.id,e[20]=l,e[21]=s,e[22]=d):d=e[22];const x=d;let g;return e[23]!==x||e[24]!==c.isPending||e[25]!==c.mutate?(g={addOrReplace:c.mutate,addOrReplaceEager:x,isPending:c.isPending},e[23]=x,e[24]=c.isPending,e[25]=c.mutate,e[26]=g):g=e[26],g}function vn(s,e,t,l){const{data:r,isLoading:a}=Oe({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await Ns({connectionId:e,orgId:t,orgSlug:l});try{const{tools:u}=await o.listTools(),f=It(s);return u.find(i=>i.name===f)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:r??void 0,isLoading:a}}const Nn={read:{icon:Qe,label:"Read File"},write:{icon:Is,label:"Write File"},edit:{icon:Zt,label:"Edit File"},grep:{icon:Ls,label:"Search Content"},glob:{icon:Ms,label:"Find Files"},bash:{icon:Yt,label:"Run Command"},read_tool_output:{icon:Qe,label:"Read Tool Output"},read_resource:{icon:Qt,label:"Read Resource"},read_prompt:{icon:jt,label:"Read Prompt"},enable_tool:{icon:$s,label:"Enable Tool"},open_in_agent:{icon:Xt,label:"Open in Agent"},sandbox:{icon:Jt,label:"Run Code"},copy_to_sandbox:{icon:vt,label:"Load File"},share_with_user:{icon:Rs,label:"Share with User"},take_screenshot:{icon:Te,label:"Take Screenshot"},scrape_url:{icon:Ce,label:"Scrape URL"},inspect_page:{icon:Kt,label:"Inspect Page"}};function Ke(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ye(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}const Sn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function kn(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
|
|
2
2
|
${l.text}`);else if(l.type==="source-url")t.push(`## Source URL
|
|
3
3
|
${l.url}`);else if(l.type==="source-document")t.push(`## Source Document
|
|
4
4
|
${l.title}`);else if(l.type==="file")t.push(`## File
|
|
@@ -28,11 +28,11 @@ Output: Tool execution was denied`)}}}return t.length>0?t.join(`
|
|
|
28
28
|
`),P=P+(`# Output
|
|
29
29
|
`+et(t.output)));let B;e:{if(U){let se;e[21]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(Ts,{}),e[21]=se):se=e[21],B=se;break e}if(T){let se;e[22]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(rt,{className:"size-4 text-muted-foreground"}),e[22]=se):se=e[22],B=se;break e}const te=v?.icon;if(te){let se;e[23]!==te?(se=n.jsx(te,{className:"size-4 text-muted-foreground"}),e[23]=te,e[24]=se):se=e[24],B=se;break e}let ae;e[25]===Symbol.for("react.memo_cache_sentinel")?(ae=n.jsx(es,{className:"size-4 text-muted-foreground"}),e[25]=ae):ae=e[25],B=ae}let G;e[26]!==l||e[27]!==u?(G=n.jsx(_n,{annotations:l,toolMeta:u}),e[26]=l,e[27]=u,e[28]=G):G=e[28];let K;e[29]!==r||e[30]!==a?(K=n.jsx(Cn,{latency:r,outputBytes:a}),e[29]=r,e[30]=a,e[31]=K):K=e[31];let Y;e[32]!==G||e[33]!==K?(Y=n.jsxs(n.Fragment,{children:[G,K]}),e[32]=G,e[33]=K,e[34]=Y):Y=e[34];const ue=P||null;let le;e[35]!==X||e[36]!==k||e[37]!==U||e[38]!==r||e[39]!==ee||e[40]!==Y||e[41]!==ue||e[42]!==B?(le=n.jsx(D,{icon:B,iconDestructive:U,trailing:Y,title:k,latency:r,summary:ee,state:X,detail:ue}),e[35]=X,e[36]=k,e[37]=U,e[38]=r,e[39]=ee,e[40]=Y,e[41]=ue,e[42]=B,e[43]=le):le=e[43];let oe;e[44]!==C||e[45]!==R?(oe=C&&n.jsx("div",{className:"flex justify-end mt-1.5 mb-1",children:n.jsxs("button",{type:"button",onClick:R,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground rounded-md [@media(hover:hover)]:hover:bg-accent/50 [@media(hover:hover)]:hover:text-foreground transition-colors",children:[n.jsx(ts,{className:"size-3.5"}),"Open in panel"]})}),e[44]=C,e[45]=R,e[46]=oe):oe=e[46];let be;e[47]!==C||e[48]!==p||e[49]!==h||e[50]!==k||e[51]!==z||e[52]!==E||e[53]!==T||e[54]!==j||e[55]!==c.id||e[56]!==c.slug||e[57]!==t.input||e[58]!==t.output||e[59]!==I||e[60]!==y||e[61]!==w?(be=T&&w&&h&&c?.id&&n.jsx(n.Fragment,{children:n.jsx(qt,{fallback:te=>{const{resetError:ae}=te;return n.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-2.5 border border-dashed border-destructive/30 bg-destructive/5 rounded-lg",children:[n.jsx(bt,{size:16,className:"shrink-0 text-destructive"}),n.jsxs("span",{className:"flex-1 text-xs text-destructive font-medium",children:["Failed to load"," ",n.jsx("span",{className:"font-mono",children:k})," app"]}),n.jsxs(Ne,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5 shrink-0",onClick:ae,children:[n.jsx(Vt,{className:"size-3.5"}),"Retry"]})]})},children:n.jsx(H.Suspense,{fallback:n.jsx("div",{className:"mt-2 flex items-center justify-center h-12 border border-border/75 rounded-lg overflow-hidden p-3",children:n.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[n.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),n.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:n.jsx(Ln,{uiResourceUri:w,connectionId:h,orgId:c.id,orgSlug:c.slug,toolName:y,toolInput:t.input,toolResult:t.output,toolMeta:j,onMessage:z,onUpdateModelContext:I&&p?te=>p.setAppContext(I,te):void 0,onTeardown:I&&p?()=>p.clearAppContext(I):void 0,onRequestDisplayMode:C?E:void 0})})})}),e[47]=C,e[48]=p,e[49]=h,e[50]=k,e[51]=z,e[52]=E,e[53]=T,e[54]=j,e[55]=c.id,e[56]=c.slug,e[57]=t.input,e[58]=t.output,e[59]=I,e[60]=y,e[61]=w,e[62]=be):be=e[62];let ke;return e[63]!==le||e[64]!==oe||e[65]!==be?(ke=n.jsxs("div",{children:[le,oe,be]}),e[63]=le,e[64]=oe,e[65]=be,e[66]=ke):ke=e[66],ke}function Rt(s){return typeof s=="object"&&s!=null&&"type"in s&&s.type==="mcpToolCall"}function In(s){if(s!=null)return Rt(s)?s.arguments??void 0:s}function Mn(s){if(s==null)return;if(Rt(s)&&s.result!=null)return s.result;if(typeof s=="object"&&"content"in s&&Array.isArray(s.content)){const t=s.content;if(t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"type"in t[0])return s}const e=typeof s=="string"?s:JSON.stringify(s);return{structuredContent:typeof s=="object"&&!Array.isArray(s)?s:void 0,content:[{type:"text",text:e}]}}function Ln(s){const e=$.c(27),{uiResourceUri:t,connectionId:l,orgId:r,orgSlug:a,toolName:o,toolInput:u,toolResult:f,toolMeta:i,onMessage:m,onUpdateModelContext:p,onTeardown:c,onRequestDisplayMode:d}=s;let x;e[0]!==l||e[1]!==r||e[2]!==a?(x={connectionId:l,orgId:r,orgSlug:a},e[0]=l,e[1]=r,e[2]=a,e[3]=x):x=e[3];const g=We(x);let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b={type:"object"},e[4]=b):b=e[4];let h;e[5]!==i?(h=i!=null&&{_meta:i},e[5]=i,e[6]=h):h=e[6];let N;e[7]!==h||e[8]!==o?(N={name:o,inputSchema:b,...h},e[7]=h,e[8]=o,e[9]=N):N=e[9];const j=N;let S;e[10]!==j?(S={tool:j},e[10]=j,e[11]=S):S=e[11];let y;e[12]!==u?(y=In(u),e[12]=u,e[13]=y):y=e[13];let v;e[14]!==f?(v=Mn(f),e[14]=f,e[15]=v):v=e[15];let k;return e[16]!==g||e[17]!==m||e[18]!==d||e[19]!==c||e[20]!==p||e[21]!==r||e[22]!==S||e[23]!==y||e[24]!==v||e[25]!==t?(k=n.jsx("div",{className:"mt-2 border border-border/75 rounded-lg overflow-hidden p-3",children:n.jsx(bs,{resourceURI:t,orgId:r,toolInfo:S,toolInput:y,toolResult:v,client:g,onMessage:m,onUpdateModelContext:p,onTeardown:c,onRequestDisplayMode:d})}),e[16]=g,e[17]=m,e[18]=d,e[19]=c,e[20]=p,e[21]=r,e[22]=S,e[23]=y,e[24]=v,e[25]=t,e[26]=k):k=e[26],k}const st="mesh-storage://";function Me(s){return s.startsWith(st)?s.slice(st.length):null}function At(s,e){const t=Me(s);return t!==null?`/api/${e}/files/${t}`:s}function Rn(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;return l?{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:0,cacheReadTokens:0,cacheWriteTokens:0}:null}function An(s){const e=$.c(13),{uri:t,orgSlug:l}=s;let r;e[0]!==l||e[1]!==t?(r=At(t,l),e[0]=l,e[1]=t,e[2]=r):r=e[2];const a=r;let o;e[3]!==t?(o=Me(t)!==null?t.slice(t.lastIndexOf("/")+1):"reference",e[3]=t,e[4]=o):o=e[4];const u=o;let f;e[5]!==u?(f=n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"inline-flex items-center gap-1 px-1 py-0.5 rounded bg-muted text-muted-foreground text-xs cursor-default select-none",children:u})}),e[5]=u,e[6]=f):f=e[6];let i;e[7]!==u||e[8]!==a?(i=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:n.jsx("img",{src:a,alt:u,className:"max-w-full max-h-64 object-contain rounded"})}),e[7]=u,e[8]=a,e[9]=i):i=e[9];let m;return e[10]!==f||e[11]!==i?(m=n.jsxs(ge,{children:[f,i]}),e[10]=f,e[11]=i,e[12]=m):m=e[12],m}function zn(s){const e=$.c(65),{part:t,latency:l}=s,r=De();let a;e[0]!==t.state?(a=re(t.state),e[0]=t.state,e[1]=a):a=e[1];const o=a,u=t.input,f=t.output,i=f?.images;let m;e[2]!==f?(m=Rn(f),e[2]=f,e[3]=m):m=e[3];const p=m,c=f?.model;let d,x,g,b,h,N,j,S,y,v,k,_;if(e[4]!==i||e[5]!==u||e[6]!==l||e[7]!==c||e[8]!==r||e[9]!==o||e[10]!==p){h=Symbol.for("react.early_return_sentinel");e:{const L=Array.isArray(u?.referenceImages)?u.referenceImages.filter(En):void 0;let R;e[23]!==l?(R=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[23]=l,e[24]=R):R=e[24];const F=R;if(o==="loading"){let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(Le,{size:14}),e[25]=E):E=e[25];let A;e[26]!==u?(A=u?.prompt?`"${u.prompt.slice(0,80)}…"`:void 0,e[26]=u,e[27]=A):A=e[27];let z;e[28]!==A?(z=n.jsx(D,{icon:E,title:"Generating image",summary:A,state:"loading"}),e[28]=A,e[29]=z):z=e[29],h=z;break e}if(o==="error"||!i||i.length===0){let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(Le,{size:14}),e[30]=E):E=e[30];const A=o==="error"?"Failed":"No images generated",z=o==="error"?"error":"idle";let O;e[31]!==F||e[32]!==A||e[33]!==z||e[34]!==p?(O=n.jsx(D,{icon:E,title:"Image generation",summary:A,state:z,usage:p,trailing:F}),e[31]=F,e[32]=A,e[33]=z,e[34]=p,e[35]=O):O=e[35],h=O;break e}b="flex flex-col gap-2",d=D,e[36]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Le,{size:14,className:"text-pink-500"}),e[36]=y):y=e[36],v="Generated image",k=c,_="idle",x=p,g=F,N="flex flex-col gap-1 pb-2 pl-6",e[37]!==u?(j=u?.prompt&&n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u.prompt}),e[37]=u,e[38]=j):j=e[38],S=L&&L.length>0&&n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsx("span",{className:"text-[11px] text-muted-foreground/50",children:"references:"}),L.map((E,A)=>{const z=E.uri??E.url;return n.jsx(An,{uri:z,orgSlug:r.slug},A)})]})}e[4]=i,e[5]=u,e[6]=l,e[7]=c,e[8]=r,e[9]=o,e[10]=p,e[11]=d,e[12]=x,e[13]=g,e[14]=b,e[15]=h,e[16]=N,e[17]=j,e[18]=S,e[19]=y,e[20]=v,e[21]=k,e[22]=_}else d=e[11],x=e[12],g=e[13],b=e[14],h=e[15],N=e[16],j=e[17],S=e[18],y=e[19],v=e[20],k=e[21],_=e[22];if(h!==Symbol.for("react.early_return_sentinel"))return h;let w;e[39]!==N||e[40]!==j||e[41]!==S?(w=n.jsxs("div",{className:N,children:[j,S]}),e[39]=N,e[40]=j,e[41]=S,e[42]=w):w=e[42];let T;e[43]!==d||e[44]!==x||e[45]!==g||e[46]!==w||e[47]!==y||e[48]!==v||e[49]!==k||e[50]!==_?(T=n.jsx(d,{icon:y,title:v,summary:k,state:_,usage:x,trailing:g,children:w}),e[43]=d,e[44]=x,e[45]=g,e[46]=w,e[47]=y,e[48]=v,e[49]=k,e[50]=_,e[51]=T):T=e[51];let I;if(e[52]!==i||e[53]!==u?.prompt||e[54]!==r){let L;e[56]!==u?.prompt||e[57]!==r?(L=(R,F)=>{const E=R.uri??R.url;if(!E)return null;const A=At(E,r.slug);return n.jsx(gt,{src:A,alt:u?.prompt??"Generated image",children:n.jsx("img",{src:A,alt:u?.prompt??"Generated image",className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"})},F)},e[56]=u?.prompt,e[57]=r,e[58]=L):L=e[58],I=i.map(L),e[52]=i,e[53]=u?.prompt,e[54]=r,e[55]=I}else I=e[55];let M;e[59]!==I?(M=n.jsx("div",{className:"flex flex-wrap gap-2",children:I}),e[59]=I,e[60]=M):M=e[60];let C;return e[61]!==b||e[62]!==T||e[63]!==M?(C=n.jsxs("div",{className:b,children:[T,M]}),e[61]=b,e[62]=T,e[63]=M,e[64]=C):C=e[64],C}function En(s){return s.uri??s.url}function Pn(s,e){const t=Me(s);return t!==null?`/api/${e}/files/${t}`:s}function Fn(s){const e=$.c(26),{part:t,latency:l}=s,r=De(),a=re(t.state),o=t.input,u=t.output,f=u?.image?.uri,i=u?.url??o?.url;let m;e[0]!==l?(m=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[0]=l,e[1]=m):m=e[1];const p=m;if(a==="loading"){let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Te,{size:14}),e[2]=y):y=e[2];let v;return e[3]!==i?(v=n.jsx(D,{icon:y,title:"Taking screenshot",summary:i,state:"loading"}),e[3]=i,e[4]=v):v=e[4],v}if(a==="error"||u?.success===!1||!f){let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Te,{size:14}),e[5]=y):y=e[5];const v=u?.error??"Failed";let k;return e[6]!==p||e[7]!==v?(k=n.jsx(D,{icon:y,title:"Take screenshot",summary:v,state:"error",trailing:p}),e[6]=p,e[7]=v,e[8]=k):k=e[8],k}let c;e[9]!==r.slug||e[10]!==f?(c=Pn(f,r.slug),e[9]=r.slug,e[10]=f,e[11]=c):c=e[11];const d=c;let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Te,{size:14,className:"text-blue-500"}),e[12]=x):x=e[12];let g;e[13]!==p||e[14]!==i?(g=n.jsx(D,{icon:x,title:"Screenshot",summary:i,state:"idle",trailing:p}),e[13]=p,e[14]=i,e[15]=g):g=e[15];const b=i??"Screenshot",h=i??"Screenshot";let N;e[16]!==d||e[17]!==h?(N=n.jsx("img",{src:d,alt:h,className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"}),e[16]=d,e[17]=h,e[18]=N):N=e[18];let j;e[19]!==d||e[20]!==b||e[21]!==N?(j=n.jsx("div",{className:"flex flex-wrap gap-2",children:n.jsx(gt,{src:d,alt:b,children:N})}),e[19]=d,e[20]=b,e[21]=N,e[22]=j):j=e[22];let S;return e[23]!==g||e[24]!==j?(S=n.jsxs("div",{className:"flex flex-col gap-2",children:[g,j]}),e[23]=g,e[24]=j,e[25]=S):S=e[25],S}function On(s,e){const t=Me(s);return t!==null?`/api/${e}/files/${t}`:s}function Dn(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;if(!l)return null;const r={providerMetadata:s.usage.providerMetadata};return{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:_t(r),cacheReadTokens:0,cacheWriteTokens:0}}function Hn(s){try{return new URL(s).hostname.replace(/^www\./,"")}catch{return s}}function Bn(s){try{return`${new URL(s).origin}/favicon.ico`}catch{return""}}function Un(s){const e=$.c(16),{citation:t,index:l}=s;let r;e[0]!==t.url?(r=Hn(t.url),e[0]=t.url,e[1]=r):r=e[1];const a=r;let o;e[2]!==t.url?(o=Bn(t.url),e[2]=t.url,e[3]=o):o=e[3];const u=o,f=t.title||a;let i;e[4]!==u?(i=n.jsx("img",{src:u,alt:"",className:"size-3.5 rounded-sm shrink-0",onError:Wn}),e[4]=u,e[5]=i):i=e[5];let m;e[6]!==f?(m=n.jsx("span",{className:"truncate max-w-[180px]",children:f}),e[6]=f,e[7]=m):m=e[7];const p=l+1;let c;e[8]!==p?(c=n.jsxs("span",{className:"text-[10px] text-muted-foreground/50 tabular-nums shrink-0",children:["[",p,"]"]}),e[8]=p,e[9]=c):c=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Nt,{size:10,className:"shrink-0 opacity-0 group-hover/src:opacity-100 transition-opacity"}),e[10]=d):d=e[10];let x;return e[11]!==t.url||e[12]!==i||e[13]!==m||e[14]!==c?(x=n.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group/src inline-flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:[i,m,c,d]}),e[11]=t.url,e[12]=i,e[13]=m,e[14]=c,e[15]=x):x=e[15],x}function Wn(s){s.target.style.display="none"}function qn(s,e){return s.replace(/\[(\d+)\]/g,(t,l)=>{const r=parseInt(l,10)-1,a=e[r];return a?`[\\[${l}\\]](${a.url})`:t})}const Ae=5;function Vn(s){const e=$.c(12),{citations:t}=s,[l,r]=H.useState(!1),a=t.length>Ae;let o;e[0]!==t||e[1]!==l?(o=l?t:t.slice(0,Ae),e[0]=t,e[1]=l,e[2]=o):o=e[2];const u=o;let f;e[3]!==u?(f=u.map(Kn),e[3]=u,e[4]=f):f=e[4];let i;e[5]!==t.length||e[6]!==l||e[7]!==a?(i=a&&n.jsx("button",{type:"button",onClick:()=>r(Gn),className:"inline-flex items-center rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:l?"show less":`+${t.length-Ae} more`}),e[5]=t.length,e[6]=l,e[7]=a,e[8]=i):i=e[8];let m;return e[9]!==f||e[10]!==i?(m=n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[f,i]}),e[9]=f,e[10]=i,e[11]=m):m=e[11],m}function Gn(s){return!s}function Kn(s,e){return n.jsx(Un,{citation:s,index:e},s.url)}function Jn(s){const e=$.c(51),{part:t,latency:l,streamingText:r}=s,a=De();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o,f=t.input,i=t.output;let m,p,c;e[2]!==a||e[3]!==i?(m=i?.uri?On(i.uri,a.slug):void 0,c=Oe,p=me.webSearchBlob(m??""),e[2]=a,e[3]=i,e[4]=m,e[5]=p,e[6]=c):(m=e[4],p=e[5],c=e[6]);let d;e[7]!==m?(d=async()=>{const W=await fetch(m);if(!W.ok)throw new Error(`Failed to fetch: ${W.status}`);return W.text()},e[7]=m,e[8]=d):d=e[8];const x=!!m;let g;e[9]!==p||e[10]!==d||e[11]!==x?(g={queryKey:p,queryFn:d,enabled:x,staleTime:1/0},e[9]=p,e[10]=d,e[11]=x,e[12]=g):g=e[12];const{data:b}=c(g),h=u==="loading",N=u!=="loading"&&u!=="error",j=i?.citations;let S;e[13]!==i?(S=Dn(i),e[13]=i,e[14]=S):S=e[14];const y=S,v=i?.content??b??r;let k;e[15]!==j||e[16]!==v?(k=v&&j?.length?qn(v,j):v,e[15]=j,e[16]=v,e[17]=k):k=e[17];const _=k;let w;e[18]!==l?(w=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[18]=l,e[19]=w):w=e[19];const T=w;if(u==="error"){let W;e[20]===Symbol.for("react.memo_cache_sentinel")?(W=n.jsx(Ce,{size:14}),e[20]=W):W=e[20];let V;return e[21]!==T||e[22]!==y?(V=n.jsx(D,{icon:W,title:"Web search",summary:"Failed",state:"error",usage:y,trailing:T}),e[21]=T,e[22]=y,e[23]=V):V=e[23],V}const I=h?"animate-pulse":"text-blue-500";let M;e[24]!==I?(M=q(I),e[24]=I,e[25]=M):M=e[25];let C;e[26]!==M?(C=n.jsx(Ce,{size:14,className:M}),e[26]=M,e[27]=C):C=e[27];const L=h?"Researching...":"Web search";let R;e[28]!==f||e[29]!==N||e[30]!==i?.model?(R=N?i?.model??f?.query?.slice(0,60):f?.query?`"${f.query.slice(0,80)}"`:void 0,e[28]=f,e[29]=N,e[30]=i?.model,e[31]=R):R=e[31];const F=h?"loading":"idle";let E;e[32]!==f?(E=f?.query&&n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:f.query}),e[32]=f,e[33]=E):E=e[33];let A;e[34]!==_||e[35]!==t.toolCallId?(A=_?n.jsx("div",{className:"max-h-96 overflow-y-auto overflow-x-hidden rounded-lg border border-border/40 bg-muted/20 px-4 py-3 min-w-0",children:n.jsx("div",{className:"prose prose-sm prose-neutral dark:prose-invert max-w-none text-[13px] leading-relaxed break-words",children:n.jsx(xt,{id:t.toolCallId,text:_})})}):n.jsx("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-4 py-3",children:n.jsxs("div",{className:"space-y-2 animate-pulse",children:[n.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-3/4"}),n.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-1/2"})]})}),e[34]=_,e[35]=t.toolCallId,e[36]=A):A=e[36];let z;e[37]!==j?(z=j&&j.length>0&&n.jsx(Vn,{citations:j}),e[37]=j,e[38]=z):z=e[38];let O;e[39]!==E||e[40]!==A||e[41]!==z?(O=n.jsxs("div",{className:"pl-6 pb-3 flex flex-col gap-1 min-w-0",children:[E,A,z]}),e[39]=E,e[40]=A,e[41]=z,e[42]=O):O=e[42];let U;return e[43]!==T||e[44]!==C||e[45]!==L||e[46]!==R||e[47]!==F||e[48]!==O||e[49]!==y?(U=n.jsx(D,{icon:C,title:L,summary:R,state:F,usage:y,trailing:T,defaultOpen:!0,children:O}),e[43]=T,e[44]=C,e[45]=L,e[46]=R,e[47]=F,e[48]=O,e[49]=y,e[50]=U):U=e[50],U}function Xn(s){const e=$.c(14),{part:t}=s;if(!t.state.startsWith("output-"))return null;let l;e[0]!==t.input?.prompt?(l=t.input?.prompt?.trim()||"Question",e[0]=t.input?.prompt,e[1]=l):l=e[1];const r=l,a=t.state==="output-error"||t.state==="output-denied",o=t.state==="output-denied";let u;e[2]!==o||e[3]!==t?(u=o?"Skipped":t.state==="output-error"?Ke(t)??"Error":t.output?.response??"",e[2]=o,e[3]=t,e[4]=u):u=e[4];const f=u;let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(as,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[5]=i):i=e[5];let m;e[6]!==r?(m=n.jsxs("div",{className:"flex items-start gap-2",children:[i,n.jsx("span",{className:"text-[14px] text-muted-foreground leading-snug",children:r})]}),e[6]=r,e[7]=m):m=e[7];let p;e[8]!==f||e[9]!==a?(p=f&&n.jsx("div",{className:"ml-6 pl-2 border-l border-border/50",children:n.jsx("span",{className:q("text-[14px] leading-snug",a?"text-muted-foreground/50 italic":"text-foreground/70"),children:f})}),e[8]=f,e[9]=a,e[10]=p):p=e[10];let c;return e[11]!==m||e[12]!==p?(c=n.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,p]}),e[11]=m,e[12]=p,e[13]=c):c=e[13],c}function Qn(s){if(s&&typeof s=="object"&&!Array.isArray(s)){const e=s;if(typeof e.text=="string"||typeof e.error=="string"||typeof e.finishReason=="string"){if(typeof e.error=="string"&&e.error.length>0)return`Subtask failed: ${e.error}`;const l=typeof e.text=="string"?e.text.trim():"",r=e.finishReason==="length";return l?(r?`[Subtask hit step limit — partial result below; consider narrowing the task.]
|
|
30
30
|
|
|
31
|
-
`:"")+l:r?"[Subtask hit step limit before producing a final report. The subagent did work but ran out of steps. Narrow the task or increase the budget.]":"Subtask completed (no output)."}}return kn(s)}function zt({part:s,subtaskMeta:e,latency:t}){const l=s.state==="input-streaming"||s.state==="input-available",r=s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-available"&&!s.preliminary,o=s.state==="output-error",u=re(s.state,"preliminary"in s?s.preliminary:!1),f=u==="approval"?"idle":u,i=l?"Starting subtask...":r?"Subtask running...":a?"Subtask completed":o?"Subtask failed":"Subtask",m=s.input?.prompt??"",p=s.state==="approval-requested"?"Awaiting approval...":m.length>120?m.slice(0,120)+"…":m,
|
|
31
|
+
`:"")+l:r?"[Subtask hit step limit before producing a final report. The subagent did work but ran out of steps. Narrow the task or increase the budget.]":"Subtask completed (no output)."}}return kn(s)}function zt({part:s,subtaskMeta:e,latency:t}){const l=s.state==="input-streaming"||s.state==="input-available",r=s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-available"&&!s.preliminary,o=s.state==="output-error",u=re(s.state,"preliminary"in s?s.preliminary:!1),f=u==="approval"?"idle":u,i=l?"Starting subtask...":r?"Subtask running...":a?"Subtask completed":o?"Subtask failed":"Subtask",m=s.input?.prompt??"",p=s.state==="approval-requested"?"Awaiting approval...":m.length>120?m.slice(0,120)+"…":m,x=(o?Ke(s):Qn(s.output))??(l||r?"":"No output available"),g=`# Task
|
|
32
32
|
${s.input?.prompt??"No prompt provided"}
|
|
33
33
|
|
|
34
34
|
# ${o?"Error":"Result"}
|
|
35
|
-
${c}`;return{fallbackTitle:i,summary:p,usage:e?.usage,latency:t,detail:d,state:f}}function Yn(s){const e=$.c(7),t=zt(s);let l,r;e[0]!==t?({fallbackTitle:l,...r}=t,e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ie,{icon:void 0,name:"Subtask",size:"2xs",className:"rounded-xs",fallbackIcon:n.jsx(St,{})}),e[3]=a):a=e[3];let o;return e[4]!==l||e[5]!==r?(o=n.jsx(D,{icon:a,title:l,...r}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o}function Zn(s){const e=$.c(11),t=zt(s);let l,r;e[0]!==t?({fallbackTitle:l,...r}=t,e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]);const a=Es(s.part.input?.agent_id),o=a?.icon,u=a?.title??"Subtask";let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(St,{}),e[3]=f):f=e[3];let i;e[4]!==o||e[5]!==u?(i=n.jsx(Ie,{icon:o,name:u,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[4]=o,e[5]=u,e[6]=i):i=e[6];const m=a?.title??l;let p;return e[7]!==r||e[8]!==i||e[9]!==m?(p=n.jsx(D,{icon:i,title:m,...r}),e[7]=r,e[8]=i,e[9]=m,e[10]=p):p=e[10],p}function el(s){const e=$.c(16),{part:t}=s;if(!t.state.startsWith("output-"))return null;const l=t.input?.plan??"",a=t.output?.approved===!0;let o,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(jt,{className:"size-4 text-purple-500 shrink-0"}),u=n.jsx("span",{className:"text-[14px] font-medium text-foreground/80",children:"Implementation Plan"}),e[0]=o,e[1]=u):(o=e[0],u=e[1]);let f;e[2]!==a?(f=a&&n.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 bg-green-500/10 px-1.5 py-0.5 rounded-md",children:[n.jsx(Be,{size:12}),"Approved"]}),e[2]=a,e[3]=f):f=e[3];let i;e[4]!==a||e[5]!==t.state?(i=!a&&t.state==="output-available"&&n.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:"Rejected"}),e[4]=a,e[5]=t.state,e[6]=i):i=e[6];let m;e[7]!==f||e[8]!==i?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,u,f,i]}),e[7]=f,e[8]=i,e[9]=m):m=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"View plan"}),e[10]=p):p=e[10];let c;e[11]!==l?(c=n.jsxs("details",{className:"ml-6",children:[p,n.jsx("div",{className:"mt-1 pl-2 border-l-2 border-purple-500/30 prose prose-sm max-w-none text-sm",children:n.jsx(Ge,{id:"plan-content",part:{type:"text",text:l}})})]}),e[11]=l,e[12]=c):c=e[12];let d;return e[13]!==m||e[14]!==c?(d=n.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,c]}),e[13]=m,e[14]=c,e[15]=d):d=e[15],d}const Je={primary:"Primary",secondary:"Secondary",accent:"Accent",background:"Background",foreground:"Foreground"};function tl(s){return s.startsWith("http")?s:`https://${s}`}function nt(s){const e=$.c(2),{children:t}=s;let l;return e[0]!==t?(l=n.jsx("span",{className:"text-sm font-medium text-foreground",children:t}),e[0]=t,e[1]=l):l=e[1],l}function sl(s){const e=$.c(12),{name:t,value:l}=s;let r;e[0]!==l?(r=n.jsx("span",{className:"size-7 shrink-0 rounded-md border border-border",style:{backgroundColor:l},"aria-hidden":!0}),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==t?(a=n.jsx("span",{className:"text-sm text-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==l?(o=n.jsx("span",{className:"text-xs font-mono tabular-nums text-muted-foreground",children:l}),e[4]=l,e[5]=o):o=e[5];let u;e[6]!==a||e[7]!==o?(u=n.jsxs("div",{className:"flex flex-col leading-tight min-w-0",children:[a,o]}),e[6]=a,e[7]=o,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==u?(f=n.jsxs("div",{className:"flex items-center gap-2.5",children:[r,u]}),e[9]=r,e[10]=u,e[11]=f):f=e[11],f}function nl(s){const e=$.c(15),{role:t,family:l}=s;let r;e[0]!==l?(r=n.jsx("span",{className:"text-2xl font-medium leading-none text-foreground shrink-0",style:{fontFamily:l},"aria-hidden":!0,children:"Aa"}),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==t?(a=n.jsx("span",{className:"text-xs text-muted-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==l?(o={fontFamily:l},e[4]=l,e[5]=o):o=e[5];let u;e[6]!==l||e[7]!==o?(u=n.jsx("span",{className:"text-sm text-foreground",style:o,children:l}),e[6]=l,e[7]=o,e[8]=u):u=e[8];let f;e[9]!==a||e[10]!==u?(f=n.jsxs("div",{className:"flex flex-col leading-tight",children:[a,u]}),e[9]=a,e[10]=u,e[11]=f):f=e[11];let i;return e[12]!==r||e[13]!==f?(i=n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted px-4 py-3",children:[r,f]}),e[12]=r,e[13]=f,e[14]=i):i=e[14],i}function ll(s){const e=$.c(3),{logo:t,favicon:l,name:r}=s,a=t??l;if(!a)return null;const o=r?`${r} logo`:"";let u;return e[0]!==a||e[1]!==o?(u=n.jsx("img",{src:a,alt:o,className:"size-16 shrink-0 rounded-lg border border-border bg-background object-contain p-2",onError:ol}),e[0]=a,e[1]=o,e[2]=u):u=e[2],u}function ol(s){s.target.style.display="none"}function Et(s){const e=$.c(4),{colors:t}=s;let l;e[0]!==t?(l=Object.entries(t).filter(rl),e[0]=t,e[1]=l):l=e[1];const r=l;if(r.length===0)return null;let a;return e[2]!==r?(a=n.jsx("div",{className:"flex h-1.5",children:r.map(al)}),e[2]=r,e[3]=a):a=e[3],a}function al(s){const[e,t]=s;return n.jsx("span",{className:"flex-1",style:{backgroundColor:t},title:`${Je[e]}: ${t}`,"aria-hidden":!0},e)}function rl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function Pt(s){const e=$.c(36),{logo:t,favicon:l,name:r,domain:a,overview:o,colors:u,fonts:f,showDefaultBadge:i,isDefault:m}=s;let p;e[0]!==u?(p=u?Object.entries(u).filter(dl):[],e[0]=u,e[1]=p):p=e[1];const c=p;let d;e[2]!==f?(d=f?Object.entries(f).filter(ul):[],e[2]=f,e[3]=d):d=e[3];const x=d;let g;e[4]!==u?(g=u&&n.jsx(Et,{colors:u}),e[4]=u,e[5]=g):g=e[5];let b;e[6]!==l||e[7]!==t||e[8]!==r?(b=n.jsx(ll,{logo:t,favicon:l,name:r}),e[6]=l,e[7]=t,e[8]=r,e[9]=b):b=e[9];let h;e[10]!==m||e[11]!==r||e[12]!==i?(h=r&&n.jsxs("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-foreground truncate",children:[r,i&&m&&n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[n.jsx(yt,{className:"size-3 text-amber-500"}),"default"]})]}),e[10]=m,e[11]=r,e[12]=i,e[13]=h):h=e[13];let N;e[14]!==a?(N=a&&n.jsxs("a",{href:tl(a),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a,n.jsx(Nt,{className:"size-3 shrink-0"})]}),e[14]=a,e[15]=N):N=e[15];let j;e[16]!==h||e[17]!==N?(j=n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h,N]}),e[16]=h,e[17]=N,e[18]=j):j=e[18];let S;e[19]!==b||e[20]!==j?(S=n.jsxs("div",{className:"flex items-center gap-4",children:[b,j]}),e[19]=b,e[20]=j,e[21]=S):S=e[21];let y;e[22]!==o?(y=o&&n.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:o}),e[22]=o,e[23]=y):y=e[23];let v;e[24]!==c?(v=c.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(nt,{children:"Colors"}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3",children:c.map(cl)})]}),e[24]=c,e[25]=v):v=e[25];let k;e[26]!==x?(k=x.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(nt,{children:"Typography"}),n.jsx("div",{className:"flex flex-wrap gap-2.5",children:x.map(il)})]}),e[26]=x,e[27]=k):k=e[27];let _;e[28]!==v||e[29]!==k||e[30]!==S||e[31]!==y?(_=n.jsxs("div",{className:"p-5 flex flex-col gap-6",children:[S,y,v,k]}),e[28]=v,e[29]=k,e[30]=S,e[31]=y,e[32]=_):_=e[32];let w;return e[33]!==_||e[34]!==g?(w=n.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden border border-border",children:[g,_]}),e[33]=_,e[34]=g,e[35]=w):w=e[35],w}function il(s){const[e,t]=s;return n.jsx(nl,{role:e,family:t},e)}function cl(s){const[e,t]=s;return n.jsx(sl,{name:Je[e],value:t},e)}function ul(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function dl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function fl(s){const e=$.c(29),{part:t,latency:l}=s,r=re(t.state);let a;e[0]!==t.output?(a=ve(t.output),e[0]=t.output,e[1]=a):a=e[1];const o=a,u=r==="loading",f=r==="error"||o&&o.success===!1;if(u){const k=t.input;let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ce,{className:"animate-pulse"}),e[2]=_):_=e[2];const w=k?.domain?`from ${k.domain}`:void 0;let T;return e[3]!==w?(T=n.jsx(D,{icon:_,title:"Extracting brand",summary:w,state:"loading",defaultOpen:!0}),e[3]=w,e[4]=T):T=e[4],T}if(f){let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ce,{}),e[5]=k):k=e[5];const _=o?.error??"Unknown error";let w;e[6]!==l?(w=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[6]=l,e[7]=w):w=e[7];let T;return e[8]!==_||e[9]!==w?(T=n.jsx(D,{icon:k,title:"Brand extraction failed",summary:_,state:"error",trailing:w}),e[8]=_,e[9]=w,e[10]=T):T=e[10],T}let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ce,{className:"text-fuchsia-500"}),e[11]=i):i=e[11];const m=o?.name?`Brand set: ${o.name}`:"Brand context set",p=o?.domain;let c;e[12]!==l?(c=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[12]=l,e[13]=c):c=e[13];let d;e[14]!==m||e[15]!==p||e[16]!==c?(d=n.jsx(D,{icon:i,title:m,summary:p,state:"idle",trailing:c}),e[14]=m,e[15]=p,e[16]=c,e[17]=d):d=e[17];const x=o?.logo,g=o?.favicon,b=o?.name,h=o?.domain,N=o?.overview,j=o?.colors,S=o?.fonts;let y;e[18]!==h||e[19]!==N||e[20]!==j||e[21]!==S||e[22]!==x||e[23]!==g||e[24]!==b?(y=n.jsx(Pt,{logo:x,favicon:g,name:b,domain:h,overview:N,colors:j,fonts:S}),e[18]=h,e[19]=N,e[20]=j,e[21]=S,e[22]=x,e[23]=g,e[24]=b,e[25]=y):y=e[25];let v;return e[26]!==y||e[27]!==d?(v=n.jsxs(n.Fragment,{children:[d,y]}),e[26]=y,e[27]=d,e[28]=v):v=e[28],v}function ml(s){const e=$.c(27),{part:t,latency:l}=s,r=re(t.state);let a;e[0]!==t.output?(a=ve(t.output),e[0]=t.output,e[1]=a):a=e[1];const o=a,u=r==="loading",f=r==="error"||o&&o.success===!1;if(u){let g;return e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brand",state:"loading"}),e[2]=g):g=e[2],g}if(f||!o){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ce,{}),e[3]=g):g=e[3];let b;e[4]!==l?(b=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[4]=l,e[5]=b):b=e[5];let h;return e[6]!==b?(h=n.jsx(D,{icon:g,title:"Couldn't load brand",state:"error",trailing:b}),e[6]=b,e[7]=h):h=e[7],h}let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ce,{className:"text-fuchsia-500"}),e[8]=i):i=e[8];const m=o.name?`Brand · ${o.name}`:"Brand";let p;e[9]!==l?(p=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[9]=l,e[10]=p):p=e[10];let c;e[11]!==o.domain||e[12]!==m||e[13]!==p?(c=n.jsx(D,{icon:i,title:m,summary:o.domain,state:"idle",trailing:p}),e[11]=o.domain,e[12]=m,e[13]=p,e[14]=c):c=e[14];let d;e[15]!==o.colors||e[16]!==o.domain||e[17]!==o.favicon||e[18]!==o.fonts||e[19]!==o.isDefault||e[20]!==o.logo||e[21]!==o.name||e[22]!==o.overview?(d=n.jsx(Pt,{logo:o.logo,favicon:o.favicon,name:o.name,domain:o.domain,overview:o.overview,colors:o.colors,fonts:o.fonts,showDefaultBadge:!0,isDefault:o.isDefault}),e[15]=o.colors,e[16]=o.domain,e[17]=o.favicon,e[18]=o.fonts,e[19]=o.isDefault,e[20]=o.logo,e[21]=o.name,e[22]=o.overview,e[23]=d):d=e[23];let x;return e[24]!==c||e[25]!==d?(x=n.jsxs(n.Fragment,{children:[c,d]}),e[24]=c,e[25]=d,e[26]=x):x=e[26],x}function pl(s){const e=$.c(32),{part:t,latency:l}=s;let r;e[0]!==t.state?(r=re(t.state),e[0]=t.state,e[1]=r):r=e[1];const a=r;let o,u,f,i;if(e[2]!==l||e[3]!==t.output||e[4]!==a){i=Symbol.for("react.early_return_sentinel");e:{const c=ve(t.output),d=Array.isArray(c?.items)?c.items:[],x=a==="loading",g=a==="error";if(x){let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brands",state:"loading"}),e[9]=j):j=e[9],i=j;break e}if(g){let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ce,{}),e[10]=j):j=e[10];let S;e[11]!==l?(S=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[11]=l,e[12]=S):S=e[12];let y;e[13]!==S?(y=n.jsx(D,{icon:j,title:"Couldn't load brands",state:"error",trailing:S}),e[13]=S,e[14]=y):y=e[14],i=y;break e}if(d.length===0){let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ce,{}),e[15]=j):j=e[15];let S;e[16]!==l?(S=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[16]=l,e[17]=S):S=e[17];let y;e[18]!==S?(y=n.jsx(D,{icon:j,title:"No brands yet",summary:"The organization hasn't set up any brand context.",state:"idle",trailing:S}),e[18]=S,e[19]=y):y=e[19],i=y;break e}let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(ce,{className:"text-fuchsia-500"}),e[20]=b):b=e[20];const h=d.length===1?"1 brand":`${d.length} brands`;let N;e[21]!==l?(N=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[21]=l,e[22]=N):N=e[22],e[23]!==h||e[24]!==N?(f=n.jsx(D,{icon:b,title:h,state:"idle",trailing:N}),e[23]=h,e[24]=N,e[25]=f):f=e[25],o="mt-2 flex flex-col gap-1.5",u=d.map(xl)}e[2]=l,e[3]=t.output,e[4]=a,e[5]=o,e[6]=u,e[7]=f,e[8]=i}else o=e[5],u=e[6],f=e[7],i=e[8];if(i!==Symbol.for("react.early_return_sentinel"))return i;let m;e[26]!==o||e[27]!==u?(m=n.jsx("div",{className:o,children:u}),e[26]=o,e[27]=u,e[28]=m):m=e[28];let p;return e[29]!==f||e[30]!==m?(p=n.jsxs(n.Fragment,{children:[f,m]}),e[29]=f,e[30]=m,e[31]=p):p=e[31],p}function xl(s){const e=s.colors?Object.entries(s.colors).filter(bl):[];return n.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[s.colors&&n.jsx(Et,{colors:s.colors}),n.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[(s.logo||s.favicon)&&n.jsx("img",{src:s.logo??s.favicon??void 0,alt:"",className:"size-8 shrink-0 rounded-md border border-border bg-background object-contain p-0.5",onError:hl}),n.jsxs("div",{className:"flex flex-col leading-tight min-w-0 flex-1",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground truncate",children:[s.name??"Untitled",s.isDefault&&n.jsx(yt,{className:"size-3 text-amber-500 shrink-0"})]}),s.domain&&n.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:s.domain})]}),e.length>0&&n.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:e.slice(0,5).map(gl)})]})]},s.id??`${s.name}-${s.domain}`)}function gl(s){const[e,t]=s;return n.jsx("span",{className:"size-3 rounded-full border border-border",style:{backgroundColor:t},title:`${Je[e]}: ${t}`,"aria-hidden":!0},e)}function hl(s){s.target.style.display="none"}function bl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function Fe(s){const e=$.c(4),{connection_id:t,iconSize:l}=s,r=l===void 0?"xs":l,a=Ps(t);if(!a)return null;let o;return e[0]!==a.icon||e[1]!==a.title||e[2]!==r?(o=n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx(Ie,{icon:a.icon,name:a.title,size:r})}),e[0]=a.icon,e[1]=a.title,e[2]=r,e[3]=o):o=e[3],o}Fe.Fallback=function({iconSize:e="xs"}){const t=e==="sm"?"size-6":"size-5";return n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx("div",{className:q(t,"rounded bg-muted animate-pulse")})})};function Se(s){const e=$.c(18),{connectionIds:t,maxVisibleIcons:l,iconSize:r,className:a}=s,o=l===void 0?2:l,u=r===void 0?"xs":r;if(t.length===0)return null;let f,i,m;if(e[0]!==a||e[1]!==t||e[2]!==u||e[3]!==o){const d=t.slice(0,o);f=t.length-o,e[7]!==a?(i=q("flex items-center justify-end -space-x-2",a),e[7]=a,e[8]=i):i=e[8];let x;e[9]!==u?(x=g=>n.jsx(H.Suspense,{fallback:n.jsx(Fe.Fallback,{iconSize:u}),children:n.jsx(Fe,{connection_id:g,iconSize:u})},g),e[9]=u,e[10]=x):x=e[10],m=d.map(x),e[0]=a,e[1]=t,e[2]=u,e[3]=o,e[4]=f,e[5]=i,e[6]=m}else f=e[4],i=e[5],m=e[6];let p;e[11]!==u||e[12]!==f?(p=f>0&&n.jsx("div",{className:q("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",u==="sm"?"size-8":"size-6"),children:n.jsxs("span",{className:q(u==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${f} more`,children:["+",f]})}),e[11]=u,e[12]=f,e[13]=p):p=e[13];let c;return e[14]!==i||e[15]!==m||e[16]!==p?(c=n.jsxs("div",{className:i,children:[m,p]}),e[14]=i,e[15]=m,e[16]=p,e[17]=c):c=e[17],c}Se.Fallback=function({maxVisibleIcons:e=2,totalCount:t,iconSize:l="xs"}){const r=l==="sm"?"size-6":"size-5",a=l==="sm"?"size-8":"size-6",o=t!==void 0&&t>e;return n.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((u,f)=>n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx("div",{className:q(r,"rounded bg-muted animate-pulse")})},f)),o&&n.jsx("div",{className:q("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",a),children:n.jsx("div",{className:q(l==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const yl="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",lt=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function jl(s){const e=$.c(64),{part:t,latency:l}=s,r=kt(),a=re(t.state),o=H.useRef(null),u=H.useRef(null),f=H.useRef(null),i=H.useRef(null),m=H.useRef(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{lt?.matches||(m.current=o.current?.getBoundingClientRect()??null,o.current&&(o.current.style.willChange="transform"))},e[0]=p):p=e[0];const c=p;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=P=>{if(lt?.matches)return;const B=m.current,G=o.current;if(!B||!G)return;const K=(P.clientX-B.left)/B.width*100,Y=(P.clientY-B.top)/B.height*100;G.style.transform=`perspective(800px) rotateY(${(K-50)*.05}deg) rotateX(${(Y-50)*-.05}deg)`,u.current&&(u.current.style.opacity="1",u.current.style.transform=`translate(${(K-50)*.15}px, ${(Y-50)*.15}px)`),f.current&&(f.current.style.opacity="0.45"),i.current&&(i.current.style.opacity="0.45")},e[1]=d):d=e[1];const x=d;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{const P=o.current;P&&(P.style.transform="none",P.style.willChange="auto"),u.current&&(u.current.style.opacity="0.4",u.current.style.transform="translate(0, 0)"),f.current&&(f.current.style.opacity="0.3"),i.current&&(i.current.style.opacity="0.3"),m.current=null},e[2]=g):g=e[2];const b=g;if(a==="loading"){let P;return e[3]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Creating agent",state:"loading",defaultOpen:!0}),e[3]=P):P=e[3],P}if(a==="approval"){let P;return e[4]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(D,{icon:n.jsx(ie,{}),title:"Create agent",state:"idle"}),e[4]=P):P=e[4],P}if(a==="error"){let P;e[5]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(ie,{}),e[5]=P):P=e[5];const B=t.state==="output-denied"?"Agent creation cancelled":"Couldn't create agent";let G;e[6]!==l?(G=n.jsx(Z,{latency:l}),e[6]=l,e[7]=G):G=e[7];let K;return e[8]!==B||e[9]!==G?(K=n.jsx(D,{icon:P,title:B,state:"error",trailing:G}),e[8]=B,e[9]=G,e[10]=K):K=e[10],K}let h,N,j;if(e[11]!==l||e[12]!==t.output){j=Symbol.for("react.early_return_sentinel");e:{if(h=ve(t.output)?.item,!h?.id||!h?.title){let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(ie,{}),e[16]=P):P=e[16];let B;e[17]!==l?(B=n.jsx(D,{icon:P,title:"Agent created",state:"idle",trailing:n.jsx(Z,{latency:l})}),e[17]=l,e[18]=B):B=e[18],j=B;break e}N=(h.connections??[]).map(vl)}e[11]=l,e[12]=t.output,e[13]=h,e[14]=N,e[15]=j}else h=e[13],N=e[14],j=e[15];if(j!==Symbol.for("react.early_return_sentinel"))return j;const S=N;let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ie,{className:"text-emerald-500"}),e[19]=y):y=e[19];const v=`Agent created: ${h.title}`;let k;e[20]!==l?(k=n.jsx(Z,{latency:l}),e[20]=l,e[21]=k):k=e[21];let _;e[22]!==v||e[23]!==k?(_=n.jsx(D,{icon:y,title:v,state:"idle",trailing:k}),e[22]=v,e[23]=k,e[24]=_):_=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w={transition:"transform 0.3s ease-out"},e[25]=w):w=e[25];let T;e[26]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("div",{ref:u,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[26]=T):T=e[26];let I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I={textAlign:"justify",wordBreak:"break-all"},e[27]=I):I=e[27];let M,C;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:I,"aria-hidden":"true",children:yl.repeat(6)}),C=n.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[28]=M,e[29]=C):(M=e[28],C=e[29]);let L;e[30]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("img",{ref:f,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[30]=L):L=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("img",{ref:i,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[31]=R):R=e[31];let F;e[32]!==h.icon||e[33]!==h.title?(F=n.jsx(it,{icon:h.icon,name:h.title,size:"md"}),e[32]=h.icon,e[33]=h.title,e[34]=F):F=e[34];let E;e[35]!==h.title?(E=n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:h.title})}),e[35]=h.title,e[36]=E):E=e[36];let A;e[37]!==F||e[38]!==E?(A=n.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[F,E]}),e[37]=F,e[38]=E,e[39]=A):A=e[39];let z;e[40]!==h.description?(z=h.description&&n.jsx("div",{className:"px-2 pt-1 pr-16",children:n.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:h.description})}),e[40]=h.description,e[41]=z):z=e[41];let O;e[42]!==A||e[43]!==z?(O=n.jsxs("div",{className:"relative",children:[A,z]}),e[42]=A,e[43]=z,e[44]=O):O=e[44];let U;e[45]!==S?(U=S.length>0&&n.jsx(H.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:S.length}),children:n.jsx(Se,{connectionIds:S,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})}),e[45]=S,e[46]=U):U=e[46];let W;e[47]!==U?(W=n.jsx("div",{className:"flex-1 min-w-0",children:U}),e[47]=U,e[48]=W):W=e[48];let V;e[49]!==h.id||e[50]!==r?(V=()=>r(h.id),e[49]=h.id,e[50]=r,e[51]=V):V=e[51];const ne=`See agent: ${h.title}`;let X;e[52]!==V||e[53]!==ne?(X=n.jsx("div",{className:"flex items-center gap-2 shrink-0",children:n.jsx(Ne,{size:"sm",className:"h-7",onClick:V,"aria-label":ne,children:"See agent"})}),e[52]=V,e[53]=ne,e[54]=X):X=e[54];let Q;e[55]!==W||e[56]!==X?(Q=n.jsxs("div",{className:"relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1",children:[W,X]}),e[55]=W,e[56]=X,e[57]=Q):Q=e[57];let J;e[58]!==O||e[59]!==Q?(J=n.jsx("div",{className:"mt-2 overflow-hidden rounded-xl border-[0.5px] border-border bg-card p-2.5",children:n.jsxs("div",{ref:o,className:"relative overflow-hidden rounded-lg bg-accent/25 p-2",style:w,onMouseEnter:c,onMouseMove:x,onMouseLeave:b,children:[T,M,C,L,R,O,Q]})}),e[58]=O,e[59]=Q,e[60]=J):J=e[60];let ee;return e[61]!==J||e[62]!==_?(ee=n.jsxs(n.Fragment,{children:[_,J]}),e[61]=J,e[62]=_,e[63]=ee):ee=e[63],ee}function vl(s){return s.connection_id}function Nl(s){const e=$.c(24),{agent:t}=s,l=kt();if(!t.id)return null;let r;e[0]!==t.connections?(r=t.connections??[],e[0]=t.connections,e[1]=r):r=e[1];let a;e[2]!==r?(a=r.map(Sl),e[2]=r,e[3]=a):a=e[3];const o=a;let u;e[4]!==t.id||e[5]!==l?(u=()=>l(t.id),e[4]=t.id,e[5]=l,e[6]=u):u=e[6];let f;e[7]!==t.icon||e[8]!==t.title?(f=n.jsx(it,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=f):f=e[9];let i;e[10]!==t.title?(i=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=i):i=e[11];let m;e[12]!==t.description?(m=t.description&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[12]=t.description,e[13]=m):m=e[13];let p;e[14]!==i||e[15]!==m?(p=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[i,m]}),e[14]=i,e[15]=m,e[16]=p):p=e[16];let c;e[17]!==o?(c=o.length>0&&n.jsx(H.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:o.length}),children:n.jsx(Se,{connectionIds:o,iconSize:"xs",maxVisibleIcons:3})}),e[17]=o,e[18]=c):c=e[18];let d;return e[19]!==u||e[20]!==f||e[21]!==p||e[22]!==c?(d=n.jsxs("button",{type:"button",onClick:u,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[f,p,c]}),e[19]=u,e[20]=f,e[21]=p,e[22]=c,e[23]=d):d=e[23],d}function Sl(s){return s.connection_id}function kl(s){const e=$.c(41),{part:t,latency:l}=s,r=je(),{org:a}=he();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o;let f,i,m,p,c,d;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==u){d=Symbol.for("react.early_return_sentinel");e:{const h=ve(t.output);if(i=Array.isArray(h?.items)?h.items:[],u==="loading"){let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Loading agents",state:"loading"}),e[12]=v):v=e[12],d=v;break e}if(u==="approval"){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(ie,{}),title:"List agents",state:"idle"}),e[13]=v):v=e[13],d=v;break e}if(u==="error"){let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(ie,{}),e[14]=v):v=e[14];const k=t.state==="output-denied"?"Agent list unavailable":"Couldn't load agents";let _;e[15]!==l?(_=n.jsx(Z,{latency:l}),e[15]=l,e[16]=_):_=e[16];let w;e[17]!==k||e[18]!==_?(w=n.jsx(D,{icon:v,title:k,state:"error",trailing:_}),e[17]=k,e[18]=_,e[19]=w):w=e[19],d=w;break e}if(i.length===0){let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(ie,{}),e[20]=v):v=e[20];let k;e[21]!==l?(k=n.jsx(D,{icon:v,title:"No agents yet",summary:"This organization hasn't created any agents.",state:"idle",trailing:n.jsx(Z,{latency:l})}),e[21]=l,e[22]=k):k=e[22],d=k;break e}const N=i.slice(0,Mt);f=i.length-N.length;let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ie,{className:"text-emerald-500"}),e[23]=j):j=e[23];const S=i.length===1?"1 agent":`${i.length} agents`;let y;e[24]!==l?(y=n.jsx(Z,{latency:l}),e[24]=l,e[25]=y):y=e[25],e[26]!==S||e[27]!==y?(c=n.jsx(D,{icon:j,title:S,state:"idle",trailing:y}),e[26]=S,e[27]=y,e[28]=c):c=e[28],m="mt-2 flex flex-col gap-1.5",p=N.map(_l)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=i,e[8]=m,e[9]=p,e[10]=c,e[11]=d}else f=e[6],i=e[7],m=e[8],p=e[9],c=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[29]!==f||e[30]!==i||e[31]!==r||e[32]!==a?(x=f>0&&n.jsx(Lt,{count:i.length,noun:"agents",onClick:()=>r({to:"/$org/settings/agents",params:{org:a.slug}})}),e[29]=f,e[30]=i,e[31]=r,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==m||e[35]!==p||e[36]!==x?(g=n.jsxs("div",{className:m,children:[p,x]}),e[34]=m,e[35]=p,e[36]=x,e[37]=g):g=e[37];let b;return e[38]!==c||e[39]!==g?(b=n.jsxs(n.Fragment,{children:[c,g]}),e[38]=c,e[39]=g,e[40]=b):b=e[40],b}function _l(s){return n.jsx(Nl,{agent:s},s.id)}const wl={active:"bg-emerald-500",inactive:"bg-muted-foreground",error:"bg-destructive"};function Tl(s){const e=$.c(27),{connection:t}=s,l=je(),{org:r}=he(),a=t.slug,o=t.description||t.app_name,u=!a||void 0;let f;e[0]!==l||e[1]!==r||e[2]!==a?(f=()=>a&&l({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:a}}),e[0]=l,e[1]=r,e[2]=a,e[3]=f):f=e[3];let i;e[4]!==t.icon||e[5]!==t.title?(i=n.jsx(Ie,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=i):i=e[6];let m;e[7]!==t.title?(m=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[7]=t.title,e[8]=m):m=e[8];let p;e[9]!==o?(p=o&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:o}),e[9]=o,e[10]=p):p=e[10];let c;e[11]!==m||e[12]!==p?(c=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[m,p]}),e[11]=m,e[12]=p,e[13]=c):c=e[13];const d=wl[t.status]??"bg-muted-foreground";let x;e[14]!==d?(x=q("size-2 shrink-0 rounded-full",d),e[14]=d,e[15]=x):x=e[15];let g;e[16]!==x?(g=n.jsx("span",{className:x,"aria-hidden":"true"}),e[16]=x,e[17]=g):g=e[17];let b;e[18]!==t.status?(b=n.jsx("span",{className:"sr-only",children:t.status}),e[18]=t.status,e[19]=b):b=e[19];let h;return e[20]!==u||e[21]!==b||e[22]!==f||e[23]!==i||e[24]!==c||e[25]!==g?(h=n.jsxs("button",{type:"button","aria-disabled":u,onClick:f,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[i,c,g,b]}),e[20]=u,e[21]=b,e[22]=f,e[23]=i,e[24]=c,e[25]=g,e[26]=h):h=e[26],h}function Cl(s){const e=$.c(40),{part:t,latency:l}=s,r=je(),{org:a}=he();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o;let f,i,m,p,c,d;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==u){d=Symbol.for("react.early_return_sentinel");e:{const h=ve(t.output);if(i=(Array.isArray(h?.items)?h.items:[]).filter(Il),u==="loading"||u==="approval"){let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(_e,{className:"animate-pulse"}),title:"Loading connections",state:"loading"}),e[12]=v):v=e[12],d=v;break e}if(u==="error"){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(_e,{}),e[13]=v):v=e[13];const k=t.state==="output-denied"?"Connection list unavailable":"Couldn't load connections";let _;e[14]!==l?(_=n.jsx(Z,{latency:l}),e[14]=l,e[15]=_):_=e[15];let w;e[16]!==k||e[17]!==_?(w=n.jsx(D,{icon:v,title:k,state:"error",trailing:_}),e[16]=k,e[17]=_,e[18]=w):w=e[18],d=w;break e}if(i.length===0){let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(_e,{}),e[19]=v):v=e[19];let k;e[20]!==l?(k=n.jsx(D,{icon:v,title:"No connections yet",summary:"This organization hasn't connected any MCPs.",state:"idle",trailing:n.jsx(Z,{latency:l})}),e[20]=l,e[21]=k):k=e[21],d=k;break e}const N=i.slice(0,Mt);f=i.length-N.length;let j;e[22]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(_e,{className:"text-emerald-500"}),e[22]=j):j=e[22];const S=i.length===1?"1 connection":`${i.length} connections`;let y;e[23]!==l?(y=n.jsx(Z,{latency:l}),e[23]=l,e[24]=y):y=e[24],e[25]!==S||e[26]!==y?(c=n.jsx(D,{icon:j,title:S,state:"idle",trailing:y}),e[25]=S,e[26]=y,e[27]=c):c=e[27],m="mt-2 flex flex-col gap-1.5",p=N.map($l)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=i,e[8]=m,e[9]=p,e[10]=c,e[11]=d}else f=e[6],i=e[7],m=e[8],p=e[9],c=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[28]!==f||e[29]!==i||e[30]!==r||e[31]!==a?(x=f>0&&n.jsx(Lt,{count:i.length,noun:"connections",onClick:()=>r({to:"/$org/settings/connections",params:{org:a.slug}})}),e[28]=f,e[29]=i,e[30]=r,e[31]=a,e[32]=x):x=e[32];let g;e[33]!==m||e[34]!==p||e[35]!==x?(g=n.jsxs("div",{className:m,children:[p,x]}),e[33]=m,e[34]=p,e[35]=x,e[36]=g):g=e[36];let b;return e[37]!==c||e[38]!==g?(b=n.jsxs(n.Fragment,{children:[c,g]}),e[37]=c,e[38]=g,e[39]=b):b=e[39],b}function $l(s){return n.jsx(Tl,{connection:s},s.id)}function Il(s){return s.connection_type!=="VIRTUAL"}function Ml(){const s=$.c(37),e=Ue(),{sendMessage:t,isStreaming:l,messages:r}=js(),{org:a}=he(),o=e?.virtualMcpId,{prompts:u}=zs(a.slug),f=o??null;let i;s[0]!==a.id||s[1]!==a.slug||s[2]!==f?(i={connectionId:f,orgId:a.id,orgSlug:a.slug},s[0]=a.id,s[1]=a.slug,s[2]=f,s[3]=i):i=s[3];const m=We(i),[p,c]=H.useState(null);if(!o||l||!Ss(o)||!r.some(Ll))return null;let x;if(s[4]!==u||s[5]!==o){let C;s[7]!==o?(C=L=>L.agentId===o&&L.promptName,s[7]=o,s[8]=C):C=s[8],x=u.find(C),s[4]=u,s[5]=o,s[6]=x}else x=s[6];const g=x;if(!g)return null;let b;s[9]!==m||s[10]!==t?(b=async(C,L)=>{if(!m){ze.error("MCP client not available");return}try{const R=await Os(m,C.name,L);await t({type:"doc",content:[{type:"paragraph",content:[$t({id:C.name,name:Ve(C.name,qe(C._meta)),metadata:R.messages,char:"/",kind:"prompt",args:L}),{type:"text",text:" "}]}]})}catch(R){console.error("[next-action-chip] failed",R),ze.error("Failed to load prompt. Please try again.")}},s[9]=m,s[10]=t,s[11]=b):b=s[11];const h=b;let N;s[12]!==g._meta||s[13]!==g.arguments||s[14]!==g.description||s[15]!==g.promptName||s[16]!==g.title||s[17]!==h?(N=()=>{const C={name:g.promptName,title:g.title,description:g.description,arguments:g.arguments,_meta:g._meta};if(C.arguments&&C.arguments.length>0){c(C);return}h(C)},s[12]=g._meta,s[13]=g.arguments,s[14]=g.description,s[15]=g.promptName,s[16]=g.title,s[17]=h,s[18]=N):N=s[18];const j=N;let S,y;s[19]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Fs,{size:12,className:"shrink-0 text-purple-500"}),y=n.jsx("span",{className:"font-medium text-foreground/80",children:"Next:"}),s[19]=S,s[20]=y):(S=s[19],y=s[20]);let v;s[21]!==g.title?(v=n.jsx("span",{className:"truncate",children:g.title}),s[21]=g.title,s[22]=v):v=s[22];let k;s[23]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ct,{size:12,className:"shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),s[23]=k):k=s[23];let _;s[24]!==j||s[25]!==v?(_=n.jsxs("button",{type:"button",onClick:j,className:"group mt-3 flex items-center gap-2 self-start rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:border-border hover:bg-accent/40 hover:text-foreground",children:[S,y,v,k]}),s[24]=j,s[25]=v,s[26]=_):_=s[26];let w;s[27]===Symbol.for("react.memo_cache_sentinel")?(w=C=>c(C),s[27]=w):w=s[27];let T;s[28]!==p||s[29]!==h?(T=async C=>{const L=p;c(null),L&&await h(L,C)},s[28]=p,s[29]=h,s[30]=T):T=s[30];let I;s[31]!==p||s[32]!==T?(I=n.jsx(an,{prompt:p,setPrompt:w,onSubmit:T}),s[31]=p,s[32]=T,s[33]=I):I=s[33];let M;return s[34]!==I||s[35]!==_?(M=n.jsxs(n.Fragment,{children:[_,I]}),s[34]=I,s[35]=_,s[36]=M):M=s[36],M}function Ll(s){return s.role==="user"||s.parts.some(Rl)}function Rl(s){return s.type==="tool-user_ask"&&s.state==="output-available"}function Al(s){const e=new Map;for(let t=s.length-1;t>=0;t--){const l=s[t]?.parts;if(l)for(const r of l){const a=r;if(a.type!=="tool-edit"&&a.type!=="tool-write"||a.state!=="output-available")continue;const o=a.output?.htmlPreview;o?.slug&&(e.has(o.slug)||e.set(o.slug,o))}}return Array.from(e.values())}function zl(){const s=$.c(8),e=je(),t=$e()?.messages??[],l=Al(t);if(l.length===0)return null;const r="flex flex-col gap-1.5 py-2";let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"text-[12px] text-muted-foreground/70 uppercase tracking-wide",children:"Pages in this chat"}),s[0]=a):a=s[0];const o="flex flex-wrap gap-2";let u;s[1]!==e?(u=p=>n.jsxs("button",{type:"button",onClick:()=>e({to:".",search:c=>({...c,main:`web-page:${p.slug}`}),replace:!0}),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-muted/30 hover:bg-muted/60 text-[13px] transition-colors",children:[n.jsx(Cs,{className:"size-3.5 shrink-0 text-muted-foreground"}),n.jsx("span",{className:"font-medium text-foreground",children:p.slug})]},p.slug),s[1]=e,s[2]=u):u=s[2];const f=l.map(u);let i;s[3]!==f?(i=n.jsx("div",{className:o,children:f}),s[3]=f,s[4]=i):i=s[4];let m;return s[5]!==a||s[6]!==i?(m=n.jsxs("div",{className:r,children:[a,i]}),s[5]=a,s[6]=i,s[7]=m):m=s[7],m}async function El(s,e){const t=await fetch(`/api/${e}/threads/${encodeURIComponent(s)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function ma(){const s=$.c(2),e=$e()?.messages??[];let t;return s[0]!==e?(t=e.some(Pl),s[0]=e,s[1]=t):t=s[1],t}function Pl(s){return s.parts?.some(Fl)}function Fl(s){const e=s;return(e.type==="tool-share_with_user"||e.type==="tool-bash"||e.type==="tool-write")&&e.state==="output-available"}function Ol(s,e){const t=$.c(9),{org:l}=he();let r;t[0]!==s?(r=me.threadOutputs(s??""),t[0]=s,t[1]=r):r=t[1];let a;t[2]!==l||t[3]!==s?(a=()=>El(s??"",l.slug),t[2]=l,t[3]=s,t[4]=a):a=t[4];const o=!!s&&(e?.enabled??!0);let u;return t[5]!==r||t[6]!==a||t[7]!==o?(u={queryKey:r,queryFn:a,enabled:o,staleTime:0},t[5]=r,t[6]=a,t[7]=o,t[8]=u):u=t[8],Oe(u)}function Dl(s){const e=$.c(20),{file:t}=s,l=je();let r;e[0]!==t.key||e[1]!==l?(r=()=>l({to:".",search:d=>({...d,main:ws(t.key)}),replace:!0}),e[0]=t.key,e[1]=l,e[2]=r):r=e[2];const a=r;let o;e[3]!==t.filename?(o=n.jsx(gs,{filename:t.filename,className:"h-5 w-4 shrink-0"}),e[3]=t.filename,e[4]=o):o=e[4];let u;e[5]!==t.filename||e[6]!==a?(u=n.jsx("button",{type:"button",onClick:a,className:"min-w-0 flex-1 truncate text-left text-[13px] font-medium text-foreground hover:underline",title:t.filename,children:t.filename}),e[5]=t.filename,e[6]=a,e[7]=u):u=e[7];const f=`Download ${t.filename}`;let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vt,{className:"size-3.5"}),e[8]=i):i=e[8];let m;e[9]!==t.downloadUrl||e[10]!==t.filename||e[11]!==f?(m=n.jsx("a",{href:t.downloadUrl,download:t.filename,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block",title:"Download","aria-label":f,children:i}),e[9]=t.downloadUrl,e[10]=t.filename,e[11]=f,e[12]=m):m=e[12];let p;e[13]!==a?(p=n.jsx(Ne,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:a,children:"Open"}),e[13]=a,e[14]=p):p=e[14];let c;return e[15]!==o||e[16]!==u||e[17]!==m||e[18]!==p?(c=n.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[o,u,m,p]}),e[15]=o,e[16]=u,e[17]=m,e[18]=p,e[19]=c):c=e[19],c}function ot(s){return s.split("/").pop()??s}const Hl=/(^|\/)output\//;function Bl(s){const e=new Set;for(const t of s.parts??[]){const l=t;if(l.state==="output-available"){if(l.type==="tool-share_with_user"){const r=l.output?.filename??l.input?.name??(l.input?.source?ot(l.input.source):null);r&&e.add(r)}else if(l.type==="tool-write"){const r=l.input?.path;r&&Hl.test(r)&&e.add(ot(r))}}}return e}function Ul(s){const e=$.c(4),{threadId:t,message:l}=s,r=Bl(l),a=r.size>0;let o;e[0]!==a?(o={enabled:a},e[0]=a,e[1]=o):o=e[1];const{data:u}=Ol(t,o);if(r.size===0)return null;const f=(u??[]).filter(c=>r.has(c.filename));if(f.length===0)return null;const i="flex flex-col gap-1.5 py-2",m=f.map(Wl);let p;return e[2]!==m?(p=n.jsx("div",{className:i,children:m}),e[2]=m,e[3]=p):p=e[3],p}function Wl(s){return n.jsx(Dl,{file:s},s.key)}function ql(s){return s.type==="reasoning"}function Vl(s){const e=[],t=new Set,l=new Map,r=new Map,a=new Map;if(s){let u=null;for(let f=0;f<s.parts.length;f++){const i=s.parts[f];if(ql(i)){u||(u={parts:[],startIndex:f},e.push(u)),u.parts.push(i),t.add(f);continue}if(u=null,i.type==="data-tool-metadata"&&"id"in i&&"data"in i){const m=i.data,p={};m.annotations&&(p.annotations=m.annotations),typeof m.latencyMs=="number"&&Number.isFinite(m.latencyMs)&&(p.latencySeconds=m.latencyMs/1e3),typeof m.outputBytes=="number"&&Number.isFinite(m.outputBytes)&&m.outputBytes>=0&&(p.outputBytes=m.outputBytes),m._meta&&typeof m._meta=="object"&&(p._meta=m._meta),l.set(i.id,p);continue}if(i.type==="data-tool-subtask-metadata"&&"id"in i){r.set(i.id,i.data);continue}if(i.type==="data-web-search"&&"id"in i&&"data"in i){const m=i.id,p=i.data;a.set(m,p.text??"");continue}}}const o=[];if(s){let u=[],f=[];const i=new Set,m=()=>{for(const p of u)i.has(p)||(i.add(p),o.push({kind:"reasoning-group",group:p}));for(const p of f)o.push({kind:"part",index:p.index});u=[],f=[]};for(let p=0;p<s.parts.length;p++){const c=s.parts[p];if(c.type==="step-start"){m();continue}if(t.has(p)){const d=e.find(x=>x.startIndex===p);d&&u.push(d);continue}c.type.startsWith("data-")||f.push({index:p})}m()}return{reasoningGroups:e,renderOrder:o,dataParts:{toolMetadata:l,toolSubtaskMetadata:r,webSearchStreaming:a}}}function Gl(s){const e=$.c(9),{since:t}=s;let l;e[0]!==t?(l=()=>Ze(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[r,a]=H.useState(l);let o,u;e[2]!==t?(o=()=>{const p=setInterval(()=>a(Ze(t,Date.now())),100);return()=>clearInterval(p)},u=[t],e[2]=t,e[3]=o,e[4]=u):(o=e[3],u=e[4]),H.useEffect(o,u);const f=r/1e3;let i;e[5]!==f?(i=de(f),e[5]=f,e[6]=i):i=e[6];let m;return e[7]!==i?(m=n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:i}),e[7]=i,e[8]=m):m=e[8],m}const Ft=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Kl(){const s=$.c(5),[e]=H.useState(Jl);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},s[0]=t):t=s[0];let l;s[1]!==e?(l=Ft.map((a,o)=>{const{delay:u}=a;return n.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[o],animation:"grid-ripple 1s ease infinite",animationDelay:`${u}ms`}},o)}),s[1]=e,s[2]=l):l=s[2];let r;return s[3]!==l?(r=n.jsx("div",{className:"grid",style:t,children:l}),s[3]=l,s[4]=r):r=s[4],r}function Jl(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Ft.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}const Xl={planning:{icon:n.jsx(ss,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:n.jsx(He,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},Ql=1200;function Yl(){const s=$.c(7),[e,t]=H.useState("planning");let l,r;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{const f=setTimeout(()=>{t("thinking")},Ql);return()=>{clearTimeout(f)}},r=[],s[0]=l,s[1]=r):(l=s[0],r=s[1]),H.useEffect(l,r);const a=Xl[e];let o;s[2]!==a.label?(o=n.jsxs("span",{className:"text-[14px] text-muted-foreground shimmer",children:[a.label,"..."]}),s[2]=a.label,s[3]=o):o=s[3];let u;return s[4]!==a.icon||s[5]!==o?(u=n.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[a.icon,o]})}),s[4]=a.icon,s[5]=o,s[6]=u):u=s[6],u}function Zl(s){const e=$.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Kl,{}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=n.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[l,n.jsx(Gl,{since:t})]}),e[1]=t,e[2]=r):r=e[2],r}function eo(s){const e=$.c(20),{duration:t,parts:l,isStreaming:r}=s;let a;e[0]!==l?(a=l.every(no),e[0]=l,e[1]=a):a=e[1];const o=a;let u;e[2]!==t?(u=t&&t/1e3>1?`Thought for ${de(t/1e3)}`:"Thought",e[2]=t,e[3]=u):u=e[3];const f=u;let i;if(e[4]!==o||e[5]!==r||e[6]!==l){const j=l.map(so).join(`
|
|
35
|
+
${x}`;return{fallbackTitle:i,summary:p,usage:e?.usage,latency:t,detail:g,state:f}}function Yn(s){const e=$.c(7),t=zt(s);let l,r;e[0]!==t?({fallbackTitle:l,...r}=t,e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ie,{icon:void 0,name:"Subtask",size:"2xs",className:"rounded-xs",fallbackIcon:n.jsx(St,{})}),e[3]=a):a=e[3];let o;return e[4]!==l||e[5]!==r?(o=n.jsx(D,{icon:a,title:l,...r}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o}function Zn(s){const e=$.c(11),t=zt(s);let l,r;e[0]!==t?({fallbackTitle:l,...r}=t,e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]);const a=Es(s.part.input?.agent_id),o=a?.icon,u=a?.title??"Subtask";let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(St,{}),e[3]=f):f=e[3];let i;e[4]!==o||e[5]!==u?(i=n.jsx(Ie,{icon:o,name:u,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[4]=o,e[5]=u,e[6]=i):i=e[6];const m=a?.title??l;let p;return e[7]!==r||e[8]!==i||e[9]!==m?(p=n.jsx(D,{icon:i,title:m,...r}),e[7]=r,e[8]=i,e[9]=m,e[10]=p):p=e[10],p}function el(s){const e=$.c(16),{part:t}=s;if(!t.state.startsWith("output-"))return null;const l=t.input?.plan??"",a=t.output?.approved===!0;let o,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(jt,{className:"size-4 text-purple-500 shrink-0"}),u=n.jsx("span",{className:"text-[14px] font-medium text-foreground/80",children:"Implementation Plan"}),e[0]=o,e[1]=u):(o=e[0],u=e[1]);let f;e[2]!==a?(f=a&&n.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 bg-green-500/10 px-1.5 py-0.5 rounded-md",children:[n.jsx(Be,{size:12}),"Approved"]}),e[2]=a,e[3]=f):f=e[3];let i;e[4]!==a||e[5]!==t.state?(i=!a&&t.state==="output-available"&&n.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:"Rejected"}),e[4]=a,e[5]=t.state,e[6]=i):i=e[6];let m;e[7]!==f||e[8]!==i?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,u,f,i]}),e[7]=f,e[8]=i,e[9]=m):m=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"View plan"}),e[10]=p):p=e[10];let c;e[11]!==l?(c=n.jsxs("details",{className:"ml-6",children:[p,n.jsx("div",{className:"mt-1 pl-2 border-l-2 border-purple-500/30 prose prose-sm max-w-none text-sm",children:n.jsx(Ge,{id:"plan-content",part:{type:"text",text:l}})})]}),e[11]=l,e[12]=c):c=e[12];let d;return e[13]!==m||e[14]!==c?(d=n.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,c]}),e[13]=m,e[14]=c,e[15]=d):d=e[15],d}const Je={primary:"Primary",secondary:"Secondary",accent:"Accent",background:"Background",foreground:"Foreground"};function tl(s){return s.startsWith("http")?s:`https://${s}`}function nt(s){const e=$.c(2),{children:t}=s;let l;return e[0]!==t?(l=n.jsx("span",{className:"text-sm font-medium text-foreground",children:t}),e[0]=t,e[1]=l):l=e[1],l}function sl(s){const e=$.c(12),{name:t,value:l}=s;let r;e[0]!==l?(r=n.jsx("span",{className:"size-7 shrink-0 rounded-md border border-border",style:{backgroundColor:l},"aria-hidden":!0}),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==t?(a=n.jsx("span",{className:"text-sm text-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==l?(o=n.jsx("span",{className:"text-xs font-mono tabular-nums text-muted-foreground",children:l}),e[4]=l,e[5]=o):o=e[5];let u;e[6]!==a||e[7]!==o?(u=n.jsxs("div",{className:"flex flex-col leading-tight min-w-0",children:[a,o]}),e[6]=a,e[7]=o,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==u?(f=n.jsxs("div",{className:"flex items-center gap-2.5",children:[r,u]}),e[9]=r,e[10]=u,e[11]=f):f=e[11],f}function nl(s){const e=$.c(15),{role:t,family:l}=s;let r;e[0]!==l?(r=n.jsx("span",{className:"text-2xl font-medium leading-none text-foreground shrink-0",style:{fontFamily:l},"aria-hidden":!0,children:"Aa"}),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==t?(a=n.jsx("span",{className:"text-xs text-muted-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==l?(o={fontFamily:l},e[4]=l,e[5]=o):o=e[5];let u;e[6]!==l||e[7]!==o?(u=n.jsx("span",{className:"text-sm text-foreground",style:o,children:l}),e[6]=l,e[7]=o,e[8]=u):u=e[8];let f;e[9]!==a||e[10]!==u?(f=n.jsxs("div",{className:"flex flex-col leading-tight",children:[a,u]}),e[9]=a,e[10]=u,e[11]=f):f=e[11];let i;return e[12]!==r||e[13]!==f?(i=n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted px-4 py-3",children:[r,f]}),e[12]=r,e[13]=f,e[14]=i):i=e[14],i}function ll(s){const e=$.c(3),{logo:t,favicon:l,name:r}=s,a=t??l;if(!a)return null;const o=r?`${r} logo`:"";let u;return e[0]!==a||e[1]!==o?(u=n.jsx("img",{src:a,alt:o,className:"size-16 shrink-0 rounded-lg border border-border bg-background object-contain p-2",onError:ol}),e[0]=a,e[1]=o,e[2]=u):u=e[2],u}function ol(s){s.target.style.display="none"}function Et(s){const e=$.c(4),{colors:t}=s;let l;e[0]!==t?(l=Object.entries(t).filter(rl),e[0]=t,e[1]=l):l=e[1];const r=l;if(r.length===0)return null;let a;return e[2]!==r?(a=n.jsx("div",{className:"flex h-1.5",children:r.map(al)}),e[2]=r,e[3]=a):a=e[3],a}function al(s){const[e,t]=s;return n.jsx("span",{className:"flex-1",style:{backgroundColor:t},title:`${Je[e]}: ${t}`,"aria-hidden":!0},e)}function rl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function Pt(s){const e=$.c(36),{logo:t,favicon:l,name:r,domain:a,overview:o,colors:u,fonts:f,showDefaultBadge:i,isDefault:m}=s;let p;e[0]!==u?(p=u?Object.entries(u).filter(dl):[],e[0]=u,e[1]=p):p=e[1];const c=p;let d;e[2]!==f?(d=f?Object.entries(f).filter(ul):[],e[2]=f,e[3]=d):d=e[3];const x=d;let g;e[4]!==u?(g=u&&n.jsx(Et,{colors:u}),e[4]=u,e[5]=g):g=e[5];let b;e[6]!==l||e[7]!==t||e[8]!==r?(b=n.jsx(ll,{logo:t,favicon:l,name:r}),e[6]=l,e[7]=t,e[8]=r,e[9]=b):b=e[9];let h;e[10]!==m||e[11]!==r||e[12]!==i?(h=r&&n.jsxs("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-foreground truncate",children:[r,i&&m&&n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[n.jsx(yt,{className:"size-3 text-amber-500"}),"default"]})]}),e[10]=m,e[11]=r,e[12]=i,e[13]=h):h=e[13];let N;e[14]!==a?(N=a&&n.jsxs("a",{href:tl(a),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a,n.jsx(Nt,{className:"size-3 shrink-0"})]}),e[14]=a,e[15]=N):N=e[15];let j;e[16]!==h||e[17]!==N?(j=n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h,N]}),e[16]=h,e[17]=N,e[18]=j):j=e[18];let S;e[19]!==b||e[20]!==j?(S=n.jsxs("div",{className:"flex items-center gap-4",children:[b,j]}),e[19]=b,e[20]=j,e[21]=S):S=e[21];let y;e[22]!==o?(y=o&&n.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:o}),e[22]=o,e[23]=y):y=e[23];let v;e[24]!==c?(v=c.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(nt,{children:"Colors"}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3",children:c.map(cl)})]}),e[24]=c,e[25]=v):v=e[25];let k;e[26]!==x?(k=x.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(nt,{children:"Typography"}),n.jsx("div",{className:"flex flex-wrap gap-2.5",children:x.map(il)})]}),e[26]=x,e[27]=k):k=e[27];let _;e[28]!==v||e[29]!==k||e[30]!==S||e[31]!==y?(_=n.jsxs("div",{className:"p-5 flex flex-col gap-6",children:[S,y,v,k]}),e[28]=v,e[29]=k,e[30]=S,e[31]=y,e[32]=_):_=e[32];let w;return e[33]!==_||e[34]!==g?(w=n.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden border border-border",children:[g,_]}),e[33]=_,e[34]=g,e[35]=w):w=e[35],w}function il(s){const[e,t]=s;return n.jsx(nl,{role:e,family:t},e)}function cl(s){const[e,t]=s;return n.jsx(sl,{name:Je[e],value:t},e)}function ul(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function dl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function fl(s){const e=$.c(29),{part:t,latency:l}=s,r=re(t.state);let a;e[0]!==t.output?(a=ve(t.output),e[0]=t.output,e[1]=a):a=e[1];const o=a,u=r==="loading",f=r==="error"||o&&o.success===!1;if(u){const k=t.input;let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ce,{className:"animate-pulse"}),e[2]=_):_=e[2];const w=k?.domain?`from ${k.domain}`:void 0;let T;return e[3]!==w?(T=n.jsx(D,{icon:_,title:"Extracting brand",summary:w,state:"loading",defaultOpen:!0}),e[3]=w,e[4]=T):T=e[4],T}if(f){let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ce,{}),e[5]=k):k=e[5];const _=o?.error??"Unknown error";let w;e[6]!==l?(w=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[6]=l,e[7]=w):w=e[7];let T;return e[8]!==_||e[9]!==w?(T=n.jsx(D,{icon:k,title:"Brand extraction failed",summary:_,state:"error",trailing:w}),e[8]=_,e[9]=w,e[10]=T):T=e[10],T}let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ce,{className:"text-fuchsia-500"}),e[11]=i):i=e[11];const m=o?.name?`Brand set: ${o.name}`:"Brand context set",p=o?.domain;let c;e[12]!==l?(c=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[12]=l,e[13]=c):c=e[13];let d;e[14]!==m||e[15]!==p||e[16]!==c?(d=n.jsx(D,{icon:i,title:m,summary:p,state:"idle",trailing:c}),e[14]=m,e[15]=p,e[16]=c,e[17]=d):d=e[17];const x=o?.logo,g=o?.favicon,b=o?.name,h=o?.domain,N=o?.overview,j=o?.colors,S=o?.fonts;let y;e[18]!==h||e[19]!==N||e[20]!==j||e[21]!==S||e[22]!==x||e[23]!==g||e[24]!==b?(y=n.jsx(Pt,{logo:x,favicon:g,name:b,domain:h,overview:N,colors:j,fonts:S}),e[18]=h,e[19]=N,e[20]=j,e[21]=S,e[22]=x,e[23]=g,e[24]=b,e[25]=y):y=e[25];let v;return e[26]!==y||e[27]!==d?(v=n.jsxs(n.Fragment,{children:[d,y]}),e[26]=y,e[27]=d,e[28]=v):v=e[28],v}function ml(s){const e=$.c(27),{part:t,latency:l}=s,r=re(t.state);let a;e[0]!==t.output?(a=ve(t.output),e[0]=t.output,e[1]=a):a=e[1];const o=a,u=r==="loading",f=r==="error"||o&&o.success===!1;if(u){let g;return e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brand",state:"loading"}),e[2]=g):g=e[2],g}if(f||!o){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ce,{}),e[3]=g):g=e[3];let b;e[4]!==l?(b=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[4]=l,e[5]=b):b=e[5];let h;return e[6]!==b?(h=n.jsx(D,{icon:g,title:"Couldn't load brand",state:"error",trailing:b}),e[6]=b,e[7]=h):h=e[7],h}let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ce,{className:"text-fuchsia-500"}),e[8]=i):i=e[8];const m=o.name?`Brand · ${o.name}`:"Brand";let p;e[9]!==l?(p=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[9]=l,e[10]=p):p=e[10];let c;e[11]!==o.domain||e[12]!==m||e[13]!==p?(c=n.jsx(D,{icon:i,title:m,summary:o.domain,state:"idle",trailing:p}),e[11]=o.domain,e[12]=m,e[13]=p,e[14]=c):c=e[14];let d;e[15]!==o.colors||e[16]!==o.domain||e[17]!==o.favicon||e[18]!==o.fonts||e[19]!==o.isDefault||e[20]!==o.logo||e[21]!==o.name||e[22]!==o.overview?(d=n.jsx(Pt,{logo:o.logo,favicon:o.favicon,name:o.name,domain:o.domain,overview:o.overview,colors:o.colors,fonts:o.fonts,showDefaultBadge:!0,isDefault:o.isDefault}),e[15]=o.colors,e[16]=o.domain,e[17]=o.favicon,e[18]=o.fonts,e[19]=o.isDefault,e[20]=o.logo,e[21]=o.name,e[22]=o.overview,e[23]=d):d=e[23];let x;return e[24]!==c||e[25]!==d?(x=n.jsxs(n.Fragment,{children:[c,d]}),e[24]=c,e[25]=d,e[26]=x):x=e[26],x}function pl(s){const e=$.c(32),{part:t,latency:l}=s;let r;e[0]!==t.state?(r=re(t.state),e[0]=t.state,e[1]=r):r=e[1];const a=r;let o,u,f,i;if(e[2]!==l||e[3]!==t.output||e[4]!==a){i=Symbol.for("react.early_return_sentinel");e:{const c=ve(t.output),d=Array.isArray(c?.items)?c.items:[],x=a==="loading",g=a==="error";if(x){let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brands",state:"loading"}),e[9]=j):j=e[9],i=j;break e}if(g){let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ce,{}),e[10]=j):j=e[10];let S;e[11]!==l?(S=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[11]=l,e[12]=S):S=e[12];let y;e[13]!==S?(y=n.jsx(D,{icon:j,title:"Couldn't load brands",state:"error",trailing:S}),e[13]=S,e[14]=y):y=e[14],i=y;break e}if(d.length===0){let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ce,{}),e[15]=j):j=e[15];let S;e[16]!==l?(S=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[16]=l,e[17]=S):S=e[17];let y;e[18]!==S?(y=n.jsx(D,{icon:j,title:"No brands yet",summary:"The organization hasn't set up any brand context.",state:"idle",trailing:S}),e[18]=S,e[19]=y):y=e[19],i=y;break e}let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(ce,{className:"text-fuchsia-500"}),e[20]=b):b=e[20];const h=d.length===1?"1 brand":`${d.length} brands`;let N;e[21]!==l?(N=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[21]=l,e[22]=N):N=e[22],e[23]!==h||e[24]!==N?(f=n.jsx(D,{icon:b,title:h,state:"idle",trailing:N}),e[23]=h,e[24]=N,e[25]=f):f=e[25],o="mt-2 flex flex-col gap-1.5",u=d.map(xl)}e[2]=l,e[3]=t.output,e[4]=a,e[5]=o,e[6]=u,e[7]=f,e[8]=i}else o=e[5],u=e[6],f=e[7],i=e[8];if(i!==Symbol.for("react.early_return_sentinel"))return i;let m;e[26]!==o||e[27]!==u?(m=n.jsx("div",{className:o,children:u}),e[26]=o,e[27]=u,e[28]=m):m=e[28];let p;return e[29]!==f||e[30]!==m?(p=n.jsxs(n.Fragment,{children:[f,m]}),e[29]=f,e[30]=m,e[31]=p):p=e[31],p}function xl(s){const e=s.colors?Object.entries(s.colors).filter(bl):[];return n.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[s.colors&&n.jsx(Et,{colors:s.colors}),n.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[(s.logo||s.favicon)&&n.jsx("img",{src:s.logo??s.favicon??void 0,alt:"",className:"size-8 shrink-0 rounded-md border border-border bg-background object-contain p-0.5",onError:hl}),n.jsxs("div",{className:"flex flex-col leading-tight min-w-0 flex-1",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground truncate",children:[s.name??"Untitled",s.isDefault&&n.jsx(yt,{className:"size-3 text-amber-500 shrink-0"})]}),s.domain&&n.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:s.domain})]}),e.length>0&&n.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:e.slice(0,5).map(gl)})]})]},s.id??`${s.name}-${s.domain}`)}function gl(s){const[e,t]=s;return n.jsx("span",{className:"size-3 rounded-full border border-border",style:{backgroundColor:t},title:`${Je[e]}: ${t}`,"aria-hidden":!0},e)}function hl(s){s.target.style.display="none"}function bl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function Fe(s){const e=$.c(4),{connection_id:t,iconSize:l}=s,r=l===void 0?"xs":l,a=Ps(t);if(!a)return null;let o;return e[0]!==a.icon||e[1]!==a.title||e[2]!==r?(o=n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx(Ie,{icon:a.icon,name:a.title,size:r})}),e[0]=a.icon,e[1]=a.title,e[2]=r,e[3]=o):o=e[3],o}Fe.Fallback=function({iconSize:e="xs"}){const t=e==="sm"?"size-6":"size-5";return n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx("div",{className:q(t,"rounded bg-muted animate-pulse")})})};function Se(s){const e=$.c(18),{connectionIds:t,maxVisibleIcons:l,iconSize:r,className:a}=s,o=l===void 0?2:l,u=r===void 0?"xs":r;if(t.length===0)return null;let f,i,m;if(e[0]!==a||e[1]!==t||e[2]!==u||e[3]!==o){const d=t.slice(0,o);f=t.length-o,e[7]!==a?(i=q("flex items-center justify-end -space-x-2",a),e[7]=a,e[8]=i):i=e[8];let x;e[9]!==u?(x=g=>n.jsx(H.Suspense,{fallback:n.jsx(Fe.Fallback,{iconSize:u}),children:n.jsx(Fe,{connection_id:g,iconSize:u})},g),e[9]=u,e[10]=x):x=e[10],m=d.map(x),e[0]=a,e[1]=t,e[2]=u,e[3]=o,e[4]=f,e[5]=i,e[6]=m}else f=e[4],i=e[5],m=e[6];let p;e[11]!==u||e[12]!==f?(p=f>0&&n.jsx("div",{className:q("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",u==="sm"?"size-8":"size-6"),children:n.jsxs("span",{className:q(u==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${f} more`,children:["+",f]})}),e[11]=u,e[12]=f,e[13]=p):p=e[13];let c;return e[14]!==i||e[15]!==m||e[16]!==p?(c=n.jsxs("div",{className:i,children:[m,p]}),e[14]=i,e[15]=m,e[16]=p,e[17]=c):c=e[17],c}Se.Fallback=function({maxVisibleIcons:e=2,totalCount:t,iconSize:l="xs"}){const r=l==="sm"?"size-6":"size-5",a=l==="sm"?"size-8":"size-6",o=t!==void 0&&t>e;return n.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((u,f)=>n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx("div",{className:q(r,"rounded bg-muted animate-pulse")})},f)),o&&n.jsx("div",{className:q("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",a),children:n.jsx("div",{className:q(l==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const yl="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",lt=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function jl(s){const e=$.c(64),{part:t,latency:l}=s,r=kt(),a=re(t.state),o=H.useRef(null),u=H.useRef(null),f=H.useRef(null),i=H.useRef(null),m=H.useRef(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{lt?.matches||(m.current=o.current?.getBoundingClientRect()??null,o.current&&(o.current.style.willChange="transform"))},e[0]=p):p=e[0];const c=p;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=P=>{if(lt?.matches)return;const B=m.current,G=o.current;if(!B||!G)return;const K=(P.clientX-B.left)/B.width*100,Y=(P.clientY-B.top)/B.height*100;G.style.transform=`perspective(800px) rotateY(${(K-50)*.05}deg) rotateX(${(Y-50)*-.05}deg)`,u.current&&(u.current.style.opacity="1",u.current.style.transform=`translate(${(K-50)*.15}px, ${(Y-50)*.15}px)`),f.current&&(f.current.style.opacity="0.45"),i.current&&(i.current.style.opacity="0.45")},e[1]=d):d=e[1];const x=d;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{const P=o.current;P&&(P.style.transform="none",P.style.willChange="auto"),u.current&&(u.current.style.opacity="0.4",u.current.style.transform="translate(0, 0)"),f.current&&(f.current.style.opacity="0.3"),i.current&&(i.current.style.opacity="0.3"),m.current=null},e[2]=g):g=e[2];const b=g;if(a==="loading"){let P;return e[3]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Creating agent",state:"loading",defaultOpen:!0}),e[3]=P):P=e[3],P}if(a==="approval"){let P;return e[4]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(D,{icon:n.jsx(ie,{}),title:"Create agent",state:"idle"}),e[4]=P):P=e[4],P}if(a==="error"){let P;e[5]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(ie,{}),e[5]=P):P=e[5];const B=t.state==="output-denied"?"Agent creation cancelled":"Couldn't create agent";let G;e[6]!==l?(G=n.jsx(Z,{latency:l}),e[6]=l,e[7]=G):G=e[7];let K;return e[8]!==B||e[9]!==G?(K=n.jsx(D,{icon:P,title:B,state:"error",trailing:G}),e[8]=B,e[9]=G,e[10]=K):K=e[10],K}let h,N,j;if(e[11]!==l||e[12]!==t.output){j=Symbol.for("react.early_return_sentinel");e:{if(h=ve(t.output)?.item,!h?.id||!h?.title){let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(ie,{}),e[16]=P):P=e[16];let B;e[17]!==l?(B=n.jsx(D,{icon:P,title:"Agent created",state:"idle",trailing:n.jsx(Z,{latency:l})}),e[17]=l,e[18]=B):B=e[18],j=B;break e}N=(h.connections??[]).map(vl)}e[11]=l,e[12]=t.output,e[13]=h,e[14]=N,e[15]=j}else h=e[13],N=e[14],j=e[15];if(j!==Symbol.for("react.early_return_sentinel"))return j;const S=N;let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ie,{className:"text-emerald-500"}),e[19]=y):y=e[19];const v=`Agent created: ${h.title}`;let k;e[20]!==l?(k=n.jsx(Z,{latency:l}),e[20]=l,e[21]=k):k=e[21];let _;e[22]!==v||e[23]!==k?(_=n.jsx(D,{icon:y,title:v,state:"idle",trailing:k}),e[22]=v,e[23]=k,e[24]=_):_=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w={transition:"transform 0.3s ease-out"},e[25]=w):w=e[25];let T;e[26]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("div",{ref:u,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[26]=T):T=e[26];let I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I={textAlign:"justify",wordBreak:"break-all"},e[27]=I):I=e[27];let M,C;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:I,"aria-hidden":"true",children:yl.repeat(6)}),C=n.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[28]=M,e[29]=C):(M=e[28],C=e[29]);let L;e[30]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("img",{ref:f,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[30]=L):L=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("img",{ref:i,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[31]=R):R=e[31];let F;e[32]!==h.icon||e[33]!==h.title?(F=n.jsx(it,{icon:h.icon,name:h.title,size:"md"}),e[32]=h.icon,e[33]=h.title,e[34]=F):F=e[34];let E;e[35]!==h.title?(E=n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:h.title})}),e[35]=h.title,e[36]=E):E=e[36];let A;e[37]!==F||e[38]!==E?(A=n.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[F,E]}),e[37]=F,e[38]=E,e[39]=A):A=e[39];let z;e[40]!==h.description?(z=h.description&&n.jsx("div",{className:"px-2 pt-1 pr-16",children:n.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:h.description})}),e[40]=h.description,e[41]=z):z=e[41];let O;e[42]!==A||e[43]!==z?(O=n.jsxs("div",{className:"relative",children:[A,z]}),e[42]=A,e[43]=z,e[44]=O):O=e[44];let U;e[45]!==S?(U=S.length>0&&n.jsx(H.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:S.length}),children:n.jsx(Se,{connectionIds:S,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})}),e[45]=S,e[46]=U):U=e[46];let W;e[47]!==U?(W=n.jsx("div",{className:"flex-1 min-w-0",children:U}),e[47]=U,e[48]=W):W=e[48];let V;e[49]!==h.id||e[50]!==r?(V=()=>r(h.id),e[49]=h.id,e[50]=r,e[51]=V):V=e[51];const ne=`See agent: ${h.title}`;let X;e[52]!==V||e[53]!==ne?(X=n.jsx("div",{className:"flex items-center gap-2 shrink-0",children:n.jsx(Ne,{size:"sm",className:"h-7",onClick:V,"aria-label":ne,children:"See agent"})}),e[52]=V,e[53]=ne,e[54]=X):X=e[54];let Q;e[55]!==W||e[56]!==X?(Q=n.jsxs("div",{className:"relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1",children:[W,X]}),e[55]=W,e[56]=X,e[57]=Q):Q=e[57];let J;e[58]!==O||e[59]!==Q?(J=n.jsx("div",{className:"mt-2 overflow-hidden rounded-xl border-[0.5px] border-border bg-card p-2.5",children:n.jsxs("div",{ref:o,className:"relative overflow-hidden rounded-lg bg-accent/25 p-2",style:w,onMouseEnter:c,onMouseMove:x,onMouseLeave:b,children:[T,M,C,L,R,O,Q]})}),e[58]=O,e[59]=Q,e[60]=J):J=e[60];let ee;return e[61]!==J||e[62]!==_?(ee=n.jsxs(n.Fragment,{children:[_,J]}),e[61]=J,e[62]=_,e[63]=ee):ee=e[63],ee}function vl(s){return s.connection_id}function Nl(s){const e=$.c(24),{agent:t}=s,l=kt();if(!t.id)return null;let r;e[0]!==t.connections?(r=t.connections??[],e[0]=t.connections,e[1]=r):r=e[1];let a;e[2]!==r?(a=r.map(Sl),e[2]=r,e[3]=a):a=e[3];const o=a;let u;e[4]!==t.id||e[5]!==l?(u=()=>l(t.id),e[4]=t.id,e[5]=l,e[6]=u):u=e[6];let f;e[7]!==t.icon||e[8]!==t.title?(f=n.jsx(it,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=f):f=e[9];let i;e[10]!==t.title?(i=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=i):i=e[11];let m;e[12]!==t.description?(m=t.description&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[12]=t.description,e[13]=m):m=e[13];let p;e[14]!==i||e[15]!==m?(p=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[i,m]}),e[14]=i,e[15]=m,e[16]=p):p=e[16];let c;e[17]!==o?(c=o.length>0&&n.jsx(H.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:o.length}),children:n.jsx(Se,{connectionIds:o,iconSize:"xs",maxVisibleIcons:3})}),e[17]=o,e[18]=c):c=e[18];let d;return e[19]!==u||e[20]!==f||e[21]!==p||e[22]!==c?(d=n.jsxs("button",{type:"button",onClick:u,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[f,p,c]}),e[19]=u,e[20]=f,e[21]=p,e[22]=c,e[23]=d):d=e[23],d}function Sl(s){return s.connection_id}function kl(s){const e=$.c(41),{part:t,latency:l}=s,r=je(),{org:a}=he();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o;let f,i,m,p,c,d;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==u){d=Symbol.for("react.early_return_sentinel");e:{const h=ve(t.output);if(i=Array.isArray(h?.items)?h.items:[],u==="loading"){let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Loading agents",state:"loading"}),e[12]=v):v=e[12],d=v;break e}if(u==="approval"){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(ie,{}),title:"List agents",state:"idle"}),e[13]=v):v=e[13],d=v;break e}if(u==="error"){let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(ie,{}),e[14]=v):v=e[14];const k=t.state==="output-denied"?"Agent list unavailable":"Couldn't load agents";let _;e[15]!==l?(_=n.jsx(Z,{latency:l}),e[15]=l,e[16]=_):_=e[16];let w;e[17]!==k||e[18]!==_?(w=n.jsx(D,{icon:v,title:k,state:"error",trailing:_}),e[17]=k,e[18]=_,e[19]=w):w=e[19],d=w;break e}if(i.length===0){let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(ie,{}),e[20]=v):v=e[20];let k;e[21]!==l?(k=n.jsx(D,{icon:v,title:"No agents yet",summary:"This organization hasn't created any agents.",state:"idle",trailing:n.jsx(Z,{latency:l})}),e[21]=l,e[22]=k):k=e[22],d=k;break e}const N=i.slice(0,Mt);f=i.length-N.length;let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ie,{className:"text-emerald-500"}),e[23]=j):j=e[23];const S=i.length===1?"1 agent":`${i.length} agents`;let y;e[24]!==l?(y=n.jsx(Z,{latency:l}),e[24]=l,e[25]=y):y=e[25],e[26]!==S||e[27]!==y?(c=n.jsx(D,{icon:j,title:S,state:"idle",trailing:y}),e[26]=S,e[27]=y,e[28]=c):c=e[28],m="mt-2 flex flex-col gap-1.5",p=N.map(_l)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=i,e[8]=m,e[9]=p,e[10]=c,e[11]=d}else f=e[6],i=e[7],m=e[8],p=e[9],c=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[29]!==f||e[30]!==i||e[31]!==r||e[32]!==a?(x=f>0&&n.jsx(Lt,{count:i.length,noun:"agents",onClick:()=>r({to:"/$org/settings/agents",params:{org:a.slug}})}),e[29]=f,e[30]=i,e[31]=r,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==m||e[35]!==p||e[36]!==x?(g=n.jsxs("div",{className:m,children:[p,x]}),e[34]=m,e[35]=p,e[36]=x,e[37]=g):g=e[37];let b;return e[38]!==c||e[39]!==g?(b=n.jsxs(n.Fragment,{children:[c,g]}),e[38]=c,e[39]=g,e[40]=b):b=e[40],b}function _l(s){return n.jsx(Nl,{agent:s},s.id)}const wl={active:"bg-emerald-500",inactive:"bg-muted-foreground",error:"bg-destructive"};function Tl(s){const e=$.c(27),{connection:t}=s,l=je(),{org:r}=he(),a=t.slug,o=t.description||t.app_name,u=!a||void 0;let f;e[0]!==l||e[1]!==r||e[2]!==a?(f=()=>a&&l({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:a}}),e[0]=l,e[1]=r,e[2]=a,e[3]=f):f=e[3];let i;e[4]!==t.icon||e[5]!==t.title?(i=n.jsx(Ie,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=i):i=e[6];let m;e[7]!==t.title?(m=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[7]=t.title,e[8]=m):m=e[8];let p;e[9]!==o?(p=o&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:o}),e[9]=o,e[10]=p):p=e[10];let c;e[11]!==m||e[12]!==p?(c=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[m,p]}),e[11]=m,e[12]=p,e[13]=c):c=e[13];const d=wl[t.status]??"bg-muted-foreground";let x;e[14]!==d?(x=q("size-2 shrink-0 rounded-full",d),e[14]=d,e[15]=x):x=e[15];let g;e[16]!==x?(g=n.jsx("span",{className:x,"aria-hidden":"true"}),e[16]=x,e[17]=g):g=e[17];let b;e[18]!==t.status?(b=n.jsx("span",{className:"sr-only",children:t.status}),e[18]=t.status,e[19]=b):b=e[19];let h;return e[20]!==u||e[21]!==b||e[22]!==f||e[23]!==i||e[24]!==c||e[25]!==g?(h=n.jsxs("button",{type:"button","aria-disabled":u,onClick:f,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[i,c,g,b]}),e[20]=u,e[21]=b,e[22]=f,e[23]=i,e[24]=c,e[25]=g,e[26]=h):h=e[26],h}function Cl(s){const e=$.c(40),{part:t,latency:l}=s,r=je(),{org:a}=he();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o;let f,i,m,p,c,d;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==u){d=Symbol.for("react.early_return_sentinel");e:{const h=ve(t.output);if(i=(Array.isArray(h?.items)?h.items:[]).filter(Il),u==="loading"||u==="approval"){let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(_e,{className:"animate-pulse"}),title:"Loading connections",state:"loading"}),e[12]=v):v=e[12],d=v;break e}if(u==="error"){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(_e,{}),e[13]=v):v=e[13];const k=t.state==="output-denied"?"Connection list unavailable":"Couldn't load connections";let _;e[14]!==l?(_=n.jsx(Z,{latency:l}),e[14]=l,e[15]=_):_=e[15];let w;e[16]!==k||e[17]!==_?(w=n.jsx(D,{icon:v,title:k,state:"error",trailing:_}),e[16]=k,e[17]=_,e[18]=w):w=e[18],d=w;break e}if(i.length===0){let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(_e,{}),e[19]=v):v=e[19];let k;e[20]!==l?(k=n.jsx(D,{icon:v,title:"No connections yet",summary:"This organization hasn't connected any MCPs.",state:"idle",trailing:n.jsx(Z,{latency:l})}),e[20]=l,e[21]=k):k=e[21],d=k;break e}const N=i.slice(0,Mt);f=i.length-N.length;let j;e[22]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(_e,{className:"text-emerald-500"}),e[22]=j):j=e[22];const S=i.length===1?"1 connection":`${i.length} connections`;let y;e[23]!==l?(y=n.jsx(Z,{latency:l}),e[23]=l,e[24]=y):y=e[24],e[25]!==S||e[26]!==y?(c=n.jsx(D,{icon:j,title:S,state:"idle",trailing:y}),e[25]=S,e[26]=y,e[27]=c):c=e[27],m="mt-2 flex flex-col gap-1.5",p=N.map($l)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=i,e[8]=m,e[9]=p,e[10]=c,e[11]=d}else f=e[6],i=e[7],m=e[8],p=e[9],c=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[28]!==f||e[29]!==i||e[30]!==r||e[31]!==a?(x=f>0&&n.jsx(Lt,{count:i.length,noun:"connections",onClick:()=>r({to:"/$org/settings/connections",params:{org:a.slug}})}),e[28]=f,e[29]=i,e[30]=r,e[31]=a,e[32]=x):x=e[32];let g;e[33]!==m||e[34]!==p||e[35]!==x?(g=n.jsxs("div",{className:m,children:[p,x]}),e[33]=m,e[34]=p,e[35]=x,e[36]=g):g=e[36];let b;return e[37]!==c||e[38]!==g?(b=n.jsxs(n.Fragment,{children:[c,g]}),e[37]=c,e[38]=g,e[39]=b):b=e[39],b}function $l(s){return n.jsx(Tl,{connection:s},s.id)}function Il(s){return s.connection_type!=="VIRTUAL"}function Ml(){const s=$.c(37),e=Ue(),{sendMessage:t,isStreaming:l,messages:r}=js(),{org:a}=he(),o=e?.virtualMcpId,{prompts:u}=zs(a.slug),f=o??null;let i;s[0]!==a.id||s[1]!==a.slug||s[2]!==f?(i={connectionId:f,orgId:a.id,orgSlug:a.slug},s[0]=a.id,s[1]=a.slug,s[2]=f,s[3]=i):i=s[3];const m=We(i),[p,c]=H.useState(null);if(!o||l||!Ss(o)||!r.some(Ll))return null;let x;if(s[4]!==u||s[5]!==o){let C;s[7]!==o?(C=L=>L.agentId===o&&L.promptName,s[7]=o,s[8]=C):C=s[8],x=u.find(C),s[4]=u,s[5]=o,s[6]=x}else x=s[6];const g=x;if(!g)return null;let b;s[9]!==m||s[10]!==t?(b=async(C,L)=>{if(!m){ze.error("MCP client not available");return}try{const R=await Os(m,C.name,L);await t({type:"doc",content:[{type:"paragraph",content:[$t({id:C.name,name:Ve(C.name,qe(C._meta)),metadata:R.messages,char:"/",kind:"prompt",args:L}),{type:"text",text:" "}]}]})}catch(R){console.error("[next-action-chip] failed",R),ze.error("Failed to load prompt. Please try again.")}},s[9]=m,s[10]=t,s[11]=b):b=s[11];const h=b;let N;s[12]!==g._meta||s[13]!==g.arguments||s[14]!==g.description||s[15]!==g.promptName||s[16]!==g.title||s[17]!==h?(N=()=>{const C={name:g.promptName,title:g.title,description:g.description,arguments:g.arguments,_meta:g._meta};if(C.arguments&&C.arguments.length>0){c(C);return}h(C)},s[12]=g._meta,s[13]=g.arguments,s[14]=g.description,s[15]=g.promptName,s[16]=g.title,s[17]=h,s[18]=N):N=s[18];const j=N;let S,y;s[19]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Fs,{size:12,className:"shrink-0 text-purple-500"}),y=n.jsx("span",{className:"font-medium text-foreground/80",children:"Next:"}),s[19]=S,s[20]=y):(S=s[19],y=s[20]);let v;s[21]!==g.title?(v=n.jsx("span",{className:"truncate",children:g.title}),s[21]=g.title,s[22]=v):v=s[22];let k;s[23]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ct,{size:12,className:"shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),s[23]=k):k=s[23];let _;s[24]!==j||s[25]!==v?(_=n.jsxs("button",{type:"button",onClick:j,className:"group mt-3 flex items-center gap-2 self-start rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:border-border hover:bg-accent/40 hover:text-foreground",children:[S,y,v,k]}),s[24]=j,s[25]=v,s[26]=_):_=s[26];let w;s[27]===Symbol.for("react.memo_cache_sentinel")?(w=C=>c(C),s[27]=w):w=s[27];let T;s[28]!==p||s[29]!==h?(T=async C=>{const L=p;c(null),L&&await h(L,C)},s[28]=p,s[29]=h,s[30]=T):T=s[30];let I;s[31]!==p||s[32]!==T?(I=n.jsx(an,{prompt:p,setPrompt:w,onSubmit:T}),s[31]=p,s[32]=T,s[33]=I):I=s[33];let M;return s[34]!==I||s[35]!==_?(M=n.jsxs(n.Fragment,{children:[_,I]}),s[34]=I,s[35]=_,s[36]=M):M=s[36],M}function Ll(s){return s.role==="user"||s.parts.some(Rl)}function Rl(s){return s.type==="tool-user_ask"&&s.state==="output-available"}function Al(s){const e=new Map;for(let t=s.length-1;t>=0;t--){const l=s[t]?.parts;if(l)for(const r of l){const a=r;if(a.type!=="tool-edit"&&a.type!=="tool-write"||a.state!=="output-available")continue;const o=a.output?.htmlPreview;o?.slug&&(e.has(o.slug)||e.set(o.slug,o))}}return Array.from(e.values())}function zl(){const s=$.c(8),e=je(),t=$e()?.messages??[],l=Al(t);if(l.length===0)return null;const r="flex flex-col gap-1.5 py-2";let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"text-[12px] text-muted-foreground/70 uppercase tracking-wide",children:"Pages in this chat"}),s[0]=a):a=s[0];const o="flex flex-wrap gap-2";let u;s[1]!==e?(u=p=>n.jsxs("button",{type:"button",onClick:()=>e({to:".",search:c=>({...c,main:`web-page:${p.slug}`}),replace:!0}),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-muted/30 hover:bg-muted/60 text-[13px] transition-colors",children:[n.jsx(Cs,{className:"size-3.5 shrink-0 text-muted-foreground"}),n.jsx("span",{className:"font-medium text-foreground",children:p.slug})]},p.slug),s[1]=e,s[2]=u):u=s[2];const f=l.map(u);let i;s[3]!==f?(i=n.jsx("div",{className:o,children:f}),s[3]=f,s[4]=i):i=s[4];let m;return s[5]!==a||s[6]!==i?(m=n.jsxs("div",{className:r,children:[a,i]}),s[5]=a,s[6]=i,s[7]=m):m=s[7],m}async function El(s,e){const t=await fetch(`/api/${e}/threads/${encodeURIComponent(s)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function ma(){const s=$.c(2),e=$e()?.messages??[];let t;return s[0]!==e?(t=e.some(Pl),s[0]=e,s[1]=t):t=s[1],t}function Pl(s){return s.parts?.some(Fl)}function Fl(s){const e=s;return(e.type==="tool-share_with_user"||e.type==="tool-bash"||e.type==="tool-write")&&e.state==="output-available"}function Ol(s,e){const t=$.c(9),{org:l}=he();let r;t[0]!==s?(r=me.threadOutputs(s??""),t[0]=s,t[1]=r):r=t[1];let a;t[2]!==l||t[3]!==s?(a=()=>El(s??"",l.slug),t[2]=l,t[3]=s,t[4]=a):a=t[4];const o=!!s&&(e?.enabled??!0);let u;return t[5]!==r||t[6]!==a||t[7]!==o?(u={queryKey:r,queryFn:a,enabled:o,staleTime:0},t[5]=r,t[6]=a,t[7]=o,t[8]=u):u=t[8],Oe(u)}function Dl(s){const e=$.c(20),{file:t}=s,l=je();let r;e[0]!==t.key||e[1]!==l?(r=()=>l({to:".",search:d=>({...d,main:ws(t.key)}),replace:!0}),e[0]=t.key,e[1]=l,e[2]=r):r=e[2];const a=r;let o;e[3]!==t.filename?(o=n.jsx(gs,{filename:t.filename,className:"h-5 w-4 shrink-0"}),e[3]=t.filename,e[4]=o):o=e[4];let u;e[5]!==t.filename||e[6]!==a?(u=n.jsx("button",{type:"button",onClick:a,className:"min-w-0 flex-1 truncate text-left text-[13px] font-medium text-foreground hover:underline",title:t.filename,children:t.filename}),e[5]=t.filename,e[6]=a,e[7]=u):u=e[7];const f=`Download ${t.filename}`;let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vt,{className:"size-3.5"}),e[8]=i):i=e[8];let m;e[9]!==t.downloadUrl||e[10]!==t.filename||e[11]!==f?(m=n.jsx("a",{href:t.downloadUrl,download:t.filename,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block",title:"Download","aria-label":f,children:i}),e[9]=t.downloadUrl,e[10]=t.filename,e[11]=f,e[12]=m):m=e[12];let p;e[13]!==a?(p=n.jsx(Ne,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:a,children:"Open"}),e[13]=a,e[14]=p):p=e[14];let c;return e[15]!==o||e[16]!==u||e[17]!==m||e[18]!==p?(c=n.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[o,u,m,p]}),e[15]=o,e[16]=u,e[17]=m,e[18]=p,e[19]=c):c=e[19],c}function ot(s){return s.split("/").pop()??s}const Hl=/(^|\/)output\//;function Bl(s){const e=new Set;for(const t of s.parts??[]){const l=t;if(l.state==="output-available"){if(l.type==="tool-share_with_user"){const r=l.output?.filename??l.input?.name??(l.input?.source?ot(l.input.source):null);r&&e.add(r)}else if(l.type==="tool-write"){const r=l.input?.path;r&&Hl.test(r)&&e.add(ot(r))}}}return e}function Ul(s){const e=$.c(4),{threadId:t,message:l}=s,r=Bl(l),a=r.size>0;let o;e[0]!==a?(o={enabled:a},e[0]=a,e[1]=o):o=e[1];const{data:u}=Ol(t,o);if(r.size===0)return null;const f=(u??[]).filter(c=>r.has(c.filename));if(f.length===0)return null;const i="flex flex-col gap-1.5 py-2",m=f.map(Wl);let p;return e[2]!==m?(p=n.jsx("div",{className:i,children:m}),e[2]=m,e[3]=p):p=e[3],p}function Wl(s){return n.jsx(Dl,{file:s},s.key)}function ql(s){return s.type==="reasoning"}function Vl(s){const e=[],t=new Set,l=new Map,r=new Map,a=new Map;if(s){let u=null;for(let f=0;f<s.parts.length;f++){const i=s.parts[f];if(ql(i)){u||(u={parts:[],startIndex:f},e.push(u)),u.parts.push(i),t.add(f);continue}if(u=null,i.type==="data-tool-metadata"&&"id"in i&&"data"in i){const m=i.data,p={};m.annotations&&(p.annotations=m.annotations),typeof m.latencyMs=="number"&&Number.isFinite(m.latencyMs)&&(p.latencySeconds=m.latencyMs/1e3),typeof m.outputBytes=="number"&&Number.isFinite(m.outputBytes)&&m.outputBytes>=0&&(p.outputBytes=m.outputBytes),m._meta&&typeof m._meta=="object"&&(p._meta=m._meta),l.set(i.id,p);continue}if(i.type==="data-tool-subtask-metadata"&&"id"in i){r.set(i.id,i.data);continue}if(i.type==="data-web-search"&&"id"in i&&"data"in i){const m=i.id,p=i.data;a.set(m,p.text??"");continue}}}const o=[];if(s){let u=[],f=[];const i=new Set,m=()=>{for(const p of u)i.has(p)||(i.add(p),o.push({kind:"reasoning-group",group:p}));for(const p of f)o.push({kind:"part",index:p.index});u=[],f=[]};for(let p=0;p<s.parts.length;p++){const c=s.parts[p];if(c.type==="step-start"){m();continue}if(t.has(p)){const d=e.find(x=>x.startIndex===p);d&&u.push(d);continue}c.type.startsWith("data-")||f.push({index:p})}m()}return{reasoningGroups:e,renderOrder:o,dataParts:{toolMetadata:l,toolSubtaskMetadata:r,webSearchStreaming:a}}}function Gl(s){const e=$.c(9),{since:t}=s;let l;e[0]!==t?(l=()=>Ze(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[r,a]=H.useState(l);let o,u;e[2]!==t?(o=()=>{const p=setInterval(()=>a(Ze(t,Date.now())),100);return()=>clearInterval(p)},u=[t],e[2]=t,e[3]=o,e[4]=u):(o=e[3],u=e[4]),H.useEffect(o,u);const f=r/1e3;let i;e[5]!==f?(i=de(f),e[5]=f,e[6]=i):i=e[6];let m;return e[7]!==i?(m=n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:i}),e[7]=i,e[8]=m):m=e[8],m}const Ft=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Kl(){const s=$.c(5),[e]=H.useState(Jl);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},s[0]=t):t=s[0];let l;s[1]!==e?(l=Ft.map((a,o)=>{const{delay:u}=a;return n.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[o],animation:"grid-ripple 1s ease infinite",animationDelay:`${u}ms`}},o)}),s[1]=e,s[2]=l):l=s[2];let r;return s[3]!==l?(r=n.jsx("div",{className:"grid",style:t,children:l}),s[3]=l,s[4]=r):r=s[4],r}function Jl(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Ft.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}const Xl={planning:{icon:n.jsx(ss,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:n.jsx(He,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},Ql=1200;function Yl(){const s=$.c(7),[e,t]=H.useState("planning");let l,r;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{const f=setTimeout(()=>{t("thinking")},Ql);return()=>{clearTimeout(f)}},r=[],s[0]=l,s[1]=r):(l=s[0],r=s[1]),H.useEffect(l,r);const a=Xl[e];let o;s[2]!==a.label?(o=n.jsxs("span",{className:"text-[14px] text-muted-foreground shimmer",children:[a.label,"..."]}),s[2]=a.label,s[3]=o):o=s[3];let u;return s[4]!==a.icon||s[5]!==o?(u=n.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[a.icon,o]})}),s[4]=a.icon,s[5]=o,s[6]=u):u=s[6],u}function Zl(s){const e=$.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Kl,{}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=n.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[l,n.jsx(Gl,{since:t})]}),e[1]=t,e[2]=r):r=e[2],r}function eo(s){const e=$.c(20),{duration:t,parts:l,isStreaming:r}=s;let a;e[0]!==l?(a=l.every(no),e[0]=l,e[1]=a):a=e[1];const o=a;let u;e[2]!==t?(u=t&&t/1e3>1?`Thought for ${de(t/1e3)}`:"Thought",e[2]=t,e[3]=u):u=e[3];const f=u;let i;if(e[4]!==o||e[5]!==r||e[6]!==l){const j=l.map(so).join(`
|
|
36
36
|
`).trim().split(`
|
|
37
37
|
`).filter(Boolean),S=r?j[j.length-1]??"":j[0]??"";i=!o&&S?S.length>100?S.slice(0,100)+"…":S:void 0,e[4]=o,e[5]=r,e[6]=l,e[7]=i}else i=e[7];const m=i;let p;if(e[8]!==o||e[9]!==l){const N=l.map(to).join(`
|
|
38
38
|
|
package/dist/client/assets/{plugin-empty-state-CaWAfurE.js → plugin-empty-state-RFNgD2Hl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,j as t,dn as n}from"./index-
|
|
1
|
+
import{e as o,j as t,dn as n}from"./index-DHt9Mf9G.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
|