decocms 3.79.2 → 3.80.0
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-Diz6uT7Y.js → AlertCircle-CzPpSV3W.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Bo4YThIl.js → ArrowUpRight-BefNTATY.js} +1 -1
- package/dist/client/assets/{CheckCircle-BSFt0_RZ.js → CheckCircle-BRNW9lmT.js} +1 -1
- package/dist/client/assets/{ChevronDown-C_njLrOU.js → ChevronDown-Di-ZHzN-.js} +1 -1
- package/dist/client/assets/{ChevronLeft-ByQFERqp.js → ChevronLeft-ByolOLbh.js} +1 -1
- package/dist/client/assets/{ChevronRight-D1duQehP.js → ChevronRight-CmB8MBzZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-_gM_dQkt.js → ChevronUp-BurUkCqE.js} +1 -1
- package/dist/client/assets/{DotsVertical-BJnhQ8u0.js → DotsVertical-Dsznav3Y.js} +1 -1
- package/dist/client/assets/{Eye-SUXNGsVY.js → Eye-B8NUm9Br.js} +1 -1
- package/dist/client/assets/{FilterLines-CxIQYlMz.js → FilterLines-DMbodALc.js} +1 -1
- package/dist/client/assets/{Globe01-CNw0uMhK.js → Globe01-BG9Wm5DJ.js} +1 -1
- package/dist/client/assets/{Globe04-B24hCYmg.js → Globe04-Fg_TSPLj.js} +1 -1
- package/dist/client/assets/{HardDrive-IPJJMMij.js → HardDrive-BLr46_IN.js} +1 -1
- package/dist/client/assets/{Key01-CES8n-fG.js → Key01-Dc0MTS9j.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D3mZzNi0.js → LayoutLeft-nNhAa0Dy.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B8zRpPza.js → LinkExternal01-D0OVTAOa.js} +1 -1
- package/dist/client/assets/{Monitor01-Uh-3HvZI.js → Monitor01-D_VMj6ZB.js} +1 -1
- package/dist/client/assets/{Palette-Du66341h.js → Palette-BmXFbt3l.js} +1 -1
- package/dist/client/assets/{Play-CVoFjR5I.js → Play-CAiQqhjZ.js} +1 -1
- package/dist/client/assets/{Plus-DoMNANl8.js → Plus-DHDiWYHk.js} +1 -1
- package/dist/client/assets/{SearchMd-B-bL1wjq.js → SearchMd-DaWHy1GV.js} +1 -1
- package/dist/client/assets/{Settings02-BvivcyYL.js → Settings02-B7jENSJZ.js} +1 -1
- package/dist/client/assets/{Shield01-BewRt7sw.js → Shield01-YoAzrA51.js} +1 -1
- package/dist/client/assets/{Star01-Ds91SJzA.js → Star01-CaB7lNB9.js} +1 -1
- package/dist/client/assets/{Stars01-PS518Jif.js → Stars01-a6WqibZn.js} +1 -1
- package/dist/client/assets/{Stars02-CVb_b-OZ.js → Stars02-D2Vky1vN.js} +1 -1
- package/dist/client/assets/{Sun-tLN4vA6M.js → Sun-vyxrPcie.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-vo5MpXEz.js → SwitchHorizontal01-C3K-vKiU.js} +1 -1
- package/dist/client/assets/{Tool01-BgzvuPeY.js → Tool01-CTw8qR4v.js} +1 -1
- package/dist/client/assets/{Trash01-D84eyfFz.js → Trash01-BzTEx-hS.js} +1 -1
- package/dist/client/assets/{Upload01-BA5iKtAl.js → Upload01-DwgHgRix.js} +1 -1
- package/dist/client/assets/{User01-CeCQHgwg.js → User01-BtO-AoKy.js} +1 -1
- package/dist/client/assets/{Users01-DtmLcsFN.js → Users01-BRTza8nY.js} +1 -1
- package/dist/client/assets/{Users03-ClWrctLP.js → Users03-9LUo_raC.js} +1 -1
- package/dist/client/assets/{X-2HGWB7Oo.js → X-1BuEzBGR.js} +1 -1
- package/dist/client/assets/{XCircle-B88UxHjD.js → XCircle-DtHr5hnB.js} +1 -1
- package/dist/client/assets/{XClose-DcfEQwVh.js → XClose-qpXD94Yo.js} +1 -1
- package/dist/client/assets/{Zap-BeB31T8Y.js → Zap-DluXKGP1.js} +1 -1
- package/dist/client/assets/{ZapSquare-BfSTQonf.js → ZapSquare-C2q_71C5.js} +1 -1
- package/dist/client/assets/{ZoomOut-Csc4IU4b.js → ZoomOut-DHX-bR9F.js} +1 -1
- package/dist/client/assets/{access-gate-BI-B2IAv.js → access-gate-CGKEhEok.js} +1 -1
- package/dist/client/assets/add-section-modal-SzJO4niJ.js +1 -0
- package/dist/client/assets/{agent-icon-BMQHBhP6.js → agent-icon-B8qJNw4_.js} +1 -1
- package/dist/client/assets/{agents-list-XJ_b0Boo.js → agents-list-BCVql_rD.js} +1 -1
- package/dist/client/assets/{ai-providers-BT9tXzcJ.js → ai-providers-DfbrzvnV.js} +1 -1
- package/dist/client/assets/{alert-BFF74cGy.js → alert-BdFRtqYC.js} +1 -1
- package/dist/client/assets/{alert-dialog-0uOi3HqZ.js → alert-dialog-CSRFWtbt.js} +3 -3
- package/dist/client/assets/app-editor-CSxGjHmN.js +1 -0
- package/dist/client/assets/{auth-CCI_mhgC.js → auth-DOooeHhC.js} +1 -1
- package/dist/client/assets/{auth-catchall-DFuEeSui.js → auth-catchall-esDJNOF7.js} +1 -1
- package/dist/client/assets/{auth-entry-BE0f6I0U.js → auth-entry-CJkDGWB9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DTKSSrMT.js → auth-split-layout-BHOeLJSB.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-eSHjAd3t.js → authenticate-and-persist-oauth-CAo_oHNJ.js} +1 -1
- package/dist/client/assets/{automation-list-row-Ct9jaHYX.js → automation-list-row-CBS-1Qac.js} +1 -1
- package/dist/client/assets/automation-runs-BhCrA9zN.js +1 -0
- package/dist/client/assets/{automations-DAlCMK2H.js → automations-DgOam79q.js} +1 -1
- package/dist/client/assets/{avatar-CtVVLapD.js → avatar-BnBqk-2k.js} +1 -1
- package/dist/client/assets/{badge-BFvLiE20.js → badge-CpxlbcB7.js} +1 -1
- package/dist/client/assets/{block-document-CZwjF0EN.js → block-document-DJ0g8qfo.js} +2 -2
- package/dist/client/assets/{brand-context-Dc4UEvfb.js → brand-context-COIa0n8O.js} +1 -1
- package/dist/client/assets/{buckets-CY1G8BoT.js → buckets-BINQS-Su.js} +1 -1
- package/dist/client/assets/{capability-load-error-CNUOCvDx.js → capability-load-error-HdFgr5IE.js} +1 -1
- package/dist/client/assets/{card-DZtTT5Es.js → card-DQnbTJFb.js} +1 -1
- package/dist/client/assets/category-editor-vCwJctBK.js +1 -0
- package/dist/client/assets/{chat-context-Dqu5Dj_J.js → chat-context-CmZjYRTw.js} +1 -1
- package/dist/client/assets/{checkbox-CHXOcnVE.js → checkbox-DokO2DXd.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BSe4zAji.js → cli-auth-success-NPtl5xjH.js} +1 -1
- package/dist/client/assets/collection-detail-DgzIzvmX.js +1 -0
- package/dist/client/assets/{collection-display-button-Dn_LJLmj.js → collection-display-button-hKaFuGbc.js} +1 -1
- package/dist/client/assets/{collection-search-D6nD206z.js → collection-search-9oxtR-cY.js} +1 -1
- package/dist/client/assets/{collection-tabs-cs02GObx.js → collection-tabs-CvHGsfW_.js} +1 -1
- package/dist/client/assets/{command-DhLgZpjn.js → command-Bw5g6PzP.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CTTgJmu9.js → commerce-onboarding-QQ9bqrwx.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DNAK4U2K.js → connect-desktop-dialog-BktLGd3J.js} +1 -1
- package/dist/client/assets/{connection-card-BwnCXxRf.js → connection-card-BZz5WDR5.js} +1 -1
- package/dist/client/assets/connection-detail-DNAdeiIH.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Csy5hutj.js → connection-form-helpers-CltinQul.js} +1 -1
- package/dist/client/assets/connections-BSiahnsQ.js +1 -0
- package/dist/client/assets/context-menu-ByPsUX7u.js +1 -0
- package/dist/client/assets/{decopilot-CLVJpS6M.js → decopilot-DjAEZRNX.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-_mJQvJZ7.js → decopilot-sse-pool-R-AtQW2s.js} +1 -1
- package/dist/client/assets/{dialog-AE8ChAe3.js → dialog-L9SFsS1U.js} +1 -1
- package/dist/client/assets/{domain-settings-Dika0U17.js → domain-settings-BDbjH98X.js} +1 -1
- package/dist/client/assets/{drawer-Di9WrlRG.js → drawer-D-LP9Hh8.js} +1 -1
- package/dist/client/assets/{dropdown-menu-ecBYljKf.js → dropdown-menu-ByaGrYAQ.js} +1 -1
- package/dist/client/assets/{empty-state-CegPWPc0.js → empty-state-BoeIt5Fh.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BumzxLvt.js → extract-connection-data-Rczvmr_Y.js} +1 -1
- package/dist/client/assets/file-explorer-QNJW4EAt.js +2 -0
- package/dist/client/assets/{file-type-icon-BOraV8Gq.js → file-type-icon-C96ES1WD.js} +1 -1
- package/dist/client/assets/{files-7E0LjJ-5.js → files-CK2ZpMSb.js} +1 -1
- package/dist/client/assets/{form-teSq_9QK.js → form-Ci3Mfx5E.js} +1 -1
- package/dist/client/assets/{general-DCnSVDK9.js → general-Dt135lsN.js} +1 -1
- package/dist/client/assets/{github-repo-picker-LA1Jld2f.js → github-repo-picker-CLrsrBV_.js} +1 -1
- package/dist/client/assets/{hooks-DwlYXenh.js → hooks-BBwQx9Hj.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-D3BPX6JW.js → import-from-deco-dialog-D3nDDNau.js} +1 -1
- package/dist/client/assets/{index-CKtGWWKI.js → index-28ylgXoe.js} +2 -2
- package/dist/client/assets/{index-DnokqHCE.js → index-B-wtw2cV.js} +3 -3
- package/dist/client/assets/{index-3BvM9m2F.js → index-BRqNUInJ.js} +1 -1
- package/dist/client/assets/{index-DJiEBchG.js → index-BYWWr4r7.js} +1 -1
- package/dist/client/assets/index-Bh2oT8fz.css +1 -0
- package/dist/client/assets/index-CuZWA4Jo.js +1 -0
- package/dist/client/assets/index-D4eNxtKO.js +503 -0
- package/dist/client/assets/{index-DR6YHYZo.js → index-DF_aAsrE.js} +1 -1
- package/dist/client/assets/{index-dCmm-GRp.js → index-DM3CipuA.js} +1 -1
- package/dist/client/assets/{index-C4YdUUl9.js → index-DUXTdmoE.js} +1 -1
- package/dist/client/assets/{index-UyzF2Wxm.js → index-DrM3Gy-E.js} +3 -3
- package/dist/client/assets/{index-DnjeTCJ0.js → index-Dtsr5F6p.js} +1 -1
- package/dist/client/assets/{index-BonkSf20.js → index-JnEot5Hj.js} +1 -1
- package/dist/client/assets/index-Y9nbouYw.js +1 -0
- package/dist/client/assets/{index-DnCrG3F_.js → index-_BBnqQdQ.js} +1 -1
- package/dist/client/assets/{index-redirect-CiKtg2BH.js → index-redirect-DmPoZnz_.js} +1 -1
- package/dist/client/assets/{input-CTZybS4f.js → input-BiM4A7Ep.js} +1 -1
- package/dist/client/assets/{integration-icon-CslqVkci.js → integration-icon-g_GK3RAr.js} +1 -1
- package/dist/client/assets/{label-Djcog1jo.js → label-CjJncELr.js} +1 -1
- package/dist/client/assets/{login-E5h2Z5UF.js → login-BOHERlR0.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BcPuGj2k.js → mcp-oauth-CEKI9gHX.js} +1 -1
- package/dist/client/assets/{members-w9nno9lo.js → members-BRt8WHan.js} +1 -1
- package/dist/client/assets/{monaco-editor-DnGtg8Ra.js → monaco-editor-BiUexVQ3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BqgDsRP3.js → monitoring-stats-row-CwoDwl1p.js} +1 -1
- package/dist/client/assets/{oauth-callback-azsKM8N9.js → oauth-callback-BuVPnEYV.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DUI7fLPI.js → oauth-callback-ai-provider-YJv6IQM9.js} +1 -1
- package/dist/client/assets/{onboarding-DQTGvP19.js → onboarding-CYpSkBDm.js} +1 -1
- package/dist/client/assets/{org-install-BIHuRdOB.js → org-install-DCy7wocy.js} +1 -1
- package/dist/client/assets/{org-layout-enkFWMsq.js → org-layout-RT_U7zH8.js} +1 -1
- package/dist/client/assets/{organization-choice-CqCgStKm.js → organization-choice-bTsrQb1b.js} +1 -1
- package/dist/client/assets/page-seo-form-oftq8ir_.js +1 -0
- package/dist/client/assets/page-seo-sheet-CAgRh54V.js +1 -0
- package/dist/client/assets/{popover-DG0h5msu.js → popover-CdhOYhn4.js} +1 -1
- package/dist/client/assets/post-editor-B3gQokNp.js +1 -0
- package/dist/client/assets/{preview-dialog-Bnu3vr0P.js → preview-dialog-vDgojfWg.js} +2 -2
- package/dist/client/assets/{primitives-BVa9_bXR.js → primitives-CPVg2JCk.js} +1 -1
- package/dist/client/assets/{profile-Dp5DSYPN.js → profile-C8hjNf5c.js} +1 -1
- package/dist/client/assets/project-app-view-CVZVC5T9.js +1 -0
- package/dist/client/assets/record-editor-BZDypwa5.js +1 -0
- package/dist/client/assets/registry-BSMljcPA.js +2 -0
- package/dist/client/assets/{registry-layout-DSIR5CP1.js → registry-layout-BuJ69l8z.js} +1 -1
- package/dist/client/assets/{require-capability-Cj0iYy81.js → require-capability-7xlqOMAl.js} +1 -1
- package/dist/client/assets/{required-auth-layout-clm6boiC.js → required-auth-layout-DMkbzFqw.js} +1 -1
- package/dist/client/assets/{reset-password-B-IQNmbh.js → reset-password-CANGclZQ.js} +1 -1
- package/dist/client/assets/{roles-Cba1TfDM.js → roles-BsbFpQdA.js} +1 -1
- package/dist/client/assets/{save-status-CDIs_R_V.js → save-status-BZrjQZNL.js} +1 -1
- package/dist/client/assets/{scroll-area-BBReqUns.js → scroll-area-DaDHqFsI.js} +2 -2
- package/dist/client/assets/{search-input-D9asghaf.js → search-input-CA0juGKQ.js} +1 -1
- package/dist/client/assets/{secrets-CN8bUJoZ.js → secrets-2KI9BQIB.js} +1 -1
- package/dist/client/assets/sections-editor-DAz_riff.js +2 -0
- package/dist/client/assets/{select-CYFnhI-Q.js → select-lfhjFS6i.js} +1 -1
- package/dist/client/assets/{select-model-35S1fWTq.js → select-model-DhPTkTLZ.js} +1 -1
- package/dist/client/assets/seo-editor-qYixYUVP.js +1 -0
- package/dist/client/assets/{settings-layout-BBO5MmT3.js → settings-layout-D8_yU3Dv.js} +1 -1
- package/dist/client/assets/{settings-section-DOlV_atx.js → settings-section-uGwPOE8T.js} +1 -1
- package/dist/client/assets/{sheet-DALs-qBg.js → sheet-nKeubIDJ.js} +1 -1
- package/dist/client/assets/{shell-controls-B6QkcDFu.js → shell-controls-Nhg6txWq.js} +1 -1
- package/dist/client/assets/{shell-layout-Ch8BfEKU.js → shell-layout-DJP1UAvL.js} +1 -1
- package/dist/client/assets/{shell-route-loading-RsrwOcS1.js → shell-route-loading-BQkX9uZV.js} +1 -1
- package/dist/client/assets/{sidebar-hZIrovG4.js → sidebar-BDxhgXc-.js} +1 -1
- package/dist/client/assets/{skeleton-BqZgigOh.js → skeleton-CQjs3VsL.js} +1 -1
- package/dist/client/assets/sortable.esm-DaR8hxU_.js +5 -0
- package/dist/client/assets/{sso-BXwKoXqN.js → sso-hQT21VNe.js} +1 -1
- package/dist/client/assets/{store-CRZGNrMb.js → store-BEmqzV80.js} +1 -1
- package/dist/client/assets/store-registry-BoeF7jFP.js +2 -0
- package/dist/client/assets/{studio-tools-C1AZbzwg.js → studio-tools-CAUx-JUt.js} +1 -1
- package/dist/client/assets/{switch-DRDIUTD7.js → switch-Vf_P6Fjw.js} +1 -1
- package/dist/client/assets/{table-tYYVDDAQ.js → table-Df43OI16.js} +1 -1
- package/dist/client/assets/{tabs-D__sk4iN.js → tabs-B7LOh75O.js} +1 -1
- package/dist/client/assets/{task-status-CftQiZKN.js → task-status-CNl7XTqg.js} +1 -1
- package/dist/client/assets/{textarea-DmmCVjU6.js → textarea-CoSni5ST.js} +1 -1
- package/dist/client/assets/{toggle-group-5CInie8P.js → toggle-group-Dpya1ElG.js} +1 -1
- package/dist/client/assets/{toolbar-Bm-rdLjh.js → toolbar-C-FtiPvy.js} +1 -1
- package/dist/client/assets/{tooltip-C7L4o0rn.js → tooltip-Cs_BNuMF.js} +1 -1
- package/dist/client/assets/{types-CppGS_VJ.js → types-GBPItn3L.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Deso-Vyj.js → use-ai-providers-Cyy4e6Er.js} +1 -1
- package/dist/client/assets/{use-automations-DdPVJNl5.js → use-automations-jx__re2k.js} +1 -1
- package/dist/client/assets/{use-capability-CGVlaZtI.js → use-capability-_e3uVe_7.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Bp0qVbdD.js → use-clock-tick-g2v6P087.js} +1 -1
- package/dist/client/assets/{use-collections-CXeEMOwb.js → use-collections-B_GMLsdD.js} +1 -1
- package/dist/client/assets/{use-connection-DqvYiUe3.js → use-connection-DKt0DY8s.js} +1 -1
- package/dist/client/assets/{use-copy-H4KuRxx2.js → use-copy-CgtuLhVL.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp--tV5feR-.js → use-create-virtual-mcp-3Gcq1gem.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Ct9kek4B.js → use-debounced-autosave-EPMbx34N.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B2XplI5F.js → use-delete-connection-CWY-Tuh_.js} +1 -1
- package/dist/client/assets/{use-file-configs-CJ5VKJt7.js → use-file-configs-Ci1h3IZS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BpnVw1p2.js → use-infinite-scroll-Dt6SxdrG.js} +1 -1
- package/dist/client/assets/{use-join-requests-rgaNUN9B.js → use-join-requests-Dtt8rzJS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cv0jyhEU.js → use-mcp-client-lyJJArps.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CPZOOi8c.js → use-mcp-prompts-82Xtua4M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-z50pjVux.js → use-mcp-tools-CdHM3tvY.js} +1 -1
- package/dist/client/assets/{use-members-jM6HOjam.js → use-members-CR5Y6qBg.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CytgRfBH.js → use-navigate-to-agent-DKc1WVEH.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DjPrRX3t.js → use-org-auth-client-DyCA15LL.js} +1 -1
- package/dist/client/assets/{use-org-sso-QBVELOwd.js → use-org-sso-DzO_wPSE.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DHxcYiQL.js → use-organization-roles-CfNQzskd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DPqJ7ETy.js → use-organization-settings-DmFrFel5.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DQ1fpeHW.js → use-registry-connections-grv_p5nm.js} +1 -1
- package/dist/client/assets/{use-secrets-C3RMGjE2.js → use-secrets-DzWb-lJi.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BaJ0EN3G.js → use-status-sounds-CeAiKW9f.js} +1 -1
- package/dist/client/assets/{use-view-mode-DMk0VP0I.js → use-view-mode-PWJQxDpL.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-iRRxKkRN.js → use-virtual-mcp-Bglvu7_H.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-v9qNAGwf.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Bu3QWDEr.js +1 -0
- package/dist/client/assets/{variant-calendar-Cn9DL04u.js → variant-calendar-BwPeBwqf.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DnLJJSFI.js → view-mode-toggle-B_Gx2-J_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-BBef0kzW.js +0 -1
- package/dist/client/assets/app-editor-DB3LZKk9.js +0 -1
- package/dist/client/assets/automation-runs-CNqGFhXQ.js +0 -1
- package/dist/client/assets/calendar-Cof0eQRR.js +0 -1
- package/dist/client/assets/category-editor-CqVdn-A-.js +0 -1
- package/dist/client/assets/collection-detail-CGFO7Nxa.js +0 -1
- package/dist/client/assets/connection-detail-jhV3T5Vf.js +0 -1
- package/dist/client/assets/connections-RSAnGIGn.js +0 -1
- package/dist/client/assets/context-menu-CwmbYH1X.js +0 -1
- package/dist/client/assets/file-explorer-pkuer-wd.js +0 -2
- package/dist/client/assets/image-field-ycul5miD.js +0 -1
- package/dist/client/assets/index-BB0hMJf7.js +0 -1
- package/dist/client/assets/index-Bcj3iVpr.js +0 -1
- package/dist/client/assets/index-CqVkj8du.js +0 -502
- package/dist/client/assets/index-wICsQ-2V.css +0 -1
- package/dist/client/assets/page-seo-form-CLI6M5cV.js +0 -1
- package/dist/client/assets/page-seo-sheet-ClPikk0g.js +0 -1
- package/dist/client/assets/post-editor-BVwj0umw.js +0 -1
- package/dist/client/assets/project-app-view-r7Nmocf7.js +0 -1
- package/dist/client/assets/record-editor-DoT_RQtf.js +0 -1
- package/dist/client/assets/registry-Do0X3IQW.js +0 -2
- package/dist/client/assets/save-referenced-block-BJospazn.js +0 -1
- package/dist/client/assets/schema-form-B6Wg-hy1.js +0 -2
- package/dist/client/assets/sections-editor-BojFR4GO.js +0 -2
- package/dist/client/assets/seo-editor-DBNUZ0fG.js +0 -1
- package/dist/client/assets/sortable.esm-BtnRUgUU.js +0 -5
- package/dist/client/assets/store-registry-C5xb_cZe.js +0 -2
- package/dist/client/assets/use-deco-credits-rzfxapgg.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DVN2QYOz.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BKCXXvPp.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as P,r as M,y as xc,C as ah,E as ch,j as p,B as lr,z as Ol,bK as bc,bL as uh,aO as dh,af as rn,bM as fh,l as Z,q as hh,P as $t,Q as Ot,V as kr,$ as ph,ai as mh,W as hn,bN as kc,U as Sc,v as zt,m as gh,d as yh,K as Kt,t as zi,k as Co,b as Ln,a2 as xh,ac as vc,bO as To,ah as bh,bP as Ut}from"./index-UyzF2Wxm.js";import{f as kh,M as Sh,d as vh,ae as wh,W as Ch,V as Th,U as Nh,ab as wc,af as Mh,ag as Eh,A as Cc,ah as it,ai as Ah,aj as Oh,ak as Ih,j as Rh}from"./agent-icon-BMQHBhP6.js";import{t as Fs}from"./Stars01-PS518Jif.js";import{i as Tc,t as jh,d as Nc,b as Er}from"./XCircle-B88UxHjD.js";import{i as No}from"./ChevronUp-_gM_dQkt.js";import{i as Il}from"./ChevronRight-D1duQehP.js";import{a as Mc,s as Dh}from"./Eye-SUXNGsVY.js";import{a as Pt,u as Ec,t as Ac,c as Rl}from"./use-clock-tick-Bp0qVbdD.js";import{u as Oc}from"./use-copy-H4KuRxx2.js";import{T as sn,a as on,b as ln}from"./tooltip-C7L4o0rn.js";import{M as Mo,I as Ic,F as Ph}from"./file-type-icon-BOraV8Gq.js";import{c as Lh}from"./content-blocks-o63cs2vh.js";import{g as Rc,M as _h}from"./types-CppGS_VJ.js";import{S as $h,f as _n,h as zh,c as Eo,a as Bh,u as Fh}from"./chat-context-Dqu5Dj_J.js";import{c as Hh,r as Vh,R as Wh}from"./hooks-DwlYXenh.js";import{u as Uh}from"./studio-tools-C1AZbzwg.js";import{f as qh,k as Kh,l as Jh}from"./tab-id-BptcWVWa.js";import{e as Gh,u as jc,l as Xh}from"./use-mcp-client-Cv0jyhEU.js";import{i as Dc}from"./AlertCircle-Diz6uT7Y.js";import{s as Jr,t as Pc}from"./Star01-Ds91SJzA.js";import{s as Yh}from"./XClose-DcfEQwVh.js";import{n as Bi}from"./ZapSquare-BfSTQonf.js";import{n as Lc,i as Qh}from"./Globe01-CNw0uMhK.js";import{b as Zh,i as ep,a as Ar}from"./Tool01-BgzvuPeY.js";import{b as jl,a as tp}from"./ZoomOut-Csc4IU4b.js";import{i as Gn}from"./Monitor01-Uh-3HvZI.js";import{i as np}from"./SearchMd-B-bL1wjq.js";import{i as rp}from"./Upload01-BA5iKtAl.js";import{b as sp,c as ip}from"./shell-layout-Ch8BfEKU.js";import{n as _c}from"./LinkExternal01-B8zRpPza.js";import{b as op,S as lp,c as ap,d as cp}from"./sheet-DALs-qBg.js";import{I as Sr}from"./integration-icon-CslqVkci.js";import{a as up}from"./use-virtual-mcp-iRRxKkRN.js";import{i as dp}from"./ArrowUpRight-Bo4YThIl.js";import{a as Ao}from"./Users03-ClWrctLP.js";import{a as ot}from"./Palette-Du66341h.js";import{m as $c}from"./use-navigate-to-agent-CytgRfBH.js";import{a as fp}from"./use-connection-DqvYiUe3.js";import{a as hp}from"./Stars02-CVb_b-OZ.js";import{g as pp}from"./use-mcp-prompts-CPZOOi8c.js";import{a as mp,D as gp,e as yp,c as xp,d as bp}from"./dialog-AE8ChAe3.js";import{a as kp,F as Sp,b as vp,c as wp,d as Cp,f as Tp}from"./form-teSq_9QK.js";import{I as Np}from"./input-CTZybS4f.js";import{t as Mp}from"./ChevronDown-C_njLrOU.js";import{e as Ep}from"./select-CYFnhI-Q.js";const Ap={openrouter:n=>{const e=n?.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 zc(n){if(!n?.providerMetadata)return 0;for(const e of Object.values(Ap)){const t=e(n.providerMetadata);if(t!==null)return t}return 0}function Bc(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Fc(n,e){if(!e)return n;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:n.inputTokens+(e.inputTokens??0),outputTokens:n.outputTokens+(e.outputTokens??0),reasoningTokens:n.reasoningTokens+(e.reasoningTokens??0),totalTokens:n.totalTokens+(e.totalTokens??0),cost:n.cost+zc(e),cacheReadTokens:n.cacheReadTokens+t,cacheWriteTokens:n.cacheWriteTokens+r}}function gw(n){return n.reduce((e,t)=>Fc(e,t.metadata?.usage),Bc())}function Op(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Oo(n){if(n&&typeof n=="object"&&"gatewayClientId"in n&&typeof n.gatewayClientId=="string")return n.gatewayClientId}function Io(n,e){if(!e)return n;const t=`${Op(e)}_`;return n.startsWith(t)?n.slice(t.length):n}function Ip(n,e){return Io(n,e).replace(/[_-]/g," ").toLowerCase()}function Rp(n){const e={};for(const t of n.arguments??[])e[t.name]=t.required?Ol().min(1,"Required"):Ol();return xc(e)}function jp(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function Dp(n){const e=P.c(66),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:i}=n,o=M.useId();let l;if(e[0]!==t){const $=t?Rp(t):xc({});l=ah($),e[0]=t,e[1]=l}else l=e[1];const c=l;let u;e[2]!==i||e[3]!==t?(u=t?jp(t,i):{},e[2]=i,e[3]=t,e[4]=u):u=e[4];let d;e[5]!==c||e[6]!==u?(d={resolver:c,defaultValues:u,mode:"onChange"},e[5]=c,e[6]=u,e[7]=d):d=e[7];const f=ch(d);let h;e[8]!==t?.arguments?(h=t?.arguments??[],e[8]=t?.arguments,e[9]=h):h=e[9];const m=h;let g;e[10]!==f||e[11]!==s||e[12]!==r?(g=async $=>{await s($),r(null),f.reset()},e[10]=f,e[11]=s,e[12]=r,e[13]=g):g=e[13];const y=g;let x;e[14]!==f||e[15]!==r?(x=$=>{$||(f.reset(),r(null))},e[14]=f,e[15]=r,e[16]=x):x=e[16];const b=x;if(!t)return null;let S;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(S=t.title||Ip(t.name,Oo(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=S):S=e[20];let v;e[21]!==S?(v=p.jsx(mp,{children:p.jsx("span",{className:"capitalize",children:S})}),e[21]=S,e[22]=v):v=e[22];let k;e[23]!==t.description?(k=t.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=k):k=e[24];let C;e[25]!==k||e[26]!==v?(C=p.jsxs(gp,{children:[v,k]}),e[25]=k,e[26]=v,e[27]=C):C=e[27];let w;e[28]!==f||e[29]!==y?(w=$=>{$.stopPropagation(),f.handleSubmit(y)($)},e[28]=f,e[29]=y,e[30]=w):w=e[30];let T;if(e[31]!==m||e[32]!==f.control||e[33]!==f.formState.isSubmitting){let $;e[35]!==f.control||e[36]!==f.formState.isSubmitting?($=B=>p.jsx(Sp,{control:f.control,name:B.name,render:J=>{const{field:Y}=J;return p.jsxs(vp,{children:[p.jsxs(wp,{className:"text-xs",children:[B.name,B.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),p.jsx(Cp,{children:p.jsx(Np,{...Y,value:Y.value??"",required:B.required,placeholder:B.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),p.jsx(Tp,{})]})}},B.name),e[35]=f.control,e[36]=f.formState.isSubmitting,e[37]=$):$=e[37],T=m.map($),e[31]=m,e[32]=f.control,e[33]=f.formState.isSubmitting,e[34]=T}else T=e[34];let N;e[38]!==b?(N=()=>b(!1),e[38]=b,e[39]=N):N=e[39];let E;e[40]!==f.formState.isSubmitting||e[41]!==N?(E=p.jsx(lr,{type:"button",variant:"ghost",onClick:N,disabled:f.formState.isSubmitting,children:"Cancel"}),e[40]=f.formState.isSubmitting,e[41]=N,e[42]=E):E=e[42];let j;e[43]!==f.formState.isSubmitting?(j=f.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx($h,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=f.formState.isSubmitting,e[44]=j):j=e[44];let L;e[45]!==f.formState.isSubmitting||e[46]!==o||e[47]!==j?(L=p.jsx(lr,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:j}),e[45]=f.formState.isSubmitting,e[46]=o,e[47]=j,e[48]=L):L=e[48];let O;e[49]!==E||e[50]!==L?(O=p.jsxs(yp,{children:[E,L]}),e[49]=E,e[50]=L,e[51]=O):O=e[51];let D;e[52]!==o||e[53]!==w||e[54]!==T||e[55]!==O?(D=p.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:w,children:[T,O]}),e[52]=o,e[53]=w,e[54]=T,e[55]=O,e[56]=D):D=e[56];let R;e[57]!==f||e[58]!==D?(R=p.jsx(kp,{...f,children:D}),e[57]=f,e[58]=D,e[59]=R):R=e[59];let F;e[60]!==C||e[61]!==R?(F=p.jsxs(xp,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[C,R]}),e[60]=C,e[61]=R,e[62]=F):F=e[62];let z;return e[63]!==b||e[64]!==F?(z=p.jsx(bp,{open:!0,onOpenChange:b,children:F}),e[63]=b,e[64]=F,e[65]=z):z=e[65],z}function Hc(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function tt(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function $n(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function Te(n){this.content=n}Te.prototype={constructor:Te,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Te(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Te(t)},addToStart:function(n,e){return new Te([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Te(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Te(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Te.from(n),n.size?new Te(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Te.from(n),n.size?new Te(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Te.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Te.from=function(n){if(n instanceof Te)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Te(e)};function Vc(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Vc(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wc(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wc(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class A{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new A(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new A(r,s)}cutByIndex(e,t){return e==t?A.empty:e==0&&t==this.content.length?this:new A(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new A(s,i)}addToStart(e){return new A([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new A(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Vc(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wc(this,e,t,r)}findIndex(e){if(e==0)return Or(0,e);if(e==this.size)return Or(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Or(t+1,i):Or(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return A.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new A(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return A.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new A(t||e,r)}static from(e){if(!e)return A.empty;if(e instanceof A)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new A([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}A.empty=new A([],0);const ci={index:0,offset:0};function Or(n,e){return ci.index=n,ci.offset=e,ci}function Gr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Gr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Gr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ne=class Fi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Fi.none;if(e instanceof Fi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};ne.none=[];class Xr extends Error{}class _{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=qc(this.content,e+this.openStart,t);return r&&new _(r,this.openStart,this.openEnd)}removeBetween(e,t){return new _(Uc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return _.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new _(A.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new _(e,r,s)}}_.empty=new _(A.empty,0,0);function Uc(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Uc(i.content,e-s-1,t-s-1)))}function qc(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=qc(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Pp(n,e,t){if(t.openStart>n.depth)throw new Xr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Xr("Inconsistent open depths");return Kc(n,e,t,0)}function Kc(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kc(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Zt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Lp(t,n);return Zt(i,Gc(n,o,l,e,r))}else return Zt(i,Yr(n,e,r))}function Jc(n,e){if(!e.type.compatibleContent(n.type))throw new Xr("Cannot join "+e.type.name+" onto "+n.type.name)}function Hi(n,e,t){let r=n.node(t);return Jc(r,e.node(t)),r}function Qt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Xn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Qt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Qt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Qt(e.nodeBefore,r)}function Zt(n,e){return n.type.checkContent(e),n.copy(e)}function Gc(n,e,t,r,s){let i=n.depth>s&&Hi(n,e,s+1),o=r.depth>s&&Hi(t,r,s+1),l=[];return Xn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jc(i,o),Qt(Zt(i,Gc(n,e,t,r,s+1)),l)):(i&&Qt(Zt(i,Yr(n,e,s+1)),l),Xn(e,t,s,l),o&&Qt(Zt(o,Yr(t,r,s+1)),l)),Xn(r,null,s,l),new A(l)}function Yr(n,e,t){let r=[];if(Xn(null,n,t,r),n.depth>t){let s=Hi(n,e,t+1);Qt(Zt(s,Yr(n,e,t+1)),r)}return Xn(e,null,t,r),new A(r)}function Lp(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(A.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class ar{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return ne.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Qr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new ar(t,r,i)}static resolveCached(e,t){let r=Dl.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Dl.set(e,r=new _p);let s=r.elts[r.i]=ar.resolve(e,t);return r.i=(r.i+1)%$p,s}}class _p{constructor(){this.elts=[],this.i=0}}const $p=12,Dl=new WeakMap;class Qr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const zp=Object.create(null);class et{constructor(e,t,r,s=ne.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||A.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Gr(this.attrs,t||e.defaultAttrs||zp)&&ne.sameSet(this.marks,r||ne.none)}copy(e=null){return e==this.content?this:new et(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new et(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return _.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new _(c,s.depth-o,i.depth-o)}replace(e,t,r){return Pp(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return ar.resolveCached(this,e)}resolveNoCache(e){return ar.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Xc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=A.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ne.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ne.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=A.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}et.prototype.text=void 0;class Zr extends et{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Xc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Zr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Xc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class an{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Bp(e,t);if(r.next==null)return an.empty;let s=Yc(r);r.next&&r.err("Unexpected trailing text");let i=Kp(qp(s));return Jp(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return A.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
1
|
+
import{c as P,r as M,y as xc,C as ah,E as ch,j as p,B as lr,z as Ol,bL as bc,bM as uh,aO as dh,af as rn,bN as fh,l as Z,q as hh,P as $t,Q as Ot,V as kr,$ as ph,ai as mh,W as hn,bO as kc,U as Sc,v as zt,m as gh,d as yh,K as Kt,t as zi,k as Co,b as Ln,a2 as xh,ac as vc,bP as To,ah as bh,bQ as Ut}from"./index-DrM3Gy-E.js";import{f as kh,M as Sh,d as vh,al as wh,a1 as Ch,a0 as Th,$ as Nh,ai as wc,am as Mh,an as Eh,A as Cc,ao as it,ap as Ah,aq as Oh,ar as Ih,j as Rh}from"./agent-icon-B8qJNw4_.js";import{t as Fs}from"./Stars01-a6WqibZn.js";import{i as Tc,t as jh,d as Nc,b as Er}from"./XCircle-DtHr5hnB.js";import{i as No}from"./ChevronUp-BurUkCqE.js";import{i as Il}from"./ChevronRight-CmB8MBzZ.js";import{a as Mc,s as Dh}from"./Eye-B8NUm9Br.js";import{a as Pt,u as Ec,t as Ac,c as Rl}from"./use-clock-tick-g2v6P087.js";import{u as Oc}from"./use-copy-CgtuLhVL.js";import{T as sn,a as on,b as ln}from"./tooltip-Cs_BNuMF.js";import{M as Mo,I as Ic,F as Ph}from"./file-type-icon-C96ES1WD.js";import{c as Lh}from"./content-blocks-o63cs2vh.js";import{g as Rc,M as _h}from"./types-GBPItn3L.js";import{S as $h,f as _n,h as zh,c as Eo,a as Bh,u as Fh}from"./chat-context-CmZjYRTw.js";import{c as Hh,r as Vh,R as Wh}from"./hooks-BBwQx9Hj.js";import{u as Uh}from"./studio-tools-CAUx-JUt.js";import{f as qh,k as Kh,l as Jh}from"./tab-id-BptcWVWa.js";import{e as Gh,u as jc,l as Xh}from"./use-mcp-client-lyJJArps.js";import{i as Dc}from"./AlertCircle-CzPpSV3W.js";import{s as Jr,t as Pc}from"./Star01-CaB7lNB9.js";import{s as Yh}from"./XClose-qpXD94Yo.js";import{n as Bi}from"./ZapSquare-C2q_71C5.js";import{n as Lc,i as Qh}from"./Globe01-BG9Wm5DJ.js";import{c as Zh,b as ep,a as Ar}from"./Tool01-CTw8qR4v.js";import{b as jl,a as tp}from"./ZoomOut-DHX-bR9F.js";import{i as Gn}from"./Monitor01-D_VMj6ZB.js";import{i as np}from"./SearchMd-DaWHy1GV.js";import{i as rp}from"./Upload01-DwgHgRix.js";import{b as sp,c as ip}from"./shell-layout-DJP1UAvL.js";import{n as _c}from"./LinkExternal01-D0OVTAOa.js";import{b as op,S as lp,c as ap,d as cp}from"./sheet-nKeubIDJ.js";import{I as Sr}from"./integration-icon-g_GK3RAr.js";import{a as up}from"./use-virtual-mcp-Bglvu7_H.js";import{i as dp}from"./ArrowUpRight-BefNTATY.js";import{a as Ao}from"./Users03-9LUo_raC.js";import{a as ot}from"./Palette-BmXFbt3l.js";import{m as $c}from"./use-navigate-to-agent-DKc1WVEH.js";import{a as fp}from"./use-connection-DKt0DY8s.js";import{a as hp}from"./Stars02-D2Vky1vN.js";import{g as pp}from"./use-mcp-prompts-82Xtua4M.js";import{a as mp,D as gp,e as yp,c as xp,d as bp}from"./dialog-L9SFsS1U.js";import{a as kp,F as Sp,b as vp,c as wp,d as Cp,f as Tp}from"./form-Ci3Mfx5E.js";import{I as Np}from"./input-BiM4A7Ep.js";import{t as Mp}from"./ChevronDown-Di-ZHzN-.js";import{e as Ep}from"./select-lfhjFS6i.js";const Ap={openrouter:n=>{const e=n?.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 zc(n){if(!n?.providerMetadata)return 0;for(const e of Object.values(Ap)){const t=e(n.providerMetadata);if(t!==null)return t}return 0}function Bc(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Fc(n,e){if(!e)return n;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:n.inputTokens+(e.inputTokens??0),outputTokens:n.outputTokens+(e.outputTokens??0),reasoningTokens:n.reasoningTokens+(e.reasoningTokens??0),totalTokens:n.totalTokens+(e.totalTokens??0),cost:n.cost+zc(e),cacheReadTokens:n.cacheReadTokens+t,cacheWriteTokens:n.cacheWriteTokens+r}}function gw(n){return n.reduce((e,t)=>Fc(e,t.metadata?.usage),Bc())}function Op(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Oo(n){if(n&&typeof n=="object"&&"gatewayClientId"in n&&typeof n.gatewayClientId=="string")return n.gatewayClientId}function Io(n,e){if(!e)return n;const t=`${Op(e)}_`;return n.startsWith(t)?n.slice(t.length):n}function Ip(n,e){return Io(n,e).replace(/[_-]/g," ").toLowerCase()}function Rp(n){const e={};for(const t of n.arguments??[])e[t.name]=t.required?Ol().min(1,"Required"):Ol();return xc(e)}function jp(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function Dp(n){const e=P.c(66),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:i}=n,o=M.useId();let l;if(e[0]!==t){const $=t?Rp(t):xc({});l=ah($),e[0]=t,e[1]=l}else l=e[1];const c=l;let u;e[2]!==i||e[3]!==t?(u=t?jp(t,i):{},e[2]=i,e[3]=t,e[4]=u):u=e[4];let d;e[5]!==c||e[6]!==u?(d={resolver:c,defaultValues:u,mode:"onChange"},e[5]=c,e[6]=u,e[7]=d):d=e[7];const f=ch(d);let h;e[8]!==t?.arguments?(h=t?.arguments??[],e[8]=t?.arguments,e[9]=h):h=e[9];const m=h;let g;e[10]!==f||e[11]!==s||e[12]!==r?(g=async $=>{await s($),r(null),f.reset()},e[10]=f,e[11]=s,e[12]=r,e[13]=g):g=e[13];const y=g;let x;e[14]!==f||e[15]!==r?(x=$=>{$||(f.reset(),r(null))},e[14]=f,e[15]=r,e[16]=x):x=e[16];const b=x;if(!t)return null;let S;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(S=t.title||Ip(t.name,Oo(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=S):S=e[20];let v;e[21]!==S?(v=p.jsx(mp,{children:p.jsx("span",{className:"capitalize",children:S})}),e[21]=S,e[22]=v):v=e[22];let k;e[23]!==t.description?(k=t.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=k):k=e[24];let C;e[25]!==k||e[26]!==v?(C=p.jsxs(gp,{children:[v,k]}),e[25]=k,e[26]=v,e[27]=C):C=e[27];let w;e[28]!==f||e[29]!==y?(w=$=>{$.stopPropagation(),f.handleSubmit(y)($)},e[28]=f,e[29]=y,e[30]=w):w=e[30];let T;if(e[31]!==m||e[32]!==f.control||e[33]!==f.formState.isSubmitting){let $;e[35]!==f.control||e[36]!==f.formState.isSubmitting?($=B=>p.jsx(Sp,{control:f.control,name:B.name,render:J=>{const{field:Y}=J;return p.jsxs(vp,{children:[p.jsxs(wp,{className:"text-xs",children:[B.name,B.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),p.jsx(Cp,{children:p.jsx(Np,{...Y,value:Y.value??"",required:B.required,placeholder:B.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),p.jsx(Tp,{})]})}},B.name),e[35]=f.control,e[36]=f.formState.isSubmitting,e[37]=$):$=e[37],T=m.map($),e[31]=m,e[32]=f.control,e[33]=f.formState.isSubmitting,e[34]=T}else T=e[34];let N;e[38]!==b?(N=()=>b(!1),e[38]=b,e[39]=N):N=e[39];let E;e[40]!==f.formState.isSubmitting||e[41]!==N?(E=p.jsx(lr,{type:"button",variant:"ghost",onClick:N,disabled:f.formState.isSubmitting,children:"Cancel"}),e[40]=f.formState.isSubmitting,e[41]=N,e[42]=E):E=e[42];let j;e[43]!==f.formState.isSubmitting?(j=f.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx($h,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=f.formState.isSubmitting,e[44]=j):j=e[44];let L;e[45]!==f.formState.isSubmitting||e[46]!==o||e[47]!==j?(L=p.jsx(lr,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:j}),e[45]=f.formState.isSubmitting,e[46]=o,e[47]=j,e[48]=L):L=e[48];let O;e[49]!==E||e[50]!==L?(O=p.jsxs(yp,{children:[E,L]}),e[49]=E,e[50]=L,e[51]=O):O=e[51];let D;e[52]!==o||e[53]!==w||e[54]!==T||e[55]!==O?(D=p.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:w,children:[T,O]}),e[52]=o,e[53]=w,e[54]=T,e[55]=O,e[56]=D):D=e[56];let R;e[57]!==f||e[58]!==D?(R=p.jsx(kp,{...f,children:D}),e[57]=f,e[58]=D,e[59]=R):R=e[59];let F;e[60]!==C||e[61]!==R?(F=p.jsxs(xp,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[C,R]}),e[60]=C,e[61]=R,e[62]=F):F=e[62];let z;return e[63]!==b||e[64]!==F?(z=p.jsx(bp,{open:!0,onOpenChange:b,children:F}),e[63]=b,e[64]=F,e[65]=z):z=e[65],z}function Hc(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function tt(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function $n(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function Te(n){this.content=n}Te.prototype={constructor:Te,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Te(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Te(t)},addToStart:function(n,e){return new Te([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Te(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Te(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Te.from(n),n.size?new Te(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Te.from(n),n.size?new Te(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Te.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Te.from=function(n){if(n instanceof Te)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Te(e)};function Vc(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Vc(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wc(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wc(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class A{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new A(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new A(r,s)}cutByIndex(e,t){return e==t?A.empty:e==0&&t==this.content.length?this:new A(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new A(s,i)}addToStart(e){return new A([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new A(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Vc(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wc(this,e,t,r)}findIndex(e){if(e==0)return Or(0,e);if(e==this.size)return Or(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Or(t+1,i):Or(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return A.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new A(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return A.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new A(t||e,r)}static from(e){if(!e)return A.empty;if(e instanceof A)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new A([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}A.empty=new A([],0);const ci={index:0,offset:0};function Or(n,e){return ci.index=n,ci.offset=e,ci}function Gr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Gr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Gr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ne=class Fi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Fi.none;if(e instanceof Fi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};ne.none=[];class Xr extends Error{}class _{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=qc(this.content,e+this.openStart,t);return r&&new _(r,this.openStart,this.openEnd)}removeBetween(e,t){return new _(Uc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return _.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new _(A.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new _(e,r,s)}}_.empty=new _(A.empty,0,0);function Uc(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Uc(i.content,e-s-1,t-s-1)))}function qc(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=qc(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Pp(n,e,t){if(t.openStart>n.depth)throw new Xr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Xr("Inconsistent open depths");return Kc(n,e,t,0)}function Kc(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kc(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Zt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Lp(t,n);return Zt(i,Gc(n,o,l,e,r))}else return Zt(i,Yr(n,e,r))}function Jc(n,e){if(!e.type.compatibleContent(n.type))throw new Xr("Cannot join "+e.type.name+" onto "+n.type.name)}function Hi(n,e,t){let r=n.node(t);return Jc(r,e.node(t)),r}function Qt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Xn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Qt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Qt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Qt(e.nodeBefore,r)}function Zt(n,e){return n.type.checkContent(e),n.copy(e)}function Gc(n,e,t,r,s){let i=n.depth>s&&Hi(n,e,s+1),o=r.depth>s&&Hi(t,r,s+1),l=[];return Xn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jc(i,o),Qt(Zt(i,Gc(n,e,t,r,s+1)),l)):(i&&Qt(Zt(i,Yr(n,e,s+1)),l),Xn(e,t,s,l),o&&Qt(Zt(o,Yr(t,r,s+1)),l)),Xn(r,null,s,l),new A(l)}function Yr(n,e,t){let r=[];if(Xn(null,n,t,r),n.depth>t){let s=Hi(n,e,t+1);Qt(Zt(s,Yr(n,e,t+1)),r)}return Xn(e,null,t,r),new A(r)}function Lp(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(A.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class ar{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return ne.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Qr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new ar(t,r,i)}static resolveCached(e,t){let r=Dl.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Dl.set(e,r=new _p);let s=r.elts[r.i]=ar.resolve(e,t);return r.i=(r.i+1)%$p,s}}class _p{constructor(){this.elts=[],this.i=0}}const $p=12,Dl=new WeakMap;class Qr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const zp=Object.create(null);class et{constructor(e,t,r,s=ne.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||A.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Gr(this.attrs,t||e.defaultAttrs||zp)&&ne.sameSet(this.marks,r||ne.none)}copy(e=null){return e==this.content?this:new et(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new et(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return _.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new _(c,s.depth-o,i.depth-o)}replace(e,t,r){return Pp(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return ar.resolveCached(this,e)}resolveNoCache(e){return ar.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Xc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=A.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ne.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ne.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=A.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}et.prototype.text=void 0;class Zr extends et{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Xc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Zr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Xc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class an{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Bp(e,t);if(r.next==null)return an.empty;let s=Yc(r);r.next&&r.err("Unexpected trailing text");let i=Kp(qp(s));return Jp(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return A.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
2
2
|
`)}}an.empty=new an(!0);class Bp{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Yc(n){let e=[];do e.push(Fp(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Fp(n){let e=[];do e.push(Hp(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Hp(n){let e=Up(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Vp(n,e);else break;return e}function Pl(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Vp(n,e){let t=Pl(n),r=t;return n.eat(",")&&(n.next!="}"?r=Pl(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Wp(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function Up(n){if(n.eat("(")){let e=Yc(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Wp(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function qp(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Qc(n,e){return e-n}function Ll(n,e){let t=[];return r(e),t.sort(Qc);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function Kp(n){let e=Object.create(null);return t(Ll(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Ll(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new an(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Qc);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function Jp(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Zc(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function eu(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function tu(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function nu(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Xp(n,r,e[r]);return t}let _l=class ru{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=nu(e,r.attrs),this.defaultAttrs=Zc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==an.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:eu(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new et(this,this.computeAttrs(e),A.from(t),ne.setFrom(r))}createChecked(e=null,t,r){return t=A.from(t),this.checkContent(t),new et(this,this.computeAttrs(e),t,ne.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=A.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(A.empty,!0);return i?new et(this,e,t.append(i),ne.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){tu(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:ne.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new ru(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Gp(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class Xp{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Gp(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Hs{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=nu(e,s.attrs),this.excluded=null;let i=Zc(this.attrs);this.instance=i?new ne(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ne(this,eu(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Hs(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){tu(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class su{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Te.from(e.nodes),t.marks=Te.from(e.marks||{}),this.nodes=_l.compile(this.spec.nodes,this),this.marks=Hs.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=an.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?$l(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:$l(this,o.split(" "))}this.nodeFromJSON=s=>et.fromJSON(this,s),this.markFromJSON=s=>ne.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof _l){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new Zr(r,r.defaultAttrs,e,ne.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function $l(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Yp(n){return n.tag!=null}function Qp(n){return n.style!=null}class It{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(Yp(s))this.tags.push(s);else if(Qp(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Bl(this,t,!1);return r.addAll(e,ne.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Bl(this,t,!0);return r.addAll(e,ne.none,t.from,t.to),_.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(tm(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Fl(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Fl(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new It(e,It.schemaRules(e)))}}const iu={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Zp={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ou={ol:!0,ul:!0},cr=1,Vi=2,Yn=4;function zl(n,e,t){return e!=null?(e?cr:0)|(e==="full"?Vi:0):n&&n.whitespace=="pre"?cr|Vi:t&~Yn}class Ir{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=ne.none,this.match=i||(o&Yn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(A.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&cr)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=A.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(A.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!iu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Bl{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=zl(null,t.preserveWhitespace,0)|(r?Yn:0);s?i=new Ir(s.type,s.attrs,ne.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Ir(null,null,ne.none,!0,null,o):i=new Ir(e.schema.topNodeType,null,ne.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&Vi?"full":this.localPreserveWS||(s.options&cr)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;ou.hasOwnProperty(o)&&this.parser.normalizeLists&&em(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Zp.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(iu.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ne.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Hl(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=zl(e,i,o.options);o.options&Yn&&o.content.length==0&&(l|=Yn);let a=ne.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):Hl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Ir(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=cr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function em(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ou.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function tm(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Fl(n){let e={};for(let t in n)e[t]=n[t];return e}function Hl(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class pn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=ui(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Vr(ui(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Vr(ui(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Vr(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new pn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Vl(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Vl(e.marks)}}function Vl(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function ui(n){return n.document||window.document}const Wl=new WeakMap;function nm(n){let e=Wl.get(n);return e===void 0&&Wl.set(n,e=rm(n)),e}function rm(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Vr(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=nm(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:m}=Vr(n,f,t,r);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const lu=65535,au=Math.pow(2,16);function sm(n,e){return n+e*au}function Ul(n){return n&lu}function im(n){return(n-(n&lu))/au}const cu=1,uu=2,Wr=4,du=8;class Wi{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&du)>0}get deletedBefore(){return(this.delInfo&(cu|Wr))>0}get deletedAfter(){return(this.delInfo&(uu|Wr))>0}get deletedAcross(){return(this.delInfo&Wr)>0}}class Fe{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Fe.empty)return Fe.empty}recover(e){let t=0,r=Ul(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+im(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let m=e==(t<0?a:d)?null:sm(l/3,e-a),g=e==a?uu:e==d?cu:Wr;return(t<0?e!=a:e!=d)&&(g|=du),new Wi(h,g,m)}s+=u-c}return r?e+s:new Wi(e+s,0,null)}touches(e,t){let r=0,s=Ul(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new Fe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Fe.empty:new Fe(e<0?[0,-e,0]:[0,0,e])}}Fe.empty=new Fe([]);class ur{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new ur(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new ur;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Wi(e,s,null)}}const di=Object.create(null);class De{getMap(){return Fe.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=di[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in di)throw new RangeError("Duplicate use of step JSON ID "+e);return di[e]=t,t.prototype.jsonID=e,t}}class me{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new me(e,null)}static fail(e){return new me(null,e)}static fromReplace(e,t,r,s){try{return me.ok(e.replace(t,r,s))}catch(i){if(i instanceof Xr)return me.fail(i.message);throw i}}}function Ro(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(Ro(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return A.fromArray(r)}class Mt extends De{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new _(Ro(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return me.fromReplace(e,this.from,this.to,i)}invert(){return new Ze(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Mt(t.pos,r.pos,this.mark)}merge(e){return e instanceof Mt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Mt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Mt(t.from,t.to,e.markFromJSON(t.mark))}}De.jsonID("addMark",Mt);class Ze extends De{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new _(Ro(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return me.fromReplace(e,this.from,this.to,r)}invert(){return new Mt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ze(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ze&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ze(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ze(t.from,t.to,e.markFromJSON(t.mark))}}De.jsonID("removeMark",Ze);class Et extends De{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return me.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return me.fromReplace(e,this.pos,this.pos+1,new _(A.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Et(this.pos,t.marks[s]);return new Et(this.pos,this.mark)}}return new cn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Et(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Et(t.pos,e.markFromJSON(t.mark))}}De.jsonID("addNodeMark",Et);class cn extends De{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return me.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return me.fromReplace(e,this.pos,this.pos+1,new _(A.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Et(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new cn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new cn(t.pos,e.markFromJSON(t.mark))}}De.jsonID("removeNodeMark",cn);class pe extends De{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&Ui(e,this.from,this.to)?me.fail("Structure replace would overwrite content"):me.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Fe([this.from,this.to-this.from,this.slice.size])}invert(e){return new pe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&pe.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new pe(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof pe)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?_.empty:new _(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new pe(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?_.empty:new _(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new pe(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new pe(t.from,t.to,_.fromJSON(e,t.slice),!!t.structure)}}pe.MAP_BIAS=1;De.jsonID("replace",pe);class ve extends De{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Ui(e,this.from,this.gapFrom)||Ui(e,this.gapTo,this.to)))return me.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return me.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?me.fromReplace(e,this.from,this.to,r):me.fail("Content does not fit in gap")}getMap(){return new Fe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ve(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new ve(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ve(t.from,t.to,t.gapFrom,t.gapTo,_.fromJSON(e,t.slice),t.insert,!!t.structure)}}De.jsonID("replaceAround",ve);function Ui(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function om(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:s.push(o=new Ze(f,h,d[g])));l&&l.to==f?l.to=h:i.push(l=new Mt(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function lm(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof Hs){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let m=s[h];m.step==i-1&&d.eq(s[h].style)&&(f=m)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new Ze(o.from,o.to,o.style)))}function jo(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new pe(l,u,_.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Ze(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(c.text);)m||(m=new _(A.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new pe(l+f.index,l+f.index+f[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(A.empty,!0);n.replace(l,l,new _(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function am(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function zn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!am(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function cm(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=A.empty,d=0;for(let m=i,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=A.from(r.node(m).copy(u)),d++):a--;let f=A.empty,h=0;for(let m=i,g=!1;m>t;m--)g||s.after(m+1)<s.end(m)?(g=!0,f=A.from(s.node(m).copy(f)),h++):c++;n.step(new ve(a,c,o,l,new _(u.append(f),d,h),u.size-d,!0))}function Do(n,e,t=null,r=n){let s=um(n,e),i=s&&dm(r,e);return i?s.map(ql).concat({type:e,attrs:t}).concat(i.map(ql)):null}function ql(n){return{type:n,attrs:null}}function um(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function dm(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function fm(n,e,t){let r=A.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=A.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new ve(s,i,s,i,new _(r,0,0),t.length,!0))}function hm(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&pm(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&hu(n,o,l,i),jo(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new ve(d,f,d+1,f-1,new _(A.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&fu(n,o,l,i),!1}})}function fu(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function hu(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -185,4 +185,4 @@ Output: Tool execution was denied`)}}}return t.length>0?t.join(`
|
|
|
185
185
|
`).trim().split(`
|
|
186
186
|
`).filter(Boolean),v=s?S[S.length-1]??"":S[0]??"";c=!o&&v?v.length>100?v.slice(0,100)+"…":v:void 0,e[4]=o,e[5]=s,e[6]=r,e[7]=c}else c=e[7];const u=c;let d;if(e[8]!==o||e[9]!==r){const b=r.map(Uv).join(`
|
|
187
187
|
|
|
188
|
-
`);d=!o&&b.trim()?b:null,e[8]=o,e[9]=r,e[10]=d}else d=e[10];const f=d,h=!s&&t!=null?t/1e3:void 0;let m;e[11]!==s?(m=s?p.jsx(Fs,{className:"size-4"}):p.jsx(Ah,{className:"size-4"}),e[11]=s,e[12]=m):m=e[12];const g=s?"Thinking...":a,y=s?"loading":"idle";let x;return e[13]!==f||e[14]!==h||e[15]!==u||e[16]!==m||e[17]!==g||e[18]!==y?(x=p.jsx(wo,{icon:m,title:g,summary:u,detail:f,state:y,detailVariant:"prose",latency:h}),e[13]=f,e[14]=h,e[15]=u,e[16]=m,e[17]=g,e[18]=y,e[19]=x):x=e[19],x}function Uv(n){return n.text??""}function qv(n){return n.text??""}function Kv(n){return n.text?.includes("REDACTED")}const Jv=3;function Gv(n,e){let t=-1;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.kind==="part"&&e[s.index]?.type==="text"){t=r;break}}return t===-1?{collapsed:[],tail:n}:{collapsed:n.slice(0,t),tail:n.slice(t)}}function Xv(n,e){let t=0,r=0;for(const s of n)if(s.kind==="reasoning-group")r++;else{const i=e[s.index]?.type;i==="text"?r++:(i==="dynamic-tool"||i?.startsWith("tool-"))&&i!=="tool-todo_write"&&i!=="tool-update_interests"&&t++}return{toolCalls:t,messages:r}}function Yv(n){const e=P.c(8),{toolCalls:t,messages:r}=n;let s;e[0]!==r||e[1]!==t?(s=t>0&&p.jsxs(p.Fragment,{children:[p.jsx(Nc,{className:"size-3.5 shrink-0"}),p.jsxs("span",{children:[t," tool call",t===1?"":"s",r>0?",":""]})]}),e[0]=r,e[1]=t,e[2]=s):s=e[2];let i;e[3]!==r?(i=r>0&&p.jsxs(p.Fragment,{children:[p.jsx(Ih,{className:"size-3.5 shrink-0"}),p.jsxs("span",{children:[r," message",r===1?"":"s"]})]}),e[3]=r,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=p.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[s,i]}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function Qv(n){const e=P.c(28),{items:t,message:r,reasoningGroups:s,isReasoningActive:i,totalDuration:o,dataParts:l,isLoading:a,isLast:c}=n;let u;e[0]!==t||e[1]!==r.parts?(u=Xv(t,r.parts),e[0]=t,e[1]=r.parts,e[2]=u):u=e[2];const{toolCalls:d,messages:f}=u;if(d===0&&f===0)return null;let h;e[3]!==f||e[4]!==d?(h=p.jsx(Yv,{toolCalls:d,messages:f}),e[3]=f,e[4]=d,e[5]=h):h=e[5];let m;if(e[6]!==l||e[7]!==c||e[8]!==a||e[9]!==i||e[10]!==t||e[11]!==r||e[12]!==s||e[13]!==o){let x;e[15]!==l||e[16]!==c||e[17]!==a||e[18]!==i||e[19]!==r||e[20]!==s||e[21]!==o?(x=(b,S)=>Kf({item:b,renderIndex:S,message:r,reasoningGroups:s,isReasoningActive:i,totalDuration:o,dataParts:l,isLoading:a,isLast:c,isLastVisiblePart:!1}),e[15]=l,e[16]=c,e[17]=a,e[18]=i,e[19]=r,e[20]=s,e[21]=o,e[22]=x):x=e[22],m=t.map(x),e[6]=l,e[7]=c,e[8]=a,e[9]=i,e[10]=t,e[11]=r,e[12]=s,e[13]=o,e[14]=m}else m=e[14];let g;e[23]!==m?(g=p.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:m}),e[23]=m,e[24]=g):g=e[24];let y;return e[25]!==h||e[26]!==g?(y=p.jsx(X,{icon:null,alwaysChevron:!0,title:h,state:"idle",children:g}),e[25]=h,e[26]=g,e[27]=y):y=e[27],y}function Kf({item:n,renderIndex:e,message:t,reasoningGroups:r,isReasoningActive:s,totalDuration:i,dataParts:o,isLoading:l,isLast:a,isLastVisiblePart:c,renderOrder:u}){if(n.kind==="reasoning-group"){const{group:m}=n,g=m===r[r.length-1],y=s&&g;if(!m.parts.some(S=>S.text?.trim())&&!y)return null;const b=r.length===1?i:null;return p.jsx(Wv,{duration:b,parts:m.parts,isStreaming:y},`${t.id}-reasoning-${m.startIndex}`)}const d=t.parts[n.index],f=c||(u?u.findLastIndex(m=>m.kind==="part")===e:!1),h=f?Fc(Bc(),t.metadata?.usage):null;return p.jsx(Zv,{part:d,id:t.id,usageStats:f&&p.jsx(Lk,{usage:h,duration:i}),dataParts:o,isLoading:l,isLastMessage:a},`${t.id}-${n.index}`)}function Zv(n){const e=P.c(121),{part:t,id:r,usageStats:s,dataParts:i,isLoading:o,isLastMessage:l}=n;let a;e[0]!==i.toolMetadata?(a=f=>i.toolMetadata.get(f),e[0]=i.toolMetadata,e[1]=a):a=e[1];const c=a;let u;e[2]!==i.toolSubtaskMetadata?(u=f=>i.toolSubtaskMetadata.get(f),e[2]=i.toolSubtaskMetadata,e[3]=u):u=e[3];const d=u;switch(t.type){case"dynamic-tool":{let f;e[4]!==c||e[5]!==t.toolCallId?(f=c(t.toolCallId)?.annotations,e[4]=c,e[5]=t.toolCallId,e[6]=f):f=e[6];let h;e[7]!==c||e[8]!==t.toolCallId?(h=c(t.toolCallId)?.latencySeconds,e[7]=c,e[8]=t.toolCallId,e[9]=h):h=e[9];let m;e[10]!==c||e[11]!==t.toolCallId?(m=c(t.toolCallId)?.outputBytes,e[10]=c,e[11]=t.toolCallId,e[12]=m):m=e[12];let g;e[13]!==c||e[14]!==t.toolCallId?(g=c(t.toolCallId)?._meta,e[13]=c,e[14]=t.toolCallId,e[15]=g):g=e[15];let y;return e[16]!==l||e[17]!==t||e[18]!==f||e[19]!==h||e[20]!==m||e[21]!==g?(y=p.jsx(fc,{part:t,annotations:f,latency:h,outputBytes:m,isLastMessage:l,toolMeta:g}),e[16]=l,e[17]=t,e[18]=f,e[19]=h,e[20]=m,e[21]=g,e[22]=y):y=e[22],y}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let f;e[23]!==c||e[24]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[23]=c,e[24]=t.toolCallId,e[25]=f):f=e[25];let h;return e[26]!==t||e[27]!==f?(h=p.jsx(AS,{part:t,latency:f}),e[26]=t,e[27]=f,e[28]=h):h=e[28],h}case"tool-propose_plan":{let f;return e[29]!==t?(f=p.jsx(BS,{part:t}),e[29]=t,e[30]=f):f=e[30],f}case"tool-generate_image":{let f;e[31]!==c||e[32]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[31]=c,e[32]=t.toolCallId,e[33]=f):f=e[33];let h;return e[34]!==t||e[35]!==f?(h=p.jsx(pS,{part:t,latency:f}),e[34]=t,e[35]=f,e[36]=h):h=e[36],h}case"tool-take_screenshot":{let f;e[37]!==c||e[38]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[37]=c,e[38]=t.toolCallId,e[39]=f):f=e[39];let h;return e[40]!==t||e[41]!==f?(h=p.jsx(yS,{part:t,latency:f}),e[40]=t,e[41]=f,e[42]=h):h=e[42],h}case"tool-web_search":case"tool-deep_research":{let f;e[43]!==c||e[44]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[43]=c,e[44]=t.toolCallId,e[45]=f):f=e[45];let h;e[46]!==i.webSearchStreaming||e[47]!==t.toolCallId?(h=i.webSearchStreaming.get(t.toolCallId),e[46]=i.webSearchStreaming,e[47]=t.toolCallId,e[48]=h):h=e[48];let m;return e[49]!==t||e[50]!==f||e[51]!==h?(m=p.jsx(ES,{part:t,latency:f,streamingText:h}),e[49]=t,e[50]=f,e[51]=h,e[52]=m):m=e[52],m}case"tool-subtask":{let f;e[53]!==d||e[54]!==t.toolCallId?(f=d(t.toolCallId),e[53]=d,e[54]=t.toolCallId,e[55]=f):f=e[55];let h;e[56]!==c||e[57]!==t.toolCallId?(h=c(t.toolCallId)?.annotations,e[56]=c,e[57]=t.toolCallId,e[58]=h):h=e[58];let m;e[59]!==c||e[60]!==t.toolCallId?(m=c(t.toolCallId)?.latencySeconds,e[59]=c,e[60]=t.toolCallId,e[61]=m):m=e[61];let g;e[62]!==t||e[63]!==f||e[64]!==h||e[65]!==m?(g={part:t,subtaskMeta:f,annotations:h,latency:m},e[62]=t,e[63]=f,e[64]=h,e[65]=m,e[66]=g):g=e[66];const y=g;let x;return e[67]!==y?(x=p.jsx(M.Suspense,{fallback:p.jsx($S,{...y}),children:p.jsx(zS,{...y})}),e[67]=y,e[68]=x):x=e[68],x}case"text":{const f=!!s&&!o,h=o&&l;let m;return e[69]!==r||e[70]!==t||e[71]!==f||e[72]!==h||e[73]!==s?(m=p.jsx(ni,{id:r,part:t,extraActions:s,copyable:!0,alwaysShowActions:f,animate:h}),e[69]=r,e[70]=t,e[71]=f,e[72]=h,e[73]=s,e[74]=m):m=e[74],m}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const f=t;if(f.type==="tool-brand_context_setup"||f.type==="tool-BRAND_CONTEXT_EXTRACT"){let h;e[75]!==f.toolCallId||e[76]!==c?(h=c(f.toolCallId)?.latencySeconds,e[75]=f.toolCallId,e[76]=c,e[77]=h):h=e[77];let m;return e[78]!==f||e[79]!==h?(m=p.jsx(QS,{part:f,latency:h}),e[78]=f,e[79]=h,e[80]=m):m=e[80],m}if(f.type==="tool-BRAND_CONTEXT_GET"){let h;e[81]!==f.toolCallId||e[82]!==c?(h=c(f.toolCallId)?.latencySeconds,e[81]=f.toolCallId,e[82]=c,e[83]=h):h=e[83];let m;return e[84]!==f||e[85]!==h?(m=p.jsx(ZS,{part:f,latency:h}),e[84]=f,e[85]=h,e[86]=m):m=e[86],m}if(f.type==="tool-BRAND_CONTEXT_LIST"){let h;e[87]!==f.toolCallId||e[88]!==c?(h=c(f.toolCallId)?.latencySeconds,e[87]=f.toolCallId,e[88]=c,e[89]=h):h=e[89];let m;return e[90]!==f||e[91]!==h?(m=p.jsx(ev,{part:f,latency:h}),e[90]=f,e[91]=h,e[92]=m):m=e[92],m}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let h;e[93]!==f.toolCallId||e[94]!==c?(h=c(f.toolCallId)?.latencySeconds,e[93]=f.toolCallId,e[94]=c,e[95]=h):h=e[95];let m;return e[96]!==f||e[97]!==h?(m=p.jsx(ov,{part:f,latency:h}),e[96]=f,e[97]=h,e[98]=m):m=e[98],m}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let h;e[99]!==f.toolCallId||e[100]!==c?(h=c(f.toolCallId)?.latencySeconds,e[99]=f.toolCallId,e[100]=c,e[101]=h):h=e[101];let m;return e[102]!==f||e[103]!==h?(m=p.jsx(uv,{part:f,latency:h}),e[102]=f,e[103]=h,e[104]=m):m=e[104],m}if(f.type==="tool-COLLECTION_CONNECTIONS_LIST"){let h;e[105]!==f.toolCallId||e[106]!==c?(h=c(f.toolCallId)?.latencySeconds,e[105]=f.toolCallId,e[106]=c,e[107]=h):h=e[107];let m;return e[108]!==f||e[109]!==h?(m=p.jsx(pv,{part:f,latency:h}),e[108]=f,e[109]=h,e[110]=m):m=e[110],m}if(f.type.startsWith("tool-")){const h=f.toolCallId;let m;e[111]!==i.toolMetadata||e[112]!==h?(m=i.toolMetadata.get(h),e[111]=i.toolMetadata,e[112]=h,e[113]=m):m=e[113];const g=m,y=g?.annotations,x=g?.latencySeconds,b=g?.outputBytes,S=g?._meta;let v;return e[114]!==f||e[115]!==l||e[116]!==y||e[117]!==x||e[118]!==b||e[119]!==S?(v=p.jsx(fc,{part:f,annotations:y,latency:x,outputBytes:b,isLastMessage:l,toolMeta:S}),e[114]=f,e[115]=l,e[116]=y,e[117]=x,e[118]=b,e[119]=S,e[120]=v):v=e[120],v}if(f.type.startsWith("data-"))return null;throw new Error(`Unknown part type: ${f.type}`)}}}function e2(n){const e=P.c(2),{isRunInProgress:t}=n;if(t){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:p.jsxs("span",{className:"flex items-center gap-1.5",children:[p.jsx(Fs,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),p.jsx("span",{className:"text-[14px] text-muted-foreground shimmer",children:"Resuming task..."})]})}),e[0]=s):s=e[0],s}let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-[14px] text-muted-foreground/60 py-2",children:"No response was generated"}),e[1]=r):r=e[1],r}function t2(n){const e=P.c(7),{className:t,children:r}=n;let s;e[0]!==t?(s=Z("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==r?(i=p.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:p.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[14px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:r})}),e[2]=r,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==i?(o=p.jsx("div",{className:s,children:i}),e[4]=s,e[5]=i,e[6]=o):o=e[6],o}function n2(n){const e=P.c(42),{message:t,turnStartedAt:r,status:s,className:i,isLast:o}=n,l=o===void 0?!1:o,{isRunInProgress:a}=_n()??{},c=a===void 0?!1:a,u=Eo()?.taskId??null,d=s==="streaming",h=d||s==="submitted";let m;e[0]!==r?(m=Ac(r),e[0]=r,e[1]=m):m=e[1];const g=m;let y;e[2]!==h?(y=()=>h?Date.now():null,e[2]=h,e[3]=y):y=e[3];const[x,b]=M.useState(y),[S,v]=M.useState(h);S!==h&&(v(h),b(h?Date.now():null));const k=g??x,{reasoningGroups:C,renderOrder:w,dataParts:T}=Pv(t),N=t!==null&&w.length>0,E=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,j=d&&E?.type==="reasoning";let L;if(e[4]!==t){const G=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,ie=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;L=G!==null?ie.getTime()-G.getTime():null,e[4]=t,e[5]=L}else L=e[5];const O=L;let D;e[6]!==l||e[7]!==t?(D=!l||!t||!t.parts.some(s2),e[6]=l,e[7]=t,e[8]=D):D=e[8];const R=D;let F;e[9]!==N||e[10]!==h||e[11]!==R||e[12]!==t||e[13]!==w?(F=!h&&N&&R&&(()=>{let G=0;for(const ie of w)if(ie.kind==="part"){const re=t.parts[ie.index]?.type;(re==="dynamic-tool"||re?.startsWith("tool-"))&&G++}return G>=Jv})(),e[9]=N,e[10]=h,e[11]=R,e[12]=t,e[13]=w,e[14]=F):F=e[14];const z=F;let $,B,J;if(e[15]!==i||e[16]!==T||e[17]!==N||e[18]!==l||e[19]!==h||e[20]!==j||e[21]!==c||e[22]!==R||e[23]!==t||e[24]!==C||e[25]!==w||e[26]!==z||e[27]!==k||e[28]!==u||e[29]!==O){const{collapsed:G,tail:ie}=z?Gv(w,t.parts):{collapsed:[],tail:w};$=t2,B=i,J=N?p.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[t.metadata?.resumedFromBackground&&p.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground/60 select-none",children:[p.jsx(vc,{className:"size-3 shrink-0"}),p.jsx("span",{children:"Resumed — background task completed"})]}),G.length>0&&p.jsx(Qv,{items:G,message:t,reasoningGroups:C,isReasoningActive:j,totalDuration:O,dataParts:T,isLoading:h,isLast:l}),ie.map((re,xe)=>{const he=G.length+xe,Ce=ie.findLastIndex(r2)===xe;return Kf({item:re,renderIndex:he,message:t,reasoningGroups:C,isReasoningActive:j,totalDuration:O,dataParts:T,isLoading:h,isLast:l,isLastVisiblePart:Ce,renderOrder:w})}),u&&p.jsx(Rv,{threadId:u,message:t}),l&&h&&k!==null&&p.jsx(Fv,{startedAt:k}),l&&!h&&u&&p.jsxs(p.Fragment,{children:[p.jsx(vv,{}),R&&p.jsx(yv,{})]})]}):h?p.jsx(Vv,{startedAt:k}):p.jsx(e2,{isRunInProgress:l&&c}),e[15]=i,e[16]=T,e[17]=N,e[18]=l,e[19]=h,e[20]=j,e[21]=c,e[22]=R,e[23]=t,e[24]=C,e[25]=w,e[26]=z,e[27]=k,e[28]=u,e[29]=O,e[30]=$,e[31]=B,e[32]=J}else $=e[30],B=e[31],J=e[32];let Y;e[33]!==l||e[34]!==d||e[35]!==t?.parts?(Y=l&&d&&p.jsx(kv,{parts:t?.parts}),e[33]=l,e[34]=d,e[35]=t?.parts,e[36]=Y):Y=e[36];let Q;return e[37]!==$||e[38]!==Y||e[39]!==B||e[40]!==J?(Q=p.jsxs($,{className:B,children:[J,Y]}),e[37]=$,e[38]=Y,e[39]=B,e[40]=J,e[41]=Q):Q=e[41],Q}function r2(n){return n.kind==="part"}function s2(n){const e=n.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=n.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function i2(n){const e=P.c(21),{event:t}=n,[r,s]=M.useState(!1);let i;e[0]!==t.data?(i=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=i):i=e[1];const o=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>s(o2),e[2]=l):l=e[2];let a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx(Rh,{className:"size-4 shrink-0 text-muted-foreground"}),c=p.jsx("span",{className:"font-medium",children:"Triggered by event"}),e[3]=a,e[4]=c):(a=e[3],c=e[4]);let u;e[5]!==t.type?(u=p.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[5]=t.type,e[6]=u):u=e[6];const d=r&&"rotate-180";let f;e[7]!==d?(f=Z("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",d),e[7]=d,e[8]=f):f=e[8];let h;e[9]!==f?(h=p.jsx(Mp,{className:f}),e[9]=f,e[10]=h):h=e[10];let m;e[11]!==u||e[12]!==h?(m=p.jsxs("button",{type:"button",onClick:l,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[a,c,u,h]}),e[11]=u,e[12]=h,e[13]=m):m=e[13];let g;e[14]!==t.source||e[15]!==r||e[16]!==o?(g=r&&p.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[p.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),p.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:o})]}),e[14]=t.source,e[15]=r,e[16]=o,e[17]=g):g=e[17];let y;return e[18]!==g||e[19]!==m?(y=p.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[m,g]}),e[18]=g,e[19]=m,e[20]=y):y=e[20],y}function o2(n){return!n}const l2=[Pk.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),Jx,Qx];function a2(n){const e=P.c(5),{tiptapDoc:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=r):r=e[0];let s;e[1]!==t?(s={extensions:l2,content:t,editable:!1,editorProps:r},e[1]=t,e[2]=s):s=e[2];const i=$x(s);if(!i)return null;let o;return e[3]!==i?(o=p.jsx(Yd,{editor:i,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=i,e[4]=o):o=e[4],o}function c2(n){const e=P.c(33),{message:t,className:r,onScrollToPair:s}=n,{id:i,parts:o,metadata:l}=t,[a,c]=M.useState(!1),[u,d]=M.useState(!1),f=M.useRef(!1);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=O=>{O&&!f.current&&(f.current=!0,d(O.scrollHeight>O.clientHeight))},e[0]=h):h=e[0];const m=h;if(!o||o.length===0)return null;let g;e[1]!==s?(g=()=>{c(!0),s?.()},e[1]=s,e[2]=g):g=e[2];const y=g,x=l?.tiptapDoc;let b;e[3]!==r?(b=Z("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=b):b=e[4];let S,v;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=()=>c(!0),v=()=>c(!1),e[5]=S,e[6]=v):(S=e[5],v=e[6]);let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=p.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=k):k=e[7];let C;e[8]!==a||e[9]!==u?(C=Z("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",a?"max-h-[50vh] overflow-auto opacity-100":Z("max-h-[84px] overflow-hidden opacity-99",u&&"mask-b-from-1%")),e[8]=a,e[9]=u,e[10]=C):C=e[10];let w;if(e[11]!==i||e[12]!==o){let O;e[14]!==i?(O=(D,R)=>D.type==="data-trigger-event"?p.jsx(i2,{event:D.data},`${i}-${R}`):null,e[14]=i,e[15]=O):O=e[15],w=o.map(O),e[11]=i,e[12]=o,e[13]=w}else w=e[13];let T;e[16]!==x||e[17]!==i||e[18]!==l||e[19]!==o?(T=x?p.jsx(a2,{tiptapDoc:l.tiptapDoc}):o.map((O,D)=>O.type==="text"?o[D-1]?.type==="data-trigger-event"?null:p.jsx(ni,{id:i,part:O},`${i}-${D}`):null),e[16]=x,e[17]=i,e[18]=l,e[19]=o,e[20]=T):T=e[20];let N;e[21]!==w||e[22]!==T?(N=p.jsxs("div",{className:"flex flex-col gap-2",children:[w,T]}),e[21]=w,e[22]=T,e[23]=N):N=e[23];let E;e[24]!==N||e[25]!==C?(E=p.jsx("div",{ref:m,className:C,children:N}),e[24]=N,e[25]=C,e[26]=E):E=e[26];let j;e[27]!==y||e[28]!==E?(j=p.jsxs("div",{tabIndex:0,onClick:y,onFocus:S,onBlur:v,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-[14px] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[k,E]}),e[27]=y,e[28]=E,e[29]=j):j=e[29];let L;return e[30]!==j||e[31]!==b?(L=p.jsx(p.Fragment,{children:p.jsx("div",{className:b,children:j})}),e[30]=j,e[31]=b,e[32]=L):L=e[32],L}function Ew(n){const e=[],t=n.filter(r=>r.role!=="system"&&!r.metadata?.internal&&!r.metadata?.subtaskJobId);for(let r=0;r<t.length;r++){const s=t[r];if(s)if(s.role==="user"){const i=t[r+1];i&&i.role==="assistant"?(e.push({user:s,assistant:i}),r++):e.push({user:s,assistant:null})}else s.role==="assistant"&&e.push({user:null,assistant:s})}return e}function Aw(n){const e=P.c(19),{pair:t,isLastPair:r,status:s}=n,i=M.useRef(null),o=M.useRef(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{i.current&&i.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=l):l=e[0];const a=l;let c;e[1]!==r||e[2]!==t.assistant?.metadata?.resumedFromBackground||e[3]!==s?(c=x=>{if(i.current=x,!r||!x||o.current||(o.current=!0,t.assistant?.metadata?.resumedFromBackground))return;if(s==="submitted"||s==="streaming"){x.scrollIntoView({behavior:"smooth",block:"start"});return}const b=x.closest("[data-chat-scroller]");b?b.scrollTop=b.scrollHeight:x.scrollIntoView({behavior:"instant",block:"start"})},e[1]=r,e[2]=t.assistant?.metadata?.resumedFromBackground,e[3]=s,e[4]=c):c=e[4];const u=c,d=!t.user&&"pt-8 sm:pt-6";let f;e[5]!==d?(f=Z("flex flex-col pb-2 sm:pb-2",d),e[5]=d,e[6]=f):f=e[6];let h;e[7]!==t.user?(h=t.user&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),p.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:p.jsx(c2,{message:t.user,onScrollToPair:a})})]}),e[7]=t.user,e[8]=h):h=e[8];const m=t.user?.created_at??null;let g;e[9]!==r||e[10]!==t.assistant||e[11]!==s||e[12]!==m?(g=p.jsx(n2,{message:t.assistant,turnStartedAt:m,status:s,isLast:r}),e[9]=r,e[10]=t.assistant,e[11]=s,e[12]=m,e[13]=g):g=e[13];let y;return e[14]!==u||e[15]!==f||e[16]!==h||e[17]!==g?(y=p.jsxs("div",{ref:u,className:f,children:[h,g]}),e[14]=u,e[15]=f,e[16]=h,e[17]=g,e[18]=y):y=e[18],y}function u2(n,e){return M.useReducer((t,r)=>e[t][r]??t,n)}var Nl="ScrollArea",[Jf]=Sc(Nl),[d2,Ge]=Jf(Nl),Gf=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=n,[l,a]=M.useState(null),[c,u]=M.useState(null),[d,f]=M.useState(null),[h,m]=M.useState(null),[g,y]=M.useState(null),[x,b]=M.useState(0),[S,v]=M.useState(0),[k,C]=M.useState(!1),[w,T]=M.useState(!1),N=hn(e,j=>a(j)),E=bh(s);return p.jsx(d2,{scope:t,type:r,dir:E,scrollHideDelay:i,scrollArea:l,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:v,children:p.jsx($t.div,{dir:E,...o,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":S+"px",...n.style}})})});Gf.displayName=Nl;var Xf="ScrollAreaViewport",Yf=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...i}=n,o=Ge(Xf,t),l=M.useRef(null),a=hn(e,l,o.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),p.jsx($t.div,{"data-radix-scroll-area-viewport":"",...i,ref:a,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...n.style},children:p.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Yf.displayName=Xf;var ct="ScrollAreaScrollbar",Qf=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ge(ct,n.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,l=n.orientation==="horizontal";return M.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),s.type==="hover"?p.jsx(f2,{...r,ref:e,forceMount:t}):s.type==="scroll"?p.jsx(h2,{...r,ref:e,forceMount:t}):s.type==="auto"?p.jsx(Zf,{...r,ref:e,forceMount:t}):s.type==="always"?p.jsx(Ml,{...r,ref:e}):null});Qf.displayName=ct;var f2=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ge(ct,n.__scopeScrollArea),[i,o]=M.useState(!1);return M.useEffect(()=>{const l=s.scrollArea;let a=0;if(l){const c=()=>{window.clearTimeout(a),o(!0)},u=()=>{a=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",c),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(a),l.removeEventListener("pointerenter",c),l.removeEventListener("pointerleave",u)}}},[s.scrollArea,s.scrollHideDelay]),p.jsx(kr,{present:t||i,children:p.jsx(Zf,{"data-state":i?"visible":"hidden",...r,ref:e})})}),h2=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ge(ct,n.__scopeScrollArea),i=n.orientation==="horizontal",o=ai(()=>a("SCROLL_END"),100),[l,a]=u2("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return M.useEffect(()=>{if(l==="idle"){const c=window.setTimeout(()=>a("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[l,s.scrollHideDelay,a]),M.useEffect(()=>{const c=s.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const h=c[u];d!==h&&(a("SCROLL"),o()),d=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[s.viewport,i,a,o]),p.jsx(kr,{present:t||l!=="hidden",children:p.jsx(Ml,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Ot(n.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:Ot(n.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Zf=M.forwardRef((n,e)=>{const t=Ge(ct,n.__scopeScrollArea),{forceMount:r,...s}=n,[i,o]=M.useState(!1),l=n.orientation==="horizontal",a=ai(()=>{if(t.viewport){const c=t.viewport.offsetWidth<t.viewport.scrollWidth,u=t.viewport.offsetHeight<t.viewport.scrollHeight;o(l?c:u)}},10);return Pn(t.viewport,a),Pn(t.content,a),p.jsx(kr,{present:r||i,children:p.jsx(Ml,{"data-state":i?"visible":"hidden",...s,ref:e})})}),Ml=M.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=Ge(ct,n.__scopeScrollArea),i=M.useRef(null),o=M.useRef(0),[l,a]=M.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=sh(l.viewport,l.content),u={...r,sizes:l,onSizesChange:a,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function d(f,h){return b2(f,o.current,l,h)}return t==="horizontal"?p.jsx(p2,{...u,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const f=s.viewport.scrollLeft,h=yc(f,l,s.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=d(f,s.dir))}}):t==="vertical"?p.jsx(m2,{...u,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const f=s.viewport.scrollTop,h=yc(f,l);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=d(f))}}):null}),p2=M.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,i=Ge(ct,n.__scopeScrollArea),[o,l]=M.useState(),a=M.useRef(null),c=hn(e,a,i.onScrollbarXChange);return M.useEffect(()=>{a.current&&l(getComputedStyle(a.current))},[a]),p.jsx(th,{"data-orientation":"horizontal",...s,ref:c,sizes:t,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":li(t)+"px",...n.style},onThumbPointerDown:u=>n.onThumbPointerDown(u.x),onDragScroll:u=>n.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;n.onWheelScroll(f),oh(f,d)&&u.preventDefault()}},onResize:()=>{a.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Bs(o.paddingLeft),paddingEnd:Bs(o.paddingRight)}})}})}),m2=M.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,i=Ge(ct,n.__scopeScrollArea),[o,l]=M.useState(),a=M.useRef(null),c=hn(e,a,i.onScrollbarYChange);return M.useEffect(()=>{a.current&&l(getComputedStyle(a.current))},[a]),p.jsx(th,{"data-orientation":"vertical",...s,ref:c,sizes:t,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":li(t)+"px",...n.style},onThumbPointerDown:u=>n.onThumbPointerDown(u.y),onDragScroll:u=>n.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;n.onWheelScroll(f),oh(f,d)&&u.preventDefault()}},onResize:()=>{a.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Bs(o.paddingTop),paddingEnd:Bs(o.paddingBottom)}})}})}),[g2,eh]=Jf(ct),th=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:a,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=n,h=Ge(ct,t),[m,g]=M.useState(null),y=hn(e,N=>g(N)),x=M.useRef(null),b=M.useRef(""),S=h.viewport,v=r.content-r.viewport,k=Ut(u),C=Ut(a),w=ai(d,10);function T(N){if(x.current){const E=N.clientX-x.current.left,j=N.clientY-x.current.top;c({x:E,y:j})}}return M.useEffect(()=>{const N=E=>{const j=E.target;m?.contains(j)&&k(E,v)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[S,m,v,k]),M.useEffect(C,[r,C]),Pn(m,w),Pn(h.content,w),p.jsx(g2,{scope:t,scrollbar:m,hasThumb:s,onThumbChange:Ut(i),onThumbPointerUp:Ut(o),onThumbPositionChange:C,onThumbPointerDown:Ut(l),children:p.jsx($t.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:Ot(n.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),x.current=m.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(N))}),onPointerMove:Ot(n.onPointerMove,T),onPointerUp:Ot(n.onPointerUp,N=>{const E=N.target;E.hasPointerCapture(N.pointerId)&&E.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),zs="ScrollAreaThumb",nh=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=eh(zs,n.__scopeScrollArea);return p.jsx(kr,{present:t||s.hasThumb,children:p.jsx(y2,{ref:e,...r})})}),y2=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,i=Ge(zs,t),o=eh(zs,t),{onThumbPositionChange:l}=o,a=hn(e,d=>o.onThumbChange(d)),c=M.useRef(void 0),u=ai(()=>{c.current&&(c.current(),c.current=void 0)},100);return M.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const h=k2(d,l);c.current=h,l()}};return l(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,l]),p.jsx($t.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ot(n.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,g=d.clientY-h.top;o.onThumbPointerDown({x:m,y:g})}),onPointerUp:Ot(n.onPointerUp,o.onThumbPointerUp)})});nh.displayName=zs;var El="ScrollAreaCorner",rh=M.forwardRef((n,e)=>{const t=Ge(El,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?p.jsx(x2,{...n,ref:e}):null});rh.displayName=El;var x2=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=Ge(El,t),[i,o]=M.useState(0),[l,a]=M.useState(0),c=!!(i&&l);return Pn(s.scrollbarX,()=>{const u=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(u),a(u)}),Pn(s.scrollbarY,()=>{const u=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(u),o(u)}),c?p.jsx($t.div,{...r,ref:e,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Bs(n){return n?parseInt(n,10):0}function sh(n,e){const t=n/e;return isNaN(t)?0:t}function li(n){const e=sh(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function b2(n,e,t,r="ltr"){const s=li(t),i=s/2,o=e||i,l=s-o,a=t.scrollbar.paddingStart+o,c=t.scrollbar.size-t.scrollbar.paddingEnd-l,u=t.content-t.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return ih([a,c],d)(n)}function yc(n,e,t="ltr"){const r=li(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,o=e.content-e.viewport,l=i-r,a=t==="ltr"?[0,o]:[o*-1,0],c=Ep(n,a);return ih([0,o],[0,l])(c)}function ih(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function oh(n,e){return n>0&&n<e}var k2=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const i={left:n.scrollLeft,top:n.scrollTop},o=t.left!==i.left,l=t.top!==i.top;(o||l)&&e(),t=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function ai(n,e){const t=Ut(n),r=M.useRef(0);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),M.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Pn(n,e){const t=Ut(e);kc(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var S2=Gf,v2=Yf,w2=rh;function Ow(n){const e=P.c(17);let t,r,s,i;e[0]!==n?({className:r,children:t,hideScrollbar:i,...s}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s,e[4]=i):(t=e[1],r=e[2],s=e[3],i=e[4]);const o=i===void 0?!1:i;let l;e[5]!==r?(l=Z("relative h-full w-full",r),e[5]=r,e[6]=l):l=e[6];let a;e[7]!==t?(a=p.jsx(v2,{"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:p.jsx("div",{className:"flex min-w-0 flex-col",children:t})}),e[7]=t,e[8]=a):a=e[8];let c;e[9]!==o?(c=p.jsx(C2,{hideScrollbar:o}),e[9]=o,e[10]=c):c=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx(w2,{}),e[11]=u):u=e[11];let d;return e[12]!==s||e[13]!==l||e[14]!==a||e[15]!==c?(d=p.jsxs(S2,{"data-slot":"scroll-area",className:l,...s,children:[a,c,u]}),e[12]=s,e[13]=l,e[14]=a,e[15]=c,e[16]=d):d=e[16],d}function C2(n){const e=P.c(15);let t,r,s,i;e[0]!==n?({className:t,orientation:s,hideScrollbar:i,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s,e[4]=i):(t=e[1],r=e[2],s=e[3],i=e[4]);const o=s===void 0?"vertical":s,l=i===void 0?!1:i,a=o==="vertical"&&"h-full w-2.5 border-l border-l-transparent",c=o==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",u=l&&"hidden";let d;e[5]!==t||e[6]!==a||e[7]!==c||e[8]!==u?(d=Z("select-none touch-none p-px transition-colors",a,c,u,t),e[5]=t,e[6]=a,e[7]=c,e[8]=u,e[9]=d):d=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=p.jsx(nh,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let h;return e[11]!==o||e[12]!==r||e[13]!==d?(h=p.jsx(Qf,{"data-slot":"scroll-area-scrollbar",orientation:o,className:d,...r,children:f}),e[11]=o,e[12]=r,e[13]=d,e[14]=h):h=e[14],h}export{vw as A,Ew as B,Tw as C,le as D,ol as E,Qx as F,Lv as G,Aw as H,Nw as I,Uk as J,ni as M,Av as O,Dp as P,Bk as R,Ow as S,Cw as T,Ev as a,ww as b,gw as c,Fk as d,Hk as e,Vk as f,Oo as g,sf as h,Ip as i,of as j,kw as k,Se as l,ae as m,Sw as n,Pe as o,yw as p,bw as q,qx as r,Io as s,Hc as t,Mw as u,$x as v,xw as w,Jx as x,Pk as y,Yd as z};
|
|
188
|
+
`);d=!o&&b.trim()?b:null,e[8]=o,e[9]=r,e[10]=d}else d=e[10];const f=d,h=!s&&t!=null?t/1e3:void 0;let m;e[11]!==s?(m=s?p.jsx(Fs,{className:"size-4"}):p.jsx(Ah,{className:"size-4"}),e[11]=s,e[12]=m):m=e[12];const g=s?"Thinking...":a,y=s?"loading":"idle";let x;return e[13]!==f||e[14]!==h||e[15]!==u||e[16]!==m||e[17]!==g||e[18]!==y?(x=p.jsx(wo,{icon:m,title:g,summary:u,detail:f,state:y,detailVariant:"prose",latency:h}),e[13]=f,e[14]=h,e[15]=u,e[16]=m,e[17]=g,e[18]=y,e[19]=x):x=e[19],x}function Uv(n){return n.text??""}function qv(n){return n.text??""}function Kv(n){return n.text?.includes("REDACTED")}const Jv=3;function Gv(n,e){let t=-1;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.kind==="part"&&e[s.index]?.type==="text"){t=r;break}}return t===-1?{collapsed:[],tail:n}:{collapsed:n.slice(0,t),tail:n.slice(t)}}function Xv(n,e){let t=0,r=0;for(const s of n)if(s.kind==="reasoning-group")r++;else{const i=e[s.index]?.type;i==="text"?r++:(i==="dynamic-tool"||i?.startsWith("tool-"))&&i!=="tool-todo_write"&&i!=="tool-update_interests"&&t++}return{toolCalls:t,messages:r}}function Yv(n){const e=P.c(8),{toolCalls:t,messages:r}=n;let s;e[0]!==r||e[1]!==t?(s=t>0&&p.jsxs(p.Fragment,{children:[p.jsx(Nc,{className:"size-3.5 shrink-0"}),p.jsxs("span",{children:[t," tool call",t===1?"":"s",r>0?",":""]})]}),e[0]=r,e[1]=t,e[2]=s):s=e[2];let i;e[3]!==r?(i=r>0&&p.jsxs(p.Fragment,{children:[p.jsx(Ih,{className:"size-3.5 shrink-0"}),p.jsxs("span",{children:[r," message",r===1?"":"s"]})]}),e[3]=r,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=p.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[s,i]}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function Qv(n){const e=P.c(28),{items:t,message:r,reasoningGroups:s,isReasoningActive:i,totalDuration:o,dataParts:l,isLoading:a,isLast:c}=n;let u;e[0]!==t||e[1]!==r.parts?(u=Xv(t,r.parts),e[0]=t,e[1]=r.parts,e[2]=u):u=e[2];const{toolCalls:d,messages:f}=u;if(d===0&&f===0)return null;let h;e[3]!==f||e[4]!==d?(h=p.jsx(Yv,{toolCalls:d,messages:f}),e[3]=f,e[4]=d,e[5]=h):h=e[5];let m;if(e[6]!==l||e[7]!==c||e[8]!==a||e[9]!==i||e[10]!==t||e[11]!==r||e[12]!==s||e[13]!==o){let x;e[15]!==l||e[16]!==c||e[17]!==a||e[18]!==i||e[19]!==r||e[20]!==s||e[21]!==o?(x=(b,S)=>Kf({item:b,renderIndex:S,message:r,reasoningGroups:s,isReasoningActive:i,totalDuration:o,dataParts:l,isLoading:a,isLast:c,isLastVisiblePart:!1}),e[15]=l,e[16]=c,e[17]=a,e[18]=i,e[19]=r,e[20]=s,e[21]=o,e[22]=x):x=e[22],m=t.map(x),e[6]=l,e[7]=c,e[8]=a,e[9]=i,e[10]=t,e[11]=r,e[12]=s,e[13]=o,e[14]=m}else m=e[14];let g;e[23]!==m?(g=p.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:m}),e[23]=m,e[24]=g):g=e[24];let y;return e[25]!==h||e[26]!==g?(y=p.jsx(X,{icon:null,alwaysChevron:!0,title:h,state:"idle",children:g}),e[25]=h,e[26]=g,e[27]=y):y=e[27],y}function Kf({item:n,renderIndex:e,message:t,reasoningGroups:r,isReasoningActive:s,totalDuration:i,dataParts:o,isLoading:l,isLast:a,isLastVisiblePart:c,renderOrder:u}){if(n.kind==="reasoning-group"){const{group:m}=n,g=m===r[r.length-1],y=s&&g;if(!m.parts.some(S=>S.text?.trim())&&!y)return null;const b=r.length===1?i:null;return p.jsx(Wv,{duration:b,parts:m.parts,isStreaming:y},`${t.id}-reasoning-${m.startIndex}`)}const d=t.parts[n.index],f=c||(u?u.findLastIndex(m=>m.kind==="part")===e:!1),h=f?Fc(Bc(),t.metadata?.usage):null;return p.jsx(Zv,{part:d,id:t.id,usageStats:f&&p.jsx(Lk,{usage:h,duration:i}),dataParts:o,isLoading:l,isLastMessage:a},`${t.id}-${n.index}`)}function Zv(n){const e=P.c(121),{part:t,id:r,usageStats:s,dataParts:i,isLoading:o,isLastMessage:l}=n;let a;e[0]!==i.toolMetadata?(a=f=>i.toolMetadata.get(f),e[0]=i.toolMetadata,e[1]=a):a=e[1];const c=a;let u;e[2]!==i.toolSubtaskMetadata?(u=f=>i.toolSubtaskMetadata.get(f),e[2]=i.toolSubtaskMetadata,e[3]=u):u=e[3];const d=u;switch(t.type){case"dynamic-tool":{let f;e[4]!==c||e[5]!==t.toolCallId?(f=c(t.toolCallId)?.annotations,e[4]=c,e[5]=t.toolCallId,e[6]=f):f=e[6];let h;e[7]!==c||e[8]!==t.toolCallId?(h=c(t.toolCallId)?.latencySeconds,e[7]=c,e[8]=t.toolCallId,e[9]=h):h=e[9];let m;e[10]!==c||e[11]!==t.toolCallId?(m=c(t.toolCallId)?.outputBytes,e[10]=c,e[11]=t.toolCallId,e[12]=m):m=e[12];let g;e[13]!==c||e[14]!==t.toolCallId?(g=c(t.toolCallId)?._meta,e[13]=c,e[14]=t.toolCallId,e[15]=g):g=e[15];let y;return e[16]!==l||e[17]!==t||e[18]!==f||e[19]!==h||e[20]!==m||e[21]!==g?(y=p.jsx(fc,{part:t,annotations:f,latency:h,outputBytes:m,isLastMessage:l,toolMeta:g}),e[16]=l,e[17]=t,e[18]=f,e[19]=h,e[20]=m,e[21]=g,e[22]=y):y=e[22],y}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let f;e[23]!==c||e[24]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[23]=c,e[24]=t.toolCallId,e[25]=f):f=e[25];let h;return e[26]!==t||e[27]!==f?(h=p.jsx(AS,{part:t,latency:f}),e[26]=t,e[27]=f,e[28]=h):h=e[28],h}case"tool-propose_plan":{let f;return e[29]!==t?(f=p.jsx(BS,{part:t}),e[29]=t,e[30]=f):f=e[30],f}case"tool-generate_image":{let f;e[31]!==c||e[32]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[31]=c,e[32]=t.toolCallId,e[33]=f):f=e[33];let h;return e[34]!==t||e[35]!==f?(h=p.jsx(pS,{part:t,latency:f}),e[34]=t,e[35]=f,e[36]=h):h=e[36],h}case"tool-take_screenshot":{let f;e[37]!==c||e[38]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[37]=c,e[38]=t.toolCallId,e[39]=f):f=e[39];let h;return e[40]!==t||e[41]!==f?(h=p.jsx(yS,{part:t,latency:f}),e[40]=t,e[41]=f,e[42]=h):h=e[42],h}case"tool-web_search":case"tool-deep_research":{let f;e[43]!==c||e[44]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[43]=c,e[44]=t.toolCallId,e[45]=f):f=e[45];let h;e[46]!==i.webSearchStreaming||e[47]!==t.toolCallId?(h=i.webSearchStreaming.get(t.toolCallId),e[46]=i.webSearchStreaming,e[47]=t.toolCallId,e[48]=h):h=e[48];let m;return e[49]!==t||e[50]!==f||e[51]!==h?(m=p.jsx(ES,{part:t,latency:f,streamingText:h}),e[49]=t,e[50]=f,e[51]=h,e[52]=m):m=e[52],m}case"tool-subtask":{let f;e[53]!==d||e[54]!==t.toolCallId?(f=d(t.toolCallId),e[53]=d,e[54]=t.toolCallId,e[55]=f):f=e[55];let h;e[56]!==c||e[57]!==t.toolCallId?(h=c(t.toolCallId)?.annotations,e[56]=c,e[57]=t.toolCallId,e[58]=h):h=e[58];let m;e[59]!==c||e[60]!==t.toolCallId?(m=c(t.toolCallId)?.latencySeconds,e[59]=c,e[60]=t.toolCallId,e[61]=m):m=e[61];let g;e[62]!==t||e[63]!==f||e[64]!==h||e[65]!==m?(g={part:t,subtaskMeta:f,annotations:h,latency:m},e[62]=t,e[63]=f,e[64]=h,e[65]=m,e[66]=g):g=e[66];const y=g;let x;return e[67]!==y?(x=p.jsx(M.Suspense,{fallback:p.jsx($S,{...y}),children:p.jsx(zS,{...y})}),e[67]=y,e[68]=x):x=e[68],x}case"text":{const f=!!s&&!o,h=o&&l;let m;return e[69]!==r||e[70]!==t||e[71]!==f||e[72]!==h||e[73]!==s?(m=p.jsx(ni,{id:r,part:t,extraActions:s,copyable:!0,alwaysShowActions:f,animate:h}),e[69]=r,e[70]=t,e[71]=f,e[72]=h,e[73]=s,e[74]=m):m=e[74],m}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const f=t;if(f.type==="tool-brand_context_setup"||f.type==="tool-BRAND_CONTEXT_EXTRACT"){let h;e[75]!==f.toolCallId||e[76]!==c?(h=c(f.toolCallId)?.latencySeconds,e[75]=f.toolCallId,e[76]=c,e[77]=h):h=e[77];let m;return e[78]!==f||e[79]!==h?(m=p.jsx(QS,{part:f,latency:h}),e[78]=f,e[79]=h,e[80]=m):m=e[80],m}if(f.type==="tool-BRAND_CONTEXT_GET"){let h;e[81]!==f.toolCallId||e[82]!==c?(h=c(f.toolCallId)?.latencySeconds,e[81]=f.toolCallId,e[82]=c,e[83]=h):h=e[83];let m;return e[84]!==f||e[85]!==h?(m=p.jsx(ZS,{part:f,latency:h}),e[84]=f,e[85]=h,e[86]=m):m=e[86],m}if(f.type==="tool-BRAND_CONTEXT_LIST"){let h;e[87]!==f.toolCallId||e[88]!==c?(h=c(f.toolCallId)?.latencySeconds,e[87]=f.toolCallId,e[88]=c,e[89]=h):h=e[89];let m;return e[90]!==f||e[91]!==h?(m=p.jsx(ev,{part:f,latency:h}),e[90]=f,e[91]=h,e[92]=m):m=e[92],m}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let h;e[93]!==f.toolCallId||e[94]!==c?(h=c(f.toolCallId)?.latencySeconds,e[93]=f.toolCallId,e[94]=c,e[95]=h):h=e[95];let m;return e[96]!==f||e[97]!==h?(m=p.jsx(ov,{part:f,latency:h}),e[96]=f,e[97]=h,e[98]=m):m=e[98],m}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let h;e[99]!==f.toolCallId||e[100]!==c?(h=c(f.toolCallId)?.latencySeconds,e[99]=f.toolCallId,e[100]=c,e[101]=h):h=e[101];let m;return e[102]!==f||e[103]!==h?(m=p.jsx(uv,{part:f,latency:h}),e[102]=f,e[103]=h,e[104]=m):m=e[104],m}if(f.type==="tool-COLLECTION_CONNECTIONS_LIST"){let h;e[105]!==f.toolCallId||e[106]!==c?(h=c(f.toolCallId)?.latencySeconds,e[105]=f.toolCallId,e[106]=c,e[107]=h):h=e[107];let m;return e[108]!==f||e[109]!==h?(m=p.jsx(pv,{part:f,latency:h}),e[108]=f,e[109]=h,e[110]=m):m=e[110],m}if(f.type.startsWith("tool-")){const h=f.toolCallId;let m;e[111]!==i.toolMetadata||e[112]!==h?(m=i.toolMetadata.get(h),e[111]=i.toolMetadata,e[112]=h,e[113]=m):m=e[113];const g=m,y=g?.annotations,x=g?.latencySeconds,b=g?.outputBytes,S=g?._meta;let v;return e[114]!==f||e[115]!==l||e[116]!==y||e[117]!==x||e[118]!==b||e[119]!==S?(v=p.jsx(fc,{part:f,annotations:y,latency:x,outputBytes:b,isLastMessage:l,toolMeta:S}),e[114]=f,e[115]=l,e[116]=y,e[117]=x,e[118]=b,e[119]=S,e[120]=v):v=e[120],v}if(f.type.startsWith("data-"))return null;throw new Error(`Unknown part type: ${f.type}`)}}}function e2(n){const e=P.c(2),{isRunInProgress:t}=n;if(t){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:p.jsxs("span",{className:"flex items-center gap-1.5",children:[p.jsx(Fs,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),p.jsx("span",{className:"text-[14px] text-muted-foreground shimmer",children:"Resuming task..."})]})}),e[0]=s):s=e[0],s}let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-[14px] text-muted-foreground/60 py-2",children:"No response was generated"}),e[1]=r):r=e[1],r}function t2(n){const e=P.c(7),{className:t,children:r}=n;let s;e[0]!==t?(s=Z("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==r?(i=p.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:p.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[14px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:r})}),e[2]=r,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==i?(o=p.jsx("div",{className:s,children:i}),e[4]=s,e[5]=i,e[6]=o):o=e[6],o}function n2(n){const e=P.c(42),{message:t,turnStartedAt:r,status:s,className:i,isLast:o}=n,l=o===void 0?!1:o,{isRunInProgress:a}=_n()??{},c=a===void 0?!1:a,u=Eo()?.taskId??null,d=s==="streaming",h=d||s==="submitted";let m;e[0]!==r?(m=Ac(r),e[0]=r,e[1]=m):m=e[1];const g=m;let y;e[2]!==h?(y=()=>h?Date.now():null,e[2]=h,e[3]=y):y=e[3];const[x,b]=M.useState(y),[S,v]=M.useState(h);S!==h&&(v(h),b(h?Date.now():null));const k=g??x,{reasoningGroups:C,renderOrder:w,dataParts:T}=Pv(t),N=t!==null&&w.length>0,E=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,j=d&&E?.type==="reasoning";let L;if(e[4]!==t){const G=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,ie=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;L=G!==null?ie.getTime()-G.getTime():null,e[4]=t,e[5]=L}else L=e[5];const O=L;let D;e[6]!==l||e[7]!==t?(D=!l||!t||!t.parts.some(s2),e[6]=l,e[7]=t,e[8]=D):D=e[8];const R=D;let F;e[9]!==N||e[10]!==h||e[11]!==R||e[12]!==t||e[13]!==w?(F=!h&&N&&R&&(()=>{let G=0;for(const ie of w)if(ie.kind==="part"){const re=t.parts[ie.index]?.type;(re==="dynamic-tool"||re?.startsWith("tool-"))&&G++}return G>=Jv})(),e[9]=N,e[10]=h,e[11]=R,e[12]=t,e[13]=w,e[14]=F):F=e[14];const z=F;let $,B,J;if(e[15]!==i||e[16]!==T||e[17]!==N||e[18]!==l||e[19]!==h||e[20]!==j||e[21]!==c||e[22]!==R||e[23]!==t||e[24]!==C||e[25]!==w||e[26]!==z||e[27]!==k||e[28]!==u||e[29]!==O){const{collapsed:G,tail:ie}=z?Gv(w,t.parts):{collapsed:[],tail:w};$=t2,B=i,J=N?p.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[t.metadata?.resumedFromBackground&&p.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground/60 select-none",children:[p.jsx(vc,{className:"size-3 shrink-0"}),p.jsx("span",{children:"Resumed — background task completed"})]}),G.length>0&&p.jsx(Qv,{items:G,message:t,reasoningGroups:C,isReasoningActive:j,totalDuration:O,dataParts:T,isLoading:h,isLast:l}),ie.map((re,xe)=>{const he=G.length+xe,Ce=ie.findLastIndex(r2)===xe;return Kf({item:re,renderIndex:he,message:t,reasoningGroups:C,isReasoningActive:j,totalDuration:O,dataParts:T,isLoading:h,isLast:l,isLastVisiblePart:Ce,renderOrder:w})}),u&&p.jsx(Rv,{threadId:u,message:t}),l&&h&&k!==null&&p.jsx(Fv,{startedAt:k}),l&&!h&&u&&p.jsxs(p.Fragment,{children:[p.jsx(vv,{}),R&&p.jsx(yv,{})]})]}):h?p.jsx(Vv,{startedAt:k}):p.jsx(e2,{isRunInProgress:l&&c}),e[15]=i,e[16]=T,e[17]=N,e[18]=l,e[19]=h,e[20]=j,e[21]=c,e[22]=R,e[23]=t,e[24]=C,e[25]=w,e[26]=z,e[27]=k,e[28]=u,e[29]=O,e[30]=$,e[31]=B,e[32]=J}else $=e[30],B=e[31],J=e[32];let Y;e[33]!==l||e[34]!==d||e[35]!==t?.parts?(Y=l&&d&&p.jsx(kv,{parts:t?.parts}),e[33]=l,e[34]=d,e[35]=t?.parts,e[36]=Y):Y=e[36];let Q;return e[37]!==$||e[38]!==Y||e[39]!==B||e[40]!==J?(Q=p.jsxs($,{className:B,children:[J,Y]}),e[37]=$,e[38]=Y,e[39]=B,e[40]=J,e[41]=Q):Q=e[41],Q}function r2(n){return n.kind==="part"}function s2(n){const e=n.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=n.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function i2(n){const e=P.c(21),{event:t}=n,[r,s]=M.useState(!1);let i;e[0]!==t.data?(i=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=i):i=e[1];const o=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>s(o2),e[2]=l):l=e[2];let a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx(Rh,{className:"size-4 shrink-0 text-muted-foreground"}),c=p.jsx("span",{className:"font-medium",children:"Triggered by event"}),e[3]=a,e[4]=c):(a=e[3],c=e[4]);let u;e[5]!==t.type?(u=p.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[5]=t.type,e[6]=u):u=e[6];const d=r&&"rotate-180";let f;e[7]!==d?(f=Z("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",d),e[7]=d,e[8]=f):f=e[8];let h;e[9]!==f?(h=p.jsx(Mp,{className:f}),e[9]=f,e[10]=h):h=e[10];let m;e[11]!==u||e[12]!==h?(m=p.jsxs("button",{type:"button",onClick:l,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[a,c,u,h]}),e[11]=u,e[12]=h,e[13]=m):m=e[13];let g;e[14]!==t.source||e[15]!==r||e[16]!==o?(g=r&&p.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[p.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),p.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:o})]}),e[14]=t.source,e[15]=r,e[16]=o,e[17]=g):g=e[17];let y;return e[18]!==g||e[19]!==m?(y=p.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[m,g]}),e[18]=g,e[19]=m,e[20]=y):y=e[20],y}function o2(n){return!n}const l2=[Pk.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),Jx,Qx];function a2(n){const e=P.c(5),{tiptapDoc:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=r):r=e[0];let s;e[1]!==t?(s={extensions:l2,content:t,editable:!1,editorProps:r},e[1]=t,e[2]=s):s=e[2];const i=$x(s);if(!i)return null;let o;return e[3]!==i?(o=p.jsx(Yd,{editor:i,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=i,e[4]=o):o=e[4],o}function c2(n){const e=P.c(33),{message:t,className:r,onScrollToPair:s}=n,{id:i,parts:o,metadata:l}=t,[a,c]=M.useState(!1),[u,d]=M.useState(!1),f=M.useRef(!1);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=O=>{O&&!f.current&&(f.current=!0,d(O.scrollHeight>O.clientHeight))},e[0]=h):h=e[0];const m=h;if(!o||o.length===0)return null;let g;e[1]!==s?(g=()=>{c(!0),s?.()},e[1]=s,e[2]=g):g=e[2];const y=g,x=l?.tiptapDoc;let b;e[3]!==r?(b=Z("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=b):b=e[4];let S,v;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=()=>c(!0),v=()=>c(!1),e[5]=S,e[6]=v):(S=e[5],v=e[6]);let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=p.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=k):k=e[7];let C;e[8]!==a||e[9]!==u?(C=Z("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",a?"max-h-[50vh] overflow-auto opacity-100":Z("max-h-[84px] overflow-hidden opacity-99",u&&"mask-b-from-1%")),e[8]=a,e[9]=u,e[10]=C):C=e[10];let w;if(e[11]!==i||e[12]!==o){let O;e[14]!==i?(O=(D,R)=>D.type==="data-trigger-event"?p.jsx(i2,{event:D.data},`${i}-${R}`):null,e[14]=i,e[15]=O):O=e[15],w=o.map(O),e[11]=i,e[12]=o,e[13]=w}else w=e[13];let T;e[16]!==x||e[17]!==i||e[18]!==l||e[19]!==o?(T=x?p.jsx(a2,{tiptapDoc:l.tiptapDoc}):o.map((O,D)=>O.type==="text"?o[D-1]?.type==="data-trigger-event"?null:p.jsx(ni,{id:i,part:O},`${i}-${D}`):null),e[16]=x,e[17]=i,e[18]=l,e[19]=o,e[20]=T):T=e[20];let N;e[21]!==w||e[22]!==T?(N=p.jsxs("div",{className:"flex flex-col gap-2",children:[w,T]}),e[21]=w,e[22]=T,e[23]=N):N=e[23];let E;e[24]!==N||e[25]!==C?(E=p.jsx("div",{ref:m,className:C,children:N}),e[24]=N,e[25]=C,e[26]=E):E=e[26];let j;e[27]!==y||e[28]!==E?(j=p.jsxs("div",{tabIndex:0,onClick:y,onFocus:S,onBlur:v,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-[14px] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[k,E]}),e[27]=y,e[28]=E,e[29]=j):j=e[29];let L;return e[30]!==j||e[31]!==b?(L=p.jsx(p.Fragment,{children:p.jsx("div",{className:b,children:j})}),e[30]=j,e[31]=b,e[32]=L):L=e[32],L}function Ew(n){const e=[],t=n.filter(r=>r.role!=="system"&&!r.metadata?.internal&&!r.metadata?.subtaskJobId);for(let r=0;r<t.length;r++){const s=t[r];if(s)if(s.role==="user"){const i=t[r+1];i&&i.role==="assistant"?(e.push({user:s,assistant:i}),r++):e.push({user:s,assistant:null})}else s.role==="assistant"&&e.push({user:null,assistant:s})}return e}function Aw(n){const e=P.c(19),{pair:t,isLastPair:r,status:s}=n,i=M.useRef(null),o=M.useRef(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{i.current&&i.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=l):l=e[0];const a=l;let c;e[1]!==r||e[2]!==t.assistant?.metadata?.resumedFromBackground||e[3]!==s?(c=x=>{if(i.current=x,!r||!x||o.current||(o.current=!0,t.assistant?.metadata?.resumedFromBackground))return;if(s==="submitted"||s==="streaming"){x.scrollIntoView({behavior:"smooth",block:"start"});return}const b=x.closest("[data-chat-scroller]");b?b.scrollTop=b.scrollHeight:x.scrollIntoView({behavior:"instant",block:"start"})},e[1]=r,e[2]=t.assistant?.metadata?.resumedFromBackground,e[3]=s,e[4]=c):c=e[4];const u=c,d=!t.user&&"pt-8 sm:pt-6";let f;e[5]!==d?(f=Z("flex flex-col pb-2 sm:pb-2",d),e[5]=d,e[6]=f):f=e[6];let h;e[7]!==t.user?(h=t.user&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),p.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:p.jsx(c2,{message:t.user,onScrollToPair:a})})]}),e[7]=t.user,e[8]=h):h=e[8];const m=t.user?.created_at??null;let g;e[9]!==r||e[10]!==t.assistant||e[11]!==s||e[12]!==m?(g=p.jsx(n2,{message:t.assistant,turnStartedAt:m,status:s,isLast:r}),e[9]=r,e[10]=t.assistant,e[11]=s,e[12]=m,e[13]=g):g=e[13];let y;return e[14]!==u||e[15]!==f||e[16]!==h||e[17]!==g?(y=p.jsxs("div",{ref:u,className:f,children:[h,g]}),e[14]=u,e[15]=f,e[16]=h,e[17]=g,e[18]=y):y=e[18],y}function u2(n,e){return M.useReducer((t,r)=>e[t][r]??t,n)}var Nl="ScrollArea",[Jf]=Sc(Nl),[d2,Ge]=Jf(Nl),Gf=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=n,[l,a]=M.useState(null),[c,u]=M.useState(null),[d,f]=M.useState(null),[h,m]=M.useState(null),[g,y]=M.useState(null),[x,b]=M.useState(0),[S,v]=M.useState(0),[k,C]=M.useState(!1),[w,T]=M.useState(!1),N=hn(e,j=>a(j)),E=bh(s);return p.jsx(d2,{scope:t,type:r,dir:E,scrollHideDelay:i,scrollArea:l,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:v,children:p.jsx($t.div,{dir:E,...o,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":S+"px",...n.style}})})});Gf.displayName=Nl;var Xf="ScrollAreaViewport",Yf=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...i}=n,o=Ge(Xf,t),l=M.useRef(null),a=hn(e,l,o.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),p.jsx($t.div,{"data-radix-scroll-area-viewport":"",...i,ref:a,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...n.style},children:p.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Yf.displayName=Xf;var ct="ScrollAreaScrollbar",Qf=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ge(ct,n.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,l=n.orientation==="horizontal";return M.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),s.type==="hover"?p.jsx(f2,{...r,ref:e,forceMount:t}):s.type==="scroll"?p.jsx(h2,{...r,ref:e,forceMount:t}):s.type==="auto"?p.jsx(Zf,{...r,ref:e,forceMount:t}):s.type==="always"?p.jsx(Ml,{...r,ref:e}):null});Qf.displayName=ct;var f2=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ge(ct,n.__scopeScrollArea),[i,o]=M.useState(!1);return M.useEffect(()=>{const l=s.scrollArea;let a=0;if(l){const c=()=>{window.clearTimeout(a),o(!0)},u=()=>{a=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",c),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(a),l.removeEventListener("pointerenter",c),l.removeEventListener("pointerleave",u)}}},[s.scrollArea,s.scrollHideDelay]),p.jsx(kr,{present:t||i,children:p.jsx(Zf,{"data-state":i?"visible":"hidden",...r,ref:e})})}),h2=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ge(ct,n.__scopeScrollArea),i=n.orientation==="horizontal",o=ai(()=>a("SCROLL_END"),100),[l,a]=u2("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return M.useEffect(()=>{if(l==="idle"){const c=window.setTimeout(()=>a("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[l,s.scrollHideDelay,a]),M.useEffect(()=>{const c=s.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const h=c[u];d!==h&&(a("SCROLL"),o()),d=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[s.viewport,i,a,o]),p.jsx(kr,{present:t||l!=="hidden",children:p.jsx(Ml,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Ot(n.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:Ot(n.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Zf=M.forwardRef((n,e)=>{const t=Ge(ct,n.__scopeScrollArea),{forceMount:r,...s}=n,[i,o]=M.useState(!1),l=n.orientation==="horizontal",a=ai(()=>{if(t.viewport){const c=t.viewport.offsetWidth<t.viewport.scrollWidth,u=t.viewport.offsetHeight<t.viewport.scrollHeight;o(l?c:u)}},10);return Pn(t.viewport,a),Pn(t.content,a),p.jsx(kr,{present:r||i,children:p.jsx(Ml,{"data-state":i?"visible":"hidden",...s,ref:e})})}),Ml=M.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=Ge(ct,n.__scopeScrollArea),i=M.useRef(null),o=M.useRef(0),[l,a]=M.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=sh(l.viewport,l.content),u={...r,sizes:l,onSizesChange:a,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function d(f,h){return b2(f,o.current,l,h)}return t==="horizontal"?p.jsx(p2,{...u,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const f=s.viewport.scrollLeft,h=yc(f,l,s.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=d(f,s.dir))}}):t==="vertical"?p.jsx(m2,{...u,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const f=s.viewport.scrollTop,h=yc(f,l);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=d(f))}}):null}),p2=M.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,i=Ge(ct,n.__scopeScrollArea),[o,l]=M.useState(),a=M.useRef(null),c=hn(e,a,i.onScrollbarXChange);return M.useEffect(()=>{a.current&&l(getComputedStyle(a.current))},[a]),p.jsx(th,{"data-orientation":"horizontal",...s,ref:c,sizes:t,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":li(t)+"px",...n.style},onThumbPointerDown:u=>n.onThumbPointerDown(u.x),onDragScroll:u=>n.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;n.onWheelScroll(f),oh(f,d)&&u.preventDefault()}},onResize:()=>{a.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Bs(o.paddingLeft),paddingEnd:Bs(o.paddingRight)}})}})}),m2=M.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,i=Ge(ct,n.__scopeScrollArea),[o,l]=M.useState(),a=M.useRef(null),c=hn(e,a,i.onScrollbarYChange);return M.useEffect(()=>{a.current&&l(getComputedStyle(a.current))},[a]),p.jsx(th,{"data-orientation":"vertical",...s,ref:c,sizes:t,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":li(t)+"px",...n.style},onThumbPointerDown:u=>n.onThumbPointerDown(u.y),onDragScroll:u=>n.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;n.onWheelScroll(f),oh(f,d)&&u.preventDefault()}},onResize:()=>{a.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Bs(o.paddingTop),paddingEnd:Bs(o.paddingBottom)}})}})}),[g2,eh]=Jf(ct),th=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:a,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=n,h=Ge(ct,t),[m,g]=M.useState(null),y=hn(e,N=>g(N)),x=M.useRef(null),b=M.useRef(""),S=h.viewport,v=r.content-r.viewport,k=Ut(u),C=Ut(a),w=ai(d,10);function T(N){if(x.current){const E=N.clientX-x.current.left,j=N.clientY-x.current.top;c({x:E,y:j})}}return M.useEffect(()=>{const N=E=>{const j=E.target;m?.contains(j)&&k(E,v)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[S,m,v,k]),M.useEffect(C,[r,C]),Pn(m,w),Pn(h.content,w),p.jsx(g2,{scope:t,scrollbar:m,hasThumb:s,onThumbChange:Ut(i),onThumbPointerUp:Ut(o),onThumbPositionChange:C,onThumbPointerDown:Ut(l),children:p.jsx($t.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:Ot(n.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),x.current=m.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(N))}),onPointerMove:Ot(n.onPointerMove,T),onPointerUp:Ot(n.onPointerUp,N=>{const E=N.target;E.hasPointerCapture(N.pointerId)&&E.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),zs="ScrollAreaThumb",nh=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=eh(zs,n.__scopeScrollArea);return p.jsx(kr,{present:t||s.hasThumb,children:p.jsx(y2,{ref:e,...r})})}),y2=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,i=Ge(zs,t),o=eh(zs,t),{onThumbPositionChange:l}=o,a=hn(e,d=>o.onThumbChange(d)),c=M.useRef(void 0),u=ai(()=>{c.current&&(c.current(),c.current=void 0)},100);return M.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const h=k2(d,l);c.current=h,l()}};return l(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,l]),p.jsx($t.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ot(n.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,g=d.clientY-h.top;o.onThumbPointerDown({x:m,y:g})}),onPointerUp:Ot(n.onPointerUp,o.onThumbPointerUp)})});nh.displayName=zs;var El="ScrollAreaCorner",rh=M.forwardRef((n,e)=>{const t=Ge(El,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?p.jsx(x2,{...n,ref:e}):null});rh.displayName=El;var x2=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=Ge(El,t),[i,o]=M.useState(0),[l,a]=M.useState(0),c=!!(i&&l);return Pn(s.scrollbarX,()=>{const u=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(u),a(u)}),Pn(s.scrollbarY,()=>{const u=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(u),o(u)}),c?p.jsx($t.div,{...r,ref:e,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Bs(n){return n?parseInt(n,10):0}function sh(n,e){const t=n/e;return isNaN(t)?0:t}function li(n){const e=sh(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function b2(n,e,t,r="ltr"){const s=li(t),i=s/2,o=e||i,l=s-o,a=t.scrollbar.paddingStart+o,c=t.scrollbar.size-t.scrollbar.paddingEnd-l,u=t.content-t.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return ih([a,c],d)(n)}function yc(n,e,t="ltr"){const r=li(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,o=e.content-e.viewport,l=i-r,a=t==="ltr"?[0,o]:[o*-1,0],c=Ep(n,a);return ih([0,o],[0,l])(c)}function ih(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function oh(n,e){return n>0&&n<e}var k2=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const i={left:n.scrollLeft,top:n.scrollTop},o=t.left!==i.left,l=t.top!==i.top;(o||l)&&e(),t=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function ai(n,e){const t=Ut(n),r=M.useRef(0);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),M.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Pn(n,e){const t=Ut(e);kc(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var S2=Gf,v2=Yf,w2=rh;function Ow(n){const e=P.c(17);let t,r,s,i;e[0]!==n?({className:r,children:t,hideScrollbar:i,...s}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s,e[4]=i):(t=e[1],r=e[2],s=e[3],i=e[4]);const o=i===void 0?!1:i;let l;e[5]!==r?(l=Z("relative h-full w-full",r),e[5]=r,e[6]=l):l=e[6];let a;e[7]!==t?(a=p.jsx(v2,{"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:p.jsx("div",{className:"flex min-w-0 flex-col",children:t})}),e[7]=t,e[8]=a):a=e[8];let c;e[9]!==o?(c=p.jsx(C2,{hideScrollbar:o}),e[9]=o,e[10]=c):c=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx(w2,{}),e[11]=u):u=e[11];let d;return e[12]!==s||e[13]!==l||e[14]!==a||e[15]!==c?(d=p.jsxs(S2,{"data-slot":"scroll-area",className:l,...s,children:[a,c,u]}),e[12]=s,e[13]=l,e[14]=a,e[15]=c,e[16]=d):d=e[16],d}function C2(n){const e=P.c(15);let t,r,s,i;e[0]!==n?({className:t,orientation:s,hideScrollbar:i,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s,e[4]=i):(t=e[1],r=e[2],s=e[3],i=e[4]);const o=s===void 0?"vertical":s,l=i===void 0?!1:i,a=o==="vertical"&&"h-full w-2.5 border-l border-l-transparent",c=o==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",u=l&&"hidden";let d;e[5]!==t||e[6]!==a||e[7]!==c||e[8]!==u?(d=Z("select-none touch-none p-px transition-colors",a,c,u,t),e[5]=t,e[6]=a,e[7]=c,e[8]=u,e[9]=d):d=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=p.jsx(nh,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let h;return e[11]!==o||e[12]!==r||e[13]!==d?(h=p.jsx(Qf,{"data-slot":"scroll-area-scrollbar",orientation:o,className:d,...r,children:f}),e[11]=o,e[12]=r,e[13]=d,e[14]=h):h=e[14],h}export{vw as A,Ew as B,Tw as C,le as D,Yd as E,Qx as F,Lv as G,Aw as H,Nw as I,Uk as J,ni as M,Av as O,Dp as P,Bk as R,Ow as S,Cw as T,Ev as a,ww as b,gw as c,$x as d,Fk as e,Hk as f,Oo as g,Vk as h,Pk as i,sf as j,Ip as k,of as l,kw as m,Se as n,ae as o,Sw as p,Pe as q,yw as r,Io as s,Hc as t,Mw as u,bw as v,qx as w,ol as x,xw as y,Jx as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,l as w,j as a,i as j}from"./index-
|
|
1
|
+
import{c as b,l as w,j as a,i as j}from"./index-DrM3Gy-E.js";import{i as N}from"./SearchMd-DaWHy1GV.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as t,a2 as P,r as j,ae as w,B as S,t as y}from"./index-
|
|
1
|
+
import{c as p,j as t,a2 as P,r as j,ae as w,B as S,t as y}from"./index-DrM3Gy-E.js";import{i as k}from"./AlertCircle-CzPpSV3W.js";import{s as z}from"./Plus-DHDiWYHk.js";import{s as F}from"./User01-BtO-AoKy.js";import{t as E}from"./Users01-BRTza8nY.js";import{d as $,c as I,D as O,a as A,b as R,e as T}from"./dialog-L9SFsS1U.js";import{I as N}from"./input-BiM4A7Ep.js";import{L as g}from"./label-CjJncELr.js";import{d as B,b as V,c as L,S as q,a as C}from"./select-lfhjFS6i.js";import{S as H}from"./skeleton-CQjs3VsL.js";import{T as K}from"./textarea-CoSni5ST.js";import{P as b}from"./index-BYWWr4r7.js";import{c as W}from"./settings-section-uGwPOE8T.js";import{u as Y,a as G}from"./use-secrets-DzWb-lJi.js";import{R as J}from"./require-capability-7xlqOMAl.js";import"./X-1BuEzBGR.js";import"./tooltip-Cs_BNuMF.js";import"./ChevronUp-BurUkCqE.js";import"./ChevronDown-Di-ZHzN-.js";import"./sidebar-BDxhgXc-.js";import"./LayoutLeft-nNhAa0Dy.js";import"./sheet-nKeubIDJ.js";import"./card-DQnbTJFb.js";import"./ArrowUpRight-BefNTATY.js";import"./studio-tools-CAUx-JUt.js";import"./use-capability-_e3uVe_7.js";import"./access-gate-CGKEhEok.js";import"./capability-load-error-HdFgr5IE.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function $e(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{$e as default};
|