decocms 4.513.7 → 4.514.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-C7oRfBvq.js → ActiveShapeUtils-VLdZwTWH.js} +1 -1
- package/dist/client/assets/{AlertCircle-Dr8-y7L0.js → AlertCircle-Chv0zwfM.js} +1 -1
- package/dist/client/assets/{AreaChart-DxgH6rKB.js → AreaChart-xRBpMPmy.js} +1 -1
- package/dist/client/assets/{ArrowLeft-bw15twJo.js → ArrowLeft-P5MTc2kM.js} +1 -1
- package/dist/client/assets/{ArrowUp-B5saELrq.js → ArrowUp-B9orjFiD.js} +1 -1
- package/dist/client/assets/{BarChart-BjUiD6cJ.js → BarChart-BLqplpUZ.js} +1 -1
- package/dist/client/assets/{Building02-CVSwXera.js → Building02-Bhj7SR-R.js} +1 -1
- package/dist/client/assets/{CartesianChart-yDLikkrw.js → CartesianChart-BjPyBEv_.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DF7o1YJ4.js → CategoricalChart-sikMJnQl.js} +1 -1
- package/dist/client/assets/{CheckCircle-DS2hb5oP.js → CheckCircle-BOOTvtN7.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CLuT1zAP.js → ChevronSelectorVertical-CKvNz838.js} +1 -1
- package/dist/client/assets/{ChevronUp-Da3KAAR7.js → ChevronUp-UOllpHWY.js} +1 -1
- package/dist/client/assets/{Copy01-Dn1u-2Zy.js → Copy01-CsZzLh_E.js} +1 -1
- package/dist/client/assets/{CreditCard01-DGwiu3_R.js → CreditCard01-Bji4icQZ.js} +1 -1
- package/dist/client/assets/{DotsVertical-CNUAKCA1.js → DotsVertical-BaN_NJ8K.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CNTq4Zkp.js → ErrorBarContext-D_W32jld.js} +1 -1
- package/dist/client/assets/{Globe04-B44qaniR.js → Globe04-BOt08kHg.js} +1 -1
- package/dist/client/assets/{Image01-hRrNF-M-.js → Image01-Ffg_Ow_R.js} +1 -1
- package/dist/client/assets/{Key01-DYxB6pya.js → Key01-BVuT8y7b.js} +1 -1
- package/dist/client/assets/{Link01-4vw5jtmA.js → Link01-Du3sgYhY.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CIPqinmW.js → LinkBroken01-D3nON0AT.js} +1 -1
- package/dist/client/assets/Minus-qI5XA_m8.js +1 -0
- package/dist/client/assets/{Monitor01-Brf4xOs8.js → Monitor01-DPFmNrHU.js} +1 -1
- package/dist/client/assets/{Play-D0AVCW7c.js → Play-CKRH5LhK.js} +1 -1
- package/dist/client/assets/{Plus-CaUk_FLH.js → Plus-Dr-ysAIN.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BgQgv_tf.js → ReferenceLine-DTjjPG4Y.js} +1 -1
- package/dist/client/assets/{SearchMd-DLWoWucQ.js → SearchMd-D_t1juud.js} +1 -1
- package/dist/client/assets/{Sector-N8qw7UTi.js → Sector-B0wid3BW.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-B4RZkB_f.js → ShoppingBag01-CVVvTwrH.js} +1 -1
- package/dist/client/assets/{Sun-B00MbfKh.js → Sun-Cgn1IQVJ.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BzSCnRCW.js → SwitchHorizontal01-CEx9qTgC.js} +1 -1
- package/dist/client/assets/Tool01-Dys7Z5ab.js +1 -0
- package/dist/client/assets/{Trash01-CqUcDLSi.js → Trash01--FklAmhG.js} +1 -1
- package/dist/client/assets/{Upload01-DMpQSW4j.js → Upload01-BeT7SqGm.js} +1 -1
- package/dist/client/assets/{User01-B8psxoPR.js → User01-C3IPjJ5l.js} +1 -1
- package/dist/client/assets/{UserSquare-C87_Ow7C.js → UserSquare-CaU54i61.js} +1 -1
- package/dist/client/assets/{Users01-D8pzXgR8.js → Users01-BZXT5qAC.js} +1 -1
- package/dist/client/assets/{XClose-Dfy4H4Df.js → XClose-Cjrx49Z1.js} +1 -1
- package/dist/client/assets/{ZoomOut-CGUQd16X.js → ZoomOut-Bi4ExiY7.js} +1 -1
- package/dist/client/assets/{access-gate-CDyNIkXG.js → access-gate-DMrwc1hr.js} +1 -1
- package/dist/client/assets/active-indicator-CCMhAsc_.js +1 -0
- package/dist/client/assets/add-connection-dialog-CtRrIzJJ.js +1 -0
- package/dist/client/assets/agent-analytics-Bnwy_Gqw.js +2 -0
- package/dist/client/assets/agent-app-ZIqUjeyR.js +1 -0
- package/dist/client/assets/agent-assets-DwMNxzbi.js +1 -0
- package/dist/client/assets/agent-automation-02Z5hyQu.js +20 -0
- package/dist/client/assets/agent-automations-CFPQlvb2.js +1 -0
- package/dist/client/assets/agent-connect-sources-Iuxi1z0Z.js +1 -0
- package/dist/client/assets/agent-deck-BbRRpKSj.js +1 -0
- package/dist/client/assets/agent-e2e-CF9xjkgd.js +1 -0
- package/dist/client/assets/agent-experiments-CFFDp5bP.js +1 -0
- package/dist/client/assets/agent-file-BMs4cJrj.js +1 -0
- package/dist/client/assets/agent-hosting-BkhWgDEP.js +1 -0
- package/dist/client/assets/agent-icon-sWZwj0Es.js +1 -0
- package/dist/client/assets/agent-library-B-Wls_Sg.js +1 -0
- package/dist/client/assets/agent-library-file-wqWJ8B3w.js +1 -0
- package/dist/client/assets/agent-monitor-5rJ2SPuO.js +1 -0
- package/dist/client/assets/agent-overview-c6SNk0le.js +1 -0
- package/dist/client/assets/agent-releases-D570Q4Mh.js +2 -0
- package/dist/client/assets/agent-settings-B8J4yqzP.js +1 -0
- package/dist/client/assets/agent-site-editor-code-KKCPuRYa.js +2 -0
- package/dist/client/assets/agent-site-editor-content-lFAgfEzB.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-BtpIiq0Q.js +1 -0
- package/dist/client/assets/{agent-site-editor-Sbn76JsU.js → agent-site-editor-uS5XJ69l.js} +17 -17
- package/dist/client/assets/agent-view-DV9c8H6A.js +1 -0
- package/dist/client/assets/{agent-view-guard-DC3OSkRt.js → agent-view-guard-D6Xp5buw.js} +1 -1
- package/dist/client/assets/agents-list-DOombnHa.js +1 -0
- package/dist/client/assets/ai-providers-tmz_JP24.js +6 -0
- package/dist/client/assets/alert-VfejUnRf.js +1 -0
- package/dist/client/assets/alert-dialog-XdiY2J_y.js +7 -0
- package/dist/client/assets/analytics-sections-ji2C2qln.js +1 -0
- package/dist/client/assets/api-keys-DGmfxaaK.js +1 -0
- package/dist/client/assets/api-keys-wu5nx6nR.js +1 -0
- package/dist/client/assets/app-editor-Cu9bylSk.js +1 -0
- package/dist/client/assets/{asset-utils-EMf-xj3-.js → asset-utils-CKM5FMXp.js} +1 -1
- package/dist/client/assets/{auth-BUCalyQg.js → auth-CR47t1GM.js} +1 -1
- package/dist/client/assets/{auth-catchall-D0OSJt--.js → auth-catchall-B1w-i5RZ.js} +1 -1
- package/dist/client/assets/auth-entry-oRjY0cnq.js +1 -0
- package/dist/client/assets/{auth-split-layout-CqIIL5cn.js → auth-split-layout-CiycErWO.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-KmGsQ7Rw.js → authenticate-and-persist-oauth-D5GDklWs.js} +1 -1
- package/dist/client/assets/automation-list-row-CCxYnaw4.js +1 -0
- package/dist/client/assets/automation-runs-CbO3I7fA.js +1 -0
- package/dist/client/assets/automations-DFS7mz__.js +1 -0
- package/dist/client/assets/{autosend-DXt3gh_V.js → autosend-DnRIvL7O.js} +1 -1
- package/dist/client/assets/avatar-x6P8tYtf.js +1 -0
- package/dist/client/assets/badge-0pHsypn4.js +1 -0
- package/dist/client/assets/block-document-D_lHlXH9.js +3 -0
- package/dist/client/assets/{blocks-preview-workspace-context-BW_d0PQH.js → blocks-preview-workspace-context--l_lynd7.js} +1 -1
- package/dist/client/assets/blocks-tab-states-llhicB0-.js +20 -0
- package/dist/client/assets/blog-schema-XUQos-wQ.js +1 -0
- package/dist/client/assets/buckets-FE463cqq.js +1 -0
- package/dist/client/assets/{build-improve-prompt-doc-Bc54QDB4.js → build-improve-prompt-doc-R7g2gEoJ.js} +1 -1
- package/dist/client/assets/{calendar-Xs6wdWPB.js → calendar-Dt43s5dd.js} +1 -1
- package/dist/client/assets/{capability-load-error-CTAYiETg.js → capability-load-error-BwHvNdC3.js} +1 -1
- package/dist/client/assets/category-editor-ChXNS4Vx.js +1 -0
- package/dist/client/assets/{chart-CORGJWsK.js → chart-BtbkFiWd.js} +1 -1
- package/dist/client/assets/{chat-context-q6pkU4Vf.js → chat-context-DHXBy843.js} +6 -6
- package/dist/client/assets/{chat-draft-CxsMQwFW.js → chat-draft-DZ2UGoju.js} +1 -1
- package/dist/client/assets/checkbox-J7NM8Nxa.js +1 -0
- package/dist/client/assets/choose-editor-sfJnCc8D.js +1 -0
- package/dist/client/assets/{cli-auth-success-SvU9VUFl.js → cli-auth-success-C3tfQ2C3.js} +1 -1
- package/dist/client/assets/{client-icons-Bf_jg3TD.js → client-icons-Cv4YCEZF.js} +1 -1
- package/dist/client/assets/cms-settings-editor-DfS-CnoD.js +1 -0
- package/dist/client/assets/{collapsible-BY1Seh2g.js → collapsible-C5IcK6_6.js} +1 -1
- package/dist/client/assets/collection-detail-CE3RN1bQ.js +1 -0
- package/dist/client/assets/collection-display-button-XyzcBi3s.js +1 -0
- package/dist/client/assets/{collection-search-B-5U_qP0.js → collection-search-EaUyhqe3.js} +1 -1
- package/dist/client/assets/collection-table-wrapper-AoIZEo7k.js +1 -0
- package/dist/client/assets/collection-tabs-CvrE77Fy.js +1 -0
- package/dist/client/assets/{column-rules-qdNVr_CJ.js → column-rules-Uuv3kpod.js} +1 -1
- package/dist/client/assets/combobox-GJu0SOmd.js +1 -0
- package/dist/client/assets/{coming-soon-page-DArmsjGV.js → coming-soon-page-C252kDGK.js} +1 -1
- package/dist/client/assets/command-CxL64Rh6.js +1 -0
- package/dist/client/assets/companion-mcps-section-dLU7TCqp.js +1 -0
- package/dist/client/assets/config-MIIbcSQe.js +1 -0
- package/dist/client/assets/connect-CPLWL7jD.js +9 -0
- package/dist/client/assets/connect-layout-DKbxeOaE.js +1 -0
- package/dist/client/assets/{connection-ByKWMYw_.js → connection-Dwyi3srb.js} +1 -1
- package/dist/client/assets/{connection-card-fTcKF10T.js → connection-card-Fd6iPvoW.js} +1 -1
- package/dist/client/assets/connection-detail-2wc1W9tk.js +1 -0
- package/dist/client/assets/connection-form-helpers-Be0GZ2Fr.js +1 -0
- package/dist/client/assets/connections-CXtzZLwk.js +1 -0
- package/dist/client/assets/content-tab-C6Yd-gaA.js +22 -0
- package/dist/client/assets/context-CTmvExSC.js +1 -0
- package/dist/client/assets/{context-menu-BXueaN2d.js → context-menu-Sl80TmNB.js} +1 -1
- package/dist/client/assets/context-shell-Luc3_ZNi.js +197 -0
- package/dist/client/assets/{core.esm-CRtLiDZz.js → core.esm-3Ntqpx6o.js} +2 -2
- package/dist/client/assets/{create-organization-dialog-C4Y0emfE.js → create-organization-dialog-Y8ioappi.js} +1 -1
- package/dist/client/assets/{daily-pulse-CIrtyrdA.js → daily-pulse-BokyOzAt.js} +1 -1
- package/dist/client/assets/discover-NdJwdhLd.js +1 -0
- package/dist/client/assets/{domain-settings-B0NQXKWl.js → domain-settings-DjKwxNmK.js} +1 -1
- package/dist/client/assets/{drawer-CgIff6c2.js → drawer-2qaZT3bV.js} +1 -1
- package/dist/client/assets/{editor-B3mInGrz.js → editor-D4klHvzy.js} +1 -1
- package/dist/client/assets/editor-classes-BBdx-JSY.js +1 -0
- package/dist/client/assets/{empty-state-CrGmAT1k.js → empty-state-CLeOp2iF.js} +1 -1
- package/dist/client/assets/empty-state-kKu94zqY.js +1 -0
- package/dist/client/assets/{extract-connection-data-BINlvp6q.js → extract-connection-data-BRxw-vDj.js} +1 -1
- package/dist/client/assets/{feature-gate-CO2kUTpS.js → feature-gate-DtQbinUr.js} +1 -1
- package/dist/client/assets/{feature-paywall-pO5N9aZ0.js → feature-paywall-BvbLf2vN.js} +1 -1
- package/dist/client/assets/file-explorer-CRhBeOh6.js +2 -0
- package/dist/client/assets/file-preview-sewMgnQS.js +1 -0
- package/dist/client/assets/file-share-button-CvBuOPBB.js +3 -0
- package/dist/client/assets/{file-type-icon-D66MjYUZ.js → file-type-icon-L81OHsVz.js} +1 -1
- package/dist/client/assets/folder-icon-yKBQ26US.js +2 -0
- package/dist/client/assets/{form-BDq24hv6.js → form-oexeEAr5.js} +1 -1
- package/dist/client/assets/general-DjPGqCh1.js +1 -0
- package/dist/client/assets/home-x3m8wBSJ.js +1 -0
- package/dist/client/assets/{hosted-publish-feedback-BWTEMXo-.js → hosted-publish-feedback-GSHWRd1_.js} +1 -1
- package/dist/client/assets/{icon-button-D7DkXPm6.js → icon-button-DfIZISrS.js} +1 -1
- package/dist/client/assets/{index-CnFj2VzS.js → index-5UrkGUsp.js} +1 -1
- package/dist/client/assets/index-B-ZICxtp.js +1 -0
- package/dist/client/assets/{index-2AvhxrGF.js → index-B50XV3gp.js} +1 -1
- package/dist/client/assets/{index-C15EALb7.js → index-BAK2VowX.js} +1 -1
- package/dist/client/assets/index-BNHeiq0Q.js +1 -0
- package/dist/client/assets/index-C0_wKyXa.js +4 -0
- package/dist/client/assets/index-CWfwo1z9.css +1 -0
- package/dist/client/assets/{index-BpdNOm6A.js → index-CYAP4xje.js} +1 -1
- package/dist/client/assets/index-CiDUJoU5.js +4 -0
- package/dist/client/assets/{index-BAMJsKZC.js → index-Cyd8Z3z7.js} +23 -23
- package/dist/client/assets/{index-L2sJXZRT.js → index-DlkvGq_Y.js} +1 -1
- package/dist/client/assets/index-DlxFtSYK.js +2 -0
- package/dist/client/assets/{index-DCfyI4nr.js → index-DpopmD-d.js} +1 -1
- package/dist/client/assets/{index-Dfl75K1t.js → index-DwUSgMrk.js} +38 -38
- package/dist/client/assets/{index-CBygj5xH.js → index-no3MX84i.js} +2 -2
- package/dist/client/assets/index-rABmEORU.js +5 -0
- package/dist/client/assets/{index-redirect-abhy0hCb.js → index-redirect-B1_VIFp-.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-ClHpbKHL.js → infiniteQueryObserver-fD19WDlu.js} +1 -1
- package/dist/client/assets/infra-billing-DeTird2m.js +1 -0
- package/dist/client/assets/input-BcdjLg5X.js +17 -0
- package/dist/client/assets/input-YsL3Z14x.js +1 -0
- package/dist/client/assets/{integration-icon-CjRJJK7e.js → integration-icon-CGlpUTQF.js} +1 -1
- package/dist/client/assets/{jira-icon-DErmkgBq.js → jira-icon-DpMHb8bf.js} +1 -1
- package/dist/client/assets/{label-vST9B_zD.js → label-9iahSV8V.js} +1 -1
- package/dist/client/assets/{layout-Gxe43rXe.js → layout-4cUTvlr5.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BfHNa36K.js → legacy-agents-deep-CE1ZIf89.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DYsSPAs0.js → legacy-main-redirect-BOOZ04G2.js} +1 -1
- package/dist/client/assets/library-BzLsSIpk.js +1 -0
- package/dist/client/assets/{location-BjlyegC2.js → location-V0VwTJTt.js} +1 -1
- package/dist/client/assets/{login-W2r99PnM.js → login-Di_zn9Rr.js} +1 -1
- package/dist/client/assets/{markdown-WjT3O7Yl.js → markdown-DQgkOB--.js} +3 -3
- package/dist/client/assets/{mcp-app-renderer-DRnWxtxP.js → mcp-app-renderer-E0Rb-X88.js} +2 -2
- package/dist/client/assets/{mcp-oauth-DhGcrPZn.js → mcp-oauth-Bvn81zXq.js} +1 -1
- package/dist/client/assets/{mcp-oauth-tbYTQeai.js → mcp-oauth-DQ15yEaL.js} +1 -1
- package/dist/client/assets/members-4brJt64W.js +1 -0
- package/dist/client/assets/{memory-DF3z-jf4.js → memory-C7XTx0yg.js} +2 -2
- package/dist/client/assets/mini-report-page-Dd9QKBqa.js +1 -0
- package/dist/client/assets/mock-board-Ds2_Ixhv.js +81 -0
- package/dist/client/assets/{monaco-editor-Dn76gAcx.js → monaco-editor-pm8M8s-N.js} +2 -2
- package/dist/client/assets/monitoring-GFsyOhLD.js +1 -0
- package/dist/client/assets/monitoring-stats-row-DSg2pS6E.js +1 -0
- package/dist/client/assets/multi-select-uR1MVHE3.js +1 -0
- package/dist/client/assets/{mustache-De5yIPqS.js → mustache-Kcmg3c_A.js} +1 -1
- package/dist/client/assets/{new-project-dialog-DWBJxe2s.js → new-project-dialog-zI2HVFQT.js} +1 -1
- package/dist/client/assets/{oauth-callback-D5U2NrXh.js → oauth-callback-B-8An67A.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DxPpDYvA.js → oauth-callback-ai-provider-C2GrwmUm.js} +1 -1
- package/dist/client/assets/onboarding-C5CJ17Jm.js +1 -0
- package/dist/client/assets/openai-conversation-B8Y0DM4W.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-C0cO7F22.js → optimistic-project-sidebar-views-DbcREcFy.js} +1 -1
- package/dist/client/assets/{order-monitor-day-QXWmu69V.js → order-monitor-day-CkXiopdS.js} +1 -1
- package/dist/client/assets/organization-choice-BsHIbX2m.js +1 -0
- package/dist/client/assets/{orgs-BxWXdeOL.js → orgs-CYS6Kjbu.js} +1 -1
- package/dist/client/assets/{page-seo-form-CG-qEPcj.js → page-seo-form-DiFnoI3j.js} +1 -1
- package/dist/client/assets/pair-BVAQv2mv.js +48 -0
- package/dist/client/assets/plan-CFOdn8Gq.js +1 -0
- package/dist/client/assets/{plan-ladder-BYQb9LH4.js → plan-ladder-hFJpqSg5.js} +1 -1
- package/dist/client/assets/popover-kKTDdvYS.js +1 -0
- package/dist/client/assets/post-calendar-fLDkPFOG.js +1 -0
- package/dist/client/assets/post-editor-kAgu7v4k.js +2 -0
- package/dist/client/assets/{preview-content-DKsnwXbk.js → preview-content-BmpJoYAF.js} +1 -1
- package/dist/client/assets/{preview-dialog-CbP43Gmi.js → preview-dialog-1doPIjMd.js} +1 -1
- package/dist/client/assets/{preview-panel-BcsdNlh3.js → preview-panel-CD98bDar.js} +1 -1
- package/dist/client/assets/preview-tab-CNqKfb-E.js +551 -0
- package/dist/client/assets/product-picker-dialog-D5ZR-4jN.js +1 -0
- package/dist/client/assets/profile-Bx09OmQG.js +1 -0
- package/dist/client/assets/project-app-view-i9ZXlEA5.js +1 -0
- package/dist/client/assets/project-apps-DjY-pfpC.js +1 -0
- package/dist/client/assets/project-feed-AQtypsNP.js +1 -0
- package/dist/client/assets/project-icon-DzYy4wKu.js +1 -0
- package/dist/client/assets/project-reports-CkkyEEQq.js +1 -0
- package/dist/client/assets/project-tasks-C6uZ3VD_.js +1 -0
- package/dist/client/assets/projects-Bl4qWgcF.js +1 -0
- package/dist/client/assets/{projects-empty-state-DC2csJcM.js → projects-empty-state-VSVQUIX3.js} +1 -1
- package/dist/client/assets/{prompts-CZxZPA4q.js → prompts-XJP0lHjx.js} +1 -1
- package/dist/client/assets/record-editor-DQnsC6va.js +1 -0
- package/dist/client/assets/redirect-editor-zBgb8pHu.js +1 -0
- package/dist/client/assets/{reports-enM7SgQ5.js → reports-BE9tpjsQ.js} +2 -2
- package/dist/client/assets/reports-BkHs6ceB.js +1 -0
- package/dist/client/assets/reports-onboarding-djvrypII.js +1 -0
- package/dist/client/assets/reports-tab-DTd-sN5F.js +2 -0
- package/dist/client/assets/repositories-jscn92Gx.js +1 -0
- package/dist/client/assets/repositories-lD386pbK.js +1 -0
- package/dist/client/assets/{repository-binding-CeR4BnTI.js → repository-binding-Ctv5jACU.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Cyu_oqW_.js → repository-import-picker-DXFAIhGC.js} +1 -1
- package/dist/client/assets/{repository-picker-nkOuiQyx.js → repository-picker-C-87Ak81.js} +1 -1
- package/dist/client/assets/{require-capability-D9vWIFzq.js → require-capability-BOhrH32F.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DLWEf_ml.js → required-auth-layout-BOZelCHP.js} +1 -1
- package/dist/client/assets/{reset-password-Di43QH7d.js → reset-password-D_RSIa3W.js} +1 -1
- package/dist/client/assets/{resizable-DrblSvH-.js → resizable-CcGplCtq.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-Cn1kjNtM.js → resolve-tab-icon-Dy1gZT8r.js} +1 -1
- package/dist/client/assets/review-settings-DJRBjChO.js +1 -0
- package/dist/client/assets/roles-IPKUXurs.js +1 -0
- package/dist/client/assets/route-CEyEwTNJ.js +1 -0
- package/dist/client/assets/route-DYdh0lyb.js +1 -0
- package/dist/client/assets/route-DkxQ33qF.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-B7L9kJQk.js → sandbox-lifecycle-context-B_iyl6NM.js} +1 -1
- package/dist/client/assets/{schema-BnxatK0k.js → schema-C9VtMeBM.js} +1 -1
- package/dist/client/assets/{schema-DweHpmdK.js → schema-CIU-vy-M.js} +1 -1
- package/dist/client/assets/{scroll-area-D4jamxk5.js → scroll-area-BgPjdFUv.js} +1 -1
- package/dist/client/assets/search-input-6roNTbiB.js +1 -0
- package/dist/client/assets/search-toggle-6uVgZqDd.js +1 -0
- package/dist/client/assets/{secret-ciphertext-uupbc2jA.js → secret-ciphertext-DFilJK15.js} +1 -1
- package/dist/client/assets/{secret-picker-CZg0ZavN.js → secret-picker-DRod6Suz.js} +1 -1
- package/dist/client/assets/secrets-wckAePsp.js +1 -0
- package/dist/client/assets/sections-editor-DvRXHJYg.js +4 -0
- package/dist/client/assets/{sections-ClTsoWOj.js → sections-ogB-svMV.js} +1 -1
- package/dist/client/assets/select-DSSug2fd.js +1 -0
- package/dist/client/assets/select-model-qiewDWcs.js +1 -0
- package/dist/client/assets/seo-editor-BTHpHgYq.js +1 -0
- package/dist/client/assets/{separator-x0saGhsc.js → separator-RD1Gkb6T.js} +1 -1
- package/dist/client/assets/settings-tab-_PnJc2CP.js +1 -0
- package/dist/client/assets/sheet-B-tTREXV.js +1 -0
- package/dist/client/assets/shell-layout-CCN75UAi.js +1 -0
- package/dist/client/assets/site-editor-59L0Aud8.js +1 -0
- package/dist/client/assets/{site-editor-toast-BBiagqFO.js → site-editor-toast-CWvkPJE7.js} +1 -1
- package/dist/client/assets/skills-BTCtj4sL.js +1 -0
- package/dist/client/assets/slider-axq58KTi.js +1 -0
- package/dist/client/assets/{sortable.esm-CiWkMI5k.js → sortable.esm-DUpSK4fM.js} +1 -1
- package/dist/client/assets/{sso-CbBgQbQ6.js → sso-DIJKG0Gf.js} +1 -1
- package/dist/client/assets/{suggestion-MTVcBuMB.js → suggestion-Be-l0Vt9.js} +2 -2
- package/dist/client/assets/switch-CPLmKtep.js +1 -0
- package/dist/client/assets/{symbol-3z2SP5L0.js → symbol-Bevi1KjX.js} +1 -1
- package/dist/client/assets/synced-repos-CDGSA9__.js +1 -0
- package/dist/client/assets/{tab-icon-glyph-D0nUUha7.js → tab-icon-glyph-DYfErhsy.js} +1 -1
- package/dist/client/assets/{table-34IUcwFv.js → table-B1WNxn6C.js} +1 -1
- package/dist/client/assets/tabs-CBoEFGVa.js +1 -0
- package/dist/client/assets/task-assignee-avatar-DNUvYoRs.js +1 -0
- package/dist/client/assets/{task-board-HULGRfOW.js → task-board-CDUMGTb-.js} +1 -1
- package/dist/client/assets/{task-route-Ce0gmf6w.js → task-route-BpUah0sB.js} +1 -1
- package/dist/client/assets/{task-status-EXrg0ZVz.js → task-status-Bxq1hmIf.js} +1 -1
- package/dist/client/assets/taskboard-analytics-DiMdGRcj.js +1 -0
- package/dist/client/assets/tasks-C43XRe6P.js +4 -0
- package/dist/client/assets/tasks-D3vb1Iwc.js +1 -0
- package/dist/client/assets/textarea-CQ_TkrdE.js +1 -0
- package/dist/client/assets/thread-analytics-D_JGJCHX.js +1 -0
- package/dist/client/assets/{thread-intent-CLVOCoii.js → thread-intent-DYNUY6FR.js} +1 -1
- package/dist/client/assets/{thread-route-Dcyau0Uq.js → thread-route-Cr8HKNDQ.js} +1 -1
- package/dist/client/assets/thread-route-xZCxiRJg.js +1 -0
- package/dist/client/assets/thread-sheet-body-CRJYPU36.js +1 -0
- package/dist/client/assets/{time-range-picker-Cnad4hdN.js → time-range-picker-CsKO958P.js} +1 -1
- package/dist/client/assets/toggle-group-CaNHwi3W.js +1 -0
- package/dist/client/assets/{tool-namespace-B34zfZd8.js → tool-namespace-D8-HQWQE.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Bk8X_nOI.js → toolbar-icon-button-pGWMZONn.js} +1 -1
- package/dist/client/assets/{tooltip-BntBAGAM.js → tooltip-7xQKXZXx.js} +1 -1
- package/dist/client/assets/{tooltipContext-DXMyjDX5.js → tooltipContext-BM_DUTQp.js} +1 -1
- package/dist/client/assets/{track-BzAXAHNU.js → track-5WqIg6Tn.js} +1 -1
- package/dist/client/assets/{types-Ep1zDBBM.js → types-DmsgcF8m.js} +6 -6
- package/dist/client/assets/{url-slug-DUZRhSs8.js → url-slug-CMhgSj9A.js} +1 -1
- package/dist/client/assets/{usage-stats-BqiobWm8.js → usage-stats-BKxLD2_l.js} +2 -2
- package/dist/client/assets/{use-ai-providers-BjL_410_.js → use-ai-providers-Dp4Hkjtx.js} +1 -1
- package/dist/client/assets/{use-automations-D3fYuk85.js → use-automations-J0jLeJwk.js} +1 -1
- package/dist/client/assets/{use-autosave-C5kOmKNl.js → use-autosave-DmDY7YGA.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-pFcrZZ0z.js → use-chat-layout-state-DeeoSPAs.js} +1 -1
- package/dist/client/assets/{use-clock-tick-B0Rju5iF.js → use-clock-tick-C6h2MMIi.js} +1 -1
- package/dist/client/assets/use-connect-companion-hQGadPnV.js +1 -0
- package/dist/client/assets/{use-connection-uNG89bZG.js → use-connection-mXOC3Xuo.js} +1 -1
- package/dist/client/assets/{use-content-sync-B0qEZVBT.js → use-content-sync-mkwV3WFd.js} +1 -1
- package/dist/client/assets/{use-copy-C3XLF-5W.js → use-copy-D9a2GtFe.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BKCuACo2.js → use-create-virtual-mcp-DtlfKOSb.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BwLo95LG.js → use-date-fns-locale-Dv1VJI3I.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-XLYKP6s7.js → use-debounced-autosave-BZlwz5E9.js} +1 -1
- package/dist/client/assets/{use-debounced-value-3xzq4nqk.js → use-debounced-value-DJVnkGFg.js} +1 -1
- package/dist/client/assets/{use-deco-credits-D-50LuKO.js → use-deco-credits-BCAKdpOu.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-lsitv-U4.js → use-decopilot-events-DYkAp_m7.js} +1 -1
- package/dist/client/assets/use-delete-connection-C00H7ulN.js +1 -0
- package/dist/client/assets/{use-deployment-admin-BJum6mLZ.js → use-deployment-admin-ByxIcPI9.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-2-EI09Yr.js → use-fast-preview-draft-url-apL5qVv1.js} +1 -1
- package/dist/client/assets/{use-file-configs-DfE7CnIY.js → use-file-configs-DJCoczIU.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CiHmMhAj.js → use-inbox-feed-CgTcDvrj.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BkN3ZRt7.js → use-infinite-scroll-AsnNIlBn.js} +1 -1
- package/dist/client/assets/{use-join-requests-D5yahqJC.js → use-join-requests-BJCQZeJg.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Ce_y4iMs.js → use-main-panel-tabs-CwksoiNK.js} +1 -1
- package/dist/client/assets/{use-main-schema-v8-DEN4NEnl.js → use-main-schema-v8-Cys0il1A.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Cs99DRAT.js → use-mcp-auth-status-mE5X1aBV.js} +1 -1
- package/dist/client/assets/use-mcp-client-CvE7itXw.js +10 -0
- package/dist/client/assets/{use-mcp-prompts-BuuMlmL5.js → use-mcp-prompts-B71f8Oap.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CYJBaX_7.js → use-mcp-tools-DT06t5rX.js} +1 -1
- package/dist/client/assets/{use-members-CrbKs_C5.js → use-members-CAjyx4dy.js} +1 -1
- package/dist/client/assets/{use-mobile-CoktYqCA.js → use-mobile-D6Ou0NEP.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CfMrStJi.js → use-navigate-to-agent-DqPVTZYN.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CNnCylra.js → use-open-billing-url-NfOqGe8U.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C0BFh8TT.js → use-org-auth-client-D54JUqPS.js} +1 -1
- package/dist/client/assets/{use-org-fs-T9B43KSX.js → use-org-fs-CnHNkGa0.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BEqn98wH.js → use-org-repo-syncs-B-iMqLC4.js} +1 -1
- package/dist/client/assets/{use-org-sso-BbRo0Ut_.js → use-org-sso-CWjER8s_.js} +1 -1
- package/dist/client/assets/{use-organization-roles-lcGgKXoG.js → use-organization-roles-BaFyhF9z.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DX9QxFXB.js → use-organization-settings-B4xXaxr4.js} +1 -1
- package/dist/client/assets/use-panel-navigate-CwRBX20z.js +1 -0
- package/dist/client/assets/{use-project-native-view-presence-tyHZj_Ny.js → use-project-native-view-presence-fFpbo52Y.js} +1 -1
- package/dist/client/assets/{use-project-scope-jYZSUZz_.js → use-project-scope-CwXHOags.js} +1 -1
- package/dist/client/assets/use-recent-apps-Bm3Mq1hd.js +1 -0
- package/dist/client/assets/{use-releases-CfA2F4jK.js → use-releases-COy4R50l.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Dju7BGsx.js → use-reports-diagnostic-Bf7x0h8K.js} +1 -1
- package/dist/client/assets/{use-secrets-CfU9WX5Q.js → use-secrets-Db7kDjN7.js} +1 -1
- package/dist/client/assets/use-section-preview-base-yuSGDzoI.js +1 -0
- package/dist/client/assets/use-sidebar-collapsed-2XEtdu2i.js +1 -0
- package/dist/client/assets/{use-tags-DqawlBDR.js → use-tags-BPUktrrg.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CCVxOb5z.js → use-task-board-analytics-Dt--SO4K.js} +1 -1
- package/dist/client/assets/{use-task-board-events-C_nDyMhs.js → use-task-board-events-DHmzNQpi.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-Djpb1Kqq.js → use-task-board-item-prs-DpiWhUD6.js} +1 -1
- package/dist/client/assets/{use-task-metadata-RdAp3Psx.js → use-task-metadata-DJlGx95B.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-vpAXd4tf.js → use-thread-analytics-RjdStU-G.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-AQZDZ-Me.js → use-thread-outputs-hOt5_FqT.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DLjfiCcz.js +1 -0
- package/dist/client/assets/{useQueries-DYxCze5b.js → useQueries-CTk9HeNu.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DJIJLbRA.js +1 -0
- package/dist/client/assets/users-DSisYmgQ.js +1 -0
- package/dist/client/assets/{utils-CsCjfn_2.js → utils-BtlQk18r.js} +1 -1
- package/dist/client/assets/variant-calendar-DM6JVe9j.js +1 -0
- package/dist/client/assets/{variant-draft-pointer-D9wG_BAr.js → variant-draft-pointer-DGsbM6lw.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BRjQCMrx.js → virtual-mcp-C-TlHAqf.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CpyfbzKA.js → watch-sse-pool-wUe9D5Rq.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +484 -484
- package/package.json +1 -1
- package/dist/client/assets/Tool01-CCvEj2ig.js +0 -1
- package/dist/client/assets/add-connection-dialog-COYKS3-h.js +0 -1
- package/dist/client/assets/agent-analytics-Cjimp4I3.js +0 -2
- package/dist/client/assets/agent-app-Dm2Q_Y28.js +0 -1
- package/dist/client/assets/agent-assets-9wdWM8im.js +0 -1
- package/dist/client/assets/agent-automation-Dse0O06l.js +0 -20
- package/dist/client/assets/agent-automations-eFJFkh79.js +0 -1
- package/dist/client/assets/agent-connect-sources-CE_fusHE.js +0 -1
- package/dist/client/assets/agent-deck-Dl8H6e7Z.js +0 -1
- package/dist/client/assets/agent-e2e-S-3oUZjD.js +0 -1
- package/dist/client/assets/agent-experiments-BZ5s-pYA.js +0 -1
- package/dist/client/assets/agent-file-CGHwvl0k.js +0 -1
- package/dist/client/assets/agent-hosting-CIoSw33S.js +0 -1
- package/dist/client/assets/agent-icon-Ck1HHwjS.js +0 -1
- package/dist/client/assets/agent-library-BkTWLlnk.js +0 -1
- package/dist/client/assets/agent-library-file-BS42xyZD.js +0 -1
- package/dist/client/assets/agent-monitor-BO8PHHjA.js +0 -1
- package/dist/client/assets/agent-overview-DpfQ-aTA.js +0 -1
- package/dist/client/assets/agent-releases-BrFQqDPl.js +0 -2
- package/dist/client/assets/agent-settings-BBP4ibAV.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CJOa5UpN.js +0 -2
- package/dist/client/assets/agent-site-editor-content-pcCCjT9D.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BlzuE9E3.js +0 -1
- package/dist/client/assets/agent-view-CQpCMbZg.js +0 -1
- package/dist/client/assets/agents-list-CDK_yCRI.js +0 -1
- package/dist/client/assets/ai-providers-WyXFCfKK.js +0 -6
- package/dist/client/assets/alert-DDsKGOlA.js +0 -1
- package/dist/client/assets/alert-dialog-CdX0WJgE.js +0 -7
- package/dist/client/assets/analytics-sections-C0cA72FI.js +0 -1
- package/dist/client/assets/api-keys-BiACkSl3.js +0 -1
- package/dist/client/assets/api-keys-vaFVbldn.js +0 -1
- package/dist/client/assets/app-editor-DAppi0wZ.js +0 -1
- package/dist/client/assets/auth-entry-0MItOYPB.js +0 -1
- package/dist/client/assets/automation-list-row-BthCY9eh.js +0 -1
- package/dist/client/assets/automation-runs-o6LdIvao.js +0 -1
- package/dist/client/assets/automations-CrS9UK_O.js +0 -1
- package/dist/client/assets/avatar-CEkqz-fA.js +0 -1
- package/dist/client/assets/badge-BzleDbER.js +0 -1
- package/dist/client/assets/block-document-CyrqLFxN.js +0 -3
- package/dist/client/assets/blocks-tab-states-S9Kv7CBl.js +0 -20
- package/dist/client/assets/blog-schema-C4_MnlKC.js +0 -1
- package/dist/client/assets/board-analytics-BF-SADkB.js +0 -1
- package/dist/client/assets/buckets-BlH967CC.js +0 -1
- package/dist/client/assets/category-editor-CtoEGxaZ.js +0 -1
- package/dist/client/assets/checkbox-CFJH9BPU.js +0 -1
- package/dist/client/assets/choose-editor-CYwXqgpB.js +0 -1
- package/dist/client/assets/cms-settings-editor-DtCgs5b4.js +0 -1
- package/dist/client/assets/collection-detail-B2jwEnTE.js +0 -1
- package/dist/client/assets/collection-display-button-D9eLaj8f.js +0 -1
- package/dist/client/assets/collection-table-wrapper-C3Sq91on.js +0 -1
- package/dist/client/assets/collection-tabs-CNPABMbS.js +0 -1
- package/dist/client/assets/combobox-CNtAcM6N.js +0 -1
- package/dist/client/assets/command-Ci3cf65Q.js +0 -1
- package/dist/client/assets/companion-mcps-section-CAp5mGvk.js +0 -1
- package/dist/client/assets/config-BDyxSbhG.js +0 -1
- package/dist/client/assets/connect-CfYMlBCa.js +0 -9
- package/dist/client/assets/connect-layout-Dtk5q8Ff.js +0 -1
- package/dist/client/assets/connection-detail-DauHKo-b.js +0 -1
- package/dist/client/assets/connection-form-helpers-BUWBJaHi.js +0 -1
- package/dist/client/assets/connections-o17r4lvj.js +0 -1
- package/dist/client/assets/content-tab-CDIQdFY6.js +0 -22
- package/dist/client/assets/context-BILSO9Oc.js +0 -1
- package/dist/client/assets/context-shell-nnrd7FeT.js +0 -30
- package/dist/client/assets/discover-Bw3u4SUp.js +0 -1
- package/dist/client/assets/editor-classes-Dh7s7KNE.js +0 -1
- package/dist/client/assets/empty-state-5YwXi_7R.js +0 -1
- package/dist/client/assets/file-explorer-CAi8cI4n.js +0 -2
- package/dist/client/assets/file-preview-B9hKxAYI.js +0 -1
- package/dist/client/assets/file-share-button-CCjiCa6m.js +0 -3
- package/dist/client/assets/flat-project-CbXy-IBz.js +0 -1
- package/dist/client/assets/folder-icon-DLUZphZo.js +0 -2
- package/dist/client/assets/general-2P63tge_.js +0 -1
- package/dist/client/assets/get-initials-D-f_fDFw.js +0 -1
- package/dist/client/assets/home-CDP8nTo9.js +0 -1
- package/dist/client/assets/index-C_HSWEzQ.js +0 -2
- package/dist/client/assets/index-DDndbO_S.js +0 -4
- package/dist/client/assets/index-DVOa5DKI.js +0 -81
- package/dist/client/assets/index-GQJyR46N.js +0 -4
- package/dist/client/assets/index-Pi-s-kcZ.js +0 -1
- package/dist/client/assets/index-kOW30gcj.js +0 -5
- package/dist/client/assets/index-pFm7t22i.css +0 -1
- package/dist/client/assets/index-wpJdtJMA.js +0 -1
- package/dist/client/assets/infra-billing-CUqHLbkr.js +0 -1
- package/dist/client/assets/input-BspCfOSh.js +0 -1
- package/dist/client/assets/input-CYQLD8P6.js +0 -17
- package/dist/client/assets/library-J8tWZ5kP.js +0 -1
- package/dist/client/assets/library-tab-DpChe3Oc.js +0 -168
- package/dist/client/assets/members-B-sc0OYP.js +0 -1
- package/dist/client/assets/mini-report-page-Dsai9GKl.js +0 -1
- package/dist/client/assets/mock-board-pBq2hymy.js +0 -1
- package/dist/client/assets/monitoring-H6E4qKaj.js +0 -1
- package/dist/client/assets/monitoring-stats-row-Elg2qzhe.js +0 -1
- package/dist/client/assets/multi-select-CUNie3kQ.js +0 -1
- package/dist/client/assets/onboarding-DNF1uUd4.js +0 -1
- package/dist/client/assets/openai-conversation-mn8dD0tq.js +0 -3
- package/dist/client/assets/organization-choice-BXhxwrhw.js +0 -1
- package/dist/client/assets/pair-BAh_rtfQ.js +0 -48
- package/dist/client/assets/plan-CfNaQn8P.js +0 -1
- package/dist/client/assets/popover-CltvtP7j.js +0 -1
- package/dist/client/assets/post-calendar-DtsRD0BB.js +0 -1
- package/dist/client/assets/post-editor-Bsz0jGpx.js +0 -2
- package/dist/client/assets/preview-tab-CfPGWoZZ.js +0 -551
- package/dist/client/assets/product-picker-dialog-C1yhPV4m.js +0 -1
- package/dist/client/assets/profile-C9APkMYB.js +0 -1
- package/dist/client/assets/project-app-view-B7OEysJl.js +0 -1
- package/dist/client/assets/project-apps-CpG_eHUm.js +0 -1
- package/dist/client/assets/project-feed-D6ZdsF6M.js +0 -1
- package/dist/client/assets/project-icon-BuiTrqnq.js +0 -1
- package/dist/client/assets/project-reports-DnqnYJVS.js +0 -1
- package/dist/client/assets/project-tasks-Baem7wqr.js +0 -1
- package/dist/client/assets/projects-Dbsz1R9W.js +0 -1
- package/dist/client/assets/record-editor-Cc6nCqy1.js +0 -1
- package/dist/client/assets/redirect-editor-Czcc1h3v.js +0 -1
- package/dist/client/assets/reports-CIjIkssH.js +0 -1
- package/dist/client/assets/reports-onboarding-mNgETpr6.js +0 -1
- package/dist/client/assets/reports-tab-uYYJuIsI.js +0 -2
- package/dist/client/assets/repositories-CdhOGfu_.js +0 -1
- package/dist/client/assets/repositories-SAQW8pIt.js +0 -1
- package/dist/client/assets/review-settings-BdYuIkO8.js +0 -1
- package/dist/client/assets/roles-K5FDY6nJ.js +0 -1
- package/dist/client/assets/route-B_dDu8dc.js +0 -1
- package/dist/client/assets/route-DPBPBesX.js +0 -1
- package/dist/client/assets/route-k25TBS11.js +0 -1
- package/dist/client/assets/search-input-C43mz2qI.js +0 -1
- package/dist/client/assets/search-toggle-DJGOXZ2e.js +0 -1
- package/dist/client/assets/secrets-Bj9KJYtM.js +0 -1
- package/dist/client/assets/sections-editor-BzCesfXD.js +0 -4
- package/dist/client/assets/select-Che713bi.js +0 -1
- package/dist/client/assets/select-model-DWQBXwqD.js +0 -1
- package/dist/client/assets/seo-editor-BqyTpV_N.js +0 -1
- package/dist/client/assets/settings-tab-5vg9K_mk.js +0 -1
- package/dist/client/assets/sheet-GHFRmJIe.js +0 -1
- package/dist/client/assets/shell-layout-CQ32Qhku.js +0 -1
- package/dist/client/assets/site-editor-DrIEYE6g.js +0 -1
- package/dist/client/assets/skills-D6XX-KTb.js +0 -1
- package/dist/client/assets/slider-Ot1ZckhS.js +0 -1
- package/dist/client/assets/switch-DMMNXYVM.js +0 -1
- package/dist/client/assets/synced-repos-BNmgaGcr.js +0 -1
- package/dist/client/assets/tabs-DcgINuCK.js +0 -1
- package/dist/client/assets/task-assignee-avatar-Dq1zRgtZ.js +0 -1
- package/dist/client/assets/taskboard-analytics-Af2fX21J.js +0 -1
- package/dist/client/assets/tasks-BITlMDB1.js +0 -4
- package/dist/client/assets/tasks-BwGddAXN.js +0 -1
- package/dist/client/assets/textarea-BouaqET7.js +0 -1
- package/dist/client/assets/thread-analytics-qopGR3eE.js +0 -1
- package/dist/client/assets/thread-route-CRIeJ9cd.js +0 -1
- package/dist/client/assets/thread-sheet-body-D1u2Dd0I.js +0 -1
- package/dist/client/assets/toggle-group-BhUb_In4.js +0 -1
- package/dist/client/assets/use-connect-companion-BYo4bOt5.js +0 -1
- package/dist/client/assets/use-delete-connection-_1Gj9u9K.js +0 -1
- package/dist/client/assets/use-ensure-project-folder-B5XtpMjE.js +0 -1
- package/dist/client/assets/use-mcp-client-Bq9mPLRa.js +0 -10
- package/dist/client/assets/use-panel-navigate-dU6rubbO.js +0 -1
- package/dist/client/assets/use-recent-apps-CunSErYp.js +0 -1
- package/dist/client/assets/use-section-preview-base-BQWRaK5P.js +0 -1
- package/dist/client/assets/use-sidebar-collapsed-CV40kq5Y.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BgRNBC3A.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BamkyUys.js +0 -1
- package/dist/client/assets/users-C8oXHT4k.js +0 -1
- package/dist/client/assets/variant-calendar-CeRaHJen.js +0 -1
- package/dist/client/assets/view-mode-toggle-WmKvpLKC.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as V,ev as Sc,ew as Yf,j as k,b4 as Xf,d$ as _t,ex as Qf,c as Yt,b as So,aD as Zf,h as eh,B as xl,aG as Sl,aF as th,aE as nh,v as rh,s as sh,I as ih,w as oh,q as lh,D as ah,l as er,af as ch,y as uh}from"./index-Dfl75K1t.js";import{d as dh,g as fh}from"./tool-namespace-B34zfZd8.js";import{a as hh,F as ph,b as mh,c as gh,d as yh,f as bh}from"./form-BDq24hv6.js";import{t as Cl}from"./utils-CVEq3hMx.js";import{a as kh,M as xh}from"./markdown-WjT3O7Yl.js";import{u as Sh}from"./use-copy-C3XLF-5W.js";import{a as Ch}from"./Copy01-Dn1u-2Zy.js";import{T as tr,a as nr,c as rr}from"./tooltip-BntBAGAM.js";import{j as Mh}from"./agent-icon-Ck1HHwjS.js";import{c as Ml}from"./format-time-Cq80KKvY.js";import{c as Co}from"./use-decopilot-events-lsitv-U4.js";import{K as Mo}from"./chat-context-q6pkU4Vf.js";var Tl=Object.defineProperty,Th=(n,e)=>{let t={};for(var r in n)Tl(t,r,{get:n[r],enumerable:!0});return Tl(t,Symbol.toStringTag,{value:"Module"}),t};function ae(n){this.content=n}ae.prototype={constructor:ae,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 ae(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 ae(t)},addToStart:function(n,e){return new ae([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ae(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 ae(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=ae.from(n),n.size?new ae(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ae.from(n),n.size?new ae(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ae.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}};ae.from=function(n){if(n instanceof ae)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ae(e)};function Cc(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){let o=s.text,l=i.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a<o.length&&a<l.length&&Ec(o.charCodeAt(a-1))&&Tc(o.charCodeAt(a))&&t--,t}if(s.content.size||i.content.size){let o=Cc(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Mc(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=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d<c.length&&Ec(c.charCodeAt(d-1))&&Tc(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||l.content.size){let c=Mc(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}function Tc(n){return n>=56320&&n<57344}function Ec(n){return n>=55296&&n<56320}class S{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 S(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 S(r,s)}cutByIndex(e,t){return e==t?S.empty:e==0&&t==this.content.length?this:new S(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 S(s,i)}addToStart(e){return new S([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new S(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 Cc(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Mc(this,e,t,r)}findIndex(e){if(e==0)return vr(0,e);if(e==this.size)return vr(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?vr(t+1,i):vr(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 S.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return S.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return S.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 S(t||e,r)}static from(e){if(!e)return S.empty;if(e instanceof S)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new S([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}S.empty=new S([],0);const ti={index:0,offset:0};function vr(n,e){return ti.index=n,ti.offset=e,ti}function Ur(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(!Ur(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Ur(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let F=class Di{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&&Ur(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 Di.none;if(e instanceof Di)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};F.none=[];class sr extends Error{}class E{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=vc(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new E(r,this.openStart,this.openEnd)}removeBetween(e,t){return new E(wc(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 E.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 E(S.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(e,r,s)}}E.empty=new E(S.empty,0,0);function wc(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(wc(i.content,e-s-1,t-s-1)))}function vc(n,e,t,r,s,i){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=vc(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?s-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function Eh(n,e,t){if(t.openStart>n.depth)throw new sr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new sr("Inconsistent open depths");return Nc(n,e,t,0)}function Nc(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=Nc(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 Bt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=wh(t,n);return Bt(i,Oc(n,o,l,e,r))}else return Bt(i,qr(n,e,r))}function Ac(n,e){if(!e.type.compatibleContent(n.type))throw new sr("Cannot join "+e.type.name+" onto "+n.type.name)}function Ri(n,e,t){let r=n.node(t);return Ac(r,e.node(t)),r}function zt(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 Fn(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&&(zt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)zt(s.child(l),r);e&&e.depth==t&&e.textOffset&&zt(e.nodeBefore,r)}function Bt(n,e){if(!n.type.validContent(e))throw new sr("Invalid content for node "+n.type.name);return n.copy(e)}function Oc(n,e,t,r,s){let i=n.depth>s&&Ri(n,e,s+1),o=r.depth>s&&Ri(t,r,s+1),l=[];return Fn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Ac(i,o),zt(Bt(i,Oc(n,e,t,r,s+1)),l)):(i&&zt(Bt(i,qr(n,e,s+1)),l),Fn(e,t,s,l),o&&zt(Bt(o,qr(t,r,s+1)),l)),Fn(r,null,s,l),new S(l)}function qr(n,e,t){let r=[];if(Fn(null,n,t,r),n.depth>t){let s=Ri(n,e,t+1);zt(Bt(s,qr(n,e,t+1)),r)}return Fn(e,null,t,r),new S(r)}function wh(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(S.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class ir{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 F.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 Jr(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 ir(t,r,i)}static resolveCached(e,t){let r=El.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 El.set(e,r=new vh);let s=r.elts[r.i]=ir.resolve(e,t);return r.i=(r.i+1)%Nh,s}}class vh{constructor(){this.elts=[],this.i=0}}const Nh=12,El=new WeakMap;class Jr{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 Ah=Object.create(null);let Ft=class Ii{constructor(e,t,r,s=F.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||S.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&&Ur(this.attrs,t||e.defaultAttrs||Ah)&&F.sameSet(this.marks,r||F.none)}copy(e=null){return e==this.content?this:new Ii(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ii(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 E.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 E(c,s.depth-o,i.depth-o)}replace(e,t,r){return Eh(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 ir.resolveCached(this,e)}resolveNoCache(e){return ir.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()+")"),Dc(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=S.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=F.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(!F.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=S.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};Ft.prototype.text=void 0;class Gr extends Ft{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):Dc(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 Gr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Gr(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 Dc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Ut{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Oh(e,t);if(r.next==null)return Ut.empty;let s=Rc(r);r.next&&r.err("Unexpected trailing text");let i=zh($h(s));return Bh(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 S.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{r as V,ey as Sc,ez as Yf,j as k,b5 as Xf,e2 as _t,eA as Qf,c as Yt,b as So,aD as Zf,h as eh,B as xl,aG as Sl,aF as th,aE as nh,v as rh,s as sh,I as ih,w as oh,q as lh,D as ah,l as er,af as ch,y as uh}from"./index-DwUSgMrk.js";import{d as dh,g as fh}from"./tool-namespace-D8-HQWQE.js";import{a as hh,F as ph,b as mh,c as gh,d as yh,f as bh}from"./form-oexeEAr5.js";import{t as Cl}from"./utils-CVEq3hMx.js";import{a as kh,M as xh}from"./markdown-DQgkOB--.js";import{u as Sh}from"./use-copy-D9a2GtFe.js";import{a as Ch}from"./Copy01-CsZzLh_E.js";import{T as tr,a as nr,c as rr}from"./tooltip-7xQKXZXx.js";import{j as Mh}from"./agent-icon-sWZwj0Es.js";import{c as Ml}from"./format-time-Cq80KKvY.js";import{c as Co}from"./use-decopilot-events-DYkAp_m7.js";import{K as Mo}from"./chat-context-DHXBy843.js";var Tl=Object.defineProperty,Th=(n,e)=>{let t={};for(var r in n)Tl(t,r,{get:n[r],enumerable:!0});return Tl(t,Symbol.toStringTag,{value:"Module"}),t};function ae(n){this.content=n}ae.prototype={constructor:ae,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 ae(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 ae(t)},addToStart:function(n,e){return new ae([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ae(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 ae(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=ae.from(n),n.size?new ae(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ae.from(n),n.size?new ae(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ae.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}};ae.from=function(n){if(n instanceof ae)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ae(e)};function Cc(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){let o=s.text,l=i.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a<o.length&&a<l.length&&Ec(o.charCodeAt(a-1))&&Tc(o.charCodeAt(a))&&t--,t}if(s.content.size||i.content.size){let o=Cc(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Mc(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=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d<c.length&&Ec(c.charCodeAt(d-1))&&Tc(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||l.content.size){let c=Mc(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}function Tc(n){return n>=56320&&n<57344}function Ec(n){return n>=55296&&n<56320}class S{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 S(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 S(r,s)}cutByIndex(e,t){return e==t?S.empty:e==0&&t==this.content.length?this:new S(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 S(s,i)}addToStart(e){return new S([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new S(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 Cc(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Mc(this,e,t,r)}findIndex(e){if(e==0)return vr(0,e);if(e==this.size)return vr(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?vr(t+1,i):vr(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 S.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return S.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return S.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 S(t||e,r)}static from(e){if(!e)return S.empty;if(e instanceof S)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new S([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}S.empty=new S([],0);const ti={index:0,offset:0};function vr(n,e){return ti.index=n,ti.offset=e,ti}function Ur(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(!Ur(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Ur(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let F=class Di{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&&Ur(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 Di.none;if(e instanceof Di)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};F.none=[];class sr extends Error{}class E{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=vc(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new E(r,this.openStart,this.openEnd)}removeBetween(e,t){return new E(wc(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 E.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 E(S.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(e,r,s)}}E.empty=new E(S.empty,0,0);function wc(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(wc(i.content,e-s-1,t-s-1)))}function vc(n,e,t,r,s,i){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=vc(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?s-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function Eh(n,e,t){if(t.openStart>n.depth)throw new sr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new sr("Inconsistent open depths");return Nc(n,e,t,0)}function Nc(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=Nc(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 Bt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=wh(t,n);return Bt(i,Oc(n,o,l,e,r))}else return Bt(i,qr(n,e,r))}function Ac(n,e){if(!e.type.compatibleContent(n.type))throw new sr("Cannot join "+e.type.name+" onto "+n.type.name)}function Ri(n,e,t){let r=n.node(t);return Ac(r,e.node(t)),r}function zt(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 Fn(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&&(zt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)zt(s.child(l),r);e&&e.depth==t&&e.textOffset&&zt(e.nodeBefore,r)}function Bt(n,e){if(!n.type.validContent(e))throw new sr("Invalid content for node "+n.type.name);return n.copy(e)}function Oc(n,e,t,r,s){let i=n.depth>s&&Ri(n,e,s+1),o=r.depth>s&&Ri(t,r,s+1),l=[];return Fn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Ac(i,o),zt(Bt(i,Oc(n,e,t,r,s+1)),l)):(i&&zt(Bt(i,qr(n,e,s+1)),l),Fn(e,t,s,l),o&&zt(Bt(o,qr(t,r,s+1)),l)),Fn(r,null,s,l),new S(l)}function qr(n,e,t){let r=[];if(Fn(null,n,t,r),n.depth>t){let s=Ri(n,e,t+1);zt(Bt(s,qr(n,e,t+1)),r)}return Fn(e,null,t,r),new S(r)}function wh(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(S.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class ir{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 F.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 Jr(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 ir(t,r,i)}static resolveCached(e,t){let r=El.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 El.set(e,r=new vh);let s=r.elts[r.i]=ir.resolve(e,t);return r.i=(r.i+1)%Nh,s}}class vh{constructor(){this.elts=[],this.i=0}}const Nh=12,El=new WeakMap;class Jr{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 Ah=Object.create(null);let Ft=class Ii{constructor(e,t,r,s=F.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||S.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&&Ur(this.attrs,t||e.defaultAttrs||Ah)&&F.sameSet(this.marks,r||F.none)}copy(e=null){return e==this.content?this:new Ii(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ii(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 E.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 E(c,s.depth-o,i.depth-o)}replace(e,t,r){return Eh(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 ir.resolveCached(this,e)}resolveNoCache(e){return ir.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()+")"),Dc(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=S.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=F.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(!F.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=S.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};Ft.prototype.text=void 0;class Gr extends Ft{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):Dc(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 Gr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Gr(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 Dc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Ut{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Oh(e,t);if(r.next==null)return Ut.empty;let s=Rc(r);r.next&&r.err("Unexpected trailing text");let i=zh($h(s));return Bh(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 S.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
|
`)}}Ut.empty=new Ut(!0);class Oh{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 Rc(n){let e=[];do e.push(Dh(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Dh(n){let e=[];do e.push(Rh(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Rh(n){let e=Lh(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=Ih(n,e);else break;return e}function wl(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Ih(n,e){let t=wl(n),r=t;return n.eat(",")&&(n.next!="}"?r=wl(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Ph(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 Lh(n){if(n.eat("(")){let e=Rc(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=Ph(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 $h(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 Ic(n,e){return e-n}function vl(n,e){let t=[];return r(e),t.sort(Ic);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 zh(n){let e=Object.create(null);return t(vl(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]);vl(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Ut(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Ic);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function Bh(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 Pc(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 Lc(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 $c(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${r}`);for(let s in n)n[s].validate&&n[s].validate(e[s])}function zc(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new jh(n,r,e[r]);return t}let Nl=class Bc{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=zc(e,r.attrs),this.defaultAttrs=Pc(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==Ut.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:Lc(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ft(this,this.computeAttrs(e),S.from(t),F.setFrom(r))}createChecked(e=null,t,r){return t=S.from(t),this.checkContent(t),new Ft(this,this.computeAttrs(e),t,F.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=S.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(S.empty,!0);return i?new Ft(this,e,t.append(i),F.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){$c(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:F.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new Bc(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 Fh(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 jh{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Fh(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Fs{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=zc(e,s.attrs),this.excluded=null;let i=Pc(this.attrs);this.instance=i?new F(this,i):null}create(e=null){return!e&&this.instance?this.instance:new F(this,Lc(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Fs(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){$c(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Fc{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=ae.from(e.nodes),t.marks=ae.from(e.marks||{}),this.nodes=Nl.compile(this.spec.nodes,this),this.marks=Fs.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]=Ut.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?Al(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==""?[]:Al(this,o.split(" "))}this.nodeFromJSON=s=>Ft.fromJSON(this,s),this.markFromJSON=s=>F.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 Nl){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 Gr(r,r.defaultAttrs,e,F.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 Al(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 Hh(n){return n.tag!=null}function Vh(n){return n.style!=null}class He{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(Hh(s))this.tags.push(s);else if(Vh(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 Dl(this,t,!1);return r.addAll(e,F.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Dl(this,t,!0);return r.addAll(e,F.none,t.from,t.to),E.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(_h(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=Rl(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=Rl(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new He(e,He.schemaRules(e)))}}const jc={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Wh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Hc={ol:!0,ul:!0},or=1,Pi=2,jn=4;function Ol(n,e,t){return e!=null?(e?or:0)|(e==="full"?Pi:0):n&&n.whitespace=="pre"?or|Pi:t&~jn}class Nr{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=F.none,this.match=i||(o&jn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(S.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&or)){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=S.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(S.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&&!jc.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Dl{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=Ol(null,t.preserveWhitespace,0)|(r?jn:0);s?i=new Nr(s.type,s.attrs,F.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Nr(null,null,F.none,!0,null,o):i=new Nr(e.schema.topNodeType,null,F.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&Pi?"full":this.localPreserveWS||(s.options&or)>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;Hc.hasOwnProperty(o)&&this.parser.normalizeLists&&Kh(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Wh.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(jc.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=F.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Il(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=Ol(e,i,o.options);o.options&jn&&o.content.length==0&&(l|=jn);let a=F.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):Il(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Nr(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|=or)}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 Kh(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Hc.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function _h(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Rl(n){let e={};for(let t in n)e[t]=n[t];return e}function Il(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 rt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Ar(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){if(e.isText)return Ar(t).createTextNode(e.text);let{dom:r,contentDOM:s}=Hr(Ar(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&&Hr(Ar(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return typeof t=="string"?{dom:e.createTextNode(t)}:Hr(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new rt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Pl(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Pl(e.marks)}}function Pl(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Ar(n){return n.document||window.document}const Ll=new WeakMap;function Uh(n){let e=Ll.get(n);return e===void 0&&Ll.set(n,e=qh(n)),e}function qh(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 Hr(n,e,t,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Uh(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 if(typeof f=="string")a.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:p}=Hr(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Vc=65535,Wc=Math.pow(2,16);function Jh(n,e){return n+e*Wc}function $l(n){return n&Vc}function Gh(n){return(n-(n&Vc))/Wc}const Kc=1,_c=2,Vr=4,Uc=8;class Li{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Uc)>0}get deletedBefore(){return(this.delInfo&(Kc|Vr))>0}get deletedAfter(){return(this.delInfo&(_c|Vr))>0}get deletedAcross(){return(this.delInfo&Vr)>0}}class Me{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Me.empty)return Me.empty}recover(e){let t=0,r=$l(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+Gh(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 p=e==(t<0?a:d)?null:Jh(l/3,e-a),g=e==a?_c:e==d?Kc:Vr;return(t<0?e!=a:e!=d)&&(g|=Uc),new Li(h,g,p)}s+=u-c}return r?e+s:new Li(e+s,0,null)}touches(e,t){let r=0,s=$l(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 Me(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Me.empty:new Me(e<0?[0,-e,0]:[0,0,e])}}Me.empty=new Me([]);class lr{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 lr(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 lr;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 Li(e,s,null)}}const ni=Object.create(null);class pe{getMap(){return Me.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ni[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 ni)throw new RangeError("Duplicate use of step JSON ID "+e);return ni[e]=t,t.prototype.jsonID=e,t}}class Z{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Z(e,null)}static fail(e){return new Z(null,e)}static fromReplace(e,t,r,s){try{return Z.ok(e.replace(t,r,s))}catch(i){if(i instanceof sr)return Z.fail(i.message);throw i}}}function To(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(To(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return S.fromArray(r)}class mt extends pe{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 E(To(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 Z.fromReplace(e,this.from,this.to,i)}invert(){return new Ie(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))}}pe.jsonID("addMark",mt);class Ie extends pe{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 E(To(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return Z.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 Ie(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ie&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ie(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 Ie(t.from,t.to,e.markFromJSON(t.mark))}}pe.jsonID("removeMark",Ie);class gt extends pe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Z.fromReplace(e,this.pos,this.pos+1,new E(S.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 gt(this.pos,t.marks[s]);return new gt(this.pos,this.mark)}}return new qt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new gt(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 gt(t.pos,e.markFromJSON(t.mark))}}pe.jsonID("addNodeMark",gt);class qt extends pe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Z.fromReplace(e,this.pos,this.pos+1,new E(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new gt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new qt(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 qt(t.pos,e.markFromJSON(t.mark))}}pe.jsonID("removeNodeMark",qt);class X extends pe{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&$i(e,this.from,this.to)?Z.fail("Structure replace would overwrite content"):Z.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Me([this.from,this.to-this.from,this.slice.size])}invert(e){return new X(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&&X.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new X(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof X)||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?E.empty:new E(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new X(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?E.empty:new E(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new X(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 X(t.from,t.to,E.fromJSON(e,t.slice),!!t.structure)}}X.MAP_BIAS=1;pe.jsonID("replace",X);class se extends pe{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&&($i(e,this.from,this.gapFrom)||$i(e,this.gapTo,this.to)))return Z.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Z.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Z.fromReplace(e,this.from,this.to,r):Z.fail("Content does not fit in gap")}getMap(){return new Me([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 se(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 se(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 se(t.from,t.to,t.gapFrom,t.gapTo,E.fromJSON(e,t.slice),t.insert,!!t.structure)}}pe.jsonID("replaceAround",se);function $i(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 Yh(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),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:s.push(o=new Ie(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 Xh(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 Fs){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 p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}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 Ie(o.from,o.to,o.style)))}function Eo(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 X(l,u,E.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Ie(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new E(S.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new X(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(S.empty,!0);n.replace(l,l,new E(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function Qh(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function En(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||!Qh(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Zh(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=S.empty,d=0;for(let p=i,g=!1;p>t;p--)g||r.index(p)>0?(g=!0,u=S.from(r.node(p).copy(u)),d++):a--;let f=S.empty,h=0;for(let p=i,g=!1;p>t;p--)g||s.after(p+1)<s.end(p)?(g=!0,f=S.from(s.node(p).copy(f)),h++):c++;n.step(new se(a,c,o,l,new E(u.append(f),d,h),u.size-d,!0))}function wo(n,e,t=null,r=n){let s=ep(n,e),i=s&&tp(r,e);return i?s.map(zl).concat({type:e,attrs:t}).concat(i.map(zl)):null}function zl(n){return{type:n,attrs:null}}function ep(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 tp(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 np(n,e,t){let r=S.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=S.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new se(s,i,s,i,new E(r,0,0),t.length,!0))}function rp(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)&&sp(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Jc(n,o,l,i),Eo(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 se(d,f,d+1,f-1,new E(S.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&qc(n,o,l,i),!1}})}function qc(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 Jc(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(`
|
|
@@ -138,4 +138,4 @@ ${t}
|
|
|
138
138
|
`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=i=>{const o=Pa(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},t);if(o){const l={type:"taskList",raw:o.raw,items:o.items},a=i.slice(o.raw.length);return a.trim()?[l,...t.blockTokens(a)]:[l]}return t.blockTokens(i)},s=Pa(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:t.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},t);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Y.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(sf.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(uf.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(ff.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(pf.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(Bk.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(Fk.configure(this.options.taskList)),n}});const Fr=" ",Ei=" ",jk=be.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",ee(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const r=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Fr||t[0].text===Fr||t[0].raw===Ei||t[0].text===Ei)&&r.length===1&&r[0].type==="text"&&(r[0].text===Fr||r[0].text===Ei)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(n,e,t)=>{if(!n)return"";const r=Array.isArray(n.content)?n.content:[];if(r.length===0){var s,i;const o=Array.isArray(t==null||(s=t.previousNode)===null||s===void 0?void 0:s.content)?t.previousNode.content:[];return(t==null||(i=t.previousNode)===null||i===void 0?void 0:i.type)==="paragraph"&&o.length===0?Fr:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Hk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Vk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Wk=Xt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",ee(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Gt({find:Hk,type:this.type})]},addPasteRules(){return[Mt({find:Vk,type:this.type})]}}),Kk=be.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),_k=Xt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",ee(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:t.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Uk(n={}){return new W({view(e){return new qk(e,n)}})}class qk{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,l=i.height/s.offsetHeight;if(t){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),g=d?p.bottom:p.top;d&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*l;r={left:p.left,right:p.right,top:g-m,bottom:g+m}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,h=d.height/a.offsetHeight;c=d.left-a.scrollLeft*f,u=d.top-a.scrollTop*h}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,t,e):s;if(t&&!i){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=vo(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const Zt=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},mf=function(n,e,t,r){return t&&(rc(n,e,t,r,-1)||rc(n,e,t,r,1))},Jk=/^(img|br|input|textarea|hr)$/i;function rc(n,e,t,r,s){for(var i;;){if(n==t&&e==r)return!0;if(e==(s<0?0:Is(n))){let o=n.parentNode;if(!o||o.nodeType!=1||cl(n)||Jk.test(n.nodeName)||n.contentEditable=="false")return!1;e=Zt(n)+(s<0?0:1),n=o}else if(n.nodeType==1){let o=n.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else n=o,e=s<0?Is(n):0}else return!1}}function Is(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Gk(n,e,t){for(let r=e==0,s=e==Is(n);r||s;){if(n==t)return!0;let i=Zt(n);if(n=n.parentNode,!n)return!1;r=r&&i==0,s=s&&i==Is(n)}}function cl(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const gf=function(n){return n.focusNode&&mf(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function yf(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const We=typeof navigator<"u"?navigator:null,sc=typeof document<"u"?document:null,vt=We&&We.userAgent||"",uo=/Edge\/(\d+)/.exec(vt),bf=/MSIE \d/.exec(vt),fo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vt),Tr=!!(bf||fo||uo),kf=bf?document.documentMode:fo?+fo[1]:uo?+uo[1]:0,Zs=!Tr&&/gecko\/(\d+)/i.test(vt);Zs&&+(/Firefox\/(\d+)/.exec(vt)||[0,0])[1];const ho=!Tr&&/Chrome\/(\d+)/.exec(vt),ot=!!ho,xf=ho?+ho[1]:0,en=!Tr&&!!We&&/Apple Computer/.test(We.vendor),ul=en&&(/Mobile\/\w+/.test(vt)||!!We&&We.maxTouchPoints>2),Ne=ul||(We?/Mac/.test(We.platform):!1),Sf=We?/Win/.test(We.platform):!1,Er=/Android \d/.test(vt),dl=!!sc&&"webkitFontSmoothing"in sc.documentElement.style,Yk=dl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Xk(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let s=n.docView.nearestDesc(t.focusNode),i=s&&s.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,c;if(gf(t)){for(a=o;s&&!s.node;)s=s.parent;let d=s.node;if(s&&d.isAtom&&w.isSelectable(d)&&s.parent&&!(d.isInline&&Gk(t.focusNode,t.focusOffset,s.dom))){let f=s.posBefore;c=new w(o==f?l:r.resolve(f))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,f=o;for(let h=0;h<t.rangeCount;h++){let p=t.getRangeAt(h);d=Math.min(d,n.docView.posFromDOM(p.startContainer,p.startOffset,1)),f=Math.max(f,n.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[a,o]=f==n.state.selection.anchor?[f,d]:[d,f],l=r.resolve(o)}else a=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let d=e=="pointer"||n.state.selection.head<l.pos&&!i?1:-1;c=Mf(n,u,l,d)}return c}function Cf(n){return n.editable?n.hasFocus():tx(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function fl(n,e=!1){let t=n.state.selection;if(ex(n,t),!!Cf(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&ot){let r=n.domSelectionRange(),s=n.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&mf(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Zk(n);else{let{anchor:r,head:s}=t,i,o;ic&&!(t instanceof N)&&(t.$from.parent.inlineContent||(i=oc(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(o=oc(n,t.to))),n.docView.setSelection(r,s,n,e),ic&&(i&&lc(i),o&&lc(o)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Qk(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const ic=en||ot&&xf<63;function oc(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),s=r<t.childNodes.length?t.childNodes[r]:null,i=r?t.childNodes[r-1]:null;if(en&&s&&s.contentEditable=="false")return wi(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return wi(s);if(i)return wi(i)}}function wi(n){return n.contentEditable="true",en&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function lc(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Qk(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,s=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=s)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Cf(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Zk(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,r=t.nodeName=="IMG";r?e.collapse(t.parentNode,Zt(t)+1):e.collapse(t,0),!r&&!n.state.selection.visible&&Tr&&kf<=11&&(t.disabled=!0,t.disabled=!1)}function ex(n,e){if(e instanceof w){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(ac(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else ac(n)}function ac(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Mf(n,e,t,r){return n.someProp("createSelectionBetween",s=>s(n,e,t))||N.between(e,t,r)}function tx(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function po(n,e){let{$anchor:t,$head:r}=n.selection,s=e>0?t.max(r):t.min(r),i=s.parent.inlineContent?s.depth?n.doc.resolve(e>0?s.after():s.before()):null:s;return i&&I.findFrom(i,e)}function ht(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function cc(n,e,t){let r=n.state.selection;if(r instanceof N)if(t.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=n.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return ht(n,new N(r.$anchor,o))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let s=po(n.state,e);return s&&s instanceof w?ht(n,s):!1}else if(!(Ne&&t.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=n.docView.descAt(l))&&!o.contentDOM?w.isSelectable(i)?ht(n,new w(e<0?n.state.doc.resolve(s.pos-i.nodeSize):s)):dl?ht(n,new N(n.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof w&&r.node.isInline)return ht(n,new N(e>0?r.$to:r.$from));{let s=po(n.state,e);return s?ht(n,s):!1}}}function Ps(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Xn(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function on(n,e){return e<0?nx(n):rx(n)}function nx(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let s,i,o=!1;for(Zs&&t.nodeType==1&&r<Ps(t)&&Xn(t.childNodes[r],-1)&&(o=!0);;)if(r>0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Xn(l,-1))s=t,i=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(Tf(t))break;{let l=t.previousSibling;for(;l&&Xn(l,-1);)s=t.parentNode,i=Zt(l),l=l.previousSibling;if(l)t=l,r=Ps(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?mo(n,t,r):s&&mo(n,s,i)}function rx(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let s=Ps(t),i,o;for(;;)if(r<s){if(t.nodeType!=1)break;let l=t.childNodes[r];if(Xn(l,1))i=t,o=++r;else break}else{if(Tf(t))break;{let l=t.nextSibling;for(;l&&Xn(l,1);)i=l.parentNode,o=Zt(l)+1,l=l.nextSibling;if(l)t=l,r=0,s=Ps(t);else{if(t=t.parentNode,t==n.dom)break;r=s=0}}}i&&mo(n,i,o)}function Tf(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function sx(n,e){for(;n&&e==n.childNodes.length&&!cl(n);)e=Zt(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function ix(n,e){for(;n&&!e&&!cl(n);)e=Zt(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function mo(n,e,t){if(e.nodeType!=3){let i,o;(o=sx(e,t))?(e=o,t=0):(i=ix(e,t))&&(e=i,t=i.nodeValue.length)}let r=n.domSelection();if(!r)return;if(gf(r)){let i=document.createRange();i.setEnd(e,t),i.setStart(e,t),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:s}=n;setTimeout(()=>{n.state==s&&fl(n)},50)}function uc(n,e){let t=n.state.doc.resolve(e);if(!(ot||Sf)&&t.parent.inlineContent){let s=n.coordsAtPos(e);if(e>t.start()){let i=n.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left<s.left?"ltr":"rtl"}if(e<t.end()){let i=n.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function dc(n,e,t){let r=n.state.selection;if(r instanceof N&&!r.empty||t.indexOf("s")>-1||Ne&&t.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=po(n.state,e);if(o&&o instanceof w)return ht(n,o)}if(!s.parent.inlineContent){let o=e<0?s:i,l=r instanceof xe?I.near(o,e):I.findFrom(o,e);return l?ht(n,l):!1}return!1}function fc(n,e){if(!(n.state.selection instanceof N))return!0;let{$head:t,$anchor:r,empty:s}=n.state.selection;if(!t.sameParent(r))return!0;if(!s)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(i&&!i.isText){let o=n.state.tr;return e<0?o.delete(t.pos-i.nodeSize,t.pos):o.delete(t.pos,t.pos+i.nodeSize),n.dispatch(o),!0}return!1}function hc(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function ox(n){if(!en||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;hc(n,r,"true"),setTimeout(()=>hc(n,r,"false"),20)}return!1}function lx(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function ax(n,e){let t=e.keyCode,r=lx(e);if(t==8||Ne&&t==72&&r=="c")return fc(n,-1)||on(n,-1);if(t==46&&!e.shiftKey||Ne&&t==68&&r=="c")return fc(n,1)||on(n,1);if(t==13||t==27)return!0;if(t==37||Ne&&t==66&&r=="c"){let s=t==37?uc(n,n.state.selection.from)=="ltr"?-1:1:-1;return cc(n,s,r)||on(n,s)}else if(t==39||Ne&&t==70&&r=="c"){let s=t==39?uc(n,n.state.selection.from)=="ltr"?1:-1:1;return cc(n,s,r)||on(n,s)}else{if(t==38||Ne&&t==80&&r=="c")return dc(n,-1,r)||on(n,-1);if(t==40||Ne&&t==78&&r=="c")return ox(n)||dc(n,1,r)||on(n,1);if(r==(Ne?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Ef(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=n.someProp("clipboardSerializer")||rt.fromSchema(n.state.schema),l=Df(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Of[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=l.createElement(u[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,`
|
|
139
139
|
|
|
140
140
|
`);return{dom:a,text:f,slice:e}}function wf(n,e,t,r,s){let i=s.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=!!e&&(r||i||!t);if(a){if(n.someProp("transformPastedText",f=>{e=f(e,i||r,n)}),i)return l=new E(S.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
141
|
-
`))),0,0),n.someProp("transformPasted",f=>{l=f(l,n,!0)}),l;let d=n.someProp("clipboardTextParser",f=>f(e,s,r,n));if(d)l=d;else{let f=s.marks(),{schema:h}=n.state,p=rt.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=o.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(h.text(g,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=fx(t),dl&&hx(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||He.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!cx.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=px(pc(l,+u[1],+u[2]),u[4]);else if(l=E.maxOpen(ux(l.content,s),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d<l.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=pc(l,d,f)}return n.someProp("transformPasted",d=>{l=d(l,n,a)}),l}const cx=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ux(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let s=e.node(t).contentMatchAt(e.index(t)),i,o=[];if(n.forEach(l=>{if(!o)return;let a=s.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&i.length&&Nf(a,i,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=Af(o[o.length-1],i.length));let u=vf(l,a);o.push(u),s=s.matchType(u.type),i=a}}),o)return S.from(o)}return n}function vf(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,S.from(n));return n}function Nf(n,e,t,r,s){if(s<n.length&&s<e.length&&n[s]==e[s]){let i=Nf(n,e,t,r.lastChild,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==n.length-1?t.type:n[s+1]))return r.copy(r.content.append(S.from(vf(t,n,s+1))))}}function Af(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Af(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(S.empty,!0);return n.copy(t.append(r))}function go(n,e,t,r,s,i){let o=e<0?n.firstChild:n.lastChild,l=o.content;return n.childCount>1&&(i=0),s<r-1&&(l=go(l,e,t,r,s+1,i)),s>=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(S.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function pc(n,e,t){return e<n.openStart&&(n=new E(go(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new E(go(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Of={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let mc=null;function Df(){return mc||(mc=document.implementation.createHTMLDocument("title"))}let vi=null;function dx(n){let e=window.trustedTypes;return e?(vi||(vi=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),vi.createHTML(n)):n}function fx(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Df().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),s;if((s=r&&Of[r[1].toLowerCase()])&&(n=s.map(i=>"<"+i+">").join("")+n+s.map(i=>"</"+i+">").reverse().join("")),t.innerHTML=dx(n),s)for(let i=0;i<s.length;i++)t=t.querySelector(s[i])||t;return t}function hx(n){let e=n.querySelectorAll(ot?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function px(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:s,openStart:i,openEnd:o}=n;for(let l=r.length-2;l>=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=S.from(a.create(r[l+1],s)),i++,o++}return new E(s,i,o)}const Le={},Te={};function yt(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Te.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!If(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Er&&ot&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),ul&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",s=>s(n,yf(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||ax(n,t)?t.preventDefault():yt(n,"key")};Te.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Te.keypress=(n,e)=>{let t=e;if(If(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ne&&t.metaKey)return;if(n.someProp("handleKeyPress",s=>s(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof N)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(t.charCode),i=()=>n.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,s,i))&&n.dispatch(i()),t.preventDefault()}};function ei(n){return{left:n.clientX,top:n.clientY}}function mx(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function hl(n,e,t,r,s){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(n.someProp(e,l=>o>i.depth?l(n,t,i.nodeAfter,i.before(o),s,!0):l(n,t,i.node(o),i.before(o),s,!1)))return!0;return!1}function gn(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function gx(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&w.isSelectable(r)?(gn(n,new w(t)),!0):!1}function yx(n,e){if(e==-1)return!1;let t=n.state.selection,r,s;t instanceof w&&(r=t.node);let i=n.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(w.isSelectable(l)){r&&t.$from.depth>0&&o>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?s=i.before(t.$from.depth):s=i.before(o);break}}return s!=null?(gn(n,w.create(n.state.doc,s)),!0):!1}function bx(n,e,t,r,s){return hl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(s?yx(n,t):gx(n,t))}function kx(n,e,t,r){return hl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",s=>s(n,e,r))}function xx(n,e,t,r){return hl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",s=>s(n,e,r))||Sx(n,t,r)}function Sx(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(gn(n,N.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),l=s.before(i);if(o.inlineContent)gn(n,N.create(r,l+1,l+1+o.content.size));else if(w.isSelectable(o))gn(n,w.create(r,l));else continue;return!0}}function pl(n){return Ls(n)}const Rf=Ne?"metaKey":"ctrlKey";Le.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=pl(n),s=Date.now(),i="singleClick";s-n.input.lastClick.time<500&&mx(t,n.input.lastClick)&&!t[Rf]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:i,button:t.button};let o=n.posAtCoords(ei(t));o&&(i=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Cx(n,o,t,!!r)):(i=="doubleClick"?kx:xx)(n,o.pos,o.inside,t)?t.preventDefault():yt(n,"pointer"))};class Cx{constructor(e,t,r,s){this.view=e,this.pos=t,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Rf],this.allowDefault=r.shiftKey;let i,o;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);i=u.parent,o=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof w&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Zs&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),yt(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>fl(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ei(e))),this.updateAllowDefault(e),this.allowDefault||!t?yt(this.view,"pointer"):bx(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||en&&this.mightDrag&&!this.mightDrag.node.isAtom||ot&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(gn(this.view,I.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):yt(this.view,"pointer")}move(e){this.updateAllowDefault(e),yt(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Le.touchstart=n=>{n.input.lastTouch=Date.now(),pl(n),yt(n,"pointer")};Le.touchmove=n=>{n.input.lastTouch=Date.now(),yt(n,"pointer")};Le.contextmenu=n=>pl(n);function If(n,e){return n.composing?!0:en&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Mx=Er?5e3:-1;Te.compositionstart=Te.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof N&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||ot&&Sf&&Tx(n)))n.markCursor=n.state.storedMarks||t.marks(),Ls(n,!0),n.markCursor=null;else if(Ls(n,!e.selection.empty),Zs&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=n.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}n.input.composing=!0}Pf(n,Mx)};function Tx(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return r.nodeType==1&&r.contentEditable=="false"}Te.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Pf(n,20))};function Pf(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ls(n),e))}function Ex(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=wx());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function wx(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ls(n,e=!1){if(!(Er&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Ex(n),e||n.docView&&n.docView.dirty){let t=Xk(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function vx(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const mr=Tr&&kf<15||ul&&Yk<604;Le.copy=Te.cut=(n,e)=>{let t=e,r=n.state.selection,s=t.type=="cut";if(r.empty)return;let i=mr?null:t.clipboardData,o=r.content(),{dom:l,text:a}=Ef(n,o);i?(t.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):vx(n,l),s&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Nx(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Ax(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?yo(n,r.value,null,s,e):yo(n,r.textContent,r.innerHTML,s,e)},50)}function yo(n,e,t,r,s){let i=wf(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,s,i||E.empty)))return!0;if(!i)return!1;let o=Nx(i),l=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Lf(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Te.paste=(n,e)=>{let t=e;if(n.composing&&!Er)return;let r=mr?null:t.clipboardData,s=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&yo(n,Lf(r),r.getData("text/html"),s,t)?t.preventDefault():Ax(n,t)};class Ox{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Dx=Ne?"altKey":"ctrlKey";function $f(n,e){let t;return n.someProp("dragCopies",r=>{t=t||r(e)}),t!=null?!t:!e[Dx]}Le.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let s=n.state.selection,i=s.empty?null:n.posAtCoords(ei(t)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof w?s.to-1:s.to))){if(r&&r.mightDrag)o=w.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(o=w.create(n.state.doc,d.posBefore))}}let l=(o||n.state.selection).content(),{dom:a,text:c,slice:u}=Ef(n,l);(!t.dataTransfer.files.length||!ot||xf>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(mr?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",mr||t.dataTransfer.setData("text/plain",c),n.dragging=new Ox(u,$f(n,t),o)};Le.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Te.dragover=Te.dragenter=(n,e)=>e.preventDefault();Te.drop=(n,e)=>{try{Rx(n,e,n.dragging)}finally{n.dragging=null}};function Rx(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(ei(e));if(!r)return;let s=n.state.doc.resolve(r.pos),i=t&&t.slice;i?n.someProp("transformPasted",h=>{i=h(i,n,!1)}):i=wf(n,Lf(e.dataTransfer),mr?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(t&&$f(n,e));if(n.someProp("handleDrop",h=>h(n,e,i||E.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?vo(n.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let a=n.state.tr;if(o){let{node:h}=t;h?h.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,d=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(d))return;let f=a.doc.resolve(c);if(u&&w.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new w(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((p,g,m,y)=>h=y),a.setSelection(Mf(n,f,a.doc.resolve(h)))}n.focus(),n.dispatch(a.setMeta("uiEvent","drop"))}Le.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&fl(n)},20))};Le.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Le.beforeinput=(n,e)=>{if(ot&&Er&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,yf(8,"Backspace")))))return;let{$cursor:s}=n.state.selection;s&&s.pos>0&&n.dispatch(n.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let n in Te)Le[n]=Te[n];function gr(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class $s{constructor(e,t){this.toDOM=e,this.spec=t||Vt,this.side=this.spec.side||0}map(e,t,r,s){let{pos:i,deleted:o}=e.mapResult(t.from+s,this.side<0?-1:1);return o?null:new je(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof $s&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&gr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class St{constructor(e,t){this.attrs=e,this.spec=t||Vt}map(e,t,r,s){let i=e.map(t.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new je(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof St&&gr(this.attrs,e.attrs)&&gr(this.spec,e.spec)}static is(e){return e.type instanceof St}destroy(){}}class ml{constructor(e,t){this.attrs=e,this.spec=t||Vt}map(e,t,r,s){let i=e.mapResult(t.from+s,1);if(i.deleted)return null;let o=e.mapResult(t.to+s,-1);return o.deleted||o.pos<=i.pos?null:new je(i.pos-r,o.pos-r,this)}valid(e,t){let{index:r,offset:s}=e.content.findIndex(t.from),i;return s==t.from&&!(i=e.child(r)).isText&&s+i.nodeSize==t.to}eq(e){return this==e||e instanceof ml&&gr(this.attrs,e.attrs)&&gr(this.spec,e.spec)}destroy(){}}class je{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new je(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new je(e,e,new $s(t,r))}static inline(e,t,r,s){return new je(e,t,new St(r,s))}static node(e,t,r,s){return new je(e,t,new ml(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof St}get widget(){return this.type instanceof $s}}const hn=[],Vt={};class re{constructor(e,t){this.local=e.length?e:hn,this.children=t.length?t:hn}static create(e,t){return t.length?zs(t,e,0,Vt):me}find(e,t,r){let s=[];return this.findInner(e??0,t??1e9,s,0,r),s}findInner(e,t,r,s,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=t&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,r,s+l,i)}}map(e,t,r){return this==me||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vt)}mapInner(e,t,r,s,i){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,s);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?Ix(this.children,o||[],e,t,r,s,i):o?new re(o.sort(Wt),hn):me}add(e,t){return t.length?this==me?re.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let s,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Bf(t,l,c)){for(s||(s=this.children.slice());i<s.length&&s[i]<a;)i+=3;s[i]==a?s[i+2]=s[i+2].addInner(l,u,c+1):s.splice(i,0,a,a+l.nodeSize,zs(u,l,c+1,Vt)),i+=3}});let o=zf(i?Ff(t):t,-r);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new re(o.length?this.local.concat(o).sort(Wt):this.local,s||this.children)}remove(e){return e.length==0||this==me?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let o,l=r[i]+t,a=r[i+1]+t;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(o||(o=[])).push(d));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(o,l+1);c!=me?r[i+2]=c:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let l=0;l<s.length;l++)s[l].eq(o,t)&&(s==this.local&&(s=this.local.slice()),s.splice(l--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new re(s,r):me}forChild(e,t){if(this==me)return this;if(t.isLeaf)return re.empty;let r,s;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,o=i+t.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>i&&a.type instanceof St){let c=Math.max(i,a.from)-i,u=Math.min(o,a.to)-i;c<u&&(s||(s=[])).push(a.copy(c,u))}}if(s){let l=new re(s.sort(Wt),hn);return r?new Dt([l,r]):l}return r||me}eq(e){if(this==e)return!0;if(!(e instanceof re)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return gl(this.localsInner(e))}localsInner(e){if(this==me)return hn;if(e.inlineContent||!this.local.some(St.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof St||t.push(this.local[r]);return t}forEachSet(e){e(this)}}re.empty=new re([],[]);re.removeOverlap=gl;const me=re.empty;class Dt{constructor(e){this.members=e}map(e,t){const r=this.members.map(s=>s.map(e,t,Vt));return Dt.from(r)}forChild(e,t){if(t.isLeaf)return re.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,t);i!=me&&(i instanceof Dt?r=r.concat(i.members):r.push(i))}return Dt.from(r)}eq(e){if(!(e instanceof Dt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(!t)t=i;else{r&&(t=t.slice(),r=!1);for(let o=0;o<i.length;o++)t.push(i[o])}}return t?gl(r?t:t.sort(Wt)):hn}static from(e){switch(e.length){case 0:return me;case 1:return e[0];default:return new Dt(e.every(t=>t instanceof re)?e:e.reduce((t,r)=>t.concat(r instanceof re?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Ix(n,e,t,r,s,i,o){let l=n.slice();for(let c=0,u=i;c<t.maps.length;c++){let d=0;t.maps[c].forEach((f,h,p,g)=>{let m=g-p-(h-f);for(let y=0;y<l.length;y+=3){let b=l[y+1];if(b<0||f>b+u-d)continue;let x=l[y]+u-d;h>=x?l[y+1]=f<=x?-2:-1:f>=u&&m&&(l[y]+=m,l[y+1]+=m)}d+=m}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=t.map(n[c]+i),d=u-s;if(d<0||d>=r.content.size){a=!0;continue}let f=t.map(n[c+1]+i,-1),h=f-s,{index:p,offset:g}=r.content.findIndex(d),m=r.maybeChild(p);if(m&&g==d&&g+m.nodeSize==h){let y=l[c+2].mapInner(t,m,u+1,n[c]+i+1,o);y!=me?(l[c]=d,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Px(l,n,e,t,s,i,o),u=zs(c,r,0,o);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<l.length&&l[f]<h;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new re(e.sort(Wt),l)}function zf(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let s=n[r];t.push(new je(s.from+e,s.to+e,s.type))}return t}function Px(n,e,t,r,s,i,o){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,s,c);d?t.push(d):o.onRemove&&o.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<n.length;a+=3)n[a+1]==-1&&l(n[a+2],e[a]+i+1);return t}function Bf(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,s=null;for(let i=0,o;i<n.length;i++)(o=n[i])&&o.from>t&&o.to<r&&((s||(s=[])).push(o),n[i]=null);return s}function Ff(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function zs(n,e,t,r){let s=[],i=!1;e.forEach((l,a)=>{let c=Bf(n,l,a+t);if(c){i=!0;let u=zs(c,l,t+a+1,r);u!=me&&s.push(a,a+l.nodeSize,u)}});let o=zf(i?Ff(n):n,-t).sort(Wt);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||s.length?new re(o,s):me}function Wt(n,e){return n.from-e.from||n.to-e.to}function gl(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let s=t+1;s<e.length;s++){let i=e[s];if(i.from==r.from){i.to!=r.to&&(e==n&&(e=n.slice()),e[s]=i.copy(i.from,r.to),gc(e,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,i.from),gc(e,s,r.copy(i.from,r.to)));break}}}return e}function gc(n,e,t){for(;e<n.length&&Wt(t,n[e])>0;)e++;n.splice(e,0,t)}class J extends I{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return J.valid(r)?new J(r):I.near(r)}content(){return E.empty}eq(e){return e instanceof J&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new J(e.resolve(t.pos))}getBookmark(){return new yl(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Lx(e)||!$x(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let s=t.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&J.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)<l.childCount:e.index(o)>0){i=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=t;let a=e.doc.resolve(s);if(J.valid(a))return a}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!w.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*t),r=!1;continue e}break}i=o,s+=t;let l=e.doc.resolve(s);if(J.valid(l))return l}return null}}}J.prototype.visible=!1;J.findFrom=J.findGapCursorFrom;I.jsonID("gapcursor",J);class yl{constructor(e){this.pos=e}map(e){return new yl(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return J.valid(t)?new J(t):I.near(t)}}function jf(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function Lx(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||jf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function $x(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||jf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function zx(){return new W({props:{decorations:Hx,createSelectionBetween(n,e,t){return e.pos==t.pos&&J.valid(t)?new J(t):null},handleClick:Fx,handleKeyDown:Bx,handleDOMEvents:{beforeinput:jx}}})}const Bx=nd({ArrowLeft:jr("horiz",-1),ArrowRight:jr("horiz",1),ArrowUp:jr("vert",-1),ArrowDown:jr("vert",1)});function jr(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof N){if(!i.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=J.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new J(c))),!0):!1}}function Fx(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!J.valid(r))return!1;let s=n.posAtCoords({left:t.clientX,top:t.clientY});return s&&s.inside>-1&&w.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new J(r))),!0)}function jx(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof J))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let s=S.empty;for(let o=r.length-1;o>=0;o--)s=S.from(r[o].createAndFill(null,s));let i=n.state.tr.replace(t.pos,t.pos,new E(s,0,0));return i.setSelection(N.near(i.doc.resolve(t.pos+1))),n.dispatch(i),!1}function Hx(n){if(!(n.selection instanceof J))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",re.create(n.doc,[je.widget(n.selection.head,e,{key:"gapcursor"})])}var Bs=200,ie=function(){};ie.prototype.append=function(e){return e.length?(e=ie.from(e),!this.length&&e||e.length<Bs&&this.leafAppend(e)||this.length<Bs&&e.leafPrepend(this)||this.appendInner(e)):this};ie.prototype.prepend=function(e){return e.length?ie.from(e).append(this):this};ie.prototype.appendInner=function(e){return new Vx(this,e)};ie.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?ie.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};ie.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ie.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};ie.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},t,r),s};ie.from=function(e){return e instanceof ie?e:e&&e.length?new Hf(e):ie.empty};var Hf=(function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a<o;a++)if(s(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,l){for(var a=i-1;a>=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=Bs)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=Bs)return new e(s.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(ie);ie.empty=new Hf([]);var Vx=(function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,i,o){var l=this.left.length;if(s<l&&this.left.forEachInner(r,s,Math.min(i,l),o)===!1||i>l&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(s,l),i,o)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(ie);const Wx=500;class Re{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;t&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,u.push(d);return}if(s){u.push(new Fe(d.map));let h=d.step.map(s.slice(i)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new Fe(p,void 0,void 0,c.length+u.length))),i--,p&&s.appendMap(p,i)}else o.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(i)):d.selection,a=new Re(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Fe(e.mapping.maps[u],d,t),h;(h=a&&a.merge(f))&&(f=h,u?i.pop():l=l.slice(0,l.length-1)),i.push(f),t&&(o++,t=void 0),s||(a=f)}let c=o-r.depth;return c>_x&&(l=Kx(l,c),o-=c),new Re(l.append(i),o)}remapping(e,t){let r=new lr;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,t),r}addMaps(e){return this.eventCount==0?this:new Re(this.items.append(e.map(t=>new Fe(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},s);let a=t;this.items.forEach(f=>{let h=i.getMirror(--a);if(h==null)return;o=Math.min(o,h);let p=i.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),m=f.selection&&f.selection.map(i.slice(a+1,h));m&&l++,r.push(new Fe(p,g,m))}else r.push(new Fe(p))},s);let c=[];for(let f=t;f<o;f++)c.push(new Fe(i.maps[f]));let u=this.items.slice(0,s).append(c).append(r),d=new Re(u,l);return d.emptyItemCount()>Wx&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=o.selection&&o.selection.map(t.slice(r));u&&i++;let d=new Fe(c.invert(),a,u),f,h=s.length-1;(f=s.length&&s[h].merge(d))?s[h]=f:s.push(d)}}else o.map&&r--},this.items.length,0),new Re(ie.from(s.reverse()),i)}}Re.empty=new Re(ie.empty,0);function Kx(n,e){let t;return n.forEach((r,s)=>{if(r.selection&&e--==0)return t=s,!1}),n.slice(t)}class Fe{constructor(e,t,r,s){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Fe(t.getMap().invert(),t,this.selection)}}}class pt{constructor(e,t,r,s,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const _x=20;function Ux(n,e,t,r){let s=t.getMeta(Kt),i;if(s)return s.historyState;t.getMeta(Gx)&&(n=new pt(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(Kt))return o.getMeta(Kt).redo?new pt(n.done.addTransform(t,void 0,r,_r(e)),n.undone,yc(t.mapping.maps),n.prevTime,n.prevComposition):new pt(n.done,n.undone.addTransform(t,void 0,r,_r(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!qx(t,n.prevRanges)),c=o?Ni(n.prevRanges,t.mapping):yc(t.mapping.maps);return new pt(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,_r(e)),Re.empty,c,t.time,l??n.prevComposition)}else return(i=t.getMeta("rebased"))?new pt(n.done.rebased(t,i),n.undone.rebased(t,i),Ni(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new pt(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Ni(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function qx(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&s>=e[i]&&(t=!0)}),t}function yc(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,s,i,o)=>e.push(i,o));return e}function Ni(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let s=e.map(n[r],1),i=e.map(n[r+1],-1);s<=i&&t.push(s,i)}return t}function Jx(n,e,t){let r=_r(e),s=Kt.get(e).spec.config,i=(t?n.undone:n.done).popEvent(e,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),l=(t?n.done:n.undone).addTransform(i.transform,e.selection.getBookmark(),s,r),a=new pt(t?l:i.remaining,t?i.remaining:l,null,0,-1);return i.transform.setSelection(o).setMeta(Kt,{redo:t,historyState:a})}let Ai=!1,bc=null;function _r(n){let e=n.plugins;if(bc!=e){Ai=!1,bc=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ai=!0;break}}return Ai}const Kt=new te("history"),Gx=new te("closeHistory");function Yx(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new W({key:Kt,state:{init(){return new pt(Re.empty,Re.empty,null,0,-1)},apply(e,t,r){return Ux(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,s=r=="historyUndo"?Wf:r=="historyRedo"?Kf:null;return!s||!e.editable?!1:(t.preventDefault(),s(e.state,e.dispatch))}}}})}function Vf(n,e){return(t,r)=>{let s=Kt.getState(t);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(r){let i=Jx(s,t,n);i&&r(e?i.scrollIntoView():i)}return!0}}const Wf=Vf(!1,!0),Kf=Vf(!0,!0);Y.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new W({key:new te("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const l=o-s,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,l=o-(i-r),a=o;return e.deleteRange(l,a),!(this.storage.characters({node:e.doc})>r)}})]}});const Xx=Y.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Uk(this.options)]}});Y.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new W({key:new te("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!t||!r)return G.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(!a.isText){if(!(s>=c&&s<=c+a.nodeSize-1))return!1;o+=1}});let l=0;return n.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(st.node(c,c+a.nodeSize,{class:this.options.className}))}),G.create(n,i)}}})]}});const Qx=Y.create({name:"gapCursor",addProseMirrorPlugins(){return[zx()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=$(O(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),_f="placeholder",kc=new te("tiptap__placeholder");function Uf(n){const{editor:e,placeholder:t,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=n,u=[a];return o&&u.push(c),st.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof t=="function"?t({editor:e,node:i,pos:s,hasAnchor:l}):t})}function qf(n,e){return typeof n=="function"?n(e):n}function Jf({editor:n,options:e,dataAttribute:t,doc:r,selection:s,from:i,to:o}){const{anchor:l}=s,a=[],c=n.isEmpty;return r.nodesBetween(i,o,(u,d)=>{const f=l>=d&&l<=d+u.nodeSize,h=!u.isLeaf&&Cr(u);return u.type.isTextblock&&(f||!e.showOnlyCurrent)&&h&&a.push(Uf({editor:n,isEmptyDoc:c,dataAttribute:t,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:qf(e.emptyNodeClass,{editor:n,node:u,pos:d,hasAnchor:f})},node:u,pos:d})),e.includeChildren}),a}function Gf({editor:n,options:e,dataAttribute:t,doc:r,selection:s}){if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:i}=s,o=[],l=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const a=r.resolve(i),c=a.depth>0?a.node(1):a.nodeAfter,u=a.depth>0?a.before(1):i;if(c&&c.type.isTextblock&&Cr(c)){const d=i>=u&&i<=u+c.nodeSize;o.push(Uf({editor:n,isEmptyDoc:l,dataAttribute:t,hasAnchor:d,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:qf(e.emptyNodeClass,{editor:n,node:c,pos:u,hasAnchor:d})},node:c,pos:u}))}}else o.push(...Jf({editor:n,options:e,dataAttribute:t,doc:r,selection:s,from:0,to:r.content.size}));return G.create(r,o)}function Qn(n,e){const t=n.resolve(e);if(t.depth===0){var r;const i=(r=t.nodeAfter)!==null&&r!==void 0?r:t.nodeBefore;if(!i)return{from:e,to:e};const o=t.nodeAfter?e:e-i.nodeSize;return{from:o,to:o+i.nodeSize}}const s=t.before(1);return{from:s,to:s+t.node(1).nodeSize}}function Zn(n,e){return{from:Math.max(0,e.from-1),to:Math.min(n.content.size,e.to-1)}}function Zx(n,e,t){const r=[];return n.forEach((s,i)=>{const o=i,l=o+s.nodeSize,a=o+1,c=l+1;a<t&&c>e&&r.push({from:o,to:l})}),r}function eS(n){if(n.length===0)return[];const e=[...n].sort((r,s)=>r.from-s.from),t=[{...e[0]}];for(let r=1;r<e.length;r+=1){const s=t[t.length-1],i=e[r];i.from<=s.to?s.to=Math.max(s.to,i.to):t.push({...i})}return t}function tS(n,e){const t=Zx(n,e.from,e.to);return t.push(Zn(n,Qn(n,e.from))),e.to>e.from?t.push(Zn(n,Qn(n,Math.min(e.to,n.content.size+1)-1))):e.from<n.content.size+1&&t.push(Zn(n,Qn(n,Math.min(e.from+1,n.content.size)))),t}function nS(n,e,t){const r=[];if(n.docChanged){const s=Js(n);for(const i of s)r.push(...tS(t.doc,i.newRange))}return n.selectionSet&&(r.push(Zn(t.doc,Qn(t.doc,n.mapping.map(e.selection.anchor)))),r.push(Zn(t.doc,Qn(t.doc,t.selection.anchor)))),eS(r)}function rS(n,e,t){const r=Math.max(0,Math.min(n,t.content.size));return{from:r,to:Math.max(r,Math.min(e,t.content.size))}}function sS({decorations:n,ranges:e,editor:t,options:r,dataAttribute:s,doc:i,selection:o}){let l=n;for(const a of e){const{from:c,to:u}=rS(a.from,a.to,i),d=l.find(c,u).filter(h=>h.from>=c&&h.to<=u);d.length&&(l=l.remove(d));const f=Jf({editor:t,options:r,dataAttribute:s,doc:i,selection:o,from:c,to:u});f.length&&(l=l.add(i,f))}return l}function iS({editor:n,options:e,dataAttribute:t}){return{init(r,s){const i=Gf({editor:n,options:e,dataAttribute:t,doc:s.doc,selection:s.selection});return i??G.empty},apply(r,s,i,o){return!r.docChanged&&!r.selectionSet?s:sS({decorations:s.map(r.mapping,r.doc),ranges:nS(r,i,o),editor:n,options:e,dataAttribute:t,doc:o.doc,selection:o.selection})}}}function oS(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function lS({editor:n,options:e}){const t=e.dataAttribute?`data-${oS(e.dataAttribute)}`:`data-${_f}`,r=e.showOnlyCurrent&&!e.includeChildren;return new W({key:kc,...r?{}:{state:iS({editor:n,options:e,dataAttribute:t})},props:{decorations:r?({doc:s,selection:i})=>Gf({editor:n,options:e,dataAttribute:t,doc:s,selection:i}):s=>{var i;return e.showOnlyWhenEditable&&!n.isEditable?G.empty:(i=kc.getState(s))!==null&&i!==void 0?i:G.empty}}})}const JS=Y.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:_f,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[lS({editor:this.editor,options:this.options})]}});function bo(n,e){return!n.selection.empty&&!kd(n.selection)&&e.isEditable}function aS(n,e){return bo(n,e)&&!e.isFocused&&!e.view.dragging}function cS(){var n;(n=window.getSelection())===null||n===void 0||n.removeAllRanges()}function uS(n){n.focus()}Y.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new W({key:new te("selection"),props:{decorations(t){return aS(t,n)?G.create(t.doc,[st.inline(t.selection.from,t.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(t){return bo(t.state,n)&&cS(),!1},focus(t){return bo(t.state,n)&&requestAnimationFrame(()=>{!n.isDestroyed&&t.hasFocus()&&uS(t)}),!1}}}})]}});function xc({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}const dS=Y.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new te(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)===null||n===void 0?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(t).includes(s.name));return[new W({key:e,appendTransaction:(s,i,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),d=l.content.size,f=c.nodes[t];if(!s.some(h=>h.getMeta("skipTrailingNode"))&&u)return a.insert(d,f.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!xc({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!xc({node:o,types:r})}}})]}}),fS=Y.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Wf(n,e),redo:()=>({state:n,dispatch:e})=>Kf(n,e)}},addProseMirrorPlugins(){return[Yx(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),hS=Y.create({name:"starterKit",addExtensions(){const n=[];if(this.options.bold!==!1&&n.push(mb.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(ub.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(sf.configure(this.options.bulletList)),this.options.code!==!1&&n.push(bb.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(Sb.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(Cb.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(Xx.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(Qx.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(Mb.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(Tb.configure(this.options.heading)),this.options.undoRedo!==!1&&n.push(fS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&n.push(Eb.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(Ob.configure(this.options.italic)),this.options.listItem!==!1&&n.push(uf.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;n.push(ff.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var t;n.push(rf.configure((t=this.options)===null||t===void 0?void 0:t.link))}if(this.options.orderedList!==!1&&n.push(pf.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push(jk.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(Wk.configure(this.options.strike)),this.options.text!==!1&&n.push(Kk.configure(this.options.text)),this.options.underline!==!1){var r;n.push(_k.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var s;n.push(dS.configure((s=this.options)===null||s===void 0?void 0:s.trailingNode))}return n}});var GS=hS;function pS(n,e){const t={};for(const r of n?.arguments??[])t[r.name]=r.required?Sl().min(1,e):Sl();return th(t)}function mS(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function YS(n){const e=Yt.c(74),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:i}=n,o=V.useId(),l=So();let a,c;if(e[0]!==t||e[1]!==l){const le=pS(t,l("chat.dialogPromptArguments.required"));c=nh,a=Zf(le),e[0]=t,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==i||e[5]!==t?(u=t?mS(t,i):{},e[4]=i,e[5]=t,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==t?.arguments?(h=t?.arguments??[],e[10]=t?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==s||e[14]!==r?(g=async le=>{await s(le),r(null),f.reset()},e[12]=f,e[13]=s,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=le=>{le||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!t)return null;let x;e[19]!==t._meta||e[20]!==t.name||e[21]!==t.title?(x=t.title||dh(t.name,fh(t._meta)),e[19]=t._meta,e[20]=t.name,e[21]=t.title,e[22]=x):x=e[22];let C;e[23]!==x?(C=k.jsx(rh,{children:k.jsx("span",{className:"capitalize",children:x})}),e[23]=x,e[24]=C):C=e[24];let T;e[25]!==t.description?(T=t.description&&k.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[25]=t.description,e[26]=T):T=e[26];let A;e[27]!==T||e[28]!==C?(A=k.jsxs(sh,{children:[C,T]}),e[27]=T,e[28]=C,e[29]=A):A=e[29];let v;e[30]!==f||e[31]!==m?(v=le=>{le.stopPropagation(),f.handleSubmit(m)(le)},e[30]=f,e[31]=m,e[32]=v):v=e[32];let D;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let le;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(le=$e=>k.jsx(ph,{control:f.control,name:$e.name,render:wn=>{const{field:Ke}=wn;return k.jsxs(mh,{children:[k.jsxs(gh,{className:"text-xs",children:[$e.name,$e.required?null:k.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),k.jsx(yh,{children:k.jsx(ih,{...Ke,value:Ke.value??"",required:$e.required,placeholder:$e.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),k.jsx(bh,{})]})}},$e.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=le):le=e[41],D=p.map(le),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=D}else D=e[37];let R;e[42]!==b?(R=()=>b(!1),e[42]=b,e[43]=R):R=e[43];const j=f.formState.isSubmitting;let K;e[44]!==l?(K=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=K):K=e[45];let U;e[46]!==f.formState.isSubmitting||e[47]!==R||e[48]!==K?(U=k.jsx(xl,{type:"button",variant:"ghost",onClick:R,disabled:j,children:K}),e[46]=f.formState.isSubmitting,e[47]=R,e[48]=K,e[49]=U):U=e[49];let L;e[50]!==f.formState.isSubmitting||e[51]!==l?(L=f.formState.isSubmitting?k.jsxs("span",{className:"flex items-center gap-2",children:[k.jsx(eh,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=L):L=e[52];let B;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==L?(B=k.jsx(xl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:L}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=L,e[56]=B):B=e[56];let z;e[57]!==U||e[58]!==B?(z=k.jsxs(oh,{children:[U,B]}),e[57]=U,e[58]=B,e[59]=z):z=e[59];let _;e[60]!==o||e[61]!==v||e[62]!==D||e[63]!==z?(_=k.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[D,z]}),e[60]=o,e[61]=v,e[62]=D,e[63]=z,e[64]=_):_=e[64];let Q;e[65]!==f||e[66]!==_?(Q=k.jsx(hh,{...f,children:_}),e[65]=f,e[66]=_,e[67]=Q):Q=e[67];let oe;e[68]!==A||e[69]!==Q?(oe=k.jsxs(lh,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[A,Q]}),e[68]=A,e[69]=Q,e[70]=oe):oe=e[70];let Ce;return e[71]!==b||e[72]!==oe?(Ce=k.jsx(ah,{open:!0,onOpenChange:b,children:oe}),e[71]=b,e[72]=oe,e[73]=Ce):Ce=e[73],Ce}function gS(n){if(typeof n!="object"||n===null)return null;const{volume:e,path:t}=n;return typeof e!="string"||e===""||typeof t!="string"||t===""?null:`${e}/${t}/SKILL.md`}function yS(n){return n.storage.mention}function XS(n,e,t){n.chain().focus().insertContentAt(e,[bS(t),{type:"text",text:" "}]).run()}function bS(n){return{type:"mention",attrs:n}}function QS(n,e,t){const r=n.state.doc.nodeAt(e);return r?.type.name==="mention"&&r.attrs.id===t}function kS(n){const e=Yt.c(43),{node:t,selected:r,view:s,editor:i,getPos:o}=n,{name:l,char:a,kind:c,id:u,args:d,metadata:f}=t.attrs,h=So(),p=V.useContext(kh),g=r&&s.editable,m=c==="task",y=a==="@",b=s.editable&&a==="/"&&(c==="prompt"||c===void 0);let x;e[0]!==c||e[1]!==f?(x=c==="skill"?gS(f):null,e[0]=c,e[1]=f,e[2]=x):x=e[2];const C=x,T=!!p&&!!C,A=b||T;let v;e[3]!==d||e[4]!==i||e[5]!==o||e[6]!==u||e[7]!==l?(v=()=>{const bl=yS(i)?.onEditChip;if(!bl||typeof o!="function")return;const kl=o();typeof kl=="number"&&bl({promptId:u,promptName:l,args:d??{},pos:kl})},e[3]=d,e[4]=i,e[5]=o,e[6]=u,e[7]=l,e[8]=v):v=e[8];const D=v;let R;e[9]!==p||e[10]!==T||e[11]!==C||e[12]!==D?(R=()=>{if(T&&C){p.open(C);return}D()},e[9]=p,e[10]=T,e[11]=C,e[12]=D,e[13]=R):R=e[13];const j=R;let K;e[14]!==j||e[15]!==A?(K=lt=>{A&&(lt.preventDefault(),lt.stopPropagation(),j())},e[14]=j,e[15]=A,e[16]=K):K=e[16];const U=K;let L;e[17]!==j||e[18]!==A?(L=lt=>{A&&(lt.key!=="Enter"&<.key!==" "||(lt.preventDefault(),lt.stopPropagation(),j()))},e[17]=j,e[18]=A,e[19]=L):L=e[19];const B=L,z=A?"button":void 0,_=A?0:void 0;let Q;e[20]!==A||e[21]!==l||e[22]!==T||e[23]!==h?(Q=A?h(T?"chat.mention.openSkill":"chat.mention.editPrompt",{name:l?Cl(l):""}):void 0,e[20]=A,e[21]=l,e[22]=T,e[23]=h,e[24]=Q):Q=e[24];const oe=A?"cursor-pointer":"cursor-default",Ce=y?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",le=g&&"outline-2 outline-blue-300 outline-offset-0",$e=A&&"hover:brightness-95",wn=!m&&"capitalize";let Ke;e[25]!==le||e[26]!==$e||e[27]!==wn||e[28]!==oe||e[29]!==Ce?(Ke=er("px-1 py-1 rounded","inline-flex items-center gap-1",oe,"select-none","text-xs font-light",Ce,le,$e,wn),e[25]=le,e[26]=$e,e[27]=wn,e[28]=oe,e[29]=Ce,e[30]=Ke):Ke=e[30];let tn;e[31]!==m||e[32]!==l?(tn=m?k.jsx("span",{className:"inline-block max-w-[220px] truncate align-bottom",children:l??""}):l?Cl(l):"",e[31]=m,e[32]=l,e[33]=tn):tn=e[33];let wr;return e[34]!==a||e[35]!==U||e[36]!==B||e[37]!==Ke||e[38]!==tn||e[39]!==z||e[40]!==_||e[41]!==Q?(wr=k.jsxs(zd,{onClick:U,onKeyDown:B,role:z,tabIndex:_,"aria-label":Q,className:Ke,children:[a,tn]}),e[34]=a,e[35]=U,e[36]=B,e[37]=Ke,e[38]=tn,e[39]=z,e[40]=_,e[41]=Q,e[42]=wr):wr=e[42],wr}const ZS=be.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id")||null,renderHTML:n=>n.id?{"data-id":n.id}:{}},name:{default:null,parseHTML:n=>n.getAttribute("data-name")||null,renderHTML:n=>n.name?{"data-name":n.name}:{}},char:{default:"/",parseHTML:n=>n.getAttribute("data-char")||"/",renderHTML:n=>n.char?{"data-char":n.char}:{}},metadata:{default:null,parseHTML:n=>{try{return JSON.parse(n.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:n=>n.metadata?{"data-metadata":JSON.stringify(n.metadata)}:{}},kind:{default:void 0,parseHTML:n=>n.getAttribute("data-kind")||void 0,renderHTML:n=>n.kind?{"data-kind":n.kind}:{}},args:{default:null,parseHTML:n=>{try{return JSON.parse(n.getAttribute("data-args")||"null")}catch{return null}},renderHTML:n=>n.args?{"data-args":JSON.stringify(n.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({HTMLAttributes:n}){return["span",ee(n,{"data-type":"mention"})]},renderText({node:n}){const e=n.attrs.char??"@",t=n.attrs.name??"";return`${e}${t}`},addNodeView(){return Bd(kS)}});function eC(n){if(n.type!=="tool-suggest_task")return!1;if(n.state==="input-available")return!0;const e=n.output;return n.state==="output-available"&&typeof e?.accepted!="boolean"}function tC(n){const e=Yt.c(19),{id:t,part:r,copyable:s,extraActions:i,alwaysShowActions:o,animate:l}=n,a=s===void 0?!1:s,c=o===void 0?!1:o,u=l===void 0?!1:l,{handleCopy:d}=Sh(),f=So(),[h,p]=V.useState(!1);let g;e[0]!==d||e[1]!==t||e[2]!==r.text?(g=async()=>{uh("chat_message_copied",{message_id:t,chars:r.text.length}),await d(r.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=d,e[1]=t,e[2]=r.text,e[3]=g):g=e[3];const m=g,y=a&&i,b=y||i;let x;e[4]!==u||e[5]!==t||e[6]!==r.text?(x=k.jsx(xh,{id:t,text:r.text,animate:u}),e[4]=u,e[5]=t,e[6]=r.text,e[7]=x):x=e[7];let C;e[8]!==c||e[9]!==i||e[10]!==m||e[11]!==h||e[12]!==b||e[13]!==y||e[14]!==f?(C=b&&k.jsxs("div",{className:er("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",c?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[i,y&&i&&k.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),y&&k.jsx("button",{type:"button",onClick:m,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":f("chat.textPart.copyMessage"),children:h?k.jsx(ch,{className:"size-4"}):k.jsx(Ch,{className:"size-4"})})]}),e[8]=c,e[9]=i,e[10]=m,e[11]=h,e[12]=b,e[13]=y,e[14]=f,e[15]=C):C=e[15];let T;return e[16]!==x||e[17]!==C?(T=k.jsxs("div",{className:"group/part relative",children:[x,C]}),e[16]=x,e[17]=C,e[18]=T):T=e[18],T}function nC(n,e,t){n.chain().focus().insertContentAt(e,[xS(t),{type:"text",text:" "}]).run()}function xS(n){return{type:"file",attrs:n}}function SS(n){return(n??"").startsWith("image/")}function CS(n){const e=Yt.c(17),{node:t,selected:r,view:s}=n,{name:i,mimeType:o,data:l}=t.attrs,a=r&&s.editable;let c;e[0]!==o?(c=SS(o),e[0]=o,e[1]=c):c=e[1];const u=c,d=a&&"outline-2 outline-blue-300 outline-offset-0";let f;e[2]!==d?(f=er("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",d),e[2]=d,e[3]=f):f=e[3];let h;e[4]!==i?(h=k.jsx(tr,{asChild:!0,children:k.jsx("span",{children:i})}),e[4]=i,e[5]=h):h=e[5];let p;e[6]!==l||e[7]!==u||e[8]!==o||e[9]!==i?(p=k.jsx(nr,{side:"top",className:"max-w-sm p-1.5",children:u?k.jsx("img",{src:`data:${o};base64,${l}`,alt:i,className:"max-w-full max-h-64 object-contain rounded"}):k.jsxs("div",{className:"text-xs",children:[k.jsx("div",{className:"font-medium",children:i}),k.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=l,e[7]=u,e[8]=o,e[9]=i,e[10]=p):p=e[10];let g;e[11]!==h||e[12]!==p?(g=k.jsxs(rr,{children:[h,p]}),e[11]=h,e[12]=p,e[13]=g):g=e[13];let m;return e[14]!==f||e[15]!==g?(m=k.jsx(zd,{className:f,children:g}),e[14]=f,e[15]=g,e[16]=m):m=e[16],m}const rC=be.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id")||null,renderHTML:n=>n.id?{"data-id":n.id}:{}},name:{default:null,parseHTML:n=>n.getAttribute("data-name")||null,renderHTML:n=>n.name?{"data-name":n.name}:{}},mimeType:{default:null,parseHTML:n=>n.getAttribute("data-mime-type")||null,renderHTML:n=>n.mimeType?{"data-mime-type":n.mimeType}:{}},size:{default:0,parseHTML:n=>{const e=n.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:n=>n.size?{"data-size":String(n.size)}:{}},data:{default:null,parseHTML:n=>n.getAttribute("data-data")||null,renderHTML:n=>n.data?{"data-data":n.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:n,HTMLAttributes:e}){const t={"data-type":"file"};return n.attrs.id&&(t["data-id"]=n.attrs.id),n.attrs.name&&(t["data-name"]=n.attrs.name),n.attrs.mimeType&&(t["data-mime-type"]=n.attrs.mimeType),n.attrs.size&&(t["data-size"]=String(n.attrs.size)),n.attrs.data&&(t["data-data"]=n.attrs.data),["span",{...e,...t}]},renderText({node:n}){return`[${n.attrs.name??""}]`},addNodeView(){return Bd(CS)}}),At=16,ko=2.5,xo=(At-ko)/2,Oi=2*Math.PI*xo;function sC(n){const e=Yt.c(29),{usage:t}=n,r=Co();if(!t)return null;const{totalTokens:s,inputTokens:i,outputTokens:o}=t,l=r?t.cost:0;if(!s&&!i&&!o)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=k.jsx(Mh,{size:12}),e[0]=a):a=e[0];let c;e[1]!==l||e[2]!==s?(c=l>0?`$${l.toFixed(4)}`:s.toLocaleString(),e[1]=l,e[2]=s,e[3]=c):c=e[3];let u;e[4]!==c?(u=k.jsx(tr,{asChild:!0,children:k.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[a,k.jsx("span",{className:"text-sm font-mono tabular-nums",children:c})]})}),e[4]=c,e[5]=u):u=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=k.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=d):d=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=k.jsx("span",{className:"text-muted",children:"in"}),e[7]=f):f=e[7];let h;e[8]!==i?(h=i.toLocaleString(),e[8]=i,e[9]=h):h=e[9];let p;e[10]!==h?(p=k.jsx("span",{className:"text-right tabular-nums",children:h}),e[10]=h,e[11]=p):p=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=k.jsx("span",{className:"text-muted",children:"out"}),e[12]=g):g=e[12];const m=o-(t.reasoningTokens??0);let y;e[13]!==m?(y=m.toLocaleString(),e[13]=m,e[14]=y):y=e[14];let b;e[15]!==y?(b=k.jsx("span",{className:"text-right tabular-nums",children:y}),e[15]=y,e[16]=b):b=e[16];let x;e[17]!==t?(x=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"cache hit"}),k.jsx("span",{className:"text-right tabular-nums",children:`${(Mo(t)*100).toFixed(0)}%`})]}),e[17]=t,e[18]=x):x=e[18];let C;e[19]!==l?(C=l>0&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"cost"}),k.jsxs("span",{className:"text-right tabular-nums",children:["$",l.toFixed(4)]})]}),e[19]=l,e[20]=C):C=e[20];let T;e[21]!==b||e[22]!==x||e[23]!==C||e[24]!==p?(T=k.jsxs(nr,{side:"top",className:"font-mono text-[11px]",children:[d,k.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[f,p,g,b,x,C]})]}),e[21]=b,e[22]=x,e[23]=C,e[24]=p,e[25]=T):T=e[25];let A;return e[26]!==T||e[27]!==u?(A=k.jsxs(rr,{children:[u,T]}),e[26]=T,e[27]=u,e[28]=A):A=e[28],A}function iC(n){const e=Yt.c(19),{usage:t,duration:r}=n,s=Co(),i=r!=null&&r>0,o=s&&t!=null&&(t.cost??0)>0,l=t!=null&&(t.totalTokens??0)>0;if(!i&&!o&&!l)return null;let a;e[0]!==r||e[1]!==i?(a=i?Ml(r/1e3):null,e[0]=r,e[1]=i,e[2]=a):a=e[2];const c=a;let u;e[3]!==r||e[4]!==c||e[5]!==t?(u=c&&k.jsxs(rr,{children:[k.jsx(tr,{asChild:!0,children:k.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:c})}),k.jsxs(nr,{side:"top",className:"font-mono text-[11px]",children:[k.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),k.jsx("span",{className:"tabular-nums",children:Ml(r/1e3)}),(t?.reasoningTokens??0)>0&&k.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=r,e[4]=c,e[5]=t,e[6]=u):u=e[6];let d;e[7]!==o||e[8]!==i||e[9]!==l?(d=i&&(o||l)&&k.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=o,e[8]=i,e[9]=l,e[10]=d):d=e[10];let f;e[11]!==o||e[12]!==l||e[13]!==t?(f=(o||l)&&k.jsxs(rr,{children:[k.jsx(tr,{asChild:!0,children:k.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:o?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),k.jsxs(nr,{side:"top",className:"font-mono text-[11px]",children:[k.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),k.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[k.jsx("span",{className:"opacity-60",children:"in"}),k.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),k.jsx("span",{className:"opacity-60",children:"out"}),k.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"opacity-60",children:"think"}),k.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"opacity-60",children:"cache hit"}),k.jsx("span",{className:"text-right tabular-nums",children:`${(Mo(t)*100).toFixed(0)}%`})]})]})]})]}),e[11]=o,e[12]=l,e[13]=t,e[14]=f):f=e[14];let h;return e[15]!==u||e[16]!==d||e[17]!==f?(h=k.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[u,d,f]}),e[15]=u,e[16]=d,e[17]=f,e[18]=h):h=e[18],h}function oC(n){const e=Yt.c(52),{usage:t,totalTokens:r,contextWindow:s,onOpenContextPanel:i}=n,o=Co(),l=Math.min(r/s*100,100),a=Oi-l/100*Oi,c=o?t?.cost??0:0,u=(t?.cost??0)>0,d=t?.inputTokens??0,f=t?.outputTokens??0;let h;e[0]!==l?(h=l.toFixed(0),e[0]=l,e[1]=h):h=e[1];let p;e[2]!==c?(p=c>0?`, $${c.toFixed(2)}`:"",e[2]=c,e[3]=p):p=e[3];const g=`Context usage: ${h}%${p}`,m=i?"cursor-pointer":"cursor-default";let y;e[4]!==m?(y=er("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",m),e[4]=m,e[5]=y):y=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=k.jsx("circle",{cx:At/2,cy:At/2,r:xo,fill:"none",stroke:"currentColor",strokeWidth:ko,className:"opacity-15"}),e[6]=b):b=e[6];const x=l>90?"text-destructive":l>70?"text-warning":"text-muted-foreground";let C;e[7]!==x?(C=er(x),e[7]=x,e[8]=C):C=e[8];let T;e[9]!==a||e[10]!==C?(T=k.jsxs("svg",{width:At,height:At,className:"-rotate-90","aria-hidden":"true",children:[b,k.jsx("circle",{cx:At/2,cy:At/2,r:xo,fill:"none",stroke:"currentColor",strokeWidth:ko,strokeDasharray:Oi,strokeDashoffset:a,strokeLinecap:"round",className:C})]}),e[9]=a,e[10]=C,e[11]=T):T=e[11];let A;e[12]!==l?(A=l.toFixed(0),e[12]=l,e[13]=A):A=e[13];let v;e[14]!==c?(v=c>0?` · $${c.toFixed(2)}`:"",e[14]=c,e[15]=v):v=e[15];let D;e[16]!==A||e[17]!==v?(D=k.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[A,"%",v]}),e[16]=A,e[17]=v,e[18]=D):D=e[18];let R;e[19]!==i||e[20]!==D||e[21]!==g||e[22]!==y||e[23]!==T?(R=k.jsx(tr,{asChild:!0,children:k.jsxs("button",{type:"button",onClick:i,"aria-label":g,className:y,children:[T,D]})}),e[19]=i,e[20]=D,e[21]=g,e[22]=y,e[23]=T,e[24]=R):R=e[24];let j;e[25]===Symbol.for("react.memo_cache_sentinel")?(j=k.jsx("span",{className:"text-muted",children:"context"}),e[25]=j):j=e[25];let K;e[26]!==r?(K=r.toLocaleString(),e[26]=r,e[27]=K):K=e[27];let U;e[28]!==s?(U=s.toLocaleString(),e[28]=s,e[29]=U):U=e[29];let L;e[30]!==l?(L=l.toFixed(1),e[30]=l,e[31]=L):L=e[31];let B;e[32]!==K||e[33]!==U||e[34]!==L?(B=k.jsxs("span",{className:"text-right tabular-nums",children:[K," / ",U," (",L,"%)"]}),e[32]=K,e[33]=U,e[34]=L,e[35]=B):B=e[35];let z;e[36]!==c?(z=c>0&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"cost"}),k.jsxs("span",{className:"text-right tabular-nums",children:["$",c.toFixed(4)]})]}),e[36]=c,e[37]=z):z=e[37];let _;e[38]!==u||e[39]!==d||e[40]!==f?(_=u&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"in"}),k.jsx("span",{className:"text-right tabular-nums",children:d.toLocaleString()}),k.jsx("span",{className:"text-muted",children:"out"}),k.jsx("span",{className:"text-right tabular-nums",children:f.toLocaleString()})]}),e[38]=u,e[39]=d,e[40]=f,e[41]=_):_=e[41];let Q;e[42]!==t?(Q=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"cache hit"}),k.jsx("span",{className:"text-right tabular-nums",children:`${(Mo(t)*100).toFixed(0)}%`})]}),e[42]=t,e[43]=Q):Q=e[43];let oe;e[44]!==B||e[45]!==z||e[46]!==_||e[47]!==Q?(oe=k.jsx(nr,{side:"top",className:"font-mono text-[11px]",children:k.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[j,B,z,_,Q]})}),e[44]=B,e[45]=z,e[46]=_,e[47]=Q,e[48]=oe):oe=e[48];let Ce;return e[49]!==R||e[50]!==oe?(Ce=k.jsxs(rr,{children:[R,oe]}),e[49]=R,e[50]=oe,e[51]=Ce):Ce=e[51],Ce}export{gp as $,Ko as A,$ as B,O as C,G as D,Y as E,rC as F,HS as G,WS as H,zS as I,Ny as J,VS as K,w0 as L,Xt as M,be as N,My as O,YS as P,zd as Q,Bd as R,oC as S,N as T,Z0 as U,KS as V,Mn as W,qS as X,Fk as Y,Bk as Z,nd as _,G1 as a,S as a0,E as a1,re as a2,je as a3,w as a4,eu as a5,BS as a6,Wo as a7,Ay as a8,yd as a9,U1 as b,bS as c,tC as d,US as e,XS as f,jS as g,sC as h,eC as i,ZS as j,iC as k,nC as l,ee as m,te as n,W as o,yS as p,QS as q,Go as r,GS as s,JS as t,_S as u,st as v,FS as w,I as x,d0 as y,Kn as z};
|
|
141
|
+
`))),0,0),n.someProp("transformPasted",f=>{l=f(l,n,!0)}),l;let d=n.someProp("clipboardTextParser",f=>f(e,s,r,n));if(d)l=d;else{let f=s.marks(),{schema:h}=n.state,p=rt.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=o.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(h.text(g,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=fx(t),dl&&hx(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||He.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!cx.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=px(pc(l,+u[1],+u[2]),u[4]);else if(l=E.maxOpen(ux(l.content,s),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d<l.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=pc(l,d,f)}return n.someProp("transformPasted",d=>{l=d(l,n,a)}),l}const cx=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ux(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let s=e.node(t).contentMatchAt(e.index(t)),i,o=[];if(n.forEach(l=>{if(!o)return;let a=s.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&i.length&&Nf(a,i,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=Af(o[o.length-1],i.length));let u=vf(l,a);o.push(u),s=s.matchType(u.type),i=a}}),o)return S.from(o)}return n}function vf(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,S.from(n));return n}function Nf(n,e,t,r,s){if(s<n.length&&s<e.length&&n[s]==e[s]){let i=Nf(n,e,t,r.lastChild,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==n.length-1?t.type:n[s+1]))return r.copy(r.content.append(S.from(vf(t,n,s+1))))}}function Af(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Af(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(S.empty,!0);return n.copy(t.append(r))}function go(n,e,t,r,s,i){let o=e<0?n.firstChild:n.lastChild,l=o.content;return n.childCount>1&&(i=0),s<r-1&&(l=go(l,e,t,r,s+1,i)),s>=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(S.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function pc(n,e,t){return e<n.openStart&&(n=new E(go(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new E(go(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Of={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let mc=null;function Df(){return mc||(mc=document.implementation.createHTMLDocument("title"))}let vi=null;function dx(n){let e=window.trustedTypes;return e?(vi||(vi=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),vi.createHTML(n)):n}function fx(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Df().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),s;if((s=r&&Of[r[1].toLowerCase()])&&(n=s.map(i=>"<"+i+">").join("")+n+s.map(i=>"</"+i+">").reverse().join("")),t.innerHTML=dx(n),s)for(let i=0;i<s.length;i++)t=t.querySelector(s[i])||t;return t}function hx(n){let e=n.querySelectorAll(ot?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function px(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:s,openStart:i,openEnd:o}=n;for(let l=r.length-2;l>=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=S.from(a.create(r[l+1],s)),i++,o++}return new E(s,i,o)}const Le={},Te={};function yt(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Te.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!If(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Er&&ot&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),ul&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",s=>s(n,yf(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||ax(n,t)?t.preventDefault():yt(n,"key")};Te.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Te.keypress=(n,e)=>{let t=e;if(If(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ne&&t.metaKey)return;if(n.someProp("handleKeyPress",s=>s(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof N)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(t.charCode),i=()=>n.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,s,i))&&n.dispatch(i()),t.preventDefault()}};function ei(n){return{left:n.clientX,top:n.clientY}}function mx(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function hl(n,e,t,r,s){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(n.someProp(e,l=>o>i.depth?l(n,t,i.nodeAfter,i.before(o),s,!0):l(n,t,i.node(o),i.before(o),s,!1)))return!0;return!1}function gn(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function gx(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&w.isSelectable(r)?(gn(n,new w(t)),!0):!1}function yx(n,e){if(e==-1)return!1;let t=n.state.selection,r,s;t instanceof w&&(r=t.node);let i=n.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(w.isSelectable(l)){r&&t.$from.depth>0&&o>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?s=i.before(t.$from.depth):s=i.before(o);break}}return s!=null?(gn(n,w.create(n.state.doc,s)),!0):!1}function bx(n,e,t,r,s){return hl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(s?yx(n,t):gx(n,t))}function kx(n,e,t,r){return hl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",s=>s(n,e,r))}function xx(n,e,t,r){return hl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",s=>s(n,e,r))||Sx(n,t,r)}function Sx(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(gn(n,N.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),l=s.before(i);if(o.inlineContent)gn(n,N.create(r,l+1,l+1+o.content.size));else if(w.isSelectable(o))gn(n,w.create(r,l));else continue;return!0}}function pl(n){return Ls(n)}const Rf=Ne?"metaKey":"ctrlKey";Le.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=pl(n),s=Date.now(),i="singleClick";s-n.input.lastClick.time<500&&mx(t,n.input.lastClick)&&!t[Rf]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:i,button:t.button};let o=n.posAtCoords(ei(t));o&&(i=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Cx(n,o,t,!!r)):(i=="doubleClick"?kx:xx)(n,o.pos,o.inside,t)?t.preventDefault():yt(n,"pointer"))};class Cx{constructor(e,t,r,s){this.view=e,this.pos=t,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Rf],this.allowDefault=r.shiftKey;let i,o;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);i=u.parent,o=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof w&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Zs&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),yt(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>fl(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ei(e))),this.updateAllowDefault(e),this.allowDefault||!t?yt(this.view,"pointer"):bx(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||en&&this.mightDrag&&!this.mightDrag.node.isAtom||ot&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(gn(this.view,I.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):yt(this.view,"pointer")}move(e){this.updateAllowDefault(e),yt(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Le.touchstart=n=>{n.input.lastTouch=Date.now(),pl(n),yt(n,"pointer")};Le.touchmove=n=>{n.input.lastTouch=Date.now(),yt(n,"pointer")};Le.contextmenu=n=>pl(n);function If(n,e){return n.composing?!0:en&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Mx=Er?5e3:-1;Te.compositionstart=Te.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof N&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||ot&&Sf&&Tx(n)))n.markCursor=n.state.storedMarks||t.marks(),Ls(n,!0),n.markCursor=null;else if(Ls(n,!e.selection.empty),Zs&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=n.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}n.input.composing=!0}Pf(n,Mx)};function Tx(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return r.nodeType==1&&r.contentEditable=="false"}Te.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Pf(n,20))};function Pf(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ls(n),e))}function Ex(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=wx());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function wx(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ls(n,e=!1){if(!(Er&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Ex(n),e||n.docView&&n.docView.dirty){let t=Xk(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function vx(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const mr=Tr&&kf<15||ul&&Yk<604;Le.copy=Te.cut=(n,e)=>{let t=e,r=n.state.selection,s=t.type=="cut";if(r.empty)return;let i=mr?null:t.clipboardData,o=r.content(),{dom:l,text:a}=Ef(n,o);i?(t.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):vx(n,l),s&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Nx(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Ax(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?yo(n,r.value,null,s,e):yo(n,r.textContent,r.innerHTML,s,e)},50)}function yo(n,e,t,r,s){let i=wf(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,s,i||E.empty)))return!0;if(!i)return!1;let o=Nx(i),l=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Lf(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Te.paste=(n,e)=>{let t=e;if(n.composing&&!Er)return;let r=mr?null:t.clipboardData,s=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&yo(n,Lf(r),r.getData("text/html"),s,t)?t.preventDefault():Ax(n,t)};class Ox{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Dx=Ne?"altKey":"ctrlKey";function $f(n,e){let t;return n.someProp("dragCopies",r=>{t=t||r(e)}),t!=null?!t:!e[Dx]}Le.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let s=n.state.selection,i=s.empty?null:n.posAtCoords(ei(t)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof w?s.to-1:s.to))){if(r&&r.mightDrag)o=w.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(o=w.create(n.state.doc,d.posBefore))}}let l=(o||n.state.selection).content(),{dom:a,text:c,slice:u}=Ef(n,l);(!t.dataTransfer.files.length||!ot||xf>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(mr?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",mr||t.dataTransfer.setData("text/plain",c),n.dragging=new Ox(u,$f(n,t),o)};Le.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Te.dragover=Te.dragenter=(n,e)=>e.preventDefault();Te.drop=(n,e)=>{try{Rx(n,e,n.dragging)}finally{n.dragging=null}};function Rx(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(ei(e));if(!r)return;let s=n.state.doc.resolve(r.pos),i=t&&t.slice;i?n.someProp("transformPasted",h=>{i=h(i,n,!1)}):i=wf(n,Lf(e.dataTransfer),mr?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(t&&$f(n,e));if(n.someProp("handleDrop",h=>h(n,e,i||E.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?vo(n.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let a=n.state.tr;if(o){let{node:h}=t;h?h.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,d=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(d))return;let f=a.doc.resolve(c);if(u&&w.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new w(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((p,g,m,y)=>h=y),a.setSelection(Mf(n,f,a.doc.resolve(h)))}n.focus(),n.dispatch(a.setMeta("uiEvent","drop"))}Le.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&fl(n)},20))};Le.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Le.beforeinput=(n,e)=>{if(ot&&Er&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,yf(8,"Backspace")))))return;let{$cursor:s}=n.state.selection;s&&s.pos>0&&n.dispatch(n.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let n in Te)Le[n]=Te[n];function gr(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class $s{constructor(e,t){this.toDOM=e,this.spec=t||Vt,this.side=this.spec.side||0}map(e,t,r,s){let{pos:i,deleted:o}=e.mapResult(t.from+s,this.side<0?-1:1);return o?null:new je(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof $s&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&gr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class St{constructor(e,t){this.attrs=e,this.spec=t||Vt}map(e,t,r,s){let i=e.map(t.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new je(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof St&&gr(this.attrs,e.attrs)&&gr(this.spec,e.spec)}static is(e){return e.type instanceof St}destroy(){}}class ml{constructor(e,t){this.attrs=e,this.spec=t||Vt}map(e,t,r,s){let i=e.mapResult(t.from+s,1);if(i.deleted)return null;let o=e.mapResult(t.to+s,-1);return o.deleted||o.pos<=i.pos?null:new je(i.pos-r,o.pos-r,this)}valid(e,t){let{index:r,offset:s}=e.content.findIndex(t.from),i;return s==t.from&&!(i=e.child(r)).isText&&s+i.nodeSize==t.to}eq(e){return this==e||e instanceof ml&&gr(this.attrs,e.attrs)&&gr(this.spec,e.spec)}destroy(){}}class je{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new je(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new je(e,e,new $s(t,r))}static inline(e,t,r,s){return new je(e,t,new St(r,s))}static node(e,t,r,s){return new je(e,t,new ml(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof St}get widget(){return this.type instanceof $s}}const hn=[],Vt={};class re{constructor(e,t){this.local=e.length?e:hn,this.children=t.length?t:hn}static create(e,t){return t.length?zs(t,e,0,Vt):me}find(e,t,r){let s=[];return this.findInner(e??0,t??1e9,s,0,r),s}findInner(e,t,r,s,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=t&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,r,s+l,i)}}map(e,t,r){return this==me||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vt)}mapInner(e,t,r,s,i){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,s);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?Ix(this.children,o||[],e,t,r,s,i):o?new re(o.sort(Wt),hn):me}add(e,t){return t.length?this==me?re.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let s,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Bf(t,l,c)){for(s||(s=this.children.slice());i<s.length&&s[i]<a;)i+=3;s[i]==a?s[i+2]=s[i+2].addInner(l,u,c+1):s.splice(i,0,a,a+l.nodeSize,zs(u,l,c+1,Vt)),i+=3}});let o=zf(i?Ff(t):t,-r);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new re(o.length?this.local.concat(o).sort(Wt):this.local,s||this.children)}remove(e){return e.length==0||this==me?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let o,l=r[i]+t,a=r[i+1]+t;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(o||(o=[])).push(d));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(o,l+1);c!=me?r[i+2]=c:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let l=0;l<s.length;l++)s[l].eq(o,t)&&(s==this.local&&(s=this.local.slice()),s.splice(l--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new re(s,r):me}forChild(e,t){if(this==me)return this;if(t.isLeaf)return re.empty;let r,s;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,o=i+t.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>i&&a.type instanceof St){let c=Math.max(i,a.from)-i,u=Math.min(o,a.to)-i;c<u&&(s||(s=[])).push(a.copy(c,u))}}if(s){let l=new re(s.sort(Wt),hn);return r?new Dt([l,r]):l}return r||me}eq(e){if(this==e)return!0;if(!(e instanceof re)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return gl(this.localsInner(e))}localsInner(e){if(this==me)return hn;if(e.inlineContent||!this.local.some(St.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof St||t.push(this.local[r]);return t}forEachSet(e){e(this)}}re.empty=new re([],[]);re.removeOverlap=gl;const me=re.empty;class Dt{constructor(e){this.members=e}map(e,t){const r=this.members.map(s=>s.map(e,t,Vt));return Dt.from(r)}forChild(e,t){if(t.isLeaf)return re.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,t);i!=me&&(i instanceof Dt?r=r.concat(i.members):r.push(i))}return Dt.from(r)}eq(e){if(!(e instanceof Dt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(!t)t=i;else{r&&(t=t.slice(),r=!1);for(let o=0;o<i.length;o++)t.push(i[o])}}return t?gl(r?t:t.sort(Wt)):hn}static from(e){switch(e.length){case 0:return me;case 1:return e[0];default:return new Dt(e.every(t=>t instanceof re)?e:e.reduce((t,r)=>t.concat(r instanceof re?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Ix(n,e,t,r,s,i,o){let l=n.slice();for(let c=0,u=i;c<t.maps.length;c++){let d=0;t.maps[c].forEach((f,h,p,g)=>{let m=g-p-(h-f);for(let y=0;y<l.length;y+=3){let b=l[y+1];if(b<0||f>b+u-d)continue;let x=l[y]+u-d;h>=x?l[y+1]=f<=x?-2:-1:f>=u&&m&&(l[y]+=m,l[y+1]+=m)}d+=m}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=t.map(n[c]+i),d=u-s;if(d<0||d>=r.content.size){a=!0;continue}let f=t.map(n[c+1]+i,-1),h=f-s,{index:p,offset:g}=r.content.findIndex(d),m=r.maybeChild(p);if(m&&g==d&&g+m.nodeSize==h){let y=l[c+2].mapInner(t,m,u+1,n[c]+i+1,o);y!=me?(l[c]=d,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Px(l,n,e,t,s,i,o),u=zs(c,r,0,o);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<l.length&&l[f]<h;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new re(e.sort(Wt),l)}function zf(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let s=n[r];t.push(new je(s.from+e,s.to+e,s.type))}return t}function Px(n,e,t,r,s,i,o){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,s,c);d?t.push(d):o.onRemove&&o.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<n.length;a+=3)n[a+1]==-1&&l(n[a+2],e[a]+i+1);return t}function Bf(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,s=null;for(let i=0,o;i<n.length;i++)(o=n[i])&&o.from>t&&o.to<r&&((s||(s=[])).push(o),n[i]=null);return s}function Ff(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function zs(n,e,t,r){let s=[],i=!1;e.forEach((l,a)=>{let c=Bf(n,l,a+t);if(c){i=!0;let u=zs(c,l,t+a+1,r);u!=me&&s.push(a,a+l.nodeSize,u)}});let o=zf(i?Ff(n):n,-t).sort(Wt);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||s.length?new re(o,s):me}function Wt(n,e){return n.from-e.from||n.to-e.to}function gl(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let s=t+1;s<e.length;s++){let i=e[s];if(i.from==r.from){i.to!=r.to&&(e==n&&(e=n.slice()),e[s]=i.copy(i.from,r.to),gc(e,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,i.from),gc(e,s,r.copy(i.from,r.to)));break}}}return e}function gc(n,e,t){for(;e<n.length&&Wt(t,n[e])>0;)e++;n.splice(e,0,t)}class J extends I{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return J.valid(r)?new J(r):I.near(r)}content(){return E.empty}eq(e){return e instanceof J&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new J(e.resolve(t.pos))}getBookmark(){return new yl(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Lx(e)||!$x(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let s=t.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&J.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)<l.childCount:e.index(o)>0){i=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=t;let a=e.doc.resolve(s);if(J.valid(a))return a}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!w.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*t),r=!1;continue e}break}i=o,s+=t;let l=e.doc.resolve(s);if(J.valid(l))return l}return null}}}J.prototype.visible=!1;J.findFrom=J.findGapCursorFrom;I.jsonID("gapcursor",J);class yl{constructor(e){this.pos=e}map(e){return new yl(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return J.valid(t)?new J(t):I.near(t)}}function jf(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function Lx(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||jf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function $x(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||jf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function zx(){return new W({props:{decorations:Hx,createSelectionBetween(n,e,t){return e.pos==t.pos&&J.valid(t)?new J(t):null},handleClick:Fx,handleKeyDown:Bx,handleDOMEvents:{beforeinput:jx}}})}const Bx=nd({ArrowLeft:jr("horiz",-1),ArrowRight:jr("horiz",1),ArrowUp:jr("vert",-1),ArrowDown:jr("vert",1)});function jr(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof N){if(!i.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=J.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new J(c))),!0):!1}}function Fx(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!J.valid(r))return!1;let s=n.posAtCoords({left:t.clientX,top:t.clientY});return s&&s.inside>-1&&w.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new J(r))),!0)}function jx(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof J))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let s=S.empty;for(let o=r.length-1;o>=0;o--)s=S.from(r[o].createAndFill(null,s));let i=n.state.tr.replace(t.pos,t.pos,new E(s,0,0));return i.setSelection(N.near(i.doc.resolve(t.pos+1))),n.dispatch(i),!1}function Hx(n){if(!(n.selection instanceof J))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",re.create(n.doc,[je.widget(n.selection.head,e,{key:"gapcursor"})])}var Bs=200,ie=function(){};ie.prototype.append=function(e){return e.length?(e=ie.from(e),!this.length&&e||e.length<Bs&&this.leafAppend(e)||this.length<Bs&&e.leafPrepend(this)||this.appendInner(e)):this};ie.prototype.prepend=function(e){return e.length?ie.from(e).append(this):this};ie.prototype.appendInner=function(e){return new Vx(this,e)};ie.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?ie.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};ie.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ie.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};ie.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},t,r),s};ie.from=function(e){return e instanceof ie?e:e&&e.length?new Hf(e):ie.empty};var Hf=(function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a<o;a++)if(s(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,l){for(var a=i-1;a>=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=Bs)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=Bs)return new e(s.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(ie);ie.empty=new Hf([]);var Vx=(function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,i,o){var l=this.left.length;if(s<l&&this.left.forEachInner(r,s,Math.min(i,l),o)===!1||i>l&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(s,l),i,o)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(ie);const Wx=500;class Re{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;t&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,u.push(d);return}if(s){u.push(new Fe(d.map));let h=d.step.map(s.slice(i)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new Fe(p,void 0,void 0,c.length+u.length))),i--,p&&s.appendMap(p,i)}else o.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(i)):d.selection,a=new Re(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Fe(e.mapping.maps[u],d,t),h;(h=a&&a.merge(f))&&(f=h,u?i.pop():l=l.slice(0,l.length-1)),i.push(f),t&&(o++,t=void 0),s||(a=f)}let c=o-r.depth;return c>_x&&(l=Kx(l,c),o-=c),new Re(l.append(i),o)}remapping(e,t){let r=new lr;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,t),r}addMaps(e){return this.eventCount==0?this:new Re(this.items.append(e.map(t=>new Fe(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},s);let a=t;this.items.forEach(f=>{let h=i.getMirror(--a);if(h==null)return;o=Math.min(o,h);let p=i.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),m=f.selection&&f.selection.map(i.slice(a+1,h));m&&l++,r.push(new Fe(p,g,m))}else r.push(new Fe(p))},s);let c=[];for(let f=t;f<o;f++)c.push(new Fe(i.maps[f]));let u=this.items.slice(0,s).append(c).append(r),d=new Re(u,l);return d.emptyItemCount()>Wx&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=o.selection&&o.selection.map(t.slice(r));u&&i++;let d=new Fe(c.invert(),a,u),f,h=s.length-1;(f=s.length&&s[h].merge(d))?s[h]=f:s.push(d)}}else o.map&&r--},this.items.length,0),new Re(ie.from(s.reverse()),i)}}Re.empty=new Re(ie.empty,0);function Kx(n,e){let t;return n.forEach((r,s)=>{if(r.selection&&e--==0)return t=s,!1}),n.slice(t)}class Fe{constructor(e,t,r,s){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Fe(t.getMap().invert(),t,this.selection)}}}class pt{constructor(e,t,r,s,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const _x=20;function Ux(n,e,t,r){let s=t.getMeta(Kt),i;if(s)return s.historyState;t.getMeta(Gx)&&(n=new pt(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(Kt))return o.getMeta(Kt).redo?new pt(n.done.addTransform(t,void 0,r,_r(e)),n.undone,yc(t.mapping.maps),n.prevTime,n.prevComposition):new pt(n.done,n.undone.addTransform(t,void 0,r,_r(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!qx(t,n.prevRanges)),c=o?Ni(n.prevRanges,t.mapping):yc(t.mapping.maps);return new pt(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,_r(e)),Re.empty,c,t.time,l??n.prevComposition)}else return(i=t.getMeta("rebased"))?new pt(n.done.rebased(t,i),n.undone.rebased(t,i),Ni(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new pt(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Ni(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function qx(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&s>=e[i]&&(t=!0)}),t}function yc(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,s,i,o)=>e.push(i,o));return e}function Ni(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let s=e.map(n[r],1),i=e.map(n[r+1],-1);s<=i&&t.push(s,i)}return t}function Jx(n,e,t){let r=_r(e),s=Kt.get(e).spec.config,i=(t?n.undone:n.done).popEvent(e,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),l=(t?n.done:n.undone).addTransform(i.transform,e.selection.getBookmark(),s,r),a=new pt(t?l:i.remaining,t?i.remaining:l,null,0,-1);return i.transform.setSelection(o).setMeta(Kt,{redo:t,historyState:a})}let Ai=!1,bc=null;function _r(n){let e=n.plugins;if(bc!=e){Ai=!1,bc=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ai=!0;break}}return Ai}const Kt=new te("history"),Gx=new te("closeHistory");function Yx(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new W({key:Kt,state:{init(){return new pt(Re.empty,Re.empty,null,0,-1)},apply(e,t,r){return Ux(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,s=r=="historyUndo"?Wf:r=="historyRedo"?Kf:null;return!s||!e.editable?!1:(t.preventDefault(),s(e.state,e.dispatch))}}}})}function Vf(n,e){return(t,r)=>{let s=Kt.getState(t);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(r){let i=Jx(s,t,n);i&&r(e?i.scrollIntoView():i)}return!0}}const Wf=Vf(!1,!0),Kf=Vf(!0,!0);Y.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new W({key:new te("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const l=o-s,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,l=o-(i-r),a=o;return e.deleteRange(l,a),!(this.storage.characters({node:e.doc})>r)}})]}});const Xx=Y.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Uk(this.options)]}});Y.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new W({key:new te("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!t||!r)return G.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(!a.isText){if(!(s>=c&&s<=c+a.nodeSize-1))return!1;o+=1}});let l=0;return n.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(st.node(c,c+a.nodeSize,{class:this.options.className}))}),G.create(n,i)}}})]}});const Qx=Y.create({name:"gapCursor",addProseMirrorPlugins(){return[zx()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=$(O(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),_f="placeholder",kc=new te("tiptap__placeholder");function Uf(n){const{editor:e,placeholder:t,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=n,u=[a];return o&&u.push(c),st.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof t=="function"?t({editor:e,node:i,pos:s,hasAnchor:l}):t})}function qf(n,e){return typeof n=="function"?n(e):n}function Jf({editor:n,options:e,dataAttribute:t,doc:r,selection:s,from:i,to:o}){const{anchor:l}=s,a=[],c=n.isEmpty;return r.nodesBetween(i,o,(u,d)=>{const f=l>=d&&l<=d+u.nodeSize,h=!u.isLeaf&&Cr(u);return u.type.isTextblock&&(f||!e.showOnlyCurrent)&&h&&a.push(Uf({editor:n,isEmptyDoc:c,dataAttribute:t,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:qf(e.emptyNodeClass,{editor:n,node:u,pos:d,hasAnchor:f})},node:u,pos:d})),e.includeChildren}),a}function Gf({editor:n,options:e,dataAttribute:t,doc:r,selection:s}){if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:i}=s,o=[],l=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const a=r.resolve(i),c=a.depth>0?a.node(1):a.nodeAfter,u=a.depth>0?a.before(1):i;if(c&&c.type.isTextblock&&Cr(c)){const d=i>=u&&i<=u+c.nodeSize;o.push(Uf({editor:n,isEmptyDoc:l,dataAttribute:t,hasAnchor:d,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:qf(e.emptyNodeClass,{editor:n,node:c,pos:u,hasAnchor:d})},node:c,pos:u}))}}else o.push(...Jf({editor:n,options:e,dataAttribute:t,doc:r,selection:s,from:0,to:r.content.size}));return G.create(r,o)}function Qn(n,e){const t=n.resolve(e);if(t.depth===0){var r;const i=(r=t.nodeAfter)!==null&&r!==void 0?r:t.nodeBefore;if(!i)return{from:e,to:e};const o=t.nodeAfter?e:e-i.nodeSize;return{from:o,to:o+i.nodeSize}}const s=t.before(1);return{from:s,to:s+t.node(1).nodeSize}}function Zn(n,e){return{from:Math.max(0,e.from-1),to:Math.min(n.content.size,e.to-1)}}function Zx(n,e,t){const r=[];return n.forEach((s,i)=>{const o=i,l=o+s.nodeSize,a=o+1,c=l+1;a<t&&c>e&&r.push({from:o,to:l})}),r}function eS(n){if(n.length===0)return[];const e=[...n].sort((r,s)=>r.from-s.from),t=[{...e[0]}];for(let r=1;r<e.length;r+=1){const s=t[t.length-1],i=e[r];i.from<=s.to?s.to=Math.max(s.to,i.to):t.push({...i})}return t}function tS(n,e){const t=Zx(n,e.from,e.to);return t.push(Zn(n,Qn(n,e.from))),e.to>e.from?t.push(Zn(n,Qn(n,Math.min(e.to,n.content.size+1)-1))):e.from<n.content.size+1&&t.push(Zn(n,Qn(n,Math.min(e.from+1,n.content.size)))),t}function nS(n,e,t){const r=[];if(n.docChanged){const s=Js(n);for(const i of s)r.push(...tS(t.doc,i.newRange))}return n.selectionSet&&(r.push(Zn(t.doc,Qn(t.doc,n.mapping.map(e.selection.anchor)))),r.push(Zn(t.doc,Qn(t.doc,t.selection.anchor)))),eS(r)}function rS(n,e,t){const r=Math.max(0,Math.min(n,t.content.size));return{from:r,to:Math.max(r,Math.min(e,t.content.size))}}function sS({decorations:n,ranges:e,editor:t,options:r,dataAttribute:s,doc:i,selection:o}){let l=n;for(const a of e){const{from:c,to:u}=rS(a.from,a.to,i),d=l.find(c,u).filter(h=>h.from>=c&&h.to<=u);d.length&&(l=l.remove(d));const f=Jf({editor:t,options:r,dataAttribute:s,doc:i,selection:o,from:c,to:u});f.length&&(l=l.add(i,f))}return l}function iS({editor:n,options:e,dataAttribute:t}){return{init(r,s){const i=Gf({editor:n,options:e,dataAttribute:t,doc:s.doc,selection:s.selection});return i??G.empty},apply(r,s,i,o){return!r.docChanged&&!r.selectionSet?s:sS({decorations:s.map(r.mapping,r.doc),ranges:nS(r,i,o),editor:n,options:e,dataAttribute:t,doc:o.doc,selection:o.selection})}}}function oS(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function lS({editor:n,options:e}){const t=e.dataAttribute?`data-${oS(e.dataAttribute)}`:`data-${_f}`,r=e.showOnlyCurrent&&!e.includeChildren;return new W({key:kc,...r?{}:{state:iS({editor:n,options:e,dataAttribute:t})},props:{decorations:r?({doc:s,selection:i})=>Gf({editor:n,options:e,dataAttribute:t,doc:s,selection:i}):s=>{var i;return e.showOnlyWhenEditable&&!n.isEditable?G.empty:(i=kc.getState(s))!==null&&i!==void 0?i:G.empty}}})}const JS=Y.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:_f,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[lS({editor:this.editor,options:this.options})]}});function bo(n,e){return!n.selection.empty&&!kd(n.selection)&&e.isEditable}function aS(n,e){return bo(n,e)&&!e.isFocused&&!e.view.dragging}function cS(){var n;(n=window.getSelection())===null||n===void 0||n.removeAllRanges()}function uS(n){n.focus()}Y.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new W({key:new te("selection"),props:{decorations(t){return aS(t,n)?G.create(t.doc,[st.inline(t.selection.from,t.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(t){return bo(t.state,n)&&cS(),!1},focus(t){return bo(t.state,n)&&requestAnimationFrame(()=>{!n.isDestroyed&&t.hasFocus()&&uS(t)}),!1}}}})]}});function xc({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}const dS=Y.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new te(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)===null||n===void 0?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(t).includes(s.name));return[new W({key:e,appendTransaction:(s,i,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),d=l.content.size,f=c.nodes[t];if(!s.some(h=>h.getMeta("skipTrailingNode"))&&u)return a.insert(d,f.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!xc({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!xc({node:o,types:r})}}})]}}),fS=Y.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Wf(n,e),redo:()=>({state:n,dispatch:e})=>Kf(n,e)}},addProseMirrorPlugins(){return[Yx(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),hS=Y.create({name:"starterKit",addExtensions(){const n=[];if(this.options.bold!==!1&&n.push(mb.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(ub.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(sf.configure(this.options.bulletList)),this.options.code!==!1&&n.push(bb.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(Sb.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(Cb.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(Xx.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(Qx.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(Mb.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(Tb.configure(this.options.heading)),this.options.undoRedo!==!1&&n.push(fS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&n.push(Eb.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(Ob.configure(this.options.italic)),this.options.listItem!==!1&&n.push(uf.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;n.push(ff.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var t;n.push(rf.configure((t=this.options)===null||t===void 0?void 0:t.link))}if(this.options.orderedList!==!1&&n.push(pf.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push(jk.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(Wk.configure(this.options.strike)),this.options.text!==!1&&n.push(Kk.configure(this.options.text)),this.options.underline!==!1){var r;n.push(_k.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var s;n.push(dS.configure((s=this.options)===null||s===void 0?void 0:s.trailingNode))}return n}});var GS=hS;function pS(n,e){const t={};for(const r of n?.arguments??[])t[r.name]=r.required?Sl().min(1,e):Sl();return th(t)}function mS(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function YS(n){const e=Yt.c(74),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:i}=n,o=V.useId(),l=So();let a,c;if(e[0]!==t||e[1]!==l){const le=pS(t,l("chat.dialogPromptArguments.required"));c=nh,a=Zf(le),e[0]=t,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==i||e[5]!==t?(u=t?mS(t,i):{},e[4]=i,e[5]=t,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==t?.arguments?(h=t?.arguments??[],e[10]=t?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==s||e[14]!==r?(g=async le=>{await s(le),r(null),f.reset()},e[12]=f,e[13]=s,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=le=>{le||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!t)return null;let x;e[19]!==t._meta||e[20]!==t.name||e[21]!==t.title?(x=t.title||dh(t.name,fh(t._meta)),e[19]=t._meta,e[20]=t.name,e[21]=t.title,e[22]=x):x=e[22];let C;e[23]!==x?(C=k.jsx(rh,{children:k.jsx("span",{className:"capitalize",children:x})}),e[23]=x,e[24]=C):C=e[24];let T;e[25]!==t.description?(T=t.description&&k.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[25]=t.description,e[26]=T):T=e[26];let A;e[27]!==T||e[28]!==C?(A=k.jsxs(sh,{children:[C,T]}),e[27]=T,e[28]=C,e[29]=A):A=e[29];let v;e[30]!==f||e[31]!==m?(v=le=>{le.stopPropagation(),f.handleSubmit(m)(le)},e[30]=f,e[31]=m,e[32]=v):v=e[32];let D;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let le;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(le=$e=>k.jsx(ph,{control:f.control,name:$e.name,render:wn=>{const{field:Ke}=wn;return k.jsxs(mh,{children:[k.jsxs(gh,{className:"text-xs",children:[$e.name,$e.required?null:k.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),k.jsx(yh,{children:k.jsx(ih,{...Ke,value:Ke.value??"",required:$e.required,placeholder:$e.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),k.jsx(bh,{})]})}},$e.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=le):le=e[41],D=p.map(le),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=D}else D=e[37];let R;e[42]!==b?(R=()=>b(!1),e[42]=b,e[43]=R):R=e[43];const j=f.formState.isSubmitting;let K;e[44]!==l?(K=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=K):K=e[45];let U;e[46]!==f.formState.isSubmitting||e[47]!==R||e[48]!==K?(U=k.jsx(xl,{type:"button",variant:"ghost",onClick:R,disabled:j,children:K}),e[46]=f.formState.isSubmitting,e[47]=R,e[48]=K,e[49]=U):U=e[49];let L;e[50]!==f.formState.isSubmitting||e[51]!==l?(L=f.formState.isSubmitting?k.jsxs("span",{className:"flex items-center gap-2",children:[k.jsx(eh,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=L):L=e[52];let B;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==L?(B=k.jsx(xl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:L}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=L,e[56]=B):B=e[56];let z;e[57]!==U||e[58]!==B?(z=k.jsxs(oh,{children:[U,B]}),e[57]=U,e[58]=B,e[59]=z):z=e[59];let _;e[60]!==o||e[61]!==v||e[62]!==D||e[63]!==z?(_=k.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[D,z]}),e[60]=o,e[61]=v,e[62]=D,e[63]=z,e[64]=_):_=e[64];let Q;e[65]!==f||e[66]!==_?(Q=k.jsx(hh,{...f,children:_}),e[65]=f,e[66]=_,e[67]=Q):Q=e[67];let oe;e[68]!==A||e[69]!==Q?(oe=k.jsxs(lh,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[A,Q]}),e[68]=A,e[69]=Q,e[70]=oe):oe=e[70];let Ce;return e[71]!==b||e[72]!==oe?(Ce=k.jsx(ah,{open:!0,onOpenChange:b,children:oe}),e[71]=b,e[72]=oe,e[73]=Ce):Ce=e[73],Ce}function gS(n){if(typeof n!="object"||n===null)return null;const{volume:e,path:t}=n;return typeof e!="string"||e===""||typeof t!="string"||t===""?null:`${e}/${t}/SKILL.md`}function yS(n){return n.storage.mention}function XS(n,e,t){n.chain().focus().insertContentAt(e,[bS(t),{type:"text",text:" "}]).run()}function bS(n){return{type:"mention",attrs:n}}function QS(n,e,t){const r=n.state.doc.nodeAt(e);return r?.type.name==="mention"&&r.attrs.id===t}function kS(n){const e=Yt.c(43),{node:t,selected:r,view:s,editor:i,getPos:o}=n,{name:l,char:a,kind:c,id:u,args:d,metadata:f}=t.attrs,h=So(),p=V.useContext(kh),g=r&&s.editable,m=c==="task",y=a==="@",b=s.editable&&a==="/"&&(c==="prompt"||c===void 0);let x;e[0]!==c||e[1]!==f?(x=c==="skill"?gS(f):null,e[0]=c,e[1]=f,e[2]=x):x=e[2];const C=x,T=!!p&&!!C,A=b||T;let v;e[3]!==d||e[4]!==i||e[5]!==o||e[6]!==u||e[7]!==l?(v=()=>{const bl=yS(i)?.onEditChip;if(!bl||typeof o!="function")return;const kl=o();typeof kl=="number"&&bl({promptId:u,promptName:l,args:d??{},pos:kl})},e[3]=d,e[4]=i,e[5]=o,e[6]=u,e[7]=l,e[8]=v):v=e[8];const D=v;let R;e[9]!==p||e[10]!==T||e[11]!==C||e[12]!==D?(R=()=>{if(T&&C){p.open(C);return}D()},e[9]=p,e[10]=T,e[11]=C,e[12]=D,e[13]=R):R=e[13];const j=R;let K;e[14]!==j||e[15]!==A?(K=lt=>{A&&(lt.preventDefault(),lt.stopPropagation(),j())},e[14]=j,e[15]=A,e[16]=K):K=e[16];const U=K;let L;e[17]!==j||e[18]!==A?(L=lt=>{A&&(lt.key!=="Enter"&<.key!==" "||(lt.preventDefault(),lt.stopPropagation(),j()))},e[17]=j,e[18]=A,e[19]=L):L=e[19];const B=L,z=A?"button":void 0,_=A?0:void 0;let Q;e[20]!==A||e[21]!==l||e[22]!==T||e[23]!==h?(Q=A?h(T?"chat.mention.openSkill":"chat.mention.editPrompt",{name:l?Cl(l):""}):void 0,e[20]=A,e[21]=l,e[22]=T,e[23]=h,e[24]=Q):Q=e[24];const oe=A?"cursor-pointer":"cursor-default",Ce=y?"bg-brand-purple-tint text-brand-purple-dark dark:bg-brand-purple/20 dark:text-brand-purple":"bg-brand-yellow-tint text-brand-yellow-dark dark:bg-brand-yellow/20 dark:text-brand-yellow",le=g&&"outline-2 outline-ring outline-offset-0",$e=A&&"hover:brightness-95",wn=!m&&"capitalize";let Ke;e[25]!==le||e[26]!==$e||e[27]!==wn||e[28]!==oe||e[29]!==Ce?(Ke=er("px-1 py-1 rounded","inline-flex items-center gap-1",oe,"select-none","text-xs font-light",Ce,le,$e,wn),e[25]=le,e[26]=$e,e[27]=wn,e[28]=oe,e[29]=Ce,e[30]=Ke):Ke=e[30];let tn;e[31]!==m||e[32]!==l?(tn=m?k.jsx("span",{className:"inline-block max-w-[220px] truncate align-bottom",children:l??""}):l?Cl(l):"",e[31]=m,e[32]=l,e[33]=tn):tn=e[33];let wr;return e[34]!==a||e[35]!==U||e[36]!==B||e[37]!==Ke||e[38]!==tn||e[39]!==z||e[40]!==_||e[41]!==Q?(wr=k.jsxs(zd,{onClick:U,onKeyDown:B,role:z,tabIndex:_,"aria-label":Q,className:Ke,children:[a,tn]}),e[34]=a,e[35]=U,e[36]=B,e[37]=Ke,e[38]=tn,e[39]=z,e[40]=_,e[41]=Q,e[42]=wr):wr=e[42],wr}const ZS=be.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id")||null,renderHTML:n=>n.id?{"data-id":n.id}:{}},name:{default:null,parseHTML:n=>n.getAttribute("data-name")||null,renderHTML:n=>n.name?{"data-name":n.name}:{}},char:{default:"/",parseHTML:n=>n.getAttribute("data-char")||"/",renderHTML:n=>n.char?{"data-char":n.char}:{}},metadata:{default:null,parseHTML:n=>{try{return JSON.parse(n.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:n=>n.metadata?{"data-metadata":JSON.stringify(n.metadata)}:{}},kind:{default:void 0,parseHTML:n=>n.getAttribute("data-kind")||void 0,renderHTML:n=>n.kind?{"data-kind":n.kind}:{}},args:{default:null,parseHTML:n=>{try{return JSON.parse(n.getAttribute("data-args")||"null")}catch{return null}},renderHTML:n=>n.args?{"data-args":JSON.stringify(n.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({HTMLAttributes:n}){return["span",ee(n,{"data-type":"mention"})]},renderText({node:n}){const e=n.attrs.char??"@",t=n.attrs.name??"";return`${e}${t}`},addNodeView(){return Bd(kS)}});function eC(n){if(n.type!=="tool-suggest_task")return!1;if(n.state==="input-available")return!0;const e=n.output;return n.state==="output-available"&&typeof e?.accepted!="boolean"}function tC(n){const e=Yt.c(19),{id:t,part:r,copyable:s,extraActions:i,alwaysShowActions:o,animate:l}=n,a=s===void 0?!1:s,c=o===void 0?!1:o,u=l===void 0?!1:l,{handleCopy:d}=Sh(),f=So(),[h,p]=V.useState(!1);let g;e[0]!==d||e[1]!==t||e[2]!==r.text?(g=async()=>{uh("chat_message_copied",{message_id:t,chars:r.text.length}),await d(r.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=d,e[1]=t,e[2]=r.text,e[3]=g):g=e[3];const m=g,y=a&&i,b=y||i;let x;e[4]!==u||e[5]!==t||e[6]!==r.text?(x=k.jsx(xh,{id:t,text:r.text,animate:u}),e[4]=u,e[5]=t,e[6]=r.text,e[7]=x):x=e[7];let C;e[8]!==c||e[9]!==i||e[10]!==m||e[11]!==h||e[12]!==b||e[13]!==y||e[14]!==f?(C=b&&k.jsxs("div",{className:er("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",c?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[i,y&&i&&k.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),y&&k.jsx("button",{type:"button",onClick:m,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":f("chat.textPart.copyMessage"),children:h?k.jsx(ch,{className:"size-4"}):k.jsx(Ch,{className:"size-4"})})]}),e[8]=c,e[9]=i,e[10]=m,e[11]=h,e[12]=b,e[13]=y,e[14]=f,e[15]=C):C=e[15];let T;return e[16]!==x||e[17]!==C?(T=k.jsxs("div",{className:"group/part relative",children:[x,C]}),e[16]=x,e[17]=C,e[18]=T):T=e[18],T}function nC(n,e,t){n.chain().focus().insertContentAt(e,[xS(t),{type:"text",text:" "}]).run()}function xS(n){return{type:"file",attrs:n}}function SS(n){return(n??"").startsWith("image/")}function CS(n){const e=Yt.c(17),{node:t,selected:r,view:s}=n,{name:i,mimeType:o,data:l}=t.attrs,a=r&&s.editable;let c;e[0]!==o?(c=SS(o),e[0]=o,e[1]=c):c=e[1];const u=c,d=a&&"outline-2 outline-ring outline-offset-0";let f;e[2]!==d?(f=er("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",d),e[2]=d,e[3]=f):f=e[3];let h;e[4]!==i?(h=k.jsx(tr,{asChild:!0,children:k.jsx("span",{children:i})}),e[4]=i,e[5]=h):h=e[5];let p;e[6]!==l||e[7]!==u||e[8]!==o||e[9]!==i?(p=k.jsx(nr,{side:"top",className:"max-w-sm p-1.5",children:u?k.jsx("img",{src:`data:${o};base64,${l}`,alt:i,className:"max-w-full max-h-64 object-contain rounded"}):k.jsxs("div",{className:"text-xs",children:[k.jsx("div",{className:"font-medium",children:i}),k.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=l,e[7]=u,e[8]=o,e[9]=i,e[10]=p):p=e[10];let g;e[11]!==h||e[12]!==p?(g=k.jsxs(rr,{children:[h,p]}),e[11]=h,e[12]=p,e[13]=g):g=e[13];let m;return e[14]!==f||e[15]!==g?(m=k.jsx(zd,{className:f,children:g}),e[14]=f,e[15]=g,e[16]=m):m=e[16],m}const rC=be.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id")||null,renderHTML:n=>n.id?{"data-id":n.id}:{}},name:{default:null,parseHTML:n=>n.getAttribute("data-name")||null,renderHTML:n=>n.name?{"data-name":n.name}:{}},mimeType:{default:null,parseHTML:n=>n.getAttribute("data-mime-type")||null,renderHTML:n=>n.mimeType?{"data-mime-type":n.mimeType}:{}},size:{default:0,parseHTML:n=>{const e=n.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:n=>n.size?{"data-size":String(n.size)}:{}},data:{default:null,parseHTML:n=>n.getAttribute("data-data")||null,renderHTML:n=>n.data?{"data-data":n.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:n,HTMLAttributes:e}){const t={"data-type":"file"};return n.attrs.id&&(t["data-id"]=n.attrs.id),n.attrs.name&&(t["data-name"]=n.attrs.name),n.attrs.mimeType&&(t["data-mime-type"]=n.attrs.mimeType),n.attrs.size&&(t["data-size"]=String(n.attrs.size)),n.attrs.data&&(t["data-data"]=n.attrs.data),["span",{...e,...t}]},renderText({node:n}){return`[${n.attrs.name??""}]`},addNodeView(){return Bd(CS)}}),At=16,ko=2.5,xo=(At-ko)/2,Oi=2*Math.PI*xo;function sC(n){const e=Yt.c(29),{usage:t}=n,r=Co();if(!t)return null;const{totalTokens:s,inputTokens:i,outputTokens:o}=t,l=r?t.cost:0;if(!s&&!i&&!o)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=k.jsx(Mh,{size:12}),e[0]=a):a=e[0];let c;e[1]!==l||e[2]!==s?(c=l>0?`$${l.toFixed(4)}`:s.toLocaleString(),e[1]=l,e[2]=s,e[3]=c):c=e[3];let u;e[4]!==c?(u=k.jsx(tr,{asChild:!0,children:k.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[a,k.jsx("span",{className:"text-sm font-mono tabular-nums",children:c})]})}),e[4]=c,e[5]=u):u=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=k.jsx("p",{className:"text-muted text-2xs mb-1",children:"tokens"}),e[6]=d):d=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=k.jsx("span",{className:"text-muted",children:"in"}),e[7]=f):f=e[7];let h;e[8]!==i?(h=i.toLocaleString(),e[8]=i,e[9]=h):h=e[9];let p;e[10]!==h?(p=k.jsx("span",{className:"text-right tabular-nums",children:h}),e[10]=h,e[11]=p):p=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=k.jsx("span",{className:"text-muted",children:"out"}),e[12]=g):g=e[12];const m=o-(t.reasoningTokens??0);let y;e[13]!==m?(y=m.toLocaleString(),e[13]=m,e[14]=y):y=e[14];let b;e[15]!==y?(b=k.jsx("span",{className:"text-right tabular-nums",children:y}),e[15]=y,e[16]=b):b=e[16];let x;e[17]!==t?(x=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"cache hit"}),k.jsx("span",{className:"text-right tabular-nums",children:`${(Mo(t)*100).toFixed(0)}%`})]}),e[17]=t,e[18]=x):x=e[18];let C;e[19]!==l?(C=l>0&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"cost"}),k.jsxs("span",{className:"text-right tabular-nums",children:["$",l.toFixed(4)]})]}),e[19]=l,e[20]=C):C=e[20];let T;e[21]!==b||e[22]!==x||e[23]!==C||e[24]!==p?(T=k.jsxs(nr,{side:"top",className:"font-mono text-2xs",children:[d,k.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[f,p,g,b,x,C]})]}),e[21]=b,e[22]=x,e[23]=C,e[24]=p,e[25]=T):T=e[25];let A;return e[26]!==T||e[27]!==u?(A=k.jsxs(rr,{children:[u,T]}),e[26]=T,e[27]=u,e[28]=A):A=e[28],A}function iC(n){const e=Yt.c(19),{usage:t,duration:r}=n,s=Co(),i=r!=null&&r>0,o=s&&t!=null&&(t.cost??0)>0,l=t!=null&&(t.totalTokens??0)>0;if(!i&&!o&&!l)return null;let a;e[0]!==r||e[1]!==i?(a=i?Ml(r/1e3):null,e[0]=r,e[1]=i,e[2]=a):a=e[2];const c=a;let u;e[3]!==r||e[4]!==c||e[5]!==t?(u=c&&k.jsxs(rr,{children:[k.jsx(tr,{asChild:!0,children:k.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:c})}),k.jsxs(nr,{side:"top",className:"font-mono text-2xs",children:[k.jsx("p",{className:"opacity-60 text-2xs mb-1",children:"thinking"}),k.jsx("span",{className:"tabular-nums",children:Ml(r/1e3)}),(t?.reasoningTokens??0)>0&&k.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=r,e[4]=c,e[5]=t,e[6]=u):u=e[6];let d;e[7]!==o||e[8]!==i||e[9]!==l?(d=i&&(o||l)&&k.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=o,e[8]=i,e[9]=l,e[10]=d):d=e[10];let f;e[11]!==o||e[12]!==l||e[13]!==t?(f=(o||l)&&k.jsxs(rr,{children:[k.jsx(tr,{asChild:!0,children:k.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:o?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),k.jsxs(nr,{side:"top",className:"font-mono text-2xs",children:[k.jsx("p",{className:"opacity-60 text-2xs mb-1",children:"tokens"}),k.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[k.jsx("span",{className:"opacity-60",children:"in"}),k.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),k.jsx("span",{className:"opacity-60",children:"out"}),k.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"opacity-60",children:"think"}),k.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"opacity-60",children:"cache hit"}),k.jsx("span",{className:"text-right tabular-nums",children:`${(Mo(t)*100).toFixed(0)}%`})]})]})]})]}),e[11]=o,e[12]=l,e[13]=t,e[14]=f):f=e[14];let h;return e[15]!==u||e[16]!==d||e[17]!==f?(h=k.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[u,d,f]}),e[15]=u,e[16]=d,e[17]=f,e[18]=h):h=e[18],h}function oC(n){const e=Yt.c(52),{usage:t,totalTokens:r,contextWindow:s,onOpenContextPanel:i}=n,o=Co(),l=Math.min(r/s*100,100),a=Oi-l/100*Oi,c=o?t?.cost??0:0,u=(t?.cost??0)>0,d=t?.inputTokens??0,f=t?.outputTokens??0;let h;e[0]!==l?(h=l.toFixed(0),e[0]=l,e[1]=h):h=e[1];let p;e[2]!==c?(p=c>0?`, $${c.toFixed(2)}`:"",e[2]=c,e[3]=p):p=e[3];const g=`Context usage: ${h}%${p}`,m=i?"cursor-pointer":"cursor-default";let y;e[4]!==m?(y=er("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",m),e[4]=m,e[5]=y):y=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=k.jsx("circle",{cx:At/2,cy:At/2,r:xo,fill:"none",stroke:"currentColor",strokeWidth:ko,className:"opacity-15"}),e[6]=b):b=e[6];const x=l>90?"text-destructive":l>70?"text-warning":"text-muted-foreground";let C;e[7]!==x?(C=er(x),e[7]=x,e[8]=C):C=e[8];let T;e[9]!==a||e[10]!==C?(T=k.jsxs("svg",{width:At,height:At,className:"-rotate-90","aria-hidden":"true",children:[b,k.jsx("circle",{cx:At/2,cy:At/2,r:xo,fill:"none",stroke:"currentColor",strokeWidth:ko,strokeDasharray:Oi,strokeDashoffset:a,strokeLinecap:"round",className:C})]}),e[9]=a,e[10]=C,e[11]=T):T=e[11];let A;e[12]!==l?(A=l.toFixed(0),e[12]=l,e[13]=A):A=e[13];let v;e[14]!==c?(v=c>0?` · $${c.toFixed(2)}`:"",e[14]=c,e[15]=v):v=e[15];let D;e[16]!==A||e[17]!==v?(D=k.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-2xs font-mono tabular-nums",children:[A,"%",v]}),e[16]=A,e[17]=v,e[18]=D):D=e[18];let R;e[19]!==i||e[20]!==D||e[21]!==g||e[22]!==y||e[23]!==T?(R=k.jsx(tr,{asChild:!0,children:k.jsxs("button",{type:"button",onClick:i,"aria-label":g,className:y,children:[T,D]})}),e[19]=i,e[20]=D,e[21]=g,e[22]=y,e[23]=T,e[24]=R):R=e[24];let j;e[25]===Symbol.for("react.memo_cache_sentinel")?(j=k.jsx("span",{className:"text-muted",children:"context"}),e[25]=j):j=e[25];let K;e[26]!==r?(K=r.toLocaleString(),e[26]=r,e[27]=K):K=e[27];let U;e[28]!==s?(U=s.toLocaleString(),e[28]=s,e[29]=U):U=e[29];let L;e[30]!==l?(L=l.toFixed(1),e[30]=l,e[31]=L):L=e[31];let B;e[32]!==K||e[33]!==U||e[34]!==L?(B=k.jsxs("span",{className:"text-right tabular-nums",children:[K," / ",U," (",L,"%)"]}),e[32]=K,e[33]=U,e[34]=L,e[35]=B):B=e[35];let z;e[36]!==c?(z=c>0&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"cost"}),k.jsxs("span",{className:"text-right tabular-nums",children:["$",c.toFixed(4)]})]}),e[36]=c,e[37]=z):z=e[37];let _;e[38]!==u||e[39]!==d||e[40]!==f?(_=u&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"in"}),k.jsx("span",{className:"text-right tabular-nums",children:d.toLocaleString()}),k.jsx("span",{className:"text-muted",children:"out"}),k.jsx("span",{className:"text-right tabular-nums",children:f.toLocaleString()})]}),e[38]=u,e[39]=d,e[40]=f,e[41]=_):_=e[41];let Q;e[42]!==t?(Q=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted",children:"cache hit"}),k.jsx("span",{className:"text-right tabular-nums",children:`${(Mo(t)*100).toFixed(0)}%`})]}),e[42]=t,e[43]=Q):Q=e[43];let oe;e[44]!==B||e[45]!==z||e[46]!==_||e[47]!==Q?(oe=k.jsx(nr,{side:"top",className:"font-mono text-2xs",children:k.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[j,B,z,_,Q]})}),e[44]=B,e[45]=z,e[46]=_,e[47]=Q,e[48]=oe):oe=e[48];let Ce;return e[49]!==R||e[50]!==oe?(Ce=k.jsxs(rr,{children:[R,oe]}),e[49]=R,e[50]=oe,e[51]=Ce):Ce=e[51],Ce}export{gp as $,Ko as A,$ as B,O as C,G as D,Y as E,rC as F,HS as G,WS as H,zS as I,Ny as J,VS as K,w0 as L,Xt as M,be as N,My as O,YS as P,zd as Q,Bd as R,oC as S,N as T,Z0 as U,KS as V,Mn as W,qS as X,Fk as Y,Bk as Z,nd as _,G1 as a,S as a0,E as a1,re as a2,je as a3,w as a4,eu as a5,BS as a6,Wo as a7,Ay as a8,yd as a9,U1 as b,bS as c,tC as d,US as e,XS as f,jS as g,sC as h,eC as i,ZS as j,iC as k,nC as l,ee as m,te as n,W as o,yS as p,QS as q,Go as r,GS as s,JS as t,_S as u,st as v,FS as w,I as x,d0 as y,Kn as z};
|