decocms 4.615.0 → 4.616.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/AlertCircle-B79T3vQg.js +1 -0
- package/dist/client/assets/AreaChart-1DjcfWAa.js +1 -0
- package/dist/client/assets/ArrowLeft-CFDBmtQn.js +1 -0
- package/dist/client/assets/ArrowRight-_1mjBk8q.js +1 -0
- package/dist/client/assets/ArrowUp-CGwCu8lq.js +1 -0
- package/dist/client/assets/BookOpen01-Cja5K-Zg.js +1 -0
- package/dist/client/assets/CartesianChart-DbfxDEk8.js +1 -0
- package/dist/client/assets/CategoricalChart-aQS_hxQA.js +33 -0
- package/dist/client/assets/CheckCircle-BdP9IvPO.js +1 -0
- package/dist/client/assets/ChevronDown-NJEKYVpP.js +1 -0
- package/dist/client/assets/ChevronSelectorVertical-QA_eM8SF.js +1 -0
- package/dist/client/assets/ChevronUp-CdlwQKca.js +1 -0
- package/dist/client/assets/CreditCard01-u7S1Papb.js +1 -0
- package/dist/client/assets/Eye-_AXqkWO1.js +1 -0
- package/dist/client/assets/File02-C4vk1-0W.js +1 -0
- package/dist/client/assets/Fingerprint04-bmDV_Zt8.js +1 -0
- package/dist/client/assets/Globe04-BXEQpgH7.js +1 -0
- package/dist/client/assets/Image01-DLy5un7V.js +1 -0
- package/dist/client/assets/Key01-CX9koaUb.js +1 -0
- package/dist/client/assets/LayoutLeft-Cc8HE6Mh.js +1 -0
- package/dist/client/assets/LinkBroken01-Be5szqzO.js +1 -0
- package/dist/client/assets/MessageCircle01-CWoIju4P.js +1 -0
- package/dist/client/assets/Minus-DJIrYTlh.js +1 -0
- package/dist/client/assets/Monitor01-DO2zUSLy.js +1 -0
- package/dist/client/assets/Play-Upgk6Vwe.js +1 -0
- package/dist/client/assets/Plus-C6PPIhQG.js +1 -0
- package/dist/client/assets/ReferenceLine-DHROouFX.js +1 -0
- package/dist/client/assets/SearchMd-ByGW18TK.js +1 -0
- package/dist/client/assets/ShoppingBag01-CoDrN_Bf.js +1 -0
- package/dist/client/assets/Sun-CFnDb3Gg.js +1 -0
- package/dist/client/assets/SwitchHorizontal01-DdMiH6v0.js +1 -0
- package/dist/client/assets/Tool01-C5U5GfFn.js +1 -0
- package/dist/client/assets/Tooltip-DMrOgBeB.js +1 -0
- package/dist/client/assets/Trash01-D3BXHl0z.js +1 -0
- package/dist/client/assets/Upload01-CmSjLpWk.js +1 -0
- package/dist/client/assets/UserCheck01-DkrJoTgc.js +1 -0
- package/dist/client/assets/UserSquare-CzDpovKf.js +1 -0
- package/dist/client/assets/Users01-CsPiPLgE.js +1 -0
- package/dist/client/assets/XClose-VFawdZTC.js +1 -0
- package/dist/client/assets/Zap-Dg95CWCj.js +1 -0
- package/dist/client/assets/access-gate-DEhQZEHK.js +1 -0
- package/dist/client/assets/add-connection-dialog-CY-1hoag.js +1 -0
- package/dist/client/assets/agent-app-CS5E8TvR.js +1 -0
- package/dist/client/assets/agent-assets-BvO33f5b.js +1 -0
- package/dist/client/assets/agent-automation-CNHhtRSa.js +20 -0
- package/dist/client/assets/agent-automations-8X1ZfMQ4.js +1 -0
- package/dist/client/assets/agent-blog-B-qgjc0R.js +2 -0
- package/dist/client/assets/agent-blog-post-ihtWC77H.js +2 -0
- package/dist/client/assets/agent-business-case-BqRjG0NY.js +1 -0
- package/dist/client/assets/agent-calendar-Bggq_CeJ.js +1 -0
- package/dist/client/assets/agent-capabilities-CHyVSIfo.js +1 -0
- package/dist/client/assets/agent-connect-sources-6QJ7xuGT.js +1 -0
- package/dist/client/assets/agent-deck-DDkow9Jj.js +1 -0
- package/dist/client/assets/agent-e2e-BFv54RnX.js +1 -0
- package/dist/client/assets/agent-experiments-CquSa1RS.js +1 -0
- package/dist/client/assets/agent-file-BxJTMm5y.js +1 -0
- package/dist/client/assets/agent-hosting-DdRCvd0_.js +1 -0
- package/dist/client/assets/agent-icon-mHnKN98z.js +1 -0
- package/dist/client/assets/agent-library-file-BEu5nmWb.js +1 -0
- package/dist/client/assets/agent-library-t6Vm-IxI.js +1 -0
- package/dist/client/assets/agent-overview-GOOAoGpS.js +1 -0
- package/dist/client/assets/agent-releases-DUkasnwf.js +3 -0
- package/dist/client/assets/agent-settings-IVdSvBTa.js +1 -0
- package/dist/client/assets/agent-site-editor-BtLnQekr.js +16 -0
- package/dist/client/assets/agent-site-editor-code-SuEMtdpK.js +2 -0
- package/dist/client/assets/agent-site-editor-content-Dm31bcya.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Dxo8gMEH.js +1 -0
- package/dist/client/assets/agent-view-DhGmpIyd.js +1 -0
- package/dist/client/assets/agent-view-guard-ddWX7YUu.js +1 -0
- package/dist/client/assets/ai-providers-CftklSU0.js +1 -0
- package/dist/client/assets/alert-ZlCw8k67.js +1 -0
- package/dist/client/assets/analytics-sections-qmiNeFYX.js +1 -0
- package/dist/client/assets/api-keys-BXYphvnv.js +1 -0
- package/dist/client/assets/api-keys-BlILgoSx.js +1 -0
- package/dist/client/assets/app-editor-BmpLgmI9.js +1 -0
- package/dist/client/assets/asset-utils-CpZNl06_.js +1 -0
- package/dist/client/assets/auth-Dj5MlzXt.js +1 -0
- package/dist/client/assets/auth-catchall-D_wyvME9.js +1 -0
- package/dist/client/assets/auth-entry-CT9zrr5H.js +1 -0
- package/dist/client/assets/auth-split-layout-BYLGv9rB.js +1 -0
- package/dist/client/assets/authenticate-and-persist-oauth-CgoDUSs7.js +1 -0
- package/dist/client/assets/automation-list-row-BIiiA8x6.js +1 -0
- package/dist/client/assets/automation-runs-C1aNVdBb.js +1 -0
- package/dist/client/assets/automations-DiBZRi3C.js +1 -0
- package/dist/client/assets/badge-D43CW9ql.js +1 -0
- package/dist/client/assets/block-document-DLzckaqO.js +3 -0
- package/dist/client/assets/blocks-preview-workspace-context-C1Xh6Ud9.js +1 -0
- package/dist/client/assets/blocks-tab-states-Dt0sIut6.js +1 -0
- package/dist/client/assets/blog-preview-url-BmfGCEca.js +1 -0
- package/dist/client/assets/blog-schema-DTkkJRmS.js +1 -0
- package/dist/client/assets/blog-source-gate-obpk25AX.js +1 -0
- package/dist/client/assets/blog-view-gate-BeBRgyJz.js +1 -0
- package/dist/client/assets/buckets-DqLM3qT3.js +1 -0
- package/dist/client/assets/build-improve-prompt-doc-BMIlWXqc.js +2 -0
- package/dist/client/assets/calendar-BVJiHXRt.js +1 -0
- package/dist/client/assets/capability-load-error-D-3178zq.js +1 -0
- package/dist/client/assets/category-editor-CJYnKN4F.js +1 -0
- package/dist/client/assets/category-tree-By1yHef5.js +18 -0
- package/dist/client/assets/chart-B0-vTmRF.js +13 -0
- package/dist/client/assets/chat-context-DElPd_KV.js +43 -0
- package/dist/client/assets/chat-draft-DYeAZXwC.js +1 -0
- package/dist/client/assets/checkbox-EN58bnRW.js +1 -0
- package/dist/client/assets/choose-editor-B6TNwHW_.js +1 -0
- package/dist/client/assets/cli-auth-success-DOsGD2k0.js +1 -0
- package/dist/client/assets/cms-settings-editor-Dnr_wfon.js +1 -0
- package/dist/client/assets/cms-store-drafts-DqlEEelF.js +1 -0
- package/dist/client/assets/collapsible-SwapIfxI.js +1 -0
- package/dist/client/assets/collection-detail-DDKzScDr.js +1 -0
- package/dist/client/assets/collection-display-button-BrJc-eHB.js +1 -0
- package/dist/client/assets/collection-search-DrcBBUCd.js +1 -0
- package/dist/client/assets/collection-table-wrapper-Cr2x7lMQ.js +1 -0
- package/dist/client/assets/collection-tabs-DNPK2rVO.js +1 -0
- package/dist/client/assets/combobox-BwdUn3zV.js +1 -0
- package/dist/client/assets/command-SY2ZnRo9.js +1 -0
- package/dist/client/assets/companion-mcps-section-Z9bmavQ2.js +1 -0
- package/dist/client/assets/config-BSLjSLLm.js +1 -0
- package/dist/client/assets/connect-dNubHVjE.js +9 -0
- package/dist/client/assets/connect-key-DPTpHhHK.js +1 -0
- package/dist/client/assets/connect-layout-DhYyXJ_a.js +1 -0
- package/dist/client/assets/connect-source-dialog-aKk77DlM.js +1 -0
- package/dist/client/assets/connection-INGF_Tys.js +1 -0
- package/dist/client/assets/connection-card-Da6QMOrb.js +1 -0
- package/dist/client/assets/connection-detail-iamd96u6.js +1 -0
- package/dist/client/assets/connection-form-helpers-DP9s_gSg.js +1 -0
- package/dist/client/assets/connection-slug-BUzOiIKa.js +1 -0
- package/dist/client/assets/connections-CxDpre2g.js +1 -0
- package/dist/client/assets/content-changes-RUsWfEyU.js +1 -0
- package/dist/client/assets/content-tab-BHPLt3xh.js +19 -0
- package/dist/client/assets/context-8uRKn5a5.js +1 -0
- package/dist/client/assets/context-menu-D_l3ejD0.js +1 -0
- package/dist/client/assets/context-shell-BDr9r5_c.js +37 -0
- package/dist/client/assets/create-organization-dialog-SvXxbH0G.js +1 -0
- package/dist/client/assets/daily-pulse-OhSSo082.js +1 -0
- package/dist/client/assets/delete-copy-BI6H_-VN.js +4 -0
- package/dist/client/assets/device-hint-D0KKa1HI.js +1 -0
- package/dist/client/assets/discover-hFnfS6fz.js +1 -0
- package/dist/client/assets/domain-settings-DE07O2_X.js +1 -0
- package/dist/client/assets/drawer-Cc5GoGE_.js +1 -0
- package/dist/client/assets/editor-CuwMJTkv.js +11 -0
- package/dist/client/assets/editor-classes-nwzo85k0.js +1 -0
- package/dist/client/assets/empty-state-BOACqe8n.js +1 -0
- package/dist/client/assets/empty-state-OmCxeENw.js +1 -0
- package/dist/client/assets/experiments-tab-choice-Bqizq6-B.js +1 -0
- package/dist/client/assets/extract-connection-data-u4OYVXGw.js +1 -0
- package/dist/client/assets/feature-gate-DmGuW1HX.js +1 -0
- package/dist/client/assets/feature-paywall-C9J82eQO.js +1 -0
- package/dist/client/assets/file-explorer-B1FCcYRv.js +2 -0
- package/dist/client/assets/file-preview-CCN1XfzT.js +1 -0
- package/dist/client/assets/file-share-button-DRrjFIUZ.js +3 -0
- package/dist/client/assets/file-type-icon-Ch8YrFS_.js +1 -0
- package/dist/client/assets/folder-icon-DcGaEdrE.js +1 -0
- package/dist/client/assets/form-CJYtyj_a.js +1 -0
- package/dist/client/assets/frame-navigation-E7yKrUfa.js +1 -0
- package/dist/client/assets/gateway-client-BgktQVnM.js +1 -0
- package/dist/client/assets/general-Cz3Mlr1e.js +1 -0
- package/dist/client/assets/github-icon-r0MgwWDh.js +1 -0
- package/dist/client/assets/held-block-view-Di7yDwAi.js +3 -0
- package/dist/client/assets/home-BTdnZuGt.js +1 -0
- package/dist/client/assets/home-overview--FC1AzlV.js +1 -0
- package/dist/client/assets/hosted-reconcile-CSjK-swv.js +1 -0
- package/dist/client/assets/icon-button-DDIgoNaN.js +1 -0
- package/dist/client/assets/index-51kU6OFU.js +1 -0
- package/dist/client/assets/index-BN4Io9gE.js +4 -0
- package/dist/client/assets/index-BmiiXn5j.js +1 -0
- package/dist/client/assets/index-BxXZTFf-.js +26 -0
- package/dist/client/assets/index-C4lDOrVl.js +1 -0
- package/dist/client/assets/index-CC54wkAD.js +1 -0
- package/dist/client/assets/index-CLK91j5E.js +1 -0
- package/dist/client/assets/index-D1W7ut2I.js +269 -0
- package/dist/client/assets/index-DDMNdM21.js +1 -0
- package/dist/client/assets/index-DH9TD1uL.js +4 -0
- package/dist/client/assets/index-DXzlWhjJ.js +1 -0
- package/dist/client/assets/index-DgGQR13e.js +69 -0
- package/dist/client/assets/index-H8x29Tys.js +15 -0
- package/dist/client/assets/index-HG0Hn-tb.js +5 -0
- package/dist/client/assets/index-ICy5uJS1.js +1 -0
- package/dist/client/assets/index-KDBjhzA9.js +1 -0
- package/dist/client/assets/index-Yw-FAojM.js +1 -0
- package/dist/client/assets/index-redirect-CCAMfHj_.js +1 -0
- package/dist/client/assets/infiniteQueryObserver-DOpE6BBu.js +1 -0
- package/dist/client/assets/infra-billing-CXB12KfP.js +1 -0
- package/dist/client/assets/input-BpwrytAl.js +1 -0
- package/dist/client/assets/input-DoVas9av.js +17 -0
- package/dist/client/assets/integration-icon-DXN-XJCR.js +1 -0
- package/dist/client/assets/item-actions-CkyvC2L-.js +1 -0
- package/dist/client/assets/jira-icon-DYRW4UM7.js +1 -0
- package/dist/client/assets/label-CJFBh9Hz.js +1 -0
- package/dist/client/assets/layout-E6Mx6Nvv.js +1 -0
- package/dist/client/assets/legacy-admin-welcome-dialog-BdcU4w3n.js +1 -0
- package/dist/client/assets/legacy-agents-deep-RrLkFDTz.js +1 -0
- package/dist/client/assets/legacy-main-redirect-jo5L4iyk.js +1 -0
- package/dist/client/assets/library-Rf-tFgTl.js +1 -0
- package/dist/client/assets/library-tab-hHLKC6vr.js +162 -0
- package/dist/client/assets/login-DOIEj3kL.js +1 -0
- package/dist/client/assets/markdown-Cs_VFIOo.js +93 -0
- package/dist/client/assets/mcp-app-renderer-DXnjbkH-.js +11 -0
- package/dist/client/assets/mcp-oauth-DqtV9nxi.js +1 -0
- package/dist/client/assets/mcp-oauth-m9Nn_Cby.js +1 -0
- package/dist/client/assets/members-C1d4xgmU.js +1 -0
- package/dist/client/assets/memory-DZqrn_HB.js +7 -0
- package/dist/client/assets/mock-board-DlNminaI.js +10 -0
- package/dist/client/assets/monaco-editor-BUZ150q-.js +9 -0
- package/dist/client/assets/monitoring-sYMmBqE5.js +2 -0
- package/dist/client/assets/monitoring-stats-row-BhJSpOTB.js +1 -0
- package/dist/client/assets/multi-select-Bh8RuVPt.js +1 -0
- package/dist/client/assets/mustache-DDfkx3Qd.js +4 -0
- package/dist/client/assets/named-rule-step-DipCSV0p.js +1 -0
- package/dist/client/assets/named-rule-view-_NZ7qOsC.js +1 -0
- package/dist/client/assets/new-project-dialog-CRE_OifY.js +1 -0
- package/dist/client/assets/new-project-store-C_CW1RtD.js +1 -0
- package/dist/client/assets/oauth-callback-ai-provider-CXQ3H8DV.js +1 -0
- package/dist/client/assets/oauth-callback-bS0CM5qz.js +1 -0
- package/dist/client/assets/oauth-consent-DXEafLdq.js +1 -0
- package/dist/client/assets/onboarding-CagamfPF.js +1 -0
- package/dist/client/assets/openai-conversation-BiojiiW5.js +3 -0
- package/dist/client/assets/optimistic-project-sidebar-views-1-DUBv8z.js +1 -0
- package/dist/client/assets/order-monitor-day-BOwSvE0N.js +1 -0
- package/dist/client/assets/organization-choice-DtvjAEPE.js +1 -0
- package/dist/client/assets/orgs-DztNhQ1I.js +1 -0
- package/dist/client/assets/own-accounts-section-wjvAAFf5.js +1 -0
- package/dist/client/assets/pair-DxgOEXG6.js +48 -0
- package/dist/client/assets/parse-sections-5x1kD0Ku.js +4 -0
- package/dist/client/assets/plan-DnP7NDfJ.js +1 -0
- package/dist/client/assets/plan-ladder-CzWQv3Fw.js +1 -0
- package/dist/client/assets/plan-page-D5xGomuu.js +6 -0
- package/dist/client/assets/plan-page-VVoBqnO4.css +1 -0
- package/dist/client/assets/plan-usage-card-BHY2xgyw.js +6 -0
- package/dist/client/assets/popover-DbSdZVd4.js +1 -0
- package/dist/client/assets/post-calendar-Br_sRpTk.js +1 -0
- package/dist/client/assets/post-editor-hYFyaI7Z.js +2 -0
- package/dist/client/assets/preview-content-C_sHEYDI.js +1 -0
- package/dist/client/assets/preview-dialog-BueRO4-u.js +1 -0
- package/dist/client/assets/preview-panel-D70i4kYa.js +1 -0
- package/dist/client/assets/preview-tab-CR27meIw.js +557 -0
- package/dist/client/assets/primitives-C_DAyRMT.js +1 -0
- package/dist/client/assets/product-picker-dialog-Cwx6BuL6.js +1 -0
- package/dist/client/assets/profile-DkquqcCP.js +1 -0
- package/dist/client/assets/project-app-view-5rTPzvKu.js +1 -0
- package/dist/client/assets/project-apps-DevR_6vG.js +1 -0
- package/dist/client/assets/project-icon-BD1ByOdc.js +1 -0
- package/dist/client/assets/project-index-BnS4CpAf.js +1 -0
- package/dist/client/assets/project-reports-BurjoLQc.js +1 -0
- package/dist/client/assets/project-tasks-nlwCObOo.js +1 -0
- package/dist/client/assets/projects-empty-state-D08dJvBE.js +1 -0
- package/dist/client/assets/projects-vpomg-Z6.js +1 -0
- package/dist/client/assets/prompts-jqUHmJ_e.js +1 -0
- package/dist/client/assets/record-editor-DFvIgTaA.js +1 -0
- package/dist/client/assets/redirect-editor-Cieib2_p.js +1 -0
- package/dist/client/assets/reports-BQEZzmQr.js +3 -0
- package/dist/client/assets/reports-DrKbPCdl.js +1 -0
- package/dist/client/assets/reports-onboarding-DOs_4gka.js +1 -0
- package/dist/client/assets/reports-tab-Bajtbz_h.js +2 -0
- package/dist/client/assets/repositories-BWyOhQYL.js +1 -0
- package/dist/client/assets/repositories-CBIonCcP.js +1 -0
- package/dist/client/assets/repository-binding-CGFnGVxJ.js +1 -0
- package/dist/client/assets/repository-picker-BPjktPxl.js +1 -0
- package/dist/client/assets/require-capability-CQ3NJym_.js +1 -0
- package/dist/client/assets/required-auth-layout-DmEyED-o.js +1 -0
- package/dist/client/assets/reset-password-Cp_nLiLi.js +1 -0
- package/dist/client/assets/resizable-zRzPDJM0.js +1 -0
- package/dist/client/assets/resolve-tab-icon-XrYn5LuK.js +1 -0
- package/dist/client/assets/review-settings-DHSAoP1k.js +1 -0
- package/dist/client/assets/role-color-DVzABbHa.js +1 -0
- package/dist/client/assets/roles-B7pKl-QS.js +1 -0
- package/dist/client/assets/route-BChDSB4_.js +1 -0
- package/dist/client/assets/route-nMFReO1B.js +1 -0
- package/dist/client/assets/route-oRV_9YzF.js +1 -0
- package/dist/client/assets/route-page-header-DXblwPS1.js +1 -0
- package/dist/client/assets/sandbox-git-api-z3lgxnDh.js +1 -0
- package/dist/client/assets/sandbox-lifecycle-context-DXG6Bomw.js +1 -0
- package/dist/client/assets/save-status-zH9sfFJK.js +1 -0
- package/dist/client/assets/schema-B0fnhJuA.js +1 -0
- package/dist/client/assets/schema-C-iQKwVz.js +1 -0
- package/dist/client/assets/scroll-area-Dm0jhVU4.js +1 -0
- package/dist/client/assets/search-input-DPbHiMJC.js +1 -0
- package/dist/client/assets/search-toggle-BTwJc97H.js +1 -0
- package/dist/client/assets/secret-picker-B6OGx2mQ.js +1 -0
- package/dist/client/assets/secrets-Cf1UmVo2.js +1 -0
- package/dist/client/assets/section-array-field-Dfaksxcj.js +1 -0
- package/dist/client/assets/sections-UpitVoFq.js +1 -0
- package/dist/client/assets/sections-editor-DOTx2SrX.js +1 -0
- package/dist/client/assets/select-Us30SuzI.js +1 -0
- package/dist/client/assets/select-model-DvuOFAKE.js +1 -0
- package/dist/client/assets/seo-editor-D_wkdMi9.js +1 -0
- package/dist/client/assets/separator-Bdq1NG6k.js +1 -0
- package/dist/client/assets/session-runtime-BIDE-rQF.js +1 -0
- package/dist/client/assets/settings-tab-DHHNeg02.js +1 -0
- package/dist/client/assets/sheet-D8HVkLc6.js +1 -0
- package/dist/client/assets/shell-layout-CCvUDm4c.js +1 -0
- package/dist/client/assets/site-draft-actions-BLjlvxVb.js +7 -0
- package/dist/client/assets/site-draft-view-B6y_crr2.js +1 -0
- package/dist/client/assets/site-editor-BVtedbL2.js +1 -0
- package/dist/client/assets/site-editor-toast-B6psqL4S.js +1 -0
- package/dist/client/assets/skills-gf32nwAO.js +1 -0
- package/dist/client/assets/slider-oJh009BK.js +1 -0
- package/dist/client/assets/sortable.esm-DhKgeEID.js +1 -0
- package/dist/client/assets/sso-CRyh0I61.js +1 -0
- package/dist/client/assets/suggestion-HxkFbXWu.js +2 -0
- package/dist/client/assets/super-agent-icon-DhNy1L1t.js +1 -0
- package/dist/client/assets/switch-C8bVi-NX.js +1 -0
- package/dist/client/assets/synced-repos-M8yw1Jwe.js +1 -0
- package/dist/client/assets/tab-icon-glyph-BJdR1rTv.js +1 -0
- package/dist/client/assets/table-BOhYBEKO.js +1 -0
- package/dist/client/assets/tabs-Bfy1intI.js +1 -0
- package/dist/client/assets/task-board-CgO9M3z4.js +1 -0
- package/dist/client/assets/task-key-B2-Ue6HC.js +5 -0
- package/dist/client/assets/task-route-Ba3aez9x.js +1 -0
- package/dist/client/assets/task-status-CdYrOhRh.js +1 -0
- package/dist/client/assets/taskboard-analytics-loV9TaFT.js +1 -0
- package/dist/client/assets/tasks-Brq4Pp7A.js +4 -0
- package/dist/client/assets/tasks-Z7BLYet6.js +1 -0
- package/dist/client/assets/textarea-D93s_9gX.js +1 -0
- package/dist/client/assets/thread-analytics-BxXXEL8G.js +1 -0
- package/dist/client/assets/thread-button-DQmfTj65.js +1 -0
- package/dist/client/assets/thread-intent-CJjEXtuE.js +15 -0
- package/dist/client/assets/thread-route-Cpqj5B6r.js +1 -0
- package/dist/client/assets/thread-route-khw3rYS4.js +1 -0
- package/dist/client/assets/thread-sheet-body-DE8XX1TP.js +1 -0
- package/dist/client/assets/time-range-picker-w3lHNK8L.js +1 -0
- package/dist/client/assets/toggle-group-DpYPg3qc.js +1 -0
- package/dist/client/assets/tool-set-selector-CRZL7bC5.js +1 -0
- package/dist/client/assets/toolbar-icon-button-6BTsLHAb.js +1 -0
- package/dist/client/assets/tooltip-BZz0vywC.js +1 -0
- package/dist/client/assets/tooltipContext-CZ3OeUnD.js +1 -0
- package/dist/client/assets/track-CR6tDDcQ.js +1 -0
- package/dist/client/assets/types-C3qQbU3-.js +77 -0
- package/dist/client/assets/url-slug-DTf0xW9o.js +1 -0
- package/dist/client/assets/usage-stats-CLMr8vHI.js +141 -0
- package/dist/client/assets/use-ai-providers-COZOIITa.js +1 -0
- package/dist/client/assets/use-api-keys-B2DhKv5O.js +1 -0
- package/dist/client/assets/use-apply-named-rule-D22hDqIn.js +1 -0
- package/dist/client/assets/use-ask-in-chat-i9g8xTsQ.js +1 -0
- package/dist/client/assets/use-automations-y62q9wiV.js +1 -0
- package/dist/client/assets/use-autosave-D8b9idjo.js +1 -0
- package/dist/client/assets/use-blocks-v8-project-BzS0SD5J.js +1 -0
- package/dist/client/assets/use-blog-view-Bj96i8iq.js +1 -0
- package/dist/client/assets/use-chat-layout-state-CRsWJAkm.js +1 -0
- package/dist/client/assets/use-cms-publish-actions-Bws1dcKi.js +10 -0
- package/dist/client/assets/use-connect-companion-Cd1kyM3y.js +1 -0
- package/dist/client/assets/use-connection-vpR-lNEV.js +1 -0
- package/dist/client/assets/use-content-sync-SowupOFR.js +1 -0
- package/dist/client/assets/use-copy-9vSDNA2-.js +1 -0
- package/dist/client/assets/use-current-view-e2srGh0R.js +1 -0
- package/dist/client/assets/use-date-fns-locale-DVuctzWR.js +1 -0
- package/dist/client/assets/use-debounced-autosave-C31axPZ5.js +1 -0
- package/dist/client/assets/use-debounced-value-Cw8HgnQu.js +1 -0
- package/dist/client/assets/use-deco-credits-DPzf77AT.js +1 -0
- package/dist/client/assets/use-decopilot-events-Dp7emgSR.js +1 -0
- package/dist/client/assets/use-delete-block-Crpx8FjE.js +1 -0
- package/dist/client/assets/use-delete-connection-BQ9YqO-c.js +1 -0
- package/dist/client/assets/use-deployment-admin-By_xF0wv.js +1 -0
- package/dist/client/assets/use-entitlements-Bi51m-s-.js +1 -0
- package/dist/client/assets/use-fast-preview-draft-url-CRmeng0Q.js +1 -0
- package/dist/client/assets/use-file-configs-GoxRHe-r.js +1 -0
- package/dist/client/assets/use-id-selection-BQh1Bg7W.js +1 -0
- package/dist/client/assets/use-in-settings-CU_P2dfR.js +1 -0
- package/dist/client/assets/use-inbox-feed-bSGgas59.js +1 -0
- package/dist/client/assets/use-infinite-scroll-DfV_gkqU.js +1 -0
- package/dist/client/assets/use-join-requests-DI3-5eWl.js +1 -0
- package/dist/client/assets/use-main-panel-tabs-DTbCL9St.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-C7HNLPrb.js +1 -0
- package/dist/client/assets/use-mcp-client-C_qG7wUZ.js +10 -0
- package/dist/client/assets/use-mcp-prompts-BVogmm65.js +1 -0
- package/dist/client/assets/use-mcp-tools-C6UyNv6N.js +1 -0
- package/dist/client/assets/use-mobile-BA8hUvQw.js +1 -0
- package/dist/client/assets/use-move-blocks-BuTBuPq7.js +1 -0
- package/dist/client/assets/use-navigate-to-agent-BlGlq6Si.js +1 -0
- package/dist/client/assets/use-never-published-iwVh38ki.js +1 -0
- package/dist/client/assets/use-org-fs-CvKheX_E.js +1 -0
- package/dist/client/assets/use-org-notice-5uXj9qdB.js +1 -0
- package/dist/client/assets/use-org-repo-syncs-De9jW4li.js +1 -0
- package/dist/client/assets/use-org-sso-aEsmoftk.js +1 -0
- package/dist/client/assets/use-organization-settings-DzL3Na4t.js +1 -0
- package/dist/client/assets/use-panel-navigate-RwlB8yz2.js +1 -0
- package/dist/client/assets/use-project-native-view-presence-LtOEv_bc.js +1 -0
- package/dist/client/assets/use-project-scope-CayH-uv6.js +1 -0
- package/dist/client/assets/use-recent-apps-DruGOBJK.js +1 -0
- package/dist/client/assets/use-reports-diagnostic-DmG6vfW3.js +1 -0
- package/dist/client/assets/use-sandbox-events-BC-9Qeez.js +2 -0
- package/dist/client/assets/use-secrets-Bx8YDUF-.js +1 -0
- package/dist/client/assets/use-section-preview-base-23Zb6ABj.js +1 -0
- package/dist/client/assets/use-sidebar-collapsed-BWfZDELa.js +1 -0
- package/dist/client/assets/use-tags-DQn-ihwP.js +1 -0
- package/dist/client/assets/use-task-board-analytics-4KchvJP_.js +1 -0
- package/dist/client/assets/use-task-board-item-prs-bjSiDC9b.js +1 -0
- package/dist/client/assets/use-task-board-items-BUgzBLKd.js +1 -0
- package/dist/client/assets/use-task-board-prompts-CScMHEY4.js +1 -0
- package/dist/client/assets/use-task-metadata-ml12mmZb.js +1 -0
- package/dist/client/assets/use-thread-outputs-DKNz-3Hm.js +1 -0
- package/dist/client/assets/use-view-draft-kind-6ZToH2lU.js +1 -0
- package/dist/client/assets/use-voice-input-FNIQ7Gtg.js +1 -0
- package/dist/client/assets/useInfiniteQuery-B7H5rw7X.js +1 -0
- package/dist/client/assets/useQueries-b1U_PciZ.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BAeDGxcg.js +1 -0
- package/dist/client/assets/users-CjER3r5S.js +1 -0
- package/dist/client/assets/utils-DxxrR_sy.js +4 -0
- package/dist/client/assets/variant-calendar-DYmrGYCj.js +1 -0
- package/dist/client/assets/variant-matcher-override-ksW5aMSA.js +1 -0
- package/dist/client/assets/view-header-COMgGMz-.js +1 -0
- package/dist/client/assets/virtual-mcp-DXFiFNeR.js +1 -0
- package/dist/client/assets/watch-sse-pool-DZnjbZdQ.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AlertCircle-CPPDtf_G.js +0 -1
- package/dist/client/assets/AreaChart-Dkcr6Ftt.js +0 -1
- package/dist/client/assets/ArrowLeft-ZIb4BJCm.js +0 -1
- package/dist/client/assets/ArrowRight-BsAaKjFT.js +0 -1
- package/dist/client/assets/ArrowUp-BoxEPcLL.js +0 -1
- package/dist/client/assets/BookOpen01-78ULfEqE.js +0 -1
- package/dist/client/assets/CartesianChart-B-fd6Fk8.js +0 -1
- package/dist/client/assets/CategoricalChart-CnnGbvL7.js +0 -33
- package/dist/client/assets/CheckCircle-CVnvVW7Z.js +0 -1
- package/dist/client/assets/ChevronDown-RjEjI_Fw.js +0 -1
- package/dist/client/assets/ChevronSelectorVertical-7aPbD1o7.js +0 -1
- package/dist/client/assets/ChevronUp-CURkkqOF.js +0 -1
- package/dist/client/assets/CreditCard01-GATZFsTY.js +0 -1
- package/dist/client/assets/Eye-cFax1ViC.js +0 -1
- package/dist/client/assets/File02-DmkZoy1E.js +0 -1
- package/dist/client/assets/Fingerprint04-vSO6N8um.js +0 -1
- package/dist/client/assets/Globe04-vBUbsG60.js +0 -1
- package/dist/client/assets/Image01-DStfZJB_.js +0 -1
- package/dist/client/assets/Key01-y01giijo.js +0 -1
- package/dist/client/assets/LayoutLeft-CZKqhqEw.js +0 -1
- package/dist/client/assets/LinkBroken01-U9ZcT-zb.js +0 -1
- package/dist/client/assets/MessageCircle01--u6B2ia8.js +0 -1
- package/dist/client/assets/Minus-DHz7ac9c.js +0 -1
- package/dist/client/assets/Monitor01-C7pwRef-.js +0 -1
- package/dist/client/assets/Play-pLUsrMym.js +0 -1
- package/dist/client/assets/Plus-0DN1Gnym.js +0 -1
- package/dist/client/assets/ReferenceLine-BlTdVghK.js +0 -1
- package/dist/client/assets/SearchMd-C6VhNKOv.js +0 -1
- package/dist/client/assets/ShoppingBag01-CbchDZQi.js +0 -1
- package/dist/client/assets/Sun-DbofJzo4.js +0 -1
- package/dist/client/assets/SwitchHorizontal01-BAD2JhOt.js +0 -1
- package/dist/client/assets/Tool01-BdB8BwwT.js +0 -1
- package/dist/client/assets/Tooltip-Id4JAR3f.js +0 -1
- package/dist/client/assets/Trash01-NEyFqlJC.js +0 -1
- package/dist/client/assets/Upload01-C2rAxNVk.js +0 -1
- package/dist/client/assets/UserCheck01-BA8i8gC-.js +0 -1
- package/dist/client/assets/UserSquare-BaVg281r.js +0 -1
- package/dist/client/assets/Users01-BIkXah4l.js +0 -1
- package/dist/client/assets/XClose-iDf6pWg-.js +0 -1
- package/dist/client/assets/Zap-BpbRWoEH.js +0 -1
- package/dist/client/assets/access-gate-5veGiSzF.js +0 -1
- package/dist/client/assets/add-connection-dialog-DMeOprq_.js +0 -1
- package/dist/client/assets/agent-app-qzh1Hl85.js +0 -1
- package/dist/client/assets/agent-assets-CXVTtm4J.js +0 -1
- package/dist/client/assets/agent-automation-BEZim52z.js +0 -20
- package/dist/client/assets/agent-automations-CahCismn.js +0 -1
- package/dist/client/assets/agent-blog-CC_XIhKE.js +0 -2
- package/dist/client/assets/agent-blog-post-C8I-Hicz.js +0 -2
- package/dist/client/assets/agent-business-case-y-uV4Kyx.js +0 -1
- package/dist/client/assets/agent-calendar-Ctum7n_E.js +0 -1
- package/dist/client/assets/agent-capabilities-CpG4q0Pf.js +0 -1
- package/dist/client/assets/agent-connect-sources-Clthw5-G.js +0 -1
- package/dist/client/assets/agent-deck-6GPZI5QZ.js +0 -1
- package/dist/client/assets/agent-e2e-CQ_H6Fq7.js +0 -1
- package/dist/client/assets/agent-experiments-_2pzJ6cS.js +0 -1
- package/dist/client/assets/agent-file-BPFzlCJH.js +0 -1
- package/dist/client/assets/agent-hosting-Cy-sCPhu.js +0 -1
- package/dist/client/assets/agent-icon-D3UAaAZc.js +0 -1
- package/dist/client/assets/agent-library-file-j7oG5YDf.js +0 -1
- package/dist/client/assets/agent-library-wR2k8m7Q.js +0 -1
- package/dist/client/assets/agent-overview-CyaSWwtC.js +0 -1
- package/dist/client/assets/agent-releases-D84lxNgT.js +0 -3
- package/dist/client/assets/agent-settings-02Ni_v2K.js +0 -1
- package/dist/client/assets/agent-site-editor-CGqx_u24.js +0 -16
- package/dist/client/assets/agent-site-editor-code-DQ_Ggog5.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BhStcDJ1.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-yRFKSlrL.js +0 -1
- package/dist/client/assets/agent-view-CBERTgtH.js +0 -1
- package/dist/client/assets/agent-view-guard-9v17Il03.js +0 -1
- package/dist/client/assets/ai-providers-DtShZCgE.js +0 -1
- package/dist/client/assets/alert-CCDrTeTF.js +0 -1
- package/dist/client/assets/analytics-sections-D3yb1REC.js +0 -1
- package/dist/client/assets/api-keys-CXCuS8XD.js +0 -1
- package/dist/client/assets/api-keys-D-9REx73.js +0 -1
- package/dist/client/assets/app-editor-BfTUK0FY.js +0 -1
- package/dist/client/assets/asset-utils-DveTp3fk.js +0 -1
- package/dist/client/assets/auth-BHQvXV6z.js +0 -1
- package/dist/client/assets/auth-catchall-BwSyGIcr.js +0 -1
- package/dist/client/assets/auth-entry-CqfzQnQV.js +0 -1
- package/dist/client/assets/auth-split-layout-CcKVOfmi.js +0 -1
- package/dist/client/assets/authenticate-and-persist-oauth-B5FenfH3.js +0 -1
- package/dist/client/assets/automation-list-row-D9CdIAYT.js +0 -1
- package/dist/client/assets/automation-runs-tEb3bk5t.js +0 -1
- package/dist/client/assets/automations-DzwS76rk.js +0 -1
- package/dist/client/assets/badge-2VSZSqFz.js +0 -1
- package/dist/client/assets/block-document-CNqV7IHC.js +0 -3
- package/dist/client/assets/blocks-preview-workspace-context-CJx_G7R9.js +0 -1
- package/dist/client/assets/blocks-tab-states-CSRiinzU.js +0 -1
- package/dist/client/assets/blog-preview-url-C9bLd-j-.js +0 -1
- package/dist/client/assets/blog-schema-DZh6qRQ-.js +0 -1
- package/dist/client/assets/blog-source-gate-TpjbGpYy.js +0 -1
- package/dist/client/assets/blog-view-gate-Cbz_7CwN.js +0 -1
- package/dist/client/assets/buckets-D3mhEN26.js +0 -1
- package/dist/client/assets/build-improve-prompt-doc-p8F6Ljg-.js +0 -2
- package/dist/client/assets/calendar-CmntaSKL.js +0 -1
- package/dist/client/assets/capability-load-error-C1CKTtM9.js +0 -1
- package/dist/client/assets/category-editor--3tQxxmU.js +0 -1
- package/dist/client/assets/category-tree-C3wmJ2qi.js +0 -18
- package/dist/client/assets/chart-JZPDSuE-.js +0 -13
- package/dist/client/assets/chat-context-CHs_vLHR.js +0 -43
- package/dist/client/assets/chat-draft-CVYZc_WM.js +0 -1
- package/dist/client/assets/checkbox-FR9M7tqI.js +0 -1
- package/dist/client/assets/choose-editor-PidrqFf2.js +0 -1
- package/dist/client/assets/cli-auth-success-C5Fd8uL1.js +0 -1
- package/dist/client/assets/cms-settings-editor-dUUSsoLV.js +0 -1
- package/dist/client/assets/cms-store-drafts-DhSImFSN.js +0 -1
- package/dist/client/assets/collapsible-BWNTyNqn.js +0 -1
- package/dist/client/assets/collection-detail-CVt8KxGt.js +0 -1
- package/dist/client/assets/collection-display-button-DVWBaPxr.js +0 -1
- package/dist/client/assets/collection-search-rqLgUJtO.js +0 -1
- package/dist/client/assets/collection-table-wrapper-Dz3xXXvY.js +0 -1
- package/dist/client/assets/collection-tabs-zjjydZl4.js +0 -1
- package/dist/client/assets/combobox-CJjUjqtl.js +0 -1
- package/dist/client/assets/command-DNUfYvKL.js +0 -1
- package/dist/client/assets/companion-mcps-section-Cv3fzW7U.js +0 -1
- package/dist/client/assets/config-CpoGhHX7.js +0 -1
- package/dist/client/assets/connect-aAvAz94A.js +0 -9
- package/dist/client/assets/connect-key-CIISkKXe.js +0 -1
- package/dist/client/assets/connect-layout-DE8QcPfU.js +0 -1
- package/dist/client/assets/connect-source-dialog-DyamthSp.js +0 -1
- package/dist/client/assets/connection-CmX2_bPO.js +0 -1
- package/dist/client/assets/connection-card-BTuntdg9.js +0 -1
- package/dist/client/assets/connection-detail-TQpSsczL.js +0 -1
- package/dist/client/assets/connection-form-helpers-DwTMfIAN.js +0 -1
- package/dist/client/assets/connection-slug-Dk0F6MJS.js +0 -1
- package/dist/client/assets/connections-DxGZdGF8.js +0 -1
- package/dist/client/assets/content-changes-DjU_gqMf.js +0 -1
- package/dist/client/assets/content-tab-D17C3NE0.js +0 -19
- package/dist/client/assets/context-B-2i9HUP.js +0 -1
- package/dist/client/assets/context-menu-am6Pi9ET.js +0 -1
- package/dist/client/assets/context-shell-StF1Ttft.js +0 -37
- package/dist/client/assets/create-organization-dialog-CXfsogY0.js +0 -1
- package/dist/client/assets/daily-pulse-DhP5AtmS.js +0 -1
- package/dist/client/assets/delete-copy-DPPlO7TG.js +0 -4
- package/dist/client/assets/device-hint-BRjNU4WX.js +0 -1
- package/dist/client/assets/discover-BPEF2lTO.js +0 -1
- package/dist/client/assets/domain-settings-BoJisjEE.js +0 -1
- package/dist/client/assets/drawer-DKvYuOCB.js +0 -1
- package/dist/client/assets/editor-KFWPYHnE.js +0 -11
- package/dist/client/assets/editor-classes-CmuNPnLv.js +0 -1
- package/dist/client/assets/empty-state-Dqeh8Fig.js +0 -1
- package/dist/client/assets/empty-state-lP1YMoK-.js +0 -1
- package/dist/client/assets/experiments-tab-choice-D-bckHiq.js +0 -1
- package/dist/client/assets/extract-connection-data-6U2u3XQX.js +0 -1
- package/dist/client/assets/feature-gate-BxOP-iGL.js +0 -1
- package/dist/client/assets/feature-paywall-DoaLWtAl.js +0 -1
- package/dist/client/assets/file-explorer-DPT4YX5c.js +0 -2
- package/dist/client/assets/file-preview-DY8-uL6t.js +0 -1
- package/dist/client/assets/file-share-button-BkBqemYn.js +0 -3
- package/dist/client/assets/file-type-icon-Br0I75Vm.js +0 -1
- package/dist/client/assets/folder-icon-CAklUdWP.js +0 -1
- package/dist/client/assets/form-BqnMqVx7.js +0 -1
- package/dist/client/assets/frame-navigation-BtRIg3ta.js +0 -1
- package/dist/client/assets/gateway-client-Dc__4TPf.js +0 -1
- package/dist/client/assets/general-WvOTqKGY.js +0 -1
- package/dist/client/assets/github-icon-DjMsQkke.js +0 -1
- package/dist/client/assets/held-block-view-C7jOBb2O.js +0 -3
- package/dist/client/assets/home-DkTQE7-f.js +0 -1
- package/dist/client/assets/home-overview-D4-EOFcQ.js +0 -1
- package/dist/client/assets/hosted-reconcile-CYTtk38V.js +0 -1
- package/dist/client/assets/icon-button-CWYyJxah.js +0 -1
- package/dist/client/assets/index-B5U9W1Mu.js +0 -1
- package/dist/client/assets/index-BGvKfTSb.js +0 -1
- package/dist/client/assets/index-BPTAax7s.js +0 -5
- package/dist/client/assets/index-BXRM9GB3.js +0 -26
- package/dist/client/assets/index-BhB8G2bF.js +0 -1
- package/dist/client/assets/index-Bj6_6zVx.js +0 -269
- package/dist/client/assets/index-CHuyyJXT.js +0 -15
- package/dist/client/assets/index-CIDUrB92.js +0 -1
- package/dist/client/assets/index-COpxpzy0.js +0 -1
- package/dist/client/assets/index-CeyzHwPJ.js +0 -69
- package/dist/client/assets/index-DA9uRCnv.js +0 -1
- package/dist/client/assets/index-DCFOJPbU.js +0 -1
- package/dist/client/assets/index-DS9t0RdF.js +0 -1
- package/dist/client/assets/index-Di_XG7be.js +0 -1
- package/dist/client/assets/index-TsmXmWpk.js +0 -4
- package/dist/client/assets/index-c0NsxqWi.js +0 -1
- package/dist/client/assets/index-l472wRT9.js +0 -4
- package/dist/client/assets/index-redirect-CpucC--Q.js +0 -1
- package/dist/client/assets/infiniteQueryObserver-DbNv63Q9.js +0 -1
- package/dist/client/assets/infra-billing-CANoMXCT.js +0 -1
- package/dist/client/assets/input-B1_XpDYL.js +0 -1
- package/dist/client/assets/input-CZtKpdoV.js +0 -17
- package/dist/client/assets/integration-icon-DCeVsTJy.js +0 -1
- package/dist/client/assets/item-actions-fZ37mrS2.js +0 -1
- package/dist/client/assets/jira-icon-BjmROWUI.js +0 -1
- package/dist/client/assets/label-B6vdSyOh.js +0 -1
- package/dist/client/assets/layout-B5o1uNUS.js +0 -1
- package/dist/client/assets/legacy-admin-welcome-dialog-CFp34ecC.js +0 -1
- package/dist/client/assets/legacy-agents-deep-BeXi4ceb.js +0 -1
- package/dist/client/assets/legacy-main-redirect-DJVQL75t.js +0 -1
- package/dist/client/assets/library-DnIbZN9I.js +0 -1
- package/dist/client/assets/library-tab-D_CctIvq.js +0 -162
- package/dist/client/assets/login-BUUrEN3F.js +0 -1
- package/dist/client/assets/markdown-CLYGcw1L.js +0 -93
- package/dist/client/assets/mcp-app-renderer-DRblOmIF.js +0 -11
- package/dist/client/assets/mcp-oauth-3XamI2Iv.js +0 -1
- package/dist/client/assets/mcp-oauth-CT2I7p8i.js +0 -1
- package/dist/client/assets/members-CRJOq7br.js +0 -1
- package/dist/client/assets/memory-ruV3CO98.js +0 -7
- package/dist/client/assets/mock-board-CHqKbIb1.js +0 -10
- package/dist/client/assets/monaco-editor-BF9cV2jc.js +0 -9
- package/dist/client/assets/monitoring-DnrpiN-u.js +0 -2
- package/dist/client/assets/monitoring-stats-row-BKwXRbbp.js +0 -1
- package/dist/client/assets/multi-select-YyQ_-FKB.js +0 -1
- package/dist/client/assets/mustache-Bt_DjIa-.js +0 -4
- package/dist/client/assets/named-rule-step-DUHG0ZfV.js +0 -1
- package/dist/client/assets/named-rule-view-BdyNA7vl.js +0 -1
- package/dist/client/assets/new-project-dialog-BdtpVZ1_.js +0 -1
- package/dist/client/assets/new-project-store-CmeGQvQy.js +0 -1
- package/dist/client/assets/oauth-callback-B-K5wR59.js +0 -1
- package/dist/client/assets/oauth-callback-ai-provider-DhAPGt17.js +0 -1
- package/dist/client/assets/oauth-consent-C_4XofGz.js +0 -1
- package/dist/client/assets/onboarding-CjguHlx_.js +0 -1
- package/dist/client/assets/openai-conversation-Dh_ls-fd.js +0 -3
- package/dist/client/assets/optimistic-project-sidebar-views-D8FI_8iU.js +0 -1
- package/dist/client/assets/order-monitor-day-By3OGqd-.js +0 -1
- package/dist/client/assets/organization-choice-BGm0DlVg.js +0 -1
- package/dist/client/assets/orgs-87Ou7TBh.js +0 -1
- package/dist/client/assets/own-accounts-section-CzNNrUJO.js +0 -1
- package/dist/client/assets/pair-DzC4ex5U.js +0 -48
- package/dist/client/assets/parse-sections-DXtY2KBF.js +0 -4
- package/dist/client/assets/plan-Bv-VSnLu.js +0 -1
- package/dist/client/assets/plan-ladder-D-MY2YGp.js +0 -1
- package/dist/client/assets/plan-page-DHGA2gWY.js +0 -6
- package/dist/client/assets/plan-page-JAVKjas9.css +0 -1
- package/dist/client/assets/plan-usage-card-BJkC9kyQ.js +0 -6
- package/dist/client/assets/popover-C5kO4vgi.js +0 -1
- package/dist/client/assets/post-calendar-vEXCNIK7.js +0 -1
- package/dist/client/assets/post-editor-DuExUo8H.js +0 -2
- package/dist/client/assets/preview-content-BWOCB4m8.js +0 -1
- package/dist/client/assets/preview-dialog-Im9ed1DF.js +0 -1
- package/dist/client/assets/preview-panel-D0PH0NbB.js +0 -1
- package/dist/client/assets/preview-tab-BHFyJXLm.js +0 -557
- package/dist/client/assets/primitives-BO5iYonj.js +0 -1
- package/dist/client/assets/product-picker-dialog-D_Z_odmx.js +0 -1
- package/dist/client/assets/profile-CTTUkWNX.js +0 -1
- package/dist/client/assets/project-app-view-CdgawHfj.js +0 -1
- package/dist/client/assets/project-apps-CszBh4SS.js +0 -1
- package/dist/client/assets/project-icon-BZME6-P4.js +0 -1
- package/dist/client/assets/project-index-DNirbL6N.js +0 -1
- package/dist/client/assets/project-reports-IrL-v43A.js +0 -1
- package/dist/client/assets/project-tasks-N7n1ETRd.js +0 -1
- package/dist/client/assets/projects-BGfl1Fnz.js +0 -1
- package/dist/client/assets/projects-empty-state-DypmC1Ec.js +0 -1
- package/dist/client/assets/prompts-oakJFq-p.js +0 -1
- package/dist/client/assets/record-editor-CwaRdDZ5.js +0 -1
- package/dist/client/assets/redirect-editor-DskbkPZE.js +0 -1
- package/dist/client/assets/reports-BOGH4hNh.js +0 -1
- package/dist/client/assets/reports-NN9tGbAJ.js +0 -3
- package/dist/client/assets/reports-onboarding-BF9d33ws.js +0 -1
- package/dist/client/assets/reports-tab-CVNcWdEe.js +0 -2
- package/dist/client/assets/repositories-BjRBMu_Y.js +0 -1
- package/dist/client/assets/repositories-EVLbsTZW.js +0 -1
- package/dist/client/assets/repository-binding-le0nIidi.js +0 -1
- package/dist/client/assets/repository-picker-DNgFAGYD.js +0 -1
- package/dist/client/assets/require-capability-P_3GadcL.js +0 -1
- package/dist/client/assets/required-auth-layout-IVU45FYN.js +0 -1
- package/dist/client/assets/reset-password-CgI6LobP.js +0 -1
- package/dist/client/assets/resizable-DhCMu9jm.js +0 -1
- package/dist/client/assets/resolve-tab-icon-Bdqcb8kc.js +0 -1
- package/dist/client/assets/review-settings-CuO-YwU9.js +0 -1
- package/dist/client/assets/role-color-x_ek03QW.js +0 -1
- package/dist/client/assets/roles-CD_nbYa3.js +0 -1
- package/dist/client/assets/route-B0XXJVhZ.js +0 -1
- package/dist/client/assets/route-BUmOv6N9.js +0 -1
- package/dist/client/assets/route-DUKe6oa-.js +0 -1
- package/dist/client/assets/route-page-header-9OZPwvWl.js +0 -1
- package/dist/client/assets/sandbox-git-api-DJL4bAUz.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-CysBGD5U.js +0 -1
- package/dist/client/assets/save-status-D_oRmIk-.js +0 -1
- package/dist/client/assets/schema-BZsFW0Lm.js +0 -1
- package/dist/client/assets/schema-D8CCdBQF.js +0 -1
- package/dist/client/assets/scroll-area-BIcQVMGl.js +0 -1
- package/dist/client/assets/search-input-aat0MNRR.js +0 -1
- package/dist/client/assets/search-toggle-DXtGCwYA.js +0 -1
- package/dist/client/assets/secret-picker-Coo_F9b2.js +0 -1
- package/dist/client/assets/secrets-EPOzgxHU.js +0 -1
- package/dist/client/assets/section-array-field-CeqUsN-m.js +0 -1
- package/dist/client/assets/sections-BgTZjDGM.js +0 -1
- package/dist/client/assets/sections-editor-DCM9M8a6.js +0 -1
- package/dist/client/assets/select-CiOYLgUG.js +0 -1
- package/dist/client/assets/select-model-CqZr8NuL.js +0 -1
- package/dist/client/assets/seo-editor-Cy4brsdL.js +0 -1
- package/dist/client/assets/separator-RsSI1g_t.js +0 -1
- package/dist/client/assets/session-runtime-4DzD9t26.js +0 -1
- package/dist/client/assets/settings-tab-C016euoq.js +0 -1
- package/dist/client/assets/sheet-BWD81VUI.js +0 -1
- package/dist/client/assets/shell-layout-dzWbEyhg.js +0 -1
- package/dist/client/assets/site-draft-actions-D0QjAA5A.js +0 -7
- package/dist/client/assets/site-draft-view-CDLwJ6S7.js +0 -1
- package/dist/client/assets/site-editor-C_UOunkW.js +0 -1
- package/dist/client/assets/site-editor-toast-YZR7M-Q_.js +0 -1
- package/dist/client/assets/skills-Bvnchoep.js +0 -1
- package/dist/client/assets/slider-FWDInh2S.js +0 -1
- package/dist/client/assets/sortable.esm-CK9iNqPG.js +0 -1
- package/dist/client/assets/sso-BSU9Pp4J.js +0 -1
- package/dist/client/assets/suggestion-DYgy8nXt.js +0 -2
- package/dist/client/assets/super-agent-icon-Pfppk_RI.js +0 -1
- package/dist/client/assets/switch-Y7aVfXjq.js +0 -1
- package/dist/client/assets/synced-repos-BpKGwyTo.js +0 -1
- package/dist/client/assets/tab-icon-glyph-2g8JCfEh.js +0 -1
- package/dist/client/assets/table-ptraHIy-.js +0 -1
- package/dist/client/assets/tabs-efVvGc7j.js +0 -1
- package/dist/client/assets/task-board-BgINXXjV.js +0 -1
- package/dist/client/assets/task-key-DYtWVOhd.js +0 -5
- package/dist/client/assets/task-route-mnSror7O.js +0 -1
- package/dist/client/assets/task-status-DWTaOuhM.js +0 -1
- package/dist/client/assets/taskboard-analytics-B1bCRnU6.js +0 -1
- package/dist/client/assets/tasks-BANca0_a.js +0 -1
- package/dist/client/assets/tasks-CooFuxa_.js +0 -4
- package/dist/client/assets/textarea-CShy6fKF.js +0 -1
- package/dist/client/assets/thread-analytics-RLiRMJNx.js +0 -1
- package/dist/client/assets/thread-button-BBJoVBQl.js +0 -1
- package/dist/client/assets/thread-intent-C2E_LwQl.js +0 -15
- package/dist/client/assets/thread-route-BNNhAHoL.js +0 -1
- package/dist/client/assets/thread-route-D4QqSXna.js +0 -1
- package/dist/client/assets/thread-sheet-body-1EuTSVhs.js +0 -1
- package/dist/client/assets/time-range-picker-BLR4bUKG.js +0 -1
- package/dist/client/assets/toggle-group-DJFDIGlt.js +0 -1
- package/dist/client/assets/tool-set-selector-Db3GVt5h.js +0 -1
- package/dist/client/assets/toolbar-icon-button-C222vHOe.js +0 -1
- package/dist/client/assets/tooltip-D7UkTGEH.js +0 -1
- package/dist/client/assets/tooltipContext-Bt-5l0GD.js +0 -1
- package/dist/client/assets/track-D4LGL2mH.js +0 -1
- package/dist/client/assets/types-iktHXW9L.js +0 -77
- package/dist/client/assets/url-slug-5D91y-TV.js +0 -1
- package/dist/client/assets/usage-stats--dyurVY0.js +0 -141
- package/dist/client/assets/use-ai-providers-BuEpxRW1.js +0 -1
- package/dist/client/assets/use-api-keys-GvKnnLxw.js +0 -1
- package/dist/client/assets/use-apply-named-rule-CqxV1tvo.js +0 -1
- package/dist/client/assets/use-ask-in-chat-DqQc4ECT.js +0 -1
- package/dist/client/assets/use-automations-dUGYDmCK.js +0 -1
- package/dist/client/assets/use-autosave-Wr8DUKbR.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-dqQj5Ply.js +0 -1
- package/dist/client/assets/use-blog-view-DD_jmJBl.js +0 -1
- package/dist/client/assets/use-chat-layout-state-CCw2XVj_.js +0 -1
- package/dist/client/assets/use-cms-publish-actions-C44NFuCw.js +0 -10
- package/dist/client/assets/use-connect-companion-Bna2u5LI.js +0 -1
- package/dist/client/assets/use-connection-VK11K4TO.js +0 -1
- package/dist/client/assets/use-content-sync-BOiRjtXl.js +0 -1
- package/dist/client/assets/use-copy-DCULGAYD.js +0 -1
- package/dist/client/assets/use-current-view-LvBpDZKU.js +0 -1
- package/dist/client/assets/use-date-fns-locale-CDd4ip5c.js +0 -1
- package/dist/client/assets/use-debounced-autosave-L6lTqwPP.js +0 -1
- package/dist/client/assets/use-debounced-value-BlSQwJ-U.js +0 -1
- package/dist/client/assets/use-deco-credits-DpSSEua8.js +0 -1
- package/dist/client/assets/use-decopilot-events-CKMgcY53.js +0 -1
- package/dist/client/assets/use-delete-block-L58Ww9Y9.js +0 -1
- package/dist/client/assets/use-delete-connection-BFs7BttY.js +0 -1
- package/dist/client/assets/use-deployment-admin-DHz3B0a8.js +0 -1
- package/dist/client/assets/use-entitlements-BlKSJHSI.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-L3qoVTTO.js +0 -1
- package/dist/client/assets/use-file-configs-C4Dk4hm8.js +0 -1
- package/dist/client/assets/use-id-selection-D4SX7fER.js +0 -1
- package/dist/client/assets/use-in-settings-CYqnux2M.js +0 -1
- package/dist/client/assets/use-inbox-feed-CCFFwUCc.js +0 -1
- package/dist/client/assets/use-infinite-scroll-DWo-mrOA.js +0 -1
- package/dist/client/assets/use-join-requests-NDAAVDgf.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-wZ8h6Edv.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-B_Et6vZ3.js +0 -1
- package/dist/client/assets/use-mcp-client-D5RDteAI.js +0 -10
- package/dist/client/assets/use-mcp-prompts-CCRkMvgY.js +0 -1
- package/dist/client/assets/use-mcp-tools-B96gliKn.js +0 -1
- package/dist/client/assets/use-mobile-DoMXTDgT.js +0 -1
- package/dist/client/assets/use-move-blocks-DA-bpY8C.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-Cqha0CMq.js +0 -1
- package/dist/client/assets/use-never-published-CycSPpKn.js +0 -1
- package/dist/client/assets/use-org-fs-BJdBDT27.js +0 -1
- package/dist/client/assets/use-org-notice-BNy_nTNB.js +0 -1
- package/dist/client/assets/use-org-repo-syncs-Tm3JL8YM.js +0 -1
- package/dist/client/assets/use-org-sso-CClbTjm_.js +0 -1
- package/dist/client/assets/use-organization-settings-Dac1YozR.js +0 -1
- package/dist/client/assets/use-panel-navigate-CwVf-Jjy.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-MvjOJKEW.js +0 -1
- package/dist/client/assets/use-project-scope-h-e-yu96.js +0 -1
- package/dist/client/assets/use-recent-apps-BX7LsNkB.js +0 -1
- package/dist/client/assets/use-reports-diagnostic-D5o6q25D.js +0 -1
- package/dist/client/assets/use-sandbox-events-vmaauW4s.js +0 -2
- package/dist/client/assets/use-secrets-DIzsE_oW.js +0 -1
- package/dist/client/assets/use-section-preview-base-BULKu3_g.js +0 -1
- package/dist/client/assets/use-sidebar-collapsed-cUrAd04a.js +0 -1
- package/dist/client/assets/use-tags-Cvkuh6ba.js +0 -1
- package/dist/client/assets/use-task-board-analytics-CZiGHIVd.js +0 -1
- package/dist/client/assets/use-task-board-item-prs-QJCbtLAj.js +0 -1
- package/dist/client/assets/use-task-board-items-DnD1pDUb.js +0 -1
- package/dist/client/assets/use-task-board-prompts-8YQzNj2R.js +0 -1
- package/dist/client/assets/use-task-metadata-BhU-ywA3.js +0 -1
- package/dist/client/assets/use-thread-outputs-TOoyjKo6.js +0 -1
- package/dist/client/assets/use-view-draft-kind-DICHr72j.js +0 -1
- package/dist/client/assets/use-voice-input-uu9NQJX-.js +0 -1
- package/dist/client/assets/useInfiniteQuery-SASRo812.js +0 -1
- package/dist/client/assets/useQueries-CaAjDvYS.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CUjGN1Y9.js +0 -1
- package/dist/client/assets/users-CT7G8uTC.js +0 -1
- package/dist/client/assets/utils-DFMvIUgl.js +0 -4
- package/dist/client/assets/variant-calendar-BXVKXMqd.js +0 -1
- package/dist/client/assets/variant-matcher-override-Plxnqp46.js +0 -1
- package/dist/client/assets/view-header-CdwTlPJe.js +0 -1
- package/dist/client/assets/virtual-mcp-B9uCwSKG.js +0 -1
- package/dist/client/assets/watch-sse-pool-BBObgt5_.js +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import{c as $,b as j,r as _,j as f,m as B,a_ as at,t as se,b8 as Oe,a6 as ot,ho as lt,i as ct,K as ut,cd as ht,h as De,o as pt}from"./index-D1W7ut2I.js";import{u as dt,v as Be,f as ue,B as ft,w as gt,_ as P,$ as mt,a0 as kt,J as xt,K as D,a1 as ve,a2 as bt,e as wt,a3 as Se,a4 as yt,a5 as G,N as Fe,a6 as he,c as qe,a7 as pe,a8 as Tt,a9 as vt,s as St,aa as Mt,a as Et,E as At}from"./usage-stats-CLMr8vHI.js";import{T as C,n as Rt,i as _t,E as $t}from"./editor-classes-nwzo85k0.js";import{a as Ct,e as Ue,s as Lt,S as It}from"./suggestion-HxkFbXWu.js";import{B as zt}from"./index-C4lDOrVl.js";import{aF as Pt,aj as jt,ak as Nt,am as Ht,L as Ot,aZ as Dt,aK as Bt}from"./agent-icon-mHnKN98z.js";import{i as Ft}from"./SwitchHorizontal01-DdMiH6v0.js";import{s as qt}from"./Trash01-D3BXHl0z.js";import{k as Ut,a as Zt}from"./use-org-fs-CvKheX_E.js";import{E as Me,i as Ze,b as Gt,c as Kt,d as Ge,A as Wt,e as Qt,f as Xt,g as Vt,j as Jt}from"./markdown-Cs_VFIOo.js";import{s as Yt,T as en}from"./index-H8x29Tys.js";import{f as tn,a as nn,c as rn,C as sn,b as Ee}from"./command-SY2ZnRo9.js";import{I as an}from"./icon-button-DDIgoNaN.js";function on(t){const e=$.c(30),{editor:n}=t,s=j(),[r,a]=_.useState(!1),[i,l]=_.useState(""),[o,h]=_.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const u=c;let p;e[2]!==n||e[3]!==r?(p=()=>{if(r){a(!1);return}const T=n.getAttributes("link").href;l(typeof T=="string"?T:""),h(!1),a(!0)},e[2]=n,e[3]=r,e[4]=p):p=e[4];const d=p;let g;e[5]!==n?(g=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=g):g=e[6];const x=g;let w;e[7]!==i||e[8]!==n||e[9]!==x?(w=()=>{const T=Rt(i);if(T===""){x();return}if(!_t(T)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:T}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=x,e[10]=w):w=e[10];const b=w;let y;e[11]!==s?(y=s("markdownEditor.link"),e[11]=s,e[12]=y):y=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=f.jsx(Pt,{size:14}),e[13]=v):v=e[13];let M;e[14]!==u||e[15]!==y||e[16]!==d?(M=f.jsx(C,{active:u,label:y,onClick:d,children:v}),e[14]=u,e[15]=y,e[16]=d,e[17]=M):M=e[17];let m;e[18]!==u||e[19]!==b||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==x||e[25]!==s?(m=r&&f.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||a(!1)},children:[f.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:T=>{l(T.target.value),h(!1)},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),b()):T.key==="Escape"&&(T.preventDefault(),a(!1),n.chain().focus().run())},className:B("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),f.jsx(C,{active:!1,label:s("markdownEditor.linkApply"),onClick:b,children:f.jsx(at,{size:14})}),u&&f.jsx(C,{active:!1,label:s("markdownEditor.linkRemove"),onClick:x,children:f.jsx(qt,{size:14})})]}),e[18]=u,e[19]=b,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=x,e[25]=s,e[26]=m):m=e[26];let k;return e[27]!==M||e[28]!==m?(k=f.jsxs("div",{className:"relative",children:[M,m]}),e[27]=M,e[28]=m,e[29]=k):k=e[29],k}const ne=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=f.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},Ae=t=>{const e=$.c(2),{children:n}=t;let s;return e[0]!==n?(s=f.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},Ke=[1,2,3],ln=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function cn(t){const e=$.c(20),{editor:n}=t,s=j(),[r,a]=_.useState(null);let i;e[0]!==n?(i={editor:n,selector:un},e[0]=n,e[1]=i):i=e[1];const l=dt(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let h;e[4]!==s?(h=s("markdownEditor.heading2"),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==s?(c=s("markdownEditor.heading3"),e[6]=s,e[7]=c):c=e[7];let u;e[8]!==o||e[9]!==h||e[10]!==c?(u={1:o,2:h,3:c},e[8]=o,e[9]=h,e[10]=c,e[11]=u):u=e[11];const p=u;let d;e[12]!==n||e[13]!==p||e[14]!==r||e[15]!==l||e[16]!==s?(d=r&&f.jsxs(zt,{editor:n,shouldShow:ln,appendTo:r,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[f.jsx(C,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:f.jsx(jt,{size:14})}),f.jsx(C,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:f.jsx(Nt,{size:14})}),f.jsx(C,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:f.jsx(Ht,{size:14})}),f.jsx(C,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:f.jsx(Ot,{size:14})}),f.jsx(ne,{}),Ke.map((x,w)=>f.jsx(C,{active:l.headings[w]??!1,label:p[x],onClick:()=>n.chain().focus().toggleHeading({level:x}).run(),children:f.jsx(Ae,{children:`H${x}`})},x)),f.jsx(ne,{}),f.jsx(C,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:f.jsx(Ft,{size:14})}),f.jsx(C,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:f.jsx(Ae,{children:"1."})}),f.jsx(C,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:f.jsx(Dt,{size:14})}),f.jsx(ne,{}),f.jsx(on,{editor:n})]}),e[12]=n,e[13]=p,e[14]=r,e[15]=l,e[16]=s,e[17]=d):d=e[17];let g;return e[18]!==d?(g=f.jsx("div",{ref:a,className:"relative z-20",children:d}),e[18]=d,e[19]=g):g=e[19],g}function un(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Ke.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const hn=10,pn=25,dn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function fn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dn[t.type]??""}function gn(){const t=$.c(4),e=j(),{upload:n}=Ut(Me),s=Zt(Me);let r;return t[0]!==s||t[1]!==e||t[2]!==n?(r={uploadFile:async i=>{const l=Ze(i),o=l?hn:pn;if(i.size>o*1024*1024)return se.error(e("markdownEditor.fileTooLarge",{name:i.name,max:String(o)})),null;const h=l?Gt:Kt,c=`${crypto.randomUUID()}${fn(i)}`;try{return await n.mutateAsync({dir:h,files:[new File([i],c,{type:i.type})]}),s(`${h}/${c}`)}catch{return se.error(e("markdownEditor.uploadFailed",{name:i.name})),null}}},t[0]=s,t[1]=e,t[2]=n,t[3]=r):r=t[3],r}const X=new Be("uploadSlots"),mn=ue.create({name:"uploadSlots",addProseMirrorPlugins(){return[new ft({key:X,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(X);if(!t.docChanged&&!n)return e;const s=new Map;for(const[r,a]of e)s.set(r,t.mapping.map(a));if(n){const[r,a]=n;a===null?s.delete(r):s.set(r,a)}return s}}})]}});function ie(t,e,n){return t.setMeta(X,[e,n])}function kn(t,e){return X.getState(t)?.get(e)}function xn(t,e,n,s,r){const{schema:a}=t.state,i=a.nodes[n];if(!i)return;const l=i.create(s),o=t.state.selection.to===e,h=t.state.doc.resolve(e),c=h.parent.textBetween(Math.max(0,h.parentOffset-1),h.parentOffset,void 0,""),u=()=>a.text(" "),p=l.isInline?[...c&&!/\s/.test(c)?[u()]:[],l,u()]:l,d=t.state.tr.replaceWith(e,e,p);let g=e,x=e;d.mapping.maps.at(-1)?.forEach((M,m,k,T)=>{g=k,x=T});let w;d.doc.nodesBetween(g,x,(M,m)=>{M===l&&(w=m+M.nodeSize)});let b=w??x;w!==void 0&&l.isInline&&(b+=1);const y=a.nodes.paragraph;w!==void 0&&l.isBlock&&y&&(d.doc.resolve(w).nodeAfter?.isTextblock||d.insert(w,y.create()),b=w+1);const v=gt.near(d.doc.resolve(b));o&&d.setSelection(v),r&&ie(d,r,v.to),t.dispatch(d)}function bn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function wn(t=!0){const e=j(),{uploadFile:n}=gn(),s=_.useRef(n);s.current=n;const[r,a]=_.useState(0),i=_.useRef(0),l=u=>{i.current+=u,a(i.current)},o=(u,p,d)=>{if(!t||p.length===0)return!1;l(p.length);const g=Symbol("upload");return u.dispatch(ie(u.state.tr,g,d)),(async()=>{for(const x of p)try{const w=await s.current(x);if(!w||u.isDestroyed)continue;const b=Ze(x);xn(u,kn(u.state,g)??u.state.selection.to,b?"image":"attachment",b?{src:w,alt:x.name}:{href:w,name:x.name},g)}catch{se.error(e("markdownEditor.uploadFailed",{name:x.name}))}finally{l(-1)}u.isDestroyed||u.dispatch(ie(u.state.tr,g,null))})(),!0};return{pending:r,uploading:()=>i.current>0,uploadInto:o,handlePaste:(u,p)=>{const d=bn(p.clipboardData);return d.length===0?!1:(p.stopPropagation(),o(u,d,u.state.selection.to))},handleDrop:(u,p,d,g)=>{if(g)return!1;const x=Array.from(p.dataTransfer?.files??[]);if(x.length===0)return!1;const w=u.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return w===void 0?!1:(p.stopPropagation(),o(u,x,w))}}}function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O=de();function We(t){O=t}var N={exec:()=>null};function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var yn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Tn=/^(?:[ \t]*(?:\n|$))+/,vn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Sn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),En=S(Qe).replace(/bull/g,fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,An=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rn=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_n=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fe).getRegex(),ee="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$n=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ke).replace("tag",ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ve=S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex(),Cn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ve).getRegex(),xe={blockquote:Cn,code:vn,def:Rn,fences:Sn,heading:Mn,hr:K,html:$n,lheading:Xe,list:_n,newline:Tn,paragraph:Ve,table:N,text:An},Re=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex(),Ln={...xe,lheading:En,table:Re,paragraph:S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex()},In={...xe,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(ge).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Je=/^( {2,}|\\)\n(?!\s*$)/,jn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,te=/[\s\p{P}\p{S}]/u,be=/[^\s\p{P}\p{S}]/u,Nn=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,te).getRegex(),Ye=/(?!~)[\p{P}\p{S}]/u,Hn=/(?!~)[\s\p{P}\p{S}]/u,On=/(?:[^\s\p{P}\p{S}]|~)/u,Dn=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",yn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),et=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bn=S(et,"u").replace(/punct/g,F).getRegex(),Fn=S(et,"u").replace(/punct/g,Ye).getRegex(),tt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",qn=S(tt,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Un=S(tt,"gu").replace(/notPunctSpace/g,On).replace(/punctSpace/g,Hn).replace(/punct/g,Ye).getRegex(),Zn=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Gn=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,F).getRegex(),Kn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Wn=S(Kn,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Qn=S(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),Xn=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Vn=S(ke).replace("(?:-->|$)","-->").getRegex(),Jn=S("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Vn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),V=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Yn=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",V).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nt=S(/^!?\[(label)\]\[(ref)\]/).replace("label",V).replace("ref",me).getRegex(),rt=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),er=S("reflink|nolink(?!\\()","g").replace("reflink",nt).replace("nolink",rt).getRegex(),_e=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,we={_backpedal:N,anyPunctuation:Qn,autolink:Xn,blockSkip:Dn,br:Je,code:Pn,del:N,delLDelim:N,delRDelim:N,emStrongLDelim:Bn,emStrongRDelimAst:qn,emStrongRDelimUnd:Zn,escape:zn,link:Yn,nolink:rt,punctuation:Nn,reflink:nt,reflinkSearch:er,tag:Jn,text:jn,url:N},tr={...we,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",V).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V).getRegex()},ae={...we,emStrongRDelimAst:Un,emStrongLDelim:Fn,delLDelim:Gn,delRDelim:Wn,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_e).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",_e).getRegex()},nr={...ae,br:S(Je).replace("{2,}","*").getRegex(),text:S(ae.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},W={normal:xe,gfm:Ln,pedantic:In},q={normal:we,gfm:ae,breaks:nr,pedantic:tr},rr={"&":"&","<":"<",">":">",'"':""","'":"'"},$e=t=>rr[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,$e)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,$e);return t}function Ce(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function Le(t,e){let n=t.replace(R.findPipe,(a,i,l)=>{let o=!1,h=i;for(;--h>=0&&l[h]==="\\";)o=!o;return o?"|":" |"}),s=n.split(R.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(R.slashPipe,"|");return s}function U(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function sr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function ir(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let a=4-n%4;s+=" ".repeat(a),n+=a}else s+=r,n++;return s}function Ie(t,e,n,s,r){let a=e.href,i=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}function ar(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
3
|
+
`).map(a=>{let i=a.match(n.other.beginningSpace);if(i===null)return a;let[l]=i;return l.length>=r.length?a.slice(r.length):a}).join(`
|
|
4
|
+
`)}var J=class{options;rules;lexer;constructor(t){this.options=t||O}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:U(n,`
|
|
5
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=ar(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=U(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:U(e[0],`
|
|
6
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=U(e[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),s="",r="",a=[];for(;n.length>0;){let i=!1,l=[],o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))l.push(n[o]),i=!0;else if(!i)l.push(n[o]);else break;n=n.slice(o);let h=l.join(`
|
|
9
|
+
`),c=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
11
|
+
${h}`:h,r=r?`${r}
|
|
12
|
+
${c}`:c;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,a,!0),this.lexer.state.top=u,n.length===0)break;let p=a.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let d=p,g=d.raw+`
|
|
13
|
+
`+n.join(`
|
|
14
|
+
`),x=this.blockquote(g);a[a.length-1]=x,s=s.substring(0,s.length-d.raw.length)+x.raw,r=r.substring(0,r.length-d.text.length)+x.text;break}else if(p?.type==="list"){let d=p,g=d.raw+`
|
|
15
|
+
`+n.join(`
|
|
16
|
+
`),x=this.list(g);a[a.length-1]=x,s=s.substring(0,s.length-p.raw.length)+x.raw,r=r.substring(0,r.length-d.raw.length)+x.raw,n=g.substring(a.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let a=this.rules.other.listItemRegex(n),i=!1;for(;t;){let o=!1,h="",c="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;h=e[0],t=t.substring(h.length);let u=ir(e[2].split(`
|
|
18
|
+
`,1)[0],e[1].length),p=t.split(`
|
|
19
|
+
`,1)[0],d=!u.trim(),g=0;if(this.options.pedantic?(g=2,c=u.trimStart()):d?g=e[1].length+1:(g=u.search(this.rules.other.nonSpaceChar),g=g>4?1:g,c=u.slice(g),g+=e[1].length),d&&this.rules.other.blankLine.test(p)&&(h+=p+`
|
|
20
|
+
`,t=t.substring(p.length+1),o=!0),!o){let x=this.rules.other.nextBulletRegex(g),w=this.rules.other.hrRegex(g),b=this.rules.other.fencesBeginRegex(g),y=this.rules.other.headingBeginRegex(g),v=this.rules.other.htmlBeginRegex(g),M=this.rules.other.blockquoteBeginRegex(g);for(;t;){let m=t.split(`
|
|
21
|
+
`,1)[0],k;if(p=m,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),k=p):k=p.replace(this.rules.other.tabCharGlobal," "),b.test(p)||y.test(p)||v.test(p)||M.test(p)||x.test(p)||w.test(p))break;if(k.search(this.rules.other.nonSpaceChar)>=g||!p.trim())c+=`
|
|
22
|
+
`+k.slice(g);else{if(d||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(u)||y.test(u)||w.test(u))break;c+=`
|
|
23
|
+
`+p}d=!p.trim(),h+=m+`
|
|
24
|
+
`,t=t.substring(m.length+1),u=k.slice(g)}}r.loose||(i?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(i=!0)),r.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=h}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let o of r.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(o.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};o.checked=c.checked,r.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=c.raw+o.tokens[0].raw,o.tokens[0].text=c.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(c)):o.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):o.tokens.unshift(c)}}if(!r.loose){let h=o.tokens.filter(u=>u.type==="space"),c=h.length>0&&h.some(u=>this.rules.other.anyLine.test(u.raw));r.loose=c}}if(r.loose)for(let o of r.items){o.loose=!0;for(let h of o.tokens)h.type==="text"&&(h.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Le(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?a.align.push("right"):this.rules.other.tableAlignCenter.test(i)?a.align.push("center"):this.rules.other.tableAlignLeft.test(i)?a.align.push("left"):a.align.push(null);for(let i=0;i<n.length;i++)a.header.push({text:n[i],tokens:this.lexer.inline(n[i]),header:!0,align:a.align[i]});for(let i of r)a.rows.push(Le(i,a.header.length).map((l,o)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[o]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=U(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=sr(e[2],"()");if(a===-2)return;if(a>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Ie(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Ie(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,a,i,l=r,o=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*t.length+r);(s=h.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(i=[...a].length,s[3]||s[4]){l+=i;continue}else if((s[5]||s[6])&&r%3&&!((r+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);let c=[...s[0]][0].length,u=t.slice(0,r+s.index+c+i);if(Math.min(r,i)%2){let d=u.slice(1,-1);return{type:"em",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}let p=u.slice(2,-2);return{type:"strong",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,a,i,l=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+r);(s=o.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a||(i=[...a].length,i!==r))continue;if(s[3]||s[4]){l+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l);let h=[...s[0]][0].length,c=t.slice(0,r+s.index+h+i),u=c.slice(r,-r);return{type:"del",raw:c,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},L=class oe{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||O,this.options.tokenizer=this.options.tokenizer||new J,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:R,block:W.normal,inline:q.normal};this.options.pedantic?(n.block=W.pedantic,n.inline=q.pedantic):this.options.gfm&&(n.block=W.gfm,this.options.breaks?n.inline=q.breaks:n.inline=q.gfm),this.tokenizer.rules=n}static get rules(){return{block:W,inline:q}}static lex(e,n){return new oe(n).lex(e)}static lexInline(e,n){return new oe(n).inlineTokens(e)}lex(e){e=e.replace(R.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(R.tabCharGlobal," ").replace(R.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(i=>(r=i.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let i=n.at(-1);r.raw.length===1&&i!==void 0?i.raw+=`
|
|
28
|
+
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let i=n.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
29
|
+
`)?"":`
|
|
30
|
+
`)+r.raw,i.text+=`
|
|
31
|
+
`+r.text,this.inlineQueue.at(-1).src=i.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let i=n.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
32
|
+
`)?"":`
|
|
33
|
+
`)+r.raw,i.text+=`
|
|
34
|
+
`+r.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let i=1/0,l=e.slice(1),o;this.options.extensions.startBlock.forEach(h=>{o=h.call({lexer:this},l),typeof o=="number"&&o>=0&&(i=Math.min(i,o))}),i<1/0&&i>=0&&(a=e.substring(0,i+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let i=n.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+r.raw,i.text+=`
|
|
37
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(r),s=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let i=n.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+r.raw,i.text+=`
|
|
40
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(r);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)a=r[2]?r[2].length:0,s=s.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,l="";for(;e;){i||(l=""),i=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let c=n.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,s,l)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e,s,l)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,u=e.slice(1),p;this.options.extensions.startInline.forEach(d=>{p=d.call({lexer:this},u),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(o=this.tokenizer.inlineText(h)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(l=o.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}},Y=class{options;parser;constructor(t){this.options=t||O}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(R.notSpaceStart)?.[0],r=t.replace(R.endingNewline,"")+`
|
|
41
|
+
`;return s?'<pre><code class="language-'+z(s)+'">'+(n?r:z(r,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(n?r:z(r,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(t)}</blockquote>
|
|
45
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
46
|
+
`}hr(t){return`<hr>
|
|
47
|
+
`}list(t){let e=t.ordered,n=t.start,s="";for(let i=0;i<t.items.length;i++){let l=t.items[i];s+=this.listitem(l)}let r=e?"ol":"ul",a=e&&n!==1?' start="'+n+'"':"";return"<"+r+a+`>
|
|
48
|
+
`+s+"</"+r+`>
|
|
49
|
+
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
50
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
51
|
+
`}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let s="";for(let r=0;r<t.rows.length;r++){let a=t.rows[r];n="";for(let i=0;i<a.length;i++)n+=this.tablecell(a[i]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+e+`</thead>
|
|
54
|
+
`+s+`</table>
|
|
55
|
+
`}tablerow({text:t}){return`<tr>
|
|
56
|
+
${t}</tr>
|
|
57
|
+
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
58
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),r=Ce(t);if(r===null)return s;t=r;let a='<a href="'+t+'"';return e&&(a+=' title="'+z(e)+'"'),a+=">"+s+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Ce(t);if(r===null)return z(n);t=r;let a=`<img src="${t}" alt="${z(n)}"`;return e&&(a+=` title="${z(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},ye=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},I=class le{options;renderer;textRenderer;constructor(e){this.options=e||O,this.options.renderer=this.options.renderer||new Y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ye}static parse(e,n){return new le(n).parse(e)}static parseInline(e,n){return new le(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let i=r,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){n+=l||"";continue}}let a=r;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let a=e[r];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=l||"";continue}}let i=a;switch(i.type){case"escape":{s+=n.text(i);break}case"html":{s+=n.html(i);break}case"link":{s+=n.link(i);break}case"image":{s+=n.image(i);break}case"checkbox":{s+=n.checkbox(i);break}case"strong":{s+=n.strong(i);break}case"em":{s+=n.em(i);break}case"codespan":{s+=n.codespan(i);break}case"br":{s+=n.br(i);break}case"del":{s+=n.del(i);break}case"text":{s+=n.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},Z=class{options;block;constructor(t){this.options=t||O}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?L.lex:L.lexInline}provideParser(t=this.block){return t?I.parse:I.parseInline}},or=class{defaults=de();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=I;Renderer=Y;TextRenderer=ye;Lexer=L;Tokenizer=J;Hooks=Z;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let a of r.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of r.rows)for(let i of a)n=n.concat(this.walkTokens(i.tokens,e));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let i=r[a].flat(1/0);n=n.concat(this.walkTokens(i,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=e.renderers[r.name];a?e.renderers[r.name]=function(...i){let l=r.renderer.apply(this,i);return l===!1&&(l=a.apply(this,i)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[r.level];a?a.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new Y(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,l=n.renderer[i],o=r[i];r[i]=(...h)=>{let c=l.apply(r,h);return c===!1&&(c=o.apply(r,h)),c||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new J(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,l=n.tokenizer[i],o=r[i];r[i]=(...h)=>{let c=l.apply(r,h);return c===!1&&(c=o.apply(r,h)),c}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Z;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,l=n.hooks[i],o=r[i];Z.passThroughHooks.has(a)?r[i]=h=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await l.call(r,h);return o.call(r,u)})();let c=l.call(r,h);return o.call(r,c)}:r[i]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await l.apply(r,h);return u===!1&&(u=await o.apply(r,h)),u})();let c=l.apply(r,h);return c===!1&&(c=o.apply(r,h)),c}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(i){let l=[];return l.push(a.call(this,i)),r&&(l=l.concat(r.call(this,i))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return L.lex(t,e??this.defaults)}parser(t,e){return I.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let i=r.hooks?await r.hooks.preprocess(e):e,l=await(r.hooks?await r.hooks.provideLexer(t):t?L.lex:L.lexInline)(i,r),o=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(o,r.walkTokens));let h=await(r.hooks?await r.hooks.provideParser(t):t?I.parse:I.parseInline)(o,r);return r.hooks?await r.hooks.postprocess(h):h})().catch(a);try{r.hooks&&(e=r.hooks.preprocess(e));let i=(r.hooks?r.hooks.provideLexer(t):t?L.lex:L.lexInline)(e,r);r.hooks&&(i=r.hooks.processAllTokens(i)),r.walkTokens&&this.walkTokens(i,r.walkTokens);let l=(r.hooks?r.hooks.provideParser(t):t?I.parse:I.parseInline)(i,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(i){return a(i)}}}onError(t,e){return n=>{if(n.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},H=new or;function E(t,e){return H.parse(t,e)}E.options=E.setOptions=function(t){return H.setOptions(t),E.defaults=H.defaults,We(E.defaults),E};E.getDefaults=de;E.defaults=O;E.use=function(...t){return H.use(...t),E.defaults=H.defaults,We(E.defaults),E};E.walkTokens=function(t,e){return H.walkTokens(t,e)};E.parseInline=H.parseInline;E.Parser=I;E.parser=I.parse;E.Renderer=Y;E.TextRenderer=ye;E.Lexer=L;E.lexer=L.lex;E.Tokenizer=J;E.Hooks=Z;E.parse=E;E.options;E.setOptions;E.use;E.walkTokens;E.parseInline;I.parse;L.lex;const lr=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function cr(t){return t.flatMap((e,n)=>{var s;if(e.type==="space"||((s=t[n+1])===null||s===void 0?void 0:s.type)==="space")return[e];const r=(e.raw||"").match(lr);return r?[{...e,raw:(e.raw||"").slice(0,-r[0].length)},{type:"space",raw:r[0]}]:[e]})}function ur(t,e){const n=e.split(`
|
|
60
|
+
`).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
|
|
61
|
+
`);return n.slice(0,n.length-1)}function hr(t,e){const n=[];return Array.from(t.entries()).forEach(([s,r])=>{if(!e){n.push(s);return}(e.marks||[]).find(a=>a.type===s&&G(a.attrs,r.attrs))||n.push(s)}),n}function pr(t,e){const n=[];return Array.from(e.entries()).forEach(([s,r])=>{const a=t.get(s);(!a||!G(a.attrs,r.attrs))&&n.push({type:s,mark:r})}),n}function dr(t,e,n,s){const r=!n,a=n&&(!n.marks||n.marks.length===0),i=n&&n.marks&&!s(e,new Map(n.marks.map(o=>[o.type,o]))),l=[];return(r||a||i)&&(n&&n.marks?Array.from(t.entries()).reverse().forEach(([o,h])=>{n.marks.find(c=>c.type===o&&G(c.attrs,h.attrs))||l.push(o)}):(r||a)&&l.push(...Array.from(t.keys()).reverse())),l}function fr(t,e){let n="";return Array.from(t.keys()).reverse().forEach(s=>{const r=e(s,t.get(s));r&&(n=r+n)}),t.clear(),n}function gr(t,e,n){let s="";return Array.from(t.entries()).forEach(([r,a])=>{const i=n(r,a);i&&(s+=i),e.set(r,a)}),s}function re(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function Q(t,e){return typeof t!="string"?"json":e}const mr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),kr=/<\/?([a-zA-Z][\w-]*)/g;function xr(t){const e=[];let n;for(;(n=kr.exec(t))!==null;)e.push(n[1].toLowerCase());return e}function br(t){const e=t.toLowerCase();return e.includes("-")?!1:!mr.has(e)}function wr(t,e){return xr(t).some(n=>br(n)?!e.has(n):!1)}var ze=class{constructor(t){var e,n,s,r,a;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t?.marked)!==null&&e!==void 0?e:E,this.indentStyle=(n=t==null||(s=t.indentation)===null||s===void 0?void 0:s.style)!==null&&n!==void 0?n:"space",this.indentSize=(r=t==null||(a=t.indentation)===null||a===void 0?void 0:a.size)!==null&&r!==void 0?r:2,this.baseExtensions=t?.extensions||[],t?.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t?.extensions&&(this.baseExtensions=t.extensions,mt(kt(t.extensions)).forEach(i=>this.registerExtension(i)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,n;this.extensions.push(t);const s=xt(D(t,"code")),r=t.name;s&&this.codeTypes.add(r),this.extensionRanks.has(r)||this.extensionRanks.set(r,this.extensionRanks.size);const a=D(t,"markdownTokenName")||r,i=D(t,"parseMarkdown"),l=D(t,"renderMarkdown"),o=D(t,"markdownTokenizer"),h=(e=D(t,"markdownOptions"))!==null&&e!==void 0?e:null,c={tokenName:a,nodeName:r,parseMarkdown:i,renderMarkdown:l,isIndenting:(n=h?.indentsContent)!==null&&n!==void 0?n:!1,htmlReopen:h?.htmlReopen,tokenizer:o};if(a&&i){const u=this.registry.get(a)||[];u.push(c),this.registry.set(a,u)}if(l){const u=this.nodeTypeRegistry.get(r)||[];u.push(c),this.nodeTypeRegistry.set(r,u)}o&&this.hasMarked()&&this.registerTokenizer(o)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!==null&&e!==void 0?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:s="inline",tokenize:r}=t,a=this.createTokenizerHelpers.bind(this),i=this.createLexer.bind(this);let l;n?l=typeof n=="function"?n:h=>h.indexOf(n):l=h=>{const c=r(h,[],this.createTokenizerHelpers(this.createLexer()));return c&&c.raw?h.indexOf(c.raw):-1};const o={name:e,level:s,start:l,tokenizer(h,c){const u=this.lexer?a(this.lexer):a(i()),p=r(h,c,u);if(p&&p.type)return{...p,type:p.type||e,raw:p.raw||"",tokens:p.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[o]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const n=this.getHandlersForNodeType(t);return n.length>0?n[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{const s=n.lex(t);return{type:"doc",content:this.parseTokens(s,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const n=e?cr(t):t,s=n.reduce((i,l,o)=>(l.type!=="space"&&i.push(o),i),[]);let r=-1,a=0;return n.flatMap((i,l)=>{for(;a<s.length&&s[a]<l;)r=s[a],a+=1;if(e&&i.type==="space"){var o;const c=(o=s[a])!==null&&o!==void 0?o:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,c)}const h=this.parseToken(i,e);return h===null?[]:Array.isArray(h)?h:[h]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const s=this.countParagraphSeparators(t.raw||"");if(s===0)return[];const r=Math.max(s-(e===-1||n===-1?0:1),0);return Array.from({length:r},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
|
|
62
|
+
`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),s=this.createParseHelpers();if(n.find(r=>{if(!r.parseMarkdown)return!1;const a=r.parseMarkdown(t,s),i=this.normalizeParseResult(a);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>re(l).isTask),n=t.items.some(l=>!re(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const s=[];let r=[],a=null;for(let l=0;l<t.items.length;l+=1){const o=t.items[l],{isTask:h,checked:c,indentLevel:u}=re(o);let p=o;if(h){const g=(o.raw||o.text||"").split(`
|
|
63
|
+
`),x=g[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),w=x?x[2]:"";let b=[];if(g.length>1&&g.slice(1).join(`
|
|
64
|
+
`).trim()){const y=g.slice(1),v=y.filter(M=>M.trim());if(v.length>0){const M=Math.min(...v.map(k=>k.length-k.trimStart().length)),m=y.map(k=>k.trim()?k.slice(M):"").join(`
|
|
65
|
+
`).trim();m&&(b=this.markedInstance.lexer(`${m}
|
|
66
|
+
`))}}p={type:"taskItem",raw:"",mainContent:w,indentLevel:u,checked:c??!1,text:w,tokens:this.tokenizeInline(w),nestedTokens:b}}const d=h?"taskList":"list";a!==d?(r.length>0&&s.push({type:a,items:r}),r=[p],a=d):r.push(p)}r.length>0&&s.push({type:a,items:r});const i=[];for(let l=0;l<s.length;l+=1){const o=s[l],h={...t,type:o.type,items:o.items},c=this.parseToken(h);c&&(Array.isArray(c)?i.push(...c):i.push(c))}return i.length>0?i:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const r=s.parseMarkdown(t,n),a=this.normalizeParseResult(r);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const s={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete s.attrs,s},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let i=0;i<t.length;i+=1){const l=t[i];if(l.type==="text")e.push({type:"text",text:ve(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,s;const o=((n=(s=l.raw)!==null&&s!==void 0?s:l.text)!==null&&n!==void 0?n:"").toString(),h=/^<\/[\s]*[\w-]+/i.test(o),c=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!h&&c&&!/\/>$/.test(o)){const p=c[1],d=this.escapeRegex(p),g=new RegExp(`^<\\/\\s*${d}\\b`,"i");let x=-1;const w=[o];for(let b=i+1;b<t.length;b+=1){var r,a;const y=t[b],v=((r=(a=y.raw)!==null&&a!==void 0?a:y.text)!==null&&r!==void 0?r:"").toString();if(w.push(v),y.type==="html"&&g.test(v)){x=b;break}}if(x!==-1){const b=w.join(""),y={type:"html",raw:b,text:b,block:!1},v=this.parseHTMLToken(y);if(v){const M=this.normalizeParseResult(v);Array.isArray(M)?e.push(...M):M&&e.push(M)}i=x;continue}}const u=this.parseHTMLToken(l);if(u){const p=this.normalizeParseResult(u);Array.isArray(p)?e.push(...p):p&&e.push(p)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const h=this.createParseHelpers(),c=o.parseMarkdown(l,h);if(this.isMarkResult(c)){const u=this.applyMarkToContent(c.mark,c.content,c.attrs);e.push(...u)}else{const u=this.normalizeParseResult(c);Array.isArray(u)?e.push(...u):u&&e.push(u)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let i=e.length-1;i>0;i-=1){const l=e[i],o=e[i-1];if(l.type==="text"&&o.type==="text"){const h=l.marks||[],c=o.marks||[];bt(h,c)&&(o.text=(o.text||"")+(l.text||""),e.splice(i,1))}}return e}applyMarkToContent(t,e,n){return e.map(s=>{if(s.type==="text"){const r=s.marks||[],a=n?{type:t,attrs:n}:{type:t};return{...s,marks:[...r,a]}}return{...s,content:s.content?this.applyMarkToContent(t,s.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:ve(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=wt(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const s=this.toInlineContent(n.content);return s.length>0?s:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=Se(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return wr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=Se(this.baseExtensions),n=s=>{const r=s?.parseDOM;Array.isArray(r)&&r.forEach(a=>{if(typeof a?.tag=="string"){const i=a.tag.match(/^[a-zA-Z][\w-]*/);i&&t.add(i[0].toLowerCase())}})};Object.values(e.nodes).forEach(s=>n(s.spec)),Object.values(e.marks).forEach(s=>n(s.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(s=>this.codeTypes.has(typeof s=="string"?s:s.type))?t:this.escapeMarkdownSyntax(yt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,s=0,r={}){var a;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const i=this.getHandlerForToken(t.type);if(!i)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(c,u)=>{const p=i.isIndenting?s+1:s;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,u||"",n,p):this.renderNodes(c,t,u||"",n,p)},renderChild:(c,u)=>{const p=i.isIndenting?s+1:s;return this.renderNodeToMarkdown(c,t,u,p)},indent:c=>this.indentString+c,wrapInBlock:ur},h={index:n,level:s,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...r}};return((a=i.renderMarkdown)===null||a===void 0?void 0:a.call(i,t,o,h))||""}renderNodes(t,e,n="",s=0,r=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,r):t.type?this.renderNodeToMarkdown(t,e,s,r):""}renderNodesWithMarkBoundaries(t,e,n="",s=0){const r=[],a=new Map,i=new Set,l=new Map;return t.forEach((o,h)=>{const c=h<t.length-1?t[h+1]:null;if(o.type)if(o.type==="text"){let u=this.encodeTextForMarkdown(o.text||"",o,e);const p=new Map((o.marks||[]).map(m=>[m.type,m])),d=this.getMarksToOpenForSerialization(a,p,c),g=hr(p,c),x=g.filter(m=>a.has(m)),w=x.length>0&&d.length>0;let b="";if(g.length>0&&!w){const m=u.match(/(\s+)$/);m&&(b=m[1],u=u.slice(0,-b.length))}w||g.slice().reverse().forEach(m=>{if(!a.has(m))return;const k=p.get(m),T=this.getMarkClosing(m,k,l.get(m));T&&(u+=T),a.has(m)&&(a.delete(m),l.delete(m))});let y="";if(d.length>0){const m=u.match(/^(\s+)/);m&&(y=m[1],u=u.slice(y.length))}d.forEach(({type:m,mark:k})=>{const T=i.has(m)?"html":"markdown",A=this.getMarkOpening(m,k,T);A&&(u=A+u),l.set(m,T),i.delete(m)}),w||d.slice().reverse().forEach(({type:m,mark:k})=>{a.set(m,k)}),u=y+u;let v;if(w){const m=new Set((c?.marks||[]).map(A=>A.type));d.forEach(({type:A})=>{m.has(A)&&this.getHtmlReopenTags(A)&&i.add(A)});const k=Array.from(a.keys()),T=x.slice().sort((A,it)=>k.indexOf(it)-k.indexOf(A));v=[...d.map(A=>A.type),...T]}else v=dr(a,p,c,this.markSetsEqual.bind(this));let M="";if(v.length>0){const m=u.match(/(\s+)$/);m&&(M=m[1],u=u.slice(0,-M.length))}v.forEach(m=>{var k;const T=(k=a.get(m))!==null&&k!==void 0?k:p.get(m),A=this.getMarkClosing(m,T,l.get(m));A&&(u+=A),a.delete(m),l.delete(m)}),u+=M,u+=b,r.push(u)}else{const u=new Set((o.marks||[]).map(b=>b.type)),p=new Map,d=new Map;a.forEach((b,y)=>{if(u.has(y)){var v;p.set(y,b),d.set(y,(v=l.get(y))!==null&&v!==void 0?v:"markdown")}});const g=fr(a,(b,y)=>this.getMarkClosing(b,y,l.get(b)));l.clear();const x=this.renderNodeToMarkdown(o,e,h,s),w=o.type==="hardBreak"?"":gr(p,a,(b,y)=>{var v;const M=(v=d.get(b))!==null&&v!==void 0?v:"markdown";return l.set(b,M),this.getMarkOpening(b,y,M)});r.push(g+x+w)}}),r.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.open)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:c=>c,wrapInBlock:(c,u)=>c+u},{index:0,level:0,parentType:"text",meta:{}}),h=o.indexOf(i);return h>=0?o.substring(0,h):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.close)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:u=>u,wrapInBlock:(u,p)=>u+p},{index:0,level:0,parentType:"text",meta:{}}),h=o.indexOf(i),c=h+33;return h>=0?o.substring(c):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,s])=>{const r=e.get(n);return r&&G(s.attrs,r.attrs)})}getMarksToOpenForSerialization(t,e,n){const s=pr(t,e);if(s.length<=1)return s;const r=n?.marks||[],a=(h,c)=>r.some(u=>u.type===h&&G(u.attrs,c)),i=(h,c)=>{var u,p;const d=(u=this.extensionRanks.get(h.type))!==null&&u!==void 0?u:Number.MAX_SAFE_INTEGER,g=(p=this.extensionRanks.get(c.type))!==null&&p!==void 0?p:Number.MAX_SAFE_INTEGER;return d!==g?g-d:h.type.localeCompare(c.type)},l=s.filter(h=>!a(h.type,h.mark.attrs)).sort(i),o=s.filter(h=>a(h.type,h.mark.attrs)).sort(i);return[...l,...o]}};const yr=ue.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(Q(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(Q(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(Q(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return P.insertContentAt(t,s,n)}}},addStorage(){return{manager:new ze({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new ze({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||Q(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function Tr(t){const e=$.c(13),{node:n,selected:s,editor:r,deleteNode:a}=t,i=j(),l=typeof n.attrs.href=="string"?n.attrs.href:"",o=typeof n.attrs.name=="string"?n.attrs.name:"",h=s&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let c;e[0]!==h?(c=B(Wt,"select-none",h),e[0]=h,e[1]=c):c=e[1];let u;e[2]!==a||e[3]!==r.isEditable||e[4]!==i?(u=r.isEditable&&f.jsx("button",{type:"button","aria-label":i("markdownEditor.removeFile"),onMouseDown:vr,onClick:a,className:"shrink-0 rounded-lg p-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:f.jsx(Oe,{size:14})}),e[2]=a,e[3]=r.isEditable,e[4]=i,e[5]=u):u=e[5];let p;e[6]!==l||e[7]!==o||e[8]!==u?(p=f.jsx(Qt,{href:l,name:o,children:u}),e[6]=l,e[7]=o,e[8]=u,e[9]=p):p=e[9];let d;return e[10]!==c||e[11]!==p?(d=f.jsx(pe,{as:"span",className:c,children:p}),e[10]=c,e[11]=p,e[12]=d):d=e[12],d}function vr(t){return t.preventDefault()}function Sr(t){return t.replace(/([[\]])/g,"\\$1")}const Mr=Fe.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]",getAttrs:t=>Ge(t.getAttribute("href")??"")?null:!1}]},renderHTML({HTMLAttributes:t,node:e}){return["a",qe(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${Sr(n)}](${e})`},addNodeView(){return he(Tr)}});function Er(t){const e=$.c(6),{node:n,selected:s}=t,r=typeof n.attrs.name=="string"?n.attrs.name:"";let a;e[0]!==n.attrs.id||e[1]!==s?(a=B("select-none",Vt(typeof n.attrs.id=="string"?n.attrs.id:null),s&&"ring-2 ring-ring"),e[0]=n.attrs.id,e[1]=s,e[2]=a):a=e[2];let i;return e[3]!==r||e[4]!==a?(i=f.jsxs(pe,{as:"span","data-testid":"mention-chip",className:a,children:["@",r]}),e[3]=r,e[4]=a,e[5]=i):i=e[5],i}const Ar=Fe.create({name:"mention",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-mention-id"),renderHTML:t=>t.id?{"data-mention-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-mention-name"),renderHTML:t=>t.name?{"data-mention-name":t.name}:{}}}},parseHTML(){return[{tag:"span[data-mention-id]"}]},renderHTML({HTMLAttributes:t,node:e}){return["span",qe(t),`@${typeof e.attrs.name=="string"?e.attrs.name:""}`]},renderMarkdown:t=>{const e=typeof t.attrs?.id=="string"?t.attrs.id:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return e?Xt(e,n):`@${n}`},addNodeView(){return he(Er)}}),Rr="studio.mention-members.",ce=new Map;function Pe(t){const e=ce.get(t);if(e)return e;try{const n=localStorage.getItem(t);if(!n)return;const s=JSON.parse(n);if(!Array.isArray(s))return;const r=s.filter(a=>!!a&&typeof a.id=="string"&&typeof a.name=="string");return ce.set(t,r),r}catch{return}}function _r(t,e){ce.set(t,e);try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function $r(t,e){if(!t?.length)return e;const n=new Map(t.map(s=>[s.id,s]));return e.map(s=>{const r=n.get(s.id);return r&&r.name===s.name&&r.email===s.email&&r.image===s.image?r:s})}function Cr(t){return t.map(e=>({id:e.userId,name:e.user?.name?.trim()||e.user?.email?.trim()||"",email:e.user?.email??"",image:e.user?.image??null})).filter(e=>!!e.name).sort((e,n)=>e.name.localeCompare(n.name))}function Lr(t){const e=$.c(17),{locator:n}=ot(),s=lt(),r=`${Rr}${n}`;let a;e[0]!==n?(a=ut.mentionMembers(n),e[0]=n,e[1]=a):a=e[1];let i;e[2]!==r?(i=()=>Pe(r),e[2]=r,e[3]=i):i=e[3];let l;e[4]!==s||e[5]!==r?(l=async()=>{const d=await s.organization.listMembers(),g=$r(Pe(r),Cr(d?.data?.members??[]));return _r(r,g),g},e[4]=s,e[5]=r,e[6]=l):l=e[6];let o;e[7]!==t||e[8]!==a||e[9]!==i||e[10]!==l?(o={queryKey:a,enabled:t,staleTime:0,placeholderData:i,queryFn:l},e[7]=t,e[8]=a,e[9]=i,e[10]=l,e[11]=o):o=e[11];const h=ct(o);let c;e[12]!==h.data?(c=h.data??[],e[12]=h.data,e[13]=c):c=e[13];const u=h.isFetching&&!h.data;let p;return e[14]!==c||e[15]!==u?(p={members:c,loading:u},e[14]=c,e[15]=u,e[16]=p):p=e[16],p}const je={query:"",range:null,rect:null,editor:null};class Ir{state=je;listeners=new Set;dismissal=null;latched=!1;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.state;set(e){this.state=e;for(const n of this.listeners)n()}close(){this.latched=!1,this.set(je)}}const Te=new Be("markdownEditorMention");function zr(t,e,n){t.chain().focus().insertContentAt(e,[{type:"mention",attrs:{id:n.id,name:n.name}},{type:"text",text:" "}]).run(),Ue(t.view,Te)}function Pr(t,e,n){const s=Math.min(e+n,t.content.size);return e>=s?"":t.textBetween(e,s,"","")}function st(t,e){const n=e.getSnapshot().range??void 0;n&&n.to>n.from&&(e.dismissal={from:n.from,text:t.state.doc.textBetween(n.from,n.to,"")}),Ue(t.view,Te)}function jr(t){return ue.create({name:"mentionSuggestion",addProseMirrorPlugins(){const e={editor:this.editor,char:"@",pluginKey:Te,allowedPrefixes:[" ",`
|
|
67
|
+
`],allow:({state:n,range:s})=>{const r=t.dismissal;return r?s.from===r.from&&Pr(n.doc,r.from,r.text.length)===r.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(st(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Ct(e)]}})}const Ne=256,Nr=40,He=280,Hr=140,Or=[];function Dr(t){const e=$.c(5),{store:n,agents:s}=t,r=s===void 0?Or:s,a=_.useSyncExternalStore(n.subscribe,n.getSnapshot),i=a.range!==null;let l;return e[0]!==r||e[1]!==i||e[2]!==a||e[3]!==n?(l=i?f.jsx(Br,{store:n,state:a,agents:r}):null,e[0]=r,e[1]=i,e[2]=a,e[3]=n,e[4]=l):l=e[4],l}function Br({store:t,state:e,agents:n}){const s=j(),{members:r,loading:a}=Lr(!0),[i,l]=_.useState(e.query),[o,h]=_.useState(null),c=Fr(e.editor),u=c.getBoundingClientRect(),p=c===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):u,d=e.rect?.()??new DOMRect(0,0,0,0),g=p.bottom-d.bottom,x=g<He&&d.top-p.top>g,w=(x?d.top-p.top:g)-8,b=Math.min(He,Math.max(w,Hr))-Nr,y={position:"absolute",width:Ne,left:Math.min(d.left,p.right-Ne-8)-u.left,...x?{bottom:u.bottom-d.top+6}:{top:d.bottom-u.top+6}},v=()=>{e.editor&&st(e.editor,t),t.close()},M=k=>{const T=k.relatedTarget;if((!T||e.editor?.view.dom.contains(T)===!0)&&t.latched){o?.focus();return}v()},m=k=>{!e.editor||!e.range||(zr(e.editor,e.range,k),t.close())};return ht.createPortal(f.jsx("div",{style:y,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg bg-popover shadow-soft",children:f.jsxs(tn,{onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),v(),e.editor?.commands.focus())},children:[f.jsx(nn,{ref:h,autoFocus:!0,onFocus:()=>{t.latched=!0},value:i,onValueChange:l,placeholder:s("markdownEditor.mentionSearch"),onBlur:M}),f.jsxs(rn,{style:{maxHeight:b},children:[a?f.jsx("div",{className:"flex items-center justify-center py-6",children:f.jsx(De,{size:"sm"})}):f.jsx(sn,{children:s("markdownEditor.mentionEmpty")}),n.map(k=>f.jsxs(Ee,{value:k.name,onSelect:()=>m(k),onMouseDown:T=>T.preventDefault(),className:"gap-2",children:[k.icon,f.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.name})]},k.id)),r.map(k=>f.jsxs(Ee,{value:`${k.name} ${k.email}`,onSelect:()=>m(k),onMouseDown:T=>T.preventDefault(),className:"gap-2",children:[f.jsx(pt,{url:k.image??void 0,fallback:k.name??"?",shape:"circle",size:"xs"}),f.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.name})]},k.id))]})]})}),c)}function Fr(t){const e=t?.view.dom.closest('[role="dialog"]');return e instanceof HTMLElement?e:document.body}function qr(t){const e=$.c(16),{node:n,selected:s,editor:r,deleteNode:a}=t,i=j(),l=typeof n.attrs.src=="string"?n.attrs.src:"",o=typeof n.attrs.alt=="string"?n.attrs.alt:"";let h;e[0]!==o||e[1]!==i?(h=o||i("markdownEditor.imageAltFallback"),e[0]=o,e[1]=i,e[2]=h):h=e[2];const c=s&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let u;e[3]!==c?(u=B("max-h-[420px] max-w-full rounded-lg border border-border object-contain",c),e[3]=c,e[4]=u):u=e[4];let p;e[5]!==l||e[6]!==h||e[7]!==u?(p=f.jsx("img",{src:l,alt:h,draggable:!1,className:u}),e[5]=l,e[6]=h,e[7]=u,e[8]=p):p=e[8];let d;e[9]!==a||e[10]!==r.isEditable||e[11]!==i?(d=r.isEditable&&f.jsx("button",{type:"button","aria-label":i("markdownEditor.removeImage"),onMouseDown:Ur,onClick:a,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-lg bg-card text-muted-foreground opacity-0 shadow-edge transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:f.jsx(Oe,{size:14})}),e[9]=a,e[10]=r.isEditable,e[11]=i,e[12]=d):d=e[12];let g;return e[13]!==p||e[14]!==d?(g=f.jsxs(pe,{className:"group/image relative my-3 w-fit max-w-full",children:[p,d]}),e[13]=p,e[14]=d,e[15]=g):g=e[15],g}function Ur(t){return t.preventDefault()}const Zr=Yt.extend({addNodeView(){return he(qr)}}).configure({inline:!1,allowBase64:!1}),Gr={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},Kr=Tt.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";if(Ge(n))return e.createNode("attachment",{href:n,name:t.text??""});const s=Jt(n);return s?e.createNode("mention",{id:s,name:(t.text??"").replace(/^@/,"")}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function Wr(t="",e){return[St.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),Kr.configure(Gr),Lt.configure({placeholder:t}),en,vt,Mt.configure({nested:!0}),Zr,Mr,mn,Ar,...e?[jr(e)]:[],yr.configure({markedOptions:{breaks:!0}})]}const Qr=/^(\s*)([-*+]|\d+[.)])\s+\S/,Xr=/^\s*(```|~~~)/,Vr=/^\s+(?![-*+>#]|\d+[.)]\s)\S/;function Jr(t){const e=[];let n=!1,s=!1;for(const r of t.split(`
|
|
68
|
+
`)){if(Xr.test(r)){n=!n,s=!1,e.push(r);continue}if(n){e.push(r);continue}if(Qr.test(r)){s=!0,e.push(r);continue}if(!r.trim()){s=!1,e.push(r);continue}if(s&&Vr.test(r)){e[e.length-1]=`${e[e.length-1]} ${r.trim()}`;continue}s=!1,e.push(r)}return e.join(`
|
|
69
|
+
`)}function Yr(t){const e=$.c(12),{onFiles:n,disabled:s}=t,r=j(),a=_.useRef(null);let i;e[0]!==r?(i=r("markdownEditor.attachFile"),e[0]=r,e[1]=i):i=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>a.current?.click(),o=f.jsx(Bt,{size:16}),e[2]=l,e[3]=o):(l=e[2],o=e[3]);let h;e[4]!==s||e[5]!==i?(h=f.jsx(an,{type:"button",label:i,disabled:s,onClick:l,children:o}),e[4]=s,e[5]=i,e[6]=h):h=e[6];let c;e[7]!==n?(c=f.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",onChange:p=>{const d=Array.from(p.target.files??[]);p.target.value="",d.length>0&&n(d)}}),e[7]=n,e[8]=c):c=e[8];let u;return e[9]!==h||e[10]!==c?(u=f.jsxs(f.Fragment,{children:[h,c]}),e[9]=h,e[10]=c,e[11]=u):u=e[11],u}function es(t){const e=$.c(6),{pending:n}=t,s=j();if(n===0)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=f.jsx(De,{className:"size-3"}),e[0]=r):r=e[0];let a;e[1]!==n||e[2]!==s?(a=n===1?s("markdownEditor.uploading"):s("markdownEditor.uploadingCount",{count:String(n)}),e[1]=n,e[2]=s,e[3]=a):a=e[3];let i;return e[4]!==a?(i=f.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[r,a]}),e[4]=a,e[5]=i):i=e[5],i}const ts=["outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-3 [&_p]:leading-[1.5]","[&_h1]:my-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-[1.5] [&_h1]:text-foreground","[&_h2]:my-3 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-[1.5] [&_h2]:text-foreground","[&_h3]:my-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-[1.5] [&_h3]:text-foreground","[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-sm","[&_pre_code]:bg-transparent [&_pre_code]:p-0",$t,"[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold [&_strong]:text-foreground","[&_table]:my-3 [&_table]:w-full [&_table]:table-fixed [&_table]:border-collapse","[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold","[&_td]:border [&_td]:border-border [&_td]:p-2 [&_td]:align-top","[&_th>p]:my-0 [&_td>p]:my-0","[&_ul[data-type=taskList]]:my-3 [&_ul[data-type=taskList]]:list-none [&_ul[data-type=taskList]]:pl-0","[&_li[data-type=taskItem]]:flex [&_li[data-type=taskItem]]:items-start [&_li[data-type=taskItem]]:gap-2","[&_li[data-type=taskItem]>label]:mt-1 [&_li[data-type=taskItem]>label]:shrink-0","[&_li[data-type=taskItem]>div]:min-w-0 [&_li[data-type=taskItem]>div>p]:my-0"].join(" "),ns=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function rs(t){const e=$.c(10),{editor:n,mentions:s}=t,r=s.items;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["markdown-editor-mentions"],e[0]=a):a=e[0];let i;e[1]!==r?(i=h=>{const{query:c}=h,u=c.trim().toLowerCase();return Promise.resolve(u?r.filter(p=>`${p.name} ${p.title??""}`.toLowerCase().includes(u)):r)},e[1]=r,e[2]=i):i=e[2];let l;e[3]!==n?(l=h=>{const{range:c,item:u}=h;n.chain().focus().insertContentAt(c,[{type:"text",text:`@${u.name}`,marks:u.href?[{type:"link",attrs:{href:u.href}}]:void 0},{type:"text",text:" "}]).run()},e[3]=n,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==s.emptyLabel||e[7]!==i||e[8]!==l?(o=f.jsx(It,{editor:n,char:"@",pluginKey:"markdownMentionMenu",queryKey:a,queryFn:i,emptyLabel:s.emptyLabel,renderItem:ss,onSelect:l}),e[5]=n,e[6]=s.emptyLabel,e[7]=i,e[8]=l,e[9]=o):o=e[9],o}function ss(t){return f.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsx("span",{className:"truncate font-medium",children:t.title??t.name}),t.description&&f.jsx("span",{className:"line-clamp-1 text-xs text-muted-foreground",children:t.description})]})}function xs({defaultValue:t,onChange:e,placeholder:n,editable:s=!0,attachments:r=!0,mentions:a,inline:i=!1}){const l=wn(r),[o]=_.useState(()=>new Ir),h=_.useRef(e);h.current=e;const c=Et({extensions:Wr(n,a?void 0:o),content:Jr(t),contentType:"markdown",editable:s,autofocus:i?"end":!1,editorProps:{attributes:{role:"textbox","aria-label":n??"","aria-multiline":"true",class:B(ts,!i&&"min-h-[200px] sm:min-h-[320px]",ns)},handlePaste:l.handlePaste,handleDrop:l.handleDrop},onUpdate:({editor:u,transaction:p})=>{p.docChanged&&h.current(u.getMarkdown())}});return c?f.jsxs("div",{className:"flex flex-col",children:[f.jsx(cn,{editor:c}),!a&&f.jsx(Dr,{store:o}),f.jsx(At,{editor:c,className:B(i?"text-sm text-foreground":"text-base text-muted-foreground")}),s&&a&&f.jsx(rs,{editor:c,mentions:a}),f.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground empty:mt-0",children:[s&&a?.hint&&f.jsx("span",{children:a.hint}),s&&r&&f.jsx(Yr,{onFiles:u=>l.uploadInto(c.view,u,c.state.selection.to)}),f.jsx(es,{pending:l.pending})]})]}):null}export{Yr as A,Ir as M,mn as U,Ar as a,yr as b,Zr as c,Mr as d,Te as e,Dr as f,es as g,xs as h,jr as m,wn as u};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{N as P,r as De,c as k,R as Ie,t as Pe,v as se,w as E,x as Oe,T as H,y as je,z as M,A as L,B as ve,D as Q,G as Z,H as Fe,I as _e,J as Ve,K as Ke,L as q,f as Xe}from"./usage-stats-CLMr8vHI.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
|
|
2
|
+
`).map(t=>!t.includes("|")||!t.includes("`")?t:ln(t)).join(`
|
|
3
|
+
`)}function sn(e){return(e||"").replace(/\s+/g," ").trim()}function cn(e,t,n={}){var o;const l=(o=n.cellLineSeparator)!==null&&o!==void 0?o:"";if(!e||!e.content||e.content.length===0)return"";const r=[];e.content.forEach(h=>{const g=[];h.content&&h.content.forEach(m=>{let w="";m.content&&Array.isArray(m.content)&&m.content.length>1?w=m.content.map(R=>t.renderChildren(R)).join(l):w=m.content?t.renderChildren(m.content):"";const S=sn(w.split(l).join(`
|
|
4
|
+
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=m.type==="tableHeader",A=qt(m.attrs);g.push({text:S,isHeader:y,align:A})}),r.push(g)});const s=r.reduce((h,g)=>Math.max(h,g.length),0);if(s===0)return"";const c=Array.from({length:s}).fill(0);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;const w=(((g=h[m])===null||g===void 0?void 0:g.text)||"").length;w>c[m]&&(c[m]=w),c[m]<3&&(c[m]=3)}});const i=(h,g)=>h+" ".repeat(Math.max(0,g-h.length)),a=r[0],d=a.some(h=>h.isHeader),u=Array.from({length:s}).fill(null);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;!u[m]&&(!((g=h[m])===null||g===void 0)&&g.align)&&(u[m]=h[m].align)}});let f=`
|
|
5
|
+
`;const p=Array.from({length:s}).map((h,g)=>d&&a[g]&&a[g].text||"");return f+=`| ${p.map((h,g)=>i(h,c[g])).join(" | ")} |
|
|
6
|
+
`,f+=`| ${c.map((h,g)=>{const m=Math.max(3,h),w=u[g];return w==="left"?`:${"-".repeat(m)}`:w==="right"?`${"-".repeat(m)}:`:w==="center"?`:${"-".repeat(m)}:`:"-".repeat(m)}).join(" | ")} |
|
|
7
|
+
`,(d?r.slice(1):r).forEach(h=>{f+=`| ${Array.from({length:s}).fill(0).map((g,m)=>i(h[m]&&h[m].text||"",c[m])).join(" | ")} |
|
|
8
|
+
`}),f}const an=P.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Zt,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:o,tableMinWidth:l}=en(e,this.options.cellMinWidth),r=t.style;function s(){return r||(o?`width: ${o}`:`min-width: ${l}`)}const c=["table",k(this.options.HTMLAttributes,t,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},c]:c},parseMarkdown:(e,t)=>{const n=[],o=Array.isArray(e.align)?e.align:[];if(e.header){const l=[];e.header.forEach((r,s)=>{var c;const i=U((c=o[s])!==null&&c!==void 0?c:r.align),a=i?{align:i}:{};l.push(t.createNode("tableHeader",a,[{type:"paragraph",content:t.parseInline(r.tokens)}]))}),n.push(t.createNode("tableRow",{},l))}return e.rows&&e.rows.forEach(l=>{const r=[];l.forEach((s,c)=>{var i;const a=U((i=o[c])!==null&&i!==void 0?i:s.align),d=a?{align:a}:{};r.push(t.createNode("tableCell",d,[{type:"paragraph",content:t.parseInline(s.tokens)}]))}),n.push(t.createNode("tableRow",{},r))}),t.createNode("table",void 0,n)},renderMarkdown:(e,t)=>cn(e,t),markdownTokenizer:{name:"table",level:"block",start:e=>{const t=e.split(`
|
|
9
|
+
`);if(t.length<2)return-1;const n=t[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes("|")?-1:t[0].includes("|")?0:-1},tokenize(e,t,n){const o=e.indexOf(`
|
|
10
|
+
|
|
11
|
+
`),l=o>=0?e.slice(0,o):e,r=l.split(`
|
|
12
|
+
`);if(r.length<2)return;const s=r[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;const c=rn(l);if(c===l)return;const i=n.blockTokens(c)[0];if(i?.type!=="table"||!i.raw)return;const a=i.raw.split(`
|
|
13
|
+
`).length,d=e.split(`
|
|
14
|
+
`).slice(0,a).join(`
|
|
15
|
+
`);return{...i,raw:d}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:o,dispatch:l,editor:r})=>{const s=nn(r.schema,e,t,n);if(l){const c=o.selection.from+1;o.replaceSelectionWith(s).scrollIntoView().setSelection(H.near(o.doc.resolve(c)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>dt(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>ut(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{const n=q(e.selection.$from,o=>o.type.name==="table");return ht(e,t&&(o=>{n&&Se(o,n.pos),t(o)}))},addRowBefore:()=>({state:e,dispatch:t})=>mt(e,t),addRowAfter:()=>({state:e,dispatch:t})=>gt(e,t),deleteRow:()=>({state:e,dispatch:t})=>{const n=q(e.selection.$from,o=>o.type.name==="table");return bt(e,t&&(o=>{n&&Se(o,n.pos),t(o)}))},deleteTable:()=>({state:e,dispatch:t})=>xt(e,t),mergeCells:()=>({state:e,dispatch:t})=>ae(e,t),splitCell:()=>({state:e,dispatch:t})=>de(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>I("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>I("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>vt(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>ae(e,t)?!0:de(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:o})=>At(e,t)(n,o),goToNextCell:()=>({state:e,dispatch:t})=>fe(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>fe(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&ze(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const o=b.create(t.doc,e.anchorCell,e.headCell);t.setSelection(o)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Wt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Kt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:n,view:o,HTMLAttributes:l})=>{const r=k(this.options.HTMLAttributes,l);return new t(n,this.options.cellMinWidth,o,r)}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Ve(Ke(e,"tableRole",t))}}}),hn=Xe.create({name:"tableKit",addExtensions(){const e=[];return this.options.table!==!1&&e.push(an.configure(this.options.table)),this.options.tableCell!==!1&&e.push(Gt.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(Yt.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(Qt.configure(this.options.tableRow)),e}});export{b as C,hn as T,un as s};
|