@seungyeop-lee/beads-desk 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +50 -50
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +5 -5
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/(client)/board/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/board/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/board/page.js +18 -18
- package/.next/server/app/(client)/board/page.js.nft.json +1 -1
- package/.next/server/app/(client)/board/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(client)/decisions/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/decisions/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/decisions/page.js +18 -18
- package/.next/server/app/(client)/decisions/page.js.nft.json +1 -1
- package/.next/server/app/(client)/decisions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(client)/epics/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/epics/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/epics/page.js +18 -18
- package/.next/server/app/(client)/epics/page.js.nft.json +1 -1
- package/.next/server/app/(client)/epics/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(client)/focus/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/focus/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/focus/page.js +18 -18
- package/.next/server/app/(client)/focus/page.js.nft.json +1 -1
- package/.next/server/app/(client)/focus/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(client)/graph/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/graph/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/graph/page.js +18 -18
- package/.next/server/app/(client)/graph/page.js.nft.json +1 -1
- package/.next/server/app/(client)/graph/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(client)/human/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/human/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/human/page.js +18 -18
- package/.next/server/app/(client)/human/page.js.nft.json +1 -1
- package/.next/server/app/(client)/human/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(client)/hygiene/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/hygiene/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/hygiene/page.js +18 -18
- package/.next/server/app/(client)/hygiene/page.js.nft.json +1 -1
- package/.next/server/app/(client)/hygiene/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(client)/issues/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/issues/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/issues/page.js +18 -18
- package/.next/server/app/(client)/issues/page.js.nft.json +1 -1
- package/.next/server/app/(client)/issues/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(client)/page/build-manifest.json +4 -4
- package/.next/server/app/(client)/page/server-reference-manifest.json +16 -16
- package/.next/server/app/(client)/page.js +19 -19
- package/.next/server/app/(client)/page.js.nft.json +1 -1
- package/.next/server/app/(client)/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(server)/api/board/route.js +6 -6
- package/.next/server/app/(server)/api/board/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/decisions/route.js +6 -6
- package/.next/server/app/(server)/api/decisions/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/epics/[id]/descendants/route.js +6 -6
- package/.next/server/app/(server)/api/epics/[id]/descendants/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/epics/route.js +6 -6
- package/.next/server/app/(server)/api/epics/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/events/route.js +4 -4
- package/.next/server/app/(server)/api/events/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/gates/route/app-paths-manifest.json +3 -0
- package/.next/server/app/(server)/api/gates/route/build-manifest.json +12 -0
- package/.next/server/app/(server)/api/gates/route/server-reference-manifest.json +4 -0
- package/.next/server/app/(server)/api/gates/route.js +10 -0
- package/.next/server/app/(server)/api/gates/route.js.nft.json +1 -0
- package/.next/server/app/(server)/api/gates/route_client-reference-manifest.js +3 -0
- package/.next/server/app/(server)/api/graph/route.js +6 -6
- package/.next/server/app/(server)/api/graph/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/health/route.js +6 -6
- package/.next/server/app/(server)/api/health/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/human-decisions/count/route.js +6 -6
- package/.next/server/app/(server)/api/human-decisions/count/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/human-gates/[id]/previous-gates/route.js +6 -6
- package/.next/server/app/(server)/api/human-gates/[id]/previous-gates/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/human-gates/route.js +6 -6
- package/.next/server/app/(server)/api/human-gates/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/hygiene/route.js +6 -6
- package/.next/server/app/(server)/api/hygiene/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/hygiene/stale/route.js +6 -6
- package/.next/server/app/(server)/api/hygiene/stale/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/issue-search/route.js +6 -6
- package/.next/server/app/(server)/api/issue-search/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/issues/[id]/history/route.js +6 -6
- package/.next/server/app/(server)/api/issues/[id]/history/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/issues/[id]/route.js +6 -6
- package/.next/server/app/(server)/api/issues/[id]/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/issues/route.js +6 -6
- package/.next/server/app/(server)/api/issues/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/local-files/route.js +6 -6
- package/.next/server/app/(server)/api/local-files/route.js.nft.json +1 -1
- package/.next/server/app/(server)/api/workspaces/route.js +6 -6
- package/.next/server/app/(server)/api/workspaces/route.js.nft.json +1 -1
- package/.next/server/app/_global-error/page/build-manifest.json +4 -4
- package/.next/server/app/_global-error/page.js +10 -10
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +8 -8
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/_global-error.segments/_full.segment.rsc +8 -8
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +4 -4
- package/.next/server/app/_not-found/page.js +14 -14
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +9 -9
- package/.next/server/app/_not-found.segments/_full.segment.rsc +9 -9
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/icon/route.js +5 -5
- package/.next/server/app/icon/route.js.nft.json +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/{0-na_next_dist_01oqa_lnmf7od._.js → 05qx_next_dist_184ptjjtlkg71._.js} +8 -8
- package/.next/server/chunks/0ysl_app__next-internal_server_app_(server)_api_gates_route_actions_0sav8gq22t2ur.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1-ofbxlienucb._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__00jsp_c83rs0d._.js → [root-of-the-server]__1qazo8i1ki7mc._.js} +3 -3
- package/.next/server/chunks/[root-of-the-server]__1x--zgen0f3x2._.js +5 -0
- package/.next/server/chunks/_02on37540o8hj._.js +3 -0
- package/.next/server/chunks/_04uhe7wc36edj._.js +3 -0
- package/.next/server/chunks/_06poqmo_9segb._.js +3 -0
- package/.next/server/chunks/_09qnp2-yd8sqg._.js +3 -0
- package/.next/server/chunks/{_0lg6l5x123jq2._.js → _0aewum0lafyu6._.js} +2 -2
- package/.next/server/chunks/_0g6qhsq0oh9f2._.js +3 -0
- package/.next/server/chunks/{_0hprt7v9m-j0-._.js → _0k0r17-hivf0b._.js} +2 -2
- package/.next/server/chunks/_0o6dnk9ppyhej._.js +3 -0
- package/.next/server/chunks/_0r96-_atd0of6._.js +3 -0
- package/.next/server/chunks/_0twtmmk6vrjgn._.js +3 -0
- package/.next/server/chunks/_0yr16743_vxl0._.js +3 -0
- package/.next/server/chunks/_0yrm94e-wxgvg._.js +3 -0
- package/.next/server/chunks/_1-81r7_12i_t3._.js +3 -0
- package/.next/server/chunks/_1_q4qbqvbyeo3._.js +3 -0
- package/.next/server/chunks/_1h203upt35re2._.js +3 -0
- package/.next/server/chunks/_1kji36mlzsk7a._.js +3 -0
- package/.next/server/chunks/_1kpi1pid8s0jq._.js +3 -0
- package/.next/server/chunks/_1or695q1uaeye._.js +3 -0
- package/.next/server/chunks/_1vml9a-7hqonb._.js +10 -0
- package/.next/server/chunks/_1wvz7lwt8c493._.js +3 -0
- package/.next/server/chunks/packages_app_src_server_infra_runtime_serverRuntime_ts_0nr1il1nd01xh._.js +1 -1
- package/.next/server/chunks/ssr/05qx_next_dist_0auumeme_jnci._.js +6 -0
- package/.next/server/chunks/ssr/{0-na_next_dist_11o-i8zo8w04f._.js → 05qx_next_dist_0la4kajft916f._.js} +7 -7
- package/.next/server/chunks/ssr/05qx_next_dist_0s0gfw_jqnu4j._.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_1hzbynyjdvvow._.js +3 -0
- package/.next/server/chunks/ssr/{0-na_next_dist_client_components_12rpdkf4u6sxc._.js → 05qx_next_dist_client_components_1nkeds0hti7te._.js} +2 -2
- package/.next/server/chunks/ssr/05qx_next_dist_client_components_builtin_1t-3jg9n15ebj._.js +33 -0
- package/.next/server/chunks/ssr/05qx_next_dist_client_components_builtin_forbidden_0q2qgqciumfnu.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_client_components_builtin_unauthorized_0o24jwhymhb-n.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_compiled_02c5g16i9tcv1._.js +3 -0
- package/.next/server/chunks/ssr/{0-na_next_dist_compiled_@edge-runtime_cookies_index_1w1mtde4yx_m_.js → 05qx_next_dist_compiled_@edge-runtime_cookies_index_05bbw1jw69yw0.js} +2 -2
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_0ds48qyk03c12.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_0j94lzdzvjpkm.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_13yild_1irzc5.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_15h35o6jai3rd.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_17j0sapd43lno.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_18o721daqsoz_.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_1i5rl48p9g02m.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_1kguvhbrw2hgc.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_1ouhezcfk6vix.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_1v01wrk-q17mq.js +3 -0
- package/.next/server/chunks/ssr/05qx_next_dist_esm_build_templates_app-page_1xxnbb6yc9npm.js +3 -0
- package/.next/server/chunks/ssr/{044y_@milkdown_crepe_lib_esm_builder_1q1p-aoo5ansr.js → 0d0f_@milkdown_crepe_lib_esm_builder_06muytl9h7gti.js} +2 -2
- package/.next/server/chunks/ssr/0d0f_@milkdown_crepe_lib_esm_feature_code-mirror_index_18a-rj6e8cet7.js +92 -0
- package/.next/server/chunks/ssr/{044y_@milkdown_crepe_lib_esm_feature_cursor_index_17hai-ps4gy4m.js → 0d0f_@milkdown_crepe_lib_esm_feature_cursor_index_1xb894r2isgpe.js} +2 -2
- package/.next/server/chunks/ssr/{044y_@milkdown_crepe_lib_esm_feature_link-tooltip_index_1k2_en72b30f7.js → 0d0f_@milkdown_crepe_lib_esm_feature_link-tooltip_index_0p7e_xlz06wlw.js} +2 -2
- package/.next/server/chunks/ssr/{044y_@milkdown_crepe_lib_esm_feature_list-item_index_0739hwl0ixqj0.js → 0d0f_@milkdown_crepe_lib_esm_feature_list-item_index_0srjq3nd94sv_.js} +3 -3
- package/.next/server/chunks/ssr/{044y_@milkdown_crepe_lib_esm_feature_table_index_1nc604l0he98t.js → 0d0f_@milkdown_crepe_lib_esm_feature_table_index_1q3bkvsxx3gmj.js} +3 -3
- package/.next/server/chunks/ssr/{044y_@milkdown_crepe_lib_esm_feature_toolbar_index_0cjy552j1ozb9.js → 0d0f_@milkdown_crepe_lib_esm_feature_toolbar_index_20d8pxp74xqfo.js} +3 -3
- package/.next/server/chunks/ssr/{04q__@milkdown_utils_lib_index_20ji0hxjb6f0c.js → 0tj8_@milkdown_utils_lib_index_13cvivb6venod.js} +2 -2
- package/.next/server/chunks/ssr/{1tr6_@milkdown_preset-commonmark_lib_index_1jsr6pxdnfhq4.js → 0w5i_@milkdown_preset-commonmark_lib_index_10ba6w5gyra6g.js} +2 -2
- package/.next/server/chunks/ssr/0ysl_app_src_client_ui_screens_humanDecisions_HumanDecisionsScreen_tsx_1q9b8qom_7y1u._.js +1 -1
- package/.next/server/chunks/ssr/{1-u6_katex_dist_katex_mjs_09t3q2al91qhp._.js → 1-u6_katex_dist_katex_mjs_13edkqm6t1q3b._.js} +1 -1
- package/.next/server/chunks/ssr/{1bjv_@milkdown_preset-gfm_lib_index_04pvj1u0oclag.js → 1a3a_@milkdown_preset-gfm_lib_index_1vk3jpxc25ee8.js} +2 -2
- package/.next/server/chunks/ssr/{214e_@milkdown_kit_lib_prose_state_0eq9g8z4xeh-u.js → 1jrj_@milkdown_kit_lib_prose_state_1j_uy430849tn.js} +2 -2
- package/.next/server/chunks/ssr/{0jby_remark-gfm_lib_index_0yd1x-xt5kcpe.js → 1k4e_remark-gfm_lib_index_06is2myg8lnri.js} +2 -2
- package/.next/server/chunks/ssr/{0tee_@milkdown_components_lib_link-tooltip_index_0_yn-0wcgrhst.js → 1ozf_@milkdown_components_lib_link-tooltip_index_1hvyp99q423_o.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__00gr3qyd8-dvb._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__1iimaf2bu0424._.js → [root-of-the-server]__052ivr1bj6h3m._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__1o26vr103y40w._.js → [root-of-the-server]__06h77zv80-8m-._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__08kvicm61y4u1._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__09lymwel_or87._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__076i3q845sw_f._.js → [root-of-the-server]__09zwmtvmbni_5._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__1859jwyl-0dyv._.js → [root-of-the-server]__0b1bu_rn1ltd8._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0of5i1kim-02t._.js → [root-of-the-server]__0eit2e7039z0p._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0hogoguacz8ur._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0sh5kpcrtscul._.js → [root-of-the-server]__0jl-8k-kdry0z._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0tygv-zuxlxc7._.js → [root-of-the-server]__0l7bvadwyl9pk._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0q3r5zcq1nq-l._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0spx3hluw-kou._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0u_5idffbe8e2._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0vmd5kxnst7_n._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__08_dlsgm45li_._.js → [root-of-the-server]__0xgp-w0xnnk40._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__14mo0eg108qyc._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__14vsuap94qdvv._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0y8_n69fn3dcz._.js → [root-of-the-server]__161u6tbhzyxvh._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0azxp5zozje9_._.js → [root-of-the-server]__18wfno_vh8-kq._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1at64e6zbwoan._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__09lybaidp4ytp._.js → [root-of-the-server]__1cfmhdear73jb._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0qvsu-225ae-9._.js → [root-of-the-server]__1cle6bds9k0xg._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1gxuu885zb7rn._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1i-khow6d_8_4._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1iil9wste8hko._.js +14 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1ox3l2713bqq8._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1qg27t6-twvk1._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1r0lv_nd2c9rc._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0u-oy5lhckmao._.js → [root-of-the-server]__1vfzwf-7au9_n._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0tshst3064nz2._.js → [root-of-the-server]__1yp4oqy24gton._.js} +2 -2
- package/.next/server/chunks/ssr/_00u85u5a1h8o6._.js +1 -1
- package/.next/server/chunks/ssr/_05on_wt1huo7_._.js +3 -0
- package/.next/server/chunks/ssr/{_18sy10caq_3xy._.js → _0_7umkn7p7olg._.js} +3 -3
- package/.next/server/chunks/ssr/_0as6zbu4ir8qr._.js +3 -0
- package/.next/server/chunks/ssr/_0xb68euaes2ir._.js +25 -0
- package/.next/server/chunks/ssr/_0xvw-2qcgrfc_._.js +299 -0
- package/.next/server/chunks/ssr/_1jtb1or9alij4._.js +3 -0
- package/.next/server/chunks/ssr/_1slk-hkdgtggu._.js +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_1nyoq9twng2wo._.js → node_modules__pnpm_00v6u4xorvx1u._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_00g26sbhm2qr8._.js → node_modules__pnpm_02h2jt06fdr_i._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules__pnpm_0du4dffjinahl._.js → node_modules__pnpm_04y8w7l_lkxkq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_04fd_yhkpujoe._.js → node_modules__pnpm_04zbf0s1mg-jk._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules__pnpm_1_i3oawxylmn8._.js → node_modules__pnpm_086313lwbkefv._.js} +3 -3
- package/.next/server/chunks/ssr/{node_modules__pnpm_1sd1boa0gva3j._.js → node_modules__pnpm_087okf97ps5hu._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules__pnpm_0bh_u1hzr_k9b._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules__pnpm_0kiaaocx_r38o._.js → node_modules__pnpm_0cw1sn39f7ipd._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_0__tvs66hrkj1._.js → node_modules__pnpm_0d5g5z5pw-uk4._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules__pnpm_0f367qx6641jk._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules__pnpm_0w52gu6fi-rer._.js → node_modules__pnpm_0igaqw6c00j23._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_1_0hw--0aak_w._.js → node_modules__pnpm_0lou5rtfyap0z._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_0l2p_8m_pr_pe._.js → node_modules__pnpm_0p0vftztmmoh6._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_1dd1bpb31liq8._.js → node_modules__pnpm_0q0ui45rmz0fr._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_1fblsasq51xzj._.js → node_modules__pnpm_0wmhdj6x4m0s0._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules__pnpm_0nxr_4vwzyim4._.js → node_modules__pnpm_0xaotjpkg4qao._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_1-fjiyetdmmzj._.js → node_modules__pnpm_0z4cezi8rjogm._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_1fmtfej-kjecy._.js → node_modules__pnpm_1630zwvi651i9._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules__pnpm_17jl2q4sdi66z._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules__pnpm_0h9wrjze1unqt._.js → node_modules__pnpm_183txivokpkqz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_0h16tk2cwq36v._.js → node_modules__pnpm_19-kbr_mkaxyx._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules__pnpm_193s_2t5-q4lu._.js +3 -0
- package/.next/server/chunks/ssr/node_modules__pnpm_1ajqvorudjmgk._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules__pnpm_19q-yb_mzzzol._.js → node_modules__pnpm_1axn2zjxin7nf._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_199adbugc26zi._.js → node_modules__pnpm_1hwpxex-sjz90._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_1xnu-1xs6nb5k._.js → node_modules__pnpm_1injkojmxh-ml._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_0do83ll585lrb._.js → node_modules__pnpm_1k3_90gaq0wg7._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_1zgy286fn4qrs._.js → node_modules__pnpm_1mbudsl2qaz35._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules__pnpm_1a_-9rnk37pv_._.js → node_modules__pnpm_1nknzmq2xjlpz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_0h3t5msxq4d8x._.js → node_modules__pnpm_1o220-8_u4-x-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules__pnpm_0bkd7rab1k1ug._.js → node_modules__pnpm_1r7dunb4op2_m._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules__pnpm_1a803tkkqathx._.js → node_modules__pnpm_1wvz0c6z8wodm._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules__pnpm_1jd-wnr4c6ime._.js → node_modules__pnpm_1z75eplnp_uw5._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules__pnpm_20n5vs3e57egd._.js → node_modules__pnpm_20fyrostt4-cj._.js} +1 -1
- package/.next/server/chunks/ssr/packages_app_src_19fv2qm5lpxq1._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_1bc3z770b0d4g._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_client_0g-zs1cjy28nl._.js +3 -0
- package/.next/server/chunks/ssr/packages_app_src_client_1-hnm8frefi_z._.js +3 -0
- package/.next/server/chunks/ssr/packages_app_src_client_1_javrsbc_aq_._.js +3 -0
- package/.next/server/chunks/ssr/packages_app_src_client_ui_1ty1yi51yl_mx._.js +3 -3
- package/.next/server/chunks/ssr/packages_app_src_client_ui_designSystem_16yt2l4h_k0xz._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_client_ui_issues_BlockerLine_tsx_0fvsr74_7eb8n._.js +3 -0
- package/.next/server/chunks/ssr/packages_app_src_client_ui_issues_IssueTable_tsx_1451_aayfauch._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_client_ui_issues_NewIssueDialog_tsx_1_lt839dbbegv._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_client_ui_screens_board_BoardScreen_tsx_0s58uy_mft-qa._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_client_ui_screens_decisions_DecisionsScreen_tsx_1splyy_8-x3pj._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_client_ui_screens_epics_EpicsScreen_tsx_10koyjd4-sokd._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_client_ui_screens_hygiene_HygieneScreen_tsx_0xm43-zl8kmfv._.js +1 -1
- package/.next/server/chunks/ssr/packages_app_src_client_ui_screens_issues_IssuesScreen_tsx_1hjq50yb745mo._.js +1 -1
- package/.next/server/edge/chunks/{1_n6_next_dist_esm_build_templates_edge-wrapper_139ztfeu83dtf.js → 02gm_next_dist_esm_build_templates_edge-wrapper_0cn1ef9fqzvnl.js} +2 -2
- package/.next/server/edge/chunks/{_0h7un2lf5xhnc._.js → _1_b9xkrda1k5s._.js} +2 -2
- package/.next/server/instrumentation/middleware-manifest.json +2 -2
- package/.next/server/middleware-build-manifest.js +50 -50
- package/.next/server/middleware.js +3 -3
- package/.next/server/middleware.js.nft.json +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +17 -17
- package/.next/static/chunks/{0qz60578fkr7_.js → 0272-d4ex88fl.js} +1 -1
- package/.next/static/chunks/{0cabbhqjiz224.js → 02p8ll7_n2_ri.js} +1 -1
- package/.next/static/chunks/{2863d6hg7_88-.js → 08_9rbv1ks1ey.js} +1 -1
- package/.next/static/chunks/09p-ekirrh5s6.js +1 -0
- package/.next/static/chunks/{0m673ey220fls.js → 0_rd3y3k7mnm9.js} +1 -1
- package/.next/static/chunks/0e-fvv1ix6nbj.js +1 -0
- package/.next/static/chunks/{084ej6i9qw54j.js → 0lg7y_ivemk1g.js} +1 -1
- package/.next/static/chunks/{227mhvflnjadl.js → 0q9idviqnkka_.js} +1 -1
- package/.next/static/chunks/{3ecfeqjbabub5.js → 0sefn6j9lobdh.js} +7 -7
- package/.next/static/chunks/{3ag_d1w8ai1dy.js → 0x_4dkgoq2x17.js} +1 -1
- package/.next/static/chunks/15ukz5ursv_c4.js +90 -0
- package/.next/static/chunks/16scd9j8t4pm6.js +1 -0
- package/.next/static/chunks/17-tksqovtok2.js +1 -0
- package/.next/static/chunks/175ye17hz03qm.js +74 -0
- package/.next/static/chunks/{322qb_kay6_dh.js → 1b7bn3-wh-scs.js} +1 -1
- package/.next/static/chunks/{0w12by1gms55l.js → 1esceuzes2qas.js} +1 -1
- package/.next/static/chunks/{20atsxy3rjjrd.js → 1hnmjsdt-73v4.js} +1 -1
- package/.next/static/chunks/1htn2_jw0oqek.js +1 -0
- package/.next/static/chunks/1i3-4r53x1s8t.js +1 -0
- package/.next/static/chunks/1mgyda7xrgxp3.js +22 -0
- package/.next/static/chunks/1pegyin52x7dm.js +53 -0
- package/.next/static/chunks/{0lhbxb-hxh-9z.js → 1qfei1aefzuoz.js} +1 -1
- package/.next/static/chunks/1ys_6vjnz-7ah.js +1 -0
- package/.next/static/chunks/{044ya20hr6lpq.js → 2-poyy6mlraub.js} +1 -1
- package/.next/static/chunks/20y_iirdx6vp1.js +1 -0
- package/.next/static/chunks/22hgo8z-yg_pu.js +9 -0
- package/.next/static/chunks/22vcgnff2q8rd.js +1 -0
- package/.next/static/chunks/293yn-85k60_m.js +88 -0
- package/.next/static/chunks/2clsk6eipaspq.js +1 -0
- package/.next/static/chunks/2cvm9hv0lg9oq.js +1 -0
- package/.next/static/chunks/{3cza5dvg2076b.js → 2gaouhmoltd17.js} +1 -1
- package/.next/static/chunks/2gh948bdx7n4h.js +1 -0
- package/.next/static/chunks/2iqgac4dnds7z.js +1 -0
- package/.next/static/chunks/2qf-bx4e18s1-.js +1 -0
- package/.next/static/chunks/2wbmm--h8psma.js +1 -0
- package/.next/static/chunks/{2v2lltug-e2as.js → 2wpjv_5b94qrf.js} +3 -3
- package/.next/static/chunks/2wxi7f5qhk5ro.js +31 -0
- package/.next/static/chunks/390-bqvvvti8m.js +1 -0
- package/.next/static/chunks/{2l4j_87dswys4.js → 39m-unkvi03vf.js} +1 -1
- package/.next/static/chunks/3_b59-f87szqi.js +1 -0
- package/.next/static/chunks/{2ejaecoye9ub2.js → 3_iky7rejspzx.js} +1 -1
- package/.next/static/chunks/3cl6bui_jv091.js +1 -0
- package/.next/static/chunks/{3-w21-v3xw7xl.js → 3g16auece-_2l.js} +1 -1
- package/.next/static/chunks/3gjd3n0fvrlgn.js +1 -0
- package/.next/static/chunks/{30b1f7z6m_g2o.js → 3ka0lm_biw9ez.js} +1 -1
- package/.next/static/chunks/{15ajhna3p_jbl.js → 3ooucquz27jxs.js} +1 -1
- package/.next/static/chunks/3wm8k3ecexl1t.js +1 -0
- package/.next/static/chunks/{14r9tx1ylqkdd.js → 3x-p-ucgyytks.js} +1 -1
- package/.next/static/chunks/{0zja4_p14i1p8.js → 3zc---1if5pr8.js} +1 -1
- package/.next/static/chunks/40swn-dd2k1ts.js +1 -0
- package/README.ko.md +4 -2
- package/README.md +4 -2
- package/package.json +1 -1
- package/.next/server/chunks/[root-of-the-server]__11bvqbes4g_x3._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__20ro7mv0nna0v._.js +0 -3
- package/.next/server/chunks/_00b94jqphddy1._.js +0 -3
- package/.next/server/chunks/_016uu1siddgx2._.js +0 -3
- package/.next/server/chunks/_06bsii67q7yo6._.js +0 -3
- package/.next/server/chunks/_0i562xm36lquh._.js +0 -3
- package/.next/server/chunks/_0lx-opy56s5c6._.js +0 -3
- package/.next/server/chunks/_0qbf8y587q6bu._.js +0 -3
- package/.next/server/chunks/_0rm-wc2vo3piv._.js +0 -3
- package/.next/server/chunks/_0s7zs7vzx_ylx._.js +0 -3
- package/.next/server/chunks/_0xwu00a8s2-yg._.js +0 -3
- package/.next/server/chunks/_0y6_en0_cs0o3._.js +0 -3
- package/.next/server/chunks/_102aj9ahpwc9u._.js +0 -10
- package/.next/server/chunks/_11katfvzfhpy9._.js +0 -3
- package/.next/server/chunks/_15u7zxu6y0q9w._.js +0 -3
- package/.next/server/chunks/_1cr-1ah3asieh._.js +0 -3
- package/.next/server/chunks/_1is_u1uzjetxm._.js +0 -3
- package/.next/server/chunks/_1pmfwik0sv_fj._.js +0 -3
- package/.next/server/chunks/_2155dycg7481k._.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_0v22fkgl1dei7._.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_167mi2pg1epou._.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_1obel6la6bfir._.js +0 -6
- package/.next/server/chunks/ssr/0-na_next_dist_client_components_builtin_1iah_ms13r9-a._.js +0 -33
- package/.next/server/chunks/ssr/0-na_next_dist_client_components_builtin_forbidden_1tn71dj7nsmm9.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_client_components_builtin_unauthorized_1v356ydmzbedc.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_compiled_0u74mrfe4mo1d._.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_05wl45qgcqk39.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_08-b4uarsqzff.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_09wp5x9z70ftx.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_0j7iske5kstio.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_17w6wwo4xnm32.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_1bu5t180bl2zv.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_1mv7fkhdbene9.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_1o0u8v-gnw2rq.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_1rvza4ou0v1-n.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_1xbwpw2s40so0.js +0 -3
- package/.next/server/chunks/ssr/0-na_next_dist_esm_build_templates_app-page_21bi4df-u6lk_.js +0 -3
- package/.next/server/chunks/ssr/044y_@milkdown_crepe_lib_esm_feature_code-mirror_index_060e1a7cm58y2.js +0 -92
- package/.next/server/chunks/ssr/[root-of-the-server]__02u9f32ry284v._.js +0 -14
- package/.next/server/chunks/ssr/[root-of-the-server]__03fd40g3mm6_p._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__068ixxdaa5ac8._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0yx3-boz833my._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0zob21vm-qus-._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1l1qy81q6o38c._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1l5v10nlz9ydv._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1rhtswovlx559._.js +0 -3
- package/.next/server/chunks/ssr/_06n6aoyvk4v8d._.js +0 -3
- package/.next/server/chunks/ssr/_0xpnl68zms_u4._.js +0 -25
- package/.next/server/chunks/ssr/_1gjuc1gubpwo8._.js +0 -3
- package/.next/server/chunks/ssr/_1oeap-f-o07w3._.js +0 -299
- package/.next/server/chunks/ssr/_1pzwyebui89yg._.js +0 -3
- package/.next/server/chunks/ssr/node_modules__pnpm_0-62y689aghse._.js +0 -3
- package/.next/server/chunks/ssr/node_modules__pnpm_00k8x00osl00i._.js +0 -3
- package/.next/server/chunks/ssr/node_modules__pnpm_08vun7__wqvc_._.js +0 -3
- package/.next/server/chunks/ssr/node_modules__pnpm_0qf67-025iumd._.js +0 -3
- package/.next/server/chunks/ssr/node_modules__pnpm_1tun34xzr03al._.js +0 -3
- package/.next/server/chunks/ssr/packages_app_src_client_0pwh_vrm-wymc._.js +0 -3
- package/.next/server/chunks/ssr/packages_app_src_client_0r-n14ighyx-y._.js +0 -3
- package/.next/server/chunks/ssr/packages_app_src_client_1938frqd2y9i8._.js +0 -3
- package/.next/server/chunks/ssr/packages_app_src_client_1al1sum_4am90._.js +0 -3
- package/.next/server/chunks/ssr/packages_app_src_client_1z17i_fpf0hcf._.js +0 -3
- package/.next/static/chunks/08e-n-dvxwrgk.js +0 -1
- package/.next/static/chunks/0ab637ez1hz_2.js +0 -1
- package/.next/static/chunks/0elrnj--45x-p.js +0 -1
- package/.next/static/chunks/0mqwot5nztff2.js +0 -1
- package/.next/static/chunks/0on9azsug3puk.js +0 -74
- package/.next/static/chunks/0s0tbdn2edof5.js +0 -1
- package/.next/static/chunks/1p93o2jvb5khm.js +0 -1
- package/.next/static/chunks/20jkms8tp9cu8.js +0 -1
- package/.next/static/chunks/20zt2omjfov9y.js +0 -1
- package/.next/static/chunks/212bl3le86sf0.js +0 -90
- package/.next/static/chunks/28467g2j8_z52.js +0 -31
- package/.next/static/chunks/2gjhwlah4s7g7.js +0 -9
- package/.next/static/chunks/2i8pc2o3bcjfy.js +0 -1
- package/.next/static/chunks/2lu1_r-7ufue1.js +0 -1
- package/.next/static/chunks/2vlza7qd86k_r.js +0 -1
- package/.next/static/chunks/2y15jhcretd-b.js +0 -1
- package/.next/static/chunks/32k_tipl5eadn.js +0 -1
- package/.next/static/chunks/33g403p6483nz.js +0 -1
- package/.next/static/chunks/33swkxqq98hj-.js +0 -53
- package/.next/static/chunks/345-lv7asgqfe.js +0 -1
- package/.next/static/chunks/38_owsclvyxjn.js +0 -1
- package/.next/static/chunks/3gaptf_l1v4pk.js +0 -22
- package/.next/static/chunks/3gogi06rt5ndf.js +0 -1
- package/.next/static/chunks/3j8hy0m9t_mr-.js +0 -1
- package/.next/static/chunks/3l0wfpq_kkgel.js +0 -1
- package/.next/static/chunks/3mjtba5cz5f6w.js +0 -88
- package/.next/static/chunks/3xkn55zbxtzwn.js +0 -1
- package/.next/static/chunks/3y-01knvv8ugx.js +0 -1
- /package/.next/static/{a1rmmFBl1qMxxHFKx8Vs5 → LOTjYNiSiuGh3o1Qxq5_0}/_buildManifest.js +0 -0
- /package/.next/static/{a1rmmFBl1qMxxHFKx8Vs5 → LOTjYNiSiuGh3o1Qxq5_0}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{a1rmmFBl1qMxxHFKx8Vs5 → LOTjYNiSiuGh3o1Qxq5_0}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,279002,e=>{var t,n=e.i(960707),i=e.i(403010),o=e.i(180569),r=e.i(879302),s=e.i(463001),l=e.i(811774),a=e.i(605938),c=e.i(541681),d=e.i(202008),h=e.i(111092),u=e.i(44376),f=e.i(19040),p=e.i(934471);function m(e,t){return e.meta={package:"@milkdown/core",group:"System",...t},e}var g={text:(e,t,n,i)=>{let o=e.value;return/^[^*_\\]*\s+$/.test(o)?o:n.safe(o,{...i,encode:[]})},strong:(e,t,n,i)=>{let o=e.marker||n.options.strong||"*",r=n.enter("strong"),s=n.createTracker(i),l=s.move(o+o);return l+=s.move(n.containerPhrasing(e,{before:l,after:o,...s.current()})),l+=s.move(o+o),r(),l},emphasis:(e,t,n,i)=>{let o=e.marker||n.options.emphasis||"*",r=n.enter("emphasis"),s=n.createTracker(i),l=s.move(o);return l+=s.move(n.containerPhrasing(e,{before:l,after:o,...s.current()})),l+=s.move(o),r(),l}},y=(0,n.W)({},"editorView"),v=(0,n.W)({},"editorState"),w=(0,n.W)([],"initTimer"),b=(0,n.W)({},"editor"),S=(0,n.W)([],"inputRules"),k=(0,n.W)([],"prosePlugins"),C=(0,n.W)([],"remarkPlugins"),x=(0,n.W)([],"nodeView"),N=(0,n.W)([],"markView"),M=(0,n.W)((0,r.f)().use(i.f).use(o.f),"remark"),D=(0,n.W)({handlers:g,encode:[]},"remarkStringifyOptions"),O=(0,n.P)("ConfigReady");function T(e){let t=t=>(t.record(O),async()=>(await e(t),t.done(O),()=>{t.clearTimer(O)}));return m(t,{displayName:"Config"}),t}var A=(0,n.P)("InitReady");function P(e){let t=t=>(t.inject(b,e).inject(k,[]).inject(C,[]).inject(S,[]).inject(x,[]).inject(N,[]).inject(D,{handlers:g,encode:[]}).inject(M,(0,r.f)().use(i.f).use(o.f)).inject(w,[O]).record(A),async()=>{await t.waitTimers(w);let e=t.get(D);return t.set(M,(0,r.f)().use(i.f).use(o.f,e)),t.done(A),()=>{t.remove(b).remove(k).remove(C).remove(S).remove(x).remove(N).remove(D).remove(M).remove(w).clearTimer(A)}});return m(t,{displayName:"Init"}),t}var E=(0,n.P)("SchemaReady"),V=(0,n.W)([],"schemaTimer"),R=(0,n.W)({},"schema"),I=(0,n.W)([],"nodes"),B=(0,n.W)([],"marks");function z(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var F=e=>(e.inject(R,{}).inject(I,[]).inject(B,[]).inject(V,[A]).record(E),async()=>{await e.waitTimers(V);let t=e.get(M),n=e.get(C).reduce((e,t)=>e.use(t.plugin,t.options),t);e.set(M,n);let i=Object.fromEntries(e.get(I).map(([e,t])=>[e,z(t)])),o=Object.fromEntries(e.get(B).map(([e,t])=>[e,z(t)])),r=new a.B({nodes:i,marks:o});return e.set(R,r),e.done(E),()=>{e.remove(R).remove(I).remove(B).remove(V).clearTimer(E)}});m(F,{displayName:"Schema"});var L=class{constructor(){this.#e=new n.t,this.#t=null,this.setCtx=e=>{this.#t=e},this.chain=()=>{if(null==this.#t)throw(0,s.Y)();let e=this.#t,t=[],n=this.get.bind(this),i={run:()=>{let n=(0,l.J)(...t),i=e.get(y);return n(i.state,i.dispatch,i)},inline:e=>(t.push(e),i),pipe:(function(e,o){let r=n(e);return t.push(r(o)),i}).bind(this)};return i}}#e;#t;get ctx(){return this.#t}create(e,t){let n=e.create(this.#e.sliceMap);return n.set(t),n}get(e){return this.#e.get(e).get()}remove(e){return this.#e.remove(e)}call(e,t){if(null==this.#t)throw(0,s.Y)();let n=this.get(e)(t),i=this.#t.get(y);return n(i.state,i.dispatch,i)}inline(e){if(null==this.#t)throw(0,s.Y)();let t=this.#t.get(y);return e(t.state,t.dispatch,t)}},j=(0,n.W)(new L,"commands"),$=(0,n.W)([E],"commandsTimer"),W=(0,n.P)("CommandsReady"),K=e=>{let t=new L;return t.setCtx(e),e.inject(j,t).inject($,[E]).record(W),async()=>(await e.waitTimers($),e.done(W),()=>{e.remove(j).remove($).clearTimer(W)})};m(K,{displayName:"Commands"});var q=class{constructor(){this.#t=null,this.#n=[],this.setCtx=e=>{this.#t=e},this.add=e=>(this.#n.push(e),()=>{this.#n=this.#n.filter(t=>t!==e)}),this.addObjectKeymap=e=>{let t=[];return Object.entries(e).forEach(([e,n])=>{if("function"==typeof n){let i={key:e,onRun:()=>n};this.#n.push(i),t.push(()=>{this.#n=this.#n.filter(e=>e!==i)})}else this.#n.push(n),t.push(()=>{this.#n=this.#n.filter(e=>e!==n)})}),()=>{t.forEach(e=>e())}},this.addBaseKeymap=()=>{var e;let t=((e=l.v).Backspace=(0,l.J)(u.S,l.b,l._,l.n),e);return this.addObjectKeymap(t)},this.build=()=>{let e={};return this.#n.forEach(t=>{e[t.key]=[...e[t.key]||[],t]}),Object.fromEntries(Object.entries(e).map(([e,t])=>{let n=t.sort((e,t)=>(t.priority??50)-(e.priority??50));return[e,(e,t,i)=>{let o=this.#t;if(null==o)throw(0,s.r)();let r=n.map(e=>e.onRun(o));return(0,l.J)(...r)(e,t,i)}]}))}}#t;#n;get ctx(){return this.#t}},_=(0,n.W)(new q,"keymap"),H=(0,n.W)([E],"keymapTimer"),U=(0,n.P)("KeymapReady"),J=e=>{let t=new q;return t.setCtx(e),e.inject(_,t).inject(H,[E]).record(U),async()=>(await e.waitTimers(H),e.done(U),()=>{e.remove(_).remove(H).clearTimer(U)})},G=(0,n.P)("ParserReady"),Y=()=>{throw(0,s.r)()},Z=(0,n.W)(Y,"parser"),X=(0,n.W)([],"parserTimer"),Q=e=>(e.inject(Z,Y).inject(X,[E]).record(G),async()=>{await e.waitTimers(X);let t=e.get(M),n=e.get(R);return e.set(Z,f.E.create(n,t)),e.done(G),()=>{e.remove(Z).remove(X).clearTimer(G)}});m(Q,{displayName:"Parser"});var ee=(0,n.P)("SerializerReady"),et=(0,n.W)([],"serializerTimer"),en=()=>{throw(0,s.r)()},ei=(0,n.W)(en,"serializer"),eo=e=>(e.inject(ei,en).inject(et,[E]).record(ee),async()=>{await e.waitTimers(et);let t=e.get(M),n=e.get(R);return e.set(ei,f.v.create(n,t)),e.done(ee),()=>{e.remove(ei).remove(et).clearTimer(ee)}});m(eo,{displayName:"Serializer"});var er=(0,n.W)("","defaultValue"),es=(0,n.W)(e=>e,"stateOptions"),el=(0,n.W)([],"editorStateTimer"),ea=(0,n.P)("EditorStateReady");function ec(e,t,n){if("string"==typeof e)return t(e);if("html"===e.type)return a.p.fromSchema(n).parse(e.dom);if("json"===e.type)return a.$.fromJSON(n,e.value);throw(0,s.V)(e)}var ed=new h.PluginKey("MILKDOWN_STATE_TRACKER"),eh=e=>(e.inject(er,"").inject(v,{}).inject(es,e=>e).inject(el,[G,ee,W,U]).record(ea),async()=>{await e.waitTimers(el);let t=e.get(R),n=e.get(Z),i=e.get(S),o=e.get(es),r=e.get(k),s=ec(e.get(er),n,t),l=e.get(_),a=l.addBaseKeymap(),u=[...r,new h.Plugin({key:ed,state:{init:()=>{},apply:(t,n,i,o)=>{e.set(v,o)}}}),(0,c.e)({rules:i}),(0,d.w)(l.build())];e.set(k,u);let f=o({schema:t,doc:s,plugins:u}),p=h.EditorState.create(f);return e.set(v,p),e.done(ea),()=>{a(),e.remove(er).remove(v).remove(es).remove(el).clearTimer(ea)}});m(eh,{displayName:"EditorState"});var eu=(0,n.W)([],"pasteRule"),ef=(0,n.W)([E],"pasteRuleTimer"),ep=(0,n.P)("PasteRuleReady"),em=e=>(e.inject(eu,[]).inject(ef,[E]).record(ep),async()=>(await e.waitTimers(ef),e.done(ep),()=>{e.remove(eu).remove(ef).clearTimer(ep)}));m(em,{displayName:"PasteRule"});var eg=(0,n.P)("EditorViewReady"),ey=(0,n.W)([],"editorViewTimer"),ev=(0,n.W)({},"editorViewOptions"),ew=(0,n.W)(null,"root"),eb=(0,n.W)(null,"rootDOM"),eS=(0,n.W)({},"rootAttrs"),ek=new h.PluginKey("MILKDOWN_VIEW_CLEAR"),eC=e=>(e.inject(ew,document.body).inject(y,{}).inject(ev,{}).inject(eb,null).inject(eS,{}).inject(ey,[ea,ep]).record(eg),async()=>{var t;await e.wait(A);let n=e.get(ew)||document.body,i="string"==typeof n?document.querySelector(n):n;e.update(k,t=>[new h.Plugin({key:ek,view:t=>{let n,o=i?((n=document.createElement("div")).className="milkdown",i.appendChild(n),e.set(eb,n),Object.entries(e.get(eS)).forEach(([e,t])=>n.setAttribute(e,t)),n):void 0;if(o&&i){let e=t.dom;i.replaceChild(o,e),o.appendChild(e)}return{destroy:()=>{o?.parentNode&&o?.parentNode.replaceChild(t.dom,o),o?.remove()}}}}),...t]),await e.waitTimers(ey);let o=e.get(v),r=e.get(ev),s=Object.fromEntries(e.get(x)),l=Object.fromEntries(e.get(N)),a=new p.j(i,{state:o,nodeViews:s,markViews:l,transformPasted:(t,n,i)=>(e.get(eu).sort((e,t)=>(t.priority??50)-(e.priority??50)).map(e=>e.run).forEach(e=>{t=e(t,n,i)}),t),...r});return(t=a.dom).classList.add("editor"),t.setAttribute("role","textbox"),e.set(y,a),e.done(eg),()=>{a?.destroy(),e.remove(ew).remove(y).remove(ev).remove(eb).remove(eS).remove(ey).clearTimer(eg)}});m(eC,{displayName:"EditorView"});var ex=((t={}).Idle="Idle",t.OnCreate="OnCreate",t.Created="Created",t.OnDestroy="OnDestroy",t.Destroyed="Destroyed",t),eN=class e{constructor(){this.#i=!1,this.#o="Idle",this.#r=[],this.#s=()=>void 0,this.#e=new n.t,this.#l=new n.x,this.#a=new Map,this.#c=new Map,this.#t=new n.z(this.#e,this.#l),this.#d=()=>{let e=T(async e=>{await Promise.all(this.#r.map(t=>Promise.resolve(t(e))))}),t=[F,Q,eo,K,J,em,eh,eC,P(this),e];this.#h(t,this.#c)},this.#h=(e,t)=>{e.forEach(e=>{let n=this.#t.produce(this.#i?e.meta:void 0),i=e(n);t.set(e,{ctx:n,handler:i,cleanup:void 0})})},this.#u=(e,t=!1)=>Promise.all([e].flat().map(async e=>{let n=this.#a.get(e)?.cleanup;return(t?this.#a.delete(e):this.#a.set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),"function"==typeof n)?n():n})),this.#f=async()=>{await Promise.all([...this.#c.entries()].map(async([e,{cleanup:t}])=>"function"==typeof t?t():t)),this.#c.clear()},this.#p=e=>{this.#o=e,this.#s(e)},this.#m=e=>[...e.entries()].map(async([t,n])=>{let{ctx:i,handler:o}=n;if(!o)return;let r=await o();e.set(t,{ctx:i,handler:o,cleanup:r})}),this.enableInspector=(e=!0)=>(this.#i=e,this),this.onStatusChange=e=>(this.#s=e,this),this.config=e=>(this.#r.push(e),this),this.removeConfig=e=>(this.#r=this.#r.filter(t=>t!==e),this),this.use=e=>{let t=[e].flat();return t.flat().forEach(e=>{this.#a.set(e,{ctx:void 0,handler:void 0,cleanup:void 0})}),"Created"===this.#o&&this.#h(t,this.#a),this},this.remove=async e=>"OnCreate"===this.#o?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise(t=>{setTimeout(()=>{t(this.remove(e))},50)})):(await this.#u([e].flat(),!0),this),this.create=async()=>("OnCreate"===this.#o||("Created"===this.#o&&await this.destroy(),this.#p("OnCreate"),this.#d(),this.#h([...this.#a.keys()],this.#a),await Promise.all([this.#m(this.#c),this.#m(this.#a)].flat()),this.#p("Created")),this),this.destroy=async(e=!1)=>"Destroyed"===this.#o||"OnDestroy"===this.#o?this:"OnCreate"===this.#o?new Promise(t=>{setTimeout(()=>{t(this.destroy(e))},50)}):(e&&(this.#r=[]),this.#p("OnDestroy"),await this.#u([...this.#a.keys()],e),await this.#f(),this.#p("Destroyed"),this),this.action=e=>e(this.#t),this.inspect=()=>this.#i?[...this.#c.values(),...this.#a.values()].map(({ctx:e})=>e?.inspector?.read()).filter(e=>!!e):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new e}#i;#o;#r;#s;#e;#l;#a;#c;#t;#d;#h;#u;#f;#p;#m;get ctx(){return this.#t}get status(){return this.#o}};e.s(["CommandManager",0,L,"CommandsReady",0,W,"ConfigReady",0,O,"Editor",0,eN,"EditorStateReady",0,ea,"EditorStatus",0,ex,"EditorViewReady",0,eg,"InitReady",0,A,"KeymapManager",0,q,"KeymapReady",0,U,"ParserReady",0,G,"PasteRulesReady",0,ep,"SchemaReady",0,E,"SerializerReady",0,ee,"commands",0,K,"commandsCtx",0,j,"commandsTimerCtx",0,$,"config",0,T,"createCmdKey",0,function(e="cmdKey"){return(0,n.W)(()=>()=>!1,e)},"defaultValueCtx",0,er,"editorCtx",0,b,"editorState",0,eh,"editorStateCtx",0,v,"editorStateOptionsCtx",0,es,"editorStateTimerCtx",0,el,"editorView",0,eC,"editorViewCtx",0,y,"editorViewOptionsCtx",0,ev,"editorViewTimerCtx",0,ey,"getDoc",0,ec,"init",0,P,"initTimerCtx",0,w,"inputRulesCtx",0,S,"keymap",0,J,"keymapCtx",0,_,"keymapTimerCtx",0,H,"markViewCtx",0,N,"marksCtx",0,B,"nodeViewCtx",0,x,"nodesCtx",0,I,"parser",0,Q,"parserCtx",0,Z,"parserTimerCtx",0,X,"pasteRule",0,em,"pasteRulesCtx",0,eu,"pasteRulesTimerCtx",0,ef,"prosePluginsCtx",0,k,"remarkCtx",0,M,"remarkPluginsCtx",0,C,"remarkStringifyOptionsCtx",0,D,"rootAttrsCtx",0,eS,"rootCtx",0,ew,"rootDOMCtx",0,eb,"schema",0,F,"schemaCtx",0,R,"schemaTimerCtx",0,V,"serializer",0,eo,"serializerCtx",0,ei,"serializerTimerCtx",0,et])},960707,180569,811774,e=>{var t=e.i(463001),n=class{constructor(){this.sliceMap=new Map,this.get=e=>{let n="string"==typeof e?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);if(!n){let n="string"==typeof e?e:e.name;throw(0,t.x)(n)}return n},this.remove=e=>{let t="string"==typeof e?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>"string"==typeof e?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}},i=class{#g;#y;#v;constructor(e,t,n){this.#g=[],this.#v=()=>{this.#g.forEach(e=>e(this.#y))},this.set=e=>{this.#y=e,this.#v()},this.get=()=>this.#y,this.update=e=>{this.#y=e(this.#y),this.#v()},this.type=n,this.#y=t,e.set(n.id,this)}on(e){return this.#g.push(e),()=>{this.#g=this.#g.filter(t=>t!==e)}}once(e){let t=this.on(n=>{e(n),t()});return t}off(e){this.#g=this.#g.filter(t=>t!==e)}offAll(){this.#g=[]}},o=class{constructor(e,n){this.id=Symbol(`Context-${n}`),this.name=n,this._defaultValue=e,this._typeInfo=()=>{throw(0,t.r)()}}create(e,t=this._defaultValue){return new i(e,t,this)}},r=class{#w;#e;#l;#b;#S;#k;#C;constructor(e,t,n){this.#b=new Set,this.#S=new Set,this.#k=new Map,this.#C=new Map,this.read=()=>({metadata:this.#w,injectedSlices:[...this.#b].map(e=>({name:"string"==typeof e?e:e.name,value:this.#x(e)})),consumedSlices:[...this.#S].map(e=>({name:"string"==typeof e?e:e.name,value:this.#x(e)})),recordedTimers:[...this.#k].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#N(e)})),waitTimers:[...this.#C].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#N(e)}))}),this.onRecord=e=>{this.#k.set(e,{start:Date.now(),duration:0})},this.onClear=e=>{this.#k.delete(e)},this.onDone=e=>{let t=this.#k.get(e);t&&(t.duration=Date.now()-t.start)},this.onWait=(e,t)=>{let n=Date.now();t.finally(()=>{this.#C.set(e,{duration:Date.now()-n})}).catch(console.error)},this.onInject=e=>{this.#b.add(e)},this.onRemove=e=>{this.#b.delete(e)},this.onUse=e=>{this.#S.add(e)},this.#x=e=>this.#e.get(e).get(),this.#N=e=>this.#l.get(e).status,this.#e=e,this.#l=t,this.#w=n}#x;#N},s=class e{#e;#l;#w;#M;constructor(t,n,i){this.produce=t=>t&&Object.keys(t).length?new e(this.#e,this.#l,{...t}):this,this.inject=(e,t)=>{let n=e.create(this.#e.sliceMap);return null!=t&&n.set(t),this.#M?.onInject(e),this},this.remove=e=>(this.#e.remove(e),this.#M?.onRemove(e),this),this.record=e=>(e.create(this.#l.store),this.#M?.onRecord(e),this),this.clearTimer=e=>(this.#l.remove(e),this.#M?.onClear(e),this),this.isInjected=e=>this.#e.has(e),this.isRecorded=e=>this.#l.has(e),this.use=e=>(this.#M?.onUse(e),this.#e.get(e)),this.get=e=>this.use(e).get(),this.set=(e,t)=>this.use(e).set(t),this.update=(e,t)=>this.use(e).update(t),this.timer=e=>this.#l.get(e),this.done=e=>{this.timer(e).done(),this.#M?.onDone(e)},this.wait=e=>{let t=this.timer(e).start();return this.#M?.onWait(e,t),t},this.waitTimers=async e=>{await Promise.all(this.get(e).map(e=>this.wait(e)))},this.#e=t,this.#l=n,this.#w=i,i&&(this.#M=new r(t,n,i))}get meta(){return this.#w}get inspector(){return this.#M}},l=class{constructor(){this.store=new Map,this.get=e=>{let n=this.store.get(e.id);if(!n)throw(0,t.z)(e.name);return n},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},a=class{#D;#O;#T;#o;#A;constructor(e,t){this.#D=null,this.#O=null,this.#o="pending",this.#A=null,this.start=()=>(this.#D??=new Promise((e,t)=>{this.#O=t=>{t instanceof CustomEvent&&t.detail.id===this.#T&&(this.#o="resolved",this.#P(),t.stopImmediatePropagation(),e())},this.#E(()=>{"pending"===this.#o&&(this.#o="rejected"),this.#P(),t(Error(`Timing ${this.type.name} timeout.`))}),this.#o="pending",addEventListener(this.type.name,this.#O)}),this.#D),this.done=()=>{dispatchEvent(new CustomEvent(this.type.name,{detail:{id:this.#T}}))},this.#P=()=>{null!==this.#A&&(clearTimeout(this.#A),this.#A=null),this.#O&&removeEventListener(this.type.name,this.#O)},this.#E=e=>{this.#A=setTimeout(()=>{this.#A=null,e()},this.type.timeout)},this.#T=Symbol(t.name),this.type=t,e.set(t.id,this)}get status(){return this.#o}#P;#E},c=class{constructor(e,t=3e3){this.create=e=>new a(e,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}};e.s(["x",0,l,"t",0,n,"z",0,s,"W",0,(e,t)=>new o(e,t),"P",0,(e,t=3e3)=>new c(e,t)],960707);var d=e.i(792113);let h={}.hasOwnProperty,u={}.hasOwnProperty;var f=e.i(877942),p=e.i(432615),m=e.i(761809),g=e.i(455470),y=e.i(937312);function v(e){if(60!==e.charCodeAt(0))return;let t=e.charCodeAt(1);if(33===t){let t=e.charCodeAt(2);return 45===t?2:91===t?5:(0,g.B)(t)?4:void 0}if(63===t)return 3;let n=47===t,i=n?2:1,o=i,r=e.charCodeAt(o);if(!(0,g.B)(r))return;for(;45===r||(0,g.O)(r);)r=e.charCodeAt(++o);let s=e.slice(i,o).toLowerCase();return!n&&47!==r&&y.M.includes(s)?1:y.y.includes(s)?6:7}let w=[function(e,t,n,i){if("code"===t.type&&(0,p.f)(t,i)&&("list"===e.type||e.type===t.type&&(0,p.f)(e,i)))return!1;if("spread"in n&&"boolean"==typeof n.spread){if("paragraph"===e.type&&(e.type===t.type||"definition"===t.type||"heading"===t.type&&(0,m.f)(t,i)))return;if("html"===e.type){let t=v(e.value);if(void 0===t||6===t||7===t)return 1}if("paragraph"===e.type&&"html"===t.type){let e=v(t.value);if(void 0===e||7===e)return 1}return+!!n.spread}}],b=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],S=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\r",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\r",after:"\\r",inConstruct:"phrasing"},{character:"\n",before:"\\n",inConstruct:"phrasing"},{character:"\n",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:b},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:b},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:b},{atBreak:!0,character:"+",after:"(?:[ \r\n])"},{atBreak:!0,character:"-",after:"(?:[ \r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:b},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:b},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:b},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:b},{atBreak:!0,character:"~"},{character:"<",inConstruct:"autolink"},{character:">",inConstruct:"autolink"},{character:"",inConstruct:"autolink"}],k=-1;for(;++k<33;)S.push({character:String.fromCharCode(k),inConstruct:"autolink"});var C=e.i(559246);function x(e){return e.label||!e.identifier?e.label||"":(0,C.f)(e.identifier)}function N(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((e.beforeNode?"^":t?"("+t+")":"")+(/[$()*+.?[\\\]^{|}]/.test(e.character)?"\\":"")+e.character+(e.afterNode?"$":e.after?"(?:"+e.after+")":""),e.unicode?"gu":"g")}return e._compiled}var M=e.i(227066);function D(e){let t=e.codePointAt(0);return void 0===t?"":String.fromCodePoint(t)}function O(e){let t=e.codePointAt(e.length-2);return void 0!==t&&t>65535?e.slice(-2):e.slice(-1)}var T=e.i(230667);function A(e,t,n){let i=(0,M.f)(e),o=(0,M.f)(t);return void 0===i?void 0===o?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===i?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}let P=new Map([["*",!1],["_",!0]]);function E(e,t,n){let i=[],o=new Map,r=new Map,s=0;for(;s<e.length;){if(!e[s].attention){s++;continue}let l=e[s].value.charAt(0),a=P.get(l),c=s+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===l;)c++;let d=s?e[s-1].value:t,h=(0,M.f)(d.charCodeAt(d.length-1)),u=(0,M.f)((c<e.length?e[c].value:n).charCodeAt(0)),f=!u||2===u&&!!h,p=!h||2===h&&!!u,m={tokens:e.slice(s,c),markers:[],start:0,end:0,open:a?f&&(!!h||!p):f,close:a?p&&(!!u||!f):p,split:void 0!==a};for(let e of m.tokens){o.set(e,[...m.tokens]),r.set(e,m);let t=e.value.length;for(;t--;)m.markers.push(e)}m.end=m.markers.length,i.push(m),s=c}for(function(e,t){let n=0;for(;n<e.length;){let i=e[n],o=i.tokens[0].value.charAt(0),r=i.end-i.start,s=i.close&&r?n:0;for(;s--;){let n=e[s],l=n.end-n.start;if(n.tokens[0].value.charAt(0)===o&&n.open&&l&&(i.split?!((n.close||i.open)&&r%3)||(l+r)%3:l===n.markers.length&&l===r)){let e=i.split?l>1&&r>1?2:1:r,o=n.markers.slice(n.end-e,n.end),s=i.markers.slice(i.start,i.start+e),a=o[0],c=s[0];if(a===o[e-1]&&a.value.length===e&&c===s[e-1]&&c.value.length===e&&a.attention===c.attention)t.delete(a),t.delete(c);else{let e=[...new Set([...o,...s])];for(let n of e){let i=t.get(n);i&&i.push(...e)}}n.end-=e,i.start+=e;break}}(-1===s||i.start===i.end)&&n++}}(i,o),s=-1;++s<e.length;){let t=o.get(e[s]);if(t)return{attention:function(e,t,n){let i=new Set;for(let o of e){let e=n.get(o);if(e&&o.attention&&t.some(e=>e.attention===o.attention))for(let t of e.tokens)i.add(t.attention)}let o=[];for(let t of e)t.attention&&i.delete(t.attention)&&o.push(t.attention);return o.reverse(),o}(e,t,r),index:s}}}function V(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let i=t?D(n.value):O(n.value),o=(0,T.f)(i.codePointAt(0));n.value=t?o+n.value.slice(i.length):n.value.slice(0,n.value.length-i.length)+o}function R(e,t,n,i){let o,r=[],s=O(n),l=-1;for(;++l<e.length;){let n=e[l];if("string"==typeof n){let e={value:n,attention:void 0};o&&o===D(n)&&V([e],!0),o=void 0,r.push(e),e.value&&(s=O(e.value));continue}let a=t.get(n)||n.sequences[0],c=a.charAt(0),d=e[l+1],h=s,u=D(void 0===d?i:"string"==typeof d?d:t.get(d)||d.sequences[0]),f=R(n.children,t,a,a),p=f.length>0?f[0].value:"",m=A(h.charCodeAt(h.length-1),p.charCodeAt(0),c);m.inside&&V(f,!0);let g=f.length>0?O(f[f.length-1].value):"",y=A(u.charCodeAt(0),g.charCodeAt(g.length-1),c);y.inside&&V(f,!1),m.outside&&"\n"!==h&&"\r"!==h&&V(r,!1),y.outside&&(o=u),r.push({value:a,attention:n},...f,{value:a,attention:n}),s=a.charAt(a.length-1)}return r}function I(e,t,n){let i=new Map,o=R(e,i,t,n),r=o,s=E(r,t,n);for(;s;){let l=function(e,t,n,i,o){for(let r of n.attention){let s=t.get(r)||r.sequences[0];for(let l of r.sequences){if(l===s)continue;let a=new Map(t);a.set(r,l);let c=R(e,a,i,o),d=E(c,i,o);if(!d||d.index>n.index)return{chosen:a,mistake:d,tokens:c}}}}(e,i,s,t,n);if(!l){r=o;break}i=l.chosen,r=l.tokens,s=l.mistake}let l="";for(let e of r)l+=e.value;return l}let B=/\r?\n|\r/g;function z(e,t){let n,i=[],o=0,r=0;for(;n=B.exec(e);)s(e.slice(o,n.index)),i.push(n[0]),o=n.index+n[0].length,r++;return s(e.slice(o)),i.join("");function s(e){i.push(t(e,r,!e))}}var F=e.i(669826);let L={}.hasOwnProperty;function j(e,t){return!e||!!t&&("string"==typeof e?e===t.type:e.includes(t.type))}function $(e,t){return e-t}function W(e,t){let n,i=/\\(?=[!-/:-@[-`{-~])/g,o=[],r=[],s=e+t,l=-1,a=0;for(;n=i.exec(s);)o.push(n.index);for(;++l<o.length;)a!==o[l]&&r.push(e.slice(a,o[l])),r.push("\\"),a=o[l];return r.push(e.slice(a)),r.join("")}function K(e){let t=e||{},n=t.now||{},i=t.lineShift||0,o=n.line||1,r=n.column||1;return{move:function(e){let t=e||"",n=t.split(/\r?\n|\r/g),s=n[n.length-1];return o+=n.length-1,r=1===n.length?r+s.length:1+s.length+i,t},current:function(){return{now:{line:o,column:r},lineShift:i}},shift:function(e){i+=e}}}function q(e){throw Error("Cannot handle value `"+e+"`, expected node")}function _(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function H(e,t){if("definition"===e.type&&e.type===t.type)return 0}function U(e,t){return I(function e(t,n,i){let o=n.indexStack,r=t.children||[],s=[],l=-1,a=i.before;o.push(-1);let c=n.createTracker(i);for(;++l<r.length;){let d,h=r[l];if(o[o.length-1]=l,l+1<r.length){let e=n.handle.handlers[r[l+1].type];e&&e.peek&&(e=e.peek),d=e?D(e(r[l+1],t,n,{before:"",after:"",...c.current()})):""}else d=i.after;let u=s[s.length-1];"string"==typeof u&&("\r"===a||"\n"===a)&&"html"===h.type&&7!==v(h.value)&&(s[s.length-1]=u.replace(/(\r?\n|\r)$/," "),a=" ",(c=n.createTracker(i)).move(I(s,i.before,i.after)));let f=n.handle.handlers[h.type];if(f&&f.attention){let{construct:t,markers:i,sizes:o}=f.attention(h,n),r=function(e,t,n){if(0===t.length)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(0===n.length)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let i=[];for(let o of t){if(1!==o.length)throw Error("Cannot serialize `"+e+"` as attention with `"+o+"` as marker, expected a single ascii character");if(!(0,g.c)(o.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+o+"` as marker, expected ascii punctuation");for(let e of n)i.push(o.repeat(e))}return i}(h.type,i,o),l=r[0],d=n.enter(t);c.move(l);let u=e(h,n,{...c.current(),before:l,after:l});c.move(I(u,l,l)),c.move(l),d(),s.push({children:u,sequences:r}),a=l.charAt(l.length-1)}else{let e=n.handle(h,t,n,{...c.current(),after:d,before:a});if(!e)continue;c.move(e),s.push(e),a=O(e)}}return o.pop(),s}(e,this,t),t.before,t.after)}function J(e,t){return function(e,t,n){let i=t.indexStack,o=e.children||[],r=t.createTracker(n),s=[],l=-1;for(i.push(-1);++l<o.length;){let n=o[l];i[i.length-1]=l,s.push(r.move(t.handle(n,e,t,{before:"\n",after:"\n",...r.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),l<o.length-1&&s.push(r.move(function(e,t,n,i){let o=i.join.length;for(;o--;){let r=i.join[o](e,t,n,i);if(!0===r||1===r)break;if("number"==typeof r)return"\n".repeat(1+r);if(!1===r)return"\n\n<!---->\n\n"}return"\n\n"}(n,o[l+1],e,t)))}return i.pop(),s.join("")}(e,this,t)}function G(e,t){return function(e,t,n){let i=(n.before||"")+(t||"")+(n.after||""),o=[],r=[],s={},l=e.stack.includes("autolink"),a=n.before?n.before.length:0,c=i.length-(n.after?n.after.length:0),d=-1;for(;++d<e.unsafe.length;){let t,r=e.unsafe[d];if(!(0,F.f)(e.stack,r)||!j(r.beforeNode,n.beforeNode)||!j(r.afterNode,n.afterNode))continue;let l=e.compilePattern(r),h=r.beforeNode?a:0,u=i.slice(h,r.afterNode?c:void 0);for(;t=l.exec(u);){let e="before"in r||!!r.atBreak,n="after"in r,i=h+t.index+(e?t[1].length:0);L.call(s,i)?(s[i].before&&!e&&(s[i].before=!1),s[i].after&&!n&&(s[i].after=!1)):(o.push(i),s[i]={before:e,after:n})}}o.sort($);let h=a;for(d=-1;++d<o.length;){let e=o[d];if(!(e<h)&&!(e>=c)){if("_"===i.charAt(e)&&e>0&&void 0===(0,M.f)(i.charCodeAt(e-1))&&!L.call(s,e-1)&&!(e-1===a&&/[*_]/.test(i.charAt(a-1)))){let t=e+1;for(;t<c&&"_"===i.charAt(t);)t++;let n=t-e-1;if(o[d+n]===t-1&&t<i.length&&void 0===(0,M.f)(i.charCodeAt(t))&&!L.call(s,t)&&!(t===c-1&&/[*_]/.test(i.charAt(c)))){d+=n;continue}}if((!(e+1<c)||o[d+1]!==e+1||!s[e].after||s[e+1].before||s[e+1].after)&&(o[d-1]!==e-1||!s[e].before||s[e-1].before||s[e-1].after)){if(h!==e){let t=i.slice(h,e);r.push(l?t:W(t,"\\"))}h=e,l?(r.push("%"+i.charCodeAt(e).toString(16).toUpperCase().padStart(2,"0")),h++):!/[!-/:-@[-`{-~]/.test(i.charAt(e))||n.encode&&n.encode.includes(i.charAt(e))?(r.push((0,T.f)(i.charCodeAt(e))),h++):r.push("\\")}}}let u=i.slice(h,c);return r.push(l?u:W(u,n.after)),r.join("")}(this,e,t)}e.s(["f",0,function(e){let t=this;t.compiler=function(n){var i;let o,r;return i={...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]},!function e(t,n){var i,o,r,s;let l,a=-1;if(n.extensions)for(;++a<n.extensions.length;)e(t,n.extensions[a]);for(l in n)if(u.call(n,l))switch(l){case"extensions":break;case"unsafe":case"join":i=t[l],(o=n[l])&&i.push(...o);break;case"handlers":r=t[l],(s=n[l])&&Object.assign(r,s);break;default:t.options[l]=n[l]}return t}(o={associationId:x,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:U,containerFlow:J,createTracker:K,compilePattern:N,enter:function(e){return o.stack.push(e),function(){o.stack.pop()}},handlers:{...f.f},handle:void 0,indentLines:z,indexStack:[],join:[...w],options:{},safe:G,stack:[],unsafe:[...S]},i||{}),o.options.tightDefinitions&&o.join.push(H),o.handle=function(e,t){let n=t||{};function i(t,...n){let o=i.invalid,r=i.handlers;if(t&&h.call(t,e)){let n=String(t[e]);o=h.call(r,n)?r[n]:i.unknown}if(o)return o.call(this,t,...n)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}("type",{invalid:q,unknown:_,handlers:o.handlers}),(r=o.handle((0,d.f)(n)?{type:"root",children:[n]}:n,void 0,o,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0}))&&10!==r.charCodeAt(r.length-1)&&13!==r.charCodeAt(r.length-1)&&(r+="\n"),r}}],180569);var Y=e.i(93464),Z=e.i(605938),X=e.i(111092);let Q=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function ee(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let et=(e,t,n)=>{let i=ee(e,n);if(!i)return!1;let o=eo(i);if(!o){let n=i.blockRange(),o=n&&(0,Y.j)(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let r=o.nodeBefore;if(ea(e,o,t,-1))return!0;if(0==i.parent.content.size&&(en(r,"end")||X.NodeSelection.isSelectable(r)))for(let n=i.depth;;n--){let s=(0,Y.e)(e.doc,i.before(n),i.after(n),Z.k.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(en(r,"end")?X.Selection.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):X.NodeSelection.create(n.doc,o.pos-r.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||i.node(n-1).childCount>1)break}return!!r.isAtom&&o.depth==i.depth-1&&(t&&t(e.tr.delete(o.pos-r.nodeSize,o.pos).scrollIntoView()),!0)};function en(e,t,n=!1){for(let i=e;i;i="start"==t?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&1!=i.childCount)break}return!1}let ei=(e,t,n)=>{let{$head:i,empty:o}=e.selection,r=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;r=eo(i)}let s=r&&r.nodeBefore;return!!s&&!!X.NodeSelection.isSelectable(s)&&(t&&t(e.tr.setSelection(X.NodeSelection.create(e.doc,r.pos-s.nodeSize)).scrollIntoView()),!0)};function eo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function er(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function es(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let el=(e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let o=n.node(-1),r=n.indexAfter(-1),s=es(o.contentMatchAt(r));if(!s||!o.canReplaceWith(r,r,s))return!1;if(t){let i=n.after(),o=e.tr.replaceWith(i,i,s.createAndFill());o.setSelection(X.Selection.near(o.doc.resolve(i),1)),t(o.scrollIntoView())}return!0};function ea(e,t,n,i){let o,r,s,l=t.nodeBefore,a=t.nodeAfter,c,d,h=l.type.spec.isolating||a.type.spec.isolating;if(!h&&(o=t.nodeBefore,r=t.nodeAfter,s=t.index(),o&&r&&o.type.compatibleContent(r.type)&&(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(s,s+1)&&!!(r.isTextblock||(0,Y.n)(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let u=!h&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(c=(d=l.contentMatchAt(l.childCount)).findWrapping(a.type))&&d.matchType(c[0]||a.type).validEnd){if(n){let i=t.pos+a.nodeSize,o=Z.y.empty;for(let e=c.length-1;e>=0;e--)o=Z.y.from(c[e].create(null,o));o=Z.y.from(l.copy(o));let r=e.tr.step(new Y.w(t.pos-1,i,t.pos,i,new Z.k(o,1,0),c.length,!0)),s=r.doc.resolve(i+2*c.length);s.nodeAfter&&s.nodeAfter.type==l.type&&(0,Y.n)(r.doc,s.pos)&&r.join(s.pos),n(r.scrollIntoView())}return!0}let f=a.type.spec.isolating||i>0&&h?null:X.Selection.findFrom(t,1),p=f&&f.$from.blockRange(f.$to),m=p&&(0,Y.j)(p);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(p,m).scrollIntoView()),!0;if(u&&en(a,"start",!0)&&en(l,"end")){let i=l,o=[];for(;o.push(i),!i.isTextblock;)i=i.lastChild;let r=a,s=1;for(;!r.isTextblock;r=r.firstChild)s++;if(i.canReplace(i.childCount,i.childCount,r.content)){if(n){let i=Z.y.empty;for(let e=o.length-1;e>=0;e--)i=Z.y.from(o[e].copy(i));n(e.tr.step(new Y.w(t.pos-o.length,t.pos+a.nodeSize,t.pos+s,t.pos+a.nodeSize-s,new Z.k(i,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ec(e){return function(t,n){let i=t.selection,o=e<0?i.$from:i.$to,r=o.depth;for(;o.node(r).isInline;){if(!r)return!1;r--}return!!o.node(r).isTextblock&&(n&&n(t.tr.setSelection(X.TextSelection.create(t.doc,e<0?o.start(r):o.end(r)))),!0)}}let ed=ec(-1),eh=ec(1);function eu(...e){return function(t,n,i){for(let o=0;o<e.length;o++)if(e[o](t,n,i))return!0;return!1}}let ef=eu(Q,et,ei),ep=eu(Q,(e,t,n)=>{let i=function(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}(e,n);if(!i)return!1;let o=er(i);if(!o)return!1;let r=o.nodeAfter;if(ea(e,o,t,1))return!0;if(0==i.parent.content.size&&(en(r,"start")||X.NodeSelection.isSelectable(r))){let n=(0,Y.e)(e.doc,i.before(),i.after(),Z.k.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection(en(r,"start")?X.Selection.findFrom(i.doc.resolve(i.mapping.map(o.pos)),1):X.NodeSelection.create(i.doc,i.mapping.map(o.pos))),t(i.scrollIntoView())}return!0}}return!!r.isAtom&&o.depth==i.depth-1&&(t&&t(e.tr.delete(o.pos,o.pos+r.nodeSize).scrollIntoView()),!0)},(e,t,n)=>{let{$head:i,empty:o}=e.selection,r=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;r=er(i)}let s=r&&r.nodeAfter;return!!s&&!!X.NodeSelection.isSelectable(s)&&(t&&t(e.tr.setSelection(X.NodeSelection.create(e.doc,r.pos)).scrollIntoView()),!0)}),em={Enter:eu((e,t)=>{let{$head:n,$anchor:i}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(i)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)},(e,t)=>{let n=e.selection,{$from:i,$to:o}=n;if(n instanceof X.AllSelection||i.parent.inlineContent||o.parent.inlineContent)return!1;let r=es(o.parent.contentMatchAt(o.indexAfter()));if(!r||!r.isTextblock)return!1;if(t){let n=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=e.tr.insert(n,r.createAndFill());s.setSelection(X.TextSelection.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,Y.J)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&(0,Y.j)(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},(e,t)=>{if(e.selection instanceof X.NodeSelection&&e.selection.node.isBlock){let{$from:n}=e.selection;return!!n.parentOffset&&!!(0,Y.J)(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof X.TextSelection||e.selection instanceof X.AllSelection)&&n.deleteSelection();let{$from:i}=n.selection,o=n.steps.length,r=[],s,l,a=!1,c=!1;for(let e=i.depth;;e--){if(i.node(e).isBlock){let t;a=i.end(e)==i.pos+(i.depth-e),c=i.start(e)==i.pos-(i.depth-e),l=es(i.node(e-1).contentMatchAt(i.indexAfter(e-1)));r.unshift(t||(a&&l?{type:l}:null)),s=e;break}if(1==e)return!1;r.unshift(null)}let d=i.pos,h=(0,Y.J)(n.doc,d,r.length,r);if(h||(r[0]=l?{type:l}:null,h=(0,Y.J)(n.doc,d,r.length,r)),!h)return!1;if(n.split(d,r.length,r),!a&&c&&i.node(s).type!=l){let e=n.mapping.slice(o),t=e.map(i.before(s)),r=n.doc.resolve(t);l&&i.node(s-1).canReplaceWith(r.index(),r.index()+1,l)&&n.setNodeMarkup(e.map(i.before(s)),l)}return t&&t(n.scrollIntoView()),!0}),"Mod-Enter":el,Backspace:ef,"Mod-Backspace":ef,"Shift-Backspace":ef,Delete:ep,"Mod-Delete":ep,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new X.AllSelection(e.doc))),!0)},eg={"Ctrl-h":em.Backspace,"Alt-Backspace":em["Mod-Backspace"],"Ctrl-d":em.Delete,"Ctrl-Alt-Backspace":em["Mod-Delete"],"Alt-Delete":em["Mod-Delete"],"Alt-d":em["Mod-Delete"],"Ctrl-a":ed,"Ctrl-e":eh};for(let e in em)eg[e]=em[e];let ey=("u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&!!os.platform&&"darwin"==os.platform())?eg:em;e.s(["v",0,ey,"J",0,eu,"b",0,Q,"A",0,el,"I",0,et,"_",0,(e,t,n)=>{let i=ee(e,n);if(!i)return!1;let o=eo(i);return!!o&&function(e,t,n){let i=t.nodeBefore,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let e=i.lastChild;if(!e)return!1;i=e}let r=t.nodeAfter,s=t.pos+1;for(;!r.isTextblock;s++){if(r.type.spec.isolating)return!1;let e=r.firstChild;if(!e)return!1;r=e}let l=(0,Y.e)(e.doc,o,s,Z.k.empty);if(!l||l.from!=o||l instanceof Y.z&&l.slice.size>=s-o)return!1;if(n){let t=e.tr.step(l);t.setSelection(X.TextSelection.create(t.doc,o)),n(t.scrollIntoView())}return!0}(e,o,t)},"n",0,ei,"s",0,function(e,t=null){return function(n,i){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:r},$to:{pos:s}}=n.selection.ranges[i];n.doc.nodesBetween(r,s,(i,r)=>{if(o)return!1;if(!(!i.isTextblock||i.hasMarkup(e,t)))if(i.type==e)o=!0;else{let t=n.doc.resolve(r),i=t.index();o=t.parent.canReplaceWith(i,i+1,e)}})}if(!o)return!1;if(i){let o=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:r},$to:{pos:s}}=n.selection.ranges[i];o.setBlockType(r,s,e,t)}i(o.scrollIntoView())}return!0}},"r",0,function(e,t=null,n){let i=!1!==(n&&n.removeWhenPresent),o=!1!==(n&&n.enterInlineAtoms),r=!(n&&n.includeWhitespace);return function(n,s){let{empty:l,$cursor:a,ranges:c}=n.selection;if(l&&!a||!function(e,t,n,i){for(let o=0;o<t.length;o++){let{$from:r,$to:s}=t[o],l=0==r.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(r.pos,s.pos,(e,t)=>{if(l||!i&&e.isAtom&&e.isInline&&t>=r.pos&&t+e.nodeSize<=s.pos)return!1;l=e.inlineContent&&e.type.allowsMarkType(n)}),l)return!0}return!1}(n.doc,c,e,o))return!1;if(s)if(a)s(e.isInSet(n.storedMarks||a.marks())?n.tr.removeStoredMark(e):n.tr.addStoredMark(e.create(t)));else{let l,a=n.tr;o||(c=function(e){let t=[];for(let n=0;n<e.length;n++){let{$from:i,$to:o}=e[n];i.doc.nodesBetween(i.pos,o.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=i.pos&&n+e.nodeSize<=o.pos)return n+1>i.pos&&t.push(new X.SelectionRange(i,i.doc.resolve(n+1))),i=i.doc.resolve(n+1+e.content.size),!1}),i.pos<o.pos&&t.push(new X.SelectionRange(i,o))}return t}(c)),l=i?!c.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!c.every(t=>{let n=!1;return a.doc.nodesBetween(t.$from.pos,t.$to.pos,(i,o,r)=>{if(n)return!1;n=!e.isInSet(i.marks)&&!!r&&r.type.allowsMarkType(e)&&!(i.isText&&/^\s*$/.test(i.textBetween(Math.max(0,t.$from.pos-o),Math.min(i.nodeSize,t.$to.pos-o))))}),!n});for(let n=0;n<c.length;n++){let{$from:i,$to:o}=c[n];if(l){let n=i.pos,s=o.pos,l=i.nodeAfter,c=o.nodeBefore,d=r&&l&&l.isText?/^\s*/.exec(l.text)[0].length:0,h=r&&c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+d<s&&(n+=d,s-=h),a.addMark(n,s,e.create(t))}else a.removeMark(i.pos,o.pos,e)}s(a.scrollIntoView())}return!0}},"K",0,function(e,t=null){return function(n,i){let{$from:o,$to:r}=n.selection,s=o.blockRange(r),l=s&&(0,Y.H)(s,e,t);return!!l&&(i&&i(n.tr.wrap(s,l).scrollIntoView()),!0)}}],811774)},463001,e=>{var t,n=((t={}).docTypeError="docTypeError",t.contextNotFound="contextNotFound",t.timerNotFound="timerNotFound",t.ctxCallOutOfScope="ctxCallOutOfScope",t.createNodeInParserFail="createNodeInParserFail",t.stackOverFlow="stackOverFlow",t.parserMatchError="parserMatchError",t.serializerMatchError="serializerMatchError",t.getAtomFromSchemaFail="getAtomFromSchemaFail",t.expectDomTypeError="expectDomTypeError",t.callCommandBeforeEditorView="callCommandBeforeEditorView",t.missingRootElement="missingRootElement",t.missingNodeInSchema="missingNodeInSchema",t.missingMarkInSchema="missingMarkInSchema",t.ctxNotBind="ctxNotBind",t.missingYjsDoc="missingYjsDoc",t.aiProviderError="aiProviderError",t.aiBuildContextError="aiBuildContextError",t),i=class extends Error{constructor(e,t,n){super(t,n),this.name="MilkdownError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},o=(e,t)=>"function"==typeof t?"[Function]":t;function r(e){try{return JSON.stringify(e,o)}catch{return"[Unserializable]"}}e.s(["e",0,function(e){let t=e instanceof Error?e.message:r(e);return new i(n.aiBuildContextError,`AI buildContext failed: ${t}`,{cause:e})},"$",0,function(e){let t=e instanceof Error?e.message:r(e);return new i(n.aiProviderError,`AI provider error: ${t}`,{cause:e})},"Y",0,function(){return new i(n.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")},"x",0,function(e){return new i(n.contextNotFound,`Context "${e}" not found, do you forget to inject it?`)},"Z",0,function(e,t,o){let r=`Cannot create node for ${"name"in e?e.name:e}`,s=e=>{if(null==e)return"null";if(Array.isArray(e))return`[${e.map(s).join(", ")}]`;if("object"==typeof e)return"toJSON"in e&&"function"==typeof e.toJSON?JSON.stringify(e.toJSON()):"spec"in e?JSON.stringify(e.spec):JSON.stringify(e);if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("function"==typeof e)return`[Function: ${e.name||"anonymous"}]`;try{return String(e)}catch{return"[Unserializable]"}},l=[["[Description]",r],["[Attributes]",t],["[Content]",(o??[]).map(e=>e?"object"==typeof e&&"type"in e?`${e}`:s(e):"null")]].reduce((e,[t,n])=>{let i=`${t}: ${s(n)}.`;return e.concat(i)},[]);return new i(n.createNodeInParserFail,l.join("\n"))},"r",0,function(){return new i(n.ctxCallOutOfScope,"Should not call a context out of the plugin.")},"V",0,function(e){return new i(n.docTypeError,`Doc type error, unsupported type: ${JSON.stringify(e,o)}`)},"a",0,function(e){return new i(n.expectDomTypeError,`Expect to be a dom, but get: ${JSON.stringify(e,o)}.`)},"O",0,function(e,t){return new i(n.getAtomFromSchemaFail,`Cannot get ${e}: ${t} from schema.`)},"S",0,function(e){return new i(n.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)},"y",0,function(e){return new i(n.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)},"F",0,function(){return new i(n.missingRootElement,"Missing root element, milkdown cannot find root element of the editor.")},"T",0,function(e){return new i(n.parserMatchError,`Cannot match target parser for node: ${JSON.stringify(e,o)}.`)},"U",0,function(e){return new i(n.serializerMatchError,`Cannot match target serializer for node: ${JSON.stringify(e,o)}.`)},"o",0,function(){return new i(n.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")},"z",0,function(e){return new i(n.timerNotFound,`Timer "${e}" not found, do you forget to record it?`)}])},541681,e=>{var t=e.i(111092),n=e.i(44376),i=e.i(463001);let o="u">typeof navigator?navigator:null,r="u">typeof document?document:null,s=o&&o.userAgent||"",l=/Edge\/(\d+)/.exec(s),a=/MSIE \d/.exec(s),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(s),d=!!(a||c||l),h=a?document.documentMode:c?+c[1]:l?+l[1]:0,u=!d&&/gecko\/(\d+)/i.test(s),f=u&&+(/Firefox\/(\d+)/.exec(s)||[0,0])[1],p=!d&&/Chrome\/(\d+)/.exec(s),m=!!p,g=p?+p[1]:0,y=!d&&!!o&&/Apple Computer/.test(o.vendor),v=y&&(/Mobile\/\w+/.test(s)||!!o&&o.maxTouchPoints>2),w=v||!!o&&/Mac/.test(o.platform),b=/Android \d/.test(s),S=!!r&&"webkitFontSmoothing"in r.documentElement.style,k=S?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var C=Object.freeze({__proto__:null,android:b,chrome:m,chrome_version:g,gecko:u,gecko_version:f,ie:d,ie_version:h,ios:v,mac:w,safari:y,webkit:S,webkit_version:k});function x(e,t,n,i,o,r){if(e.composing)return!1;let s=e.state,l=s.doc.resolve(t);if(l.parent.type.spec.code)return!1;let a=l.parent.textBetween(Math.max(0,l.parentOffset-500),l.parentOffset,void 0,"")+i;for(let l of o){let o=l.match.exec(a),c=o&&o[0]&&l.handler(s,o,t-(o[0].length-i.length),n);if(c)return!1!==l.undoable&&c.setMeta(r,{transform:c,from:t,to:n,text:i}),e.dispatch(c),!0}return!1}let N=new t.PluginKey("MILKDOWN_CUSTOM_INPUTRULES");function M(e){return e.some(e=>e.type.spec.code)}function D(e,t,n){if(t>=n)return!1;let i=!1;return e.doc.nodesBetween(t,n,e=>(e.isInline&&M(e.marks)&&(i=!0),!i)),i}var O=Object.defineProperty,T=Object.defineProperties,A=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,R=(e,t,n)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function I(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function B(e){return t=>{for(let n=t.depth;n>0;n-=1){let i=t.node(n);if(e(i))return{from:t.before(n),to:t.after(n),node:i}}}}e.s(["l",0,C,"d",0,function(e){return Object.assign(Object.create(e),e).setTime(Date.now())},"e",0,function({rules:e}){let n=new t.Plugin({key:N,isInputRules:!0,state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(t,i,o,r)=>x(t,i,o,r,e,n),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:i}=t.state.selection;i&&x(t,i.pos,i.pos,"",e,n)}),!1),keydown:(e,t)=>!!(b&&m&&"Enter"===t.key)&&!e.composing&&!!e.someProp("handleKeyDown",n=>n(e,t))&&(t.preventDefault(),!0)},handleKeyDown(t,i){if("Enter"!==i.key)return!1;let{$cursor:o}=t.state.selection;return!!o&&x(t,o.pos,o.pos,"\n",e,n)}}});return n},"T",0,(e,n)=>{let{selection:i,doc:o}=e;if(i instanceof t.NodeSelection)return{hasNode:i.node.type===n,pos:i.from,target:i.node};let{from:r,to:s}=i,l=!1,a=-1,c=null;return o.nodesBetween(r,s,(e,t)=>!c&&(e.type!==n||(l=!0,a=t,c=e,!1))),{hasNode:l,pos:a,target:c}},"Y",0,B,"R",0,function(e){return t=>{for(let n=t.depth;n>0;n--){let i=t.node(n);if(e(i))return{pos:t.before(n),start:t.start(n),depth:n,node:i}}}},"M",0,function(e,t){return B(e=>e.type===t)(e)},"y",0,function(e,n){if(!(e instanceof t.NodeSelection))return;let{node:i,$from:o}=e;if(Array.isArray(n)&&n.includes(i.type)||i.type===n)return{node:i,pos:o.pos,start:o.start(o.depth),depth:o.depth}},"$",0,function(e,t){let n=t.nodes[e];if(!n)throw(0,i.O)("node",e);return n},"D",0,function(e){if(1===e.content.childCount){let t=e.content.firstChild;if((null==t?void 0:t.type.name)==="text"&&0===t.marks.length)return t;if((null==t?void 0:t.type.name)==="paragraph"&&1===t.childCount){let e=t.firstChild;if((null==e?void 0:e.type.name)==="text"&&0===e.marks.length)return e}}return!1},"B",0,function(e,t,i={}){return new n.E(e,(e,n,o,r)=>{var s,l,a,c,d,h;let u,{tr:f}=e,p=n.length,m=n[p-1],g=n[0],y=[],v={group:m,fullMatch:g,start:o,end:r},w=null==(s=i.updateCaptured)?void 0:s.call(i,v);if(Object.assign(v,w),{group:m,fullMatch:g,start:o,end:r}=v,null===g||(null==m?void 0:m.trim())==="")return null;if(m){let s=g.search(/\S/),p=o+g.indexOf(m),v=p+m.length,w=D(e,o+s,p),b=v<r&&D(e,v,r);if(w||b||(d=r,M(null!=(h=e.storedMarks)?h:e.doc.resolve(d).marks())))return null;y=null!=(l=f.storedMarks)?l:[],v<r&&f.delete(v,r),p>o&&f.delete(o+s,p),u=o+s+m.length;let S=null==(a=i.getAttr)?void 0:a.call(i,n);f.addMark(o,u,t.create(S)),f.setStoredMarks(y),null==(c=i.beforeDispatch)||c.call(i,{match:n,start:o,end:r,tr:f})}return f})},"W",0,function(e,t,n){let i=e.state.doc.content.size,o=I(t,0,i),r=I(n,0,i),s=e.coordsAtPos(o),l=e.coordsAtPos(r,-1),a=Math.min(s.top,l.top),c=Math.max(s.bottom,l.bottom),d=Math.min(s.left,l.left),h=Math.max(s.right,l.right),u={top:a,bottom:c,left:d,right:h,width:h-d,height:c-a,x:d,y:a};return T(((e,t)=>{for(var n in t||(t={}))E.call(t,n)&&R(e,n,t[n]);if(P)for(var n of P(t))V.call(t,n)&&R(e,n,t[n]);return e})({},u),A({toJSON:()=>u}))}])},44376,e=>{e.i(111092);var t=e.i(93464);class n{constructor(e,t,n={}){var i;this.match=e,this.match=e,this.handler="string"==typeof t?(i=t,function(e,t,n,o){let r=i;if(t[1]){let e=t[0].lastIndexOf(t[1]);r+=t[0].slice(e+t[1].length);let i=(n+=e)-o;i>0&&(r=t[0].slice(e-i,e)+r,n=o)}return e.tr.insertText(r,n,o)}):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1,this.inCodeMark=!1!==n.inCodeMark}}new n(/--$/,"—",{inCodeMark:!1}),new n(/\.\.\.$/,"…",{inCodeMark:!1}),new n(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new n(/"$/,"”",{inCodeMark:!1}),new n(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new n(/'$/,"’",{inCodeMark:!1}),e.s(["E",0,n,"V",0,function(e,t,i=null){return new n(e,(e,n,o,r)=>{let s=e.doc.resolve(o),l=i instanceof Function?i(n):i;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,r).setBlockType(o,o,t,l):null})},"S",0,(e,t)=>{let n=e.plugins;for(let i=0;i<n.length;i++){let o=n[i],r;if(o.spec.isInputRules&&(r=o.getState(e))){if(t){let n=e.tr,i=r.transform;for(let e=i.steps.length-1;e>=0;e--)n.step(i.steps[e].invert(i.docs[e]));if(r.text){let t=n.doc.resolve(r.from).marks();n.replaceWith(r.from,r.to,e.schema.text(r.text,t))}else n.delete(r.from,r.to);t(n)}return!0}}return!1},"D",0,function(e,i,o=null,r){return new n(e,(e,n,s,l)=>{let a=o instanceof Function?o(n):o,c=e.tr.delete(s,l),d=c.doc.resolve(s).blockRange(),h=d&&(0,t.H)(d,i,a);if(!h)return null;c.wrap(d,h);let u=c.doc.resolve(s-1).nodeBefore;return u&&u.type==i&&(0,t.n)(c.doc,s-1)&&(!r||r(n,u))&&c.join(s-1),c})}])},202008,19040,e=>{var t=e.i(260861),n=e.i(111092);let i="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),o="u">typeof navigator&&/Win/.test(navigator.platform);function r(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function s(e){let n=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,o,r,s=e.split(/-(?!$)/),l=s[s.length-1];"Space"==l&&(l=" ");for(let e=0;e<s.length-1;e++){let l=s[e];if(/^(cmd|meta|m)$/i.test(l))r=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))i?r=!0:n=!0;else throw Error("Unrecognized modifier name: "+l)}return t&&(l="Alt-"+l),n&&(l="Ctrl-"+l),r&&(l="Meta-"+l),o&&(l="Shift-"+l),l}(n)]=e[n];return t}(e);return function(e,i){let s=(0,t.R)(i),l,a=n[r(s,i)];if(a&&a(e.state,e.dispatch,e))return!0;if(1==s.length&&" "!=s){if(i.shiftKey){let t=n[r(s,i,!1)];if(t&&t(e.state,e.dispatch,e))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(o&&i.ctrlKey&&i.altKey)&&(l=t.j[i.keyCode])&&l!=s){let t=n[r(l,i)];if(t&&t(e.state,e.dispatch,e))return!0}}return!1}}e.s(["v",0,s,"w",0,function(e){return new n.Plugin({props:{handleKeyDown:s(e)}})}],202008);var l=e.i(463001),a=e.i(605938),c=class{},d=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{this.top()?.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{let e=this.elements.pop();if(!e)throw(0,l.o)();return e}}},h=class e extends c{constructor(e,t,n){super(),this.type=e,this.content=t,this.attrs=n}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(t,n,i){return new e(t,n,i)}},u=class extends d{#V;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(t,e),n.toDoc())}}constructor(e){super(),this.#V=a.H.none,this.#R=e=>e.isText,this.#I=(e,t)=>{if(this.#R(e)&&this.#R(t)&&a.H.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)},this.#B=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.parseMarkdown.match(e));if(!t)throw(0,l.T)(e);return t},this.#z=e=>{let t=this.#B(e);t.spec.parseMarkdown.runner(this,e,t)},this.injectRoot=(e,t,n)=>(this.openNode(t,n),this.next(e.children),this),this.openNode=(e,t)=>(this.open(h.create(e,[],t)),this),this.#F=()=>{this.#V=a.H.none;let e=this.close();return this.#L(e.type,e.attrs,e.content)},this.closeNode=()=>{try{this.#F()}catch(e){console.error(e)}return this},this.#L=(e,t,n)=>{let i=e.createAndFill(t,n,this.#V);if(!i)throw(0,l.Z)(e,t,n);return this.push(i),i},this.addNode=(e,t,n)=>{try{this.#L(e,t,n)}catch(e){console.error(e)}return this},this.openMark=(e,t)=>{let n=e.create(t);return this.#V=n.addToSet(this.#V),this},this.closeMark=e=>(this.#V=e.removeFromSet(this.#V),this),this.addText=e=>{try{let t=this.top();if(!t)throw(0,l.o)();let n=t.pop(),i=this.schema.text(e,this.#V);if(!n)return t.push(i),this;let o=this.#I(n,i);if(o)return t.push(o),this;return t.push(n,i),this}catch(e){return console.error(e),this}},this.build=()=>{let e;do e=this.#F();while(this.size())return e},this.next=(e=[])=>([e].flat().forEach(e=>this.#z(e)),this),this.toDoc=()=>this.build(),this.run=(e,t)=>{let n=e.runSync(e.parse(t),t);return this.next(n),this},this.schema=e}#R;#I;#B;#z;#F;#L},f=class e extends c{constructor(e,t,n,i={}){super(),this.type=e,this.children=t,this.value=n,this.props=i,this.push=(e,...t)=>{this.children||(this.children=[]),this.children.push(e,...t)},this.pop=()=>this.children?.pop()}static{this.create=(t,n,i,o={})=>new e(t,n,i,o)}},p=class extends d{#j;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(e),n.toString(t))}}constructor(e){super(),this.#j=[],this.#B=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.toMarkdown.match(e));if(!t)throw(0,l.U)(e.type);return t},this.#$=e=>this.#B(e).spec.toMarkdown.runner(this,e),this.#W=(e,t)=>this.#B(e).spec.toMarkdown.runner(this,e,t),this.#K=e=>{let t=e=>e.type.spec.priority??50,n=[...e].sort((e,n)=>t(e)-t(n)),i=[];return this.#j.forEach(({mark:e})=>{let t=n.findIndex(t=>t.eq(e));t>=0&&i.push(...n.splice(t,1))}),i.concat(n)},this.#q=e=>{let t=e?.marks,n=0;for(;n<this.#j.length;){let{mark:e,spanning:i}=this.#j[n];if(i&&t?.some(t=>t.eq(e)))n++;else break}for(let e=this.#j.length-1;e>=n;e--)this.#_(this.#j[e].mark)},this.#z=(e,t)=>{this.#K(e.marks).every(t=>!this.#W(t,e))&&this.#$(e),this.#q(t)},this.#H=e=>{let{children:t}=e;return t&&(e.children=t.reduce((e,t,n)=>{if(0===n)return[t];let i=e.at(-1);if(i&&i.isMark&&t.isMark){let{children:n,...o}=t,{children:r,...s}=i;if(t.type===i.type&&n&&r&&JSON.stringify(o)===JSON.stringify(s)){let t={...s,children:[...r,...n]};return e.slice(0,-1).concat(this.#H(t))}}return e.concat(t)},[])),e},this.#U=e=>{let t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t},this.openNode=(e,t,n)=>(this.open(f.create(e,void 0,t,n)),this),this.#J=(e,t)=>{let n="",i="",o=e.children;if(o){let e=o[0],t=o.at(-1);if(t&&"text"===t.type&&t.value.endsWith(" ")){let e=t.value,n=e.trimEnd();i=e.slice(n.length),t.value=n}if(e&&"text"===e.type&&e.value.startsWith(" ")){let t=e.value,i=t.trimStart();n=t.slice(0,t.length-i.length),e.value=i}}n.length&&this.#L("text",void 0,n);let r=t();return i.length&&this.#L("text",void 0,i),r},this.#F=(e=!1)=>{let t=this.close(),n=()=>this.#L(t.type,t.children,t.value,t.props);return e?this.#J(t,n):n()},this.closeNode=()=>(this.#F(),this),this.#L=(e,t,n,i)=>{let o=f.create(e,t,n,i),r=this.#H(this.#U(o));return this.push(r),r},this.addNode=(e,t,n,i)=>(this.#L(e,t,n,i),this),this.#G=(e,t,n,i)=>this.#j.some(t=>t.mark.eq(e))?this:(this.#j.push({mark:e,spanning:null==n}),this.openNode(t,n,{...i,isMark:!0})),this.#_=e=>{let t=-1;for(let n=this.#j.length-1;n>=0;n--)if(this.#j[n].mark.eq(e)){t=n;break}t<0||(this.#j.splice(t,1),this.#F(!0))},this.withMark=(e,t,n,i)=>(this.#G(e,t,n,i),this),this.closeMark=e=>(this.#_(e),this),this.build=()=>{let e=null;do e=this.#F();while(this.size())return e.children||(e.children=[]),e},this.next=e=>(Object.prototype.hasOwnProperty.call(e,"size")?e.forEach((t,n,i)=>{this.#z(t,e.maybeChild(i+1)??void 0)}):this.#z(e),this),this.toString=e=>e.stringify(this.build()),this.run=e=>(this.#j=[],this.next(e),this),this.schema=e}#B;#$;#W;#K;#q;#z;#H;#U;#J;#F;#L;#G;#_};e.s(["E",0,u,"v",0,p],19040)},934471,e=>{var t=e.i(111092),n=e.i(605938),i=e.i(93464);let o=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},r=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},s=null,l=function(e,t,n){let i=s||(s=document.createRange());return i.setEnd(e,null==n?e.nodeValue.length:n),i.setStart(e,t||0),i},a=function(){s=null},c=function(e,t,n,i){return n&&(h(e,t,n,i,-1)||h(e,t,n,i,1))},d=/^(img|br|input|textarea|hr)$/i;function h(e,t,n,i,r){for(var s;;){if(e==n&&t==i)return!0;if(t==(r<0?0:u(e))){let n=e.parentNode;if(!n||!f(n)||g(e)||d.test(e.nodeName)||"false"==e.contentEditable)return!1;t=o(e)+(r<0?0:1),e=n}else{if(!f(e))return!1;let n=e.childNodes[t+(r<0?-1:0)];if(f(n)&&"false"==n.contentEditable)if(null==(s=n.pmViewDesc)||!s.ignoreForSelection)return!1;else t+=r;else e=n,t=r<0?u(e):0}}}function u(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function f(e){return 1==e.nodeType}function p(e){return 3==e.nodeType}function m(e,t){return!!t&&e.contains(f(t)?t:t.parentNode)}function g(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let y=function(e){return e.focusNode&&c(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function v(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let w="u">typeof navigator?navigator:null,b="u">typeof document?document:null,S=w&&w.userAgent||"",k=/Edge\/(\d+)/.exec(S),C=/MSIE \d/.exec(S),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(S),N=!!(C||x||k),M=C?document.documentMode:x?+x[1]:k?+k[1]:0,D=!N&&/gecko\/(\d+)/i.test(S);D&&(/Firefox\/(\d+)/.exec(S)||[0,0])[1];let O=!N&&/Chrome\/(\d+)/.exec(S),T=!!O,A=O?+O[1]:0,P=!N&&!!w&&/Apple Computer/.test(w.vendor),E=P&&(/Mobile\/\w+/.test(S)||!!w&&w.maxTouchPoints>2),V=E||!!w&&/Mac/.test(w.platform),R=!!w&&/Win/.test(w.platform),I=/Android \d/.test(S),B=!!b&&"webkitFontSmoothing"in b.documentElement.style,z=B?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function F(e,t){return"number"==typeof e?e:e[t]}function L(e,t,n){if(!q(t)&&0==t.left)return;let i=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let l=n||e.dom;l;){if(!f(l)){l=r(l);continue}let e=l==s.body,n=e?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(s):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*i}}(l),a=0,c=0;if(t.top<n.top+F(i,"top")?c=-(n.top-t.top+F(o,"top")):t.bottom>n.bottom-F(i,"bottom")&&(c=t.bottom-t.top>n.bottom-n.top?t.top+F(o,"top")-n.top:t.bottom-n.bottom+F(o,"bottom")),t.left<n.left+F(i,"left")?a=-(n.left-t.left+F(o,"left")):t.right>n.right-F(i,"right")&&(a=t.right-n.right+F(o,"right")),a||c)if(e)s.defaultView.scrollBy(a,c);else{let e=l.scrollLeft,n=l.scrollTop;c&&(l.scrollTop+=c),a&&(l.scrollLeft+=a);let i=l.scrollLeft-e,o=l.scrollTop-n;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let d=e?"fixed":getComputedStyle(l).position;if(/^(fixed|sticky)$/.test(d))break;l="absolute"==d?l.offsetParent:r(l)}}function j(e){let t=[],n=e.ownerDocument;for(let i=e;i&&(t.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),e!=n);i=r(i));return t}function $(e,t){for(let n=0;n<e.length;n++){let{dom:i,top:o,left:r}=e[n];i.scrollTop!=o+t&&(i.scrollTop=o+t),i.scrollLeft!=r&&(i.scrollLeft=r)}}let W=null;function K(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function q(e){return e.top<e.bottom||e.left<e.right}function _(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(q(e))return e}return Array.prototype.find.call(n,q)||e.getBoundingClientRect()}let H=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function U(e,t,n){let{node:i,offset:o,atom:r}=e.docView.domFromPos(t,n<0?-1:1),s=B||D;if(p(i))if(s&&(H.test(i.nodeValue)||(n<0?!o:o==i.nodeValue.length))){let e=_(l(i,o,o),n);if(D&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let t=_(l(i,o-1,o-1),-1);if(t.top==e.top){let n=_(l(i,o,o+1),-1);if(n.top!=e.top)return J(n,n.left<t.left)}}return e}else{let e=o,t=o,r=n<0?1:-1;return n<0&&!o?(t++,r=-1):n>=0&&o==i.nodeValue.length?(e--,r=1):n<0?e--:t++,J(_(l(i,e,t),r),r<0)}if(!e.state.doc.resolve(t-(r||0)).parent.inlineContent){if(null==r&&o&&(n<0||o==u(i))){let e=i.childNodes[o-1];if(f(e))return G(e.getBoundingClientRect(),!1)}if(null==r&&o<u(i)){let e=i.childNodes[o];if(f(e))return G(e.getBoundingClientRect(),!0)}return G(i.getBoundingClientRect(),n>=0)}if(null==r&&o&&(n<0||o==u(i))){let e=i.childNodes[o-1],t=p(e)?l(e,u(e)-!s):f(e)&&("BR"!=e.nodeName||!e.nextSibling)?e:null;if(t)return J(_(t,1),!1)}if(null==r&&o<u(i)){let e=i.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?p(e)?l(e,0,+!s):f(e)?e:null:null;if(t)return J(_(t,-1),!0)}return J(_(p(i)?l(i):i,-n),n>=0)}function J(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function G(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Y(e,t,n){let i=e.state,o=e.root.activeElement;i!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{i!=t&&e.updateState(i),o!=e.dom&&o&&o.focus()}}let Z=/[\u0590-\u08ac]/,X=null,Q=null,ee=!1;class et{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){let i;if(this.contentDOM&&m(this.contentDOM,e))if(n<0){let n,i;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((i=n.pmViewDesc)&&i.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(i)+i.size:this.posAtStart}else{let n,i;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((i=n.pmViewDesc)&&i.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(i):this.posAtEnd}if(e==this.dom&&this.contentDOM)i=t>o(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(4&e.compareDocumentPosition(this.contentDOM));else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!1;break}if(t.previousSibling)break}if(null==i&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!0;break}if(t.nextSibling)break}}return(null==i?n>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),r;if(o&&(!t||o.node))if(!n||!(r=o.nodeDOM)||(f(r)?m(r,e):r==e))return o;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],o=n+i.size;if(n==e&&o!=n){for(;!i.border&&i.children.length;)for(let e=0;e<i.children.length;e++){let t=i.children[e];if(t.size){i=t;break}}return i}if(e<o)return i.descAt(e-n-i.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let t=0;n<this.children.length;n++){let o=t+this.children[n].size;if(o>e){i=e-t;break}t=o}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof ea||e instanceof en&&e.side>=0))break}if(t<=0){let e,i=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,i=!1);return e&&t&&i&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?o(e.dom)+1:0}}{let e,i=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,i=!1);return e&&i&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?o(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,r=-1;for(let s=n,l=0;;l++){let n=this.children[l],a=s+n.size;if(-1==i&&e<=a){let r=s+n.border;if(e>=r&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,r);e=s;for(let t=l;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){i=o(n.dom)+1;break}e-=n.size}-1==i&&(i=0)}if(i>-1&&(a>t||l==this.children.length-1)){t=a;for(let e=l+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){r=o(n.dom);break}t+=n.size}-1==r&&(r=this.contentDOM.childNodes.length);break}s=a}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:r}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(!f(t)||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let r=Math.min(e,t),s=Math.max(e,t);for(let o=0,l=0;o<this.children.length;o++){let a=this.children[o],c=l+a.size;if(r>l&&s<c)return a.setSelection(e-l-a.border,t-l-a.border,n,i);l=c}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),d=n.root.getSelection(),h=n.domSelectionRange(),u=!1;if((D||P)&&e==t){let{node:e,offset:t}=l;if(p(e)){if((u=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(l=a={node:n.parentNode,offset:o(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(D&&h.focusNode&&h.focusNode!=a.node&&f(h.focusNode)){let e=h.focusNode.childNodes[h.focusOffset];e&&"false"==e.contentEditable&&(i=!0)}if(!(i||u&&P)&&c(l.node,l.offset,h.anchorNode,h.anchorOffset)&&c(a.node,a.offset,h.focusNode,h.focusOffset))return;let m=!1;if((d.extend||e==t)&&!(u&&D)){d.collapse(l.node,l.offset);try{e!=t&&d.extend(a.node,a.offset),m=!0}catch(e){}}if(!m){if(e>t){let e=l;l=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let o=this.children[i],r=n+o.size;if(n==r?e<=r&&t>=n:e<r&&t>n){let i=n+o.border,s=r-o.border;if(e>=i&&t<=s){this.dirty=e==n||t==r?2:1,e==i&&t==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(e-i,t-i);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=r}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class en extends et{constructor(e,t,n,i){let o,r=t.type.toDOM;if("function"==typeof r&&(r=r(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!t.type.spec.raw){let e=f(r)?r:document.createElement("span");e!=r&&e.appendChild(r),e.hasAttribute("contenteditable")||(e.contentEditable="false"),e.classList.add("ProseMirror-widget")}super(e,[],r,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ei extends et{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class eo extends et{constructor(e,t,n,i,o){super(e,[],n,i),this.mark=t,this.spec=o}static create(e,t,i,o){let r=o.nodeViews[t.type.name],s=r&&r(t,o,i);return s&&s.dom||(s=n.h.renderSpec(document,t.type.spec.toDOM(t,i),null,t.attrs)),new eo(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let i=eo.create(this.parent,this.mark,!0,n),o=this.children,r=this.size;t<r&&(o=ew(o,t,r,n)),e>0&&(o=ew(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class er extends et{constructor(e,t,n,i,o,r,s){super(e,[],o,r),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=s}static create(e,t,i,o,r,s){let l=r.nodeViews[t.type.name],a,c=l&&l(t,r,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,i,o),d=c&&c.dom,h=c&&c.contentDOM;if(t.isText)if(d){if(!p(d))throw RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(t.text);else if(!d){let e=n.h.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:d,contentDOM:h}=e)}h||t.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let u=d;return(d=ep(d,i,t),c)?a=new ec(e,t,i,o,d,h||null,u,c):t.isText?new el(e,t,i,o,d,u):new er(e,t,i,o,d,h||null,u)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let i=e&&e.find(t=>f(t)&&0>e.indexOf(t.parentNode)&&this.dom.contains(t));i?t.contentElement=i:t.getContent=()=>n.y.empty}}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&em(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let i=this.node.inlineContent,o=t,r=e.composing?this.localCompositionInfo(e,t):null,s=r&&r.pos>-1?r:null,l=r&&r.pos<0,a=new ey(this,s&&s.node,e),c=this.node.inlineContent,d=c&&this.node.isBlock;(function(e,t,n,i){let o=t.locals(e),r=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);i(s,o,t.forChild(r,s),n),r+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let d,h,u,f;for(;s<o.length&&o[s].to==r;){let e=o[s++];e.widget&&(d?(h||(h=[d])).push(e):d=e)}if(d)if(h){h.sort(ev);for(let e=0;e<h.length;e++)n(h[e],c,!!a)}else n(d,c,!!a);if(a)f=-1,u=a,a=null;else if(c<e.childCount)f=c,u=e.child(c++);else break;for(let e=0;e<l.length;e++)l[e].to<=r&&l.splice(e--,1);for(;s<o.length&&o[s].from<=r&&o[s].to>r;)l.push(o[s++]);let p=r+u.nodeSize;if(u.isText){let e=p;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<p&&(a=u.cut(e-r),u=u.cut(0,e-r),p=e,f=-1)}else for(;s<o.length&&o[s].to<p;)s++;let m=u.isInline&&!u.isLeaf?l.filter(e=>!e.inline):l.slice();i(u,m,t.forChild(r,u),f),r=p}})(this.node,this.innerDeco,(t,r,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,i,e,r):t.type.side>=0&&!s&&a.syncToMarks(r==this.node.childCount?n.H.none:this.node.child(r).marks,i,e,r),a.placeWidget(t,e,o)},(t,n,s,h)=>{let u;a.syncToMarks(t.marks,i,e,h),d&&t.isAtom&&!t.isText&&a.addHackNode("IMG",a.top),a.findNodeMatch(t,n,s,h)||l&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(u=a.findIndexWithChild(r.node))>-1&&a.updateNodeAt(t,n,s,u,e)||a.updateNextNode(t,n,s,e,h,o)||a.addNode(t,n,s,e,o),o+=t.nodeSize,c&&(d=t.isAtom&&!t.isText)}),a.syncToMarks([],i,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),function e(t,n,i){let o=t.firstChild,r=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=o;)o=eg(o),r=!0;o=o.nextSibling}else r=!0,t.insertBefore(a,o);if(l instanceof eo){let n=o?o.previousSibling:t.lastChild;e(l.contentDOM,l.children,i),o=n?n.nextSibling:t.firstChild}}for(;o;)o=eg(o),r=!0;r&&i.trackWrites==t&&(i.trackWrites=null)}(this.contentDOM,this.children,e),E&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,n){let{from:i,to:o}=e.state.selection;if(!(e.state.selection instanceof t.TextSelection)||i<n||o>n+this.node.content.size)return null;let r=e.input.compositionNode;if(!r||!this.dom.contains(r.parentNode))return null;if(!this.node.inlineContent)return{node:r,pos:-1,text:""};{let e=r.nodeValue,t=function(e,t,n,i){for(let o=0,r=0;o<e.childCount&&r<=i;){let s=e.child(o++),l=r;if(r+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<e.childCount;){let t=e.child(o++);if(r+=t.nodeSize,!t.isText)break;a+=t.text}if(r>=n){if(r>=i&&a.slice(i-t.length-l,i-l)==t)return i-t.length;let e=l<i?a.lastIndexOf(t,i-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==i&&a.length>=i+t.length-l&&a.slice(i-l,i-l+t.length)==t)return i}}return -1}(this.node.content,e,i-n,o-n);return t<0?null:{node:r,pos:t,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let r=new ei(this,o,t,i);e.input.compositionNodes.push(r),this.children=ew(this.children,n,n+i.length,e,r)}update(e,t,n,i){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(em(e,this.outerDeco))return;let t=!f(this.nodeDOM),n=this.dom;this.dom=ef(this.dom,this.nodeDOM,eu(this.outerDeco,this.node,t),eu(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){f(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){f(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function es(e,t,n,i,o){ep(i,t,e);let r=new er(void 0,e,t,n,i,i,i);return r.contentDOM&&r.updateChildren(o,0),r}class el extends er{constructor(e,t,n,i,o,r){super(e,t,n,i,o,null,r)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new el(this.parent,i,this.outerDeco,this.innerDeco,o,o)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ea extends et{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ec extends er{constructor(e,t,n,i,o,r,s,l){super(e,t,n,i,o,r,s),this.spec=l}update(e,t,n,i){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,i),o}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let ed=function(e){e&&(this.nodeName=e)};ed.prototype=Object.create(null);let eh=[new ed];function eu(e,t,n){if(0==e.length)return eh;let i=n?eh[0]:new ed,o=[i];for(let r=0;r<e.length;r++){let s=e[r].type.attrs;if(s)for(let e in s.nodeName&&o.push(i=new ed(s.nodeName)),s){let r=s[e];null!=r&&(n&&1==o.length&&o.push(i=new ed(t.isInline?"span":"div")),"class"==e?i.class=(i.class?i.class+" ":"")+r:"style"==e?i.style=(i.style?i.style+";":"")+r:"nodeName"!=e&&(i[e]=r))}}return o}function ef(e,t,n,i){if(n==eh&&i==eh)return t;let o=t;for(let t=0;t<i.length;t++){let r=i[t],s=n[t];if(t){let t;s&&s.nodeName==r.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==r.nodeName||((t=document.createElement(r.nodeName)).pmIsDeco=!0,t.appendChild(o),s=eh[0]),o=t}!function(e,t,n){for(let i in t)"class"==i||"style"==i||"nodeName"==i||i in n||e.removeAttribute(i);for(let i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=t[i]&&e.setAttribute(i,n[i]);if(t.class!=n.class){let i=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<i.length;t++)-1==o.indexOf(i[t])&&e.classList.remove(i[t]);for(let t=0;t<o.length;t++)-1==i.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}(o,s||eh[0],r)}return o}function ep(e,t,n){return ef(e,e,eh,eu(t,n,!f(e)))}function em(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function eg(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ey{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,i=n.children.length,o=e.childCount,r=new Map,s=[];e:for(;o>0;){let l;for(;;)if(i){let e=n.children[i-1];if(e instanceof eo)n=e,i=e.children.length;else{l=e,i--;break}}else if(n==t)break e;else i=n.parent.children.indexOf(n),n=n.parent;let a=l.node;if(a){if(a!=e.child(o-1))break;--o,r.set(l,o),s.push(l)}}return{index:o,matched:r,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,i){let o=0,r=this.stack.length>>1,s=Math.min(r,e.length);for(;o<s&&(o==r-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<r;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),r--;for(;r<e.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;i<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[r])&&!this.isLocked(n.dom)){o=t;break}}if(o<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof eo&&3!=t.dirty&&t.mark.type==e[r].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[r])&&(t.mark=e[r],o=this.index,this.changed=!0)}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let i=eo.create(this.top,e[r],t,n);this.top.children.splice(this.index,0,i),this.top=i,this.changed=!0}this.index=0,r++}}findNodeMatch(e,t,n,i){let o=-1,r;if(i>=this.preMatch.index&&(r=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&r.matchesNode(e,t,n))o=this.top.children.indexOf(r,this.index);else for(let i=this.index,r=Math.min(this.top.children.length,i+5);i<r;i++){let r=this.top.children[i];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=i;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,i,o){let r=this.top.children[i];return 3==r.dirty&&r.dom==r.contentDOM&&(r.dirty=2),!!r.update(e,t,n,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,n,i,o,r){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof er){let a=this.preMatch.matched.get(l);if(null!=a&&a!=o)return!1;let c=l.dom,d,h=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&em(t,l.outerDeco));if(!h&&l.update(e,t,n,i))return this.destroyBetween(this.index,s),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,t,n,i,r)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=2,d.updateChildren(i,r+1),d.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,o,r){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!em(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let s=er.create(this.top,t,n,i,o,r);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,i,o){let r=er.create(this.top,e,t,n,i,o);r.contentDOM&&r.updateChildren(i,o+1),this.top.children.splice(this.index++,0,r),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let i=new en(this.top,e,t,n);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof eo;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof el)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((P||T)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let i=new ea(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||f(e)&&e.contains(this.lock.parentNode))}}function ev(e,t){return e.type.side-t.type.side}function ew(e,t,n,i,o){let r=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,d=l+=a.size;c>=n||d<=t?r.push(a):(c<t&&r.push(a.slice(0,t-c,i)),o&&(r.push(o),o=void 0),d>n&&r.push(a.slice(n-c,a.size,i)))}return r}function eb(e,n=null){let i=e.domSelectionRange(),r=e.state.doc;if(!i.focusNode)return null;let s=e.docView.nearestDesc(i.focusNode),l=s&&0==s.size,a=e.docView.posFromDOM(i.focusNode,i.focusOffset,1);if(a<0)return null;let c=r.resolve(a),d,h;if(y(i)){for(d=a;s&&!s.node;)s=s.parent;if(s&&s.node.isAtom&&t.NodeSelection.isSelectable(s.node)&&s.parent&&!(s.node.isInline&&function(e,t,n){for(let i=0==t,r=t==u(e);i||r;){if(e==n)return!0;let t=o(e);if(!(e=e.parentNode))return!1;i=i&&0==t,r=r&&t==u(e)}}(i.focusNode,i.focusOffset,s.dom))){let e=s.posBefore;h=new t.NodeSelection(a==e?c:r.resolve(e))}else if(D&&"key"==n&&a>e.state.selection.to&&f(i.focusNode)&&i.focusOffset==i.focusNode.childNodes.length&&s&&s.posAtStart>e.state.selection.to)for(let e=i.focusNode;;e=e.parentNode){if("visible"!=getComputedStyle(e).overflow){h=t.Selection.findFrom(r.resolve(s.posAtStart),1);break}if(e==s.dom||e.nextSibling||!e.parentNode||!f(e.parentNode))break}}else{if(i instanceof e.dom.ownerDocument.defaultView.Selection&&i.rangeCount>1){let t=a,n=a;for(let o=0;o<i.rangeCount;o++){let r=i.getRangeAt(o);t=Math.min(t,e.docView.posFromDOM(r.startContainer,r.startOffset,1)),n=Math.max(n,e.docView.posFromDOM(r.endContainer,r.endOffset,-1))}if(t<0)return null;[d,a]=n==e.state.selection.anchor?[n,t]:[t,n],c=r.resolve(a)}else d=e.docView.posFromDOM(i.anchorNode,i.anchorOffset,1);if(d<0)return null}let p=r.resolve(d);if(!h){let t="pointer"==n||e.state.selection.head<c.pos&&!l?1:-1;h=eT(e,p,c,t)}return h}function eS(e){return e.editable?e.hasFocus():eP(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ek(e,n=!1){let i=e.state.selection;if(eD(e,i),!eS(e))return;let r=e.input.mouseDown;if(!n&&T&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&c(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate())return void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,i="IMG"==n.nodeName;i?t.collapse(n.parentNode,o(n)+1):t.collapse(n,0),!i&&!e.state.selection.visible&&N&&M<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var s;let o,r,l,a,{anchor:c,head:d}=i,h,u;eC&&!(i instanceof t.TextSelection)&&(i.$from.parent.inlineContent||(h=ex(e,i.from)),i.empty||i.$from.parent.inlineContent||(u=ex(e,i.to))),e.docView.setSelection(c,d,e,n),eC&&(h&&eM(h),u&&eM(u)),i.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((o=(s=e).dom.ownerDocument).removeEventListener("selectionchange",s.input.hideSelectionGuard),l=(r=s.domSelectionRange()).anchorNode,a=r.anchorOffset,o.addEventListener("selectionchange",s.input.hideSelectionGuard=()=>{(r.anchorNode!=l||r.anchorOffset!=a)&&(o.removeEventListener("selectionchange",s.input.hideSelectionGuard),setTimeout(()=>{(!eS(s)||s.state.selection.visible)&&s.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}let eC=P||T&&A<63;function ex(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),o=i<n.childNodes.length?n.childNodes[i]:null,r=i?n.childNodes[i-1]:null;if(P&&o&&"false"==o.contentEditable)return eN(o);if((!o||"false"==o.contentEditable)&&(!r||"false"==r.contentEditable)){if(o)return eN(o);else if(r)return eN(r)}}function eN(e){return e.contentEditable="true",P&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function eM(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function eD(e,n){if(n instanceof t.NodeSelection){let t=e.docView.descAt(n.from);t!=e.lastSelectedViewDesc&&(eO(e),t&&t.selectNode(),e.lastSelectedViewDesc=t)}else eO(e)}function eO(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function eT(e,n,i,o){return e.someProp("createSelectionBetween",t=>t(e,n,i))||t.TextSelection.between(n,i,o)}function eA(e){return(!e.editable||!!e.hasFocus())&&eP(e)}function eP(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return m(e.dom,t.anchorNode)&&(e.editable||m(e.dom,t.focusNode))}catch(e){return!1}}function eE(e,n){let{$anchor:i,$head:o}=e.selection,r=n>0?i.max(o):i.min(o),s=r.parent.inlineContent?r.depth?e.doc.resolve(n>0?r.after():r.before()):null:r;return s&&t.Selection.findFrom(s,n)}function eV(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function eR(e,n,i){let o=e.state.selection;if(o instanceof t.TextSelection){if(i.indexOf("s")>-1){let{$head:i}=o,r=i.textOffset?null:n<0?i.nodeBefore:i.nodeAfter;if(!r||r.isText||!r.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+r.nodeSize*(n<0?-1:1));return eV(e,new t.TextSelection(o.$anchor,s))}else if(!o.empty)return!1;else if(e.endOfTextblock(n>0?"forward":"backward")){let i=eE(e.state,n);return!!i&&i instanceof t.NodeSelection&&eV(e,i)}else if(!(V&&i.indexOf("m")>-1)){let i=o.$head,r=i.textOffset?null:n<0?i.nodeBefore:i.nodeAfter,s;if(!r||r.isText)return!1;let l=n<0?i.pos-r.nodeSize:i.pos;return!!(r.isAtom||(s=e.docView.descAt(l))&&!s.contentDOM)&&(t.NodeSelection.isSelectable(r)?eV(e,new t.NodeSelection(n<0?e.state.doc.resolve(i.pos-r.nodeSize):i)):eV(e,new t.TextSelection(e.state.doc.resolve(n<0?l:l+r.nodeSize))))}}else{if(o instanceof t.NodeSelection&&o.node.isInline)return eV(e,new t.TextSelection(n>0?o.$to:o.$from));let i=eE(e.state,n);return!!i&&eV(e,i)}}function eI(e,t){let n=e.pmViewDesc;return n?0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName):f(e)&&"false"==e.contentEditable}function eB(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,s,l=!1;for(D&&f(n)&&i<u(n)&&eI(n.childNodes[i],-1)&&(l=!0);;)if(i>0){if(!f(n))break;let e=n.childNodes[i-1];if(eI(e,-1))r=n,s=--i;else if(p(e))i=(n=e).nodeValue.length;else break}else if(ez(n))break;else{let t=n.previousSibling;for(;t&&eI(t,-1);)r=n.parentNode,s=o(t),t=t.previousSibling;if(t)i=u(n=t);else{if((n=n.parentNode)==e.dom)break;i=0}}l?eF(e,n,i):r&&eF(e,r,s)}(e):function(e){let t,n,i=e.domSelectionRange(),r=i.focusNode,s=i.focusOffset;if(!r)return;let l=u(r);for(;;)if(s<l){if(!f(r))break;if(eI(r.childNodes[s],1))t=r,n=++s;else break}else if(ez(r))break;else{let i=r.nextSibling;for(;i&&eI(i,1);)t=i.parentNode,n=o(i)+1,i=i.nextSibling;if(i)s=0,l=u(r=i);else{if((r=r.parentNode)==e.dom)break;s=l=0}}t&&eF(e,t,n)}(e)}function ez(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function eF(e,t,n){if(!p(t)){let e,i;(i=function(e,t){for(;e&&t==e.childNodes.length&&!g(e);)t=o(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(p(n))return n;if(f(n)&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=i,n=0):(e=function(e,t){for(;e&&!t&&!g(e);)t=o(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(p(n))return n;if(f(n)&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let i=e.domSelection();if(!i)return;if(y(i)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),i.removeAllRanges(),i.addRange(e)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&ek(e)},50)}function eL(e,t){let n=e.state.doc.resolve(t);if(!(T||R)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(n.left-i.left)>1)return n.left<i.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(n.left-i.left)>1)return n.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function ej(e,n,i){let o=e.state.selection;if(o instanceof t.TextSelection&&!o.empty||i.indexOf("s")>-1||V&&i.indexOf("m")>-1)return!1;let{$from:r,$to:s}=o;if(!r.parent.inlineContent||e.endOfTextblock(n<0?"up":"down")){let i=eE(e.state,n);if(i&&i instanceof t.NodeSelection)return eV(e,i)}if(!r.parent.inlineContent){let i=n<0?r:s,l=o instanceof t.AllSelection?t.Selection.near(i,n):t.Selection.findFrom(i,n);return!!l&&eV(e,l)}return!1}function e$(e,n){if(!(e.state.selection instanceof t.TextSelection))return!0;let{$head:i,$anchor:o,empty:r}=e.state.selection;if(!i.sameParent(o))return!0;if(!r)return!1;if(e.endOfTextblock(n>0?"forward":"backward"))return!0;let s=!i.textOffset&&(n<0?i.nodeBefore:i.nodeAfter);if(s&&!s.isText){let t=e.state.tr;return n<0?t.delete(i.pos-s.nodeSize,i.pos):t.delete(i.pos,i.pos+s.nodeSize),e.dispatch(t),!0}return!1}function eW(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function eK(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let i=[],{content:o,openStart:r,openEnd:s}=t;for(;r>1&&s>1&&1==o.childCount&&1==o.firstChild.childCount;){r--,s--;let e=o.firstChild;i.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),o=e.content}let l=e.someProp("clipboardSerializer")||n.h.fromSchema(e.state.schema),a=eY(),c=a.createElement("div");c.appendChild(l.serializeFragment(o,{document:a}));let d=c.firstChild,h,u=0;for(;d&&f(d)&&(h=eG[d.nodeName.toLowerCase()]);){for(let e=h.length-1;e>=0;e--){let t=a.createElement(h[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),u++}d=c.firstChild}return d&&f(d)&&d.setAttribute("data-pm-slice",`${r} ${s}${u?` -${u}`:""} ${JSON.stringify(i)}`),{dom:c,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function eq(e,t,i,o,r){let s,l,a=r.parent.type.spec.code;if(!i&&!t)return null;let c=!!t&&(o||a||!i);if(c){if(e.someProp("transformPastedText",n=>{t=n(t,a||o,e)}),a)return l=new n.k(n.y.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let i=e.someProp("clipboardTextParser",n=>n(t,r,o,e));if(i)l=i;else{let i=r.marks(),{schema:o}=e.state,l=n.h.fromSchema(o);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(o.text(e,i)))})}}else e.someProp("transformPastedHTML",t=>{i=t(i,e)}),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=eY(),i=n.body,o=/<([a-z][^>\s]+)/i.exec(e),r;if((r=o&&eG[o[1].toLowerCase()])&&(e=r.map(e=>"<"+e+">").join("")+e+r.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;if(!eZ){if(eZ=t.defaultPolicy)try{return eZ.createHTML(e)}catch(e){}eZ=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})}return eZ.createHTML(e)}(e),r)for(let e=0;e<r.length;e++)i=i.querySelector(r[e])||i;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=i.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return i}(i),B&&function(e){let t=e.querySelectorAll(T?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];1==i.childNodes.length&&" "==i.textContent&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}(s);let d=s&&s.querySelector("[data-pm-slice]"),h=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let e=+h[3];e>0;e--){let e=s.firstChild;for(;e&&!f(e);)e=e.nextSibling;if(!e)break;s=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||n.p.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||h),context:r,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||e_.test(e.parentNode.nodeName)?null:{ignore:!0}})),h)l=function(e,t){if(!e.size)return e;let i=e.content.firstChild.type.schema,o;try{o=JSON.parse(t)}catch(t){return e}let{content:r,openStart:s,openEnd:l}=e;for(let e=o.length-2;e>=0;e-=2){let t=i.nodes[o[e]];if(!t||t.hasRequiredAttrs())break;try{r=n.y.from(t.create(o[e+1],r))}catch(e){break}s++,l++}return new n.k(r,s,l)}(eJ(l,+h[1],+h[2]),h[4]);else if((l=n.k.maxOpen(function(e,t){if(e.childCount<2)return e;for(let i=t.depth;i>=0;i--){let o=t.node(i).contentMatchAt(t.index(i)),r,s=[];if(e.forEach(e=>{if(!s)return;let t=o.findWrapping(e.type),i;if(!t)return s=null;if(i=s.length&&r.length&&function e(t,i,o,r,s){if(s<t.length&&s<i.length&&t[s]==i[s]){let l=e(t,i,o,r.lastChild,s+1);if(l)return r.copy(r.content.replaceChild(r.childCount-1,l));if(r.contentMatchAt(r.childCount).matchType(s==t.length-1?o.type:t[s+1]))return r.copy(r.content.append(n.y.from(eH(o,t,s+1))))}}(t,r,e,s[s.length-1],0))s[s.length-1]=i;else{s.length&&(s[s.length-1]=function e(t,i){if(0==i)return t;let o=t.content.replaceChild(t.childCount-1,e(t.lastChild,i-1)),r=t.contentMatchAt(t.childCount).fillBefore(n.y.empty,!0);return t.copy(o.append(r))}(s[s.length-1],r.length));let i=eH(e,t);s.push(i),o=o.matchType(i.type),r=t}}),s)return n.y.from(s)}return e}(l.content,r),!0)).openStart||l.openEnd){let e=0,t=0;for(let t=l.content.firstChild;e<l.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=l.content.lastChild;t<l.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);l=eJ(l,e,t)}return e.someProp("transformPasted",t=>{l=t(l,e,c)}),l}let e_=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function eH(e,t,i=0){for(let o=t.length-1;o>=i;o--)e=t[o].create(null,n.y.from(e));return e}function eU(e,t,i,o,r,s){let l=t<0?e.firstChild:e.lastChild,a=l.content;return e.childCount>1&&(s=0),r<o-1&&(a=eU(a,t,i,o,r+1,s)),r>=i&&(a=t<0?l.contentMatchAt(0).fillBefore(a,s<=r).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(n.y.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function eJ(e,t,i){return t<e.openStart&&(e=new n.k(eU(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),i<e.openEnd&&(e=new n.k(eU(e.content,1,i,e.openEnd,0,0),e.openStart,i)),e}let eG={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function eY(){return document.implementation.createHTMLDocument("title")}let eZ=null,eX={},eQ={},e0={touchstart:!0,touchmove:!0};class e1{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function e2(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function e3(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>e6(e,t))})}function e6(e,t){return e.someProp("handleDOMEvents",n=>{let i=n[t.type];return!!i&&(i(e,t)||t.defaultPrevented)})}function e4(e){return{left:e.clientX,top:e.clientY}}function e5(e,t,n,i,o){if(-1==i)return!1;let r=e.state.doc.resolve(i);for(let i=r.depth+1;i>0;i--)if(e.someProp(t,t=>i>r.depth?t(e,n,r.nodeAfter,r.before(i),o,!0):t(e,n,r.node(i),r.before(i),o,!1)))return!0;return!1}function e9(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function e7(e,n,i){let o=e.state.doc;if(-1==n)return o.inlineContent?t.TextSelection.create(o,0,o.content.size):null;let r=o.resolve(n);for(let e=r.depth+1;e>0;e--){let n=e>r.depth?r.nodeAfter:r.node(e),s=r.before(e);if(n.inlineContent)return t.TextSelection.create(o,s+1,s+1+n.content.size);if(i&&t.NodeSelection.isSelectable(n))return t.NodeSelection.create(o,s)}return null}eQ.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!ti(e))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!I||!T||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!E||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,i=t.keyCode,o=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==i||V&&72==i&&"c"==o)return e$(e,-1)||eB(e,-1);if(46==i&&!t.shiftKey||V&&68==i&&"c"==o)return e$(e,1)||eB(e,1);if(13==i||27==i)return!0;if(37==i||V&&66==i&&"c"==o){let t=37==i?"ltr"==eL(e,e.state.selection.from)?-1:1:-1;return eR(e,t,o)||eB(e,t)}if(39==i||V&&70==i&&"c"==o){let t=39==i?"ltr"==eL(e,e.state.selection.from)?1:-1:1;return eR(e,t,o)||eB(e,t)}else if(38==i||V&&80==i&&"c"==o)return ej(e,-1,o)||eB(e,-1);else if(40==i||V&&78==i&&"c"==o)return function(e){if(!P||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&f(t)&&0==n&&t.firstChild&&f(t.firstChild)&&"false"==t.firstChild.contentEditable){let n=t.firstChild;eW(e,n,"true"),setTimeout(()=>eW(e,n,"false"),20)}return!1}(e)||ej(e,1,o)||eB(e,1);else if(o==(V?"m":"c")&&(66==i||73==i||89==i||90==i))return!0;return!1}(e,t)?t.preventDefault():e2(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,v(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},eQ.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},eQ.keypress=(e,n)=>{if(ti(e)||!n.charCode||n.ctrlKey&&!n.altKey||V&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof t.TextSelection)||!i.$from.sameParent(i.$to)){let t=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,i.$from.pos,i.$to.pos,t,o))||e.dispatch(o()),n.preventDefault()}};let e8=V?"metaKey":"ctrlKey";eX.mousedown=(e,n)=>{var i;let o,r;e.input.shiftKey=n.shiftKey;let s=tl(e),l=Date.now(),a="singleClick";l-e.input.lastClick.time<500&&(o=(i=e.input.lastClick).x-n.clientX)*o+(r=i.y-n.clientY)*r<100&&!n[e8]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:l,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let c=e.posAtCoords(e4(n));c&&("singleClick"==a?e.input.mouseDown=new tt(e,c,n,!!s):("doubleClick"==a?function(e,t,n,i){return e5(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",n=>n(e,t,i))}:function(e,n,i,o){return e5(e,"handleTripleClickOn",n,i,o)||e.someProp("handleTripleClick",t=>t(e,n,o))||function(e,n,i){if(0!=i.button)return!1;let o=e7(e,n,!0),r=e.state.doc;return!!o&&(e9(e,o),o instanceof t.TextSelection&&r.eq(e.state.doc)&&(e.input.mouseDown=new tn(e,o)),!0)}(e,i,o)})(e,c.pos,c.inside,n)?n.preventDefault():e2(e,"pointer"))};class te{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){0==e.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class tt extends te{constructor(e,n,i,o){let r,s;if(super(e),this.pos=n,this.event=i,this.flushed=o,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!i[e8],this.allowDefault=i.shiftKey,n.inside>-1)r=e.state.doc.nodeAt(n.inside),s=n.inside;else{let t=e.state.doc.resolve(n.pos);r=t.parent,s=t.depth?t.before():0}let l=o?null:i.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&f(a.nodeDOM)?a.nodeDOM:null;let{selection:c}=e.state;0==i.button&&(r.type.spec.draggable&&!1!==r.type.spec.selectable||c instanceof t.NodeSelection&&c.from<=s&&c.to>s)&&(this.mightDrag={node:r,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&D&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e2(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||ek(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;if(this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(e4(e))),this.updateAllowDefault(e),this.allowDefault||!n)e2(this.view,"pointer");else{var i,o,r,s;(i=this.view,o=n.pos,r=n.inside,s=this.selectNode,e5(i,"handleClickOn",o,r,e)||i.someProp("handleClick",t=>t(i,o,e))||(s?function(e,n){if(-1==n)return!1;let i=e.state.selection,o,r;i instanceof t.NodeSelection&&(o=i.node);let s=e.state.doc.resolve(n);for(let e=s.depth+1;e>0;e--){let n=e>s.depth?s.nodeAfter:s.node(e);if(t.NodeSelection.isSelectable(n)){r=o&&i.$from.depth>0&&e>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(e);break}}return null!=r&&(e9(e,t.NodeSelection.create(e.state.doc,r)),!0)}(i,r):function(e,n){if(-1==n)return!1;let i=e.state.doc.resolve(n),o=i.nodeAfter;return!!(o&&o.isAtom&&t.NodeSelection.isSelectable(o))&&(e9(e,new t.NodeSelection(i)),!0)}(i,r)))?e.preventDefault():0==e.button&&(this.flushed||P&&this.mightDrag&&!this.mightDrag.node.isAtom||T&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to)))?(e9(this.view,t.Selection.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):e2(this.view,"pointer")}}move(e){this.updateAllowDefault(e),e2(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}}class tn extends te{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),e2(this.view,"pointer");let n=this.view.posAtCoords(e4(e)),i=n&&e7(this.view,n.inside,!1);if(!i)return;let{doc:o}=this.view.state,r=this.startSelection,[s,l]=i.from<r.from?[r.to,i.from]:[r.from,i.to];e9(this.view,t.TextSelection.create(o,s,l))}}function ti(e,t){return!!e.composing||!!(P&&500>Math.abs(Date.now()-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}eX.touchstart=e=>{e.input.lastTouch=Date.now(),tl(e),e2(e,"pointer")},eX.touchmove=e=>{e.input.lastTouch=Date.now(),e2(e,"pointer")},eX.contextmenu=e=>tl(e);let to=I?5e3:-1;function tr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>tl(e),t))}function ts(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function tl(e,t=!1){if(!I||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ts(e),t||e.docView&&e.docView.dirty){let n=eb(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}eQ.compositionstart=eQ.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:n}=e,i=n.selection.$to;if(n.selection instanceof t.TextSelection&&n.selection.empty&&(n.storedMarks||!i.textOffset&&i.parentOffset&&i.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||T&&R&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!f(t)||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return f(i)&&"false"==i.contentEditable}(e)))e.markCursor=e.state.storedMarks||i.marks(),tl(e,!0),e.markCursor=null;else if(tl(e,!n.selection.empty),D&&n.selection.empty&&i.parentOffset&&!i.textOffset&&i.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,i=t.focusOffset;n&&f(n)&&0!=i;){let t=i<0?n.lastChild:n.childNodes[i-1];if(!t)break;if(p(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,i=-1}}e.input.composing=!0}tr(e,to)},eQ.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,tr(e,20))};let ta=N&&M<15||E&&z<604;function tc(e,t,i,o,r){let s=eq(e,t,i,o,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,r,s||n.k.empty)))return!0;if(!s)return!1;let l=0==s.openStart&&0==s.openEnd&&1==s.content.childCount?s.content.firstChild:null,a=l?e.state.tr.replaceSelectionWith(l,o):e.state.tr.replaceSelection(s);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function td(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}eX.copy=eQ.cut=(e,t)=>{let n=e.state.selection,i="cut"==t.type;if(n.empty)return;let o=ta?null:t.clipboardData,{dom:r,text:s}=eK(e,n.content());o?(t.preventDefault(),o.clearData(),o.setData("text/html",r.innerHTML),o.setData("text/plain",s)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,r),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},eQ.paste=(e,t)=>{if(e.composing&&!I)return;let n=ta?null:t.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&tc(e,td(n),n.getData("text/html"),i,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?tc(e,i.value,null,o,t):tc(e,i.textContent,i.innerHTML,o,t)},50)}(e,t)};class th{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let tu=V?"altKey":"ctrlKey";function tf(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[tu]}for(let e in eX.dragstart=(e,n)=>{let i,o=e.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let r=e.state.selection,s=r.empty?null:e.posAtCoords(e4(n));if(s&&s.pos>=r.from&&s.pos<=(r instanceof t.NodeSelection?r.to-1:r.to));else if(o&&o.mightDrag)i=t.NodeSelection.create(e.state.doc,o.mightDrag.pos);else if(n.target&&f(n.target)){let o=e.docView.nearestDesc(n.target,!0);o&&o.node.type.spec.draggable&&o!=e.docView&&(i=t.NodeSelection.create(e.state.doc,o.posBefore))}let l=(i||e.state.selection).content(),{dom:a,text:c,slice:d}=eK(e,l);n.dataTransfer.files.length&&T&&!(A>120)||n.dataTransfer.clearData(),n.dataTransfer.setData(ta?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",ta||n.dataTransfer.setData("text/plain",c),e.dragging=new th(d,tf(e,n),i)},eX.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},eQ.dragover=eQ.dragenter=(e,t)=>t.preventDefault(),eQ.drop=(e,o)=>{try{!function(e,o,r){if(!o.dataTransfer)return;let s=e.posAtCoords(e4(o));if(!s)return;let l=e.state.doc.resolve(s.pos),a=r&&r.slice;a?e.someProp("transformPasted",t=>{a=t(a,e,!1)}):a=eq(e,td(o.dataTransfer),ta?null:o.dataTransfer.getData("text/html"),!1,l);let c=!!(r&&tf(e,o));if(e.someProp("handleDrop",t=>t(e,o,a||n.k.empty,c)))return o.preventDefault();if(!a)return;o.preventDefault();let d=a?(0,i.s)(e.state.doc,l.pos,a):l.pos;null==d&&(d=l.pos);let h=e.state.tr;if(c){let{node:e}=r;e?e.replace(h):h.deleteSelection()}let u=h.mapping.map(d),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,p=h.doc;if(f?h.replaceRangeWith(u,u,a.content.firstChild):h.replaceRange(u,u,a),h.doc.eq(p))return;let m=h.doc.resolve(u);if(f&&t.NodeSelection.isSelectable(a.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new t.NodeSelection(m));else{let t=h.mapping.map(d);h.mapping.maps[h.mapping.maps.length-1].forEach((e,n,i,o)=>t=o),h.setSelection(eT(e,m,h.doc.resolve(t)))}e.focus(),e.dispatch(h.setMeta("uiEvent","drop"))}(e,o,e.dragging)}finally{e.dragging=null}},eX.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ek(e)},20))},eX.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},eX.beforeinput=(e,t)=>{if(I&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,v(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},eQ)eX[e]=eQ[e];function tp(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class tm{constructor(e,t){this.toDOM=e,this.spec=t||tb,this.side=this.spec.side||0}map(e,t,n,i){let{pos:o,deleted:r}=e.mapResult(t.from+i,this.side<0?-1:1);return r?null:new tv(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof tm&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&tp(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tg{constructor(e,t){this.attrs=e,this.spec=t||tb}map(e,t,n,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,r=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return o>=r?null:new tv(o,r,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof tg&&tp(this.attrs,e.attrs)&&tp(this.spec,e.spec)}static is(e){return e.type instanceof tg}destroy(){}}class ty{constructor(e,t){this.attrs=e,this.spec=t||tb}map(e,t,n,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let r=e.mapResult(t.to+i,-1);return r.deleted||r.pos<=o.pos?null:new tv(o.pos-n,r.pos-n,this)}valid(e,t){let{index:n,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(n)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof ty&&tp(this.attrs,e.attrs)&&tp(this.spec,e.spec)}destroy(){}}class tv{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new tv(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new tv(e,e,new tm(t,n))}static inline(e,t,n,i){return new tv(e,t,new tg(n,i))}static node(e,t,n,i){return new tv(e,t,new ty(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof tg}get widget(){return this.type instanceof tm}}let tw=[],tb={};class tS{constructor(e,t){this.local=e.length?e:tw,this.children=t.length?t:tw}static create(e,t){return t.length?tD(t,e,0,tb):tk}find(e,t,n){let i=[];return this.findInner(null==e?0:e,null==t?1e9:t,i,0,n),i}findInner(e,t,n,i,o){for(let r=0;r<this.local.length;r++){let s=this.local[r];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+i,s.to+i))}for(let r=0;r<this.children.length;r+=3)if(this.children[r]<t&&this.children[r+1]>e){let s=this.children[r]+1;this.children[r+2].findInner(e-s,t-s,n,i+s,o)}}map(e,t,n){return this==tk||0==e.maps.length?this:this.mapInner(e,t,0,0,n||tb)}mapInner(e,t,n,i,o){let r;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,i);l&&l.type.valid(t,l)?(r||(r=[])).push(l):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,i,o,r,s){let l=e.slice();for(let e=0,t=r;e<n.maps.length;e++){let i=0;n.maps[e].forEach((e,n,o,r)=>{let s=r-o-(n-e);for(let o=0;o<l.length;o+=3){let r=l[o+1];if(r<0||e>r+t-i)continue;let a=l[o]+t-i;n>=a?l[o+1]=e<=a?-2:-1:e>=t&&s&&(l[o]+=s,l[o+1]+=s)}i+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let c=n.map(e[t]+r),d=c-o;if(d<0||d>=i.content.size){a=!0;continue}let h=n.map(e[t+1]+r,-1)-o,{index:u,offset:f}=i.content.findIndex(d),p=i.maybeChild(u);if(p&&f==d&&f+p.nodeSize==h){let i=l[t+2].mapInner(n,p,c+1,e[t]+r+1,s);i!=tk?(l[t]=d,l[t+1]=h,l[t+2]=i):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=tD(function(e,t,n,i,o,r,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,r){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(i,o,r);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+r+1)}(e[l+2],t[l]+r+1);return n}(l,e,t,n,o,r,s),i,0,s);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new tS(t.sort(tO),l)}(this.children,r||[],e,t,n,i,o):r?new tS(r.sort(tO),tw):tk}add(e,t){return t.length?this==tk?tS.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,o=0;e.forEach((e,r)=>{let s=r+n,l;if(l=tN(t,e,s)){for(i||(i=this.children.slice());o<i.length&&i[o]<r;)o+=3;i[o]==r?i[o+2]=i[o+2].addInner(e,l,s+1):i.splice(o,0,r,r+e.nodeSize,tD(l,e,s+1,tb)),o+=3}});let r=tx(o?tM(t):t,-n);for(let t=0;t<r.length;t++)r[t].type.valid(e,r[t])||r.splice(t--,1);return new tS(r.length?this.local.concat(r).sort(tO):this.local,i||this.children)}remove(e){return 0==e.length||this==tk?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let i=0;i<n.length;i+=3){let o,r=n[i]+t,s=n[i+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>r&&n.to<s&&(e[t]=null,(o||(o=[])).push(n));if(!o)continue;n==this.children&&(n=this.children.slice());let l=n[i+2].removeInner(o,r+1);l!=tk?n[i+2]=l:(n.splice(i,3),i-=3)}if(i.length){for(let n=0,o;n<e.length;n++)if(o=e[n])for(let e=0;e<i.length;e++)i[e].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new tS(i,n):tk}forChild(e,t){let n,i;if(this==tk)return this;if(t.isLeaf)return tS.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,r=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<r&&t.to>o&&t.type instanceof tg){let e=Math.max(o,t.from)-o,n=Math.min(r,t.to)-o;e<n&&(i||(i=[])).push(t.copy(e,n))}}if(i){let e=new tS(i.sort(tO),tw);return n?new tC([e,n]):e}return n||tk}eq(e){if(this==e)return!0;if(!(e instanceof tS)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return tT(this.localsInner(e))}localsInner(e){if(this==tk)return tw;if(e.inlineContent||!this.local.some(tg.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof tg||t.push(this.local[e]);return t}forEachSet(e){e(this)}}tS.empty=new tS([],[]),tS.removeOverlap=tT;let tk=tS.empty;class tC{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,tb));return tC.from(n)}forChild(e,t){if(t.isLeaf)return tS.empty;let n=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=tk&&(o instanceof tC?n=n.concat(o.members):n.push(o))}return tC.from(n)}eq(e){if(!(e instanceof tC)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?tT(n?t:t.sort(tO)):tw}static from(e){switch(e.length){case 0:return tk;case 1:return e[0];default:return new tC(e.every(e=>e instanceof tS)?e:e.reduce((e,t)=>e.concat(t instanceof tS?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function tx(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let o=e[i];n.push(new tv(o.from+t,o.to+t,o.type))}return n}function tN(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,o=null;for(let t=0,r;t<e.length;t++)(r=e[t])&&r.from>n&&r.to<i&&((o||(o=[])).push(r),e[t]=null);return o}function tM(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function tD(e,t,n,i){let o=[],r=!1;t.forEach((t,s)=>{let l=tN(e,t,s+n);if(l){r=!0;let e=tD(l,t,n+s+1,i);e!=tk&&o.push(s,s+t.nodeSize,e)}});let s=tx(r?tM(e):e,-n).sort(tO);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(i.onRemove&&i.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new tS(s,o):tk}function tO(e,t){return e.from-t.from||e.to-t.to}function tT(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let o=n+1;o<t.length;o++){let r=t[o];if(r.from==i.from){r.to!=i.to&&(t==e&&(t=e.slice()),t[o]=r.copy(r.from,i.to),tA(t,o+1,r.copy(i.to,r.to)));continue}r.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,r.from),tA(t,o,i.copy(r.from,i.to)));break}}return t}function tA(e,t,n){for(;t<e.length&&tO(n,e[t])>0;)t++;e.splice(t,0,n)}function tP(e){let t=[];return e.someProp("decorations",n=>{let i=n(e.state);i&&i!=tk&&t.push(i)}),e.cursorWrapper&&t.push(tS.create(e.state.doc,[e.cursorWrapper.deco])),tC.from(t)}let tE={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tV=N&&M<=11;class tR{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class tI{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tR,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);N&&M<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():P&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),tV&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,tE)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(eA(this.view)){if(this.suppressingSelectionUpdates)return ek(this.view);if(N&&M<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&c(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=r(n))t.add(n);for(let i=e.anchorNode;i;i=r(i))if(t.has(i)){n=i;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:p(n)?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let i=this.pendingRecords();i.length&&(this.queue=[]);let o=n.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&eA(n)&&!this.ignoreSelectionChange(o),s=-1,l=-1,a=!1,c=[];if(n.editable)for(let e=0;e<i.length;e++){let t=this.registerMutation(i[e],c);t&&(s=s<0?t.from:Math.min(t.from,s),l=l<0?t.to:Math.max(t.to,l),t.typeOver&&(a=!0))}if(c.some(e=>"BR"==e.nodeName)&&(8==n.input.lastKeyCode||46==n.input.lastKeyCode||T&&(n.composing||n.input.compositionEndedAt>Date.now()-50)&&i.some(e=>"childList"==e.type&&e.removedNodes.length))){for(let e of c)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&f(t);){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(D&&c.length){let e=c.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:t}=this.currentSelection;for(let i of e){let e=i.parentNode;e&&"LI"==e.nodeName&&(!t||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(n,t)!=e)&&i.remove()}}}let d=null;s<0&&r&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&y(o)&&(d=eb(n))&&d.eq(t.Selection.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,ek(n),this.currentSelection.set(o),n.scrollToSelection()):(s>-1||r)&&(s>-1&&(n.docView.markDirty(s,l),e=n,!tB.has(e)&&(tB.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=D,tz||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),tz=!0))),n.input.badSafariComposition&&(n.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:i,focusOffset:o}=e.domSelectionRange();for(let r of t)if((null==(n=r.parentNode)?void 0:n.nodeName)=="TR"){let t=r.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||!f(e)||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(r,n.firstChild),i==r&&e.domSelection().collapse(r,o)}else r.parentNode.removeChild(r)}}(n,c)),this.handleDOMChange(s,l,a,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(o)||ek(n),this.currentSelection.set(o))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let i=e.addedNodes[n];t.push(i),p(i)&&(this.lastChangedTextNode=i)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,r=e.nextSibling;if(N&&M<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(i=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(r=o)}let s=i&&i.parentNode==e.target?o(i)+1:0,l=n.localPosFromDOM(e.target,s,-1),a=r&&r.parentNode==e.target?o(r):e.target.childNodes.length;return{from:l,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let tB=new WeakMap,tz=!1;function tF(e,t){let n=t.startContainer,i=t.startOffset,o=t.endContainer,r=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return c(s.node,s.offset,o,r)&&([n,i,o,r]=[o,r,n,i]),{anchorNode:n,anchorOffset:i,focusNode:o,focusOffset:r}}let tL=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function tj(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:eT(e,t.resolve(n.anchor),t.resolve(n.head))}function t$(e,t,n){let i=e.depth,o=t?e.end():e.pos;for(;i>0&&(t||e.indexAfter(i)==e.node(i).childCount);)i--,o++,t=!1;if(n){let t=e.node(i).maybeChild(e.indexAfter(i));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class tW{constructor(e,i){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new e1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=i,this.state=i.state,this.directPlugins=i.plugins||[],this.directPlugins.forEach(tU),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=t_(this),tq(this),this.nodeViews=tH(this),this.docView=es(this.state.doc,tK(this),tP(this),this.dom,this),this.domObserver=new tI(this,(e,i,o,r)=>(function(e,i,o,r,s){var l,a,c;let d,h,u,p,g,w=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,i<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=eb(e,t);if(n&&!e.state.selection.eq(n)){if(T&&I&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,v(13,"Enter"))))return;let i=e.state.tr.setSelection(n);"pointer"==t?i.setMeta("pointer",!0):"key"==t&&i.scrollIntoView(),w&&i.setMeta("composition",w),e.dispatch(i)}return}let b=e.state.doc.resolve(i),S=b.sharedDepth(o);i=b.before(S+1),o=e.state.doc.resolve(o).after(S+1);let k=e.state.selection,C=function(e,t,i,o){let r,s,{node:l,fromOffset:a,toOffset:c,from:d,to:h}=e.docView.parseRange(t,i),u=e.domSelectionRange(),f=u.anchorNode;if(f&&m(e.dom,f)&&(s=[{node:f,offset:u.anchorOffset}],y(u)||s.push({node:u.focusNode,offset:u.focusOffset})),T&&8===e.input.lastKeyCode)for(let e=c;e>a;e--){let t=l.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){c=e;break}if(!n||n.size)break}let p=e.state.doc,g=e.someProp("domParser")||n.p.fromSchema(e.state.schema),v=p.resolve(d),w=null,b=g.parse(l,{topNode:v.parent,topMatch:v.parent.contentMatchAt(v.index()),topOpen:!0,from:a,to:c,preserveWhitespace:"pre"!=v.parent.type.whitespace||"full",findPositions:s,ruleFromNode:(r=o,e=>{let t=e.pmViewDesc;if(t)return t.parseRule(r);if("BR"==e.nodeName&&e.parentNode){if(P&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||P&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}),context:v});if(s&&null!=s[0].pos){let e=s[0].pos,t=s[1]&&s[1].pos;null==t&&(t=e),w={anchor:e+d,head:t+d}}return{doc:b,sel:w,from:d,to:h}}(e,i,o,s),x=e.state.doc,D=x.slice(C.from,C.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,p="end"):(u=e.state.selection.from,p="start"),e.input.lastKeyCode=null;let O=function(e,t,n,i,o){let r=e.findDiffStart(t,n),s=n+e.size,l=n+t.size;if(null==r)return null;let{a:a,b:c}=e.findDiffEnd(t,s,l);if("end"==o){let e=Math.max(0,r-Math.min(a,c));i-=a+e-r}if(a<r&&s<l){let e=i<=r&&i>=a?r-i:0;r-=e,c=r+(c-a),a=r}else if(c<r){let e=i<=r&&i>=c?r-i:0;r-=e,a=r+(a-c),c=r}return{start:r,endA:a,endB:c}}(D.content,C.doc.content,C.from,u,p);if(O&&e.input.domChangeCount++,(E&&e.input.lastIOSEnter>Date.now()-225||I)&&s.some(e=>f(e)&&!tL.test(e.nodeName))&&(!O||O.endA>=O.endB)&&e.someProp("handleKeyDown",t=>t(e,v(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!O)if(r&&k instanceof t.TextSelection&&!k.empty&&k.$head.sameParent(k.$anchor)&&!e.composing&&!(C.sel&&C.sel.anchor!=C.sel.head))O={start:k.from,endA:k.to,endB:k.to};else{if(C.sel){let t=tj(e,e.state.doc,C.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);w&&n.setMeta("composition",w),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&O.start==O.endB&&e.state.selection instanceof t.TextSelection&&(O.start>e.state.selection.from&&O.start<=e.state.selection.from+2&&e.state.selection.from>=C.from?O.start=e.state.selection.from:O.endA<e.state.selection.to&&O.endA>=e.state.selection.to-2&&e.state.selection.to<=C.to&&(O.endB+=e.state.selection.to-O.endA,O.endA=e.state.selection.to)),N&&M<=11&&O.endB==O.start+1&&O.endA==O.start&&O.start>C.from&&" "==C.doc.textBetween(O.start-C.from-1,O.start-C.from+1)&&(O.start--,O.endA--,O.endB--);let A=C.doc.resolveNoCache(O.start-C.from),V=C.doc.resolveNoCache(O.endB-C.from),R=x.resolve(O.start),B=A.sameParent(V)&&A.parent.inlineContent&&R.end()>=O.endA;if((E&&e.input.lastIOSEnter>Date.now()-225&&(!B||s.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!B&&(l=C.doc,a=A.pos,c=V.pos,d=0,h=0,l.nodesBetween(a,c,(e,t)=>{e.isTextblock&&t>=a&&t<c?d++:(e.isText?/\S/.test(e.text.slice(Math.max(0,a-t),Math.min(e.nodeSize,c-t))):e.isLeaf)&&h++}),0==h&&1==d))&&e.someProp("handleKeyDown",t=>t(e,v(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>O.start&&function(e,t,n,i,o){if(n-t<=o.pos-i.pos||t$(i,!0,!1)<o.pos)return!1;let r=e.resolve(t);if(!i.parent.isTextblock){let e=r.nodeAfter;return null!=e&&n==t+e.nodeSize}if(r.parentOffset<r.parent.content.size||!r.parent.isTextblock)return!1;let s=e.resolve(t$(r,!0,!0));return!(!s.parent.isTextblock||s.pos>n||t$(s,!0,!1)<n)&&i.parent.content.cut(i.parentOffset).eq(s.parent.content)}(x,O.start,O.endA,A,V)&&e.someProp("handleKeyDown",t=>t(e,v(8,"Backspace")))){I&&T&&e.domObserver.suppressSelectionUpdates();return}T&&O.endB==O.start&&(e.input.lastChromeDelete=Date.now()),I&&!B&&A.start()!=V.start()&&0==V.parentOffset&&A.depth==V.depth&&C.sel&&C.sel.anchor==C.sel.head&&C.sel.head==O.endA&&(O.endB-=2,V=C.doc.resolveNoCache(O.endB-C.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,v(13,"Enter"))})},20));let z=O.start,F=O.endA,L=t=>{let n=t||e.state.tr.replace(z,F,C.doc.slice(O.start-C.from,O.endB-C.from));if(C.sel){let t=tj(e,n.doc,C.sel);t&&!(T&&e.composing&&t.empty&&(O.start!=O.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==z||t.head==n.mapping.map(F)-1)||N&&t.empty&&t.head==z)&&n.setSelection(t)}return w&&n.setMeta("composition",w),n.scrollIntoView()};if(B)if(A.pos==V.pos){N&&M<=11&&0==A.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ek(e),20));let t=L(e.state.tr.delete(z,F)),n=x.resolve(O.start).marksAcross(x.resolve(O.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(O.endA==O.endB&&(g=function(e,t){let i=e.firstChild.marks,o=t.firstChild.marks,r=i,s=o,l,a,c;for(let e=0;e<o.length;e++)r=o[e].removeFromSet(r);for(let e=0;e<i.length;e++)s=i[e].removeFromSet(s);if(1==r.length&&0==s.length)a=r[0],l="add",c=e=>e.mark(a.addToSet(e.marks));else{if(0!=r.length||1!=s.length)return null;a=s[0],l="remove",c=e=>e.mark(a.removeFromSet(e.marks))}let d=[];for(let e=0;e<t.childCount;e++)d.push(c(t.child(e)));if(n.y.from(d).eq(e))return{mark:a,type:l}}(A.parent.content.cut(A.parentOffset,V.parentOffset),R.parent.content.cut(R.parentOffset,O.endA-R.start())))){let t=L(e.state.tr);"add"==g.type?t.addMark(z,F,g.mark):t.removeMark(z,F,g.mark),e.dispatch(t)}else if(A.parent.child(A.index()).isText&&A.index()==V.index()-!V.textOffset){let t=A.parent.textBetween(A.parentOffset,V.parentOffset),n=()=>L(e.state.tr.insertText(t,z,F));e.someProp("handleTextInput",i=>i(e,z,F,t,n))||e.dispatch(n())}else e.dispatch(L());else e.dispatch(L())})(this,e,i,o,r)),this.domObserver.start();var o=this;for(let e in eX){let t=eX[e];o.dom.addEventListener(e,o.input.eventHandlers[e]=e=>{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(o,e)||e6(o,e)||!o.editable&&e.type in eQ||t(o,e)},e0[e]?{passive:!0}:void 0)}P&&o.dom.addEventListener("input",()=>null),e3(o),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&e3(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(tU),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,i,r;let s=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(ts(this),a=!0),this.state=e;let d=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(d||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=tH(this);(function(e,t){let n=0,i=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let e in t)i++;return n!=i})(e,this.nodeViews)&&(this.nodeViews=e,l=!0)}(d||t.handleDOMEvents!=this._props.handleDOMEvents)&&e3(this),this.editable=t_(this),tq(this);let h=tP(this),m=tK(this),y=s.plugins==e.plugins||s.doc.eq(e.doc)?e.scrollToSelection>s.scrollToSelection?"to selection":"preserve":"reset",v=l||!this.docView.matchesNode(e.doc,m,h);(v||!e.selection.eq(s.selection))&&(a=!0);let w="preserve"==y&&a&&null==this.dom.style.overflowAnchor&&function(e){let t,n,i=e.dom.getBoundingClientRect(),o=Math.max(0,i.top);for(let r=(i.left+i.right)/2,s=o+1;s<Math.min(innerHeight,i.bottom);s+=5){let i=e.root.elementFromPoint(r,s);if(!i||i==e.dom||!e.dom.contains(i))continue;let l=i.getBoundingClientRect();if(l.top>=o-20){t=i,n=l.top;break}}return{refDOM:t,refTop:n,stack:j(e.dom)}}(this);if(a){let t,n,a;this.domObserver.stop();let d=v&&(N||T)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&(i=s.selection,r=e.selection,a=Math.min(i.$anchor.sharedDepth(i.head),r.$anchor.sharedDepth(r.head)),i.$anchor.start(a)!=r.$anchor.start(a));if(v){let t=T?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(p(e)&&t)return e;if(f(e)&&t>0){if("false"==e.contentEditable)return null;t=u(e=e.childNodes[t-1])}else{if(!e.parentNode||g(e))return null;t=o(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),i=function(e,t){for(;;){if(p(e)&&t<e.nodeValue.length)return e;if(f(e)&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||g(e))return null;t=o(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&i&&n!=i){let t=i.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||i==o)return o;if(!t||!t.isText(i.nodeValue))return i;if(e.input.compositionNode==i){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return i}}return n||i}(this)),(l||!this.docView.update(e.doc,m,h,this))&&(this.docView.updateOuterDeco(m),this.docView.destroy(),this.docView=es(e.doc,m,h,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(d=!0)}let y=this.input.mouseDown;d||!(y&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),c(t.node,t.offset,n.anchorNode,n.anchorOffset))&&y.delaySelUpdate())?ek(this,d):(eD(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),(null==(n=this.dragging)?void 0:n.node)&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),"reset"==y?this.dom.scrollTop=0:"to selection"==y?this.scrollToSelection():w&&function({refDOM:e,refTop:t,stack:n}){let i=e?e.getBoundingClientRect().top:0;$(n,0==i?0:i-t)}(w)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&m(this.dom,e))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof t.NodeSelection){let t=this.docView.domAfterPos(this.state.selection.from);f(t)&&L(this,t.getBoundingClientRect(),e)}else L(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,n){let i=e.node,o=-1;if(i.from<this.state.doc.content.size&&this.state.doc.nodeAt(i.from)==i.node)o=i.from;else{let e=i.from+(this.state.doc.content.size-n.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==i.node&&(o=e)}this.dragging=new th(e.slice,e.move,o<0?void 0:t.NodeSelection.create(this.state.doc,o))}someProp(e,t){let n=this._props&&this._props[e],i;if(null!=n&&(i=t?t(n):n))return i;for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n].props[e];if(null!=o&&(i=t?t(o):o))return i}let o=this.state.plugins;if(o)for(let n=0;n<o.length;n++){let r=o[n].props[e];if(null!=r&&(i=t?t(r):r))return i}}hasFocus(){if(N){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(W)return e.focus(W);let t=j(e);e.focus(null==W?{get preventScroll(){return W={preventScroll:!0},!0}}:void 0),W||(W=!1,$(t,0))}(this.dom),ek(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let i,o,s=e.dom.ownerDocument,a,c=0,d=function(e,t,n){if(e.caretPositionFromPoint)try{let i=e.caretPositionFromPoint(t,n);if(i)return{node:i.offsetNode,offset:Math.min(u(i.offsetNode),i.offset)}}catch(e){}if(e.caretRangeFromPoint){let i=e.caretRangeFromPoint(t,n);if(i)return{node:i.startContainer,offset:Math.min(u(i.startContainer),i.startOffset)}}}(s,t.left,t.top);d&&({node:a,offset:c}=d);let h=(e.root.elementFromPoint?e.root:s).elementFromPoint(t.left,t.top);if(!h||!e.dom.contains(h)){let n=e.dom.getBoundingClientRect();if(!K(t,n)||!(h=function e(t,n,i){let o=t.childNodes.length;if(o&&i.top<i.bottom)for(let r=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-i.top)/(i.bottom-i.top))-2)),s=r;;){let i=t.childNodes[s];if(f(i)){let t=i.getClientRects();for(let o=0;o<t.length;o++){let r=t[o];if(K(n,r))return e(i,n,r)}}if((s=(s+1)%o)==r)break}return t}(e.dom,t,n)))return null}if(P)for(let e=h;a&&e;e=r(e))e.draggable&&(a=void 0);if(h=(i=(n=h).parentNode)&&/^li$/i.test(i.nodeName)&&t.left<n.getBoundingClientRect().left?i:n,a){let n;if(D&&f(a)&&(c=Math.min(c,a.childNodes.length))<a.childNodes.length){let e=a.childNodes[c],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&c++}B&&c&&f(a)&&f(n=a.childNodes[c-1])&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&c--,a==e.dom&&c==a.childNodes.length-1&&f(a.lastChild)&&t.top>a.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=c&&f(a)&&"BR"==a.childNodes[c-1].nodeName||(o=function(e,t,n,i){let o=-1;for(let n=t,r=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(f(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!r&&s.left>i.left||s.top>i.top?o=t.posBefore:(!r&&s.right<i.left||s.bottom<i.top)&&(o=t.posAfter),r=!0),!t.contentDOM&&o<0&&!t.node.isText))return(t.node.isBlock?i.top<(s.top+s.bottom)/2:i.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,a,c,t))}null==o&&(o=function(e,t,n){let{node:i,offset:o}=function e(t,n){let i,o,r,s=2e8,a,c=0,d=n.top,h=n.top;for(let e=t.firstChild,u=0;e;e=e.nextSibling,u++){let t;if(f(e))t=e.getClientRects();else{if(!p(e))continue;t=l(e).getClientRects()}for(let l=0;l<t.length;l++){let m=t[l];if(m.top<=d&&m.bottom>=h){d=Math.max(m.bottom,d),h=Math.min(m.top,h);let t=m.left>n.left?m.left-n.left:m.right<n.left?n.left-m.right:0;if(t<s){i=e,s=t,a=t&&p(i)?{left:m.right<n.left?m.right:m.left,top:n.top}:n,f(e)&&t&&(c=u+ +(n.left>=(m.left+m.right)/2));continue}}else m.top>n.top&&!o&&m.left<=n.left&&m.right>=n.left&&(o=e,r={left:Math.max(m.left,Math.min(m.right,n.left)),top:m.top});!i&&(n.left>=m.right&&n.top>=m.top||n.left>=m.left&&n.top>=m.bottom)&&(c=u+1)}}return(!i&&o&&(i=o,a=r,s=0),i&&p(i))?function(e,t){let n=e.nodeValue.length,i=document.createRange(),o;for(let r=0;r<n;r++){i.setEnd(e,r+1),i.setStart(e,r);let n=_(i,1);if(n.top!=n.bottom&&K(t,n)){o={node:e,offset:r+ +(t.left>=(n.left+n.right)/2)};break}}return i.detach(),o||{node:e,offset:0}}(i,a):!i||s?{node:t,offset:c}:e(i,a)}(t,n),r=-1;if(f(i)&&!i.firstChild){let e=i.getBoundingClientRect();r=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(i,o,r)}(e,h,t));let m=e.docView.nearestDesc(h,!0);return{pos:o,inside:m?m.posAtStart-m.border:-1}}(this,e)}coordsAtPos(e,t=1){return U(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(null==i)throw RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return function(e,t,n){let i,o;return X==t&&Q==n?ee:(X=t,Q=n,ee="up"==n||"down"==n?(i=t.selection,o="up"==n?i.$from:i.$to,Y(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let i=U(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(f(e))t=e.getClientRects();else{if(!p(e))continue;t=l(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?i.top-o.top>(o.bottom-i.top)*2:o.bottom-i.bottom>(i.bottom-o.top)*2))return!1}}return!0})):function(e,t,n){let{$head:i}=t.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,r=o==i.parent.content.size,s=e.domSelection();return s?Z.test(i.parent.textContent)&&s.modify?Y(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:r,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let c=i.depth?e.docView.domAfterPos(i.before()):e.dom,{focusNode:d,focusOffset:h}=e.domSelectionRange(),u=d&&!m(c,d)||t==d&&o==h;try{s.collapse(r,l),t&&(t!=r||o!=l)&&s.extend&&s.extend(t,o)}catch(e){}return null!=a&&(s.caretBidiLevel=a),u}):"left"==n||"backward"==n?!o:r:i.pos==i.start()||i.pos==i.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return tc(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return tc(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return eK(this,e)}destroy(){if(this.docView){for(let e in this.input.mouseDown&&this.input.mouseDown.done(),this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],tP(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,a()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!e6(this,e)&&eX[e.type]&&(this.editable||!(e.type in eQ))&&eX[e.type](this,e)}domSelectionRange(){let e=!1!==this.dom.isConnected&&this.domSelection();return e?P&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return tF(e,n)}function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",i,!0),n?tF(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function tK(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[tv.node(0,e.state.doc.content.size,t)]}function tq(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:tv.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function t_(e){return!e.someProp("editable",t=>!1===t(e.state))}function tH(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function tU(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}tW.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},e.s(["G",0,tv,"q",0,tS,"j",0,tW])}])})();
|