decocms 4.167.0 → 4.167.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cd8M35Wb.js → AlertCircle-CUqW_w6g.js} +1 -1
- package/dist/client/assets/{AreaChart-C78nqQQF.js → AreaChart-Bm75VTUe.js} +1 -1
- package/dist/client/assets/{ArrowUp-4BHUZHFD.js → ArrowUp-C7ToAohd.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CCEVlmCI.js → ArrowUpRight-Ctd2GOR9.js} +1 -1
- package/dist/client/assets/{Check-CK_e8wdj.js → Check-CgsRhHy8.js} +1 -1
- package/dist/client/assets/{CheckCircle-D31c9Zko.js → CheckCircle-VXm1pD5i.js} +1 -1
- package/dist/client/assets/{ChevronDown-DSAcD82u.js → ChevronDown-Wb4xUAM2.js} +1 -1
- package/dist/client/assets/{ChevronRight-D02mIW0w.js → ChevronRight-Bb4Md-MD.js} +1 -1
- package/dist/client/assets/{ChevronUp-BqqaHKfG.js → ChevronUp-Bsb-Y77Y.js} +1 -1
- package/dist/client/assets/{Copy01-CbmbpqVa.js → Copy01-DZd32DIO.js} +1 -1
- package/dist/client/assets/{CpuChip01-DHX1tpE2.js → CpuChip01-BPw4omKe.js} +1 -1
- package/dist/client/assets/{DotsVertical-DD9vI7XN.js → DotsVertical-Do26-QjL.js} +1 -1
- package/dist/client/assets/{Eye-CgfUY2cN.js → Eye-B22W8AyK.js} +1 -1
- package/dist/client/assets/{FilterLines-BVMJKn0q.js → FilterLines-Bc1kxraS.js} +1 -1
- package/dist/client/assets/{HardDrive-2n4L-vNW.js → HardDrive-BUNzYRdb.js} +1 -1
- package/dist/client/assets/{Key01-T5YNQBm2.js → Key01-CG1NND7T.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CaOxvIEl.js → LayoutLeft-m1wg28yS.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CXa8wVjc.js → LinkExternal01-BHdYJ4vg.js} +1 -1
- package/dist/client/assets/{LogOut01-CM9eugyU.js → LogOut01-CTki1bzq.js} +1 -1
- package/dist/client/assets/{Monitor01-8S0W2w5U.js → Monitor01-DcyY807V.js} +1 -1
- package/dist/client/assets/{Palette-BQLbJJdf.js → Palette-BEUtyKuF.js} +1 -1
- package/dist/client/assets/{Play-CuYQk1-M.js → Play-DrITqLDw.js} +1 -1
- package/dist/client/assets/{Plus-BApQaxo5.js → Plus-BmYOuiAj.js} +1 -1
- package/dist/client/assets/{SearchLg-BSb_OzKH.js → SearchLg-Brn3yddB.js} +1 -1
- package/dist/client/assets/{SearchMd-bzt4kP0K.js → SearchMd-h05KKMiS.js} +1 -1
- package/dist/client/assets/{Settings02-Cslfpi0u.js → Settings02-DqYJFs_A.js} +1 -1
- package/dist/client/assets/{Shield01-vx0tzuE8.js → Shield01-BGuTNf8w.js} +1 -1
- package/dist/client/assets/{Star01-DGK3WnVL.js → Star01-sYD82Np9.js} +1 -1
- package/dist/client/assets/{Stars01-BkoB-Q1B.js → Stars01-CfCAp21f.js} +1 -1
- package/dist/client/assets/{Stars02-Cx4R-W4T.js → Stars02-DnbvYkKU.js} +1 -1
- package/dist/client/assets/{Sun-Cno0ZL2K.js → Sun-tw8Adw2s.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B1yag0Lu.js → SwitchHorizontal01-BnpMv-f4.js} +1 -1
- package/dist/client/assets/{Tool01-BPkNcjLe.js → Tool01-CTroi0ek.js} +1 -1
- package/dist/client/assets/{Tool02-8rf_PPrb.js → Tool02-Bh88tYGs.js} +1 -1
- package/dist/client/assets/{Trash01-CjLF47KG.js → Trash01-B8ymhEo_.js} +1 -1
- package/dist/client/assets/{TrendUp01-B3nbKtR5.js → TrendUp01-Bqs7ykt4.js} +1 -1
- package/dist/client/assets/{Upload01-C74iA_2l.js → Upload01-CRF4bF0L.js} +1 -1
- package/dist/client/assets/{User01-gol1gjVG.js → User01-BMMY0J4X.js} +1 -1
- package/dist/client/assets/{Users01-ConkK5Hy.js → Users01-Co3nN3tw.js} +1 -1
- package/dist/client/assets/{Users03-C0TiA5ig.js → Users03-23U4ny0D.js} +1 -1
- package/dist/client/assets/{X-D-SXXNOh.js → X-BM44NliR.js} +1 -1
- package/dist/client/assets/{XCircle-Bdipnf78.js → XCircle-UQVfZTIm.js} +1 -1
- package/dist/client/assets/{XClose-BXyOmw6P.js → XClose-Beh-B9Gb.js} +1 -1
- package/dist/client/assets/{Zap-DJXvF0rz.js → Zap-BuelQrvQ.js} +1 -1
- package/dist/client/assets/{ZapSquare-DRAXQQVP.js → ZapSquare-Cp9irGGl.js} +1 -1
- package/dist/client/assets/{access-gate-BKMOmBMY.js → access-gate-D-oUG6gg.js} +1 -1
- package/dist/client/assets/{add-section-modal-B75sXBI5.js → add-section-modal-D_hcTQ7N.js} +1 -1
- package/dist/client/assets/{agent-icon-bqP8cd4A.js → agent-icon-CSidaJ6B.js} +1 -1
- package/dist/client/assets/{agents-list-JTNfRO7b.js → agents-list-DpnxFgYY.js} +1 -1
- package/dist/client/assets/{ai-providers-DB4edqOH.js → ai-providers-B2Fsskz4.js} +1 -1
- package/dist/client/assets/{alert-kXNc1jQs.js → alert-BTpI2Cnj.js} +1 -1
- package/dist/client/assets/{alert-dialog-fWZE2eoL.js → alert-dialog-FVJZWl26.js} +1 -1
- package/dist/client/assets/{app-editor-BJoZeDYw.js → app-editor-B4ngBBof.js} +1 -1
- package/dist/client/assets/{auth-B6-JmtGV.js → auth-D-uIp2CQ.js} +1 -1
- package/dist/client/assets/{auth-catchall-cHl02pOC.js → auth-catchall-V3EeqtwY.js} +1 -1
- package/dist/client/assets/{auth-entry-BkcVdNXd.js → auth-entry-C08ZxDNT.js} +1 -1
- package/dist/client/assets/{auth-split-layout-ozU7OFFM.js → auth-split-layout-ByioBOA7.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BBAoTw-S.js → authenticate-and-persist-oauth-DObbFBl5.js} +1 -1
- package/dist/client/assets/{automation-list-row-BkrA0C81.js → automation-list-row-DMeZ0lJ3.js} +1 -1
- package/dist/client/assets/{automation-runs-1f49gKdv.js → automation-runs-DChno1Ee.js} +1 -1
- package/dist/client/assets/{automations-CuujfvxS.js → automations-B1nDP5Tu.js} +1 -1
- package/dist/client/assets/{avatar-CG1sYMC3.js → avatar-BumNKk7X.js} +1 -1
- package/dist/client/assets/{badge-DTv3ytkG.js → badge-BFv5PsKE.js} +1 -1
- package/dist/client/assets/{block-document-pKW_gNRc.js → block-document-DT1iEokX.js} +1 -1
- package/dist/client/assets/{brand-context-CSdoqkrl.js → brand-context-CjUnREO9.js} +1 -1
- package/dist/client/assets/{buckets-9vcDP1Xx.js → buckets-D7qH3DY9.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Z8lz1ptZ.js → bulk-category-panel-R7nvjZc1.js} +1 -1
- package/dist/client/assets/{calendar-CSYSRHan.js → calendar-DMZ7yz5j.js} +1 -1
- package/dist/client/assets/{capability-load-error-CI7JffNO.js → capability-load-error-Zpx0CzA1.js} +1 -1
- package/dist/client/assets/{card-Djqe431m.js → card-Dv8gN6wM.js} +1 -1
- package/dist/client/assets/{category-editor-BOkZGzvy.js → category-editor-DBU4RcGL.js} +1 -1
- package/dist/client/assets/{chat-context-B9IMqX9H.js → chat-context-D2jz7TPk.js} +1 -1
- package/dist/client/assets/{checkbox-g1Xe-Fh0.js → checkbox-B5fS-ChG.js} +1 -1
- package/dist/client/assets/{cli-auth-success-71pX1cOc.js → cli-auth-success-Dq-DdX99.js} +1 -1
- package/dist/client/assets/{collection-detail-DSTfsDtj.js → collection-detail-BJdFlI_D.js} +1 -1
- package/dist/client/assets/{collection-display-button-DqckpPka.js → collection-display-button-DlQC5Fqe.js} +1 -1
- package/dist/client/assets/{collection-search-D8p930-2.js → collection-search-CclDfE5O.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C4pkDKfG.js → collection-table-wrapper-DRbR52Xw.js} +1 -1
- package/dist/client/assets/{collection-tabs-Btbvy5wZ.js → collection-tabs-B0dT6Ygy.js} +1 -1
- package/dist/client/assets/{command-D8VZgYcp.js → command-Bjp1VURS.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-B_-r2hWt.js → commerce-onboarding-EUvt30Jc.js} +1 -1
- package/dist/client/assets/{companions-core-C6pGrBaV.js → companions-core-BDbmsLM0.js} +1 -1
- package/dist/client/assets/{connect-Dggz_rgK.js → connect-DaqnZRt8.js} +1 -1
- package/dist/client/assets/{connection-Bm6D5T7s.js → connection-C0Suj0GO.js} +1 -1
- package/dist/client/assets/{connection-card-DaylHwd8.js → connection-card-HFSstqIJ.js} +1 -1
- package/dist/client/assets/{connection-detail-pp291ZsI.js → connection-detail-BvAKPB53.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-abaaeWRW.js → connection-form-helpers-CKgaIsD-.js} +1 -1
- package/dist/client/assets/{connections-C-3JQ-RT.js → connections-O4_j66gP.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DJTs5v3B.js → decopilot-sse-pool-NjFnhgvn.js} +1 -1
- package/dist/client/assets/{dialog-BNEf4h73.js → dialog-D4l4Xdsp.js} +1 -1
- package/dist/client/assets/{domain-settings-BQw1ZHpG.js → domain-settings-BMIxOiTg.js} +1 -1
- package/dist/client/assets/{drawer-BOicXoW4.js → drawer-C3pYai9a.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B0OSBqF5.js → dropdown-menu-Q--ZyLLW.js} +1 -1
- package/dist/client/assets/{empty-state-Jijm8Zjj.js → empty-state-BOcwt_Pf.js} +1 -1
- package/dist/client/assets/{extract-connection-data-ByQ1VQpk.js → extract-connection-data-Df7SJj9F.js} +1 -1
- package/dist/client/assets/{file-explorer-CheIIdH4.js → file-explorer-lqBegrgA.js} +1 -1
- package/dist/client/assets/{form-BoZJqj_8.js → form-DMrBv8ot.js} +1 -1
- package/dist/client/assets/{general-CtysXkWo.js → general-N31775KP.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CCSv048C.js → github-repo-picker-Bw5gD-qj.js} +1 -1
- package/dist/client/assets/{hooks-Bl53PFCW.js → hooks-BkWYCTuM.js} +1 -1
- package/dist/client/assets/{index-BB4oQ8m2.js → index-3_M3tW1F.js} +1 -1
- package/dist/client/assets/{index-BAn2tA3m.js → index-BR7TGZHq.js} +1 -1
- package/dist/client/assets/{index-BdV3mKMQ.js → index-BxSgbIJg.js} +1 -1
- package/dist/client/assets/{index-EC0JTBd4.js → index-C8SvWM2K.js} +1 -1
- package/dist/client/assets/{index-DFVpce2g.js → index-CfVmXxnZ.js} +35 -35
- package/dist/client/assets/{index-7i5MzulY.js → index-DBssoMSm.js} +1 -1
- package/dist/client/assets/{index-CzdD7w68.js → index-DIkj5DIc.js} +1 -1
- package/dist/client/assets/{index-DBW7-LLJ.js → index-DptGhhs0.js} +27 -27
- package/dist/client/assets/{index-DW8FWTYY.js → index-Dsil6t1i.js} +1 -1
- package/dist/client/assets/{index-D7iPCSni.js → index-NXIL8Ow6.js} +10 -10
- package/dist/client/assets/{index-redirect-idcaLUlq.js → index-redirect-dX53aGUA.js} +1 -1
- package/dist/client/assets/{index-DS1dPTBr.js → index-yBY16i4r.js} +1 -1
- package/dist/client/assets/{input-DM14QBHx.js → input-zj8m7n84.js} +1 -1
- package/dist/client/assets/{integration-icon-BjR4OGAx.js → integration-icon-BuPK5TYy.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-D9LT_tFK.js → invite-member-dialog-C6-_qm1d.js} +1 -1
- package/dist/client/assets/{label-BEcprhix.js → label-CuF09Kzu.js} +1 -1
- package/dist/client/assets/{layout-DluG1Vni.js → layout-DBvRMRIb.js} +1 -1
- package/dist/client/assets/{login-BUNmGthz.js → login-Cc4SDSF_.js} +1 -1
- package/dist/client/assets/{mcp-oauth-ws9m29vQ.js → mcp-oauth-shlK2GTY.js} +1 -1
- package/dist/client/assets/{members-B2rGjbVl.js → members-BDXBmXwe.js} +1 -1
- package/dist/client/assets/{monaco-editor-DJSyif3I.js → monaco-editor-CVT6PsIN.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B5xpjD5z.js → monitoring-stats-row-Cdet9jiU.js} +1 -1
- package/dist/client/assets/{multi-select-DX4wKmiL.js → multi-select-xU_EwzSI.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DYANs1ON.js → oauth-callback-ai-provider-Dm1COiz9.js} +1 -1
- package/dist/client/assets/{oauth-callback-qhM58XQs.js → oauth-callback-iNyi40DB.js} +1 -1
- package/dist/client/assets/{onboarding-WshxsJzF.js → onboarding-Cloqiw3U.js} +1 -1
- package/dist/client/assets/{org-layout-CvfJlqf0.js → org-layout-CAFsjPqf.js} +1 -1
- package/dist/client/assets/{organization-choice-CsgXcMIz.js → organization-choice-Cyi_e8Zq.js} +1 -1
- package/dist/client/assets/{orgs-CGCwj0aX.js → orgs-S_k4xMrd.js} +1 -1
- package/dist/client/assets/{page-seo-form-BUmIrCHq.js → page-seo-form-D01XOKmk.js} +1 -1
- package/dist/client/assets/{popover-13d1_Ydy.js → popover-Bt8NA7TT.js} +1 -1
- package/dist/client/assets/{post-editor-CW3QV3HH.js → post-editor-C7T3qUe4.js} +1 -1
- package/dist/client/assets/{primitives-CWnjtxmC.js → primitives-CghAr9iC.js} +1 -1
- package/dist/client/assets/{profile-D-gvwVRu.js → profile-Dte5ZwvH.js} +1 -1
- package/dist/client/assets/project-app-view-BkR_dxRJ.js +1 -0
- package/dist/client/assets/record-editor-C_TZAxUC.js +1 -0
- package/dist/client/assets/{redirect-editor-BQgkHo14.js → redirect-editor-BSuCXuw4.js} +1 -1
- package/dist/client/assets/registry-Cy4VwkhT.js +2 -0
- package/dist/client/assets/{registry-layout-10se5s7s.js → registry-layout-D7OeE4Tp.js} +1 -1
- package/dist/client/assets/{reports-B0dg8-1T.js → reports-Ii6S1PYR.js} +1 -1
- package/dist/client/assets/{require-capability-94N1MpBW.js → require-capability-D5sKrc-a.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DTRJEXT6.js → required-auth-layout-PejcRLRr.js} +1 -1
- package/dist/client/assets/{reset-password-DTqfLCFl.js → reset-password-j1MU8BBT.js} +1 -1
- package/dist/client/assets/{roles-DMaB4I0B.js → roles-CpX37qPN.js} +1 -1
- package/dist/client/assets/{search-input-Cav-R6u1.js → search-input-Bf_CjAux.js} +1 -1
- package/dist/client/assets/{secrets-CmQA_lCO.js → secrets-DidOyNZ0.js} +1 -1
- package/dist/client/assets/{sections-editor-B1CYJQwI.js → sections-editor-DY2AuZd7.js} +1 -1
- package/dist/client/assets/{select-p5o_Bt0F.js → select-j9WEM8Sh.js} +1 -1
- package/dist/client/assets/{select-model-z0c2dMz_.js → select-model-C8d0poms.js} +2 -2
- package/dist/client/assets/self-tool-result-aQ7EVEiZ.js +1 -0
- package/dist/client/assets/{seo-editor-DTdLrmHB.js → seo-editor-DGYP3acD.js} +1 -1
- package/dist/client/assets/{settings-layout-BnrJScNO.js → settings-layout-DWcGqshR.js} +1 -1
- package/dist/client/assets/{settings-section-CZTjnxlV.js → settings-section-fm3Mm6Bm.js} +1 -1
- package/dist/client/assets/{shell-controls-XiJZc3ao.js → shell-controls-DVyMygC3.js} +1 -1
- package/dist/client/assets/{shell-layout-CvSnv4Ng.js → shell-layout-Qdn6Ab14.js} +1 -1
- package/dist/client/assets/{sidebar-BBmlF4Le.js → sidebar-DYUk0Bcn.js} +1 -1
- package/dist/client/assets/{skeleton-D5maqyjg.js → skeleton--88gs_EO.js} +1 -1
- package/dist/client/assets/{spinner-D09NsuWH.js → spinner-DEsDb5EQ.js} +1 -1
- package/dist/client/assets/{sso-DqK4eFK8.js → sso-C0YVRrqi.js} +1 -1
- package/dist/client/assets/{store-DRo6GtOx.js → store-9L8vOeYP.js} +1 -1
- package/dist/client/assets/store-registry-DZm0Mqt3.js +2 -0
- package/dist/client/assets/{studio-tools-eC6fCmF6.js → studio-tools-Dz4porfg.js} +1 -1
- package/dist/client/assets/{switch-DJGvmJgh.js → switch-CjtCOM9l.js} +1 -1
- package/dist/client/assets/{tab-id-ts2R-IK7.js → tab-id-swDgZMnB.js} +1 -1
- package/dist/client/assets/{table-CUPzY57H.js → table-B1o0Pwj4.js} +1 -1
- package/dist/client/assets/{tabs-BezZc3NY.js → tabs-VUaZhlmm.js} +1 -1
- package/dist/client/assets/{textarea-DHTTJLnr.js → textarea-Bs8WvAl6.js} +1 -1
- package/dist/client/assets/{toggle-group-CqJpxcmh.js → toggle-group-BsLp02VA.js} +1 -1
- package/dist/client/assets/{toolbar-8XCdJRqW.js → toolbar-B5h5oyq6.js} +1 -1
- package/dist/client/assets/{tooltip-fkTa7gIG.js → tooltip-CETnd3ay.js} +1 -1
- package/dist/client/assets/{use-ai-providers-wy-pIlnl.js → use-ai-providers-gi5xr2mP.js} +1 -1
- package/dist/client/assets/{use-automations-BebUXKcQ.js → use-automations-DhjGDNZK.js} +1 -1
- package/dist/client/assets/{use-autosave-CUZ4cIic.js → use-autosave-D0NLBkKG.js} +1 -1
- package/dist/client/assets/{use-capability-D9H3t7HP.js → use-capability-BqS7iGUH.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Cso4aNFM.js → use-clock-tick-B9BJ0pwX.js} +1 -1
- package/dist/client/assets/{use-connection-DJ0b1gTC.js → use-connection-BMokl4CO.js} +1 -1
- package/dist/client/assets/{use-copy-BNgRyC_N.js → use-copy-Be1Kjd_w.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-pKJoeitk.js → use-create-virtual-mcp-CWkwgd9r.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B-9KRifB.js → use-debounced-autosave-D0IOAPSF.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DrbFDRJg.js → use-debounced-value-B-JvHFEo.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DmpIUFXQ.js → use-deco-credits-UciEpjbi.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CPtuygfk.js → use-decopilot-events-CEPq_dZU.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Ca978irp.js → use-delete-connection-COvCqZ-1.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DG7sPT_s.js → use-deployment-admin-BJaOQser.js} +1 -1
- package/dist/client/assets/{use-file-configs-BSbmDdF6.js → use-file-configs-I7iEol3j.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BLH47khU.js → use-infinite-scroll-CK3Uizc8.js} +1 -1
- package/dist/client/assets/{use-join-requests-BFZJlmrE.js → use-join-requests-DqDoWz8D.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DtWK2vVN.js → use-mcp-auth-status-h3xamCXm.js} +1 -1
- package/dist/client/assets/{use-mcp-client-YC9HMu6y.js → use-mcp-client-C7paE-cE.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-81zsgjbk.js → use-mcp-tools-DS7HyfmS.js} +1 -1
- package/dist/client/assets/{use-members-BOo6SBZf.js → use-members-BuBLbPW8.js} +1 -1
- package/dist/client/assets/{use-mobile-DaXh9iB4.js → use-mobile-CYh3EGEt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CwseQD-z.js → use-navigate-to-agent-Bqz6pwLi.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-B_HThHi-.js → use-org-auth-client-CsKd0mpo.js} +1 -1
- package/dist/client/assets/{use-org-sso-vq0R-8A9.js → use-org-sso-CCq7sZnB.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C1XBXdGf.js → use-organization-roles-CgtJI-6n.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bi013MJn.js → use-organization-settings-MkvwyFUq.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DHHAMc5J.js → use-registry-connections-YnGGDwWM.js} +1 -1
- package/dist/client/assets/{use-secrets-BCwf7s42.js → use-secrets-HEeF0D3f.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B4bZcx6E.js → use-status-sounds-CyFcW6V5.js} +1 -1
- package/dist/client/assets/{use-tags-CxtVjJTC.js → use-tags-BDVrYGwL.js} +1 -1
- package/dist/client/assets/{use-view-mode-2rHbtOa0.js → use-view-mode-9B1lHoFF.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Czn5fHtD.js → use-virtual-mcp-Bdv0Gghv.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BIuIIh4Y.js +1 -0
- package/dist/client/assets/{useQueries-BIMkg7rJ.js → useQueries-Bq9KgQR-.js} +1 -1
- package/dist/client/assets/{useRouterState-CQeHJLAo.js → useRouterState-Bf1ibFXD.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-TLdwTHtB.js +1 -0
- package/dist/client/assets/{users-CbQWIH4c.js → users-BpJTuCAK.js} +1 -1
- package/dist/client/assets/{variant-calendar-CVBnB48e.js → variant-calendar-B7O5BNIE.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CZXwONMQ.js → view-mode-toggle-BO7qzBum.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +389 -389
- package/dist/server/server.js +265 -265
- package/package.json +1 -1
- package/dist/client/assets/project-app-view-CWjCgPJM.js +0 -1
- package/dist/client/assets/record-editor-Bhe663KT.js +0 -1
- package/dist/client/assets/registry-Dp0LTgEx.js +0 -2
- package/dist/client/assets/self-tool-result-Cgb76l_D.js +0 -1
- package/dist/client/assets/store-registry-BfDOrY5J.js +0 -2
- package/dist/client/assets/useInfiniteQuery-yZBiNKu9.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CdZRM8uM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as B,D as ke,r as y,e as ae,p as $,j as t,m as j,B as pe,o as Be,n as $e,K as oe,c as ce,b as xe,S as Fe}from"./index-DBW7-LLJ.js";import{I as X}from"./input-DM14QBHx.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-D09NsuWH.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const _e={submitEmailPassword:({mode:r,email:e,password:c,name:f})=>r==="sign_up"?B.signUp.email({email:e,password:c,name:f||""}):B.signIn.email({email:e,password:c}),requestPasswordReset:({email:r,redirectTo:e})=>B.requestPasswordReset({email:r,redirectTo:e}),sendOtp:({email:r})=>B.emailOtp.sendVerificationOtp({email:r,type:"sign-in"}),submitOtp:({email:r,otp:e})=>B.signIn.emailOtp({email:r,otp:e}),socialSignIn:({provider:r,callbackURL:e})=>B.signIn.social({provider:r,callbackURL:e}),ssoSignIn:({providerId:r,callbackURL:e})=>B.signIn.sso({providerId:r,callbackURL:e}),onAuthenticated:r=>{window.location.href=r}},le="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:r=>`Code sent to ${r}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:r=>`Continue with ${r}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:r,callbackUrl:e="/",title:c,subtitle:f,brand:p,copy:m,variant:i="default",allowedSocialProviders:l,allowPassword:u=!0,onAuthEvent:I,actions:N}){const{emailAndPassword:A,resetPassword:v,emailOtp:E,socialProviders:h}=ke(),d={..._e,...N},g=s=>{try{I?.(s)}catch{}},P=i==="compact",Z=l?h.providers.filter(s=>l.includes(s.name)):h.providers,ee=h.enabled&&Z.length>0,me=A.enabled&&(u||!E.enabled&&!ee),x=h.enabled&&h.providers.length>0&&!ee&&!E.enabled&&!me?h.providers:Z,O=h.enabled&&x.length>0,F=A.enabled&&(u||!E.enabled&&!O),[b,M]=y.useState(""),[_,V]=y.useState(""),[a,S]=y.useState(""),[q,T]=y.useState(""),[L,ue]=y.useState(!1),[ge,Le]=y.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[k,Q]=y.useState(""),[be,ye]=y.useState(!1),[Oe,he]=y.useState(null),n={...Ke,...m},te=y.useId(),z=`${te}-email`,H=`${te}-email-error`,ve=`${te}-name`,we=`${te}-password`,Ee=`${te}-otp`,C=ge==="signUp",W=ge==="forgotPassword",R=ge==="emailOtp",se=ae({mutationFn:async({email:s,password:o,name:D})=>{try{const J=await d.submitEmailPassword({mode:C?"sign_up":"sign_in",email:s,password:o,name:D});if(J.error)throw new Error(J.error.message||(C?n.signUpFailed:n.signInFailed));return J}catch(J){throw J instanceof Error?J:new Error(n.authenticationFailed)}},onMutate:()=>{g({type:"started",method:"email_password",mode:C?"sign_up":"sign_in"})},onSuccess:()=>{g({type:"succeeded",method:"email_password",mode:C?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(r??e)},onError:s=>{g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),$(C?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),ne=ae({mutationFn:async({email:s})=>{const o=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(o.error)throw new Error(o.error.message||n.resetEmailFailed);return o},onSuccess:()=>{$("password_reset_requested"),ye(!0)},onError:s=>{$("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),K=ae({mutationFn:async({email:s})=>{const o=await d.sendOtp({email:s});if(o.error)throw new Error(o.error.message||n.otpSendFailed);return o},onMutate:()=>{g({type:"started",method:"email_otp"})},onSuccess:()=>{g({type:"otp_sent",method:"email_otp"}),$("email_otp_sent"),ue(!0)},onError:s=>{g({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),Y=ae({mutationFn:async({email:s,otp:o})=>{const D=await d.submitOtp({email:s,otp:o});if(D.error)throw new Error(D.error.message||n.invalidCode);return D},onMutate:()=>{g({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{g({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(r??e)},onError:s=>{g({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ie=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),fe=()=>{b.trim()&&!ie(b)&&Q(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}se.mutate({email:b,password:_,name:a})},Re=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail);return}ne.mutate({email:b})},De=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}K.mutate({email:b})},Me=s=>{s.preventDefault(),Y.mutate({email:b,otp:q})},G=s=>o=>{s(o.target.value),Se&&se.reset(),je&&ne.reset(),Ne&&(K.reset(),Y.reset()),s===M&&k&&Q("")},re=s=>{Le(s),S(""),T(""),ue(!1),Q(""),ye(!1),he(null),se.reset(),ne.reset(),K.reset(),Y.reset()},w=se.isPending||ne.isPending||K.isPending||Y.isPending,Se=se.error,je=ne.error,Ne=K.error||Y.error,U=C?b.trim()&&_.trim()&&a.trim():W?b.trim():R?L?q.trim():b.trim():b.trim()&&_.trim(),qe=s=>{if(!s)return null;const o=s.message.toLowerCase();return o.includes("unauthorized")||o.includes("401")?n.invalidEmailOrPassword:o.includes("already exists")||o.includes("409")?n.accountExists:o.includes("network")||o.includes("fetch")?n.networkError:o.includes("rate limit")||o.includes("429")?n.tooManyAttempts:o.includes("invalid")&&o.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=Se||je||Ne||Oe,We=async s=>{g({type:"started",method:"social",provider:s}),he(null);try{const o=await d.socialSignIn({provider:s,callbackURL:r??e});if(o.error)throw new Error(o.error.message||n.authenticationFailed)}catch(o){const D=o instanceof Error?o.message:String(o);g({type:"failed",method:"social",provider:s,stage:"redirect",error:D}),$("social_signin_failed",{provider:s,error:D}),he(o instanceof Error?o:new Error(D))}},Ue=W?n.resetPasswordTitle:R&&L?n.verificationCodeTitle:c??n.welcomeTitle,Ae=W?n.resetPasswordSubtitle:R&&L?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:j("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:j("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ae&&t.jsx("p",{className:j("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ae})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),be&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!W&&!(R&&L)&&O&&t.jsx("div",{className:"grid gap-2",children:x.map(s=>t.jsxs("button",{type:"button",disabled:w,onClick:()=>{We(s.name)},className:j("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:j("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!W&&!(R&&L)&&O&&(F||E.enabled)&&t.jsxs("div",{className:j("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:j("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),R&&E.enabled&&t.jsx(t.Fragment,{children:L?t.jsxs("form",{onSubmit:Me,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Ee,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(X,{id:Ee,type:"text",placeholder:n.enterCodePlaceholder,value:q,onChange:G(T),required:!0,disabled:w,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{ue(!1),T(""),K.reset(),Y.reset()},disabled:w,className:j("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:z,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive",children:k})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.sending:n.sendCode})]})}),W&&F&&!be&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive mt-1.5",children:k})]}),t.jsx(pe,{type:"submit",disabled:w||!U,className:"w-full font-semibold",size:"xl",children:w?n.sending:n.sendResetLink})]}),!W&&!R&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[C&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(X,{id:ve,type:"text",placeholder:n.namePlaceholder,value:a,onChange:G(S),required:!0,disabled:w,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive mt-1.5",children:k})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!C&&v.enabled&&t.jsx("button",{type:"button",onClick:()=>re("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(X,{id:we,type:"password",placeholder:"••••••••",value:_,onChange:G(V),required:!0,disabled:w,autoComplete:C?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:j("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",U?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:j("p-1",!U&&"pointer-events-none"),children:t.jsx(pe,{type:"submit",disabled:w||!U,className:j("w-full font-semibold"),size:"xl","aria-hidden":!U,children:w?C?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:W?t.jsx("button",{type:"button",onClick:()=>re("signIn"),disabled:w,className:le,children:n.backToSignIn}):R&&F?t.jsx("button",{type:"button",onClick:()=>re("signIn"),disabled:w,className:le,children:n.signInWithPassword}):!R&&F?t.jsxs(t.Fragment,{children:[C?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>re(C?"signIn":"signUp"),disabled:w,className:le,children:C?n.signIn:n.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>re("emailOtp"),disabled:w,className:le,children:n.signInWithEmailCode})]})]}):null})]})}async function de(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const r=Be(),e=Ve(),c=$e({queryKey:oe.desktopAuthStatus(),queryFn:async()=>(await de()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=y.useState(!1),[m,i]=y.useState(null),[l,u]=y.useState(!1),[I,N]=y.useState(null);y.useEffect(()=>{},[e,r]);async function A(){p(!0),i(null);try{const d=await de();await d.performAuthLogin();const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}catch(d){i(d instanceof Error?d.message:"Sign-in failed")}finally{p(!1)}}async function v(){p(!0);try{const d=await de();await d.performAuthLogout();const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}finally{p(!1)}}async function E(){u(!0),N(null);let d;try{d=await de()}catch(g){N(g instanceof Error?g.message:"Sign-in failed"),u(!1);return}try{await d.performAuthCompleteSession()}catch(g){N(g instanceof Error?g.message:"Sign-in failed")}finally{try{const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}finally{u(!1)}}}async function h(){await c.refetch()}return{status:c.data,isChecking:c.isLoading,isRetryingStatus:c.isFetching,isPending:f,loginError:m,login:A,logout:v,isCompletingSession:l,completeSessionError:I,completeSession:E,retryStatus:h}}function Je(r){return!(r.emailAndPassword.enabled||r.emailOtp.enabled||r.socialProviders.enabled)&&!r.sso.enabled&&r.magicLink.enabled}function Xe(){return ce.c(10),Ge(),null}function Ze(r){const e=ce.c(25),{onContinue:c,isPending:f,error:p}=r,m=xe();let i;e[0]!==m?(i=m("common.authEntry.browserOnlyTitle"),e[0]=m,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:i}),e[2]=i,e[3]=l):l=e[3];let u;e[4]!==m?(u=m("common.authEntry.browserOnlyDescription"),e[4]=m,e[5]=u):u=e[5];let I;e[6]!==u?(I=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:u}),e[6]=u,e[7]=I):I=e[7];let N;e[8]!==l||e[9]!==I?(N=t.jsxs("div",{className:"flex flex-col gap-1",children:[l,I]}),e[8]=l,e[9]=I,e[10]=N):N=e[10];let A;e[11]!==c?(A=()=>{c()},e[11]=c,e[12]=A):A=e[12];let v;e[13]!==m?(v=m("common.authEntry.browserOnlyCta"),e[13]=m,e[14]=v):v=e[14];let E;e[15]!==f||e[16]!==A||e[17]!==v?(E=t.jsx(pe,{onClick:A,disabled:f,children:v}),e[15]=f,e[16]=A,e[17]=v,e[18]=E):E=e[18];let h;e[19]!==p?(h=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=h):h=e[20];let d;return e[21]!==N||e[22]!==E||e[23]!==h?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[N,E,h]}),e[21]=N,e[22]=E,e[23]=h,e[24]=d):d=e[24],d}function Ce(r){const e=ce.c(8),{label:c,error:f}=r;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let m;e[1]!==c?(m=c&&t.jsx("p",{className:"text-sm text-muted-foreground",children:c}),e[1]=c,e[2]=m):m=e[2];let i;e[3]!==f?(i=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=i):i=e[4];let l;return e[5]!==m||e[6]!==i?(l=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,m,i]}),e[5]=m,e[6]=i,e[7]=l):l=e[7],l}class Ie{constructor(e){this.response=e}response}function et(r){return r.startsWith("/")&&!r.startsWith("//")?r:"/"}function tt({redirectTo:r,onAuthEvent:e}){const c=xe(),[f,p]=y.useState(null),m=y.useEffectEvent(i=>{try{e?.(i)}catch{}});return y.useEffect(()=>{let i=!1;return(async()=>{m({type:"started",method:"local"});try{let l;try{l=await ze(async()=>{const u=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(u.status>=500)throw new Ie(u);return u},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(u){if(u instanceof He&&u.cause instanceof Ie)l=u.cause.response;else throw u}if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u?.error||c("common.authEntry.autoLoginFailed"))}i||(m({type:"succeeded",method:"local"}),window.location.href=et(r))}catch(l){i||(m({type:"failed",method:"local",stage:"authenticate",error:l instanceof Error?l.message:String(l)}),p(l instanceof Error?l.message:c("common.authEntry.autoLoginFailed")))}})(),()=>{i=!0}},[r]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:c("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:c("common.authEntry.tryRestartingServer")})]})}):t.jsx(Fe,{})}function st({callbackURL:r,providerId:e,ssoSignIn:c,onAuthEvent:f}){const p=y.useEffectEvent(i=>{try{f?.(i)}catch{}}),m=y.useEffectEvent(c);return y.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const i=await m({providerId:e,callbackURL:r});if(i.error)throw new Error(i.error.message||"SSO redirect failed")}catch(i){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:i instanceof Error?i.message:String(i)})}})()},[e,r]),t.jsx(Fe,{})}function lt(r){const e=ce.c(45),{callbackUrl:c,redirectUrl:f,allowAutoLogin:p,title:m,subtitle:i,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v}=r,E=p===void 0?!0:p,h=xe(),{sso:d,emailAndPassword:g,magicLink:P,emailOtp:Z,socialProviders:ee,localMode:me}=ke(),x=Xe(),O=f||c,F=x?.actions;let b;e[0]!==F?(b={..._e,...F},e[0]=F,e[1]=b):b=e[1];const M=b;if(x?.isPending){let a;e[2]!==h?(a=h("common.authEntry.finishSignInInBrowser"),e[2]=h,e[3]=a):a=e[3];let S;return e[4]!==x.loginError||e[5]!==a?(S=t.jsx(Ce,{label:a,error:x.loginError}),e[4]=x.loginError,e[5]=a,e[6]=S):S=e[6],S}if(x?.isCompletingSession){let a;e[7]!==h?(a=h("common.authEntry.finishingSignIn"),e[7]=h,e[8]=a):a=e[8];let S;return e[9]!==x.completeSessionError||e[10]!==a?(S=t.jsx(Ce,{label:a,error:x.completeSessionError}),e[9]=x.completeSessionError,e[10]=a,e[11]=S):S=e[11],S}if(me&&E){let a;return e[12]!==v||e[13]!==O?(a=t.jsx(tt,{redirectTo:O,onAuthEvent:v}),e[12]=v,e[13]=O,e[14]=a):a=e[14],a}if(d.enabled){let a;return e[15]!==v||e[16]!==O||e[17]!==M.ssoSignIn||e[18]!==d.providerId?(a=t.jsx(st,{callbackURL:O,providerId:d.providerId,ssoSignIn:M.ssoSignIn,onAuthEvent:v}),e[15]=v,e[16]=O,e[17]=M.ssoSignIn,e[18]=d.providerId,e[19]=a):a=e[19],a}if(x&&Je({emailAndPassword:g,emailOtp:Z,socialProviders:ee,magicLink:P,sso:d})){let a;return e[20]!==x.isPending||e[21]!==x.login||e[22]!==x.loginError?(a=t.jsx(Ze,{onContinue:x.login,isPending:x.isPending,error:x.loginError}),e[20]=x.isPending,e[21]=x.login,e[22]=x.loginError,e[23]=a):a=e[23],a}if(g.enabled||P.enabled||Z.enabled||ee.enabled){const a=x?.loginError??x?.completeSessionError??null;let S;e[24]!==A||e[25]!==N||e[26]!==l||e[27]!==c||e[28]!==u||e[29]!==v||e[30]!==F||e[31]!==f||e[32]!==i||e[33]!==m||e[34]!==I?(S=t.jsx(Ye,{redirectUrl:f,callbackUrl:c,title:m,subtitle:i,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v,actions:F}),e[24]=A,e[25]=N,e[26]=l,e[27]=c,e[28]=u,e[29]=v,e[30]=F,e[31]=f,e[32]=i,e[33]=m,e[34]=I,e[35]=S):S=e[35];const q=S;if(!a)return q;let T;e[36]!==a?(T=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[36]=a,e[37]=T):T=e[37];let L;return e[38]!==q||e[39]!==T?(L=t.jsxs("div",{className:"grid gap-4",children:[T,q]}),e[38]=q,e[39]=T,e[40]=L):L=e[40],L}let _;e[41]!==h?(_=h("common.authEntry.noLoginOptions"),e[41]=h,e[42]=_):_=e[42];let V;return e[43]!==_?(V=t.jsx("div",{children:_}),e[43]=_,e[44]=V):V=e[44],V}export{lt as A,Ge as u};
|
|
1
|
+
import{a as B,D as ke,r as y,e as ae,p as $,j as t,m as j,B as pe,o as Be,n as $e,K as oe,c as ce,b as xe,S as Fe}from"./index-DptGhhs0.js";import{I as X}from"./input-zj8m7n84.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-DEsDb5EQ.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const _e={submitEmailPassword:({mode:r,email:e,password:c,name:f})=>r==="sign_up"?B.signUp.email({email:e,password:c,name:f||""}):B.signIn.email({email:e,password:c}),requestPasswordReset:({email:r,redirectTo:e})=>B.requestPasswordReset({email:r,redirectTo:e}),sendOtp:({email:r})=>B.emailOtp.sendVerificationOtp({email:r,type:"sign-in"}),submitOtp:({email:r,otp:e})=>B.signIn.emailOtp({email:r,otp:e}),socialSignIn:({provider:r,callbackURL:e})=>B.signIn.social({provider:r,callbackURL:e}),ssoSignIn:({providerId:r,callbackURL:e})=>B.signIn.sso({providerId:r,callbackURL:e}),onAuthenticated:r=>{window.location.href=r}},le="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:r=>`Code sent to ${r}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:r=>`Continue with ${r}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:r,callbackUrl:e="/",title:c,subtitle:f,brand:p,copy:m,variant:i="default",allowedSocialProviders:l,allowPassword:u=!0,onAuthEvent:I,actions:N}){const{emailAndPassword:A,resetPassword:v,emailOtp:E,socialProviders:h}=ke(),d={..._e,...N},g=s=>{try{I?.(s)}catch{}},P=i==="compact",Z=l?h.providers.filter(s=>l.includes(s.name)):h.providers,ee=h.enabled&&Z.length>0,me=A.enabled&&(u||!E.enabled&&!ee),x=h.enabled&&h.providers.length>0&&!ee&&!E.enabled&&!me?h.providers:Z,O=h.enabled&&x.length>0,F=A.enabled&&(u||!E.enabled&&!O),[b,M]=y.useState(""),[_,V]=y.useState(""),[a,S]=y.useState(""),[q,T]=y.useState(""),[L,ue]=y.useState(!1),[ge,Le]=y.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[k,Q]=y.useState(""),[be,ye]=y.useState(!1),[Oe,he]=y.useState(null),n={...Ke,...m},te=y.useId(),z=`${te}-email`,H=`${te}-email-error`,ve=`${te}-name`,we=`${te}-password`,Ee=`${te}-otp`,C=ge==="signUp",W=ge==="forgotPassword",R=ge==="emailOtp",se=ae({mutationFn:async({email:s,password:o,name:D})=>{try{const J=await d.submitEmailPassword({mode:C?"sign_up":"sign_in",email:s,password:o,name:D});if(J.error)throw new Error(J.error.message||(C?n.signUpFailed:n.signInFailed));return J}catch(J){throw J instanceof Error?J:new Error(n.authenticationFailed)}},onMutate:()=>{g({type:"started",method:"email_password",mode:C?"sign_up":"sign_in"})},onSuccess:()=>{g({type:"succeeded",method:"email_password",mode:C?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(r??e)},onError:s=>{g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),$(C?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),ne=ae({mutationFn:async({email:s})=>{const o=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(o.error)throw new Error(o.error.message||n.resetEmailFailed);return o},onSuccess:()=>{$("password_reset_requested"),ye(!0)},onError:s=>{$("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),K=ae({mutationFn:async({email:s})=>{const o=await d.sendOtp({email:s});if(o.error)throw new Error(o.error.message||n.otpSendFailed);return o},onMutate:()=>{g({type:"started",method:"email_otp"})},onSuccess:()=>{g({type:"otp_sent",method:"email_otp"}),$("email_otp_sent"),ue(!0)},onError:s=>{g({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),Y=ae({mutationFn:async({email:s,otp:o})=>{const D=await d.submitOtp({email:s,otp:o});if(D.error)throw new Error(D.error.message||n.invalidCode);return D},onMutate:()=>{g({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{g({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(r??e)},onError:s=>{g({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ie=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),fe=()=>{b.trim()&&!ie(b)&&Q(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}se.mutate({email:b,password:_,name:a})},Re=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail);return}ne.mutate({email:b})},De=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}K.mutate({email:b})},Me=s=>{s.preventDefault(),Y.mutate({email:b,otp:q})},G=s=>o=>{s(o.target.value),Se&&se.reset(),je&&ne.reset(),Ne&&(K.reset(),Y.reset()),s===M&&k&&Q("")},re=s=>{Le(s),S(""),T(""),ue(!1),Q(""),ye(!1),he(null),se.reset(),ne.reset(),K.reset(),Y.reset()},w=se.isPending||ne.isPending||K.isPending||Y.isPending,Se=se.error,je=ne.error,Ne=K.error||Y.error,U=C?b.trim()&&_.trim()&&a.trim():W?b.trim():R?L?q.trim():b.trim():b.trim()&&_.trim(),qe=s=>{if(!s)return null;const o=s.message.toLowerCase();return o.includes("unauthorized")||o.includes("401")?n.invalidEmailOrPassword:o.includes("already exists")||o.includes("409")?n.accountExists:o.includes("network")||o.includes("fetch")?n.networkError:o.includes("rate limit")||o.includes("429")?n.tooManyAttempts:o.includes("invalid")&&o.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=Se||je||Ne||Oe,We=async s=>{g({type:"started",method:"social",provider:s}),he(null);try{const o=await d.socialSignIn({provider:s,callbackURL:r??e});if(o.error)throw new Error(o.error.message||n.authenticationFailed)}catch(o){const D=o instanceof Error?o.message:String(o);g({type:"failed",method:"social",provider:s,stage:"redirect",error:D}),$("social_signin_failed",{provider:s,error:D}),he(o instanceof Error?o:new Error(D))}},Ue=W?n.resetPasswordTitle:R&&L?n.verificationCodeTitle:c??n.welcomeTitle,Ae=W?n.resetPasswordSubtitle:R&&L?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:j("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:j("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ae&&t.jsx("p",{className:j("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ae})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),be&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!W&&!(R&&L)&&O&&t.jsx("div",{className:"grid gap-2",children:x.map(s=>t.jsxs("button",{type:"button",disabled:w,onClick:()=>{We(s.name)},className:j("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:j("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!W&&!(R&&L)&&O&&(F||E.enabled)&&t.jsxs("div",{className:j("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:j("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),R&&E.enabled&&t.jsx(t.Fragment,{children:L?t.jsxs("form",{onSubmit:Me,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Ee,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(X,{id:Ee,type:"text",placeholder:n.enterCodePlaceholder,value:q,onChange:G(T),required:!0,disabled:w,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{ue(!1),T(""),K.reset(),Y.reset()},disabled:w,className:j("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:z,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive",children:k})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.sending:n.sendCode})]})}),W&&F&&!be&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive mt-1.5",children:k})]}),t.jsx(pe,{type:"submit",disabled:w||!U,className:"w-full font-semibold",size:"xl",children:w?n.sending:n.sendResetLink})]}),!W&&!R&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[C&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(X,{id:ve,type:"text",placeholder:n.namePlaceholder,value:a,onChange:G(S),required:!0,disabled:w,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive mt-1.5",children:k})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!C&&v.enabled&&t.jsx("button",{type:"button",onClick:()=>re("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(X,{id:we,type:"password",placeholder:"••••••••",value:_,onChange:G(V),required:!0,disabled:w,autoComplete:C?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:j("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",U?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:j("p-1",!U&&"pointer-events-none"),children:t.jsx(pe,{type:"submit",disabled:w||!U,className:j("w-full font-semibold"),size:"xl","aria-hidden":!U,children:w?C?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:W?t.jsx("button",{type:"button",onClick:()=>re("signIn"),disabled:w,className:le,children:n.backToSignIn}):R&&F?t.jsx("button",{type:"button",onClick:()=>re("signIn"),disabled:w,className:le,children:n.signInWithPassword}):!R&&F?t.jsxs(t.Fragment,{children:[C?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>re(C?"signIn":"signUp"),disabled:w,className:le,children:C?n.signIn:n.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>re("emailOtp"),disabled:w,className:le,children:n.signInWithEmailCode})]})]}):null})]})}async function de(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const r=Be(),e=Ve(),c=$e({queryKey:oe.desktopAuthStatus(),queryFn:async()=>(await de()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=y.useState(!1),[m,i]=y.useState(null),[l,u]=y.useState(!1),[I,N]=y.useState(null);y.useEffect(()=>{},[e,r]);async function A(){p(!0),i(null);try{const d=await de();await d.performAuthLogin();const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}catch(d){i(d instanceof Error?d.message:"Sign-in failed")}finally{p(!1)}}async function v(){p(!0);try{const d=await de();await d.performAuthLogout();const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}finally{p(!1)}}async function E(){u(!0),N(null);let d;try{d=await de()}catch(g){N(g instanceof Error?g.message:"Sign-in failed"),u(!1);return}try{await d.performAuthCompleteSession()}catch(g){N(g instanceof Error?g.message:"Sign-in failed")}finally{try{const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}finally{u(!1)}}}async function h(){await c.refetch()}return{status:c.data,isChecking:c.isLoading,isRetryingStatus:c.isFetching,isPending:f,loginError:m,login:A,logout:v,isCompletingSession:l,completeSessionError:I,completeSession:E,retryStatus:h}}function Je(r){return!(r.emailAndPassword.enabled||r.emailOtp.enabled||r.socialProviders.enabled)&&!r.sso.enabled&&r.magicLink.enabled}function Xe(){return ce.c(10),Ge(),null}function Ze(r){const e=ce.c(25),{onContinue:c,isPending:f,error:p}=r,m=xe();let i;e[0]!==m?(i=m("common.authEntry.browserOnlyTitle"),e[0]=m,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:i}),e[2]=i,e[3]=l):l=e[3];let u;e[4]!==m?(u=m("common.authEntry.browserOnlyDescription"),e[4]=m,e[5]=u):u=e[5];let I;e[6]!==u?(I=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:u}),e[6]=u,e[7]=I):I=e[7];let N;e[8]!==l||e[9]!==I?(N=t.jsxs("div",{className:"flex flex-col gap-1",children:[l,I]}),e[8]=l,e[9]=I,e[10]=N):N=e[10];let A;e[11]!==c?(A=()=>{c()},e[11]=c,e[12]=A):A=e[12];let v;e[13]!==m?(v=m("common.authEntry.browserOnlyCta"),e[13]=m,e[14]=v):v=e[14];let E;e[15]!==f||e[16]!==A||e[17]!==v?(E=t.jsx(pe,{onClick:A,disabled:f,children:v}),e[15]=f,e[16]=A,e[17]=v,e[18]=E):E=e[18];let h;e[19]!==p?(h=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=h):h=e[20];let d;return e[21]!==N||e[22]!==E||e[23]!==h?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[N,E,h]}),e[21]=N,e[22]=E,e[23]=h,e[24]=d):d=e[24],d}function Ce(r){const e=ce.c(8),{label:c,error:f}=r;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let m;e[1]!==c?(m=c&&t.jsx("p",{className:"text-sm text-muted-foreground",children:c}),e[1]=c,e[2]=m):m=e[2];let i;e[3]!==f?(i=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=i):i=e[4];let l;return e[5]!==m||e[6]!==i?(l=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,m,i]}),e[5]=m,e[6]=i,e[7]=l):l=e[7],l}class Ie{constructor(e){this.response=e}response}function et(r){return r.startsWith("/")&&!r.startsWith("//")?r:"/"}function tt({redirectTo:r,onAuthEvent:e}){const c=xe(),[f,p]=y.useState(null),m=y.useEffectEvent(i=>{try{e?.(i)}catch{}});return y.useEffect(()=>{let i=!1;return(async()=>{m({type:"started",method:"local"});try{let l;try{l=await ze(async()=>{const u=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(u.status>=500)throw new Ie(u);return u},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(u){if(u instanceof He&&u.cause instanceof Ie)l=u.cause.response;else throw u}if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u?.error||c("common.authEntry.autoLoginFailed"))}i||(m({type:"succeeded",method:"local"}),window.location.href=et(r))}catch(l){i||(m({type:"failed",method:"local",stage:"authenticate",error:l instanceof Error?l.message:String(l)}),p(l instanceof Error?l.message:c("common.authEntry.autoLoginFailed")))}})(),()=>{i=!0}},[r]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:c("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:c("common.authEntry.tryRestartingServer")})]})}):t.jsx(Fe,{})}function st({callbackURL:r,providerId:e,ssoSignIn:c,onAuthEvent:f}){const p=y.useEffectEvent(i=>{try{f?.(i)}catch{}}),m=y.useEffectEvent(c);return y.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const i=await m({providerId:e,callbackURL:r});if(i.error)throw new Error(i.error.message||"SSO redirect failed")}catch(i){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:i instanceof Error?i.message:String(i)})}})()},[e,r]),t.jsx(Fe,{})}function lt(r){const e=ce.c(45),{callbackUrl:c,redirectUrl:f,allowAutoLogin:p,title:m,subtitle:i,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v}=r,E=p===void 0?!0:p,h=xe(),{sso:d,emailAndPassword:g,magicLink:P,emailOtp:Z,socialProviders:ee,localMode:me}=ke(),x=Xe(),O=f||c,F=x?.actions;let b;e[0]!==F?(b={..._e,...F},e[0]=F,e[1]=b):b=e[1];const M=b;if(x?.isPending){let a;e[2]!==h?(a=h("common.authEntry.finishSignInInBrowser"),e[2]=h,e[3]=a):a=e[3];let S;return e[4]!==x.loginError||e[5]!==a?(S=t.jsx(Ce,{label:a,error:x.loginError}),e[4]=x.loginError,e[5]=a,e[6]=S):S=e[6],S}if(x?.isCompletingSession){let a;e[7]!==h?(a=h("common.authEntry.finishingSignIn"),e[7]=h,e[8]=a):a=e[8];let S;return e[9]!==x.completeSessionError||e[10]!==a?(S=t.jsx(Ce,{label:a,error:x.completeSessionError}),e[9]=x.completeSessionError,e[10]=a,e[11]=S):S=e[11],S}if(me&&E){let a;return e[12]!==v||e[13]!==O?(a=t.jsx(tt,{redirectTo:O,onAuthEvent:v}),e[12]=v,e[13]=O,e[14]=a):a=e[14],a}if(d.enabled){let a;return e[15]!==v||e[16]!==O||e[17]!==M.ssoSignIn||e[18]!==d.providerId?(a=t.jsx(st,{callbackURL:O,providerId:d.providerId,ssoSignIn:M.ssoSignIn,onAuthEvent:v}),e[15]=v,e[16]=O,e[17]=M.ssoSignIn,e[18]=d.providerId,e[19]=a):a=e[19],a}if(x&&Je({emailAndPassword:g,emailOtp:Z,socialProviders:ee,magicLink:P,sso:d})){let a;return e[20]!==x.isPending||e[21]!==x.login||e[22]!==x.loginError?(a=t.jsx(Ze,{onContinue:x.login,isPending:x.isPending,error:x.loginError}),e[20]=x.isPending,e[21]=x.login,e[22]=x.loginError,e[23]=a):a=e[23],a}if(g.enabled||P.enabled||Z.enabled||ee.enabled){const a=x?.loginError??x?.completeSessionError??null;let S;e[24]!==A||e[25]!==N||e[26]!==l||e[27]!==c||e[28]!==u||e[29]!==v||e[30]!==F||e[31]!==f||e[32]!==i||e[33]!==m||e[34]!==I?(S=t.jsx(Ye,{redirectUrl:f,callbackUrl:c,title:m,subtitle:i,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v,actions:F}),e[24]=A,e[25]=N,e[26]=l,e[27]=c,e[28]=u,e[29]=v,e[30]=F,e[31]=f,e[32]=i,e[33]=m,e[34]=I,e[35]=S):S=e[35];const q=S;if(!a)return q;let T;e[36]!==a?(T=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[36]=a,e[37]=T):T=e[37];let L;return e[38]!==q||e[39]!==T?(L=t.jsxs("div",{className:"grid gap-4",children:[T,q]}),e[38]=q,e[39]=T,e[40]=L):L=e[40],L}let _;e[41]!==h?(_=h("common.authEntry.noLoginOptions"),e[41]=h,e[42]=_):_=e[42];let V;return e[43]!==_?(V=t.jsx("div",{children:_}),e[43]=_,e[44]=V):V=e[44],V}export{lt as A,Ge as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,m as p,j as f}from"./index-
|
|
1
|
+
import{c as g,m as p,j as f}from"./index-DptGhhs0.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-DptGhhs0.js";import{i as u,a as p}from"./mcp-oauth-shlK2GTY.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
|
package/dist/client/assets/{automation-list-row-BkrA0C81.js → automation-list-row-DMeZ0lJ3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-
|
|
1
|
+
import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-DptGhhs0.js";import{A as Y,a as Z,b as ee,c as te,d as se,e as ie,f as ne,g as oe}from"./alert-dialog-FVJZWl26.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-Q--ZyLLW.js";import{s as me}from"./Stars02-DnbvYkKU.js";import{a as ue}from"./DotsVertical-Do26-QjL.js";import{s as de}from"./Trash01-B8ymhEo_.js";import{i as fe}from"./Zap-BuelQrvQ.js";import{u as ge}from"./use-virtual-mcp-Bdv0Gghv.js";import{A as xe}from"./agent-icon-CSidaJ6B.js";import{u as pe}from"./use-automations-DhjGDNZK.js";function ke(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=ge(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(xe,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(ue,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(de,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(me,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(fe,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{ke as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as R,c as L,b as V,_ as Rn,j as n,B as Ce,Z as ss,Y as Pn,$ as An,m as K,p as En,aB as Ln,ay as we,aF as Mn,aE as Se,bM as Be,aC as Pe,bN as xs,aA as hs,F as je,o as Dn,e as Fn,K as pe,t as ft,n as Ue,d as Me,E as gs,aw as bs,bO as kt,aD as zn,bP as _e}from"./index-DBW7-LLJ.js";import{e as On}from"./select-p5o_Bt0F.js";import{u as ys}from"./useInfiniteQuery-yZBiNKu9.js";import{a as js,u as Bn}from"./use-connection-DJ0b1gTC.js";import{k as Un,u as Tt,f as Hn,i as Wn,a as Vn,S as qn}from"./use-mcp-client-YC9HMu6y.js";import{a as Gn}from"./use-virtual-mcp-Czn5fHtD.js";import{C as Xn}from"./card-Djqe431m.js";import{o as vs,m as Ss,p as _t,q as Ct}from"./sidebar-BBmlF4Le.js";import{c as Ns,e as ws,a as Qe,d as fe,b as ks,T as me}from"./table-CUPzY57H.js";import{E as mt}from"./empty-state-Jijm8Zjj.js";import{u as It}from"./use-infinite-scroll-BLH47khU.js";import{u as Yn}from"./use-members-BOo6SBZf.js";import{u as Ts,S as Ee}from"./use-clock-tick-Cso4aNFM.js";import{e as Kn}from"./use-automations-BebUXKcQ.js";import{u as _s}from"./studio-tools-eC6fCmF6.js";import{u as Jn}from"./useSuspenseInfiniteQuery-CdZRM8uM.js";import{A as Cs}from"./avatar-CG1sYMC3.js";import{t as Ge}from"./ChevronDown-DSAcD82u.js";import{n as pt}from"./ChevronUp-BqqaHKfG.js";import{n as Is,t as Qn,c as $s,i as Zn,a as $t}from"./Tool02-8rf_PPrb.js";import{h as el,aN as tl,aO as sl,a6 as nl,E as ll,aP as ol,ad as rl,i as ns,at as al,C as il,m as cl,aQ as ul,aL as Rs,aR as dl,A as Ps,aS as be,aT as fl,n as ml}from"./agent-icon-bqP8cd4A.js";import{t as Ze}from"./Stars01-BkoB-Q1B.js";import{i as As,b as He}from"./XCircle-Bdipnf78.js";import{i as Rt}from"./Check-CK_e8wdj.js";import{i as ls}from"./ChevronRight-D02mIW0w.js";import{a as Es}from"./Copy01-CbmbpqVa.js";import{b as Ne,t as Pt,c as os}from"./format-time-BnbuEtat.js";import{u as Ls}from"./use-copy-BNgRyC_N.js";import{T as Ie,a as $e,c as Re}from"./tooltip-fkTa7gIG.js";import{j as At,I as pl,R as xl,J as hl,t as gl,U as he,V as Ms,W as De,c as bl,u as yl,M as jl,e as vl,f as Sl}from"./calendar-CSYSRHan.js";import{d as Nl,c as wl,r as kl,e as Tl}from"./hooks-Bl53PFCW.js";import{j as Fe,F as _l,k as Et,b as Ds,a as Cl}from"./chat-context-B9IMqX9H.js";import{c as Il}from"./monaco-editor-DJSyif3I.js";import{g as Fs,M as $l}from"./index-DS1dPTBr.js";import{f as Rl,o as Pl,q as Al}from"./tab-id-ts2R-IK7.js";import{i as zs}from"./AlertCircle-Cd8M35Wb.js";import{s as El}from"./Eye-CgfUY2cN.js";import{s as Xe,t as Os}from"./Star01-DGK3WnVL.js";import{s as Ll}from"./XClose-BXyOmw6P.js";import{n as xt}from"./ZapSquare-DRAXQQVP.js";import{d as Ml,c as Dl,a as We}from"./Tool01-BPkNcjLe.js";import{i as ze}from"./Monitor01-8S0W2w5U.js";import{i as Fl}from"./SearchMd-bzt4kP0K.js";import{i as zl}from"./Upload01-C74iA_2l.js";import{u as Ol,a as Bl}from"./shell-layout-CvSnv4Ng.js";import{n as Bs}from"./LinkExternal01-CXa8wVjc.js";import{I as ke}from"./integration-icon-BjR4OGAx.js";import{i as Ul}from"./ArrowUpRight-CCEVlmCI.js";import{a as Lt}from"./Users03-C0TiA5ig.js";import{a as ye}from"./Palette-BQLbJJdf.js";import{c as Us}from"./use-navigate-to-agent-CwseQD-z.js";import{a as Hl}from"./Stars02-Cx4R-W4T.js";import{g as Wl}from"./AreaChart-C78nqQQF.js";import{b as Vl,a as ql,c as Gl,d as Xl,e as Yl}from"./dialog-BNEf4h73.js";import{a as Kl,F as Jl,b as Ql,c as Zl,d as eo,e as to}from"./form-BoZJqj_8.js";import{I as so}from"./input-DM14QBHx.js";import{S as no}from"./spinner-D09NsuWH.js";const lo={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 Hs(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(lo)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function Ws(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Vs(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+Hs(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function Bc(s){return s.reduce((e,t)=>Vs(e,t.metadata?.usage),Ws())}const oo={damping:.7,stiffness:.05,mass:1.25},ro=70,ao=1e3/60,io=350;let et=!1;globalThis.document?.addEventListener("mousedown",()=>{et=!0});globalThis.document?.addEventListener("mouseup",()=>{et=!1});globalThis.document?.addEventListener("click",()=>{et=!1});const co=(s={})=>{const[e,t]=R.useState(!1),[l,o]=R.useState(s.initial!==!1),[a,r]=R.useState(!1),c=R.useRef(null);c.current=s;const i=R.useCallback(()=>{if(!et)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const v=b.getRangeAt(0);return v.commonAncestorContainer.contains(g.current)||g.current?.contains(v.commonAncestorContainer)},[]),u=R.useCallback(b=>{f.isAtBottom=b,o(b)},[]),m=R.useCallback(b=>{f.escapedFromLock=b,t(b)},[]),f=R.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:l,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(v){if(g.current){const{scrollBehavior:j}=getComputedStyle(g.current);j!=="auto"&&(g.current.style.scrollBehavior="auto"),g.current.scrollTop=v,f.ignoreScrollToTop=g.current.scrollTop,j!=="auto"&&(g.current.style.scrollBehavior=j)}},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:v}=this;if(!s.targetScrollTop)return v;if(b?.targetScrollTop===v)return b.calculatedScrollTop;const j=Math.max(Math.min(s.targetScrollTop(v,{scrollElement:g.current,contentElement:y.current}),v),0);return b={targetScrollTop:v,calculatedScrollTop:j},requestAnimationFrame(()=>{b=void 0}),j},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=ro}}},[]),d=R.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||u(!0);const v=Date.now()+(Number(b.wait)||0),j=it(c.current,b.animation),{ignoreEscapes:T=!1}=b;let S,N=f.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{S=Date.now()}):S=v+(b.duration??0);const w=async()=>{const k=new Promise(requestAnimationFrame).then(()=>{if(!f.isAtBottom)return f.animation=void 0,!1;const{scrollTop:_}=f,C=performance.now(),I=(C-(f.lastTick??C))/ao;if(f.animation||(f.animation={behavior:j,promise:k,ignoreEscapes:T}),f.animation.behavior===j&&(f.lastTick=C),i()||v>Date.now())return w();if(_<Math.min(N,f.calculatedTargetScrollTop)){if(f.animation?.behavior===j){if(j==="instant")return f.scrollTop=f.calculatedTargetScrollTop,w();f.velocity=(j.damping*f.velocity+j.stiffness*f.scrollDifference)/j.mass,f.accumulated+=f.velocity*I,f.scrollTop+=f.accumulated,f.scrollTop!==_&&(f.accumulated=0)}return w()}return S>Date.now()?(N=f.calculatedTargetScrollTop,w()):(f.animation=void 0,f.scrollTop<f.calculatedTargetScrollTop?d({animation:it(c.current,c.current.resize),ignoreEscapes:T,duration:Math.max(0,S-Date.now())||void 0}):f.isAtBottom)});return k.then(_=>(requestAnimationFrame(()=>{f.animation||(f.lastTick=void 0,f.velocity=0)}),_))};return b.wait!==!0&&(f.animation=void 0),f.animation?.behavior===j?f.animation.promise:w()},[u,i,f]),p=R.useCallback(()=>{m(!0),u(!1)},[m,u]),x=R.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:v,ignoreScrollToTop:j}=f;let{lastScrollTop:T=v}=f;f.lastScrollTop=v,f.ignoreScrollToTop=void 0,j&&j>v&&(T=j),r(f.isNearBottom),setTimeout(()=>{if(f.resizeDifference||v===j)return;if(i()){m(!0),u(!1);return}const S=v>T,N=v<T;if(f.animation?.ignoreEscapes){f.scrollTop=T;return}N&&(m(!0),u(!1)),S&&m(!1),!f.escapedFromLock&&f.isNearBottom&&u(!0)},1)},[m,u,i,f]),h=R.useCallback(({target:b,deltaY:v})=>{let j=b;for(;!["scroll","auto"].includes(getComputedStyle(j).overflow);){if(!j.parentElement)return;j=j.parentElement}j===g.current&&v<0&&g.current.scrollHeight>g.current.clientHeight&&!f.animation?.ignoreEscapes&&(m(!0),u(!1))},[m,u,f]),g=rs(b=>{g.current?.removeEventListener("scroll",x),g.current?.removeEventListener("wheel",h),b?.addEventListener("scroll",x,{passive:!0}),b?.addEventListener("wheel",h,{passive:!0})},[]),y=rs(b=>{if(f.resizeObserver?.disconnect(),f.resizeObserver=void 0,!b)return;let v;f.resizeObserver=new ResizeObserver(([j])=>{const{height:T}=j.contentRect,S=T-(v??T);if(f.resizeDifference=S,f.scrollTop>f.targetScrollTop&&(f.scrollTop=f.targetScrollTop),r(f.isNearBottom),S>=0){const N=it(c.current,v?c.current.resize:c.current.initial);d({animation:N,wait:!0,preserveScrollPosition:!0,duration:N==="instant"?void 0:io})}else f.isNearBottom&&(m(!1),u(!0));v=T,requestAnimationFrame(()=>{setTimeout(()=>{f.resizeDifference===S&&(f.resizeDifference=0)},1)})}),f.resizeObserver?.observe(b)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:d,stopScroll:p,isAtBottom:l||a,isNearBottom:a,escapedFromLock:e,state:f}};function rs(s,e){const t=R.useCallback(l=>(t.current=l,s(l)),e);return t}const at=new Map;function it(...s){const e={...oo};let t=!1;for(const o of s){if(o==="instant"){t=!0;continue}typeof o=="object"&&(t=!1,e.damping=o.damping??e.damping,e.stiffness=o.stiffness??e.stiffness,e.mass=o.mass??e.mass)}const l=JSON.stringify(e);return at.has(l)||at.set(l,Object.freeze(e)),t?"instant":at.get(l)}function uo(s){let e=2166136261;for(let t=0;t<s.length;t++)e=Math.imul(e^s.charCodeAt(t),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function Mt(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Dt(s,e){if(!e)return s;const t=`${uo(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function fo(s,e){return Dt(s,e).replace(/[_-]/g," ").toLowerCase()}function mo(s,e){const t={};for(const l of s?.arguments??[])t[l.name]=l.required?ss().min(1,e):ss();return Pn(t)}function po(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function xo(s){const e=L.c(74),{prompt:t,setPrompt:l,onSubmit:o,defaultValues:a}=s,r=R.useId(),c=V();let i,u;if(e[0]!==t||e[1]!==c){const D=mo(t,c("chat.dialogPromptArguments.required"));u=An,i=Rn(D),e[0]=t,e[1]=c,e[2]=i,e[3]=u}else i=e[2],u=e[3];let m;e[4]!==a||e[5]!==t?(m=t?po(t,a):{},e[4]=a,e[5]=t,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f={resolver:i,defaultValues:m,mode:"onChange"},e[7]=i,e[8]=m,e[9]=f):f=e[9];const d=u(f);let p;e[10]!==t?.arguments?(p=t?.arguments??[],e[10]=t?.arguments,e[11]=p):p=e[11];const x=p;let h;e[12]!==d||e[13]!==o||e[14]!==l?(h=async D=>{await o(D),l(null),d.reset()},e[12]=d,e[13]=o,e[14]=l,e[15]=h):h=e[15];const g=h;let y;e[16]!==d||e[17]!==l?(y=D=>{D||(d.reset(),l(null))},e[16]=d,e[17]=l,e[18]=y):y=e[18];const b=y;if(!t)return null;let v;e[19]!==t._meta||e[20]!==t.name||e[21]!==t.title?(v=t.title||fo(t.name,Mt(t._meta)),e[19]=t._meta,e[20]=t.name,e[21]=t.title,e[22]=v):v=e[22];let j;e[23]!==v?(j=n.jsx(Vl,{children:n.jsx("span",{className:"capitalize",children:v})}),e[23]=v,e[24]=j):j=e[24];let T;e[25]!==t.description?(T=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[25]=t.description,e[26]=T):T=e[26];let S;e[27]!==T||e[28]!==j?(S=n.jsxs(ql,{children:[j,T]}),e[27]=T,e[28]=j,e[29]=S):S=e[29];let N;e[30]!==d||e[31]!==g?(N=D=>{D.stopPropagation(),d.handleSubmit(g)(D)},e[30]=d,e[31]=g,e[32]=N):N=e[32];let w;if(e[33]!==x||e[34]!==d.control||e[35]!==d.formState.isSubmitting||e[36]!==c){let D;e[38]!==d.control||e[39]!==d.formState.isSubmitting||e[40]!==c?(D=O=>n.jsx(Jl,{control:d.control,name:O.name,render:B=>{const{field:U}=B;return n.jsxs(Ql,{children:[n.jsxs(Zl,{className:"text-xs",children:[O.name,O.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",c("chat.dialogPromptArguments.optional")]})]}),n.jsx(eo,{children:n.jsx(so,{...U,value:U.value??"",required:O.required,placeholder:O.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),n.jsx(to,{})]})}},O.name),e[38]=d.control,e[39]=d.formState.isSubmitting,e[40]=c,e[41]=D):D=e[41],w=x.map(D),e[33]=x,e[34]=d.control,e[35]=d.formState.isSubmitting,e[36]=c,e[37]=w}else w=e[37];let k;e[42]!==b?(k=()=>b(!1),e[42]=b,e[43]=k):k=e[43];const _=d.formState.isSubmitting;let C;e[44]!==c?(C=c("chat.dialogPromptArguments.cancel"),e[44]=c,e[45]=C):C=e[45];let I;e[46]!==d.formState.isSubmitting||e[47]!==k||e[48]!==C?(I=n.jsx(Ce,{type:"button",variant:"ghost",onClick:k,disabled:_,children:C}),e[46]=d.formState.isSubmitting,e[47]=k,e[48]=C,e[49]=I):I=e[49];let E;e[50]!==d.formState.isSubmitting||e[51]!==c?(E=d.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(no,{size:"xs"}),c("chat.dialogPromptArguments.loading")]}):c("chat.dialogPromptArguments.usePrompt"),e[50]=d.formState.isSubmitting,e[51]=c,e[52]=E):E=e[52];let P;e[53]!==d.formState.isSubmitting||e[54]!==r||e[55]!==E?(P=n.jsx(Ce,{type:"submit",form:r,disabled:d.formState.isSubmitting,children:E}),e[53]=d.formState.isSubmitting,e[54]=r,e[55]=E,e[56]=P):P=e[56];let $;e[57]!==I||e[58]!==P?($=n.jsxs(Gl,{children:[I,P]}),e[57]=I,e[58]=P,e[59]=$):$=e[59];let A;e[60]!==r||e[61]!==N||e[62]!==w||e[63]!==$?(A=n.jsxs("form",{id:r,className:"space-y-4 py-4",autoComplete:"off",onSubmit:N,children:[w,$]}),e[60]=r,e[61]=N,e[62]=w,e[63]=$,e[64]=A):A=e[64];let M;e[65]!==d||e[66]!==A?(M=n.jsx(Kl,{...d,children:A}),e[65]=d,e[66]=A,e[67]=M):M=e[67];let F;e[68]!==S||e[69]!==M?(F=n.jsxs(Xl,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[S,M]}),e[68]=S,e[69]=M,e[70]=F):F=e[70];let z;return e[71]!==b||e[72]!==F?(z=n.jsx(Yl,{open:!0,onOpenChange:b,children:F}),e[71]=b,e[72]=F,e[73]=z):z=e[73],z}const ho=/^mcp__[a-zA-Z0-9_-]+__/;function qs(s){return s.replace(ho,"")}function tt(s){const e=L.c(19),{id:t,part:l,copyable:o,extraActions:a,alwaysShowActions:r,animate:c}=s,i=o===void 0?!1:o,u=r===void 0?!1:r,m=c===void 0?!1:c,{handleCopy:f}=Ls(),d=V(),[p,x]=R.useState(!1);let h;e[0]!==f||e[1]!==t||e[2]!==l.text?(h=async()=>{En("chat_message_copied",{message_id:t,chars:l.text.length}),await f(l.text),x(!0),setTimeout(()=>x(!1),2e3)},e[0]=f,e[1]=t,e[2]=l.text,e[3]=h):h=e[3];const g=h,y=i&&a,b=y||a;let v;e[4]!==m||e[5]!==t||e[6]!==l.text?(v=n.jsx(At,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=v):v=e[7];let j;e[8]!==u||e[9]!==a||e[10]!==g||e[11]!==p||e[12]!==b||e[13]!==y||e[14]!==d?(j=b&&n.jsxs("div",{className:K("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",u?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,y&&a&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),y&&n.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":d("chat.textPart.copyMessage"),children:p?n.jsx(Rt,{className:"size-4"}):n.jsx(Es,{className:"size-4"})})]}),e[8]=u,e[9]=a,e[10]=g,e[11]=p,e[12]=b,e[13]=y,e[14]=d,e[15]=j):j=e[15];let T;return e[16]!==v||e[17]!==j?(T=n.jsxs("div",{className:"group/part relative",children:[v,j]}),e[16]=v,e[17]=j,e[18]=T):T=e[18],T}function Uc(s,e,t){s.chain().focus().insertContentAt(e,[go(t),{type:"text",text:" "}]).run()}function go(s){return{type:"file",attrs:s}}function bo(s){const e=L.c(17),{node:t,selected:l,view:o}=s,{name:a,mimeType:r,data:c}=t.attrs,i=l&&o.editable;let u;e[0]!==r?(u=r.startsWith("image/"),e[0]=r,e[1]=u):u=e[1];const m=u,f=i&&"outline-2 outline-blue-300 outline-offset-0";let d;e[2]!==f?(d=K("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",f),e[2]=f,e[3]=d):d=e[3];let p;e[4]!==a?(p=n.jsx(Ie,{asChild:!0,children:n.jsx("span",{children:a})}),e[4]=a,e[5]=p):p=e[5];let x;e[6]!==c||e[7]!==m||e[8]!==r||e[9]!==a?(x=n.jsx($e,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${r};base64,${c}`,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:r})]})}),e[6]=c,e[7]=m,e[8]=r,e[9]=a,e[10]=x):x=e[10];let h;e[11]!==p||e[12]!==x?(h=n.jsxs(Re,{children:[p,x]}),e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;return e[14]!==d||e[15]!==h?(g=n.jsx(hl,{className:d,children:h}),e[14]=d,e[15]=h,e[16]=g):g=e[16],g}const yo=pl.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 xl(bo)}}),Te=16,ht=2.5,gt=(Te-ht)/2,ct=2*Math.PI*gt;function Gs(s){const e=L.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:o,outputTokens:a,cost:r}=t;if(!l&&!o&&!a)return null;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(el,{size:12}),e[0]=c):c=e[0];let i;e[1]!==r||e[2]!==l?(i=r>0?`$${r.toFixed(4)}`:l.toLocaleString(),e[1]=r,e[2]=l,e[3]=i):i=e[3];let u;e[4]!==i?(u=n.jsx(Ie,{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:[c,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:i})]})}),e[4]=i,e[5]=u):u=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 f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=f):f=e[7];let d;e[8]!==o?(d=o.toLocaleString(),e[8]=o,e[9]=d):d=e[9];let p;e[10]!==d?(p=n.jsx("span",{className:"text-right tabular-nums",children:d}),e[10]=d,e[11]=p):p=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 h=a-(t.reasoningTokens??0);let g;e[13]!==h?(g=h.toLocaleString(),e[13]=h,e[14]=g):g=e[14];let y;e[15]!==g?(y=n.jsx("span",{className:"text-right tabular-nums",children:g}),e[15]=g,e[16]=y):y=e[16];let b;e[17]!==o||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(b=(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:o>0?`${(t.cacheReadTokens/o*100).toFixed(0)}%`:"0%"})]}),e[17]=o,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=b):b=e[20];let v;e[21]!==r?(v=r>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",r.toFixed(4)]})]}),e[21]=r,e[22]=v):v=e[22];let j;e[23]!==y||e[24]!==b||e[25]!==v||e[26]!==p?(j=n.jsxs($e,{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:[f,p,x,y,b,v]})]}),e[23]=y,e[24]=b,e[25]=v,e[26]=p,e[27]=j):j=e[27];let T;return e[28]!==j||e[29]!==u?(T=n.jsxs(Re,{children:[u,j]}),e[28]=j,e[29]=u,e[30]=T):T=e[30],T}function jo(s){const e=L.c(19),{usage:t,duration:l}=s,o=l!=null&&l>0,a=t!=null&&(t.cost??0)>0,r=t!=null&&(t.totalTokens??0)>0;if(!o&&!a&&!r)return null;let c;e[0]!==l||e[1]!==o?(c=o?Ne(l/1e3):null,e[0]=l,e[1]=o,e[2]=c):c=e[2];const i=c;let u;e[3]!==l||e[4]!==i||e[5]!==t?(u=i&&n.jsxs(Re,{children:[n.jsx(Ie,{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:i})}),n.jsxs($e,{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:Ne(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=i,e[5]=t,e[6]=u):u=e[6];let m;e[7]!==a||e[8]!==o||e[9]!==r?(m=o&&(a||r)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=a,e[8]=o,e[9]=r,e[10]=m):m=e[10];let f;e[11]!==a||e[12]!==r||e[13]!==t?(f=(a||r)&&n.jsxs(Re,{children:[n.jsx(Ie,{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($e,{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]=r,e[13]=t,e[14]=f):f=e[14];let d;return e[15]!==u||e[16]!==m||e[17]!==f?(d=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[u,m,f]}),e[15]=u,e[16]=m,e[17]=f,e[18]=d):d=e[18],d}function Hc(s){const e=L.c(51),{usage:t,totalTokens:l,contextWindow:o,onOpenContextPanel:a}=s,r=Math.min(l/o*100,100),c=ct-r/100*ct,i=t?.cost??0,u=t?.inputTokens??0,m=t?.outputTokens??0;let f;e[0]!==r?(f=r.toFixed(0),e[0]=r,e[1]=f):f=e[1];let d;e[2]!==i?(d=i>0?`, $${i.toFixed(2)}`:"",e[2]=i,e[3]=d):d=e[3];const p=`Context usage: ${f}%${d}`,x=a?"cursor-pointer":"cursor-default";let h;e[4]!==x?(h=K("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=h):h=e[5];let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("circle",{cx:Te/2,cy:Te/2,r:gt,fill:"none",stroke:"currentColor",strokeWidth:ht,className:"opacity-15"}),e[6]=g):g=e[6];const y=r>90?"text-destructive":r>70?"text-warning":"text-muted-foreground";let b;e[7]!==y?(b=K(y),e[7]=y,e[8]=b):b=e[8];let v;e[9]!==c||e[10]!==b?(v=n.jsxs("svg",{width:Te,height:Te,className:"-rotate-90",children:[g,n.jsx("circle",{cx:Te/2,cy:Te/2,r:gt,fill:"none",stroke:"currentColor",strokeWidth:ht,strokeDasharray:ct,strokeDashoffset:c,strokeLinecap:"round",className:b})]}),e[9]=c,e[10]=b,e[11]=v):v=e[11];let j;e[12]!==r?(j=r.toFixed(0),e[12]=r,e[13]=j):j=e[13];let T;e[14]!==i?(T=i>0?` · $${i.toFixed(2)}`:"",e[14]=i,e[15]=T):T=e[15];let S;e[16]!==j||e[17]!==T?(S=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:[j,"%",T]}),e[16]=j,e[17]=T,e[18]=S):S=e[18];let N;e[19]!==a||e[20]!==S||e[21]!==p||e[22]!==h||e[23]!==v?(N=n.jsx(Ie,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":p,className:h,children:[v,S]})}),e[19]=a,e[20]=S,e[21]=p,e[22]=h,e[23]=v,e[24]=N):N=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=w):w=e[25];let k;e[26]!==l?(k=l.toLocaleString(),e[26]=l,e[27]=k):k=e[27];let _;e[28]!==o?(_=o.toLocaleString(),e[28]=o,e[29]=_):_=e[29];let C;e[30]!==r?(C=r.toFixed(1),e[30]=r,e[31]=C):C=e[31];let I;e[32]!==k||e[33]!==_||e[34]!==C?(I=n.jsxs("span",{className:"text-right tabular-nums",children:[k," / ",_," (",C,"%)"]}),e[32]=k,e[33]=_,e[34]=C,e[35]=I):I=e[35];let E;e[36]!==i||e[37]!==u||e[38]!==m?(E=i>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",i.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:u.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=i,e[37]=u,e[38]=m,e[39]=E):E=e[39];let P;e[40]!==u||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(P=((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:u>0?`${((t?.cacheReadTokens??0)/u*100).toFixed(0)}%`:"0%"})]}),e[40]=u,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=P):P=e[43];let $;e[44]!==I||e[45]!==E||e[46]!==P?($=n.jsx($e,{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:[w,I,E,P]})}),e[44]=I,e[45]=E,e[46]=P,e[47]=$):$=e[47];let A;return e[48]!==N||e[49]!==$?(A=n.jsxs(Re,{children:[N,$]}),e[48]=N,e[49]=$,e[50]=A):A=e[50],A}var st="Collapsible",[vo,Wc]=hs(st),[So,Ft]=vo(st),Xs=R.forwardRef((s,e)=>{const{__scopeCollapsible:t,open:l,defaultOpen:o,disabled:a,onOpenChange:r,...c}=s,[i,u]=Ln({prop:l,defaultProp:o??!1,onChange:r,caller:st});return n.jsx(So,{scope:t,disabled:a,contentId:Mn(),open:i,onOpenToggle:R.useCallback(()=>u(m=>!m),[u]),children:n.jsx(we.div,{"data-state":Ut(i),"data-disabled":a?"":void 0,...c,ref:e})})});Xs.displayName=st;var Ys="CollapsibleTrigger",zt=R.forwardRef((s,e)=>{const{__scopeCollapsible:t,...l}=s,o=Ft(Ys,t);return n.jsx(we.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Ut(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...l,ref:e,onClick:Se(s.onClick,o.onOpenToggle)})});zt.displayName=Ys;var Ot="CollapsibleContent",Bt=R.forwardRef((s,e)=>{const{forceMount:t,...l}=s,o=Ft(Ot,s.__scopeCollapsible);return n.jsx(Be,{present:t||o.open,children:({present:a})=>n.jsx(No,{...l,ref:e,present:a})})});Bt.displayName=Ot;var No=R.forwardRef((s,e)=>{const{__scopeCollapsible:t,present:l,children:o,...a}=s,r=Ft(Ot,t),[c,i]=R.useState(l),u=R.useRef(null),m=Pe(e,u),f=R.useRef(0),d=f.current,p=R.useRef(0),x=p.current,h=r.open||c,g=R.useRef(h),y=R.useRef(void 0);return R.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),xs(()=>{const b=u.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const v=b.getBoundingClientRect();f.current=v.height,p.current=v.width,g.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),i(l)}},[r.open,l]),n.jsx(we.div,{"data-state":Ut(r.open),"data-disabled":r.disabled?"":void 0,id:r.contentId,hidden:!h,...a,ref:m,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...s.style},children:h&&o})});function Ut(s){return s?"open":"closed"}var wo=Xs,Vc=zt,qc=Bt;function ko(s){const e=L.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(wo,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function To(s){const e=L.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(zt,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function _o(s){const e=L.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(Bt,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Y({icon:s,title:e,usage:t,summary:l,state:o,detail:a,detailVariant:r="code",forceOpen:c,variant:i="default",trailing:u,iconDestructive:m,alwaysChevron:f,defaultOpen:d,children:p}){const x=V(),[h,g]=R.useState(d??!1),{handleCopy:y,copied:b}=Ls(),v=o==="loading",j=o==="error",S=!!(a&&a.trim())||!!p,N=i==="subtask",w=(c??!1)||h,k=co({initial:v?"instant":!1}),_=n.jsxs(ko,{open:w,onOpenChange:c?void 0:g,className:"min-w-0",children:[n.jsxs(To,{disabled:!S,className:K("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",S&&"[@media(hover:hover)]:hover:bg-accent/30",!S&&"cursor-default",v&&"shimmer"),"aria-disabled":!S,children:[n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:f?n.jsx(ls,{className:K("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",w&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:K("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",m?"[&>svg]:text-destructive/70":j?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",S&&(w?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:s}),S&&n.jsx("div",{className:K("absolute inset-0 flex items-center justify-center transition-opacity duration-150",w?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(ls,{className:K("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",w&&"rotate-90")})})]})}),n.jsx("span",{className:K("shrink-0 text-[14px] font-normal",j?"text-warning/80":"text-foreground"),children:e}),l?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:l})}):n.jsx("div",{className:"flex-1"}),u&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:u}),n.jsx(Gs,{usage:t})]}),S&&n.jsx(_o,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:p||(r==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsx("div",{ref:k.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:n.jsx("p",{ref:k.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:a})})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsx("div",{ref:k.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:n.jsxs("div",{ref:k.contentRef,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:a})}),n.jsx("button",{type:"button",onClick:()=>y(a),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":x("common.copy"),children:b?n.jsx(Rt,{className:"size-3.5"}):n.jsx(Es,{className:"size-3.5"})})]})})}))})]});return N?n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:_}):_}function ue(s){const e=L.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=Ne(t),e[0]=t,e[1]=l):l=e[1];let o;return e[2]!==l?(o=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=o):o=e[3],o}const Ks=4;function Js(s){const e=L.c(8),{count:t,noun:l,onClick:o}=s,a=V();let r;e[0]!==t||e[1]!==l||e[2]!==a?(r=a("common.seeAll",{count:t,noun:l}),e[0]=t,e[1]=l,e[2]=a,e[3]=r):r=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(As,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[4]=c):c=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsxs("button",{type:"button",onClick:o,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:[r,c]}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Qs(s){const e=L.c(12),{message:t,className:l}=s,o=t.created_at??t.metadata?.created_at??null;let a,r,c,i;if(e[0]!==l||e[1]!==o){i=Symbol.for("react.early_return_sentinel");e:{const m=Pt(o);if(m===null){i=null;break e}const f=new Date(m);a=f.toLocaleString(),e[6]!==l?(r=K("text-[11px] text-muted-foreground/60 select-none",l),e[6]=l,e[7]=r):r=e[7],c=f.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=l,e[1]=o,e[2]=a,e[3]=r,e[4]=c,e[5]=i}else a=e[2],r=e[3],c=e[4],i=e[5];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;return e[8]!==a||e[9]!==r||e[10]!==c?(u=n.jsx("span",{title:a,className:r,children:c}),e[8]=a,e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function bt(s){const e=L.c(9),{since:t}=s;let l;e[0]!==t?(l=()=>os(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[o,a]=R.useState(l);let r,c;e[2]!==t?(r=()=>{const f=setInterval(()=>a(os(t,Date.now())),100);return()=>clearInterval(f)},c=[t],e[2]=t,e[3]=r,e[4]=c):(r=e[3],c=e[4]),R.useEffect(r,c);const i=o/1e3;let u;e[5]!==i?(u=Ne(i),e[5]=i,e[6]=u):u=e[6];let m;return e[7]!==u?(m=n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:u}),e[7]=u,e[8]=m):m=e[8],m}const Zs=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Co(){const s=L.c(5),[e]=R.useState(Io);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=Zs.map((a,r)=>{const{delay:c}=a;return n.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[r],animation:"grid-ripple 1s ease infinite",animationDelay:`${c}ms`}},r)}),s[1]=e,s[2]=l):l=s[2];let o;return s[3]!==l?(o=n.jsx("div",{className:"grid",style:t,children:l}),s[3]=l,s[4]=o):o=s[4],o}function Io(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Zs.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}function $o(s){return{planning:{icon:n.jsx(sl,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.planningLabel"),detail:s("chat.thinkingIndicator.planningDetail")},thinking:{icon:n.jsx(Ze,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.thinkingLabel"),detail:s("chat.thinkingIndicator.thinkingDetail")}}}const Ro=1200;function yt(s){const e=L.c(8),{icon:t,title:l,summary:o,detail:a,state:r,detailVariant:c,trailing:i}=s,u=c===void 0?"prose":c;let m;return e[0]!==a||e[1]!==u||e[2]!==t||e[3]!==r||e[4]!==o||e[5]!==l||e[6]!==i?(m=n.jsx(Y,{icon:t,title:l,summary:o,detail:a,state:r,detailVariant:u,trailing:i}),e[0]=a,e[1]=u,e[2]=t,e[3]=r,e[4]=o,e[5]=l,e[6]=i,e[7]=m):m=e[7],m}function Po(s){const e=L.c(22),{startedAt:t}=s,l=V(),o=Fe()?.runStatusStage??null,[a,r]=R.useState("planning");let c,i;if(e[0]!==o?(c=()=>{if(o!==null)return;const h=setTimeout(()=>{r("thinking")},Ro);return()=>{clearTimeout(h)}},i=[o],e[0]=o,e[1]=c,e[2]=i):(c=e[1],i=e[2]),R.useEffect(c,i),o!==null){let h;e[3]!==o||e[4]!==l?(h=Nl(l,o),e[3]=o,e[4]=l,e[5]=h):h=e[5];const g=h;let y;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ze,{className:"size-4"}),e[6]=y):y=e[6];const b=`${g.label}...`;let v;e[7]!==t?(v=t!==null&&n.jsx(bt,{since:t}),e[7]=t,e[8]=v):v=e[8];let j;return e[9]!==g.detail||e[10]!==b||e[11]!==v?(j=n.jsx(yt,{icon:y,title:b,summary:g.detail,state:"loading",trailing:v}),e[9]=g.detail,e[10]=b,e[11]=v,e[12]=j):j=e[12],j}let u;e[13]!==l?(u=$o(l),e[13]=l,e[14]=u):u=e[14];const f=u[a],d=`${f.label}...`;let p;e[15]!==t?(p=t!==null&&n.jsx(bt,{since:t}),e[15]=t,e[16]=p):p=e[16];let x;return e[17]!==f.detail||e[18]!==f.icon||e[19]!==d||e[20]!==p?(x=n.jsx(yt,{icon:f.icon,title:d,summary:f.detail,state:"loading",trailing:p}),e[17]=f.detail,e[18]=f.icon,e[19]=d,e[20]=p,e[21]=x):x=e[21],x}function Ao(s){const e=L.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Co,{}),e[0]=l):l=e[0];let o;return e[1]!==t?(o=n.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[l,n.jsx(bt,{since:t})]}),e[1]=t,e[2]=o):o=e[2],o}const Eo=2e4;function Lo(s){const e=L.c(9),{startedAt:t}=s,l=V();Ts(1e3);const o=Fe(),r=(t!==null?Date.now()-t:0)>=Eo;let c;e[0]!==t?(c=n.jsx(Po,{startedAt:t}),e[0]=t,e[1]=c):c=e[1];let i;e[2]!==r||e[3]!==o||e[4]!==l?(i=r&&o?.stop&&n.jsxs("div",{className:"flex items-center gap-2 pb-1 text-[13px] text-muted-foreground/60",children:[n.jsx("span",{children:l("chat.thinkingIndicator.takingLonger")}),n.jsx("button",{type:"button",onClick:()=>o.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:l("chat.thinkingIndicator.cancel")})]}),e[2]=r,e[3]=o,e[4]=l,e[5]=i):i=e[5];let u;return e[6]!==c||e[7]!==i?(u=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[c,i]}),e[6]=c,e[7]=i,e[8]=u):u=e[8],u}function Mo(s){const e=L.c(24),{duration:t,parts:l,isStreaming:o}=s,a=V();let r;e[0]!==l?(r=l.every(zo),e[0]=l,e[1]=r):r=e[1];const c=r;let i;e[2]!==t||e[3]!==a?(i=t&&t/1e3>1?a("chat.thinkingIndicator.thoughtFor",{duration:Ne(t/1e3)}):a("chat.thinkingIndicator.thought"),e[2]=t,e[3]=a,e[4]=i):i=e[4];const u=i;let m;if(e[5]!==c||e[6]!==o||e[7]!==l){const v=l.map(Fo).join(`
|
|
1
|
+
import{r as R,c as L,b as V,_ as Rn,j as n,B as Ce,Z as ss,Y as Pn,$ as An,m as K,p as En,aB as Ln,ay as we,aF as Mn,aE as Se,bM as Be,aC as Pe,bN as xs,aA as hs,F as je,o as Dn,e as Fn,K as pe,t as ft,n as Ue,d as Me,E as gs,aw as bs,bO as kt,aD as zn,bP as _e}from"./index-DptGhhs0.js";import{e as On}from"./select-j9WEM8Sh.js";import{u as ys}from"./useInfiniteQuery-BIuIIh4Y.js";import{a as js,u as Bn}from"./use-connection-BMokl4CO.js";import{k as Un,u as Tt,f as Hn,i as Wn,a as Vn,S as qn}from"./use-mcp-client-C7paE-cE.js";import{a as Gn}from"./use-virtual-mcp-Bdv0Gghv.js";import{C as Xn}from"./card-Dv8gN6wM.js";import{o as vs,m as Ss,p as _t,q as Ct}from"./sidebar-DYUk0Bcn.js";import{c as Ns,e as ws,a as Qe,d as fe,b as ks,T as me}from"./table-B1o0Pwj4.js";import{E as mt}from"./empty-state-BOcwt_Pf.js";import{u as It}from"./use-infinite-scroll-CK3Uizc8.js";import{u as Yn}from"./use-members-BuBLbPW8.js";import{u as Ts,S as Ee}from"./use-clock-tick-B9BJ0pwX.js";import{e as Kn}from"./use-automations-DhjGDNZK.js";import{u as _s}from"./studio-tools-Dz4porfg.js";import{u as Jn}from"./useSuspenseInfiniteQuery-TLdwTHtB.js";import{A as Cs}from"./avatar-BumNKk7X.js";import{t as Ge}from"./ChevronDown-Wb4xUAM2.js";import{n as pt}from"./ChevronUp-Bsb-Y77Y.js";import{n as Is,t as Qn,c as $s,i as Zn,a as $t}from"./Tool02-Bh88tYGs.js";import{h as el,aN as tl,aO as sl,a6 as nl,E as ll,aP as ol,ad as rl,i as ns,at as al,C as il,m as cl,aQ as ul,aL as Rs,aR as dl,A as Ps,aS as be,aT as fl,n as ml}from"./agent-icon-CSidaJ6B.js";import{t as Ze}from"./Stars01-CfCAp21f.js";import{i as As,b as He}from"./XCircle-UQVfZTIm.js";import{i as Rt}from"./Check-CgsRhHy8.js";import{i as ls}from"./ChevronRight-Bb4Md-MD.js";import{a as Es}from"./Copy01-DZd32DIO.js";import{b as Ne,t as Pt,c as os}from"./format-time-BnbuEtat.js";import{u as Ls}from"./use-copy-Be1Kjd_w.js";import{T as Ie,a as $e,c as Re}from"./tooltip-CETnd3ay.js";import{j as At,I as pl,R as xl,J as hl,t as gl,U as he,V as Ms,W as De,c as bl,u as yl,M as jl,e as vl,f as Sl}from"./calendar-DMZ7yz5j.js";import{d as Nl,c as wl,r as kl,e as Tl}from"./hooks-BkWYCTuM.js";import{j as Fe,F as _l,k as Et,b as Ds,a as Cl}from"./chat-context-D2jz7TPk.js";import{c as Il}from"./monaco-editor-CVT6PsIN.js";import{g as Fs,M as $l}from"./index-yBY16i4r.js";import{f as Rl,o as Pl,q as Al}from"./tab-id-swDgZMnB.js";import{i as zs}from"./AlertCircle-CUqW_w6g.js";import{s as El}from"./Eye-B22W8AyK.js";import{s as Xe,t as Os}from"./Star01-sYD82Np9.js";import{s as Ll}from"./XClose-Beh-B9Gb.js";import{n as xt}from"./ZapSquare-Cp9irGGl.js";import{d as Ml,c as Dl,a as We}from"./Tool01-CTroi0ek.js";import{i as ze}from"./Monitor01-DcyY807V.js";import{i as Fl}from"./SearchMd-h05KKMiS.js";import{i as zl}from"./Upload01-CRF4bF0L.js";import{u as Ol,a as Bl}from"./shell-layout-Qdn6Ab14.js";import{n as Bs}from"./LinkExternal01-BHdYJ4vg.js";import{I as ke}from"./integration-icon-BuPK5TYy.js";import{i as Ul}from"./ArrowUpRight-Ctd2GOR9.js";import{a as Lt}from"./Users03-23U4ny0D.js";import{a as ye}from"./Palette-BEUtyKuF.js";import{c as Us}from"./use-navigate-to-agent-Bqz6pwLi.js";import{a as Hl}from"./Stars02-DnbvYkKU.js";import{g as Wl}from"./AreaChart-Bm75VTUe.js";import{b as Vl,a as ql,c as Gl,d as Xl,e as Yl}from"./dialog-D4l4Xdsp.js";import{a as Kl,F as Jl,b as Ql,c as Zl,d as eo,e as to}from"./form-DMrBv8ot.js";import{I as so}from"./input-zj8m7n84.js";import{S as no}from"./spinner-DEsDb5EQ.js";const lo={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 Hs(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(lo)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function Ws(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Vs(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+Hs(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function Bc(s){return s.reduce((e,t)=>Vs(e,t.metadata?.usage),Ws())}const oo={damping:.7,stiffness:.05,mass:1.25},ro=70,ao=1e3/60,io=350;let et=!1;globalThis.document?.addEventListener("mousedown",()=>{et=!0});globalThis.document?.addEventListener("mouseup",()=>{et=!1});globalThis.document?.addEventListener("click",()=>{et=!1});const co=(s={})=>{const[e,t]=R.useState(!1),[l,o]=R.useState(s.initial!==!1),[a,r]=R.useState(!1),c=R.useRef(null);c.current=s;const i=R.useCallback(()=>{if(!et)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const v=b.getRangeAt(0);return v.commonAncestorContainer.contains(g.current)||g.current?.contains(v.commonAncestorContainer)},[]),u=R.useCallback(b=>{f.isAtBottom=b,o(b)},[]),m=R.useCallback(b=>{f.escapedFromLock=b,t(b)},[]),f=R.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:l,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(v){if(g.current){const{scrollBehavior:j}=getComputedStyle(g.current);j!=="auto"&&(g.current.style.scrollBehavior="auto"),g.current.scrollTop=v,f.ignoreScrollToTop=g.current.scrollTop,j!=="auto"&&(g.current.style.scrollBehavior=j)}},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:v}=this;if(!s.targetScrollTop)return v;if(b?.targetScrollTop===v)return b.calculatedScrollTop;const j=Math.max(Math.min(s.targetScrollTop(v,{scrollElement:g.current,contentElement:y.current}),v),0);return b={targetScrollTop:v,calculatedScrollTop:j},requestAnimationFrame(()=>{b=void 0}),j},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=ro}}},[]),d=R.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||u(!0);const v=Date.now()+(Number(b.wait)||0),j=it(c.current,b.animation),{ignoreEscapes:T=!1}=b;let S,N=f.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{S=Date.now()}):S=v+(b.duration??0);const w=async()=>{const k=new Promise(requestAnimationFrame).then(()=>{if(!f.isAtBottom)return f.animation=void 0,!1;const{scrollTop:_}=f,C=performance.now(),I=(C-(f.lastTick??C))/ao;if(f.animation||(f.animation={behavior:j,promise:k,ignoreEscapes:T}),f.animation.behavior===j&&(f.lastTick=C),i()||v>Date.now())return w();if(_<Math.min(N,f.calculatedTargetScrollTop)){if(f.animation?.behavior===j){if(j==="instant")return f.scrollTop=f.calculatedTargetScrollTop,w();f.velocity=(j.damping*f.velocity+j.stiffness*f.scrollDifference)/j.mass,f.accumulated+=f.velocity*I,f.scrollTop+=f.accumulated,f.scrollTop!==_&&(f.accumulated=0)}return w()}return S>Date.now()?(N=f.calculatedTargetScrollTop,w()):(f.animation=void 0,f.scrollTop<f.calculatedTargetScrollTop?d({animation:it(c.current,c.current.resize),ignoreEscapes:T,duration:Math.max(0,S-Date.now())||void 0}):f.isAtBottom)});return k.then(_=>(requestAnimationFrame(()=>{f.animation||(f.lastTick=void 0,f.velocity=0)}),_))};return b.wait!==!0&&(f.animation=void 0),f.animation?.behavior===j?f.animation.promise:w()},[u,i,f]),p=R.useCallback(()=>{m(!0),u(!1)},[m,u]),x=R.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:v,ignoreScrollToTop:j}=f;let{lastScrollTop:T=v}=f;f.lastScrollTop=v,f.ignoreScrollToTop=void 0,j&&j>v&&(T=j),r(f.isNearBottom),setTimeout(()=>{if(f.resizeDifference||v===j)return;if(i()){m(!0),u(!1);return}const S=v>T,N=v<T;if(f.animation?.ignoreEscapes){f.scrollTop=T;return}N&&(m(!0),u(!1)),S&&m(!1),!f.escapedFromLock&&f.isNearBottom&&u(!0)},1)},[m,u,i,f]),h=R.useCallback(({target:b,deltaY:v})=>{let j=b;for(;!["scroll","auto"].includes(getComputedStyle(j).overflow);){if(!j.parentElement)return;j=j.parentElement}j===g.current&&v<0&&g.current.scrollHeight>g.current.clientHeight&&!f.animation?.ignoreEscapes&&(m(!0),u(!1))},[m,u,f]),g=rs(b=>{g.current?.removeEventListener("scroll",x),g.current?.removeEventListener("wheel",h),b?.addEventListener("scroll",x,{passive:!0}),b?.addEventListener("wheel",h,{passive:!0})},[]),y=rs(b=>{if(f.resizeObserver?.disconnect(),f.resizeObserver=void 0,!b)return;let v;f.resizeObserver=new ResizeObserver(([j])=>{const{height:T}=j.contentRect,S=T-(v??T);if(f.resizeDifference=S,f.scrollTop>f.targetScrollTop&&(f.scrollTop=f.targetScrollTop),r(f.isNearBottom),S>=0){const N=it(c.current,v?c.current.resize:c.current.initial);d({animation:N,wait:!0,preserveScrollPosition:!0,duration:N==="instant"?void 0:io})}else f.isNearBottom&&(m(!1),u(!0));v=T,requestAnimationFrame(()=>{setTimeout(()=>{f.resizeDifference===S&&(f.resizeDifference=0)},1)})}),f.resizeObserver?.observe(b)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:d,stopScroll:p,isAtBottom:l||a,isNearBottom:a,escapedFromLock:e,state:f}};function rs(s,e){const t=R.useCallback(l=>(t.current=l,s(l)),e);return t}const at=new Map;function it(...s){const e={...oo};let t=!1;for(const o of s){if(o==="instant"){t=!0;continue}typeof o=="object"&&(t=!1,e.damping=o.damping??e.damping,e.stiffness=o.stiffness??e.stiffness,e.mass=o.mass??e.mass)}const l=JSON.stringify(e);return at.has(l)||at.set(l,Object.freeze(e)),t?"instant":at.get(l)}function uo(s){let e=2166136261;for(let t=0;t<s.length;t++)e=Math.imul(e^s.charCodeAt(t),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function Mt(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Dt(s,e){if(!e)return s;const t=`${uo(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function fo(s,e){return Dt(s,e).replace(/[_-]/g," ").toLowerCase()}function mo(s,e){const t={};for(const l of s?.arguments??[])t[l.name]=l.required?ss().min(1,e):ss();return Pn(t)}function po(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function xo(s){const e=L.c(74),{prompt:t,setPrompt:l,onSubmit:o,defaultValues:a}=s,r=R.useId(),c=V();let i,u;if(e[0]!==t||e[1]!==c){const D=mo(t,c("chat.dialogPromptArguments.required"));u=An,i=Rn(D),e[0]=t,e[1]=c,e[2]=i,e[3]=u}else i=e[2],u=e[3];let m;e[4]!==a||e[5]!==t?(m=t?po(t,a):{},e[4]=a,e[5]=t,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f={resolver:i,defaultValues:m,mode:"onChange"},e[7]=i,e[8]=m,e[9]=f):f=e[9];const d=u(f);let p;e[10]!==t?.arguments?(p=t?.arguments??[],e[10]=t?.arguments,e[11]=p):p=e[11];const x=p;let h;e[12]!==d||e[13]!==o||e[14]!==l?(h=async D=>{await o(D),l(null),d.reset()},e[12]=d,e[13]=o,e[14]=l,e[15]=h):h=e[15];const g=h;let y;e[16]!==d||e[17]!==l?(y=D=>{D||(d.reset(),l(null))},e[16]=d,e[17]=l,e[18]=y):y=e[18];const b=y;if(!t)return null;let v;e[19]!==t._meta||e[20]!==t.name||e[21]!==t.title?(v=t.title||fo(t.name,Mt(t._meta)),e[19]=t._meta,e[20]=t.name,e[21]=t.title,e[22]=v):v=e[22];let j;e[23]!==v?(j=n.jsx(Vl,{children:n.jsx("span",{className:"capitalize",children:v})}),e[23]=v,e[24]=j):j=e[24];let T;e[25]!==t.description?(T=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[25]=t.description,e[26]=T):T=e[26];let S;e[27]!==T||e[28]!==j?(S=n.jsxs(ql,{children:[j,T]}),e[27]=T,e[28]=j,e[29]=S):S=e[29];let N;e[30]!==d||e[31]!==g?(N=D=>{D.stopPropagation(),d.handleSubmit(g)(D)},e[30]=d,e[31]=g,e[32]=N):N=e[32];let w;if(e[33]!==x||e[34]!==d.control||e[35]!==d.formState.isSubmitting||e[36]!==c){let D;e[38]!==d.control||e[39]!==d.formState.isSubmitting||e[40]!==c?(D=O=>n.jsx(Jl,{control:d.control,name:O.name,render:B=>{const{field:U}=B;return n.jsxs(Ql,{children:[n.jsxs(Zl,{className:"text-xs",children:[O.name,O.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",c("chat.dialogPromptArguments.optional")]})]}),n.jsx(eo,{children:n.jsx(so,{...U,value:U.value??"",required:O.required,placeholder:O.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),n.jsx(to,{})]})}},O.name),e[38]=d.control,e[39]=d.formState.isSubmitting,e[40]=c,e[41]=D):D=e[41],w=x.map(D),e[33]=x,e[34]=d.control,e[35]=d.formState.isSubmitting,e[36]=c,e[37]=w}else w=e[37];let k;e[42]!==b?(k=()=>b(!1),e[42]=b,e[43]=k):k=e[43];const _=d.formState.isSubmitting;let C;e[44]!==c?(C=c("chat.dialogPromptArguments.cancel"),e[44]=c,e[45]=C):C=e[45];let I;e[46]!==d.formState.isSubmitting||e[47]!==k||e[48]!==C?(I=n.jsx(Ce,{type:"button",variant:"ghost",onClick:k,disabled:_,children:C}),e[46]=d.formState.isSubmitting,e[47]=k,e[48]=C,e[49]=I):I=e[49];let E;e[50]!==d.formState.isSubmitting||e[51]!==c?(E=d.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(no,{size:"xs"}),c("chat.dialogPromptArguments.loading")]}):c("chat.dialogPromptArguments.usePrompt"),e[50]=d.formState.isSubmitting,e[51]=c,e[52]=E):E=e[52];let P;e[53]!==d.formState.isSubmitting||e[54]!==r||e[55]!==E?(P=n.jsx(Ce,{type:"submit",form:r,disabled:d.formState.isSubmitting,children:E}),e[53]=d.formState.isSubmitting,e[54]=r,e[55]=E,e[56]=P):P=e[56];let $;e[57]!==I||e[58]!==P?($=n.jsxs(Gl,{children:[I,P]}),e[57]=I,e[58]=P,e[59]=$):$=e[59];let A;e[60]!==r||e[61]!==N||e[62]!==w||e[63]!==$?(A=n.jsxs("form",{id:r,className:"space-y-4 py-4",autoComplete:"off",onSubmit:N,children:[w,$]}),e[60]=r,e[61]=N,e[62]=w,e[63]=$,e[64]=A):A=e[64];let M;e[65]!==d||e[66]!==A?(M=n.jsx(Kl,{...d,children:A}),e[65]=d,e[66]=A,e[67]=M):M=e[67];let F;e[68]!==S||e[69]!==M?(F=n.jsxs(Xl,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[S,M]}),e[68]=S,e[69]=M,e[70]=F):F=e[70];let z;return e[71]!==b||e[72]!==F?(z=n.jsx(Yl,{open:!0,onOpenChange:b,children:F}),e[71]=b,e[72]=F,e[73]=z):z=e[73],z}const ho=/^mcp__[a-zA-Z0-9_-]+__/;function qs(s){return s.replace(ho,"")}function tt(s){const e=L.c(19),{id:t,part:l,copyable:o,extraActions:a,alwaysShowActions:r,animate:c}=s,i=o===void 0?!1:o,u=r===void 0?!1:r,m=c===void 0?!1:c,{handleCopy:f}=Ls(),d=V(),[p,x]=R.useState(!1);let h;e[0]!==f||e[1]!==t||e[2]!==l.text?(h=async()=>{En("chat_message_copied",{message_id:t,chars:l.text.length}),await f(l.text),x(!0),setTimeout(()=>x(!1),2e3)},e[0]=f,e[1]=t,e[2]=l.text,e[3]=h):h=e[3];const g=h,y=i&&a,b=y||a;let v;e[4]!==m||e[5]!==t||e[6]!==l.text?(v=n.jsx(At,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=v):v=e[7];let j;e[8]!==u||e[9]!==a||e[10]!==g||e[11]!==p||e[12]!==b||e[13]!==y||e[14]!==d?(j=b&&n.jsxs("div",{className:K("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",u?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,y&&a&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),y&&n.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":d("chat.textPart.copyMessage"),children:p?n.jsx(Rt,{className:"size-4"}):n.jsx(Es,{className:"size-4"})})]}),e[8]=u,e[9]=a,e[10]=g,e[11]=p,e[12]=b,e[13]=y,e[14]=d,e[15]=j):j=e[15];let T;return e[16]!==v||e[17]!==j?(T=n.jsxs("div",{className:"group/part relative",children:[v,j]}),e[16]=v,e[17]=j,e[18]=T):T=e[18],T}function Uc(s,e,t){s.chain().focus().insertContentAt(e,[go(t),{type:"text",text:" "}]).run()}function go(s){return{type:"file",attrs:s}}function bo(s){const e=L.c(17),{node:t,selected:l,view:o}=s,{name:a,mimeType:r,data:c}=t.attrs,i=l&&o.editable;let u;e[0]!==r?(u=r.startsWith("image/"),e[0]=r,e[1]=u):u=e[1];const m=u,f=i&&"outline-2 outline-blue-300 outline-offset-0";let d;e[2]!==f?(d=K("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",f),e[2]=f,e[3]=d):d=e[3];let p;e[4]!==a?(p=n.jsx(Ie,{asChild:!0,children:n.jsx("span",{children:a})}),e[4]=a,e[5]=p):p=e[5];let x;e[6]!==c||e[7]!==m||e[8]!==r||e[9]!==a?(x=n.jsx($e,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${r};base64,${c}`,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:r})]})}),e[6]=c,e[7]=m,e[8]=r,e[9]=a,e[10]=x):x=e[10];let h;e[11]!==p||e[12]!==x?(h=n.jsxs(Re,{children:[p,x]}),e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;return e[14]!==d||e[15]!==h?(g=n.jsx(hl,{className:d,children:h}),e[14]=d,e[15]=h,e[16]=g):g=e[16],g}const yo=pl.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 xl(bo)}}),Te=16,ht=2.5,gt=(Te-ht)/2,ct=2*Math.PI*gt;function Gs(s){const e=L.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:o,outputTokens:a,cost:r}=t;if(!l&&!o&&!a)return null;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(el,{size:12}),e[0]=c):c=e[0];let i;e[1]!==r||e[2]!==l?(i=r>0?`$${r.toFixed(4)}`:l.toLocaleString(),e[1]=r,e[2]=l,e[3]=i):i=e[3];let u;e[4]!==i?(u=n.jsx(Ie,{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:[c,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:i})]})}),e[4]=i,e[5]=u):u=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 f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=f):f=e[7];let d;e[8]!==o?(d=o.toLocaleString(),e[8]=o,e[9]=d):d=e[9];let p;e[10]!==d?(p=n.jsx("span",{className:"text-right tabular-nums",children:d}),e[10]=d,e[11]=p):p=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 h=a-(t.reasoningTokens??0);let g;e[13]!==h?(g=h.toLocaleString(),e[13]=h,e[14]=g):g=e[14];let y;e[15]!==g?(y=n.jsx("span",{className:"text-right tabular-nums",children:g}),e[15]=g,e[16]=y):y=e[16];let b;e[17]!==o||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(b=(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:o>0?`${(t.cacheReadTokens/o*100).toFixed(0)}%`:"0%"})]}),e[17]=o,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=b):b=e[20];let v;e[21]!==r?(v=r>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",r.toFixed(4)]})]}),e[21]=r,e[22]=v):v=e[22];let j;e[23]!==y||e[24]!==b||e[25]!==v||e[26]!==p?(j=n.jsxs($e,{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:[f,p,x,y,b,v]})]}),e[23]=y,e[24]=b,e[25]=v,e[26]=p,e[27]=j):j=e[27];let T;return e[28]!==j||e[29]!==u?(T=n.jsxs(Re,{children:[u,j]}),e[28]=j,e[29]=u,e[30]=T):T=e[30],T}function jo(s){const e=L.c(19),{usage:t,duration:l}=s,o=l!=null&&l>0,a=t!=null&&(t.cost??0)>0,r=t!=null&&(t.totalTokens??0)>0;if(!o&&!a&&!r)return null;let c;e[0]!==l||e[1]!==o?(c=o?Ne(l/1e3):null,e[0]=l,e[1]=o,e[2]=c):c=e[2];const i=c;let u;e[3]!==l||e[4]!==i||e[5]!==t?(u=i&&n.jsxs(Re,{children:[n.jsx(Ie,{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:i})}),n.jsxs($e,{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:Ne(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=i,e[5]=t,e[6]=u):u=e[6];let m;e[7]!==a||e[8]!==o||e[9]!==r?(m=o&&(a||r)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=a,e[8]=o,e[9]=r,e[10]=m):m=e[10];let f;e[11]!==a||e[12]!==r||e[13]!==t?(f=(a||r)&&n.jsxs(Re,{children:[n.jsx(Ie,{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($e,{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]=r,e[13]=t,e[14]=f):f=e[14];let d;return e[15]!==u||e[16]!==m||e[17]!==f?(d=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[u,m,f]}),e[15]=u,e[16]=m,e[17]=f,e[18]=d):d=e[18],d}function Hc(s){const e=L.c(51),{usage:t,totalTokens:l,contextWindow:o,onOpenContextPanel:a}=s,r=Math.min(l/o*100,100),c=ct-r/100*ct,i=t?.cost??0,u=t?.inputTokens??0,m=t?.outputTokens??0;let f;e[0]!==r?(f=r.toFixed(0),e[0]=r,e[1]=f):f=e[1];let d;e[2]!==i?(d=i>0?`, $${i.toFixed(2)}`:"",e[2]=i,e[3]=d):d=e[3];const p=`Context usage: ${f}%${d}`,x=a?"cursor-pointer":"cursor-default";let h;e[4]!==x?(h=K("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=h):h=e[5];let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("circle",{cx:Te/2,cy:Te/2,r:gt,fill:"none",stroke:"currentColor",strokeWidth:ht,className:"opacity-15"}),e[6]=g):g=e[6];const y=r>90?"text-destructive":r>70?"text-warning":"text-muted-foreground";let b;e[7]!==y?(b=K(y),e[7]=y,e[8]=b):b=e[8];let v;e[9]!==c||e[10]!==b?(v=n.jsxs("svg",{width:Te,height:Te,className:"-rotate-90",children:[g,n.jsx("circle",{cx:Te/2,cy:Te/2,r:gt,fill:"none",stroke:"currentColor",strokeWidth:ht,strokeDasharray:ct,strokeDashoffset:c,strokeLinecap:"round",className:b})]}),e[9]=c,e[10]=b,e[11]=v):v=e[11];let j;e[12]!==r?(j=r.toFixed(0),e[12]=r,e[13]=j):j=e[13];let T;e[14]!==i?(T=i>0?` · $${i.toFixed(2)}`:"",e[14]=i,e[15]=T):T=e[15];let S;e[16]!==j||e[17]!==T?(S=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:[j,"%",T]}),e[16]=j,e[17]=T,e[18]=S):S=e[18];let N;e[19]!==a||e[20]!==S||e[21]!==p||e[22]!==h||e[23]!==v?(N=n.jsx(Ie,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":p,className:h,children:[v,S]})}),e[19]=a,e[20]=S,e[21]=p,e[22]=h,e[23]=v,e[24]=N):N=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=w):w=e[25];let k;e[26]!==l?(k=l.toLocaleString(),e[26]=l,e[27]=k):k=e[27];let _;e[28]!==o?(_=o.toLocaleString(),e[28]=o,e[29]=_):_=e[29];let C;e[30]!==r?(C=r.toFixed(1),e[30]=r,e[31]=C):C=e[31];let I;e[32]!==k||e[33]!==_||e[34]!==C?(I=n.jsxs("span",{className:"text-right tabular-nums",children:[k," / ",_," (",C,"%)"]}),e[32]=k,e[33]=_,e[34]=C,e[35]=I):I=e[35];let E;e[36]!==i||e[37]!==u||e[38]!==m?(E=i>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",i.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:u.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=i,e[37]=u,e[38]=m,e[39]=E):E=e[39];let P;e[40]!==u||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(P=((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:u>0?`${((t?.cacheReadTokens??0)/u*100).toFixed(0)}%`:"0%"})]}),e[40]=u,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=P):P=e[43];let $;e[44]!==I||e[45]!==E||e[46]!==P?($=n.jsx($e,{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:[w,I,E,P]})}),e[44]=I,e[45]=E,e[46]=P,e[47]=$):$=e[47];let A;return e[48]!==N||e[49]!==$?(A=n.jsxs(Re,{children:[N,$]}),e[48]=N,e[49]=$,e[50]=A):A=e[50],A}var st="Collapsible",[vo,Wc]=hs(st),[So,Ft]=vo(st),Xs=R.forwardRef((s,e)=>{const{__scopeCollapsible:t,open:l,defaultOpen:o,disabled:a,onOpenChange:r,...c}=s,[i,u]=Ln({prop:l,defaultProp:o??!1,onChange:r,caller:st});return n.jsx(So,{scope:t,disabled:a,contentId:Mn(),open:i,onOpenToggle:R.useCallback(()=>u(m=>!m),[u]),children:n.jsx(we.div,{"data-state":Ut(i),"data-disabled":a?"":void 0,...c,ref:e})})});Xs.displayName=st;var Ys="CollapsibleTrigger",zt=R.forwardRef((s,e)=>{const{__scopeCollapsible:t,...l}=s,o=Ft(Ys,t);return n.jsx(we.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Ut(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...l,ref:e,onClick:Se(s.onClick,o.onOpenToggle)})});zt.displayName=Ys;var Ot="CollapsibleContent",Bt=R.forwardRef((s,e)=>{const{forceMount:t,...l}=s,o=Ft(Ot,s.__scopeCollapsible);return n.jsx(Be,{present:t||o.open,children:({present:a})=>n.jsx(No,{...l,ref:e,present:a})})});Bt.displayName=Ot;var No=R.forwardRef((s,e)=>{const{__scopeCollapsible:t,present:l,children:o,...a}=s,r=Ft(Ot,t),[c,i]=R.useState(l),u=R.useRef(null),m=Pe(e,u),f=R.useRef(0),d=f.current,p=R.useRef(0),x=p.current,h=r.open||c,g=R.useRef(h),y=R.useRef(void 0);return R.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),xs(()=>{const b=u.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const v=b.getBoundingClientRect();f.current=v.height,p.current=v.width,g.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),i(l)}},[r.open,l]),n.jsx(we.div,{"data-state":Ut(r.open),"data-disabled":r.disabled?"":void 0,id:r.contentId,hidden:!h,...a,ref:m,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...s.style},children:h&&o})});function Ut(s){return s?"open":"closed"}var wo=Xs,Vc=zt,qc=Bt;function ko(s){const e=L.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(wo,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function To(s){const e=L.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(zt,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function _o(s){const e=L.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(Bt,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Y({icon:s,title:e,usage:t,summary:l,state:o,detail:a,detailVariant:r="code",forceOpen:c,variant:i="default",trailing:u,iconDestructive:m,alwaysChevron:f,defaultOpen:d,children:p}){const x=V(),[h,g]=R.useState(d??!1),{handleCopy:y,copied:b}=Ls(),v=o==="loading",j=o==="error",S=!!(a&&a.trim())||!!p,N=i==="subtask",w=(c??!1)||h,k=co({initial:v?"instant":!1}),_=n.jsxs(ko,{open:w,onOpenChange:c?void 0:g,className:"min-w-0",children:[n.jsxs(To,{disabled:!S,className:K("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",S&&"[@media(hover:hover)]:hover:bg-accent/30",!S&&"cursor-default",v&&"shimmer"),"aria-disabled":!S,children:[n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:f?n.jsx(ls,{className:K("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",w&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:K("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",m?"[&>svg]:text-destructive/70":j?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",S&&(w?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:s}),S&&n.jsx("div",{className:K("absolute inset-0 flex items-center justify-center transition-opacity duration-150",w?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(ls,{className:K("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",w&&"rotate-90")})})]})}),n.jsx("span",{className:K("shrink-0 text-[14px] font-normal",j?"text-warning/80":"text-foreground"),children:e}),l?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:l})}):n.jsx("div",{className:"flex-1"}),u&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:u}),n.jsx(Gs,{usage:t})]}),S&&n.jsx(_o,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:p||(r==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsx("div",{ref:k.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:n.jsx("p",{ref:k.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:a})})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsx("div",{ref:k.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:n.jsxs("div",{ref:k.contentRef,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:a})}),n.jsx("button",{type:"button",onClick:()=>y(a),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":x("common.copy"),children:b?n.jsx(Rt,{className:"size-3.5"}):n.jsx(Es,{className:"size-3.5"})})]})})}))})]});return N?n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:_}):_}function ue(s){const e=L.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=Ne(t),e[0]=t,e[1]=l):l=e[1];let o;return e[2]!==l?(o=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=o):o=e[3],o}const Ks=4;function Js(s){const e=L.c(8),{count:t,noun:l,onClick:o}=s,a=V();let r;e[0]!==t||e[1]!==l||e[2]!==a?(r=a("common.seeAll",{count:t,noun:l}),e[0]=t,e[1]=l,e[2]=a,e[3]=r):r=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(As,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[4]=c):c=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsxs("button",{type:"button",onClick:o,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:[r,c]}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Qs(s){const e=L.c(12),{message:t,className:l}=s,o=t.created_at??t.metadata?.created_at??null;let a,r,c,i;if(e[0]!==l||e[1]!==o){i=Symbol.for("react.early_return_sentinel");e:{const m=Pt(o);if(m===null){i=null;break e}const f=new Date(m);a=f.toLocaleString(),e[6]!==l?(r=K("text-[11px] text-muted-foreground/60 select-none",l),e[6]=l,e[7]=r):r=e[7],c=f.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=l,e[1]=o,e[2]=a,e[3]=r,e[4]=c,e[5]=i}else a=e[2],r=e[3],c=e[4],i=e[5];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;return e[8]!==a||e[9]!==r||e[10]!==c?(u=n.jsx("span",{title:a,className:r,children:c}),e[8]=a,e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function bt(s){const e=L.c(9),{since:t}=s;let l;e[0]!==t?(l=()=>os(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[o,a]=R.useState(l);let r,c;e[2]!==t?(r=()=>{const f=setInterval(()=>a(os(t,Date.now())),100);return()=>clearInterval(f)},c=[t],e[2]=t,e[3]=r,e[4]=c):(r=e[3],c=e[4]),R.useEffect(r,c);const i=o/1e3;let u;e[5]!==i?(u=Ne(i),e[5]=i,e[6]=u):u=e[6];let m;return e[7]!==u?(m=n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:u}),e[7]=u,e[8]=m):m=e[8],m}const Zs=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Co(){const s=L.c(5),[e]=R.useState(Io);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=Zs.map((a,r)=>{const{delay:c}=a;return n.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[r],animation:"grid-ripple 1s ease infinite",animationDelay:`${c}ms`}},r)}),s[1]=e,s[2]=l):l=s[2];let o;return s[3]!==l?(o=n.jsx("div",{className:"grid",style:t,children:l}),s[3]=l,s[4]=o):o=s[4],o}function Io(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Zs.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}function $o(s){return{planning:{icon:n.jsx(sl,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.planningLabel"),detail:s("chat.thinkingIndicator.planningDetail")},thinking:{icon:n.jsx(Ze,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.thinkingLabel"),detail:s("chat.thinkingIndicator.thinkingDetail")}}}const Ro=1200;function yt(s){const e=L.c(8),{icon:t,title:l,summary:o,detail:a,state:r,detailVariant:c,trailing:i}=s,u=c===void 0?"prose":c;let m;return e[0]!==a||e[1]!==u||e[2]!==t||e[3]!==r||e[4]!==o||e[5]!==l||e[6]!==i?(m=n.jsx(Y,{icon:t,title:l,summary:o,detail:a,state:r,detailVariant:u,trailing:i}),e[0]=a,e[1]=u,e[2]=t,e[3]=r,e[4]=o,e[5]=l,e[6]=i,e[7]=m):m=e[7],m}function Po(s){const e=L.c(22),{startedAt:t}=s,l=V(),o=Fe()?.runStatusStage??null,[a,r]=R.useState("planning");let c,i;if(e[0]!==o?(c=()=>{if(o!==null)return;const h=setTimeout(()=>{r("thinking")},Ro);return()=>{clearTimeout(h)}},i=[o],e[0]=o,e[1]=c,e[2]=i):(c=e[1],i=e[2]),R.useEffect(c,i),o!==null){let h;e[3]!==o||e[4]!==l?(h=Nl(l,o),e[3]=o,e[4]=l,e[5]=h):h=e[5];const g=h;let y;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ze,{className:"size-4"}),e[6]=y):y=e[6];const b=`${g.label}...`;let v;e[7]!==t?(v=t!==null&&n.jsx(bt,{since:t}),e[7]=t,e[8]=v):v=e[8];let j;return e[9]!==g.detail||e[10]!==b||e[11]!==v?(j=n.jsx(yt,{icon:y,title:b,summary:g.detail,state:"loading",trailing:v}),e[9]=g.detail,e[10]=b,e[11]=v,e[12]=j):j=e[12],j}let u;e[13]!==l?(u=$o(l),e[13]=l,e[14]=u):u=e[14];const f=u[a],d=`${f.label}...`;let p;e[15]!==t?(p=t!==null&&n.jsx(bt,{since:t}),e[15]=t,e[16]=p):p=e[16];let x;return e[17]!==f.detail||e[18]!==f.icon||e[19]!==d||e[20]!==p?(x=n.jsx(yt,{icon:f.icon,title:d,summary:f.detail,state:"loading",trailing:p}),e[17]=f.detail,e[18]=f.icon,e[19]=d,e[20]=p,e[21]=x):x=e[21],x}function Ao(s){const e=L.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Co,{}),e[0]=l):l=e[0];let o;return e[1]!==t?(o=n.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[l,n.jsx(bt,{since:t})]}),e[1]=t,e[2]=o):o=e[2],o}const Eo=2e4;function Lo(s){const e=L.c(9),{startedAt:t}=s,l=V();Ts(1e3);const o=Fe(),r=(t!==null?Date.now()-t:0)>=Eo;let c;e[0]!==t?(c=n.jsx(Po,{startedAt:t}),e[0]=t,e[1]=c):c=e[1];let i;e[2]!==r||e[3]!==o||e[4]!==l?(i=r&&o?.stop&&n.jsxs("div",{className:"flex items-center gap-2 pb-1 text-[13px] text-muted-foreground/60",children:[n.jsx("span",{children:l("chat.thinkingIndicator.takingLonger")}),n.jsx("button",{type:"button",onClick:()=>o.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:l("chat.thinkingIndicator.cancel")})]}),e[2]=r,e[3]=o,e[4]=l,e[5]=i):i=e[5];let u;return e[6]!==c||e[7]!==i?(u=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[c,i]}),e[6]=c,e[7]=i,e[8]=u):u=e[8],u}function Mo(s){const e=L.c(24),{duration:t,parts:l,isStreaming:o}=s,a=V();let r;e[0]!==l?(r=l.every(zo),e[0]=l,e[1]=r):r=e[1];const c=r;let i;e[2]!==t||e[3]!==a?(i=t&&t/1e3>1?a("chat.thinkingIndicator.thoughtFor",{duration:Ne(t/1e3)}):a("chat.thinkingIndicator.thought"),e[2]=t,e[3]=a,e[4]=i):i=e[4];const u=i;let m;if(e[5]!==c||e[6]!==o||e[7]!==l){const v=l.map(Fo).join(`
|
|
2
2
|
`).trim().split(`
|
|
3
3
|
`).filter(Boolean),j=o?v[v.length-1]??"":v[0]??"";m=!c&&j?j.length>100?j.slice(0,100)+"…":j:void 0,e[5]=c,e[6]=o,e[7]=l,e[8]=m}else m=e[8];const f=m;let d;if(e[9]!==c||e[10]!==l){const b=l.map(Do).join(`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B,j as o,b as D,F as M,d as $,r as q,B as F,p as R}from"./index-
|
|
1
|
+
import{c as B,j as o,b as D,F as M,d as $,r as q,B as F,p as R}from"./index-DptGhhs0.js";import{s as V}from"./Plus-BmYOuiAj.js";import{i as S}from"./Zap-BuelQrvQ.js";import{S as G}from"./search-input-Bf_CjAux.js";import{P as d}from"./index-DIkj5DIc.js";import{E as T}from"./empty-state-BOcwt_Pf.js";import{c as H}from"./use-automations-DhjGDNZK.js";import{c as J}from"./use-navigate-to-agent-Bqz6pwLi.js";import{A as K}from"./automation-list-row-DMeZ0lJ3.js";import{r as O}from"./use-mcp-client-C7paE-cE.js";import{a as Q}from"./use-virtual-mcp-Bdv0Gghv.js";import{R as U}from"./require-capability-D5sKrc-a.js";import"./SearchMd-h05KKMiS.js";import"./sidebar-DYUk0Bcn.js";import"./LayoutLeft-m1wg28yS.js";import"./use-mobile-CYh3EGEt.js";import"./X-BM44NliR.js";import"./tooltip-CETnd3ay.js";import"./studio-tools-Dz4porfg.js";import"./hooks-BkWYCTuM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-NjFnhgvn.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-FVJZWl26.js";import"./dropdown-menu-Q--ZyLLW.js";import"./Check-CgsRhHy8.js";import"./ChevronRight-Bb4Md-MD.js";import"./DotsVertical-Do26-QjL.js";import"./Stars02-DnbvYkKU.js";import"./Trash01-B8ymhEo_.js";import"./agent-icon-CSidaJ6B.js";import"./AlertCircle-CUqW_w6g.js";import"./Tool01-CTroi0ek.js";import"./ArrowUp-C7ToAohd.js";import"./Settings02-DqYJFs_A.js";import"./Tool02-Bh88tYGs.js";import"./XCircle-UQVfZTIm.js";import"./ArrowUpRight-Ctd2GOR9.js";import"./TrendUp01-Bqs7ykt4.js";import"./ZapSquare-Cp9irGGl.js";import"./Users03-23U4ny0D.js";import"./CheckCircle-VXm1pD5i.js";import"./ChevronDown-Wb4xUAM2.js";import"./ChevronUp-Bsb-Y77Y.js";import"./Copy01-DZd32DIO.js";import"./CpuChip01-BPw4omKe.js";import"./Eye-B22W8AyK.js";import"./FilterLines-Bc1kxraS.js";import"./Star01-sYD82Np9.js";import"./Palette-BEUtyKuF.js";import"./SwitchHorizontal01-BnpMv-f4.js";import"./HardDrive-BUNzYRdb.js";import"./Key01-CG1NND7T.js";import"./LinkExternal01-BHdYJ4vg.js";import"./LogOut01-CTki1bzq.js";import"./Monitor01-DcyY807V.js";import"./Sun-tw8Adw2s.js";import"./Play-DrITqLDw.js";import"./SearchLg-Brn3yddB.js";import"./Shield01-BGuTNf8w.js";import"./Stars01-CfCAp21f.js";import"./Upload01-CRF4bF0L.js";import"./User01-BMMY0J4X.js";import"./Users01-Co3nN3tw.js";import"./XClose-Beh-B9Gb.js";import"./auth-D-uIp2CQ.js";import"./use-capability-BqS7iGUH.js";import"./access-gate-D-oUG6gg.js";import"./capability-load-error-Zpx0CzA1.js";function W(){const t=B.c(20),e=D(),{org:c}=M(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=$(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+i}})};let l;t[0]!==f||t[1]!==c.slug?(l=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=l):l=t[2];const L=l,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(G,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(F,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function go(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{go as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as i,m as f,bC as R,cV as S,cW as I,cX as $}from"./index-
|
|
1
|
+
import{c as k,j as i,m as f,bC as R,cV as S,cW as I,cX as $}from"./index-DptGhhs0.js";import{s as O}from"./User01-BMMY0J4X.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(S,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const V=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),W=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),_=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function D(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const m=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f(V({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==m||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:_(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:f(W({objectFit:u}))}),i.jsx(M,{className:f(z,"rounded-none"),delayMs:l?600:0,children:m})]}),e[22]=z,e[23]=m,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function X(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let m;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(m=i.jsx(D,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=m):m=e[17],m}X.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(V({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{X as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,m as l,j as g,be as v,bC as b}from"./index-
|
|
1
|
+
import{c as u,m as l,j as g,be as v,bC as b}from"./index-DptGhhs0.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=u.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=l(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
|